@wwawing/engine 4.0.6 → 4.0.8-fps-measure.based-on.4.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/wwa.js CHANGED
@@ -6,7 +6,7 @@ var WWA=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}
6
6
  よろしいですか?`,mapdataParams:{messageArea:`message`,index:5}},GAME_SPEED_CHANGED:{code:501,defaultText:`移動速度を【%GAME_SPEED_NAME%】に切り替えました。
7
7
  %HIGH_SPEED_MESSAGE%(%MAX_SPEED_INDEX%段階中%GAME_SPEED_INDEX%)
8
8
  速度を落とすには%SPEED_DOWN_BUTTON%, 速度を上げるには%SPEED_UP_BUTTON%を押してください。`},GAME_SPEED_CHANGE_DISABLED:{code:502,defaultText:`ここでは移動速度を
9
- 変更できません。`}}),h=Object.keys(m),g=h.reduce((e,t)=>({...e,[t]:t}),{}),_=m;function v(e){return h.some(t=>t===e)}function y(e){for(let t of h)if(_[t].code===e)return t}var b=class e{add(e){return this.strength+=e.strength,this.defence+=e.defence,this}plus(t){return new e(this.strength+t.strength,this.defence+t.defence)}minus(t){return new e(this.strength-t.strength,this.defence-t.defence)}equals(e){return this.strength===e.strength&&this.defence===e.defence}constructor(e,t){this.strength=e,this.defence=t}},x=class e extends b{add(t){return t instanceof e&&(this.energy+=t.energy,this.gold+=t.gold),this.strength+=t.strength,this.defence+=t.defence,this}plus(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)}minus(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)}equals(e){return this.energy===e.energy&&this.strength===e.strength&&this.defence===e.defence&&this.gold===e.gold}calculateScore(e){return Object.keys(e.rates).reduce((t,n)=>t+e.rates[n]*this[n],0)}clone(){return new e(this.energy,this.strength,this.defence,this.gold)}constructor(e,t,n,r){super(t,n),this.energy=e,this.gold=r}},S=class e{equals(e){return this.x===e.x&&this.y===e.y}substract(t){return new e(this.x-t.x,this.y-t.y)}clone(){return new e(this.x,this.y)}convertIntoPosition(e){return new C(e,this.x,this.y,0,0)}getDirectionTo(e){return this.x<e.x?this.y>e.y?9:this.y===e.y?6:3:this.x===e.x?this.y>e.y?8:this.y===e.y?5:2:this.y>e.y?7:this.y===e.y?4:1}toString(){return`(`+this.x+`, `+this.y+`)`}constructor(e=0,t=0){this.x=e,this.y=t}},C=class e{getPartsCoord(){return this._partsCoord}getOffsetCoord(){return this._offsetCoord}getScreenTopPosition(){var t=Math.floor(this._partsCoord.x/(R.H_PARTS_NUM_IN_WINDOW-1))*(R.H_PARTS_NUM_IN_WINDOW-1),n=Math.floor(this._partsCoord.y/(R.V_PARTS_NUM_IN_WINDOW-1))*(R.V_PARTS_NUM_IN_WINDOW-1);return new e(this._wwa,t,n,0,0)}getDefaultCameraPosition(){var e=this.getScreenTopPosition(),t=e.getPartsCoord(),n=this._wwa.getMapWidth(),r=e.getPartsCoord().clone();return t.x===n-1&&r.x--,t.y===n-1&&r.y--,r.convertIntoPosition(this._wwa).getScreenTopPosition()}getNextJustPosition(t){if(t!==void 0){var n=this._partsCoord;return new e(this._wwa,n.x+D[t],n.y+O[t],0,0)}var r=this._partsCoord.x,i=this._partsCoord.y;return this._offsetCoord.x<0?r--:this._offsetCoord.x>0&&r++,this._offsetCoord.y<0?i--:this._offsetCoord.y>0&&i++,new e(this._wwa,r,i,0,0)}getNextFramePosition(t,n,r){var i=this._partsCoord.x,a=this._partsCoord.y,o=this._offsetCoord.x+D[t]*n,s=this._offsetCoord.y+O[t]*r;if(o<0){var c=Math.floor(Math.abs(o)/R.CHIP_SIZE);i-=c,o=(o+c*R.CHIP_SIZE)%R.CHIP_SIZE}if(s<0){var l=Math.floor(Math.abs(s)/R.CHIP_SIZE);a-=l,s=(s+l*R.CHIP_SIZE)%R.CHIP_SIZE}return o>=R.CHIP_SIZE&&(i+=Math.floor(o/R.CHIP_SIZE),o=(o+R.CHIP_SIZE)%R.CHIP_SIZE),s>=R.CHIP_SIZE&&(a+=Math.floor(s/R.CHIP_SIZE),s=(s+R.CHIP_SIZE)%R.CHIP_SIZE),new e(this._wwa,i,a,o,s)}isJustPosition(){return this._offsetCoord.x==0&&this._offsetCoord.y==0}isScreenTopPosition(){var e=this.getScreenTopPosition();return this.equals(e)}equals(e){return this._partsCoord.equals(e.getPartsCoord())&&this._offsetCoord.equals(e.getOffsetCoord())}isInCameraRange(e,t=!1){var n=e.getPosition()._partsCoord,r=this._partsCoord.x,i=this._partsCoord.y,a=+!!t;return n.x<=r&&r<n.x+R.H_PARTS_NUM_IN_WINDOW-a&&n.y<=i&&i<n.y+R.V_PARTS_NUM_IN_WINDOW-a}hasLocalGate(){return this._wwa.getMapTypeByPosition(this)===R.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===R.OBJECT_LOCALGATE}clone(){return new e(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)}constructor(e,t,n,r=0,i=0){if(this._wwa=e,this._wwa===void 0)throw Error(`WWAのインスタンスが存在しません. `);var a=this._wwa.getMapWidth();if(t<0||t>=a||t>=a-1&&r>0||n<0||n>=a||n>=a-1&&i>0)throw Error(`範囲外の座標です!! parts:(`+t+`, `+n+`), offset:(`+r+`, `+i+`), mapWidth = `+a);this._partsCoord=new S(t,n),this._offsetCoord=new S(r,i)}},w=class{constructor(e,t,n){this.destPos=e.clone(),this.srcPos=t.clone(),this.srcSize=n.clone()}},ee=class{constructor(e,t,n,r,i){this.partsIDObj=e,this.x=t,this.y=n,this.isStatic=r,this.isFighting=i}},T=function(e){return e[e.GOTO_WWA=0]=`GOTO_WWA`,e[e.BATTLE_REPORT=1]=`BATTLE_REPORT`,e[e.GAME_END=2]=`GAME_END`,e}({}),E=function(e){return e[e.UNUSED=0]=`UNUSED`,e[e.LEFT=4]=`LEFT`,e[e.RIGHT=6]=`RIGHT`,e[e.DOWN=2]=`DOWN`,e[e.UP=8]=`UP`,e[e.LEFT_DOWN=1]=`LEFT_DOWN`,e[e.LEFT_UP=7]=`LEFT_UP`,e[e.RIGHT_DOWN=3]=`RIGHT_DOWN`,e[e.RIGHT_UP=9]=`RIGHT_UP`,e[e.NO_DIRECTION=5]=`NO_DIRECTION`,e}({}),D=[0,-1,0,1,-1,0,1,-1,0,1],O=[0,1,1,1,0,0,0,-1,-1,-1],k=function(e){return e[e.YES=0]=`YES`,e[e.NO=1]=`NO`,e[e.UNSELECTED=2]=`UNSELECTED`,e}({}),A=function(e){return e[e.MAP=0]=`MAP`,e[e.OBJECT=1]=`OBJECT`,e[e.CHOICE_YES=2]=`CHOICE_YES`,e[e.CHOICE_NO=3]=`CHOICE_NO`,e}({}),te=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.CAN_USE=1]=`CAN_USE`,e[e.NOT_DISAPPEAR=2]=`NOT_DISAPPEAR`,e}({}),j=function(e){return e[e.MAP=1]=`MAP`,e[e.OBJECT=0]=`OBJECT`,e}({}),M=class{constructor(){var e=window.navigator.userAgent;this.os=this._getOS(e),this.browser=this.getBrowser(e),this.device=this.getDevice()}_getOS(e){return e.match(/xbox/i)?9:e.match(/windows/i)?1:e.match(/macintosh/i)?`ontouchstart`in document?5:2:e.match(/iphone|ipad|ipod/i)?5:e.match(/oculus/i)?8:e.match(/android/i)?4:e.match(/nintendo/i)?6:e.match(/playstation/i)?7:e.match(/linux/i)?3:9999}getBrowser(e){return e.match(/chrome/i)?1:e.match(/firefox/i)?2:e.match(/safari/i)?3:9999}getDevice(){switch(this.os){case 1:case 2:case 3:return 1;case 5:case 4:return 2;case 8:return 3;case 6:case 7:case 9:return 4}return 9999}},ne=function(e){return e[e.WINDOWS=1]=`WINDOWS`,e[e.MACINTOSH=2]=`MACINTOSH`,e[e.LINUX=3]=`LINUX`,e[e.ANDROID=4]=`ANDROID`,e[e.IOS=5]=`IOS`,e[e.NINTENDO=6]=`NINTENDO`,e[e.PLAY_STATION=7]=`PLAY_STATION`,e[e.OCULUS=8]=`OCULUS`,e[e.XBOX=9]=`XBOX`,e[e.OTHERS=9999]=`OTHERS`,e}({}),re=function(e){return e[e.PC=1]=`PC`,e[e.SP=2]=`SP`,e[e.VR=3]=`VR`,e[e.GAME=4]=`GAME`,e[e.OTHERS=9999]=`OTHERS`,e}({}),ie=function(e){return e[e.CHROME=1]=`CHROME`,e[e.FIREFOX=2]=`FIREFOX`,e[e.SAFARI=3]=`SAFARI`,e[e.OTHERS=9999]=`OTHERS`,e}({}),N=function(e){return e[e.NONE=0]=`NONE`,e[e.CALL_BY_MAP_PARTS=1]=`CALL_BY_MAP_PARTS`,e[e.CALL_BY_OBJECT_PARTS=2]=`CALL_BY_OBJECT_PARTS`,e[e.CALL_BY_ITEM_USE=3]=`CALL_BY_ITEM_USE`,e[e.CALL_BY_QUICK_SAVE=4]=`CALL_BY_QUICK_SAVE`,e[e.CALL_BY_QUICK_LOAD=5]=`CALL_BY_QUICK_LOAD`,e[e.CALL_BY_RESTART_GAME=6]=`CALL_BY_RESTART_GAME`,e[e.CALL_BY_GOTO_WWA=7]=`CALL_BY_GOTO_WWA`,e[e.CALL_BY_PASSWORD_SAVE=8]=`CALL_BY_PASSWORD_SAVE`,e[e.CALL_BY_PASSWORD_LOAD=9]=`CALL_BY_PASSWORD_LOAD`,e[e.CALL_BY_END_GAME=10]=`CALL_BY_END_GAME`,e[e.CALL_BY_SUSPEND=11]=`CALL_BY_SUSPEND`,e[e.CALL_BY_LOG_QUICK_SAVE=12]=`CALL_BY_LOG_QUICK_SAVE`,e[e.CALL_BY_LOG_QUICK_LOAD=13]=`CALL_BY_LOG_QUICK_LOAD`,e}({}),P=function(e){return e[e.QUICK_LOAD=0]=`QUICK_LOAD`,e[e.QUICK_SAVE=1]=`QUICK_SAVE`,e[e.RESTART_GAME=2]=`RESTART_GAME`,e[e.GOTO_WWA=3]=`GOTO_WWA`,e}({}),ae=function(e){return e[e.UP=0]=`UP`,e[e.DOWN=1]=`DOWN`,e}({}),oe=function(e){return e[e.QUICK_LOAD=0]=`QUICK_LOAD`,e[e.RESTART_GAME=1]=`RESTART_GAME`,e[e.PASSWORD=2]=`PASSWORD`,e}({}),se=function(e){return e[e.STATIC=0]=`STATIC`,e[e.CHASE_PLAYER=1]=`CHASE_PLAYER`,e[e.RUN_OUT=2]=`RUN_OUT`,e[e.HANG_AROUND=3]=`HANG_AROUND`,e}({}),ce=function(e){return e[e.MODE_X=0]=`MODE_X`,e[e.MODE_Y=1]=`MODE_Y`,e[e.UNDECIDED=2]=`UNDECIDED`,e}({}),F=[`cell-load`,`cell-save`,`cell-restart`,`cell-gotowwa`],I=function(e){return e[e.UNDEFINED=0]=`UNDEFINED`,e[e.IMGPLAYER=1]=`IMGPLAYER`,e[e.IMGYESNO=2]=`IMGYESNO`,e[e.HPMAX=3]=`HPMAX`,e[e.SAVE=4]=`SAVE`,e[e.ITEM=5]=`ITEM`,e[e.DEFAULT=6]=`DEFAULT`,e[e.OLDMAP=7]=`OLDMAP`,e[e.PARTS=8]=`PARTS`,e[e.MOVE=9]=`MOVE`,e[e.MAP=10]=`MAP`,e[e.DIRMAP=11]=`DIRMAP`,e[e.IMGFRAME=12]=`IMGFRAME`,e[e.IMGBOM=13]=`IMGBOM`,e[e.DELPLAYER=14]=`DELPLAYER`,e[e.FACE=15]=`FACE`,e[e.EFFECT=16]=`EFFECT`,e[e.GAMEOVER=17]=`GAMEOVER`,e[e.IMGCLICK=18]=`IMGCLICK`,e[e.STATUS=19]=`STATUS`,e[e.EFFITEM=20]=`EFFITEM`,e[e.COLOR=21]=`COLOR`,e[e.WAIT=22]=`WAIT`,e[e.SOUND=23]=`SOUND`,e[e.JUMPGATE=24]=`JUMPGATE`,e[e.RECPOSITION=25]=`RECPOSITION`,e[e.JUMPRECPOSITION=26]=`JUMPRECPOSITION`,e[e.CONSOLE_LOG=27]=`CONSOLE_LOG`,e[e.COPY_HP_TO=28]=`COPY_HP_TO`,e[e.SET_HP=29]=`SET_HP`,e[e.COPY_HPMAX_TO=30]=`COPY_HPMAX_TO`,e[e.SET_HPMAX=31]=`SET_HPMAX`,e[e.COPY_AT_TO=32]=`COPY_AT_TO`,e[e.SET_AT=33]=`SET_AT`,e[e.COPY_DF_TO=34]=`COPY_DF_TO`,e[e.SET_DF=35]=`SET_DF`,e[e.COPY_MONEY_TO=36]=`COPY_MONEY_TO`,e[e.SET_MONEY=37]=`SET_MONEY`,e[e.COPY_STEP_COUNT_TO=38]=`COPY_STEP_COUNT_TO`,e[e.VAR_SET_VAL=39]=`VAR_SET_VAL`,e[e.VAR_SET=40]=`VAR_SET`,e[e.VAR_ADD=41]=`VAR_ADD`,e[e.VAR_SUB=42]=`VAR_SUB`,e[e.VAR_MUL=43]=`VAR_MUL`,e[e.VAR_DIV=44]=`VAR_DIV`,e[e.VAR_SET_RAND=45]=`VAR_SET_RAND`,e[e.SHOW_STR=46]=`SHOW_STR`,e[e.GAME_SPEED=47]=`GAME_SPEED`,e[e.IF=50]=`IF`,e[e.SET_SPEED=51]=`SET_SPEED`,e[e.COPY_TIME_TO=52]=`COPY_TIME_TO`,e[e.HIDE_STATUS=53]=`HIDE_STATUS`,e[e.VAR_MAP=54]=`VAR_MAP`,e[e.VAR_MOD=55]=`VAR_MOD`,e[e.NO_GAMEOVER=56]=`NO_GAMEOVER`,e[e.ELSE_IF=57]=`ELSE_IF`,e[e.ELSE=58]=`ELSE`,e[e.END_IF=59]=`END_IF`,e[e.SET=60]=`SET`,e[e.MAP2=61]=`MAP2`,e[e.SHOW_STR2=62]=`SHOW_STR2`,e[e.CONSOLE_LOG2=63]=`CONSOLE_LOG2`,e[e.DELAYBGM=64]=`DELAYBGM`,e[e.SYSMSG=65]=`SYSMSG`,e[e.PICTURE=66]=`PICTURE`,e[e.GAMEPAD_BUTTON=100]=`GAMEPAD_BUTTON`,e[e.OLDMOVE=101]=`OLDMOVE`,e[e.LEGACY_IF=10050]=`LEGACY_IF`,e}({}),le={"":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,$picture:66,$gamepad_button:100,$oldmove:101},ue=function(e){return e[e.ENERGY=0]=`ENERGY`,e[e.STRENGTH=1]=`STRENGTH`,e[e.DEFENCE=2]=`DEFENCE`,e[e.GOLD=3]=`GOLD`,e[e.MOVES=4]=`MOVES`,e}({}),L=function(e){return e[e.ENERGY=0]=`ENERGY`,e[e.STRENGTH=1]=`STRENGTH`,e[e.DEFENCE=2]=`DEFENCE`,e[e.GOLD=3]=`GOLD`,e[e.WIDE_CELL_ROW=4]=`WIDE_CELL_ROW`,e[e.ITEM_BG=5]=`ITEM_BG`,e[e.MAIN_FRAME=6]=`MAIN_FRAME`,e}({}),de=[1,2,5,8,10,20],fe=[`超低速`,`低速`,`準低速`,`中速`,`高速`,`超高速`],pe=[`energy`,`strength`,`defence`,`gold`],R=class e{static{this.WWA_HOME=`http://wwajp.com`}static{this.ITEMBOX_SIZE=12}static{this.MAP_ATR_MAX=60}static{this.OBJ_ATR_MAX=60}static{this.OLD_MAP_ATR_MAX=40}static{this.OLD_OBJ_ATR_MAX=40}static{this.ATR_TYPE=3}static{this.ATR_MODE=4}static{this.ATR_STRING=5}static{this.ATR_X=6}static{this.ATR_Y=7}static{this.ATR_X2=8}static{this.ATR_Y2=9}static{this.ATR_ENERGY=10}static{this.ATR_STRENGTH=11}static{this.ATR_DEFENCE=12}static{this.ATR_GOLD=13}static{this.ATR_ITEM=14}static{this.ATR_NUMBER=15}static{this.ATR_JUMP_X=16}static{this.ATR_MOVE=16}static{this.ATR_JUMP_Y=17}static{this.ATR_SOUND=19}static{this.ATR_APPERANCE_BASE=20}static{this.REL_ATR_APPERANCE_ID=0}static{this.REL_ATR_APPERANCE_X=1}static{this.REL_ATR_APPERANCE_Y=2}static{this.REL_ATR_APPERANCE_TYPE=3}static{this.REL_ATR_APPERANCE_UNIT_LENGTH=4}static{this.ATR_RANDOM_BASE=10}static{this.RANDOM_ATR_NUM=10}static{this.RANDOM_ITERATION_MAX=10}static{this.MAP_STREET=0}static{this.MAP_WALL=1}static{this.MAP_LOCALGATE=2}static{this.MAP_URLGATE=4}static{this.OBJECT_NORMAL=0}static{this.OBJECT_MESSAGE=1}static{this.OBJECT_URLGATE=2}static{this.OBJECT_STATUS=3}static{this.OBJECT_ITEM=4}static{this.OBJECT_DOOR=5}static{this.OBJECT_MONSTER=6}static{this.OBJECT_SCORE=11}static{this.OBJECT_SELL=14}static{this.OBJECT_BUY=15}static{this.OBJECT_RANDOM=16}static{this.OBJECT_SELECT=17}static{this.OBJECT_LOCALGATE=18}static{this.SYSTEM_MESSAGE_NUM=20}static{this.IMGPOS_DEFAULT_YESNO_X=3}static{this.IMGPOS_DEFAULT_YESNO_Y=1}static{this.IMGRELPOS_YESNO_YES_X=0}static{this.IMGRELPOS_YESNO_NO_X=1}static{this.IMGRELPOS_YESNO_YESP_X=2}static{this.IMGRELPOS_YESNO_NOP_X=3}static{this.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0}static{this.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0}static{this.IMGPOS_DEFAULT_FRAME_X=0}static{this.IMGPOS_DEFAULT_FRAME_Y=1}static{this.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3}static{this.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3}static{this.DEFAULT_DISABLE_SAVE=!1}static{this.DEFAULT_OLDMAP=!1}static{this.DEFAULT_OBJECT_NO_COLLAPSE=!1}static{this.SPLASH_SCREEN_DISP_MILLS=100}static{this.DEFAULT_FRAME_INTERVAL=20}static{this.GAMEOVER_FRAME_INTERVAL=50}static{this.YESNO_PRESS_DISP_FRAME_NUM=20}static{this.WAIT_TIME_FRAME_NUM=6}static{this.CHIP_SIZE=40}static{this.MAP_WINDOW_WIDTH=440}static{this.MAP_WINDOW_HEIGHT=440}static{this.H_PARTS_NUM_IN_WINDOW=e.MAP_WINDOW_WIDTH/e.CHIP_SIZE}static{this.V_PARTS_NUM_IN_WINDOW=e.MAP_WINDOW_HEIGHT/e.CHIP_SIZE}static{this.MIN_SPEED_INDEX=0}static{this.MAX_SPEED_INDEX=de.length-1}static{this.QUICK_BATTLE_SPEED_INDECIES=[de.length-2,de.length-1]}static{this.ANIMATION_REP_HALF_FRAME=22}static{this.PLAYER_LOOKING_AROUND_START_FRAME=e.ANIMATION_REP_HALF_FRAME*4}static{this.RELATIVE_COORD_BIAS=1e4}static{this.RELATIVE_COORD_LOWER=e.RELATIVE_COORD_BIAS-1e3}static{this.PLAYER_COORD=e.RELATIVE_COORD_BIAS-1e3}static{this.LOCALGATE_PLAYER_WAIT_FRAME=5}static{this.STATUS_CHANGED_EFFECT_FRAME_NUM=20}static{this.PASSABLE_OBJECT=1}static{this.APPERANCE_PARTS_MIN_INDEX=0}static{this.APPERANCE_PARTS_MAX_INDEX=9}static{this.APPERANCE_PARTS_MIN_INDEX_NO=5}static{this.APPERANCE_PARTS_MAX_INDEX_YES=4}static{this.FADEOUT_SPEED=8}static{this.STATUS_MINUS_BORDER=3e4}static{this.ITEMBOX_IS_FULL=-1}static{this.BATTLE_INTERVAL_FRAME_NUM=10}static{this.BATTLE_SPEED_CHANGE_TURN_NUM=40}static{this.RANDOM_MOVE_ITERATION_NUM=50}static{this.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31=8}static{this.BATTLE_ESTIMATE_MONSTER_TYPE_MAX=8}static{this.SOUND_MAX=100}static{this.ITEM_BORDER_IMG_DATA_URL=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAArklEQVRYR+2Y0QqAIAxFt///aENJHwxxuJUSxzeh3S7HXaNpEkly4FIRzba0GEyHeVTN7jqDWvb7V4Y1NLibZIY0NbiL5G3MZLCe / 1fn3XJgJYjB7mgg6O1VCEKwXo79JeklY62nB62kRs9BEIKkeNIDhISQEBJC4k0BBCF4D7D4cV9shf99ixdB + MrM0y3fa3zV05D45GOqhwPMGPkYlccIOEY2VKUN0UNVXxC7ADj7mDi9aFZZAAAAAElFTkSuQmCC`}static{this.LOAD_STAGE_MAX_EXCEPT_AUDIO=7}static{this.WWA_STYLE_TAG_ID=`wwa-additional-style`}static{this.DEFAULT_FRAME_COLOR_R=255}static{this.DEFAULT_FRAME_COLOR_G=255}static{this.DEFAULT_FRAME_COLOR_B=255}static{this.DEFAULT_FRAMEOUT_COLOR_R=96}static{this.DEFAULT_FRAMEOUT_COLOR_G=96}static{this.DEFAULT_FRAMEOUT_COLOR_B=96}static{this.DEFAULT_STRBACK_COLOR_R=0}static{this.DEFAULT_STRBACK_COLOR_G=0}static{this.DEFAULT_STRBACK_COLOR_B=0}static{this.DEFAULT_STATUS_COLOR_R=0}static{this.DEFAULT_STATUS_COLOR_G=0}static{this.DEFAULT_STATUS_COLOR_B=0}static{this.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM=20}static{this.WWAP_SERVER_OLD=`http://wwawing.com/wwap`}static{this.WWAP_SERVER=`https://wwaphoenix.github.io`}static{this.WWAP_SERVER_AUDIO_DIR=`audio`}static{this.WWAP_SERVER_TITLE_IMG=`cover_p.gif`}static{this.WWAP_SERVER_LOADER_NO_WORKER=`wwaload.noworker.js`}static{this.SCREEN_WIDTH=560}static{this.SCREEN_HEIGHT=440}static{this.LOADING_FONT=`Times New Roman`}static{this.MSG_STR_WIDTH=16}static{this.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME=20}static{this.ITEMBOX_TOP_Y=140}static{this.USER_VAR_NUM=256}static{this.USER_VAR_NUM_MAX_VALUE=9007199254740991}static{this.USET_VAR_NUM_MIN_VALUE=-9007199254740991}static{this.CONTROLL_WAIT_FRAME=6}static{this.INLINE_USER_VAR_VIEWER_DISPLAY_NUM=10}static{this.FIGHT_DRAW_TURN=40}},me=class{static{this.QUICK_SAVE_MAX=4}static{this.QUICK_SAVE_THUMNAIL_WIDTH=99}static{this.QUICK_SAVE_THUMNAIL_HEIGHT=99}static{this.SAVE_INTERVAL_MOVE=200}static{this.INDEXEDDB_DB_NAME=`WWA_WING_DB`}static{this.INDEXEDDB_TABLE_NAME=`SAVE_TABLE`}static{this.DATE_LAST_SAVE_TEXT_COLOR=`rgba(255,255,0,1)`}},he=class{static{this.EMPTY_LOAD=``}static{this.EMPTY_SAVE=``}static{this.PASSWORD=`Password`}static{this.QUICK_SAVE=`Quick Save`}static{this.QUICK_LOAD=`Quick Load`}static{this.BATTLE_REPORT=`Battle Report`}static{this.GAME_END=`Game End`}static{this.GOTO_WWA=`Goto WWA`}static{this.RESTART_GAME=`Restart Game`}},ge=class{},_e=function(e){return e[e.INIT=0]=`INIT`,e[e.MAP_LOAD=1]=`MAP_LOAD`,e[e.OBJ_LOAD=2]=`OBJ_LOAD`,e[e.MAP_ATTR=3]=`MAP_ATTR`,e[e.OBJ_ATTR=4]=`OBJ_ATTR`,e[e.RAND_PARTS=5]=`RAND_PARTS`,e[e.MESSAGE=6]=`MESSAGE`,e[e.GAME_INIT=7]=`GAME_INIT`,e[e.AUDIO=8]=`AUDIO`,e[e.FINISH=9]=`FINISH`,e}({}),ve=[`ロードの準備をしています。`,`背景パーツを読み込んでいます。`,`物体パーツを読み込んでます。`,`背景パーツの属性を読み込んでます。`,`物体パーツの属性を読み込んでます。`,`ランダムパーツを置換しています。`,`メッセージを読み込んでます。`,`Welcome to WWA Wing!`],ye=[`Welcome to WWA Wing!`,`Now Map Data Loading .....`,`Now CG Data Loading .....`,`Now Making chara CG .....`],z=function(e){return e[e.LINE=30]=`LINE`,e[e.TITLE_X=100]=`TITLE_X`,e[e.TITLE_Y=70]=`TITLE_Y`,e[e.LOADING_X=50]=`LOADING_X`,e[e.LOADING_Y=140]=`LOADING_Y`,e[e.ERROR_X=10]=`ERROR_X`,e[e.ERROR_Y=180]=`ERROR_Y`,e[e.FOOTER_X=160]=`FOOTER_X`,e[e.FOOTER_Y=360]=`FOOTER_Y`,e[e.WORLD_Y=330]=`WORLD_Y`,e[e.COPYRIGHT_Y=390]=`COPYRIGHT_Y`,e}({}),be=function(e){return e[e.TITLE=32]=`TITLE`,e[e.LOADING=22]=`LOADING`,e[e.FOOTER=18]=`FOOTER`,e[e.ERRROR=16]=`ERRROR`,e}({}),xe=function(e){return e[e.COLOR_FRAME=0]=`COLOR_FRAME`,e[e.COLOR_FRAMEOUT=1]=`COLOR_FRAMEOUT`,e[e.COLOR_STR=2]=`COLOR_STR`,e[e.COLOR_STATUS_STR=4]=`COLOR_STATUS_STR`,e}({}),Se=function(e){return e[e.MESSAGE_WINDOW=0]=`MESSAGE_WINDOW`,e[e.SIDEBAR=1]=`SIDEBAR`,e}({}),Ce=function(e){return e[e.BITSHIFT=16]=`BITSHIFT`,e[e.BITMASK=65535]=`BITMASK`,e}({}),B=function(e){return e[e.NONE=0]=`NONE`,e[e.KEYDOWN=1]=`KEYDOWN`,e[e.KEYPRESS=2]=`KEYPRESS`,e[e.KEYUP=3]=`KEYUP`,e[e.KEYPRESS_MESSAGECHANGE=4]=`KEYPRESS_MESSAGECHANGE`,e}({}),V=function(e){return e[e.KEY_ENTER=13]=`KEY_ENTER`,e[e.KEY_SHIFT=16]=`KEY_SHIFT`,e[e.KEY_ESC=27]=`KEY_ESC`,e[e.KEY_SPACE=32]=`KEY_SPACE`,e[e.KEY_LEFT=37]=`KEY_LEFT`,e[e.KEY_UP=38]=`KEY_UP`,e[e.KEY_RIGHT=39]=`KEY_RIGHT`,e[e.KEY_DOWN=40]=`KEY_DOWN`,e[e.KEY_0=48]=`KEY_0`,e[e.KEY_1=49]=`KEY_1`,e[e.KEY_2=50]=`KEY_2`,e[e.KEY_3=51]=`KEY_3`,e[e.KEY_4=52]=`KEY_4`,e[e.KEY_5=53]=`KEY_5`,e[e.KEY_6=54]=`KEY_6`,e[e.KEY_7=55]=`KEY_7`,e[e.KEY_8=56]=`KEY_8`,e[e.KEY_9=57]=`KEY_9`,e[e.KEY_A=65]=`KEY_A`,e[e.KEY_B=66]=`KEY_B`,e[e.KEY_C=67]=`KEY_C`,e[e.KEY_D=68]=`KEY_D`,e[e.KEY_E=69]=`KEY_E`,e[e.KEY_F=70]=`KEY_F`,e[e.KEY_G=71]=`KEY_G`,e[e.KEY_H=72]=`KEY_H`,e[e.KEY_I=73]=`KEY_I`,e[e.KEY_J=74]=`KEY_J`,e[e.KEY_K=75]=`KEY_K`,e[e.KEY_L=76]=`KEY_L`,e[e.KEY_M=77]=`KEY_M`,e[e.KEY_N=78]=`KEY_N`,e[e.KEY_O=79]=`KEY_O`,e[e.KEY_P=80]=`KEY_P`,e[e.KEY_Q=81]=`KEY_Q`,e[e.KEY_R=82]=`KEY_R`,e[e.KEY_S=83]=`KEY_S`,e[e.KEY_T=84]=`KEY_T`,e[e.KEY_U=85]=`KEY_U`,e[e.KEY_V=86]=`KEY_V`,e[e.KEY_W=87]=`KEY_W`,e[e.KEY_X=88]=`KEY_X`,e[e.KEY_Y=89]=`KEY_Y`,e[e.KEY_Z=90]=`KEY_Z`,e[e.KEY_NUM0=96]=`KEY_NUM0`,e[e.KEY_NUM1=97]=`KEY_NUM1`,e[e.KEY_NUM2=98]=`KEY_NUM2`,e[e.KEY_NUM3=99]=`KEY_NUM3`,e[e.KEY_NUM4=100]=`KEY_NUM4`,e[e.KEY_NUM5=101]=`KEY_NUM5`,e[e.KEY_NUM6=102]=`KEY_NUM6`,e[e.KEY_NUM7=103]=`KEY_NUM7`,e[e.KEY_NUM8=104]=`KEY_NUM8`,e[e.KEY_NUM9=105]=`KEY_NUM9`,e[e.KEY_F1=112]=`KEY_F1`,e[e.KEY_F2=113]=`KEY_F2`,e[e.KEY_F3=114]=`KEY_F3`,e[e.KEY_F4=115]=`KEY_F4`,e[e.KEY_F5=116]=`KEY_F5`,e[e.KEY_F6=117]=`KEY_F6`,e[e.KEY_F7=118]=`KEY_F7`,e[e.KEY_F8=119]=`KEY_F8`,e[e.KEY_F9=120]=`KEY_F9`,e[e.KEY_F10=121]=`KEY_F10`,e[e.KEY_F12=123]=`KEY_F12`,e}({}),we=class e{static{this.KEY_BUFFER_MAX=256}checkHitKey(e){var t=this.getKeyState(e);return t===1||t===2}getKeyState(e){return this._prevKeyState[e]?this._keyState[e]?2:3:+!!this._keyState[e]}getKeyStateForControllPlayer(e){return this._prevKeyStateOnControllable[e]?this._keyState[e]?2:3:+!!this._keyState[e]}getKeyStateForMessageCheck(e){return this._prevKeyState[e]?this._keyState[e]?this._keyInputContinueFrameNum[e]>=R.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?4:2:3:+!!this._keyState[e]}setPressInfo(e){this._nextKeyState[e]=!0,this._keyInputContinueFrameNum[e]=-1}setReleaseInfo(e){this._nextKeyState[e]=!1,this._keyInputContinueFrameNum[e]=-1}update(){var t;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),t=0;t<e.KEY_BUFFER_MAX;t++)this._keyState[t]&&this._keyInputContinueFrameNum[t]++}memorizeKeyStateOnControllableFrame(){this._prevKeyStateOnControllable=this._keyState.slice()}allClear(){var t;for(this._nextKeyState=Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1}constructor(){var t;for(this._nextKeyState=Array(e.KEY_BUFFER_MAX),this._keyState=Array(e.KEY_BUFFER_MAX),this._prevKeyState=Array(e.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=Array(e.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1,this._keyState[t]=!1,this._prevKeyState[t]=!1,this._prevKeyStateOnControllable[t]=!1,this._keyInputContinueFrameNum[t]=0}},Te=function(e){return e[e.NONE=0]=`NONE`,e[e.MOUSEDOWN=1]=`MOUSEDOWN`,e[e.MOUSEPRESS=2]=`MOUSEPRESS`,e[e.MOUSEUP=3]=`MOUSEUP`,e}({}),Ee=class{checkClickMouse(e){var t=e===void 0?this.getMouseState():this.getMouseState(e);return t===1||t===2}getMouseState(e){return e!==void 0&&this._inputDir!==e?0:this._prevMouseState?this._mouseState?2:3:+!!this._mouseState}getMouseStateForControllPlayer(e){return e!==void 0&&this._inputDir!==e?0:this._prevMouseStateOnControllable?this._mouseState?2:3:+!!this._mouseState}setPressInfo(e,t){this._nextMouseState=!0,this._inputDir=e,this._touchID=t}setReleaseInfo(){this._touchID=0,this._nextMouseState=!1}touchIDIsSetDir(){return this._touchID===1}memorizeMouseStateOnControllableFrame(){this._prevMouseStateOnControllable=this._mouseState}update(){this._prevMouseState=this._mouseState,this._mouseState=this._nextMouseState}clear(){this._nextMouseState=!1}getTouchID(){return this._touchID}constructor(){this._prevMouseState=!1,this._mouseState=!1,this._nextMouseState=!1}},H=function(e){return e[e.BUTTON_INDEX_B=0]=`BUTTON_INDEX_B`,e[e.BUTTON_INDEX_A=1]=`BUTTON_INDEX_A`,e[e.BUTTON_INDEX_Y=2]=`BUTTON_INDEX_Y`,e[e.BUTTON_INDEX_X=3]=`BUTTON_INDEX_X`,e[e.BUTTON_INDEX_L=4]=`BUTTON_INDEX_L`,e[e.BUTTON_INDEX_R=5]=`BUTTON_INDEX_R`,e[e.BUTTON_INDEX_ZL=6]=`BUTTON_INDEX_ZL`,e[e.BUTTON_INDEX_ZR=7]=`BUTTON_INDEX_ZR`,e[e.BUTTON_INDEX_MINUS=8]=`BUTTON_INDEX_MINUS`,e[e.BUTTON_INDEX_PLUS=9]=`BUTTON_INDEX_PLUS`,e[e.BUTTON_INDEX_LEFT_STICK=10]=`BUTTON_INDEX_LEFT_STICK`,e[e.BUTTON_INDEX_RIGHT_STICK=11]=`BUTTON_INDEX_RIGHT_STICK`,e[e.BUTTON_CROSS_KEY_UP=12]=`BUTTON_CROSS_KEY_UP`,e[e.BUTTON_CROSS_KEY_DOWN=13]=`BUTTON_CROSS_KEY_DOWN`,e[e.BUTTON_CROSS_KEY_LEFT=14]=`BUTTON_CROSS_KEY_LEFT`,e[e.BUTTON_CROSS_KEY_RIGHT=15]=`BUTTON_CROSS_KEY_RIGHT`,e}({}),De=class{constructor(){this.gamepad=null,this.triggers=[];var e;for(e=0;e<16;e++)this.triggers[e]=!1}update(){this.gamepad=null;var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:[];if(e&&e.length>0&&e[0]){var t=e[0];this.gamepad=t}}buttonTrigger(...e){if(!this.gamepad)return!1;var t,n=e.length,r,i,a;for(t=0;t<n;t++){r=e[t];var o=this.gamepad.buttons[r];if(!o)return!1;if(i=typeof o==`object`?o.pressed===!0:o===1,a=this.triggers[r],this.triggers[r]=i,i&&!a)return!0}return!1}buttonPressed(...e){if(!this.gamepad)return!1;var t,n=e.length,r,i;for(t=0;t<n;t++){r=e[t];var a=this.gamepad.buttons[r];if(!a)return!1;if(i=typeof a==`object`?a.pressed===!0:a===1,i)return!0}return!1}crossPressed(...e){if(!this.gamepad)return!1;var t,n=e.length,r;for(t=0;t<n;t++)switch(r=e[t],r){case 12:if(this.gamepad.axes[1]<=-.6||this.gamepad.axes[3]<=-.6||this.stickFloor(9)===-1||this.buttonPressed(12))return!0;break;case 13:if(this.gamepad.axes[1]>=.7||this.gamepad.axes[3]>=.7||this.stickFloor(9)===.1||this.buttonPressed(13))return!0;break;case 14:if(this.gamepad.axes[0]<=-.7||this.gamepad.axes[2]<=-.7||this.stickFloor(9)===.7||this.buttonPressed(14))return!0;break;case 15:if(this.gamepad.axes[0]>.6||this.gamepad.axes[2]>.6||this.stickFloor(9)===-.5||this.buttonPressed(15))return!0;break}return!1}vibration(e){if(!this.gamepad||!this.gamepad.vibrationActuator)return!1;e?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})}stickFloor(...e){if(!this.gamepad)return 0;var t,n=e.length,r;for(t=0;t<n;t++){r=e[t];var i=this.gamepad.axes[r];return typeof i==`number`?Math.floor(i*10)/10:0}return 0}},Oe=class e{constructor(e=0){this.lastCalculatedTimeUnixMs=Date.now(),this.lastCalculatedPlayTimeMs=e}calculateTimeMs(){let e=Date.now(),t=e-this.lastCalculatedTimeUnixMs+this.lastCalculatedPlayTimeMs;return this.lastCalculatedTimeUnixMs=e,this.lastCalculatedPlayTimeMs=t,t}calculatePlayTimeFormat(){return e.formatPlayTimeText(this.calculateTimeMs()/1e3)}static formatPlayTimeText(e){let t=Math.floor(e);return t>=3600*1e4?`9999:99:99`:(`000`+(t/60/60|0)).slice(-4)+`:`+(`0`+(t/60|0)%60).slice(-2)+`:`+(`0`+t%60).slice(-2)}},ke=[`BUTTON_ENTER`,`BUTTON_ESC`,`BUTTON_SIDEBAR`,`BUTTON_FAST`,`BUTTON_SLOW`,`BUTTON_LEFT`,`BUTTON_UP`,`BUTTON_RIGHT`,`BUTTON_DOWN`],Ae=[`BUTTON_LEFT`,`BUTTON_UP`,`BUTTON_RIGHT`,`BUTTON_DOWN`],je=new Set(Ae),Me=class e{constructor(t,n=!1,r=null,i=null,a=null,o=null){if(this._enabled=t!==null,this._visible=n,this._onTouchStart=a||null,this._onTouchEnd=o||null,this._availableButtons=[],this._isTouchingButtons={},this._moveButtonsElement=i,this._buttonWrapperElement=r,this._setVisible(n),this._moveButtonsElement&&(this._moveButtonsElement.style.visibility=`visible`),this._buttonWrapperElement&&(this._buttonWrapperElement.style.visibility=`visible`),t!==null){for(let n in t){let r=t[n];if(!r)continue;let i=n;this._availableButtons.push(i),r.setAttribute(`type`,n),this._isTouchingButtons[i]={prev:!1,current:!1,next:!1};let a=e=>{e.cancelable&&e.preventDefault()};r.addEventListener(`touchstart`,e=>{a(e),this.setTouchInfo(i)}),r.addEventListener(`touchcancel`,e=>{a(e),this.allClear()}),e.isMoveButton(i)?(r.addEventListener(`touchmove`,this._detectMovingMoveButton.bind(this)),r.addEventListener(`touchend`,this.allMoveClear.bind(this))):r.addEventListener(`touchend`,e=>{a(e),this.clearTouchInfo(i)})}i!==null&&i.addEventListener(`touchmove`,this._detectMovingMoveButton.bind(this))}}_detectMovingMoveButton(e){e.preventDefault(),this.allMoveClear();let t=e.targetTouches.item(0);if(!this._moveButtonsElement||t===null)return;let n=this._moveButtonsElement.getBoundingClientRect(),r=document.body.getBoundingClientRect(),i=n.left-r.left+n.width/2,a=n.top-r.top+n.height/2,o=t.pageX-i,s=t.pageY-a;o>=s?o<=-s?this.setTouchInfo(`BUTTON_UP`):this.setTouchInfo(`BUTTON_RIGHT`):o>=-s?this.setTouchInfo(`BUTTON_DOWN`):this.setTouchInfo(`BUTTON_LEFT`)}_setVisible(e){this._moveButtonsElement!==null&&(this._moveButtonsElement.style.display=e?`grid`:`none`),this._buttonWrapperElement!==null&&(this._buttonWrapperElement.style.display=e?`grid`:`none`),this._visible=e}checkTouchButton(e){return this._enabled?this.getButtonState(e)===`TOUCH`:!1}checkTouchingButton(e){if(!this._enabled)return!1;let t=this.getButtonState(e);return t===`TOUCH`||t===`TOUCHING`}getButtonState(e){let t=this._isTouchingButtons[e];if(!this._enabled||t===void 0)return`NONE`;let n=t.prev,r=t.current;return n&&r?`TOUCHING`:r?`TOUCH`:n?`LEAVE`:`NONE`}setTouchInfo(e){let t=this._isTouchingButtons[e];!this._enabled||t===void 0||(t.next=!0)}clearTouchInfo(e){let t=this._isTouchingButtons[e];!this._enabled||t===void 0||(t.next=!1)}allMoveClear(){Ae.forEach(e=>{this._availableButtons.includes(e)&&this.clearTouchInfo(e)})}allClear(){this._availableButtons.forEach(e=>{if(e!==void 0){let t=this._isTouchingButtons[e];t!==void 0&&(t.next=!1)}})}static isMoveButton(e){return je.has(e)}update(){this._availableButtons.forEach(e=>{if(e===void 0)return;let t=this._isTouchingButtons[e];if(t!==void 0)switch(this._isTouchingButtons[e].prev=t.current,this._isTouchingButtons[e].current=t.next,this.getButtonState(e)){case`TOUCH`:this._onTouchStart?.(e);break;case`LEAVE`:this._onTouchEnd?.(e);break}})}toggleVisible(){this._setVisible(!this._visible)}};function Ne(){let e=document.getElementsByTagName(`head`)[0],t=document.createElement(`meta`);t.setAttribute(`name`,`viewport`),e.appendChild(t),Pe()}function Pe(){let e=document.querySelector(`meta[name='viewport']`),t=window.innerWidth,n=window.innerHeight,r=`user-scalable=no`;t>n?r=`width=${Math.floor(t/n*456)},${r}`:t<=n&&(r=`width=576,${r}`),e?.setAttribute(`content`,`${r}`)}function Fe(){return`
9
+ 変更できません。`}}),h=Object.keys(m),g=h.reduce((e,t)=>({...e,[t]:t}),{}),_=m;function v(e){return h.some(t=>t===e)}function y(e){for(let t of h)if(_[t].code===e)return t}var b=class e{add(e){return this.strength+=e.strength,this.defence+=e.defence,this}plus(t){return new e(this.strength+t.strength,this.defence+t.defence)}minus(t){return new e(this.strength-t.strength,this.defence-t.defence)}equals(e){return this.strength===e.strength&&this.defence===e.defence}constructor(e,t){this.strength=e,this.defence=t}},x=class e extends b{add(t){return t instanceof e&&(this.energy+=t.energy,this.gold+=t.gold),this.strength+=t.strength,this.defence+=t.defence,this}plus(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)}minus(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)}equals(e){return this.energy===e.energy&&this.strength===e.strength&&this.defence===e.defence&&this.gold===e.gold}calculateScore(e){return Object.keys(e.rates).reduce((t,n)=>t+e.rates[n]*this[n],0)}clone(){return new e(this.energy,this.strength,this.defence,this.gold)}constructor(e,t,n,r){super(t,n),this.energy=e,this.gold=r}},S=class e{equals(e){return this.x===e.x&&this.y===e.y}substract(t){return new e(this.x-t.x,this.y-t.y)}clone(){return new e(this.x,this.y)}convertIntoPosition(e){return new C(e,this.x,this.y,0,0)}getDirectionTo(e){return this.x<e.x?this.y>e.y?9:this.y===e.y?6:3:this.x===e.x?this.y>e.y?8:this.y===e.y?5:2:this.y>e.y?7:this.y===e.y?4:1}toString(){return`(`+this.x+`, `+this.y+`)`}constructor(e=0,t=0){this.x=e,this.y=t}},C=class e{getPartsCoord(){return this._partsCoord}getOffsetCoord(){return this._offsetCoord}getScreenTopPosition(){var t=Math.floor(this._partsCoord.x/(R.H_PARTS_NUM_IN_WINDOW-1))*(R.H_PARTS_NUM_IN_WINDOW-1),n=Math.floor(this._partsCoord.y/(R.V_PARTS_NUM_IN_WINDOW-1))*(R.V_PARTS_NUM_IN_WINDOW-1);return new e(this._wwa,t,n,0,0)}getDefaultCameraPosition(){var e=this.getScreenTopPosition(),t=e.getPartsCoord(),n=this._wwa.getMapWidth(),r=e.getPartsCoord().clone();return t.x===n-1&&r.x--,t.y===n-1&&r.y--,r.convertIntoPosition(this._wwa).getScreenTopPosition()}getNextJustPosition(t){if(t!==void 0){var n=this._partsCoord;return new e(this._wwa,n.x+D[t],n.y+O[t],0,0)}var r=this._partsCoord.x,i=this._partsCoord.y;return this._offsetCoord.x<0?r--:this._offsetCoord.x>0&&r++,this._offsetCoord.y<0?i--:this._offsetCoord.y>0&&i++,new e(this._wwa,r,i,0,0)}getNextFramePosition(t,n,r){var i=this._partsCoord.x,a=this._partsCoord.y,o=this._offsetCoord.x+D[t]*n,s=this._offsetCoord.y+O[t]*r;if(o<0){var c=Math.floor(Math.abs(o)/R.CHIP_SIZE);i-=c,o=(o+c*R.CHIP_SIZE)%R.CHIP_SIZE}if(s<0){var l=Math.floor(Math.abs(s)/R.CHIP_SIZE);a-=l,s=(s+l*R.CHIP_SIZE)%R.CHIP_SIZE}return o>=R.CHIP_SIZE&&(i+=Math.floor(o/R.CHIP_SIZE),o=(o+R.CHIP_SIZE)%R.CHIP_SIZE),s>=R.CHIP_SIZE&&(a+=Math.floor(s/R.CHIP_SIZE),s=(s+R.CHIP_SIZE)%R.CHIP_SIZE),new e(this._wwa,i,a,o,s)}isJustPosition(){return this._offsetCoord.x==0&&this._offsetCoord.y==0}isScreenTopPosition(){var e=this.getScreenTopPosition();return this.equals(e)}equals(e){return this._partsCoord.equals(e.getPartsCoord())&&this._offsetCoord.equals(e.getOffsetCoord())}isInCameraRange(e,t=!1){var n=e.getPosition()._partsCoord,r=this._partsCoord.x,i=this._partsCoord.y,a=+!!t;return n.x<=r&&r<n.x+R.H_PARTS_NUM_IN_WINDOW-a&&n.y<=i&&i<n.y+R.V_PARTS_NUM_IN_WINDOW-a}hasLocalGate(){return this._wwa.getMapTypeByPosition(this)===R.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===R.OBJECT_LOCALGATE}clone(){return new e(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)}constructor(e,t,n,r=0,i=0){if(this._wwa=e,this._wwa===void 0)throw Error(`WWAのインスタンスが存在しません. `);var a=this._wwa.getMapWidth();if(t<0||t>=a||t>=a-1&&r>0||n<0||n>=a||n>=a-1&&i>0)throw Error(`範囲外の座標です!! parts:(`+t+`, `+n+`), offset:(`+r+`, `+i+`), mapWidth = `+a);this._partsCoord=new S(t,n),this._offsetCoord=new S(r,i)}},w=class{constructor(e,t,n){this.destPos=e.clone(),this.srcPos=t.clone(),this.srcSize=n.clone()}},ee=class{constructor(e,t,n,r,i){this.partsIDObj=e,this.x=t,this.y=n,this.isStatic=r,this.isFighting=i}},T=function(e){return e[e.GOTO_WWA=0]=`GOTO_WWA`,e[e.BATTLE_REPORT=1]=`BATTLE_REPORT`,e[e.GAME_END=2]=`GAME_END`,e}({}),E=function(e){return e[e.UNUSED=0]=`UNUSED`,e[e.LEFT=4]=`LEFT`,e[e.RIGHT=6]=`RIGHT`,e[e.DOWN=2]=`DOWN`,e[e.UP=8]=`UP`,e[e.LEFT_DOWN=1]=`LEFT_DOWN`,e[e.LEFT_UP=7]=`LEFT_UP`,e[e.RIGHT_DOWN=3]=`RIGHT_DOWN`,e[e.RIGHT_UP=9]=`RIGHT_UP`,e[e.NO_DIRECTION=5]=`NO_DIRECTION`,e}({}),D=[0,-1,0,1,-1,0,1,-1,0,1],O=[0,1,1,1,0,0,0,-1,-1,-1],k=function(e){return e[e.YES=0]=`YES`,e[e.NO=1]=`NO`,e[e.UNSELECTED=2]=`UNSELECTED`,e}({}),A=function(e){return e[e.MAP=0]=`MAP`,e[e.OBJECT=1]=`OBJECT`,e[e.CHOICE_YES=2]=`CHOICE_YES`,e[e.CHOICE_NO=3]=`CHOICE_NO`,e}({}),te=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.CAN_USE=1]=`CAN_USE`,e[e.NOT_DISAPPEAR=2]=`NOT_DISAPPEAR`,e}({}),j=function(e){return e[e.MAP=1]=`MAP`,e[e.OBJECT=0]=`OBJECT`,e}({}),M=class{constructor(){var e=window.navigator.userAgent;this.os=this._getOS(e),this.browser=this.getBrowser(e),this.device=this.getDevice()}_getOS(e){return e.match(/xbox/i)?9:e.match(/windows/i)?1:e.match(/macintosh/i)?`ontouchstart`in document?5:2:e.match(/iphone|ipad|ipod/i)?5:e.match(/oculus/i)?8:e.match(/android/i)?4:e.match(/nintendo/i)?6:e.match(/playstation/i)?7:e.match(/linux/i)?3:9999}getBrowser(e){return e.match(/chrome/i)?1:e.match(/firefox/i)?2:e.match(/safari/i)?3:9999}getDevice(){switch(this.os){case 1:case 2:case 3:return 1;case 5:case 4:return 2;case 8:return 3;case 6:case 7:case 9:return 4}return 9999}},ne=function(e){return e[e.WINDOWS=1]=`WINDOWS`,e[e.MACINTOSH=2]=`MACINTOSH`,e[e.LINUX=3]=`LINUX`,e[e.ANDROID=4]=`ANDROID`,e[e.IOS=5]=`IOS`,e[e.NINTENDO=6]=`NINTENDO`,e[e.PLAY_STATION=7]=`PLAY_STATION`,e[e.OCULUS=8]=`OCULUS`,e[e.XBOX=9]=`XBOX`,e[e.OTHERS=9999]=`OTHERS`,e}({}),re=function(e){return e[e.PC=1]=`PC`,e[e.SP=2]=`SP`,e[e.VR=3]=`VR`,e[e.GAME=4]=`GAME`,e[e.OTHERS=9999]=`OTHERS`,e}({}),ie=function(e){return e[e.CHROME=1]=`CHROME`,e[e.FIREFOX=2]=`FIREFOX`,e[e.SAFARI=3]=`SAFARI`,e[e.OTHERS=9999]=`OTHERS`,e}({}),N=function(e){return e[e.NONE=0]=`NONE`,e[e.CALL_BY_MAP_PARTS=1]=`CALL_BY_MAP_PARTS`,e[e.CALL_BY_OBJECT_PARTS=2]=`CALL_BY_OBJECT_PARTS`,e[e.CALL_BY_ITEM_USE=3]=`CALL_BY_ITEM_USE`,e[e.CALL_BY_QUICK_SAVE=4]=`CALL_BY_QUICK_SAVE`,e[e.CALL_BY_QUICK_LOAD=5]=`CALL_BY_QUICK_LOAD`,e[e.CALL_BY_RESTART_GAME=6]=`CALL_BY_RESTART_GAME`,e[e.CALL_BY_GOTO_WWA=7]=`CALL_BY_GOTO_WWA`,e[e.CALL_BY_PASSWORD_SAVE=8]=`CALL_BY_PASSWORD_SAVE`,e[e.CALL_BY_PASSWORD_LOAD=9]=`CALL_BY_PASSWORD_LOAD`,e[e.CALL_BY_END_GAME=10]=`CALL_BY_END_GAME`,e[e.CALL_BY_SUSPEND=11]=`CALL_BY_SUSPEND`,e[e.CALL_BY_LOG_QUICK_SAVE=12]=`CALL_BY_LOG_QUICK_SAVE`,e[e.CALL_BY_LOG_QUICK_LOAD=13]=`CALL_BY_LOG_QUICK_LOAD`,e}({}),P=function(e){return e[e.QUICK_LOAD=0]=`QUICK_LOAD`,e[e.QUICK_SAVE=1]=`QUICK_SAVE`,e[e.RESTART_GAME=2]=`RESTART_GAME`,e[e.GOTO_WWA=3]=`GOTO_WWA`,e}({}),ae=function(e){return e[e.UP=0]=`UP`,e[e.DOWN=1]=`DOWN`,e}({}),oe=function(e){return e[e.QUICK_LOAD=0]=`QUICK_LOAD`,e[e.RESTART_GAME=1]=`RESTART_GAME`,e[e.PASSWORD=2]=`PASSWORD`,e}({}),se=function(e){return e[e.STATIC=0]=`STATIC`,e[e.CHASE_PLAYER=1]=`CHASE_PLAYER`,e[e.RUN_OUT=2]=`RUN_OUT`,e[e.HANG_AROUND=3]=`HANG_AROUND`,e}({}),ce=function(e){return e[e.MODE_X=0]=`MODE_X`,e[e.MODE_Y=1]=`MODE_Y`,e[e.UNDECIDED=2]=`UNDECIDED`,e}({}),F=[`cell-load`,`cell-save`,`cell-restart`,`cell-gotowwa`],I=function(e){return e[e.UNDEFINED=0]=`UNDEFINED`,e[e.IMGPLAYER=1]=`IMGPLAYER`,e[e.IMGYESNO=2]=`IMGYESNO`,e[e.HPMAX=3]=`HPMAX`,e[e.SAVE=4]=`SAVE`,e[e.ITEM=5]=`ITEM`,e[e.DEFAULT=6]=`DEFAULT`,e[e.OLDMAP=7]=`OLDMAP`,e[e.PARTS=8]=`PARTS`,e[e.MOVE=9]=`MOVE`,e[e.MAP=10]=`MAP`,e[e.DIRMAP=11]=`DIRMAP`,e[e.IMGFRAME=12]=`IMGFRAME`,e[e.IMGBOM=13]=`IMGBOM`,e[e.DELPLAYER=14]=`DELPLAYER`,e[e.FACE=15]=`FACE`,e[e.EFFECT=16]=`EFFECT`,e[e.GAMEOVER=17]=`GAMEOVER`,e[e.IMGCLICK=18]=`IMGCLICK`,e[e.STATUS=19]=`STATUS`,e[e.EFFITEM=20]=`EFFITEM`,e[e.COLOR=21]=`COLOR`,e[e.WAIT=22]=`WAIT`,e[e.SOUND=23]=`SOUND`,e[e.JUMPGATE=24]=`JUMPGATE`,e[e.RECPOSITION=25]=`RECPOSITION`,e[e.JUMPRECPOSITION=26]=`JUMPRECPOSITION`,e[e.CONSOLE_LOG=27]=`CONSOLE_LOG`,e[e.COPY_HP_TO=28]=`COPY_HP_TO`,e[e.SET_HP=29]=`SET_HP`,e[e.COPY_HPMAX_TO=30]=`COPY_HPMAX_TO`,e[e.SET_HPMAX=31]=`SET_HPMAX`,e[e.COPY_AT_TO=32]=`COPY_AT_TO`,e[e.SET_AT=33]=`SET_AT`,e[e.COPY_DF_TO=34]=`COPY_DF_TO`,e[e.SET_DF=35]=`SET_DF`,e[e.COPY_MONEY_TO=36]=`COPY_MONEY_TO`,e[e.SET_MONEY=37]=`SET_MONEY`,e[e.COPY_STEP_COUNT_TO=38]=`COPY_STEP_COUNT_TO`,e[e.VAR_SET_VAL=39]=`VAR_SET_VAL`,e[e.VAR_SET=40]=`VAR_SET`,e[e.VAR_ADD=41]=`VAR_ADD`,e[e.VAR_SUB=42]=`VAR_SUB`,e[e.VAR_MUL=43]=`VAR_MUL`,e[e.VAR_DIV=44]=`VAR_DIV`,e[e.VAR_SET_RAND=45]=`VAR_SET_RAND`,e[e.SHOW_STR=46]=`SHOW_STR`,e[e.GAME_SPEED=47]=`GAME_SPEED`,e[e.IF=50]=`IF`,e[e.SET_SPEED=51]=`SET_SPEED`,e[e.COPY_TIME_TO=52]=`COPY_TIME_TO`,e[e.HIDE_STATUS=53]=`HIDE_STATUS`,e[e.VAR_MAP=54]=`VAR_MAP`,e[e.VAR_MOD=55]=`VAR_MOD`,e[e.NO_GAMEOVER=56]=`NO_GAMEOVER`,e[e.ELSE_IF=57]=`ELSE_IF`,e[e.ELSE=58]=`ELSE`,e[e.END_IF=59]=`END_IF`,e[e.SET=60]=`SET`,e[e.MAP2=61]=`MAP2`,e[e.SHOW_STR2=62]=`SHOW_STR2`,e[e.CONSOLE_LOG2=63]=`CONSOLE_LOG2`,e[e.DELAYBGM=64]=`DELAYBGM`,e[e.SYSMSG=65]=`SYSMSG`,e[e.PICTURE=66]=`PICTURE`,e[e.GAMEPAD_BUTTON=100]=`GAMEPAD_BUTTON`,e[e.OLDMOVE=101]=`OLDMOVE`,e[e.LEGACY_IF=10050]=`LEGACY_IF`,e}({}),le={"":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,$picture:66,$gamepad_button:100,$oldmove:101},ue=function(e){return e[e.ENERGY=0]=`ENERGY`,e[e.STRENGTH=1]=`STRENGTH`,e[e.DEFENCE=2]=`DEFENCE`,e[e.GOLD=3]=`GOLD`,e[e.MOVES=4]=`MOVES`,e}({}),L=function(e){return e[e.ENERGY=0]=`ENERGY`,e[e.STRENGTH=1]=`STRENGTH`,e[e.DEFENCE=2]=`DEFENCE`,e[e.GOLD=3]=`GOLD`,e[e.WIDE_CELL_ROW=4]=`WIDE_CELL_ROW`,e[e.ITEM_BG=5]=`ITEM_BG`,e[e.MAIN_FRAME=6]=`MAIN_FRAME`,e}({}),de=[1,2,5,8,10,20],fe=[`超低速`,`低速`,`準低速`,`中速`,`高速`,`超高速`],pe=[`energy`,`strength`,`defence`,`gold`],R=class e{static{this.WWA_HOME=`http://wwajp.com`}static{this.TARGET_FPS=60}static{this.INTERVAL_MS=1e3/e.TARGET_FPS}static{this.ITEMBOX_SIZE=12}static{this.MAP_ATR_MAX=60}static{this.OBJ_ATR_MAX=60}static{this.OLD_MAP_ATR_MAX=40}static{this.OLD_OBJ_ATR_MAX=40}static{this.ATR_TYPE=3}static{this.ATR_MODE=4}static{this.ATR_STRING=5}static{this.ATR_X=6}static{this.ATR_Y=7}static{this.ATR_X2=8}static{this.ATR_Y2=9}static{this.ATR_ENERGY=10}static{this.ATR_STRENGTH=11}static{this.ATR_DEFENCE=12}static{this.ATR_GOLD=13}static{this.ATR_ITEM=14}static{this.ATR_NUMBER=15}static{this.ATR_JUMP_X=16}static{this.ATR_MOVE=16}static{this.ATR_JUMP_Y=17}static{this.ATR_SOUND=19}static{this.ATR_APPERANCE_BASE=20}static{this.REL_ATR_APPERANCE_ID=0}static{this.REL_ATR_APPERANCE_X=1}static{this.REL_ATR_APPERANCE_Y=2}static{this.REL_ATR_APPERANCE_TYPE=3}static{this.REL_ATR_APPERANCE_UNIT_LENGTH=4}static{this.ATR_RANDOM_BASE=10}static{this.RANDOM_ATR_NUM=10}static{this.RANDOM_ITERATION_MAX=10}static{this.MAP_STREET=0}static{this.MAP_WALL=1}static{this.MAP_LOCALGATE=2}static{this.MAP_URLGATE=4}static{this.OBJECT_NORMAL=0}static{this.OBJECT_MESSAGE=1}static{this.OBJECT_URLGATE=2}static{this.OBJECT_STATUS=3}static{this.OBJECT_ITEM=4}static{this.OBJECT_DOOR=5}static{this.OBJECT_MONSTER=6}static{this.OBJECT_SCORE=11}static{this.OBJECT_SELL=14}static{this.OBJECT_BUY=15}static{this.OBJECT_RANDOM=16}static{this.OBJECT_SELECT=17}static{this.OBJECT_LOCALGATE=18}static{this.SYSTEM_MESSAGE_NUM=20}static{this.IMGPOS_DEFAULT_YESNO_X=3}static{this.IMGPOS_DEFAULT_YESNO_Y=1}static{this.IMGRELPOS_YESNO_YES_X=0}static{this.IMGRELPOS_YESNO_NO_X=1}static{this.IMGRELPOS_YESNO_YESP_X=2}static{this.IMGRELPOS_YESNO_NOP_X=3}static{this.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0}static{this.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0}static{this.IMGPOS_DEFAULT_FRAME_X=0}static{this.IMGPOS_DEFAULT_FRAME_Y=1}static{this.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3}static{this.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3}static{this.DEFAULT_DISABLE_SAVE=!1}static{this.DEFAULT_OLDMAP=!1}static{this.DEFAULT_OBJECT_NO_COLLAPSE=!1}static{this.SPLASH_SCREEN_DISP_MILLS=100}static{this.DEFAULT_FRAME_INTERVAL=20}static{this.GAMEOVER_FRAME_INTERVAL=50}static{this.YESNO_PRESS_DISP_FRAME_NUM=20}static{this.WAIT_TIME_FRAME_NUM=6}static{this.CHIP_SIZE=40}static{this.MAP_WINDOW_WIDTH=440}static{this.MAP_WINDOW_HEIGHT=440}static{this.H_PARTS_NUM_IN_WINDOW=e.MAP_WINDOW_WIDTH/e.CHIP_SIZE}static{this.V_PARTS_NUM_IN_WINDOW=e.MAP_WINDOW_HEIGHT/e.CHIP_SIZE}static{this.MIN_SPEED_INDEX=0}static{this.MAX_SPEED_INDEX=de.length-1}static{this.QUICK_BATTLE_SPEED_INDECIES=[de.length-2,de.length-1]}static{this.ANIMATION_REP_HALF_FRAME=22}static{this.PLAYER_LOOKING_AROUND_START_FRAME=e.ANIMATION_REP_HALF_FRAME*4}static{this.RELATIVE_COORD_BIAS=1e4}static{this.RELATIVE_COORD_LOWER=e.RELATIVE_COORD_BIAS-1e3}static{this.PLAYER_COORD=e.RELATIVE_COORD_BIAS-1e3}static{this.LOCALGATE_PLAYER_WAIT_FRAME=5}static{this.STATUS_CHANGED_EFFECT_FRAME_NUM=20}static{this.PASSABLE_OBJECT=1}static{this.APPERANCE_PARTS_MIN_INDEX=0}static{this.APPERANCE_PARTS_MAX_INDEX=9}static{this.APPERANCE_PARTS_MIN_INDEX_NO=5}static{this.APPERANCE_PARTS_MAX_INDEX_YES=4}static{this.FADEOUT_SPEED=8}static{this.STATUS_MINUS_BORDER=3e4}static{this.ITEMBOX_IS_FULL=-1}static{this.BATTLE_INTERVAL_FRAME_NUM=10}static{this.BATTLE_SPEED_CHANGE_TURN_NUM=40}static{this.RANDOM_MOVE_ITERATION_NUM=50}static{this.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31=8}static{this.BATTLE_ESTIMATE_MONSTER_TYPE_MAX=8}static{this.SOUND_MAX=100}static{this.ITEM_BORDER_IMG_DATA_URL=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAArklEQVRYR+2Y0QqAIAxFt///aENJHwxxuJUSxzeh3S7HXaNpEkly4FIRzba0GEyHeVTN7jqDWvb7V4Y1NLibZIY0NbiL5G3MZLCe / 1fn3XJgJYjB7mgg6O1VCEKwXo79JeklY62nB62kRs9BEIKkeNIDhISQEBJC4k0BBCF4D7D4cV9shf99ixdB + MrM0y3fa3zV05D45GOqhwPMGPkYlccIOEY2VKUN0UNVXxC7ADj7mDi9aFZZAAAAAElFTkSuQmCC`}static{this.LOAD_STAGE_MAX_EXCEPT_AUDIO=7}static{this.WWA_STYLE_TAG_ID=`wwa-additional-style`}static{this.DEFAULT_FRAME_COLOR_R=255}static{this.DEFAULT_FRAME_COLOR_G=255}static{this.DEFAULT_FRAME_COLOR_B=255}static{this.DEFAULT_FRAMEOUT_COLOR_R=96}static{this.DEFAULT_FRAMEOUT_COLOR_G=96}static{this.DEFAULT_FRAMEOUT_COLOR_B=96}static{this.DEFAULT_STRBACK_COLOR_R=0}static{this.DEFAULT_STRBACK_COLOR_G=0}static{this.DEFAULT_STRBACK_COLOR_B=0}static{this.DEFAULT_STATUS_COLOR_R=0}static{this.DEFAULT_STATUS_COLOR_G=0}static{this.DEFAULT_STATUS_COLOR_B=0}static{this.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM=20}static{this.WWAP_SERVER_OLD=`http://wwawing.com/wwap`}static{this.WWAP_SERVER=`https://wwaphoenix.github.io`}static{this.WWAP_SERVER_AUDIO_DIR=`audio`}static{this.WWAP_SERVER_TITLE_IMG=`cover_p.gif`}static{this.WWAP_SERVER_LOADER_NO_WORKER=`wwaload.noworker.js`}static{this.SCREEN_WIDTH=560}static{this.SCREEN_HEIGHT=440}static{this.LOADING_FONT=`Times New Roman`}static{this.MSG_STR_WIDTH=16}static{this.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME=20}static{this.ITEMBOX_TOP_Y=140}static{this.USER_VAR_NUM=256}static{this.USER_VAR_NUM_MAX_VALUE=9007199254740991}static{this.USET_VAR_NUM_MIN_VALUE=-9007199254740991}static{this.CONTROLL_WAIT_FRAME=6}static{this.INLINE_USER_VAR_VIEWER_DISPLAY_NUM=10}static{this.FIGHT_DRAW_TURN=40}},me=class{static{this.QUICK_SAVE_MAX=4}static{this.QUICK_SAVE_THUMNAIL_WIDTH=99}static{this.QUICK_SAVE_THUMNAIL_HEIGHT=99}static{this.SAVE_INTERVAL_MOVE=200}static{this.INDEXEDDB_DB_NAME=`WWA_WING_DB`}static{this.INDEXEDDB_TABLE_NAME=`SAVE_TABLE`}static{this.DATE_LAST_SAVE_TEXT_COLOR=`rgba(255,255,0,1)`}},he=class{static{this.EMPTY_LOAD=``}static{this.EMPTY_SAVE=``}static{this.PASSWORD=`Password`}static{this.QUICK_SAVE=`Quick Save`}static{this.QUICK_LOAD=`Quick Load`}static{this.BATTLE_REPORT=`Battle Report`}static{this.GAME_END=`Game End`}static{this.GOTO_WWA=`Goto WWA`}static{this.RESTART_GAME=`Restart Game`}},ge=class{},_e=function(e){return e[e.INIT=0]=`INIT`,e[e.MAP_LOAD=1]=`MAP_LOAD`,e[e.OBJ_LOAD=2]=`OBJ_LOAD`,e[e.MAP_ATTR=3]=`MAP_ATTR`,e[e.OBJ_ATTR=4]=`OBJ_ATTR`,e[e.RAND_PARTS=5]=`RAND_PARTS`,e[e.MESSAGE=6]=`MESSAGE`,e[e.GAME_INIT=7]=`GAME_INIT`,e[e.AUDIO=8]=`AUDIO`,e[e.FINISH=9]=`FINISH`,e}({}),ve=[`ロードの準備をしています。`,`背景パーツを読み込んでいます。`,`物体パーツを読み込んでます。`,`背景パーツの属性を読み込んでます。`,`物体パーツの属性を読み込んでます。`,`ランダムパーツを置換しています。`,`メッセージを読み込んでます。`,`Welcome to WWA Wing!`],ye=[`Welcome to WWA Wing!`,`Now Map Data Loading .....`,`Now CG Data Loading .....`,`Now Making chara CG .....`],z=function(e){return e[e.LINE=30]=`LINE`,e[e.TITLE_X=100]=`TITLE_X`,e[e.TITLE_Y=70]=`TITLE_Y`,e[e.LOADING_X=50]=`LOADING_X`,e[e.LOADING_Y=140]=`LOADING_Y`,e[e.ERROR_X=10]=`ERROR_X`,e[e.ERROR_Y=180]=`ERROR_Y`,e[e.FOOTER_X=160]=`FOOTER_X`,e[e.FOOTER_Y=360]=`FOOTER_Y`,e[e.WORLD_Y=330]=`WORLD_Y`,e[e.COPYRIGHT_Y=390]=`COPYRIGHT_Y`,e}({}),be=function(e){return e[e.TITLE=32]=`TITLE`,e[e.LOADING=22]=`LOADING`,e[e.FOOTER=18]=`FOOTER`,e[e.ERRROR=16]=`ERRROR`,e}({}),xe=function(e){return e[e.COLOR_FRAME=0]=`COLOR_FRAME`,e[e.COLOR_FRAMEOUT=1]=`COLOR_FRAMEOUT`,e[e.COLOR_STR=2]=`COLOR_STR`,e[e.COLOR_STATUS_STR=4]=`COLOR_STATUS_STR`,e}({}),Se=function(e){return e[e.MESSAGE_WINDOW=0]=`MESSAGE_WINDOW`,e[e.SIDEBAR=1]=`SIDEBAR`,e}({}),Ce=function(e){return e[e.BITSHIFT=16]=`BITSHIFT`,e[e.BITMASK=65535]=`BITMASK`,e}({}),B=function(e){return e[e.NONE=0]=`NONE`,e[e.KEYDOWN=1]=`KEYDOWN`,e[e.KEYPRESS=2]=`KEYPRESS`,e[e.KEYUP=3]=`KEYUP`,e[e.KEYPRESS_MESSAGECHANGE=4]=`KEYPRESS_MESSAGECHANGE`,e}({}),V=function(e){return e[e.KEY_ENTER=13]=`KEY_ENTER`,e[e.KEY_SHIFT=16]=`KEY_SHIFT`,e[e.KEY_ESC=27]=`KEY_ESC`,e[e.KEY_SPACE=32]=`KEY_SPACE`,e[e.KEY_LEFT=37]=`KEY_LEFT`,e[e.KEY_UP=38]=`KEY_UP`,e[e.KEY_RIGHT=39]=`KEY_RIGHT`,e[e.KEY_DOWN=40]=`KEY_DOWN`,e[e.KEY_0=48]=`KEY_0`,e[e.KEY_1=49]=`KEY_1`,e[e.KEY_2=50]=`KEY_2`,e[e.KEY_3=51]=`KEY_3`,e[e.KEY_4=52]=`KEY_4`,e[e.KEY_5=53]=`KEY_5`,e[e.KEY_6=54]=`KEY_6`,e[e.KEY_7=55]=`KEY_7`,e[e.KEY_8=56]=`KEY_8`,e[e.KEY_9=57]=`KEY_9`,e[e.KEY_A=65]=`KEY_A`,e[e.KEY_B=66]=`KEY_B`,e[e.KEY_C=67]=`KEY_C`,e[e.KEY_D=68]=`KEY_D`,e[e.KEY_E=69]=`KEY_E`,e[e.KEY_F=70]=`KEY_F`,e[e.KEY_G=71]=`KEY_G`,e[e.KEY_H=72]=`KEY_H`,e[e.KEY_I=73]=`KEY_I`,e[e.KEY_J=74]=`KEY_J`,e[e.KEY_K=75]=`KEY_K`,e[e.KEY_L=76]=`KEY_L`,e[e.KEY_M=77]=`KEY_M`,e[e.KEY_N=78]=`KEY_N`,e[e.KEY_O=79]=`KEY_O`,e[e.KEY_P=80]=`KEY_P`,e[e.KEY_Q=81]=`KEY_Q`,e[e.KEY_R=82]=`KEY_R`,e[e.KEY_S=83]=`KEY_S`,e[e.KEY_T=84]=`KEY_T`,e[e.KEY_U=85]=`KEY_U`,e[e.KEY_V=86]=`KEY_V`,e[e.KEY_W=87]=`KEY_W`,e[e.KEY_X=88]=`KEY_X`,e[e.KEY_Y=89]=`KEY_Y`,e[e.KEY_Z=90]=`KEY_Z`,e[e.KEY_NUM0=96]=`KEY_NUM0`,e[e.KEY_NUM1=97]=`KEY_NUM1`,e[e.KEY_NUM2=98]=`KEY_NUM2`,e[e.KEY_NUM3=99]=`KEY_NUM3`,e[e.KEY_NUM4=100]=`KEY_NUM4`,e[e.KEY_NUM5=101]=`KEY_NUM5`,e[e.KEY_NUM6=102]=`KEY_NUM6`,e[e.KEY_NUM7=103]=`KEY_NUM7`,e[e.KEY_NUM8=104]=`KEY_NUM8`,e[e.KEY_NUM9=105]=`KEY_NUM9`,e[e.KEY_F1=112]=`KEY_F1`,e[e.KEY_F2=113]=`KEY_F2`,e[e.KEY_F3=114]=`KEY_F3`,e[e.KEY_F4=115]=`KEY_F4`,e[e.KEY_F5=116]=`KEY_F5`,e[e.KEY_F6=117]=`KEY_F6`,e[e.KEY_F7=118]=`KEY_F7`,e[e.KEY_F8=119]=`KEY_F8`,e[e.KEY_F9=120]=`KEY_F9`,e[e.KEY_F10=121]=`KEY_F10`,e[e.KEY_F12=123]=`KEY_F12`,e}({}),we=class e{static{this.KEY_BUFFER_MAX=256}checkHitKey(e){var t=this.getKeyState(e);return t===1||t===2}getKeyState(e){return this._prevKeyState[e]?this._keyState[e]?2:3:+!!this._keyState[e]}getKeyStateForControllPlayer(e){return this._prevKeyStateOnControllable[e]?this._keyState[e]?2:3:+!!this._keyState[e]}getKeyStateForMessageCheck(e){return this._prevKeyState[e]?this._keyState[e]?this._keyInputContinueFrameNum[e]>=R.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?4:2:3:+!!this._keyState[e]}setPressInfo(e){this._nextKeyState[e]=!0,this._keyInputContinueFrameNum[e]=-1}setReleaseInfo(e){this._nextKeyState[e]=!1,this._keyInputContinueFrameNum[e]=-1}update(){var t;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),t=0;t<e.KEY_BUFFER_MAX;t++)this._keyState[t]&&this._keyInputContinueFrameNum[t]++}memorizeKeyStateOnControllableFrame(){this._prevKeyStateOnControllable=this._keyState.slice()}allClear(){var t;for(this._nextKeyState=Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1}constructor(){var t;for(this._nextKeyState=Array(e.KEY_BUFFER_MAX),this._keyState=Array(e.KEY_BUFFER_MAX),this._prevKeyState=Array(e.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=Array(e.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1,this._keyState[t]=!1,this._prevKeyState[t]=!1,this._prevKeyStateOnControllable[t]=!1,this._keyInputContinueFrameNum[t]=0}},Te=function(e){return e[e.NONE=0]=`NONE`,e[e.MOUSEDOWN=1]=`MOUSEDOWN`,e[e.MOUSEPRESS=2]=`MOUSEPRESS`,e[e.MOUSEUP=3]=`MOUSEUP`,e}({}),Ee=class{checkClickMouse(e){var t=e===void 0?this.getMouseState():this.getMouseState(e);return t===1||t===2}getMouseState(e){return e!==void 0&&this._inputDir!==e?0:this._prevMouseState?this._mouseState?2:3:+!!this._mouseState}getMouseStateForControllPlayer(e){return e!==void 0&&this._inputDir!==e?0:this._prevMouseStateOnControllable?this._mouseState?2:3:+!!this._mouseState}setPressInfo(e,t){this._nextMouseState=!0,this._inputDir=e,this._touchID=t}setReleaseInfo(){this._touchID=0,this._nextMouseState=!1}touchIDIsSetDir(){return this._touchID===1}memorizeMouseStateOnControllableFrame(){this._prevMouseStateOnControllable=this._mouseState}update(){this._prevMouseState=this._mouseState,this._mouseState=this._nextMouseState}clear(){this._nextMouseState=!1}getTouchID(){return this._touchID}constructor(){this._prevMouseState=!1,this._mouseState=!1,this._nextMouseState=!1}},H=function(e){return e[e.BUTTON_INDEX_B=0]=`BUTTON_INDEX_B`,e[e.BUTTON_INDEX_A=1]=`BUTTON_INDEX_A`,e[e.BUTTON_INDEX_Y=2]=`BUTTON_INDEX_Y`,e[e.BUTTON_INDEX_X=3]=`BUTTON_INDEX_X`,e[e.BUTTON_INDEX_L=4]=`BUTTON_INDEX_L`,e[e.BUTTON_INDEX_R=5]=`BUTTON_INDEX_R`,e[e.BUTTON_INDEX_ZL=6]=`BUTTON_INDEX_ZL`,e[e.BUTTON_INDEX_ZR=7]=`BUTTON_INDEX_ZR`,e[e.BUTTON_INDEX_MINUS=8]=`BUTTON_INDEX_MINUS`,e[e.BUTTON_INDEX_PLUS=9]=`BUTTON_INDEX_PLUS`,e[e.BUTTON_INDEX_LEFT_STICK=10]=`BUTTON_INDEX_LEFT_STICK`,e[e.BUTTON_INDEX_RIGHT_STICK=11]=`BUTTON_INDEX_RIGHT_STICK`,e[e.BUTTON_CROSS_KEY_UP=12]=`BUTTON_CROSS_KEY_UP`,e[e.BUTTON_CROSS_KEY_DOWN=13]=`BUTTON_CROSS_KEY_DOWN`,e[e.BUTTON_CROSS_KEY_LEFT=14]=`BUTTON_CROSS_KEY_LEFT`,e[e.BUTTON_CROSS_KEY_RIGHT=15]=`BUTTON_CROSS_KEY_RIGHT`,e}({}),De=class{constructor(){this.gamepad=null,this.triggers=[];var e;for(e=0;e<16;e++)this.triggers[e]=!1}update(){this.gamepad=null;var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:[];if(e&&e.length>0&&e[0]){var t=e[0];this.gamepad=t}}buttonTrigger(...e){if(!this.gamepad)return!1;var t,n=e.length,r,i,a;for(t=0;t<n;t++){r=e[t];var o=this.gamepad.buttons[r];if(!o)return!1;if(i=typeof o==`object`?o.pressed===!0:o===1,a=this.triggers[r],this.triggers[r]=i,i&&!a)return!0}return!1}buttonPressed(...e){if(!this.gamepad)return!1;var t,n=e.length,r,i;for(t=0;t<n;t++){r=e[t];var a=this.gamepad.buttons[r];if(!a)return!1;if(i=typeof a==`object`?a.pressed===!0:a===1,i)return!0}return!1}crossPressed(...e){if(!this.gamepad)return!1;var t,n=e.length,r;for(t=0;t<n;t++)switch(r=e[t],r){case 12:if(this.gamepad.axes[1]<=-.6||this.gamepad.axes[3]<=-.6||this.stickFloor(9)===-1||this.buttonPressed(12))return!0;break;case 13:if(this.gamepad.axes[1]>=.7||this.gamepad.axes[3]>=.7||this.stickFloor(9)===.1||this.buttonPressed(13))return!0;break;case 14:if(this.gamepad.axes[0]<=-.7||this.gamepad.axes[2]<=-.7||this.stickFloor(9)===.7||this.buttonPressed(14))return!0;break;case 15:if(this.gamepad.axes[0]>.6||this.gamepad.axes[2]>.6||this.stickFloor(9)===-.5||this.buttonPressed(15))return!0;break}return!1}vibration(e){if(!this.gamepad||!this.gamepad.vibrationActuator)return!1;e?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})}stickFloor(...e){if(!this.gamepad)return 0;var t,n=e.length,r;for(t=0;t<n;t++){r=e[t];var i=this.gamepad.axes[r];return typeof i==`number`?Math.floor(i*10)/10:0}return 0}},Oe=class e{constructor(e=0){this.lastCalculatedTimeUnixMs=Date.now(),this.lastCalculatedPlayTimeMs=e}calculateTimeMs(){let e=Date.now(),t=e-this.lastCalculatedTimeUnixMs+this.lastCalculatedPlayTimeMs;return this.lastCalculatedTimeUnixMs=e,this.lastCalculatedPlayTimeMs=t,t}calculatePlayTimeFormat(){return e.formatPlayTimeText(this.calculateTimeMs()/1e3)}static formatPlayTimeText(e){let t=Math.floor(e);return t>=3600*1e4?`9999:99:99`:(`000`+(t/60/60|0)).slice(-4)+`:`+(`0`+(t/60|0)%60).slice(-2)+`:`+(`0`+t%60).slice(-2)}},ke=[`BUTTON_ENTER`,`BUTTON_ESC`,`BUTTON_SIDEBAR`,`BUTTON_FAST`,`BUTTON_SLOW`,`BUTTON_LEFT`,`BUTTON_UP`,`BUTTON_RIGHT`,`BUTTON_DOWN`],Ae=[`BUTTON_LEFT`,`BUTTON_UP`,`BUTTON_RIGHT`,`BUTTON_DOWN`],je=new Set(Ae),Me=class e{constructor(t,n=!1,r=null,i=null,a=null,o=null){if(this._enabled=t!==null,this._visible=n,this._onTouchStart=a||null,this._onTouchEnd=o||null,this._availableButtons=[],this._isTouchingButtons={},this._moveButtonsElement=i,this._buttonWrapperElement=r,this._setVisible(n),this._moveButtonsElement&&(this._moveButtonsElement.style.visibility=`visible`),this._buttonWrapperElement&&(this._buttonWrapperElement.style.visibility=`visible`),t!==null){for(let n in t){let r=t[n];if(!r)continue;let i=n;this._availableButtons.push(i),r.setAttribute(`type`,n),this._isTouchingButtons[i]={prev:!1,current:!1,next:!1};let a=e=>{e.cancelable&&e.preventDefault()};r.addEventListener(`touchstart`,e=>{a(e),this.setTouchInfo(i)}),r.addEventListener(`touchcancel`,e=>{a(e),this.allClear()}),e.isMoveButton(i)?(r.addEventListener(`touchmove`,this._detectMovingMoveButton.bind(this)),r.addEventListener(`touchend`,this.allMoveClear.bind(this))):r.addEventListener(`touchend`,e=>{a(e),this.clearTouchInfo(i)})}i!==null&&i.addEventListener(`touchmove`,this._detectMovingMoveButton.bind(this))}}_detectMovingMoveButton(e){e.preventDefault(),this.allMoveClear();let t=e.targetTouches.item(0);if(!this._moveButtonsElement||t===null)return;let n=this._moveButtonsElement.getBoundingClientRect(),r=document.body.getBoundingClientRect(),i=n.left-r.left+n.width/2,a=n.top-r.top+n.height/2,o=t.pageX-i,s=t.pageY-a;o>=s?o<=-s?this.setTouchInfo(`BUTTON_UP`):this.setTouchInfo(`BUTTON_RIGHT`):o>=-s?this.setTouchInfo(`BUTTON_DOWN`):this.setTouchInfo(`BUTTON_LEFT`)}_setVisible(e){this._moveButtonsElement!==null&&(this._moveButtonsElement.style.display=e?`grid`:`none`),this._buttonWrapperElement!==null&&(this._buttonWrapperElement.style.display=e?`grid`:`none`),this._visible=e}checkTouchButton(e){return this._enabled?this.getButtonState(e)===`TOUCH`:!1}checkTouchingButton(e){if(!this._enabled)return!1;let t=this.getButtonState(e);return t===`TOUCH`||t===`TOUCHING`}getButtonState(e){let t=this._isTouchingButtons[e];if(!this._enabled||t===void 0)return`NONE`;let n=t.prev,r=t.current;return n&&r?`TOUCHING`:r?`TOUCH`:n?`LEAVE`:`NONE`}setTouchInfo(e){let t=this._isTouchingButtons[e];!this._enabled||t===void 0||(t.next=!0)}clearTouchInfo(e){let t=this._isTouchingButtons[e];!this._enabled||t===void 0||(t.next=!1)}allMoveClear(){Ae.forEach(e=>{this._availableButtons.includes(e)&&this.clearTouchInfo(e)})}allClear(){this._availableButtons.forEach(e=>{if(e!==void 0){let t=this._isTouchingButtons[e];t!==void 0&&(t.next=!1)}})}static isMoveButton(e){return je.has(e)}update(){this._availableButtons.forEach(e=>{if(e===void 0)return;let t=this._isTouchingButtons[e];if(t!==void 0)switch(this._isTouchingButtons[e].prev=t.current,this._isTouchingButtons[e].current=t.next,this.getButtonState(e)){case`TOUCH`:this._onTouchStart?.(e);break;case`LEAVE`:this._onTouchEnd?.(e);break}})}toggleVisible(){this._setVisible(!this._visible)}};function Ne(){let e=document.getElementsByTagName(`head`)[0],t=document.createElement(`meta`);t.setAttribute(`name`,`viewport`),e.appendChild(t),Pe()}function Pe(){let e=document.querySelector(`meta[name='viewport']`),t=window.innerWidth,n=window.innerHeight,r=`user-scalable=no`;t>n?r=`width=${Math.floor(t/n*456)},${r}`:t<=n&&(r=`width=576,${r}`),e?.setAttribute(`content`,`${r}`)}function Fe(){return`
10
10
  <div id="wwa-virtualpad-left">
11
11
  <button class="wwa-virtualpad__button" id="wwa-up-button"></button>
12
12
  <button class="wwa-virtualpad__button" id="wwa-left-button"></button>
@@ -28,21 +28,21 @@ var WWA=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}
28
28
  ${n}`);default:throw Error(`マップデータ「${e}」の読み込みに失敗しました。
29
29
  ${n}`)}}async request(){let t=await e.fetch(this.uri);return e.handleError(this.uri,t),await t.arrayBuffer()}},Dn=s(((e,t)=>{t.exports={}})),On=l(Dn()),kn=class extends Tn{constructor(e){super(),this.fileName=e}async request(){return new Promise((e,t)=>{On.default.readFile(this.fileName,(n,r)=>{n&&t(n),e(r.buffer)})})}},An=e=>typeof window<`u`?new En(e):new kn(e),jn=class{constructor(e,t){this.fileName=e,this.eventEmitter=t}async requestAndLoadMapData(){let e=An(this.fileName);try{let t=await e.request();if(!t){this.eventEmitter.dispatch(`error`,{name:`マップデータ取得に失敗しました`,message:`mapdata is empty`});return}let n=this.loadMapData(t);this.eventEmitter.dispatch(`mapData`,n)}catch(e){let t=e.name||``,n=e.message||``;this.eventEmitter.dispatch(`error`,{name:t,message:n})}}loadMapData(e){try{let t=new Uint8Array(e),{byteMapData:n,byteMapLength:r,compressedEndPosition:i}=Cn(t);return new wn(new bn(n,r,this.eventEmitter).extractAllData(),t,i,this.eventEmitter).load()}catch(e){throw e}}},Mn=class{constructor(){this._milisecondTimer=0,this._frameTimer=0,this._points=new Map}addPoint(e,t,n){if(!t&&!n)return;let r=Nn(t,n);switch(this._points.set(e,r),r.type){case`milisecond`:{let e=[...this._points.values()].filter(({type:e})=>e===`milisecond`).map(({value:e})=>e);this._milisecondLimit=Math.max(...e);break}case`frame`:{let e=[...this._points.values()].filter(({type:e})=>e===`frame`).map(({value:e})=>e);this._frameLimit=Math.max(...e)}}}enabled(){return this._points.size>0&&(this._milisecondTimer<this._milisecondLimit||this._frameTimer<this._frameLimit)}tick(e){!this.enabled()||this.isTimeOver()||(this._milisecondTimer+=e,this._frameTimer++)}isOver(e,t){if(this._points.has(e)){let t=this._points.get(e);switch(t.type){case`milisecond`:return this._milisecondTimer>=t.value;case`frame`:return this._frameTimer>=t.value;default:return!1}}return t}isNotOver(e,t){if(this._points.has(e)){let t=this._points.get(e);switch(t.type){case`milisecond`:return this._milisecondTimer<t.value;case`frame`:return this._frameTimer<t.value;default:return!1}}return t}isTimeOver(){return!1}get timeLimit(){return{milisecond:this._milisecondLimit,frame:this._frameLimit}}},Nn=(e,t)=>{if(e)return{value:e,type:`milisecond`};if(t)return{value:t,type:`frame`}},Pn=class{constructor(e,t){this.canvas=new OffscreenCanvas(ln(e),un(t)),this.ctx=this.canvas.getContext(`2d`,{alpha:!0}),this.ctx.imageSmoothingEnabled=!1}getCanvasImage(){return this.canvas}drawCanvas(e,t,n,r,i,a=R.CHIP_SIZE,o=R.CHIP_SIZE){this.ctx.drawImage(e,R.CHIP_SIZE*t,R.CHIP_SIZE*n,R.CHIP_SIZE,R.CHIP_SIZE,r,i,a,o)}drawCanvasFree(e,t,n,r,i){this.ctx.drawImage(e,t,n,r,i)}drawFont(e,t,n,r){r===void 0?this.ctx.fillText(e,t,n):e.split(`
30
30
  `).forEach((e,i)=>{this.ctx.fillText(e,t,n+i*r)})}updateSize(e,t){this.canvas.width=ln(e),this.canvas.height=un(t),this.ctx.imageSmoothingEnabled=!1}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}},Fn=(e,t,n)=>e===`maximum`?{width:R.MAP_WINDOW_WIDTH,height:R.MAP_WINDOW_HEIGHT}:e===`minimumWithMargin`?{width:t+R.CHIP_SIZE*2,height:n+R.CHIP_SIZE*2}:{width:t,height:n},In=(e,t,n)=>e===`maximum`?{x:t,y:n}:e===`minimumWithMargin`?{x:R.CHIP_SIZE,y:R.CHIP_SIZE}:{x:0,y:0},Ln=(e,t,n,r,i)=>e===`maximum`?{x:0,y:0,width:R.MAP_WINDOW_WIDTH,height:R.MAP_WINDOW_HEIGHT}:e===`minimumWithMargin`?{x:t-R.CHIP_SIZE,y:n-R.CHIP_SIZE,width:r*(R.CHIP_SIZE*2),height:i*(R.CHIP_SIZE*2)}:{x:t,y:n,width:r,height:i},Rn=(e,t,n,r,i)=>e===`maximum`?{x:r,y:i}:e===`minimumWithMargin`?{x:R.CHIP_SIZE+t/2,y:R.CHIP_SIZE+n/2}:{x:t/2,y:n/2},zn=class e{constructor(t,n,r){this._registry=n;let{properties:i}=n;this._posBaseX=i.pos?.[0]??0,this._posBaseY=i.pos?.[1]??0,[this._imgMainX,this._imgMainY]=e._getImgPosByPicture(this._registry,!0),[this._imgSubX,this._imgSubY]=e._getImgPosByPicture(this._registry,!1),this._mapCropCache=e._getMapImgPosArray(this._registry,t),this._drawChip=nn(this._imgMainX,this._imgMainY,this._imgSubX,this._imgSubY)||this._mapCropCache!==null,this._repeatX=i.repeat?.[0]??1,this._repeatY=i.repeat?.[1]??1,this._imgFile=r,this._cropX=this._imgFile?1:i.crop?.[0]??1,this._cropY=this._imgFile?1:i.crop?.[1]??1,this._sizeX=i.size?.[0]??(this._imgFile?this._imgFile.width:R.CHIP_SIZE),this._sizeY=i.size?.[1]??(this._imgFile?this._imgFile.height:R.CHIP_SIZE),this._circleRadiusX=i.circle?.[0]??0,this._circleRadiusY=i.circle?.[1]??this._circleRadiusX,this._circleAngle=i.circle?.[2]??0,this._fontStyle=e._getFontValue(i),this._textAlign=e._convertTextAlign(i.textAlign);let a=i.color?.[0]??0,o=i.color?.[1]??0,s=i.color?.[2]??0;this._fillStyle=`rgb(${a}, ${o}, ${s})`,this._moveX=i.move?.[0]??0,this._moveY=i.move?.[1]??0,this._accelX=i.accel?.[0]??0,this._accelY=i.accel?.[1]??0,this._zoomX=i.zoom?.[0]??0,this._zoomY=i.zoom?.[1]??0,this._zoomAccelX=i.zoomAccel?.[0]??0,this._zoomAccelY=i.zoomAccel?.[1]??0,this._anchor=i.anchor??7,this._circleSpeed=i.circle?.[3]??0,this._opacity=i.opacity??100,this._fade=i.fade??0,this._angleRadian=i.angle?i.angle*Math.PI/180:0,this._rotateRadian=i.rotate?i.rotate*Math.PI/180:0,i.text?((i.angle||i.rotate)&&console.warn(`レイヤー${this.layerNumber}番: テキストの描画と回転の併用は、現時点では非推奨です。今後動作が変わる可能性があるので、自己責任でお願いします。`),this._drawCoordType=`maximum`):i.angle||i.rotate?this._drawCoordType=`minimumWithMargin`:this._drawCoordType=`minimum`,this._updatePictureCache();let{width:c,height:l}=Fn(this._drawCoordType,this._totalWidth,this._totalHeight);if(this._canvas=new Pn(c,l),this._timer=new Mn,this._timer.addPoint(`start`,tn(i.time,1,!1),tn(i.timeFrame,1,!1)),this._timer.addPoint(`end`,tn(i.time,0,!0),tn(i.timeFrame,0,!0)),this._timer.addPoint(`startAnim`,i.animTime?.[0],i.animTimeFrame?.[0]),this._timer.addPoint(`endAnim`,i.animTime?.[1],i.animTimeFrame?.[1]),this._timer.addPoint(`wait`,i.wait,i.waitFrame),this._angleRadian!==0){let{x:e,y:t}=Rn(this._drawCoordType,this._totalWidth,this._totalHeight,this._posBaseX,this._posBaseY);this._canvas.ctx.translate(e,t),this._canvas.ctx.rotate(this._angleRadian),this._canvas.ctx.translate(-e,-t)}this.updateCanvasContext(),this._hasAnimation=this.getHasAnimation()}get layerNumber(){return this._registry.layerNumber}get hasAnimation(){return this._hasAnimation}get canvasImage(){return this._canvas.getCanvasImage()}get appearParts(){if(!(!this._registry.properties.map||this._registry.properties.map.length<3))return{partsNumber:this._registry.properties.map[0],x:this._registry.properties.map[1],y:this._registry.properties.map[2],partsType:this._registry.properties.map[3]??_n.OBJECT}}get executeScriptFunctionName(){return this._registry.properties.script}updateCanvasContext(){this._canvas.ctx.globalAlpha=e._roundPercentage(this._opacity)/100,this._canvas.ctx.font=this._fontStyle,this._canvas.ctx.textBaseline=`top`,this._textAlign&&(this._canvas.ctx.textAlign=this._textAlign),this._canvas.ctx.fillStyle=this._fillStyle}draw(e,t){this.clearCanvas();let n=t?this._imgMainX:this._imgSubX,r=t?this._imgMainY:this._imgSubY,{x:i,y:a}=In(this._drawCoordType,this._posDestX,this._posDestY);for(let o=0;o<this._repeatY;o++)for(let s=0;s<this._repeatX;s++){let c=i+this._charaWidth*s,l=a+this._charaHeight*o;if(this._imgFile)this._canvas.drawCanvasFree(this._imgFile,c,l,this._charaWidth,this._charaHeight);else if(this._drawChip)if(this._mapCropCache!==null)this._mapCropCache.forEach((n,r)=>{n.forEach(([n,i,a,o],s)=>{nn(n,i,a,o)&&this._canvas.drawCanvas(e,t?n:a,t?i:o,c+this._chipWidth*s,l+this._chipHeight*r,this._chipWidth,this._chipHeight)})});else for(let t=0;t<this._cropY;t++)for(let i=0;i<this._cropX;i++)this._canvas.drawCanvas(e,n+i,r+t,c+this._chipWidth*i,l+this._chipHeight*t,this._chipWidth,this._chipHeight);this.getHasText()&&this._canvas.drawFont(this._registry.properties.text,c,l,this._registry.properties.lineHeight)}}getDrawPictureCoords(){return Ln(this._drawCoordType,this._posDestX,this._posDestY,this._totalWidth,this._totalHeight)}updateAnimation(){if(this._timer.isNotOver(`startAnim`,!1)||this._timer.isOver(`endAnim`,!1))return;this._posBaseX+=this._moveX,this._posBaseY+=this._moveY,this._moveX+=this._accelX,this._moveY+=this._accelY,this._sizeX+=this._zoomX,this._sizeY+=this._zoomY,this._zoomX+=this._zoomAccelX,this._zoomY+=this._zoomAccelY,this._updatePictureCache();let{width:e,height:t}=Fn(this._drawCoordType,this._totalWidth,this._totalHeight);if(this._canvas.updateSize(e,t),this._circleAngle+=this._circleSpeed,this._fade!==0&&(this._opacity+=this._fade),this._angleRadian!==0||this._rotateRadian!==0){this._angleRadian+=this._rotateRadian;let{x:e,y:t}=Rn(this._drawCoordType,this._totalWidth,this._totalHeight,this._posBaseX,this._posBaseY);this._canvas.ctx.translate(e,t),this._canvas.ctx.rotate(this._angleRadian),this._canvas.ctx.translate(-e,-t)}this.updateCanvasContext()}_updatePictureCache(){this._chipWidth=rn(this._sizeX),this._chipHeight=rn(this._sizeY),this._charaWidth=this._chipWidth*this._cropX,this._charaHeight=this._chipHeight*this._cropY,this._totalWidth=this._charaWidth*this._repeatX,this._totalHeight=this._charaHeight*this._repeatY,this._posDestX=Math.floor(an(on(this._posBaseX,this._circleRadiusX,this._circleAngle),this._charaWidth,this._anchor)),this._posDestY=Math.floor(sn(cn(this._posBaseY,this._circleRadiusY,this._circleAngle),this._charaHeight,this._anchor))}isNotStarted(){return this._timer.isNotOver(`start`,!1)}tickTime(e){this._timer.tick(e)}isDeadlineOver(){return this._timer.isOver(`end`,!1)}isStartTimeOver(){return this._timer.isOver(`start`,!0)}isWaiting(){return this._timer.isNotOver(`wait`,!1)}clearCanvas(){this._canvas.clear()}getRegistryData(){return this._registry}getNextPicturePartsInfo(){let e=Array.isArray(this._registry.properties.next)&&this._registry.properties.next[0]?{layerNumber:this._registry.layerNumber,partsNumber:this._registry.properties.next[0],partsType:this._registry.properties.next[1]??_n.OBJECT,connectProperties:!!this._registry.properties.next[2]}:void 0,t=Array.isArray(this._registry.properties.create)?this._registry.properties.create.filter(Array.isArray).map(e=>({layerNumber:e[0],partsNumber:e[1],partsType:e[2]??_n.OBJECT,connectProperties:!!e[3]})):[];return e?t.concat(e):t}getNextPictureProperties(){let e={...this._registry.properties};return delete e.next,delete e.create,{...e,pos:[this._posBaseX,this._posBaseY],move:[this._moveX,this._moveY],size:[this._sizeX,this._sizeY],zoom:[this._zoomX,this._zoomY],circle:[this._circleRadiusX,this._circleRadiusY,this._circleAngle,this._circleSpeed],opacity:this._opacity}}getTriggerPartsCoord(){return new S(this._registry.triggerPartsX,this._registry.triggerPartsY)}getHasAnimation(){return this._moveX!==0||this._moveY!==0||this._accelX!==0||this._accelY!==0||this._zoomX!==0||this._zoomY!==0||this._zoomAccelX!==0||this._zoomAccelY!==0||this._circleSpeed!==0||this._fade!==0||this._rotateRadian!==0}getHasText(){return this._registry.properties.text}static _getImgPosByPicture(e,t){let{properties:n}=e;return n.imgMap?.[0]!==void 0&&n.imgMap?.[1]!==void 0?[0,0]:n.img?.[0]!==void 0&&n.img?.[1]!==void 0?t?[n.img[0],n.img[1]]:n.img[2]!==void 0&&n.img[3]!==void 0?[n.img[2],n.img[3]]:[n.img[0],n.img[1]]:t||e.imgPosX2===0&&e.imgPosY2===0?[e.imgPosX,e.imgPosY]:[e.imgPosX2,e.imgPosY2]}static _getMapImgPosArray(e,t){let{properties:n}=e,r=n.imgMap?.[0]??-1,i=n.imgMap?.[1]??-1;if(r<0||i<0)return null;let a=n.crop?.[0]??1,o=n.crop?.[1]??1,s=n.imgMap?.[2]!==void 0&&n.imgMap[2]>=1?_n.MAP:_n.OBJECT,c=[];for(let e=0;e<o;e++){let n=[];for(let o=0;o<a;o++){let a=t.getPartsID(new S(r+o,i+e),s);if(a===0)n.push([0,0,0,0]);else{let e=s===_n.MAP?t.getMapInfo(a):t.getObjectInfo(a);s===_n.MAP||e[R.ATR_X2]===0&&e[R.ATR_Y2]===0?n.push([e[R.ATR_X]/R.CHIP_SIZE,e[R.ATR_Y]/R.CHIP_SIZE,e[R.ATR_X]/R.CHIP_SIZE,e[R.ATR_Y]/R.CHIP_SIZE]):n.push([e[R.ATR_X]/R.CHIP_SIZE,e[R.ATR_Y]/R.CHIP_SIZE,e[R.ATR_X2]/R.CHIP_SIZE,e[R.ATR_Y2]/R.CHIP_SIZE])}}c.push(n)}return c}static _getFontValue(e){if(e.font)return e.font;let t=getComputedStyle(U(`wwa-wrapper`));return e.fontSize===void 0&&e.fontFamily===void 0&&e.italic===void 0&&e.bold===void 0?t.font:`${e.italic?`italic`:``} ${e.bold?`bold`:``} ${e.fontSize?`${e.fontSize}px`:t.fontSize} ${e.fontFamily&&e.fontFamily.length>0?e.fontFamily:t.fontFamily}`}static _convertTextAlign(e){return e?[`center`,`end`,`left`,`right`,`start`].includes(e)?e:(console.warn(`textAlign プロパティで不正な値が検出されました。: ${e}`),null):null}static _roundPercentage(e){return e<0?0:e>100?100:e}},Bn=async e=>fetch(e).then(t=>t.status===200||t.status===304?{kind:`data`,data:t}:{kind:`httpError`,errorMessage:`ファイル ${e} が読み込めませんでした。ステータスコード: ${t.status}`}).catch(t=>({kind:`connectionError`,errorMessage:`ファイル ${e} が読み込めませんでした。通信状態がいい場所で再度お試しください。`})).then(async e=>e.kind===`data`?{kind:`data`,data:await e.data.json()}:e).catch(t=>({kind:`brokenJson`,errorMessage:`ファイル ${e} が壊れています。`})),Vn=class e{constructor(t,n){this._wwa=t,this._pictures=new Map,this._anonymousPictures=[],this._externalImageFiles=new Map,this._frameTimerValue=e._getNowFrameValue(),this._setupExternalImageFiles(n)}async _setupExternalImageFiles(e){if(!e)return;let t=await Bn(e);if(t){if(t.kind!==`data`){console.warn(`ピクチャ画像の定義ファイル ${e} が見つかりませんでした。エラーメッセージ: ${t.errorMessage}`);return}if(!t.data||typeof t.data!=`object`){console.warn(`ピクチャ画像の定義ファイル ${e} が正しい形式で書かれていません。`);return}if(`files`in t.data){let{files:n}=t.data;typeof n==`object`?Object.entries(t.data.files).forEach(([e,t])=>{this._externalImageFiles.set(e,{status:`loading`});let n=new Image;n.src=t,n.onerror=n=>{console.warn(typeof n==`string`?`ピクチャ画像ファイル ${t} が見つかりませんでした。エラーメッセージ: ${n}`:`ピクチャ画像ファイル ${t} が見つかりませんでした。`),this._externalImageFiles.set(e,{status:`failed`})},n.onload=()=>{this._externalImageFiles.set(e,{status:`success`,element:n})}}):console.warn(`ピクチャ画像の定義ファイル ${e} の files が正しい形式で書かれていません。`)}}}static _getNowFrameValue(){return performance.now()}registerPicture(e){let t=Object.keys(e.properties).filter(e=>!Je.some(({name:t})=>t===e));if(t.length>0)throw Error(`不明なプロパティ名 ${t.map(e=>`"${e}"`).join(`, `)} が検出されました。`);let n;if(e.properties.imgFile){let t=this._externalImageFiles.get(e.properties.imgFile);t?t.status===`loading`?console.warn(`ピクチャ画像ファイル ${e.properties.imgFile} はまだ読み込みを完了していません。`):t.status===`failed`?console.warn(`ピクチャ画像ファイル ${e.properties.imgFile} を表示することができません。画像ファイルの Path が間違っていないかご確認ください。`):n=t.element:console.warn(`ピクチャ画像ファイル ${e.properties.imgFile} が定義に含まれていません。定義ファイルがあるかご確認ください。`)}let r=e.properties.sound??e.soundNumber;if(r&&this._wwa.playSound(r),Zt(e.layerNumber))Qt(e.layerNumber)?this._anonymousPictures.push(new zn(this._wwa,e,n)):(this._pictures.set(e.layerNumber,new zn(this._wwa,e,n)),this._pictures=new Map([...this._pictures.entries()].sort(([,e],[,t])=>e.layerNumber-t.layerNumber)));else throw Error(`指定したレイヤー番号 ${e.layerNumber}番はこのバージョンでは無効です!`)}registerPictureFromRawRegistry(e,t,n,r){return this.registerPicture(en(r?{...e,properties:{...r,...e.properties}}:e,this._wwa.generateTokenValues({id:t,type:n,position:new S(e.triggerPartsX,e.triggerPartsY)}))),this.getPictureRegistryData()}registerPictureFromRawText(e,t){let n=Jt({imgPosX:0,imgPosY:0,imgPosX2:0,imgPosY2:0,layerNumber:e,triggerPartsX:0,triggerPartsY:0,soundNumber:0,propertiesText:t});return this.registerPicture($t(n)),this.getPictureRegistryData()}registerPictureFromObject(e,t){return this.registerPicture($t({imgPosX:0,imgPosY:0,imgPosX2:0,imgPosY2:0,layerNumber:e,triggerPartsX:0,triggerPartsY:0,soundNumber:0,properties:t})),this.getPictureRegistryData()}deletePicture(e){return Qt(e)?(this._anonymousPictures.forEach(e=>{e.clearCanvas()}),this._anonymousPictures.splice(0),this.getPictureRegistryData()):(this._pictures.has(e)&&(this._pictures.get(e).clearCanvas(),this._pictures.delete(e)),this.getPictureRegistryData())}clearAllPictures(){this._pictures.forEach(e=>{e.clearCanvas()}),this._anonymousPictures.forEach(e=>{e.clearCanvas()}),this._pictures.clear(),this._anonymousPictures.splice(0)}forEachPictures(e){this._anonymousPictures.forEach(e),this._pictures.forEach(e)}updateAllPicturesCache(e,t){this.forEachPictures(n=>{n.isNotStarted()||n.draw(e,t)})}updateFrameTimerValue(){this._frameTimerValue=e._getNowFrameValue()}updatePicturesAnimation(t,n){let r=e._getNowFrameValue()-this._frameTimerValue;this.forEachPictures(e=>{if(e.tickTime(r),!e.isNotStarted()){if(e.isDeadlineOver()){let t=e.layerNumber,n=e.getNextPicturePartsInfo(),r=e.appearParts,i=e.executeScriptFunctionName,a=e.getNextPictureProperties(),o=e.getTriggerPartsCoord();this._wwa.deletePictureRegistry(t);for(let e of n)this._wwa.setPictureRegistry(e.layerNumber,e.partsNumber,e.partsType,o,e.connectProperties?a:void 0);r!==void 0&&this._wwa.setPartsOnPosition(r.partsType,r.partsNumber,new S(r.x,r.y)),i&&this._wwa.callUserScript(i);return}e.hasAnimation&&(e.updateAnimation(),e.draw(t,n))}})}isWaiting(){for(let e of this._pictures.values())if(e.isWaiting())return!0;for(let e of this._anonymousPictures)if(e.isWaiting())return!0;return!1}getPictureRegistryData(){return Array.from(this._pictures.values()).map(e=>e.getRegistryData())}},Hn=class{constructor(e,t,n){this.cvs=document.createElement(`canvas`),this.cvs.width=e,this.cvs.height=t,this.ctx=this.cvs.getContext(`2d`,{alpha:n}),this._isTransparent=n}drawCanvas(e,t,n,r,i,a=R.CHIP_SIZE,o=R.CHIP_SIZE){this.ctx.drawImage(e,R.CHIP_SIZE*t,R.CHIP_SIZE*n,R.CHIP_SIZE,R.CHIP_SIZE,r,i,a,o)}clear(){this.clearRect(0,0,this.cvs.width,this.cvs.height)}clearRectWithLowerYLimit(e){this.clearRect(0,0,this.cvs.width,e)}clearRect(e,t,n,r){this._isTransparent?this.ctx.clearRect(e,t,n,r):(this.ctx.fillStyle=`#9E9E9E`,this.ctx.fillRect(e,t,n,r))}},Un=class{_load(){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`,()=>{this.createFrame(),this._loadCompleteCallBack()}),this._image.addEventListener(`error`,()=>{throw Error(`Image Load Failed!!
31
- file name:`+this._fileName)}),this._image.src=this._fileName,this._isLoaded=!0)}createFrame(){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,R.MAP_WINDOW_WIDTH-R.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,R.MAP_WINDOW_HEIGHT-R.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,R.MAP_WINDOW_WIDTH-R.CHIP_SIZE,R.MAP_WINDOW_HEIGHT-R.CHIP_SIZE);for(var e=1;e<R.H_PARTS_NUM_IN_WINDOW-1;e++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,R.CHIP_SIZE*e,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,R.CHIP_SIZE*e,R.MAP_WINDOW_HEIGHT-R.CHIP_SIZE);for(var e=1;e<R.V_PARTS_NUM_IN_WINDOW-1;e++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,R.CHIP_SIZE*e),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,R.MAP_WINDOW_WIDTH-R.CHIP_SIZE,R.CHIP_SIZE*e)}updateEffects(e){var t;if(e){var n=e.length,r;for(t=0;t<n;t++){var i=e[t];r=this._effectCanvases[t],r?r.clear():r=this._effectCanvases[t]=new Hn(R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,!0);for(var a=0;a<R.V_PARTS_NUM_IN_WINDOW;a++)for(var o=0;o<R.H_PARTS_NUM_IN_WINDOW;o++)r.drawCanvas(this._image,i.x,i.y,o*R.CHIP_SIZE,a*R.CHIP_SIZE)}}}restorePictures(e){this.picture.clearAllPictures(),e.forEach(e=>{this.picture.registerPicture(e)})}updateAllPicturesCache(e=!0){this.picture.updateAllPicturesCache(this._image,e)}updatePicturesAnimation(e=!0){this.picture.updatePicturesAnimation(this._image,e)}drawFrame(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-1),R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE,0,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-1),R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,R.CHIP_SIZE,R.CHIP_SIZE,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-2),0,R.CHIP_SIZE,R.CHIP_SIZE,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-1),R.CHIP_SIZE,R.CHIP_SIZE,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-2),R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-1),R.CHIP_SIZE,R.CHIP_SIZE,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-2))}drawEffect(e){var t=this._effectCanvases[e];t&&this._ctx.drawImage(t.cvs,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW)}drawPictures(){this.picture.forEachPictures(e=>{let{x:t,y:n,width:r,height:i}=e.getDrawPictureCoords();this._ctx.drawImage(e.canvasImage,0,0,r,i,t,n,r,i)})}drawCanvas(e,t,n,r){if(!this._isLoaded)throw Error(`No image was loaded.`);this._ctx.drawImage(this._image,R.CHIP_SIZE*e,R.CHIP_SIZE*t,R.CHIP_SIZE,R.CHIP_SIZE,n,r,R.CHIP_SIZE,R.CHIP_SIZE)}drawCanvasWithSize(e,t,n,r,i,a){if(!this._isLoaded)throw Error(`No image was loaded.`);this._ctx.drawImage(this._image,R.CHIP_SIZE*e,R.CHIP_SIZE*t,R.CHIP_SIZE*n,R.CHIP_SIZE*r,i,a,R.CHIP_SIZE*n,R.CHIP_SIZE*r)}drawCanvasWithUpperYLimit(e,t,n,r,i){if(!this._isLoaded)throw Error(`No image was loaded.`);var a=Math.max(0,r+R.CHIP_SIZE-i);a>=R.CHIP_SIZE||this._ctx.drawImage(this._image,R.CHIP_SIZE*e,R.CHIP_SIZE*t,R.CHIP_SIZE,R.CHIP_SIZE-a,n,r,R.CHIP_SIZE,R.CHIP_SIZE)}copyCanvas(e,t){return(n,r,i,a,o)=>{if(!this._isLoaded)throw Error(`No image was loaded.`);let s=Math.max(0,t(a,o));s>=R.CHIP_SIZE||e.ctx.drawImage(this._image,R.CHIP_SIZE*n,R.CHIP_SIZE*r+s,R.CHIP_SIZE,R.CHIP_SIZE-s,i,a+s,R.CHIP_SIZE,R.CHIP_SIZE)}}copyBackCanvasWithUpperYLimit(e,t,n,r,i){this.copyCanvas(this._backCanvas,(e,t)=>e+R.CHIP_SIZE-t)(e,t,n,r,i)}copyBackCanvasWithLowerYLimit(e,t,n,r,i){this.copyCanvas(this._backCanvas,(e,t)=>t-e)(e,t,n,r,i)}copyObjectCanvasWithUpperYLimit(e,t,n,r,i,a){this.copyCanvas(this._objectCanvases[e],(e,t)=>e+R.CHIP_SIZE-t)(t,n,r,i,a)}copyObjectCanvasWithLowerYLimit(e,t,n,r,i,a){this.copyCanvas(this._objectCanvases[e],(e,t)=>t-e)(t,n,r,i,a)}drawBackCanvas(){if(!this._isLoaded)throw Error(`No image was loaded.`);this._ctx.drawImage(this._backCanvas.cvs,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW)}drawObjectCanvas(e){if(!this._isLoaded)throw Error(`No image was loaded.`);this._ctx.drawImage(this._objectCanvases[e].cvs,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW)}clearBackCanvas(){this._backCanvas.clear()}clearBackCanvasWithLowerYLimit(e){this._backCanvas.clearRectWithLowerYLimit(e)}clearObjectCanvases(){var e;for(e=0;e<2;e++)this._objectCanvases[e].clear()}clearObjectCanvasesWithLowerYLimit(e){var t;for(t=0;t<2;t++)this._objectCanvases[t].clearRectWithLowerYLimit(e)}drawCanvasWithLowerYLimit(e,t,n,r,i){if(!this._isLoaded)throw Error(`No image was loaded.`);var a=Math.max(0,i-r);a>=R.CHIP_SIZE||this._ctx.drawImage(this._image,R.CHIP_SIZE*e,R.CHIP_SIZE*t+a,R.CHIP_SIZE,R.CHIP_SIZE-a,n,r+a,R.CHIP_SIZE,R.CHIP_SIZE)}clearCanvas(e,t,n,r){this._ctx.clearRect(e,t,n,r)}drawBase(e,t,n,r){this._ctx.fillStyle=`#9E9E9E`,this._ctx.fillRect(e,t,n,r)}setFrameImage(e){this._frameCoord=e,this.createFrame()}constructor(e,t,n,r,i,a){this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new Hn(R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new Hn(R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],this.picture=new Vn(r,i);var o;for(o=0;o<2;o++)this._objectCanvases[o]=new Hn(R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=e,this._fileName=t,this._loadCompleteCallBack=a,this._load(),this._frameCoord=n.clone(),this.cpPartsLog=new S(0,0)}},Wn=class{constructor(e){this._position=null,this.reset(e)}setPlayer(e){this._player=e}isResetting(){return this._isResetting}getPosition(){return this._position}getPreviousPosition(){return this._positionPrev}resetPreviousPosition(){this._positionPrev=null}move(e){var t=de[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(e,t*(R.H_PARTS_NUM_IN_WINDOW-1),t*(R.V_PARTS_NUM_IN_WINDOW-1))}getTransitionStepNum(){return this._transitionStep}advanceTransitionStepNum(){return++this._transitionStep,this._transitionStep===R.V_PARTS_NUM_IN_WINDOW&&(this._isResetting=!1,this._transitionStep=0),this._transitionStep}isFinalStep(){if(this._isResetting===!1)throw Error(`リセット中ではありません。`);return this._transitionStep===R.V_PARTS_NUM_IN_WINDOW-1}reset(e){this._positionPrev=this._position,this._position=e.getDefaultCameraPosition(),this._transitionStep=0,this._isResetting=!0}},Gn=class{getPosition(){return this._position}constructor(e){this._position=e}},Kn=class extends Gn{constructor(e){super(e)}},qn=class extends Kn{move(){if(this.isControllable()){this.controll(this._dir);return}if(this._state===2){try{this._camera.move(this._dir)}catch{}this._isOnCameraStopPosition()&&(this._state=0,this._wwa.callCameraMoveUserDefineFunction())}else if(this._state===1){try{var e=this._position.getNextFramePosition(this._dir,de[this._speedIndex],de[this._speedIndex])}catch{}e.isJustPosition()&&(this._state=0,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._wwa.callMoveUserDefineFunction()),this._position=e}}controll(e){var t,n;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=e;try{t=this._position.getNextFramePosition(this._dir,de[this._speedIndex],de[this._speedIndex]),n=this._position.getNextJustPosition(e)}catch{return}if(this._isOnCameraMovingPosition()){if(this._wwa.getMapIdByPosition(n)!==0||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=2}catch{this._state=0}return}if(!this.canMoveTo(n)){this._wwa.getMapTypeByPosition(n)===R.MAP_WALL&&this._wwa.checkMap(n.getPartsCoord()),this._wwa.checkObject(n.getPartsCoord());return}this._position=t,this._state=1,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(e),R.ATR_TYPE)!==R.MAP_LOCALGATE&&this._wwa.moveObjects(!0)}}setDir(e){this._isPreparedForLookingAround=!1,this._dir=e}canMoveTo(e){return e===null?!1:this._wwa.debug?!0:(this._wwa.getMapWidth(),e.getPartsCoord(),e.getOffsetCoord(),this._wwa.getMapIdByPosition(e)===0&&!this._wwa.isOldMap()||this._wwa.getMapTypeByPosition(e)===R.MAP_WALL?!1:this._wwa.getObjectIdByPosition(e)===0||this._wwa.getObjectTypeByPosition(e)===R.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(e,R.ATR_MODE)===R.PASSABLE_OBJECT?!0:this._wwa.getObjectTypeByPosition(e)===R.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(e,R.ATR_NUMBER)===R.PASSABLE_OBJECT?!this.hasItem(this._wwa.getObjectAttributeByPosition(e,R.ATR_ITEM)):!1)}isMoving(){return this._state==1||this._state==2}_isOnCameraMovingPosition(){var e=this._camera.getPosition().getPartsCoord(),t=this.getPosition().getPartsCoord();return t.x-e.x===R.H_PARTS_NUM_IN_WINDOW-1&&this._dir===E.RIGHT||t.x===e.x&&this._dir===E.LEFT||t.y-e.y===R.V_PARTS_NUM_IN_WINDOW-1&&this._dir===E.DOWN||t.y===e.y&&this._dir===E.UP}_isOnCameraStopPosition(){var e=this._camera.getPosition().getPartsCoord(),t=this.getPosition().getPartsCoord();return t.x-e.x===R.H_PARTS_NUM_IN_WINDOW-1&&this._dir===E.LEFT||t.x===e.x&&this._dir===E.RIGHT||t.y-e.y===R.V_PARTS_NUM_IN_WINDOW-1&&this._dir===E.UP||t.y===e.y&&this._dir===E.DOWN}isControllable(){var e=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===0&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==R.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==R.MAP_URLGATE||!this._wwa.isPrevFrameEventExecuted())&&this._moveMacroWaitingRemainMoves===0&&this._moveObjectAutoExecTimer===0&&!e&&this._wwa.canInput()}getCopyOfItemBox(){return this._itemBox.slice()}getDir(){return this._dir}isMovingImage(){return this._isMovingImage}toggleMovingImage(){this._isMovingImage?this._isMovingImage=!1:this._isMovingImage=!0}getEnergyMax(){return this._energyMax}isJumped(){return this._state===5||this._state===9}setMessageWaiting(){this._state=3}setManualPause(e){if(!this.isControllable()){this._state===3&&console.warn(`メッセージが表示されるパーツではマニュアルポーズはできません。`);return}this._state=4,this._manualPauseInformation=e}isWaitingMessageOrManualPause(){return[3,4].includes(this._state)}isWaitingMessage(){return this._state===3}isManualPause(){return this._state===4}getManualPauseInformation(){return this._manualPauseInformation}isDelayFrame(){return this._messageDelayFrameCount>0}updateDelayFrame(){this._messageDelayFrameCount--}setDelayFrame(){this._messageDelayFrameCount=1}clearWaitingMessageOrManualPause(){this._state===4&&(this._manualPauseInformation=void 0);let e=this.isWaitingMessageOrManualPause();!e&&this._state!==9||(e?this._state=0:this._state===9&&(this._state=5),this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=R.PLAYER_LOOKING_AROUND_START_FRAME))}setEstimateWindowWating(){this._state=7}isWaitingEstimateWindow(){return this._state===7}clearEstimateWindowWaiting(){this._state===7&&(this._state=0)}setPasswordWindowWating(){this._state=8}isWaitingPasswordWindow(){return this._state===8}clearPasswordWindowWaiting(){this._state===8&&(this._state=0)}isPartsEventExecuted(){return this._isPartsEventExecuted}resetEventExecutionInfo(){this._isPartsEventExecuted=!1}getLastExecPartsIDOnSamePosition(e){return e===j.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID}setLastExecInfoOnSamePosition(e,t){e===j.MAP?this._samePosLastExecutedMapID=t:this._samePosLastExecutedObjID=t}processAfterJump(){this._state!==5&&this._state!==9||--this._jumpWaitFramesRemain===0&&(this._state=this._state===5?0:3)}jumpTo(e){var t=this._camera.getPosition();return this.getPosition(),this._position.equals(e)?!1:(this._position=e,e.isInCameraRange(this._camera,!0)||this._camera.reset(e),this._state=this._state===3?9:5,this._jumpWaitFramesRemain=R.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,e.hasLocalGate()?this._dir=E.DOWN:e.getPartsCoord().y<=this._wwa.getMapWidth()-2&&e.getNextJustPosition(E.DOWN).hasLocalGate()?this._dir=E.UP:e.getPartsCoord().y>=1&&e.getNextJustPosition(E.UP).hasLocalGate()?this._dir=E.DOWN:e.getPartsCoord().x<=this._wwa.getMapWidth()-2&&e.getNextJustPosition(E.RIGHT).hasLocalGate()?this._dir=E.LEFT:e.getPartsCoord().x>=1&&e.getNextJustPosition(E.LEFT).hasLocalGate()?this._dir=E.RIGHT:this._dir=E.DOWN,this._camera.getPosition().equals(t)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=R.PLAYER_LOOKING_AROUND_START_FRAME),this._wwa.callJumpGateUserDefineFunction(),!0)}systemJumpTo(e){this._position=e,this._camera.reset(e),this._camera.resetPreviousPosition(),this._state=5,this._jumpWaitFramesRemain=R.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=E.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=R.PLAYER_LOOKING_AROUND_START_FRAME}addStatusAll(e){return this._status.add(e),this.isDead()&&(this._status.energy=0),this._energyMax!==0&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),this._status}setEnergyMax(e){return this._energyMax=e,e!==0&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),e}setEnergy(e){return this._status.energy=e,this.isDead()&&(this._status.energy=0),this._energyMax!==0&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),e}damage(e){this._status.energy=Math.max(0,this._status.energy-e),this.isDead()&&(this._status.energy=0),this._energyMax!==0&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox()}setStrength(e){return this._status.strength=e,this.updateStatusValueBox(),e}setDefence(e){return this._status.defence=e,this.updateStatusValueBox(),e}setGold(e){return this._status.gold=e,this.updateStatusValueBox(),e}getStatus(){return this._status.plus(this._equipStatus)}getStatusWithoutEquipments(){return this._status.plus(new b(0,0))}getStatusOfEquipments(){return this._equipStatus.plus(new b(0,0))}updateStatusValueBox(){let 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):``,this._wwa._messageWindow?.update(),this._wwa.updateScore()}updateItemBox(e){for(let t=0;t<this._itemBoxElement.length;t++){let n=this._itemBoxElement[t],r=Le(`#item`+t);if(this._itemBox[t]===0){n.style.backgroundPosition=`-40px 0px`,this.disposeItemEffect(t,this._itemBoxElement[t],r);continue}let i=this._wwa.getObjectCropXById(this._itemBox[t]),a=this._wwa.getObjectCropYById(this._itemBox[t]);if(!e||t!==e.insertPos-1){n.style.backgroundPosition=`-`+i+`px -`+a+`px`,this.disposeItemEffect(t,this._itemBoxElement[t],r);continue}let o=e.itemScreenPixelCoord.x-e.itemBoxScreenPixelCoord.x,s=e.itemScreenPixelCoord.y-e.itemBoxScreenPixelCoord.y,c=-o*R.DEFAULT_FRAME_INTERVAL/R.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,l=e.overwrittenObjectId===0||e.overwrittenObjectId===void 0,u=l?e.itemBoxBackgroundImageCoord.x:this._wwa.getObjectCropXById(e.overwrittenObjectId),d=l?e.itemBoxBackgroundImageCoord.y:this._wwa.getObjectCropYById(e.overwrittenObjectId);n.style.left=o+`px`,n.style.top=s+`px`,typeof this.itemEffectStartTimers[t]==`number`&&clearInterval(this.itemEffectStartTimers[t]),this.itemEffectStartTimers[t]=window.setTimeout(()=>{this.itemEffectStartTimers[t]=void 0,this.startItemEffect(t,n,r,{target:{x:i,y:a},overwritten:{x:u,y:d}},c)},R.DEFAULT_FRAME_INTERVAL)}}startItemEffect(e,t,n,r,i){let a=n.querySelector(this.overwittenItemSelector);a&&n.removeChild(a);let o=document.createElement(`div`);o.classList.add(this.overwittenItemClassName),o.style.backgroundPosition=`-`+r.overwritten.x+`px -`+r.overwritten.y+`px`,o.style.backgroundImage=n.style.backgroundImage,n.appendChild(o),t.style.backgroundPosition=`-`+r.target.x+`px -`+r.target.y+`px`,t.style.transitionDuration=i+`ms`,t.style.transitionProperty=`left,top`,t.style.transitionTimingFunction=`linear`,t.style.left=`0`,t.style.top=`0`,n.classList.add(this.itemTransitioningClassName),t.addEventListener(`transitionend`,()=>{this.disposeItemEffect(e,t,n)},{once:!0})}disposeItemEffect(e,t,n){typeof this.itemEffectStartTimers[e]==`number`&&(clearInterval(this.itemEffectStartTimers[e]),this.itemEffectStartTimers[e]=void 0),t.style.transitionDuration=`0s`,t.style.transitionProperty=``,t.style.left=`0`,t.style.top=`0`,n.classList.contains(this.itemTransitioningClassName)&&n.classList.remove(this.itemTransitioningClassName);let r=n.querySelector(this.overwittenItemSelector);r&&n.removeChild(r)}isDead(){return this._status.energy<=0}addItem(e,t=0,n=!1,r){var i,a,o,s=this._wwa.getObjectAttributeById(e,R.ATR_NUMBER),c=0;if(t===0&&s!==0&&(t=s),t===0){if(e===0)return;if(i=this._getBlankItemPos(),i===R.ITEMBOX_IS_FULL)throw this._wwa.setEvalCalcWwaNodeEarnedItem(e,-1),this._wwa.callGetItemFullUserDefineFunction(),this._wwa.clearEvalCalcWwaNodeEarnedItem(),Error(`これ以上、アイテムを持てません。`);c=this._itemBox[i-1],this._forceSetItemBox(i,e)}else if(n===!1)if(i=t,o=this._itemBox[i-1],this._wwa.getObjectAttributeById(o,R.ATR_NUMBER)!==this._wwa.getObjectAttributeById(e,R.ATR_NUMBER))if(a=this._getBlankItemPos(),a!==R.ITEMBOX_IS_FULL)this._forceSetItemBox(a,o),this._forceSetItemBox(i,e);else throw this._wwa.setEvalCalcWwaNodeEarnedItem(e,-1),this._wwa.callGetItemFullUserDefineFunction(),this._wwa.clearEvalCalcWwaNodeEarnedItem(),Error(`これ以上、アイテムを持てません。`);else c=this._itemBox[i-1],this._forceSetItemBox(i,e);else i=t,c=this._itemBox[i-1],this._forceSetItemBox(i,e);this._updateEquipmentStatus(),this.updateItemBox(r?{insertPos:i,itemScreenPixelCoord:r.screenPixelCoord,itemBoxBackgroundImageCoord:r.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new S(R.MAP_WINDOW_WIDTH+(i-1)%3*R.CHIP_SIZE,R.ITEMBOX_TOP_Y+Math.floor((i-1)/3)*R.CHIP_SIZE),overwrittenObjectId:c}:void 0)}_forceSetItemBox(e,t){var n=this,r=Re(`#item`+(e-1)+`>.item-click-border`),i=this._wwa.getObjectAttributeById(t,R.ATR_MODE);if(this.removeItemByItemPosition(e),this._itemBox[e-1]=t,this._wwa.setEvalCalcWwaNodeEarnedItem(t,e),this._wwa.callGetItemUserDefineFunction(),this._wwa.clearEvalCalcWwaNodeEarnedItem(),t!==0&&i!==te.NORMAL){let t=this._wwa.resolveSystemMessage(g.ITEM_SELECT_TUTORIAL);this._isClickableItemGot||=(t!==`BLANK`&&this._wwa.registerSystemMessagePage(t),!0),r.style.display=`block`,(e=>{n._itemUsingEvent[e-1]=()=>{(n.isControllable()||n._wwa._messageWindow.isItemMenuChoice())&&(n._wwa._itemMenu.close(),n._wwa._setNextPage(),n._wwa.onselectitem(e))}})(e),r.addEventListener(`click`,this._itemUsingEvent[e-1])}}_getBlankItemPos(){var e;for(e=1;e<this._itemBox.length+1;e++)if(this._itemBox[e-1]===0)return e;return R.ITEMBOX_IS_FULL}_updateEquipmentStatus(){var e,t=new b(0,0);for(e=0;e<R.ITEMBOX_SIZE;e++)this._itemBox[e]!==0&&(t.strength+=this._wwa.getObjectAttributeById(this._itemBox[e],R.ATR_STRENGTH),t.defence+=this._wwa.getObjectAttributeById(this._itemBox[e],R.ATR_DEFENCE));var n=t.minus(this._equipStatus);this._wwa.setStatusChangedEffect(n),this._equipStatus=t,this.updateStatusValueBox()}hasItem(e){for(var t=0;t<R.ITEMBOX_SIZE;t++)if(this._itemBox[t]===e)return!0;return!1}canUseItem(e){var t=this._itemBox[e-1];return!(t===0||this._wwa.getObjectAttributeById(t,R.ATR_MODE)===te.NORMAL)}useItem(){var e=this._itemBox[this._readyToUseItemPos1To12-1];this._wwa.getObjectAttributeById(e,R.ATR_MODE)!==te.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos1To12);var t=U(`item`+(this._readyToUseItemPos1To12-1));return setTimeout(()=>{t.classList.contains(`onpress`)&&t.classList.remove(`onpress`)},R.DEFAULT_FRAME_INTERVAL),this._wwa.setEvalCalcWwaNodeEarnedItem(e,this._readyToUseItemPos1To12),this._wwa.callUseItemUserDefineFunction(),this._wwa.clearEvalCalcWwaNodeEarnedItem(),this._isReadyToUseItem=!1,this._readyToUseItemPos1To12=void 0,e}canHaveMoreItems(){return this._getBlankItemPos()!==R.ITEMBOX_IS_FULL}removeItemByItemPosition(e){var t;this._itemBox[e-1]!==0&&(this._wwa.getObjectAttributeById(this._itemBox[e-1],R.ATR_MODE)!==te.NORMAL&&(t=Re(`#item`+(e-1)+`>.item-click-border`),t.removeEventListener(`click`,this._itemUsingEvent[e-1]),t.style.display=`none`),this._itemBox[e-1]=0,this._updateEquipmentStatus(),this.updateItemBox())}removeItemByPartsID(e){var t;if(!this.hasItem(e))throw Error(`アイテムを持っていない`);for(var n=0;n<R.ITEMBOX_SIZE;n++)if(this._itemBox[n]===e){this._wwa.getObjectAttributeById(this._itemBox[n],R.ATR_MODE)!==te.NORMAL&&(t=Re(`#item`+n+`>.item-click-border`),t.removeEventListener(`click`,this._itemUsingEvent[n]),t.style.display=`none`),this._itemBox[n]=0,this._updateEquipmentStatus(),this.updateItemBox();return}}clearItemBox(){for(var e=1;e<=R.ITEMBOX_SIZE;e++)this.removeItemByItemPosition(e);this._updateEquipmentStatus(),this.updateItemBox()}hasGold(e){return this._status.gold>=e}payGold(e){if(!this.hasGold(e))throw Error(`お金が足りない`);this.setGold(this._status.gold-e)}earnGold(e){this.setGold(this._status.gold+e)}setPartsAppearedFlag(){this._partsAppeared=!0}clearPartsAppearedFlag(){this._partsAppeared=!1}isPartsAppearedTime(){return this._partsAppeared===!0}startBattleWith(e){this._isPlayerTurn=!0,this._battleFrameCounter=R.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnLength=0,this._battleNoDamageTurnLength=0,this._enemy=e,this._state=6}isFighting(){return this._state===6}isTurn(){return this._isPlayerTurn}getTurnNum(){return this._battleTurnLength}isBattleStartFrame(){return this._battleFrameCounter===R.BATTLE_INTERVAL_FRAME_NUM&&this._battleTurnLength===0}calcBattleResultForPlayerTurn(e,t,n=!1){return this._wwa.callUserDefinedBattleDamageFunction(`playerToEnemy`,(n||void 0)&&{playerStatus:e,enemyStatus:t})||{damage:this._calcDamageDefault(e,t)}}calcBattleResultForEnemyTurn(e,t,n=!1){return this._wwa.callUserDefinedBattleDamageFunction(`enemyToPlayer`,(n||void 0)&&{playerStatus:t,enemyStatus:e})||{damage:this._calcDamageDefault(e,t)}}_calcDamageDefault(e,t){let n=e.strength-t.defence;return n>0?n:0}fight(){if(!this.isFighting())throw Error(`バトルが開始されていません。`);if(this._battleTurnLength===0&&this._battleFrameCounter===R.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),--this._battleFrameCounter>0)return;this._battleTurnLength++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnLength>R.BATTLE_SPEED_CHANGE_TURN_NUM?(this._battleTurnLength===1&&(this._wwa.playAttackSound(),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=R.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playAttackSound(),this._wwa.vibration(!0));var e=this.getStatus(),t=this._enemy.status;let n=!1;if(this._isPlayerTurn){if(this._battleTurnLength===1&&this._wwa.isUsingDefaultDamageCalcFunction()&&e.strength<=t.defence&&e.defence>=t.strength){this._enemy.battleEndProcess(),this._wwa.registerSystemMessagePageByKey(g.CANNOT_DAMAGE_MONSTER),this._battleTurnLength=0,this._enemy=null,this._state=0;return}let{damage:r,aborted:i}=this.calcBattleResultForPlayerTurn(e,t);this._enemy.damage(r),n=!!i,this._enemy.status.energy<=0&&(this._wwa.playSound(this._wwa.getObjectAttributeById(this._enemy.partsID,R.ATR_SOUND)),this.earnGold(t.gold),this._wwa.setStatusChangedEffect(new x(0,0,0,t.gold)),this._enemy.item===0?this._wwa.setPartsOnPosition(j.OBJECT,0,this._enemy.position):this._wwa.setPartsOnPosition(j.OBJECT,this._enemy.item,this._enemy.position),this._wwa.reserveAppearPartsInNextFrame(this._enemy.position,A.OBJECT,this._enemy.partsID),this._state=0,this._wwa.registerPageByMessage(this._enemy.message,{triggerParts:{id:this._enemy.partsID,type:j.OBJECT,position:this._enemy.position}}),this._enemy.battleEndProcess(),this._battleTurnLength=0,this._battleNoDamageTurnLength=0,this._enemy=null),this._enemy!==null&&(r===0?this._battleNoDamageTurnLength++:this._battleNoDamageTurnLength=0),this._isPlayerTurn=!1}else{let{damage:r,aborted:i}=this.calcBattleResultForEnemyTurn(t,e);this.damage(r),n=!!i,this._status.energy<=0&&(this.setEnergy(0),this._enemy.battleEndProcess(),this._state=0,this._battleTurnLength=0,this._battleNoDamageTurnLength=0,this._enemy=null,this._wwa.shouldApplyGameOver({isCalledByMacro:!1})&&this._wwa.gameover()),r===0?this._battleNoDamageTurnLength++:this._battleNoDamageTurnLength=0,this._isPlayerTurn=!0}(this._battleNoDamageTurnLength>R.FIGHT_DRAW_TURN||n)&&(this._enemy.battleEndProcess(),this._state=0,this._wwa.registerSystemMessagePageByKey(g.BATTLE_NOT_SETTLED),this._battleTurnLength=0,this._battleNoDamageTurnLength=0,this._enemy=null)}readyToUseItem(e){var t;if(!this.canUseItem(e))throw Error(`アイテムがないか、アイテムが使えません。`);t=this._itemBox[e-1],this._wwa.getObjectAttributeById(t,R.ATR_STRING),this._wwa.reserveAppearPartsInNextFrame(this._position.getPartsCoord(),A.OBJECT,t),this._readyToUseItemPos1To12=e,this._isReadyToUseItem=!0}isReadyToUseItem(){return this._isReadyToUseItem}getDrawingCenterPosition(){var e=this._position.getPartsCoord(),t=this._position.getOffsetCoord(),n=this._camera.getPosition(),r=n.getPartsCoord(),i=n.getOffsetCoord();return new S((e.x-r.x)*R.CHIP_SIZE+t.x-i.x+R.CHIP_SIZE/2,(e.y-r.y)*R.CHIP_SIZE+t.y-i.y+R.CHIP_SIZE/2)}mainFrameCount(){this._frameCount++}getFrameCount(){return this._frameCount}setFrameCount(e){return typeof e!=`number`&&(e=0),this._frameCount=e}getMoveCount(){return this._moves}setMoveCount(e){return this._moves=e}isMoveObjectAutoExecTime(){return this._moveObjectAutoExecTimer===0}setMoveMacroWaiting(e){e<0||(this._moveMacroWaitingRemainMoves=e,this._moveObjectAutoExecTimer=0)}resetMoveObjectAutoExecTimer(){this._moveObjectAutoExecTimer=R.CHIP_SIZE/de[this._speedIndex],this._moveMacroWaitingRemainMoves--}decrementMoveObjectAutoExecTimer(){return this._moveMacroWaitingRemainMoves>=0&&this._moveObjectAutoExecTimer>0&&(this._moveObjectAutoExecTimer--,this._moveMacroWaitingRemainMoves===0&&this._moveObjectAutoExecTimer===0&&(this._afterMoveMacroFlag=!0)),0}isWaitingMoveMacro(){return this._moveMacroWaitingRemainMoves!==0||this._moveObjectAutoExecTimer!==0}decrementLookingAroundTimer(){return this._isPreparedForLookingAround&&this._lookingAroundTimer>0?--this._lookingAroundTimer:0}isLookingAround(){return this._isPreparedForLookingAround&&this._lookingAroundTimer===0}getSpeedIndex(){return this._speedIndex}speedUp(){return this._speedIndex=Math.min(R.MAX_SPEED_INDEX,this._speedIndex+1)}speedDown(){return this._speedIndex=Math.max(R.MIN_SPEED_INDEX,this._speedIndex-1)}setSpeedIndex(e){if(e<R.MIN_SPEED_INDEX||R.MAX_SPEED_INDEX<e)throw Error(`#set_speed の引数が異常です:`+e);return this._speedIndex=e,this._speedIndex}isPausing(){return this.isJumped()||this.isWaitingMessageOrManualPause()||this.isWaitingPasswordWindow()||this.isWaitingEstimateWindow()||this.isWaitingMoveMacro()||this.isFighting()}constructor(e,t,n,r,i,a,o){super(t),this.itemTransitioningClassName=`item-transitioning`,this.overwittenItemClassName=`item-overwritten`,this.overwittenItemSelector=`.${this.overwittenItemClassName}`,this.itemEffectStartTimers=Array(R.ITEMBOX_SIZE),this._status=r,this._equipStatus=new b(0,0),this._itemBox=Array(R.ITEMBOX_SIZE),this._itemBoxElement=Array(R.ITEMBOX_SIZE),this._itemUsingEvent=Array(R.ITEMBOX_SIZE);for(var s=0;s<this._itemBox.length;s++)this._itemBox[s]=0,this._itemBoxElement[s]=Re(`#item`+s+`>.item-disp`);this.updateItemBox(),this._energyMax=i,this._dir=E.DOWN,this._isMovingImage=!1,this._wwa=e,this._state=0,this._camera=n,this._isPartsEventExecuted=!1,this._energyValueElement=Re(`#disp-energy>.status-value-box`),this._strengthValueElement=Re(`#disp-strength>.status-value-box`),this._defenceValueElement=Re(`#disp-defence>.status-value-box`),this._goldValueElement=Re(`#disp-gold>.status-value-box`),this._isReadyToUseItem=!1,this._isClickableItemGot=!1,this._moves=a,this._moveMacroWaitingRemainMoves=0,this._moveObjectAutoExecTimer=0,this.updateStatusValueBox(),this._partsAppeared=!1,this._afterMoveMacroFlag=!1,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=R.PLAYER_LOOKING_AROUND_START_FRAME,this._speedIndex=o,this._messageDelayFrameCount=0,this._battleNoDamageTurnLength=0}},Jn=class e{constructor(e,t,n,r,i,a,o){this._partsID=e,this._position=t,this._imgCoord=n,this._status=r,this._message=i,this._item=a,this._battleEndCallback=o}get partsID(){return this._partsID}get position(){return this._position}get imgCoord(){return this._imgCoord}get status(){return this._status}get message(){return this._message}get item(){return this._item}damage(e){this._status.energy=Math.max(0,this._status.energy-e)}battleEndProcess(){this._battleEndCallback?.()}setStatus(e){e.energy!==null&&(this._status.energy=e.energy),e.strength!==null&&(this._status.strength=e.strength),e.defence!==null&&(this._status.defence=e.defence)}clone(){return new e(this._partsID,this._position.clone(),this._imgCoord.clone(),this._status.clone(),this._message,this._item,this._battleEndCallback)}},Yn=class{constructor(e,t,n,r,i){this._player=e,this._objectID=t,this._srcPos=n,this._destPos=r,this._dir=i,this._currentPos=this._srcPos.clone()}update(){var e=this._player.getSpeedIndex();return this._currentPos=this._currentPos.getNextFramePosition(this._dir,de[e],de[e]),this._currentPos}get isAchievedDestination(){return this._currentPos.equals(this._destPos)}get currentPosition(){return this._currentPos}get beforePosition(){return this._srcPos}get destination(){return this._destPos}get objID(){return this._objectID}},Xn=class{constructor(e,t){this._wwa=e,this._player=t,this.clear()}add(e,t,n,r){this._queue.push(new Yn(this._player,e,t,n,r))}update(){for(var e=[],t=[],n=0;n<this._queue.length;n++)this._queue[n].update(),this._queue[n].isAchievedDestination?(e.push(this._queue[n]),this._wwa.setPartsOnPosition(j.OBJECT,0,this._queue[n].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(j.OBJECT,this._queue[n].objID,this._queue[n].destination.getPartsCoord())):t.push(this._queue[n]);return this._queue=t,e}clear(){this._queue=[]}get objectMovingData(){return this.objectMovingData}getOffsetByBeforePartsCoord(e){var t=this._queue.filter(t=>t.beforePosition.getPartsCoord().equals(e));return t.length===0?null:t[0].currentPosition.getOffsetCoord()}},Zn=(e,t)=>{if(e[0]===`+`){let n=parseInt(e.substring(1,10));if(Number.isNaN(n))throw Error(`+ 以降の文字列は数値形式で記載してください。`);return t+n}else if(e[0]===`-`){let n=parseInt(e.substring(1,10));if(Number.isNaN(n))throw Error(`- 以降の文字列は数値形式で記載してください。`);return t-n}let n=parseInt(e,10);if(Number.isNaN(n))throw Error(`数値形式ではないため、解析できません。`);return n},Qn=class{constructor(e,t,n,r){this._wwa=e,this._triggerParts=t,this.macroType=n,this.macroArgs=r}isJunction(){return[I.IF,I.ELSE_IF,I.ELSE,I.END_IF].includes(this.macroType)}execute(){try{switch(this.macroType){case I.IMGPLAYER:return this._executeImgPlayerMacro(),{};case I.IMGYESNO:return this._executeImgYesNoMacro(),{};case I.HPMAX:return this._executeHPMaxMacro(),{};case I.SAVE:return this._executeSaveMacro(),{};case I.ITEM:return this._executeItemMacro(),{};case I.DEFAULT:return this._executeDefaultMacro(),{};case I.OLDMAP:return this._executeOldMapMacro(),{};case I.PARTS:return this._executePartsMacro(),{};case I.MOVE:return this._executeMoveMacro(),{};case I.MAP:return this._executeMapMacro(1),{};case I.DIRMAP:return this._executeDirMapMacro(),{};case I.IMGFRAME:return this._executeImgFrameMacro(),{};case I.IMGBOM:return this._executeImgBomMacro(),{};case I.DELPLAYER:return this._executeDelPlayerMacro(),{};case I.FACE:return this._executeFaceMacro(),{};case I.EFFECT:return this._executeEffectMacro(),{};case I.GAMEOVER:return this._executeGameOverMacro(),{};case I.IMGCLICK:return this._executeImgClickMacro(),{};case I.STATUS:{let{isGameOver:e}=this._executeStatusMacro();return{isGameOver:e}}case I.EFFITEM:return this._executeEffItemMacro(),{};case I.COLOR:return this._executeColorMacro(),{};case I.WAIT:return this._executeWaitMacro(),{};case I.SOUND:return this._executeSoundMacro(),{};case I.GAMEPAD_BUTTON:return this._executeGamePadButtonMacro(),{};case I.OLDMOVE:return this._executeOldMoveMacro(),{};case I.JUMPGATE:return this._executeJumpGateMacro(),{};case I.RECPOSITION:return this._executeRecPositionMacro(),{};case I.JUMPRECPOSITION:return this._executeJumpRecPositionMacro(),{};case I.CONSOLE_LOG:return this._executeConsoleLogMacro(1),{};case I.COPY_HP_TO:return this._executeCopyHpToMacro(),{};case I.SET_HP:{let{isGameOver:e}=this._executeSetHPMacro();return{isGameOver:e}}case I.COPY_HPMAX_TO:return this._executeCopyHpMaxToMacro(),{};case I.SET_HPMAX:return this._executeSetHpMaxMacro(),{};case I.COPY_AT_TO:return this._executeCopyAtToMacro(),{};case I.SET_AT:return this._executeSetAtMacro(),{};case I.COPY_DF_TO:return this._executeCopyDfToMacro(),{};case I.SET_DF:return this._executeSetDfMacro(),{};case I.COPY_MONEY_TO:return this._executeCopyMoneyToMacro(),{};case I.SET_MONEY:return this._executeSetMoneyMacro(),{};case I.COPY_STEP_COUNT_TO:return this._executeSetStepCountMacro(),{};case I.VAR_SET_VAL:return this._executeVarSetValMacro(),{};case I.VAR_SET:return this._executeVarSetMacro(),{};case I.VAR_ADD:return this._executeVarAddMacro(),{};case I.VAR_SUB:return this._executeVarSubMacro(),{};case I.VAR_MUL:return this._executeVarMulMacro(),{};case I.VAR_DIV:return this._executeVarDivMacro(),{};case I.VAR_MOD:return this._executeVarModMacro(),{};case I.VAR_SET_RAND:return this._executeVarSetRandMacro(),{};case I.GAME_SPEED:return this._executeGameSpeedMacro(),{};case I.SHOW_STR:return{};case I.SHOW_STR2:return{};case I.IF:return{};case I.LEGACY_IF:return this._executeLegacyIfMacro(),{};case I.ELSE_IF:return{};case I.ELSE:return{};case I.END_IF:return{};case I.SET_SPEED:return this._executeSetSpeedMacro(),{};case I.COPY_TIME_TO:return this._executeCopyTimeToMacro(),{};case I.HIDE_STATUS:return this._executeHideStatusMacro(),{};case I.VAR_MAP:return this._executeVarMapMacro(),{};case I.NO_GAMEOVER:return this._executeNoGameOverMacro(),{};case I.SET:{let{isGameOver:e}=this._executeSetMacro();return{isGameOver:e}}case I.MAP2:return this._executeMapMacro(2),{};case I.CONSOLE_LOG2:return this._executeConsoleLogMacro(2),{};case I.DELAYBGM:return this._executeDelayBgmMacro(),{};case I.SYSMSG:return this._executeSysMsgMacro(),{};case I.PICTURE:return this._executePictureMacro(),{};default:return console.log(`不明なマクロIDが実行されました:`+this.macroType),{}}}catch{}}_concatEmptyArgs(e){if(this.macroArgs.length<e){for(var t=Array(e-this.macroArgs.length),n=0;n<t.length;n++)t[n]=``;this.macroArgs=this.macroArgs.concat(t)}}_evaluateIntValue(e,t=0){let n=this.macroArgs[e];if(n===``)return t;let r=Number(n),i=r>=0?Math.floor(r):Math.ceil(r);return isNaN(i)?Gt(n,this._wwa.generateTokenValues(this._triggerParts),t):i}_executeJumpGateMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.forcedJumpGate(e,t)}_executeRecPositionMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.recUserPosition(e,t)}_executeJumpRecPositionMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.jumpRecUserPosition(e,t)}_executeConsoleLogMacro(e){this._concatEmptyArgs(1);let t=this._evaluateIntValue(0);switch(e){case 1:this._wwa.outputUserVar(t);return;case 2:console.log(`${this.macroArgs[0]} = ${t}`);return}}_executeCopyHpToMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarHP(e)}_executeCopyHpMaxToMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarHPMAX(e)}_executeCopyAtToMacro(){this._concatEmptyArgs(2);let e=this._evaluateIntValue(0),t=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarAT(e,t)}_executeCopyDfToMacro(){this._concatEmptyArgs(2);let e=this._evaluateIntValue(0),t=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarDF(e,t)}_parseStatusKind(e){switch(e){case 0:return`all`;case 1:return`bare`;case 2:return`equipment`;default:return`all`}}_executeCopyMoneyToMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarMONEY(e)}_executeSetHPMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);return this._wwa.setHPUserVar(e,!0)}_executeSetHpMaxMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setHPMAXUserVar(e)}_executeSetAtMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setATUserVar(e)}_executeSetDfMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setDFUserVar(e)}_executeSetMoneyMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setMONEYUserVar(e)}_executeSetStepCountMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarStep(e)}_executeVarSetValMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserVarVal(e,t)}_executeVarSetMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValOtherUserVal(e,t)}_executeVarAddMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValAdd(e,t)}_executeVarSubMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValSub(e,t)}_executeVarMulMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValMul(e,t)}_executeVarDivMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValDiv(e,t)}_executeVarModMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValMod(e,t)}_executeVarSetRandMacro(){this._concatEmptyArgs(3);let e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2,0);this._wwa.setUserValRandNum(e,t,n)}_executeGameSpeedMacro(){this._concatEmptyArgs(1);var e=!!this._evaluateIntValue(0);this._wwa.speedChangeJudge(e)}_executeLegacyIfMacro(){for(var e=Array(11),t=0;t<10;t++)e[t]=this.macroArgs[t];this._wwa.userVarUserIf(this._triggerParts.position,e)}_executeSetSpeedMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setPlayerSpeedIndex(e-1)}_executeCopyTimeToMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarPlayTime(e)}_executeHideStatusMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1)!==0;this._wwa.hideStatus(e,t)}_executeVarMapMacro(){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),t=this.macroArgs[1],n=this.macroArgs[2],r=this._evaluateIntValue(3,j.OBJECT);if(e<0)throw Error(`入力変数が不正です`);this._wwa.varMap(this._triggerParts.position,t,n,e,r)}_executeImgPlayerMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setPlayerImgCoord(new S(e,t))}_executeImgYesNoMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setYesNoImgCoord(new S(e,t))}_executeHPMaxMacro(){this._concatEmptyArgs(1);var e=Math.max(0,this._evaluateIntValue(0));this._wwa.setPlayerEnergyMax(e)}_executeSaveMacro(){this._concatEmptyArgs(1);var e=!!this._evaluateIntValue(0);this._wwa.disableSave(e)}_executeItemMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setPlayerGetItem(e,t)}_executeDefaultMacro(){this._concatEmptyArgs(1);var e=!!this._evaluateIntValue(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(e)}_executeOldMapMacro(){this._concatEmptyArgs(1);var e=!!this._evaluateIntValue(0);this._wwa.setOldMap(e)}_executePartsMacro(){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2,j.OBJECT),r=this._evaluateIntValue(3);if(n!==j.OBJECT&&n!==j.MAP)throw Error(`パーツ種別が不明です`);if(r!==0&&r!==1&&(r=1),e<0||t<0)throw Error(`パーツ番号が不正です`);if(n===j.OBJECT){if(e>=this._wwa.getObjectPartsNum()||t>=this._wwa.getObjectPartsNum())throw Error(`パーツ番号が不正です`)}else if(e>=this._wwa.getMapPartsNum()||t>=this._wwa.getMapPartsNum())throw Error(`パーツ番号が不正です`);this._wwa.replaceParts(e,t,n,!!r)}_executeMoveMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setMoveMacroWaitingToPlayer(e)}_executeMapMacro(e){this._concatEmptyArgs(4);let t=this._evaluateIntValue(0);var n=this._evaluateIntValue(3,j.OBJECT);if(t<0)throw Error(`パーツ番号が不正です`);if(n===j.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw Error(`パーツ番号が不正です`)}else if(t>=this._wwa.getMapPartsNum())throw Error(`パーツ番号が不正です`);if(e===1){let e=this.macroArgs[1],r=this.macroArgs[2];this._wwa.appearPartsEval(this._triggerParts.position,e,r,t,n)}else if(e===2){let e=this._evaluateIntValue(1),r=this._evaluateIntValue(2);if(isNaN(e)||isNaN(r))throw Error(`出現先座標が不正です`);this._wwa.appearPartsEval(this._triggerParts.position,`${e}`,`${r}`,t,n)}}_executeDirMapMacro(){this._concatEmptyArgs(3);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2,j.OBJECT);if(isNaN(e)||isNaN(t)||isNaN(n))throw Error(`引数が整数ではありません`);if(e<0)throw Error(`パーツ番号が不正です`);if(n===j.OBJECT){if(e>=this._wwa.getObjectPartsNum())throw Error(`パーツ番号が不正です`)}else if(e>=this._wwa.getMapPartsNum())throw Error(`パーツ番号が不正です`);this._wwa.appearPartsByDirection(t,e,n)}_executeImgFrameMacro(){this._concatEmptyArgs(3);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2);if(t<0||n<0)throw Error(`座標は正でなければなりません。`);if(e===L.ENERGY||e===L.STRENGTH||e===L.DEFENCE||e===L.GOLD)this._wwa.setStatusIconCoord(e,new S(t,n));else if(e===L.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new S(t,n));else if(e===L.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:t,y:n});else if(e===L.MAIN_FRAME)this._wwa.setFrameCoord(new S(t,n));else throw Error(`種別が不正です。`)}_executeImgBomMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||t<0)throw Error(`座標は正でなければなりません。`);this._wwa.setBattleEffectCoord(new S(e,t))}_executeDelPlayerMacro(){this._concatEmptyArgs(1);let e=this._evaluateIntValue(0);this._wwa.setDelPlayer(!!e)}_executeFaceMacro(){this._concatEmptyArgs(6);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2),r=this._evaluateIntValue(3),i=this._evaluateIntValue(4),a=this._evaluateIntValue(5),o;if(e<0||t<0||n<0||r<0||i<0||a<0)throw Error(`各引数は0以上の整数でなければなりません。`);o=new w(new S(e,t),new S(n,r),new S(i,a)),this._wwa.addFace(o)}_executeEffectMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);if(e<0)throw Error(`待ち時間は0以上の整数でなければなりません。`);if(e===0){this._wwa.stopEffect();return}for(var t=[],n=1;n<this.macroArgs.length;n+=2){var r=this._evaluateIntValue(n),i=0;if(r<0)throw Error(`画像のパーツ座標指定は0以上の整数でなければなりません。`);if(n+1===this.macroArgs.length)throw Error(`画像のパーツ座標指定で、Y座標が指定されていません。`);if(i=this._evaluateIntValue(n+1),i<0)throw Error(`画像のパーツ座標指定は0以上の整数でなければなりません。`);t.push(new S(r,i))}this._wwa.setEffect(e,t)}_executeGameOverMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||e>=this._wwa.getMapWidth()||t<0||t>=this._wwa.getMapWidth())throw Error(`マップの範囲外が指定されています!`);this._wwa.setGameOverPosition(new S(e,t))}_executeImgClickMacro(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw Error(`引数が少なすぎます`);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||t<0)throw Error(`引数が0以上の整数ではありません`);this._wwa.setImgClick(new S(e,t))}_executeEffItemMacro(){if(this.macroArgs.length<1)throw Error(`引数が少なすぎます`);var e=this._evaluateIntValue(0);this._wwa.updateItemEffectEnabled(!!e)}_executeStatusMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||4<e)throw Error(`ステータス種別が範囲外です。`);return this._wwa.setPlayerStatus(e,t,!0)}_executeColorMacro(){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2),r=this._evaluateIntValue(3);if(e<0||e>5)throw Error(`種別は0から5までです`);if(t<0||t>255||n<0||n>255||r<0||r>255)throw Error(`色が範囲外です`);this._wwa.changeStyleRule(e,t,n,r)}_executeWaitMacro(){throw Error(`Not implemented!`)}_executeSoundMacro(){this._concatEmptyArgs(2);let e=parseInt(this.macroArgs[0]),t=parseInt(this.macroArgs[1]);this._wwa.playSound(e,{bgmDelayDurationMs:t})}_executeGamePadButtonMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||t<0)throw Error(`各引数は0以上の整数でなければなりません。`);if(t>R.ITEMBOX_SIZE)throw Error(`アイテムボックス上限を超えた数値が指定されました。`);this._wwa.setGamePadButtonItemTable(e,t)}_executeOldMoveMacro(){this._concatEmptyArgs(1);let e=!!this._evaluateIntValue(0);this._wwa.setOldMove(e)}_executeNoGameOverMacro(){this._concatEmptyArgs(1);let e=this._evaluateIntValue(0);this._wwa.setGameOverPolicy(e)}_executeSetMacro(){return this._wwa.execSetMacro(this.macroArgs[0],{triggerParts:this._triggerParts})}_executePictureMacro(){if(this._concatEmptyArgs(3),this.macroArgs.length<1)throw Error(`引数が少なすぎます`);let e=this._evaluateIntValue(0),t=this.macroArgs[1].length>0?this.macroArgs[1]:`+0`;if(t===`0`){this._wwa.deletePictureRegistry(e);return}let n=Zn(t,this._triggerParts.id);if(n===0)throw Error(`パーツ番号の相対値算出で0が検出されました。ピクチャを消去する場合は0のまま指定してください。`);if(n<0)throw Error(`パーツ番号は0以上の整数でなければなりません。`);let r=this._evaluateIntValue(2,j.OBJECT);this._wwa.setPictureRegistry(e,n,r,this._triggerParts.position)}_executeDelayBgmMacro(){this._concatEmptyArgs(1);let e=this._evaluateIntValue(0);this._wwa.setBgmDelay(e)}_executeSysMsgMacro(){this._concatEmptyArgs(2);let e=this.resolveSystemMessageKeyFromMacroArg(this.macroArgs[0]);if(!e)throw Error(`該当するシステムメッセージの定義がありません`);let t=this.macroArgs[1]===``?void 0:this.macroArgs[1].replaceAll(`\\n`,`
31
+ file name:`+this._fileName)}),this._image.src=this._fileName,this._isLoaded=!0)}createFrame(){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,R.MAP_WINDOW_WIDTH-R.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,R.MAP_WINDOW_HEIGHT-R.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,R.MAP_WINDOW_WIDTH-R.CHIP_SIZE,R.MAP_WINDOW_HEIGHT-R.CHIP_SIZE);for(var e=1;e<R.H_PARTS_NUM_IN_WINDOW-1;e++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,R.CHIP_SIZE*e,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,R.CHIP_SIZE*e,R.MAP_WINDOW_HEIGHT-R.CHIP_SIZE);for(var e=1;e<R.V_PARTS_NUM_IN_WINDOW-1;e++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,R.CHIP_SIZE*e),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,R.MAP_WINDOW_WIDTH-R.CHIP_SIZE,R.CHIP_SIZE*e)}updateEffects(e){var t;if(e){var n=e.length,r;for(t=0;t<n;t++){var i=e[t];r=this._effectCanvases[t],r?r.clear():r=this._effectCanvases[t]=new Hn(R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,!0);for(var a=0;a<R.V_PARTS_NUM_IN_WINDOW;a++)for(var o=0;o<R.H_PARTS_NUM_IN_WINDOW;o++)r.drawCanvas(this._image,i.x,i.y,o*R.CHIP_SIZE,a*R.CHIP_SIZE)}}}restorePictures(e){this.picture.clearAllPictures(),e.forEach(e=>{this.picture.registerPicture(e)})}updateAllPicturesCache(e=!0){this.picture.updateAllPicturesCache(this._image,e)}updatePicturesAnimation(e=!0){this.picture.updatePicturesAnimation(this._image,e)}drawFrame(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-1),R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE,0,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-1),R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,R.CHIP_SIZE,R.CHIP_SIZE,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-2),0,R.CHIP_SIZE,R.CHIP_SIZE,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-1),R.CHIP_SIZE,R.CHIP_SIZE,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-2),R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-1),R.CHIP_SIZE,R.CHIP_SIZE,R.CHIP_SIZE*(R.H_PARTS_NUM_IN_WINDOW-2))}drawEffect(e){var t=this._effectCanvases[e];t&&this._ctx.drawImage(t.cvs,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW)}drawPictures(){this.picture.forEachPictures(e=>{let{x:t,y:n,width:r,height:i}=e.getDrawPictureCoords();this._ctx.drawImage(e.canvasImage,0,0,r,i,t,n,r,i)})}drawCanvas(e,t,n,r){if(!this._isLoaded)throw Error(`No image was loaded.`);this._ctx.drawImage(this._image,R.CHIP_SIZE*e,R.CHIP_SIZE*t,R.CHIP_SIZE,R.CHIP_SIZE,n,r,R.CHIP_SIZE,R.CHIP_SIZE)}drawCanvasWithSize(e,t,n,r,i,a){if(!this._isLoaded)throw Error(`No image was loaded.`);this._ctx.drawImage(this._image,R.CHIP_SIZE*e,R.CHIP_SIZE*t,R.CHIP_SIZE*n,R.CHIP_SIZE*r,i,a,R.CHIP_SIZE*n,R.CHIP_SIZE*r)}drawCanvasWithUpperYLimit(e,t,n,r,i){if(!this._isLoaded)throw Error(`No image was loaded.`);var a=Math.max(0,r+R.CHIP_SIZE-i);a>=R.CHIP_SIZE||this._ctx.drawImage(this._image,R.CHIP_SIZE*e,R.CHIP_SIZE*t,R.CHIP_SIZE,R.CHIP_SIZE-a,n,r,R.CHIP_SIZE,R.CHIP_SIZE)}copyCanvas(e,t){return(n,r,i,a,o)=>{if(!this._isLoaded)throw Error(`No image was loaded.`);let s=Math.max(0,t(a,o));s>=R.CHIP_SIZE||e.ctx.drawImage(this._image,R.CHIP_SIZE*n,R.CHIP_SIZE*r+s,R.CHIP_SIZE,R.CHIP_SIZE-s,i,a+s,R.CHIP_SIZE,R.CHIP_SIZE)}}copyBackCanvasWithUpperYLimit(e,t,n,r,i){this.copyCanvas(this._backCanvas,(e,t)=>e+R.CHIP_SIZE-t)(e,t,n,r,i)}copyBackCanvasWithLowerYLimit(e,t,n,r,i){this.copyCanvas(this._backCanvas,(e,t)=>t-e)(e,t,n,r,i)}copyObjectCanvasWithUpperYLimit(e,t,n,r,i,a){this.copyCanvas(this._objectCanvases[e],(e,t)=>e+R.CHIP_SIZE-t)(t,n,r,i,a)}copyObjectCanvasWithLowerYLimit(e,t,n,r,i,a){this.copyCanvas(this._objectCanvases[e],(e,t)=>t-e)(t,n,r,i,a)}drawBackCanvas(){if(!this._isLoaded)throw Error(`No image was loaded.`);this._ctx.drawImage(this._backCanvas.cvs,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW)}drawObjectCanvas(e){if(!this._isLoaded)throw Error(`No image was loaded.`);this._ctx.drawImage(this._objectCanvases[e].cvs,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,0,0,R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW)}clearBackCanvas(){this._backCanvas.clear()}clearBackCanvasWithLowerYLimit(e){this._backCanvas.clearRectWithLowerYLimit(e)}clearObjectCanvases(){var e;for(e=0;e<2;e++)this._objectCanvases[e].clear()}clearObjectCanvasesWithLowerYLimit(e){var t;for(t=0;t<2;t++)this._objectCanvases[t].clearRectWithLowerYLimit(e)}drawCanvasWithLowerYLimit(e,t,n,r,i){if(!this._isLoaded)throw Error(`No image was loaded.`);var a=Math.max(0,i-r);a>=R.CHIP_SIZE||this._ctx.drawImage(this._image,R.CHIP_SIZE*e,R.CHIP_SIZE*t+a,R.CHIP_SIZE,R.CHIP_SIZE-a,n,r+a,R.CHIP_SIZE,R.CHIP_SIZE)}clearCanvas(e,t,n,r){this._ctx.clearRect(e,t,n,r)}drawBase(e,t,n,r){this._ctx.fillStyle=`#9E9E9E`,this._ctx.fillRect(e,t,n,r)}setFrameImage(e){this._frameCoord=e,this.createFrame()}constructor(e,t,n,r,i,a){this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new Hn(R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new Hn(R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],this.picture=new Vn(r,i);var o;for(o=0;o<2;o++)this._objectCanvases[o]=new Hn(R.CHIP_SIZE*R.V_PARTS_NUM_IN_WINDOW,R.CHIP_SIZE*R.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=e,this._fileName=t,this._loadCompleteCallBack=a,this._load(),this._frameCoord=n.clone(),this.cpPartsLog=new S(0,0)}},Wn=class{constructor(e){this._position=null,this.reset(e)}setPlayer(e){this._player=e}isResetting(){return this._isResetting}getPosition(){return this._position}getPreviousPosition(){return this._positionPrev}resetPreviousPosition(){this._positionPrev=null}move(e){var t=de[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(e,t*(R.H_PARTS_NUM_IN_WINDOW-1),t*(R.V_PARTS_NUM_IN_WINDOW-1))}getTransitionStepNum(){return this._transitionStep}advanceTransitionStepNum(){return++this._transitionStep,this._transitionStep===R.V_PARTS_NUM_IN_WINDOW&&(this._isResetting=!1,this._transitionStep=0),this._transitionStep}isFinalStep(){if(this._isResetting===!1)throw Error(`リセット中ではありません。`);return this._transitionStep===R.V_PARTS_NUM_IN_WINDOW-1}reset(e){this._positionPrev=this._position,this._position=e.getDefaultCameraPosition(),this._transitionStep=0,this._isResetting=!0}},Gn=class{getPosition(){return this._position}constructor(e){this._position=e}},Kn=class extends Gn{constructor(e){super(e)}},qn=class extends Kn{move(){if(this.isControllable()){this.controll(this._dir);return}if(this._state===2){try{this._camera.move(this._dir)}catch{}this._isOnCameraStopPosition()&&(this._state=0,this._wwa.callCameraMoveUserDefineFunction())}else if(this._state===1){try{var e=this._position.getNextFramePosition(this._dir,de[this._speedIndex],de[this._speedIndex])}catch{}if(e.isJustPosition()){this._state=0,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0;let{isGameOver:e}=this._wwa.callMoveUserDefineFunction();if(e)return}this._position=e}}controll(e){var t,n;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=e;try{t=this._position.getNextFramePosition(this._dir,de[this._speedIndex],de[this._speedIndex]),n=this._position.getNextJustPosition(e)}catch{return}if(this._isOnCameraMovingPosition()){if(this._wwa.getMapIdByPosition(n)!==0||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=2}catch{this._state=0}return}if(!this.canMoveTo(n)){this._wwa.getMapTypeByPosition(n)===R.MAP_WALL&&this._wwa.checkMap(n.getPartsCoord()),this._wwa.checkObject(n.getPartsCoord());return}this._position=t,this._state=1,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(e),R.ATR_TYPE)!==R.MAP_LOCALGATE&&this._wwa.moveObjects(!0)}}setDir(e){this._isPreparedForLookingAround=!1,this._dir=e}canMoveTo(e){return e===null?!1:this._wwa.debug?!0:(this._wwa.getMapWidth(),e.getPartsCoord(),e.getOffsetCoord(),this._wwa.getMapIdByPosition(e)===0&&!this._wwa.isOldMap()||this._wwa.getMapTypeByPosition(e)===R.MAP_WALL?!1:this._wwa.getObjectIdByPosition(e)===0||this._wwa.getObjectTypeByPosition(e)===R.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(e,R.ATR_MODE)===R.PASSABLE_OBJECT?!0:this._wwa.getObjectTypeByPosition(e)===R.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(e,R.ATR_NUMBER)===R.PASSABLE_OBJECT?!this.hasItem(this._wwa.getObjectAttributeByPosition(e,R.ATR_ITEM)):!1)}isMoving(){return this._state==1||this._state==2}_isOnCameraMovingPosition(){var e=this._camera.getPosition().getPartsCoord(),t=this.getPosition().getPartsCoord();return t.x-e.x===R.H_PARTS_NUM_IN_WINDOW-1&&this._dir===E.RIGHT||t.x===e.x&&this._dir===E.LEFT||t.y-e.y===R.V_PARTS_NUM_IN_WINDOW-1&&this._dir===E.DOWN||t.y===e.y&&this._dir===E.UP}_isOnCameraStopPosition(){var e=this._camera.getPosition().getPartsCoord(),t=this.getPosition().getPartsCoord();return t.x-e.x===R.H_PARTS_NUM_IN_WINDOW-1&&this._dir===E.LEFT||t.x===e.x&&this._dir===E.RIGHT||t.y-e.y===R.V_PARTS_NUM_IN_WINDOW-1&&this._dir===E.UP||t.y===e.y&&this._dir===E.DOWN}isControllable(){var e=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===0&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==R.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==R.MAP_URLGATE||!this._wwa.isPrevFrameEventExecuted())&&this._moveMacroWaitingRemainMoves===0&&this._moveObjectAutoExecTimer===0&&!e&&this._wwa.canInput()}getCopyOfItemBox(){return this._itemBox.slice()}getDir(){return this._dir}isMovingImage(){return this._isMovingImage}toggleMovingImage(){this._isMovingImage?this._isMovingImage=!1:this._isMovingImage=!0}getEnergyMax(){return this._energyMax}isJumped(){return this._state===5||this._state===9}setMessageWaiting(){this._state===4&&console.warn(`メッセージが表示されるため、マニュアルポーズが無効になりました。`),this._state=3}setManualPause(e,t=!1){this.isControllable()&&(this._state=4,this._manualPauseInformation=e)}isWaitingMessageOrManualPause(){return[3,4].includes(this._state)}isWaitingMessage(){return this._state===3}isManualPause(){return this._state===4}getManualPauseInformation(){return this._manualPauseInformation}isDelayFrame(){return this._messageDelayFrameCount>0}updateDelayFrame(){this._messageDelayFrameCount--}setDelayFrame(){this._messageDelayFrameCount=1}clearWaitingMessageOrManualPause(){this._state===4&&(this._manualPauseInformation=void 0);let e=this.isWaitingMessageOrManualPause();!e&&this._state!==9||(e?this._state=0:this._state===9&&(this._state=5),this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=R.PLAYER_LOOKING_AROUND_START_FRAME))}setEstimateWindowWating(){this._state=7}isWaitingEstimateWindow(){return this._state===7}clearEstimateWindowWaiting(){this._state===7&&(this._state=0)}setPasswordWindowWating(){this._state=8}isWaitingPasswordWindow(){return this._state===8}clearPasswordWindowWaiting(){this._state===8&&(this._state=0)}isPartsEventExecuted(){return this._isPartsEventExecuted}resetEventExecutionInfo(){this._isPartsEventExecuted=!1}getLastExecPartsIDOnSamePosition(e){return e===j.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID}setLastExecInfoOnSamePosition(e,t){e===j.MAP?this._samePosLastExecutedMapID=t:this._samePosLastExecutedObjID=t}processAfterJump(){this._state!==5&&this._state!==9||--this._jumpWaitFramesRemain===0&&(this._state=this._state===5?0:3)}jumpTo(e){var t=this._camera.getPosition();return this.getPosition(),this._position.equals(e)?!1:(this._position=e,e.isInCameraRange(this._camera,!0)||this._camera.reset(e),this._state=this._state===3?9:5,this._jumpWaitFramesRemain=R.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,e.hasLocalGate()?this._dir=E.DOWN:e.getPartsCoord().y<=this._wwa.getMapWidth()-2&&e.getNextJustPosition(E.DOWN).hasLocalGate()?this._dir=E.UP:e.getPartsCoord().y>=1&&e.getNextJustPosition(E.UP).hasLocalGate()?this._dir=E.DOWN:e.getPartsCoord().x<=this._wwa.getMapWidth()-2&&e.getNextJustPosition(E.RIGHT).hasLocalGate()?this._dir=E.LEFT:e.getPartsCoord().x>=1&&e.getNextJustPosition(E.LEFT).hasLocalGate()?this._dir=E.RIGHT:this._dir=E.DOWN,this._camera.getPosition().equals(t)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=R.PLAYER_LOOKING_AROUND_START_FRAME),this._wwa.callJumpGateUserDefineFunction(),!0)}systemJumpTo(e){this._position=e,this._camera.reset(e),this._camera.resetPreviousPosition(),this._state=5,this._jumpWaitFramesRemain=R.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=E.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=R.PLAYER_LOOKING_AROUND_START_FRAME}addStatusAll(e){return this._status.add(e),this.isDead()&&(this._status.energy=0),this._energyMax!==0&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),this._status}setEnergyMax(e){return this._energyMax=e,e!==0&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),e}setEnergy(e){return this._status.energy=e,this.isDead()&&(this._status.energy=0),this._energyMax!==0&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),e}damage(e){this._status.energy=Math.max(0,this._status.energy-e),this.isDead()&&(this._status.energy=0),this._energyMax!==0&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox()}setStrength(e){return this._status.strength=e,this.updateStatusValueBox(),e}setDefence(e){return this._status.defence=e,this.updateStatusValueBox(),e}setGold(e){return this._status.gold=e,this.updateStatusValueBox(),e}getStatus(){return this._status.plus(this._equipStatus)}getStatusWithoutEquipments(){return this._status.plus(new b(0,0))}getStatusOfEquipments(){return this._equipStatus.plus(new b(0,0))}updateStatusValueBox(){let 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):``,this._wwa._messageWindow?.update(),this._wwa.updateScore()}updateItemBox(e){for(let t=0;t<this._itemBoxElement.length;t++){let n=this._itemBoxElement[t],r=Le(`#item`+t);if(this._itemBox[t]===0){n.style.backgroundPosition=`-40px 0px`,this.disposeItemEffect(t,this._itemBoxElement[t],r);continue}let i=this._wwa.getObjectCropXById(this._itemBox[t]),a=this._wwa.getObjectCropYById(this._itemBox[t]);if(!e||t!==e.insertPos-1){n.style.backgroundPosition=`-`+i+`px -`+a+`px`,this.disposeItemEffect(t,this._itemBoxElement[t],r);continue}let o=e.itemScreenPixelCoord.x-e.itemBoxScreenPixelCoord.x,s=e.itemScreenPixelCoord.y-e.itemBoxScreenPixelCoord.y,c=-o*R.DEFAULT_FRAME_INTERVAL/R.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,l=e.overwrittenObjectId===0||e.overwrittenObjectId===void 0,u=l?e.itemBoxBackgroundImageCoord.x:this._wwa.getObjectCropXById(e.overwrittenObjectId),d=l?e.itemBoxBackgroundImageCoord.y:this._wwa.getObjectCropYById(e.overwrittenObjectId);n.style.left=o+`px`,n.style.top=s+`px`,typeof this.itemEffectStartTimers[t]==`number`&&clearInterval(this.itemEffectStartTimers[t]),this.itemEffectStartTimers[t]=window.setTimeout(()=>{this.itemEffectStartTimers[t]=void 0,this.startItemEffect(t,n,r,{target:{x:i,y:a},overwritten:{x:u,y:d}},c)},R.DEFAULT_FRAME_INTERVAL)}}startItemEffect(e,t,n,r,i){let a=n.querySelector(this.overwittenItemSelector);a&&n.removeChild(a);let o=document.createElement(`div`);o.classList.add(this.overwittenItemClassName),o.style.backgroundPosition=`-`+r.overwritten.x+`px -`+r.overwritten.y+`px`,o.style.backgroundImage=n.style.backgroundImage,n.appendChild(o),t.style.backgroundPosition=`-`+r.target.x+`px -`+r.target.y+`px`,t.style.transitionDuration=i+`ms`,t.style.transitionProperty=`left,top`,t.style.transitionTimingFunction=`linear`,t.style.left=`0`,t.style.top=`0`,n.classList.add(this.itemTransitioningClassName),t.addEventListener(`transitionend`,()=>{this.disposeItemEffect(e,t,n)},{once:!0})}disposeItemEffect(e,t,n){typeof this.itemEffectStartTimers[e]==`number`&&(clearInterval(this.itemEffectStartTimers[e]),this.itemEffectStartTimers[e]=void 0),t.style.transitionDuration=`0s`,t.style.transitionProperty=``,t.style.left=`0`,t.style.top=`0`,n.classList.contains(this.itemTransitioningClassName)&&n.classList.remove(this.itemTransitioningClassName);let r=n.querySelector(this.overwittenItemSelector);r&&n.removeChild(r)}isDead(){return this._status.energy<=0}addItem(e,t=0,n=!1,r){var i,a,o,s=this._wwa.getObjectAttributeById(e,R.ATR_NUMBER),c=0;if(t===0&&s!==0&&(t=s),t===0){if(e===0)return;if(i=this._getBlankItemPos(),i===R.ITEMBOX_IS_FULL)throw this._wwa.setEvalCalcWwaNodeEarnedItem(e,-1),this._wwa.callGetItemFullUserDefineFunction(),this._wwa.clearEvalCalcWwaNodeEarnedItem(),Error(`これ以上、アイテムを持てません。`);c=this._itemBox[i-1],this._forceSetItemBox(i,e)}else if(n===!1)if(i=t,o=this._itemBox[i-1],this._wwa.getObjectAttributeById(o,R.ATR_NUMBER)!==this._wwa.getObjectAttributeById(e,R.ATR_NUMBER))if(a=this._getBlankItemPos(),a!==R.ITEMBOX_IS_FULL)this._forceSetItemBox(a,o),this._forceSetItemBox(i,e);else throw this._wwa.setEvalCalcWwaNodeEarnedItem(e,-1),this._wwa.callGetItemFullUserDefineFunction(),this._wwa.clearEvalCalcWwaNodeEarnedItem(),Error(`これ以上、アイテムを持てません。`);else c=this._itemBox[i-1],this._forceSetItemBox(i,e);else i=t,c=this._itemBox[i-1],this._forceSetItemBox(i,e);this._updateEquipmentStatus(),this.updateItemBox(r?{insertPos:i,itemScreenPixelCoord:r.screenPixelCoord,itemBoxBackgroundImageCoord:r.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new S(R.MAP_WINDOW_WIDTH+(i-1)%3*R.CHIP_SIZE,R.ITEMBOX_TOP_Y+Math.floor((i-1)/3)*R.CHIP_SIZE),overwrittenObjectId:c}:void 0)}_forceSetItemBox(e,t){var n=this,r=Re(`#item`+(e-1)+`>.item-click-border`),i=this._wwa.getObjectAttributeById(t,R.ATR_MODE);if(this.removeItemByItemPosition(e),this._itemBox[e-1]=t,this._wwa.setEvalCalcWwaNodeEarnedItem(t,e),this._wwa.callGetItemUserDefineFunction(),this._wwa.clearEvalCalcWwaNodeEarnedItem(),t!==0&&i!==te.NORMAL){let t=this._wwa.resolveSystemMessage(g.ITEM_SELECT_TUTORIAL);this._isClickableItemGot||=(t!==`BLANK`&&this._wwa.registerSystemMessagePage(t),!0),r.style.display=`block`,(e=>{n._itemUsingEvent[e-1]=()=>{(n.isControllable()||n._wwa._messageWindow.isItemMenuChoice())&&(n._wwa._itemMenu.close(),n._wwa._setNextPage(),n._wwa.onselectitem(e))}})(e),r.addEventListener(`click`,this._itemUsingEvent[e-1])}}_getBlankItemPos(){var e;for(e=1;e<this._itemBox.length+1;e++)if(this._itemBox[e-1]===0)return e;return R.ITEMBOX_IS_FULL}_updateEquipmentStatus(){var e,t=new b(0,0);for(e=0;e<R.ITEMBOX_SIZE;e++)this._itemBox[e]!==0&&(t.strength+=this._wwa.getObjectAttributeById(this._itemBox[e],R.ATR_STRENGTH),t.defence+=this._wwa.getObjectAttributeById(this._itemBox[e],R.ATR_DEFENCE));var n=t.minus(this._equipStatus);this._wwa.setStatusChangedEffect(n),this._equipStatus=t,this.updateStatusValueBox()}hasItem(e){for(var t=0;t<R.ITEMBOX_SIZE;t++)if(this._itemBox[t]===e)return!0;return!1}canUseItem(e){var t=this._itemBox[e-1];return!(t===0||this._wwa.getObjectAttributeById(t,R.ATR_MODE)===te.NORMAL)}useItem(){var e=this._itemBox[this._readyToUseItemPos1To12-1];this._wwa.getObjectAttributeById(e,R.ATR_MODE)!==te.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos1To12);var t=U(`item`+(this._readyToUseItemPos1To12-1));return setTimeout(()=>{t.classList.contains(`onpress`)&&t.classList.remove(`onpress`)},R.DEFAULT_FRAME_INTERVAL),this._wwa.setEvalCalcWwaNodeEarnedItem(e,this._readyToUseItemPos1To12),this._wwa.callUseItemUserDefineFunction(),this._wwa.clearEvalCalcWwaNodeEarnedItem(),this._isReadyToUseItem=!1,this._readyToUseItemPos1To12=void 0,e}canHaveMoreItems(){return this._getBlankItemPos()!==R.ITEMBOX_IS_FULL}removeItemByItemPosition(e){var t;this._itemBox[e-1]!==0&&(this._wwa.getObjectAttributeById(this._itemBox[e-1],R.ATR_MODE)!==te.NORMAL&&(t=Re(`#item`+(e-1)+`>.item-click-border`),t.removeEventListener(`click`,this._itemUsingEvent[e-1]),t.style.display=`none`),this._itemBox[e-1]=0,this._updateEquipmentStatus(),this.updateItemBox())}removeItemByPartsID(e){var t;if(!this.hasItem(e))throw Error(`アイテムを持っていない`);for(var n=0;n<R.ITEMBOX_SIZE;n++)if(this._itemBox[n]===e){this._wwa.getObjectAttributeById(this._itemBox[n],R.ATR_MODE)!==te.NORMAL&&(t=Re(`#item`+n+`>.item-click-border`),t.removeEventListener(`click`,this._itemUsingEvent[n]),t.style.display=`none`),this._itemBox[n]=0,this._updateEquipmentStatus(),this.updateItemBox();return}}clearItemBox(){for(var e=1;e<=R.ITEMBOX_SIZE;e++)this.removeItemByItemPosition(e);this._updateEquipmentStatus(),this.updateItemBox()}hasGold(e){return this._status.gold>=e}payGold(e){if(!this.hasGold(e))throw Error(`お金が足りない`);this.setGold(this._status.gold-e)}earnGold(e){this.setGold(this._status.gold+e)}setPartsAppearedFlag(){this._partsAppeared=!0}clearPartsAppearedFlag(){this._partsAppeared=!1}isPartsAppearedTime(){return this._partsAppeared===!0}startBattleWith(e){this._isPlayerTurn=!0,this._battleFrameCounter=R.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnLength=0,this._battleNoDamageTurnLength=0,this._enemy=e,this._state=6}isFighting(){return this._state===6}isTurn(){return this._isPlayerTurn}getTurnNum(){return this._battleTurnLength}isBattleStartFrame(){return this._battleFrameCounter===R.BATTLE_INTERVAL_FRAME_NUM&&this._battleTurnLength===0}calcBattleResultForPlayerTurn(e,t,n=!1){return this._wwa.callUserDefinedBattleDamageFunction(`playerToEnemy`,(n||void 0)&&{playerStatus:e,enemyStatus:t})||{damage:this._calcDamageDefault(e,t)}}calcBattleResultForEnemyTurn(e,t,n=!1){return this._wwa.callUserDefinedBattleDamageFunction(`enemyToPlayer`,(n||void 0)&&{playerStatus:t,enemyStatus:e})||{damage:this._calcDamageDefault(e,t)}}_calcDamageDefault(e,t){let n=e.strength-t.defence;return n>0?n:0}fight(){if(!this.isFighting())throw Error(`バトルが開始されていません。`);if(this._battleTurnLength===0&&this._battleFrameCounter===R.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),--this._battleFrameCounter>0)return;this._battleTurnLength++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnLength>R.BATTLE_SPEED_CHANGE_TURN_NUM?(this._battleTurnLength===1&&(this._wwa.playAttackSound(),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=R.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playAttackSound(),this._wwa.vibration(!0));var e=this.getStatus(),t=this._enemy.status;let n=!1;if(this._isPlayerTurn){if(this._battleTurnLength===1&&this._wwa.isUsingDefaultDamageCalcFunction()&&e.strength<=t.defence&&e.defence>=t.strength){this._enemy.battleEndProcess(),this._wwa.registerSystemMessagePageByKey(g.CANNOT_DAMAGE_MONSTER),this._battleTurnLength=0,this._enemy=null,this._state=0;return}let{damage:r,aborted:i}=this.calcBattleResultForPlayerTurn(e,t);this._enemy.damage(r),n=!!i,this._enemy.status.energy<=0&&(this._wwa.playSound(this._wwa.getObjectAttributeById(this._enemy.partsID,R.ATR_SOUND)),this.earnGold(t.gold),this._wwa.setStatusChangedEffect(new x(0,0,0,t.gold)),this._enemy.item===0?this._wwa.setPartsOnPosition(j.OBJECT,0,this._enemy.position):this._wwa.setPartsOnPosition(j.OBJECT,this._enemy.item,this._enemy.position),this._wwa.reserveAppearPartsInNextFrame(this._enemy.position,A.OBJECT,this._enemy.partsID),this._state=0,this._wwa.registerPageByMessage(this._enemy.message,{triggerParts:{id:this._enemy.partsID,type:j.OBJECT,position:this._enemy.position}}),this._enemy.battleEndProcess(),this._battleTurnLength=0,this._battleNoDamageTurnLength=0,this._enemy=null),this._enemy!==null&&(r===0?this._battleNoDamageTurnLength++:this._battleNoDamageTurnLength=0),this._isPlayerTurn=!1}else{let{damage:r,aborted:i}=this.calcBattleResultForEnemyTurn(t,e);this.damage(r),n=!!i,this._status.energy<=0&&(this.setEnergy(0),this._enemy.battleEndProcess(),this._state=0,this._battleTurnLength=0,this._battleNoDamageTurnLength=0,this._enemy=null,this._wwa.shouldApplyGameOver({isAssignment:!1})&&this._wwa.gameover()),r===0?this._battleNoDamageTurnLength++:this._battleNoDamageTurnLength=0,this._isPlayerTurn=!0}(this._battleNoDamageTurnLength>R.FIGHT_DRAW_TURN||n)&&(this._enemy.battleEndProcess(),this._state=0,this._wwa.registerSystemMessagePageByKey(g.BATTLE_NOT_SETTLED),this._battleTurnLength=0,this._battleNoDamageTurnLength=0,this._enemy=null)}readyToUseItem(e){var t;if(!this.canUseItem(e))throw Error(`アイテムがないか、アイテムが使えません。`);t=this._itemBox[e-1],this._wwa.getObjectAttributeById(t,R.ATR_STRING),this._wwa.reserveAppearPartsInNextFrame(this._position.getPartsCoord(),A.OBJECT,t),this._readyToUseItemPos1To12=e,this._isReadyToUseItem=!0}isReadyToUseItem(){return this._isReadyToUseItem}getDrawingCenterPosition(){var e=this._position.getPartsCoord(),t=this._position.getOffsetCoord(),n=this._camera.getPosition(),r=n.getPartsCoord(),i=n.getOffsetCoord();return new S((e.x-r.x)*R.CHIP_SIZE+t.x-i.x+R.CHIP_SIZE/2,(e.y-r.y)*R.CHIP_SIZE+t.y-i.y+R.CHIP_SIZE/2)}mainFrameCount(){this._frameCount++}getFrameCount(){return this._frameCount}setFrameCount(e){return typeof e!=`number`&&(e=0),this._frameCount=e}getMoveCount(){return this._moves}setMoveCount(e){return this._moves=e}isMoveObjectAutoExecTime(){return this._moveObjectAutoExecTimer===0}setMoveMacroWaiting(e){e<0||(this._moveMacroWaitingRemainMoves=e,this._moveObjectAutoExecTimer=0)}resetMoveObjectAutoExecTimer(){this._moveObjectAutoExecTimer=R.CHIP_SIZE/de[this._speedIndex],this._moveMacroWaitingRemainMoves--}decrementMoveObjectAutoExecTimer(){return this._moveMacroWaitingRemainMoves>=0&&this._moveObjectAutoExecTimer>0&&(this._moveObjectAutoExecTimer--,this._moveMacroWaitingRemainMoves===0&&this._moveObjectAutoExecTimer===0&&(this._afterMoveMacroFlag=!0)),0}isWaitingMoveMacro(){return this._moveMacroWaitingRemainMoves!==0||this._moveObjectAutoExecTimer!==0}decrementLookingAroundTimer(){return this._isPreparedForLookingAround&&this._lookingAroundTimer>0?--this._lookingAroundTimer:0}isLookingAround(){return this._isPreparedForLookingAround&&this._lookingAroundTimer===0}getSpeedIndex(){return this._speedIndex}speedUp(){return this._speedIndex=Math.min(R.MAX_SPEED_INDEX,this._speedIndex+1)}speedDown(){return this._speedIndex=Math.max(R.MIN_SPEED_INDEX,this._speedIndex-1)}setSpeedIndex(e){if(e<R.MIN_SPEED_INDEX||R.MAX_SPEED_INDEX<e)throw Error(`#set_speed の引数が異常です:`+e);return this._speedIndex=e,this._speedIndex}isPausing(){return this.isJumped()||this.isWaitingMessageOrManualPause()||this.isWaitingPasswordWindow()||this.isWaitingEstimateWindow()||this.isWaitingMoveMacro()||this.isFighting()}constructor(e,t,n,r,i,a,o){super(t),this.itemTransitioningClassName=`item-transitioning`,this.overwittenItemClassName=`item-overwritten`,this.overwittenItemSelector=`.${this.overwittenItemClassName}`,this.itemEffectStartTimers=Array(R.ITEMBOX_SIZE),this._status=r,this._equipStatus=new b(0,0),this._itemBox=Array(R.ITEMBOX_SIZE),this._itemBoxElement=Array(R.ITEMBOX_SIZE),this._itemUsingEvent=Array(R.ITEMBOX_SIZE);for(var s=0;s<this._itemBox.length;s++)this._itemBox[s]=0,this._itemBoxElement[s]=Re(`#item`+s+`>.item-disp`);this.updateItemBox(),this._energyMax=i,this._dir=E.DOWN,this._isMovingImage=!1,this._wwa=e,this._state=0,this._camera=n,this._isPartsEventExecuted=!1,this._energyValueElement=Re(`#disp-energy>.status-value-box`),this._strengthValueElement=Re(`#disp-strength>.status-value-box`),this._defenceValueElement=Re(`#disp-defence>.status-value-box`),this._goldValueElement=Re(`#disp-gold>.status-value-box`),this._isReadyToUseItem=!1,this._isClickableItemGot=!1,this._moves=a,this._moveMacroWaitingRemainMoves=0,this._moveObjectAutoExecTimer=0,this.updateStatusValueBox(),this._partsAppeared=!1,this._afterMoveMacroFlag=!1,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=R.PLAYER_LOOKING_AROUND_START_FRAME,this._speedIndex=o,this._messageDelayFrameCount=0,this._battleNoDamageTurnLength=0}},Jn=class e{constructor(e,t,n,r,i,a,o){this._partsID=e,this._position=t,this._imgCoord=n,this._status=r,this._message=i,this._item=a,this._battleEndCallback=o}get partsID(){return this._partsID}get position(){return this._position}get imgCoord(){return this._imgCoord}get status(){return this._status}get message(){return this._message}get item(){return this._item}damage(e){this._status.energy=Math.max(0,this._status.energy-e)}battleEndProcess(){this._battleEndCallback?.()}setStatus(e){e.energy!==null&&(this._status.energy=e.energy),e.strength!==null&&(this._status.strength=e.strength),e.defence!==null&&(this._status.defence=e.defence)}clone(){return new e(this._partsID,this._position.clone(),this._imgCoord.clone(),this._status.clone(),this._message,this._item,this._battleEndCallback)}},Yn=class{constructor(e,t,n,r,i){this._player=e,this._objectID=t,this._srcPos=n,this._destPos=r,this._dir=i,this._currentPos=this._srcPos.clone()}update(){var e=this._player.getSpeedIndex();return this._currentPos=this._currentPos.getNextFramePosition(this._dir,de[e],de[e]),this._currentPos}get isAchievedDestination(){return this._currentPos.equals(this._destPos)}get currentPosition(){return this._currentPos}get beforePosition(){return this._srcPos}get destination(){return this._destPos}get objID(){return this._objectID}},Xn=class{constructor(e,t){this._wwa=e,this._player=t,this.clear()}add(e,t,n,r){this._queue.push(new Yn(this._player,e,t,n,r))}update(){for(var e=[],t=[],n=0;n<this._queue.length;n++)this._queue[n].update(),this._queue[n].isAchievedDestination?(e.push(this._queue[n]),this._wwa.setPartsOnPosition(j.OBJECT,0,this._queue[n].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(j.OBJECT,this._queue[n].objID,this._queue[n].destination.getPartsCoord())):t.push(this._queue[n]);return this._queue=t,e}clear(){this._queue=[]}get objectMovingData(){return this.objectMovingData}getOffsetByBeforePartsCoord(e){var t=this._queue.filter(t=>t.beforePosition.getPartsCoord().equals(e));return t.length===0?null:t[0].currentPosition.getOffsetCoord()}},Zn=(e,t)=>{if(e[0]===`+`){let n=parseInt(e.substring(1,10));if(Number.isNaN(n))throw Error(`+ 以降の文字列は数値形式で記載してください。`);return t+n}else if(e[0]===`-`){let n=parseInt(e.substring(1,10));if(Number.isNaN(n))throw Error(`- 以降の文字列は数値形式で記載してください。`);return t-n}let n=parseInt(e,10);if(Number.isNaN(n))throw Error(`数値形式ではないため、解析できません。`);return n},Qn=class{constructor(e,t,n,r){this._wwa=e,this._triggerParts=t,this.macroType=n,this.macroArgs=r}isJunction(){return[I.IF,I.ELSE_IF,I.ELSE,I.END_IF].includes(this.macroType)}execute(){try{switch(this.macroType){case I.IMGPLAYER:return this._executeImgPlayerMacro(),{};case I.IMGYESNO:return this._executeImgYesNoMacro(),{};case I.HPMAX:return this._executeHPMaxMacro(),{};case I.SAVE:return this._executeSaveMacro(),{};case I.ITEM:return this._executeItemMacro(),{};case I.DEFAULT:return this._executeDefaultMacro(),{};case I.OLDMAP:return this._executeOldMapMacro(),{};case I.PARTS:return this._executePartsMacro(),{};case I.MOVE:return this._executeMoveMacro(),{};case I.MAP:return this._executeMapMacro(1),{};case I.DIRMAP:return this._executeDirMapMacro(),{};case I.IMGFRAME:return this._executeImgFrameMacro(),{};case I.IMGBOM:return this._executeImgBomMacro(),{};case I.DELPLAYER:return this._executeDelPlayerMacro(),{};case I.FACE:return this._executeFaceMacro(),{};case I.EFFECT:return this._executeEffectMacro(),{};case I.GAMEOVER:return this._executeGameOverMacro(),{};case I.IMGCLICK:return this._executeImgClickMacro(),{};case I.STATUS:{let{isGameOver:e}=this._executeStatusMacro();return{isGameOver:e}}case I.EFFITEM:return this._executeEffItemMacro(),{};case I.COLOR:return this._executeColorMacro(),{};case I.WAIT:return this._executeWaitMacro(),{};case I.SOUND:return this._executeSoundMacro(),{};case I.GAMEPAD_BUTTON:return this._executeGamePadButtonMacro(),{};case I.OLDMOVE:return this._executeOldMoveMacro(),{};case I.JUMPGATE:return this._executeJumpGateMacro(),{};case I.RECPOSITION:return this._executeRecPositionMacro(),{};case I.JUMPRECPOSITION:return this._executeJumpRecPositionMacro(),{};case I.CONSOLE_LOG:return this._executeConsoleLogMacro(1),{};case I.COPY_HP_TO:return this._executeCopyHpToMacro(),{};case I.SET_HP:{let{isGameOver:e}=this._executeSetHPMacro();return{isGameOver:e}}case I.COPY_HPMAX_TO:return this._executeCopyHpMaxToMacro(),{};case I.SET_HPMAX:return this._executeSetHpMaxMacro(),{};case I.COPY_AT_TO:return this._executeCopyAtToMacro(),{};case I.SET_AT:return this._executeSetAtMacro(),{};case I.COPY_DF_TO:return this._executeCopyDfToMacro(),{};case I.SET_DF:return this._executeSetDfMacro(),{};case I.COPY_MONEY_TO:return this._executeCopyMoneyToMacro(),{};case I.SET_MONEY:return this._executeSetMoneyMacro(),{};case I.COPY_STEP_COUNT_TO:return this._executeSetStepCountMacro(),{};case I.VAR_SET_VAL:return this._executeVarSetValMacro(),{};case I.VAR_SET:return this._executeVarSetMacro(),{};case I.VAR_ADD:return this._executeVarAddMacro(),{};case I.VAR_SUB:return this._executeVarSubMacro(),{};case I.VAR_MUL:return this._executeVarMulMacro(),{};case I.VAR_DIV:return this._executeVarDivMacro(),{};case I.VAR_MOD:return this._executeVarModMacro(),{};case I.VAR_SET_RAND:return this._executeVarSetRandMacro(),{};case I.GAME_SPEED:return this._executeGameSpeedMacro(),{};case I.SHOW_STR:return{};case I.SHOW_STR2:return{};case I.IF:return{};case I.LEGACY_IF:return this._executeLegacyIfMacro(),{};case I.ELSE_IF:return{};case I.ELSE:return{};case I.END_IF:return{};case I.SET_SPEED:return this._executeSetSpeedMacro(),{};case I.COPY_TIME_TO:return this._executeCopyTimeToMacro(),{};case I.HIDE_STATUS:return this._executeHideStatusMacro(),{};case I.VAR_MAP:return this._executeVarMapMacro(),{};case I.NO_GAMEOVER:return this._executeNoGameOverMacro(),{};case I.SET:{let{isGameOver:e}=this._executeSetMacro();return{isGameOver:e}}case I.MAP2:return this._executeMapMacro(2),{};case I.CONSOLE_LOG2:return this._executeConsoleLogMacro(2),{};case I.DELAYBGM:return this._executeDelayBgmMacro(),{};case I.SYSMSG:return this._executeSysMsgMacro(),{};case I.PICTURE:return this._executePictureMacro(),{};default:return console.log(`不明なマクロIDが実行されました:`+this.macroType),{}}}catch{}}_concatEmptyArgs(e){if(this.macroArgs.length<e){for(var t=Array(e-this.macroArgs.length),n=0;n<t.length;n++)t[n]=``;this.macroArgs=this.macroArgs.concat(t)}}_evaluateIntValue(e,t=0){let n=this.macroArgs[e];if(n===``)return t;let r=Number(n),i=r>=0?Math.floor(r):Math.ceil(r);return isNaN(i)?Gt(n,this._wwa.generateTokenValues(this._triggerParts),t):i}_executeJumpGateMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.forcedJumpGate(e,t)}_executeRecPositionMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.recUserPosition(e,t)}_executeJumpRecPositionMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.jumpRecUserPosition(e,t)}_executeConsoleLogMacro(e){this._concatEmptyArgs(1);let t=this._evaluateIntValue(0);switch(e){case 1:this._wwa.outputUserVar(t);return;case 2:console.log(`${this.macroArgs[0]} = ${t}`);return}}_executeCopyHpToMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarHP(e)}_executeCopyHpMaxToMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarHPMAX(e)}_executeCopyAtToMacro(){this._concatEmptyArgs(2);let e=this._evaluateIntValue(0),t=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarAT(e,t)}_executeCopyDfToMacro(){this._concatEmptyArgs(2);let e=this._evaluateIntValue(0),t=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarDF(e,t)}_parseStatusKind(e){switch(e){case 0:return`all`;case 1:return`bare`;case 2:return`equipment`;default:return`all`}}_executeCopyMoneyToMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarMONEY(e)}_executeSetHPMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);return this._wwa.setHPUserVar(e,!0)}_executeSetHpMaxMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setHPMAXUserVar(e)}_executeSetAtMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setATUserVar(e)}_executeSetDfMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setDFUserVar(e)}_executeSetMoneyMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setMONEYUserVar(e)}_executeSetStepCountMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarStep(e)}_executeVarSetValMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserVarVal(e,t)}_executeVarSetMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValOtherUserVal(e,t)}_executeVarAddMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValAdd(e,t)}_executeVarSubMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValSub(e,t)}_executeVarMulMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValMul(e,t)}_executeVarDivMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValDiv(e,t)}_executeVarModMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setUserValMod(e,t)}_executeVarSetRandMacro(){this._concatEmptyArgs(3);let e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2,0);this._wwa.setUserValRandNum(e,t,n)}_executeGameSpeedMacro(){this._concatEmptyArgs(1);var e=!!this._evaluateIntValue(0);this._wwa.speedChangeJudge(e)}_executeLegacyIfMacro(){for(var e=Array(11),t=0;t<10;t++)e[t]=this.macroArgs[t];this._wwa.userVarUserIf(this._triggerParts.position,e)}_executeSetSpeedMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setPlayerSpeedIndex(e-1)}_executeCopyTimeToMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setUserVarPlayTime(e)}_executeHideStatusMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1)!==0;this._wwa.hideStatus(e,t)}_executeVarMapMacro(){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),t=this.macroArgs[1],n=this.macroArgs[2],r=this._evaluateIntValue(3,j.OBJECT);if(e<0)throw Error(`入力変数が不正です`);this._wwa.varMap(this._triggerParts.position,t,n,e,r)}_executeImgPlayerMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setPlayerImgCoord(new S(e,t))}_executeImgYesNoMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setYesNoImgCoord(new S(e,t))}_executeHPMaxMacro(){this._concatEmptyArgs(1);var e=Math.max(0,this._evaluateIntValue(0));this._wwa.setPlayerEnergyMax(e)}_executeSaveMacro(){this._concatEmptyArgs(1);var e=!!this._evaluateIntValue(0);this._wwa.disableSave(e)}_executeItemMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);this._wwa.setPlayerGetItem(e,t)}_executeDefaultMacro(){this._concatEmptyArgs(1);var e=!!this._evaluateIntValue(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(e)}_executeOldMapMacro(){this._concatEmptyArgs(1);var e=!!this._evaluateIntValue(0);this._wwa.setOldMap(e)}_executePartsMacro(){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2,j.OBJECT),r=this._evaluateIntValue(3);if(n!==j.OBJECT&&n!==j.MAP)throw Error(`パーツ種別が不明です`);if(r!==0&&r!==1&&(r=1),e<0||t<0)throw Error(`パーツ番号が不正です`);if(n===j.OBJECT){if(e>=this._wwa.getObjectPartsNum()||t>=this._wwa.getObjectPartsNum())throw Error(`パーツ番号が不正です`)}else if(e>=this._wwa.getMapPartsNum()||t>=this._wwa.getMapPartsNum())throw Error(`パーツ番号が不正です`);this._wwa.replaceParts(e,t,n,!!r)}_executeMoveMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);this._wwa.setMoveMacroWaitingToPlayer(e)}_executeMapMacro(e){this._concatEmptyArgs(4);let t=this._evaluateIntValue(0);var n=this._evaluateIntValue(3,j.OBJECT);if(t<0)throw Error(`パーツ番号が不正です`);if(n===j.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw Error(`パーツ番号が不正です`)}else if(t>=this._wwa.getMapPartsNum())throw Error(`パーツ番号が不正です`);if(e===1){let e=this.macroArgs[1],r=this.macroArgs[2];this._wwa.appearPartsEval(this._triggerParts.position,e,r,t,n)}else if(e===2){let e=this._evaluateIntValue(1),r=this._evaluateIntValue(2);if(isNaN(e)||isNaN(r))throw Error(`出現先座標が不正です`);this._wwa.appearPartsEval(this._triggerParts.position,`${e}`,`${r}`,t,n)}}_executeDirMapMacro(){this._concatEmptyArgs(3);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2,j.OBJECT);if(isNaN(e)||isNaN(t)||isNaN(n))throw Error(`引数が整数ではありません`);if(e<0)throw Error(`パーツ番号が不正です`);if(n===j.OBJECT){if(e>=this._wwa.getObjectPartsNum())throw Error(`パーツ番号が不正です`)}else if(e>=this._wwa.getMapPartsNum())throw Error(`パーツ番号が不正です`);this._wwa.appearPartsByDirection(t,e,n)}_executeImgFrameMacro(){this._concatEmptyArgs(3);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2);if(t<0||n<0)throw Error(`座標は正でなければなりません。`);if(e===L.ENERGY||e===L.STRENGTH||e===L.DEFENCE||e===L.GOLD)this._wwa.setStatusIconCoord(e,new S(t,n));else if(e===L.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new S(t,n));else if(e===L.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:t,y:n});else if(e===L.MAIN_FRAME)this._wwa.setFrameCoord(new S(t,n));else throw Error(`種別が不正です。`)}_executeImgBomMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||t<0)throw Error(`座標は正でなければなりません。`);this._wwa.setBattleEffectCoord(new S(e,t))}_executeDelPlayerMacro(){this._concatEmptyArgs(1);let e=this._evaluateIntValue(0);this._wwa.setDelPlayer(!!e)}_executeFaceMacro(){this._concatEmptyArgs(6);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2),r=this._evaluateIntValue(3),i=this._evaluateIntValue(4),a=this._evaluateIntValue(5),o;if(e<0||t<0||n<0||r<0||i<0||a<0)throw Error(`各引数は0以上の整数でなければなりません。`);o=new w(new S(e,t),new S(n,r),new S(i,a)),this._wwa.addFace(o)}_executeEffectMacro(){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);if(e<0)throw Error(`待ち時間は0以上の整数でなければなりません。`);if(e===0){this._wwa.stopEffect();return}for(var t=[],n=1;n<this.macroArgs.length;n+=2){var r=this._evaluateIntValue(n),i=0;if(r<0)throw Error(`画像のパーツ座標指定は0以上の整数でなければなりません。`);if(n+1===this.macroArgs.length)throw Error(`画像のパーツ座標指定で、Y座標が指定されていません。`);if(i=this._evaluateIntValue(n+1),i<0)throw Error(`画像のパーツ座標指定は0以上の整数でなければなりません。`);t.push(new S(r,i))}this._wwa.setEffect(e,t)}_executeGameOverMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||e>=this._wwa.getMapWidth()||t<0||t>=this._wwa.getMapWidth())throw Error(`マップの範囲外が指定されています!`);this._wwa.setGameOverPosition(new S(e,t))}_executeImgClickMacro(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw Error(`引数が少なすぎます`);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||t<0)throw Error(`引数が0以上の整数ではありません`);this._wwa.setImgClick(new S(e,t))}_executeEffItemMacro(){if(this.macroArgs.length<1)throw Error(`引数が少なすぎます`);var e=this._evaluateIntValue(0);this._wwa.updateItemEffectEnabled(!!e)}_executeStatusMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||4<e)throw Error(`ステータス種別が範囲外です。`);return this._wwa.setPlayerStatus(e,t,!0)}_executeColorMacro(){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1),n=this._evaluateIntValue(2),r=this._evaluateIntValue(3);if(e<0||e>5)throw Error(`種別は0から5までです`);if(t<0||t>255||n<0||n>255||r<0||r>255)throw Error(`色が範囲外です`);this._wwa.changeStyleRule(e,t,n,r)}_executeWaitMacro(){throw Error(`Not implemented!`)}_executeSoundMacro(){this._concatEmptyArgs(2);let e=parseInt(this.macroArgs[0]),t=parseInt(this.macroArgs[1]);this._wwa.playSound(e,{bgmDelayDurationMs:t})}_executeGamePadButtonMacro(){this._concatEmptyArgs(2);var e=this._evaluateIntValue(0),t=this._evaluateIntValue(1);if(e<0||t<0)throw Error(`各引数は0以上の整数でなければなりません。`);if(t>R.ITEMBOX_SIZE)throw Error(`アイテムボックス上限を超えた数値が指定されました。`);this._wwa.setGamePadButtonItemTable(e,t)}_executeOldMoveMacro(){this._concatEmptyArgs(1);let e=!!this._evaluateIntValue(0);this._wwa.setOldMove(e)}_executeNoGameOverMacro(){this._concatEmptyArgs(1);let e=this._evaluateIntValue(0);this._wwa.setGameOverPolicy(e)}_executeSetMacro(){return this._wwa.execSetMacro(this.macroArgs[0],{triggerParts:this._triggerParts})}_executePictureMacro(){if(this._concatEmptyArgs(3),this.macroArgs.length<1)throw Error(`引数が少なすぎます`);let e=this._evaluateIntValue(0),t=this.macroArgs[1].length>0?this.macroArgs[1]:`+0`;if(t===`0`){this._wwa.deletePictureRegistry(e);return}let n=Zn(t,this._triggerParts.id);if(n===0)throw Error(`パーツ番号の相対値算出で0が検出されました。ピクチャを消去する場合は0のまま指定してください。`);if(n<0)throw Error(`パーツ番号は0以上の整数でなければなりません。`);let r=this._evaluateIntValue(2,j.OBJECT);this._wwa.setPictureRegistry(e,n,r,this._triggerParts.position)}_executeDelayBgmMacro(){this._concatEmptyArgs(1);let e=this._evaluateIntValue(0);this._wwa.setBgmDelay(e)}_executeSysMsgMacro(){this._concatEmptyArgs(2);let e=this.resolveSystemMessageKeyFromMacroArg(this.macroArgs[0]);if(!e)throw Error(`該当するシステムメッセージの定義がありません`);let t=this.macroArgs[1]===``?void 0:this.macroArgs[1].replaceAll(`\\n`,`
32
32
  `);this._wwa.overwriteSystemMessage(e,t)}resolveSystemMessageKeyFromMacroArg(e){return v(e)?e:y(this._evaluateIntValue(0))}};function $n(e,t,n){let r=n.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if((r===null||r.length!==3)&&(r=n.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)/),r===null||r.length!==2))throw Error(`マクロではありません`);let i=`$${r[1].toLowerCase()}`,a=i===`$if`&&n.match(/,/)?I.LEGACY_IF:le[i],o=a!==I.SHOW_STR&&a!==I.SHOW_STR2,s=(r[2]??``).split(`,`).map(e=>o?e.trim():e);return new Qn(e,t,a===void 0?I.UNDEFINED:a,s)}var er=class{constructor(e){this.generateTokenValues=e}static executeNodes(e,t){try{return{isError:!1,messages:e?.execute(t)??[]}}catch(e){return console.error(e),{isError:!0}}}},tr=class extends er{constructor(e=[],t){super(t),this.branches=e}appendBranch(e){this.branches.push(e)}getLastUnconnectedBranch(){for(let e of this.branches)if(!e.next)return e}evaluateAndGetNextNode(e){for(let t of this.branches)if(!t.descriminant||Lt(t.descriminant,this.generateTokenValues(e)))return t.next}hasElseBranch(){return this.branches.filter(e=>!!e.elseBranch).length>=1}execute(e){if(!e)throw Error(`パーツ起因ページによる実行ではないため、Junctionノードの利用を想定していません。`);let t=this.evaluateAndGetNextNode(e);return t?t.execute(e):[]}},nr=class e extends er{constructor(e,t,n,r,i,a){super(t),this.evalScript=n,this.macro=r,this.next=i,this.script=a,this.messageSegments=this.parseMessage(e),this.macro===void 0&&(this.macro=[])}isEmpty(){return this.messageSegments.reduce((e,t)=>e&&t===``,!0)}generatePrintableMessage(){return this.messageSegments.reduce((e,t)=>`${e}${typeof t==`string`?t:t()}`,``)}appendMessage(e,t=!1){this.messageSegments=this.messageSegments.concat(t?[`
33
33
  `]:[],this.parseMessage(e))}static createEmptyMessage(t,n,r){return new e([],t,n,void 0,void 0,r)}parseMessage(e){return typeof e==`string`?[e]:e}execute(e){return this.script&&this.evalScript(this.script,e),this.macro?.forEach(e=>{if(e.execute().isGameOver)throw Error(`ゲームオーバーのため、メッセージ・マクロの実行を打ち切ります。`)}),this.next?[this,...this.next.execute(e)]:[this]}};function rr(e){return e.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(`
34
34
  `).map(e=>{if(!e.startsWith(`//`))return e.match(/\/\//)?Ue(Ue(e).replace(/^.*\/\/(?!:s?ptth)/gi,``)):e}).filter(e=>e!==void 0).join(`
35
35
  `).replace(/\\\/\\\//gi,`//`)}function ir(e){if(e===``)return{pageContents:[]};let t=e.split(/\<script\>/i),[n,r]=t.length>1?[t[0],t[1]]:[t[0]];return{pageContents:n.split(/\<p\>/gi),script:r}}function ar({content:e,script:t,generatingOption:n,pageType:r,parseMacro:i,evalScript:a,generateTokenValuesCallback:o}){let s,c,l,u=sr(e,i),d=[];if(u.forEach((e,t)=>{try{let r=t===0?void 0:u[t-1].type,i=d[d.length-1],f=cr(e,!s||!or(r),o,a,{triggerParts:n.triggerParts}),p=lr(f,e,i,d);p&&(l=p),r?ur(e,r,c,f,i,l,o,{triggerParts:n.triggerParts}):s=f,f&&(c=f)}catch(e){console.error(`$if-$else_if-$else-$endif マクロの解析中にエラーが発生しました。ページ ${t}`),console.error(e)}}),t&&r===`first`){let e=nr.createEmptyMessage(o,a,t);e.next=s,s=e}return{firstNode:s,isLastPage:r===`last`,triggerParts:n.triggerParts,isSystemMessage:n.isSystemMessage,showChoice:r===`first`?n.showChoice:void 0,scoreOption:r===`first`?n.scoreOption:void 0,additionalItems:n.additionalItems}}var or=e=>e===I.SHOW_STR||e===I.SHOW_STR2||e===`text`||e===`normalMacro`;function sr(e,t){return e.split(`
36
36
  `).map(e=>{let n=e.match(/(\$(?:[a-zA-Z_][a-zA-Z0-9_]*)(?:.*))/);if(!n||n.length<2)return e.startsWith(`$`)?void 0:{type:`text`,text:e};let r=t(n[1]);switch(r.macroType){case I.IF:case I.ELSE_IF:case I.ELSE:case I.END_IF:case I.SHOW_STR:case I.SHOW_STR2:return{type:r.macroType,text:e,macro:r};default:return{type:`normalMacro`,text:e,macro:r}}}).filter(Boolean)}function cr(e,t,n,r,i){switch(e.type){case I.IF:return new tr([{descriminant:qt(e.macro.macroArgs[0])}],n);case I.SHOW_STR:case I.SHOW_STR2:return t?new nr(fr(e.macro.macroArgs,n,{triggerParts:i.triggerParts,version:e.type===I.SHOW_STR2?2:1}),n,r):void 0;case`text`:return t?new nr(e.text,n,r):void 0;case`normalMacro`:return t?new nr(``,n,r,[e.macro]):void 0;default:return}}function lr(e,t,n,r){let i=r.length===0;switch(t.type){case I.IF:r.push(e);return;case I.ELSE_IF:if(i)throw Error(`構文エラー: $if を呼ぶ前に $else_if は呼べません`);n.appendBranch({descriminant:qt(t.macro.macroArgs[0])});return;case I.ELSE:if(i)throw Error(`構文エラー: $if を呼ぶ前に $else は呼べません`);n.appendBranch({descriminant:!0,elseBranch:{type:`real`}});return;case I.END_IF:if(i)throw Error(`構文エラー: $if を呼ぶ前に $endif は呼べません`);return r.pop()}}function ur(e,t,n,r,i,a,o,s){let c=or(t);switch(t){case I.IF:case I.ELSE_IF:case I.ELSE:{if(!r||!i)return;let e=i.getLastUnconnectedBranch();if(e)e.next=r;else throw Error(`lastUnconnectedBranchが見つかりませんでした。`);return}case I.END_IF:if(!r||!(a instanceof tr))return;for(let e=0;e<a.branches.length;e++){let t=a.branches[e].next;if(!t){a.branches[e].next=r;continue}dr(t,r)}a.hasElseBranch()||a.branches.push({next:r,descriminant:!0,elseBranch:{type:`pesudo-else`}});return;default:{if(!c||!(n instanceof nr))return;let t=!n.isEmpty();e.type===I.SHOW_STR||e.type===I.SHOW_STR2?n.appendMessage(fr(e.macro.macroArgs,o,{triggerParts:s.triggerParts,version:e.type===I.SHOW_STR2?2:1}),t):e.type===`text`?n.appendMessage(e.text,t):e.type===`normalMacro`?n.macro.push(e.macro):n.next=r}}}function dr(e,t){let n=e;for(;;)if(n instanceof tr&&(n=n.branches[0].next),n instanceof nr){if(!n.next){n.next=t;return}n=n.next}}function fr(e,t,n){return e.map(e=>{let r=Number(e);return isNaN(r)?Kt(e)?()=>Gt(e,t(n.triggerParts)):e.replace(/\\n/g,`
37
37
  `):()=>{let e=t(n.triggerParts).userVars;return n.version===1?e[r]:r}})}function pr(e,t,n,r,i){let{pageContents:a,script:o}=ir(rr(e));return a.length===0?[{firstNode:nr.createEmptyMessage(i,r,o),isLastPage:!0,...t}]:a.map((e,s)=>ar({script:o,content:e,generatingOption:t,pageType:mr(s,a.length),parseMacro:n,evalScript:r,generateTokenValuesCallback:i}))}function mr(e,t){return e===0?`first`:e===t-1?`last`:`other`}function hr(e){if(e===void 0)return!0;if(e instanceof tr)return e.branches.reduce((e,t)=>e&&hr(t.next),!0);if(e instanceof nr)return e.isEmpty()&&hr(e.next)}var gr=class{constructor(e,t,n,r,i,a,o){this._wwa=e,this._coord=t,this._width=n,this._height=r,this._isVisible=i,this._parentElement=a,this._element=document.createElement(`div`),this._element.style.position=`absolute`,this._element.style.borderWidth=`2px`,this._element.style.borderStyle=`solid`,e.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)}update(e){}show(){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})}hide(){this._isVisible=!1,this._element.style.display=`none`,this.update(),this._wwa.wwaCustomEvent(`wwa_window_hide`,{name:this.windowName})}isVisible(){return this._isVisible}get windowName(){return`TextWindow`}},_r=class extends gr{constructor(e,t,n,r,i,a,o){super(e,new S(t.x,t.y),n,r,i,a,201),this._cgFileName=o,this._monsterBox=document.createElement(`div`),this._monsterBox.style.width=R.CHIP_SIZE+`px`,this._monsterBox.style.height=R.CHIP_SIZE+`px`,this._monsterBox.style.position=`absolute`,this._monsterBox.style.left=`10px`,this._monsterBox.style.top=`10px`,this._monsterBox.style.backgroundImage=`url(`+this._cgFileName.replace(`(`,`\\(`).replace(`)`,`\\)`)+`)`,this._monsterBox.style.backgroundPosition=`0 0`,this._element.appendChild(this._monsterBox),this._energyBox=document.createElement(`div`),this._energyBox.style.position=`absolute`,this._energyBox.style.left=`80px`,this._energyBox.style.top=`10px`,this._energyBox.textContent=`生命力 0`,this._element.appendChild(this._energyBox),this._strengthBox=document.createElement(`div`),this._strengthBox.style.position=`absolute`,this._strengthBox.style.left=`80px`,this._strengthBox.style.top=`30px`,this._strengthBox.textContent=`攻撃力 0`,this._element.appendChild(this._strengthBox),this._defenceBox=document.createElement(`div`),this._defenceBox.style.position=`absolute`,this._defenceBox.style.left=`180px`,this._defenceBox.style.top=`30px`,this._defenceBox.textContent=`防御力 0`,this._element.appendChild(this._defenceBox),this._isVisible?this._element.style.display=`block`:this._element.style.display=`none`}update(e){e!==void 0&&(this._monsterBox.style.backgroundPosition=`-`+e.imgCoord.x+`px -`+e.imgCoord.y+`px`,this._energyBox.textContent=`生命力 `+e.status.energy,this._strengthBox.textContent=`攻撃力 `+e.status.strength,this._defenceBox.textContent=`防御力 `+e.status.defence)}get windowName(){return`MonsterWindow`}},vr=class extends gr{static{this.WINDOW_NAME=`ScoreWindow`}constructor(e,t,n,r){e.isClassicMode()?(super(e,new S(R.CHIP_SIZE*2,30),R.CHIP_SIZE*7,40,n,r,202),this._element.style.borderWidth=`0`,this._element.style.borderRadius=`4px`,this._element.style.fontSize=`20px`,this._element.style.lineHeight=`40px`):super(e,new S(t.x,t.y),340,30,n,r,202),this._element.style.textAlign=`center`,this._isVisible?this._element.style.display=`block`:this._element.style.display=`none`,this.update(0)}update(e){e!==void 0&&(this._element.textContent=`Score: `+e)}get windowName(){return`ScoreWindow`}},yr=class{constructor(e,t,n,r,i,a,o,s,c,l){this._wwaSave=void 0,this._save_select_id=0,this._save_counter=0,this._save_close=!1;var u=this,d=a.replace(`(`,`\\(`).replace(`)`,`\\)`);switch(this._wwa=e,this._cgFileName=a,this._x=t,this._y=n,this._width=r,this._height=i,this._message=``,this._isVisible=o,this._isYesno=s,this._isItemMenu=c,this._element=document.createElement(`div`),this._element.id=`wwa-text-message-window`,this._element.classList.add(`wwa-message-window`),this._msgWrapperElement=document.createElement(`div`),this._msgWrapperElement.style.textAlign=`left`,this._msgWrapperElement.style.wordWrap=`break-word`,this._msgWrapperElement.style.margin=e.isClassicMode()?`8px 0 8px 16px`:`0`,this._msgWrapperElement.style.padding=e.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=l,this._parentElement.appendChild(this._element),this._divYesElement=document.createElement(`div`),this._divYesElement.classList.add(`wwa-yes-button`),this._divYesElement.style.background=`url(`+d+`)`,this._divYesElement.onclick=function(){u._isInputDisable||(e.setYesNoInput(k.YES),u.update())},this._divYesElement.style.cursor=`pointer`,this._divNoElement=document.createElement(`div`),this._divNoElement.classList.add(`wwa-no-button`),this._divNoElement.style.background=`url(`+d+`)`,this._divNoElement.onclick=function(){u._isInputDisable||(e.setYesNoInput(k.NO),u.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),u._isInputDisable=!1,e.userDevice.device){case re.SP:case re.VR:this._parentElement.classList.add(`useScaleUp`);break}this.update()}setPosition(e,t,n,r){this._x=e,this._y=t,this._width=n,this._height=r,this.update()}setPositionByPlayerPosition(e,t,n,r,i){var a=r.getPartsCoord().substract(i.getPartsCoord()).y,o=e?2:t?3:n?1:a>=Math.ceil(R.V_PARTS_NUM_IN_WINDOW/2)?0:2;this.setPositionEasy(o)}setPositionEasy(e){var t=Math.floor(this._element.clientHeight/2);if(e===1){this._y=R.MAP_WINDOW_HEIGHT/2-t,this.update();return}if(e===0){this._y=Math.max(20,R.MAP_WINDOW_HEIGHT/4-t)+10,this.update();return}if(e===2){this._y=Math.min(R.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,R.MAP_WINDOW_HEIGHT*3/4-t),this.update();return}if(e===3){this._y=80,this.update();return}}setMessage(e){this._message=e,this.update()}clear(){this._message=``,this.update()}setYesNoChoice(e){return this._isInputDisable=!1,this._isYesno=e,this.update(),this._isYesno}isYesNoChoice(){return this._isYesno}isSaveChoice(){return this._isSave}setItemMenuChoice(e){return this._isInputDisable=!1,this._isItemMenu=e,this.update(),this._isItemMenu}isItemMenuChoice(){return this._isItemMenu}setInputDisable(){this._isInputDisable=!0}isInputDisable(){return this._isInputDisable}show(){this._isVisible=!0,this.update()}hide(){this._isVisible=!1,this.update()}isVisible(){return this._isVisible}isWideChar(e){return e.match(/^[^\x01-\x7E\xA1-\xDF]+$/)!==null}createClassicTextElement(e){var t=document.createElement(`span`);let n=0,r=``;for(let a=0;a<e.length||n!=0;a++)if(this.isWideChar(e.charAt(a))?n+=2:n+=1,r+=e.charAt(a),n+1>R.MSG_STR_WIDTH*2){(e.charAt(a+1)===`。`||e.charAt(a+1)===`、`)&&(r+=e.charAt(a+1),a++);var i=document.createElement(`span`);i.style.display=`inline-block`,i.style.width=`100%`,i.textContent=r,t.appendChild(i),n=0,r=``}return t}update(){var e=this._wwa.getYesNoImgCoord();this._isYesno?(this._wwa.getYesNoState()===k.YES?(this._divYesElement.style.backgroundPosition=`-`+(e.x+R.IMGRELPOS_YESNO_YESP_X)*R.CHIP_SIZE+`px -`+e.y*R.CHIP_SIZE+`px`,this._divNoElement.style.backgroundPosition=`-`+(e.x+R.IMGRELPOS_YESNO_NO_X)*R.CHIP_SIZE+`px -`+e.y*R.CHIP_SIZE+`px`):this._wwa.getYesNoState()===k.NO?(this._divYesElement.style.backgroundPosition=`-`+(e.x+R.IMGRELPOS_YESNO_YES_X)*R.CHIP_SIZE+`px -`+e.y*R.CHIP_SIZE+`px`,this._divNoElement.style.backgroundPosition=`-`+(e.x+R.IMGRELPOS_YESNO_NOP_X)*R.CHIP_SIZE+`px -`+e.y*R.CHIP_SIZE+`px`):(this._divYesElement.style.backgroundPosition=`-`+(e.x+R.IMGRELPOS_YESNO_YES_X)*R.CHIP_SIZE+`px -`+e.y*R.CHIP_SIZE+`px`,this._divNoElement.style.backgroundPosition=`-`+(e.x+R.IMGRELPOS_YESNO_NO_X)*R.CHIP_SIZE+`px -`+e.y*R.CHIP_SIZE+`px`),this._ynWrapperElement.style.display=`block`):this._ynWrapperElement.style.display=`none`,this._msgWrapperElement.textContent=``;var t=this._message.split(`
38
- `);t.forEach((e,n)=>{let r;this._wwa.isClassicMode()?r=this.createClassicTextElement(e):(r=document.createElement(`span`),r.textContent=t[n]),this._msgWrapperElement.appendChild(r),this._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`}setWWASave(e){this._wwaSave=e}createSaveDom(){for(var e,t=document.createElement(`div`),n,r,i,a,o,s=document.getElementById(`disp-energy`),c,l=s.style.backgroundPosition,u=s.style.backgroundImage,d=this._wwaSave.list.length,f=0;f<d;f++)e=this._wwaSave.list[f],n=document.createElement(`div`),n.classList.add(`savedata`),n.setAttribute(`save_id`,f),n.addEventListener(`click`,e=>{this.setSaveID(e.currentTarget.getAttribute(`save_id`)|0),this._save_close=!0,e.preventDefault()}),r=document.createElement(`div`),r.classList.add(`ss`),n.appendChild(r),i=document.createElement(`div`),i.classList.add(`wide-cell-row`),i.style.backgroundPosition=l,i.style.backgroundImage=u,n.appendChild(i),t.appendChild(n),e.flag&&(r.appendChild(e.cvs),a=document.createElement(`span`),a.textContent=e.getDateText(),e.isLastSaveData()&&(a.style.color=me.DATE_LAST_SAVE_TEXT_COLOR),r.appendChild(a),o=document.createElement(`div`),o.classList.add(`status-icon`),o.style.backgroundImage=u,o.style.backgroundPosition=`-120px -80px`,i.appendChild(o),c=document.createElement(`div`),c.classList.add(`status-value-box`),c.textContent=e.getStatusEnergy(),i.appendChild(c));this._saveElement.textContent=``,this._saveElement.appendChild(t),this.setSaveID(this._save_select_id),this._isSave=!0,this._save_counter=0,this._save_close=!1}deleteSaveDom(){this._saveElement.textContent=``,this._isSave=!1}setSaveID(e){this._save_select_id=e;for(var t=document.querySelectorAll(`.savedata`),n,r=t.length,i=0;i<r;i++)n=t[i],e===i?n.classList.add(`select`):n.classList.remove(`select`)}save(e,t){return this._wwaSave.save(e,t,this._save_select_id)}load(){return this._wwaSave.load(this._save_select_id)}saveUpdate(){this._save_counter>0&&this._save_counter--}isSaveClose(){return this._save_close}cursor_wait(){this._save_counter=R.CONTROLL_WAIT_FRAME}saveControll(e){if(!(this._save_counter>0)&&!this._isInputDisable){switch(e){case E.DOWN:this._save_select_id-=2,this.cursor_wait();break;case E.UP:this._save_select_id+=2,this.cursor_wait();break;case E.LEFT:this._save_select_id--,this.cursor_wait();break;case E.RIGHT:this._save_select_id++,this.cursor_wait();break}this.setSaveID((this._save_select_id+me.QUICK_SAVE_MAX)%me.QUICK_SAVE_MAX)}}get windowName(){return`MessageWindow`}},br=class{constructor(e,t,n){this.id=e,this.imgFileName=t,this.parent=n,this.elem=document.createElement(`div`),this.elem.classList.add(`est`),this.elem.setAttribute(`id`,`wwa-est-`+e),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)}hide(){this.elem.style.display=`none`}show(){this.elem.style.display=`block`}setResult(e,t,n){this.imgElem.style.backgroundPosition=`-`+e.x+`px -`+e.y+`px`,this.energyDispElem.textContent=`生命力 `+t.energy,this.strengthDispElem.textContent=`攻撃力 `+t.strength,this.defenceDispElem.textContent=`防御力 `+t.defence,n.cannotDamageMonster?this.damageDispElem.textContent=`攻撃無効`:n.noSettled?this.damageDispElem.textContent=`勝負がつきません`:n.isOverMaxTurn?this.damageDispElem.textContent=`長期戦が予想されます`:this.damageDispElem.textContent=`予測ダメージ `+n.estimatedDamage}},xr=class{constructor(e,t,n){this._wwa=e,this._imgFileName=t,this._parent=n;var r;this._element=document.createElement(`div`),this._element.setAttribute(`id`,`wwa-battle-estimate`),this._element.style.display=`none`,this._edes=[];for(var i=0;i<R.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;i++)r=new br(i,this._imgFileName,this._element),this._edes.push(r),this._element.appendChild(r.elem);this._element.addEventListener(`click`,()=>{this._wwa.hideBattleEstimateWindow()}),this._parent.appendChild(this._element)}update(e,t,n,r,i){for(let a=0;a<R.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;a++){if(a>=t.length){this._edes[a].hide();continue}let o=new S(this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_X),this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_Y)),s=new x(this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_ENERGY),this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_STRENGTH),this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_DEFENCE),0),c=Sr(e,t[a],n,r,i);this._edes[a].setResult(o,s,c),this._edes[a].show()}}show(){this._element.style.display=`block`}hide(){this._element.style.display=`none`}};function Sr(e,t,n,r,i){let a=t.clone(),o=e.clone(),s=0,c=0,l=0,u=e.energy;if(i&&o.strength<=a.status.defence&&o.defence>=a.status.strength)return{cannotDamageMonster:!0,estimatedDamage:0};for(;;){c++;let e=n(o,a);if(a.status.energy-=e.damage,e.damage===0?l++:l=0,a.status.energy<=0)return{estimatedDamage:s};if(l>R.FIGHT_DRAW_TURN||e.aborted)return{noSettled:(u<=0||o.energy>0)&&a.status.energy>0,estimatedDamage:s};if(c>2e4)return{isOverMaxTurn:!0,estimatedDamage:0};c++;let t=r(a,o),i=Math.max(t.damage,0);if(i===0?l++:l=0,s+=i,o.energy=Math.max(o.energy-i,0),l>R.FIGHT_DRAW_TURN||t.aborted)return{noSettled:(u<=0||o.energy>0)&&a.status.energy>0,estimatedDamage:s};if(c>2e4)return{isOverMaxTurn:!0,estimatedDamage:0}}}var Cr=function(e){return e[e.SAVE=0]=`SAVE`,e[e.LOAD=1]=`LOAD`,e}({});function wr(e){return`下のボックスに前回のプレイで取得した
38
+ `);t.forEach((e,n)=>{let r;this._wwa.isClassicMode()?r=this.createClassicTextElement(e):(r=document.createElement(`span`),r.textContent=t[n]),this._msgWrapperElement.appendChild(r),this._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`}setWWASave(e){this._wwaSave=e}createSaveDom(){for(var e,t=document.createElement(`div`),n,r,i,a,o,s=document.getElementById(`disp-energy`),c,l=s.style.backgroundPosition,u=s.style.backgroundImage,d=this._wwaSave.list.length,f=0;f<d;f++)e=this._wwaSave.list[f],n=document.createElement(`div`),n.classList.add(`savedata`),n.setAttribute(`save_id`,f),n.addEventListener(`click`,e=>{this.setSaveID(e.currentTarget.getAttribute(`save_id`)|0),this._save_close=!0,e.preventDefault()}),r=document.createElement(`div`),r.classList.add(`ss`),n.appendChild(r),i=document.createElement(`div`),i.classList.add(`wide-cell-row`),i.style.backgroundPosition=l,i.style.backgroundImage=u,n.appendChild(i),t.appendChild(n),e.flag&&(r.appendChild(e.cvs),a=document.createElement(`span`),a.textContent=e.getDateText(),e.isLastSaveData()&&(a.style.color=me.DATE_LAST_SAVE_TEXT_COLOR),r.appendChild(a),o=document.createElement(`div`),o.classList.add(`status-icon`),o.style.backgroundImage=u,o.style.backgroundPosition=`-120px -80px`,i.appendChild(o),c=document.createElement(`div`),c.classList.add(`status-value-box`),c.textContent=e.getStatusEnergy(),i.appendChild(c));this._saveElement.textContent=``,this._saveElement.appendChild(t),this.setSaveID(this._save_select_id),this._isSave=!0,this._save_counter=0,this._save_close=!1}deleteSaveDom(){this._saveElement.textContent=``,this._isSave=!1}setSaveID(e){this._save_select_id=e;for(var t=document.querySelectorAll(`.savedata`),n,r=t.length,i=0;i<r;i++)n=t[i],e===i?n.classList.add(`select`):n.classList.remove(`select`)}save(e,t){return this._wwaSave.save(e,t,this._save_select_id)}load(){return this._wwaSave.load(this._save_select_id)}saveUpdate(){this._save_counter>0&&this._save_counter--}isSaveClose(){return this._save_close}cursor_wait(){this._save_counter=R.CONTROLL_WAIT_FRAME}saveControll(e){if(!(this._save_counter>0)&&!this._isInputDisable){switch(e){case E.DOWN:this._save_select_id-=2,this.cursor_wait();break;case E.UP:this._save_select_id+=2,this.cursor_wait();break;case E.LEFT:this._save_select_id--,this.cursor_wait();break;case E.RIGHT:this._save_select_id++,this.cursor_wait();break}this.setSaveID((this._save_select_id+me.QUICK_SAVE_MAX)%me.QUICK_SAVE_MAX)}}get windowName(){return`MessageWindow`}},br=class e{constructor(e,t){this.element=document.createElement(`div`),this.element.setAttribute(`id`,`wwa-game-frame-rate-window`),this.currentFpsIndicatorElement=document.createElement(`span`),this.element.appendChild(this.currentFpsIndicatorElement),this.separatorElement=document.createElement(`span`),this.separatorElement.textContent=`/`,this.element.appendChild(this.separatorElement),this.targetFpsIndicatorElement=document.createElement(`span`),this.element.appendChild(this.targetFpsIndicatorElement),this.unitElement=document.createElement(`span`),this.unitElement.textContent=`fps`,this.element.appendChild(this.unitElement),t&&(this.closeButtonElement=document.createElement(`button`),this.closeButtonElement.textContent=`✕`,this.closeButtonElement.classList.add(`wwa-game-frame-rate-window-close-button`),this.closeButtonElement.addEventListener(`click`,t),this.element.appendChild(this.closeButtonElement)),this.reset(),e.appendChild(this.element)}updateCurrentFps(t){this.currentFpsIndicatorElement.textContent=e.formatFps(t)}updateTargetFps(t){this.targetFpsIndicatorElement.textContent=e.formatFps(t)}reset(){this.updateCurrentFps(NaN),this.updateTargetFps(NaN)}show(){this.element.removeAttribute(`aria-hidden`)}hide(){this.element.setAttribute(`aria-hidden`,`true`),this.reset()}toggleVisibility(){this.element.hasAttribute(`aria-hidden`)?this.show():this.hide()}static formatFps(e){if(Number.isNaN(e))return`--.--`;let t=Math.round(e*100);return`${Math.floor(t/100)}.${(t%100).toString().padStart(2,`0`)} `}},xr=class{constructor(e,t,n){this.id=e,this.imgFileName=t,this.parent=n,this.elem=document.createElement(`div`),this.elem.classList.add(`est`),this.elem.setAttribute(`id`,`wwa-est-`+e),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)}hide(){this.elem.style.display=`none`}show(){this.elem.style.display=`block`}setResult(e,t,n){this.imgElem.style.backgroundPosition=`-`+e.x+`px -`+e.y+`px`,this.energyDispElem.textContent=`生命力 `+t.energy,this.strengthDispElem.textContent=`攻撃力 `+t.strength,this.defenceDispElem.textContent=`防御力 `+t.defence,n.cannotDamageMonster?this.damageDispElem.textContent=`攻撃無効`:n.noSettled?this.damageDispElem.textContent=`勝負がつきません`:n.isOverMaxTurn?this.damageDispElem.textContent=`長期戦が予想されます`:this.damageDispElem.textContent=`予測ダメージ `+n.estimatedDamage}},Sr=class{constructor(e,t,n){this._wwa=e,this._imgFileName=t,this._parent=n;var r;this._element=document.createElement(`div`),this._element.setAttribute(`id`,`wwa-battle-estimate`),this._element.style.display=`none`,this._edes=[];for(var i=0;i<R.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;i++)r=new xr(i,this._imgFileName,this._element),this._edes.push(r),this._element.appendChild(r.elem);this._element.addEventListener(`click`,()=>{this._wwa.hideBattleEstimateWindow()}),this._parent.appendChild(this._element)}update(e,t,n,r,i){for(let a=0;a<R.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;a++){if(a>=t.length){this._edes[a].hide();continue}let o=new S(this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_X),this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_Y)),s=new x(this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_ENERGY),this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_STRENGTH),this._wwa.getObjectAttributeById(t[a].partsID,R.ATR_DEFENCE),0),c=Cr(e,t[a],n,r,i);this._edes[a].setResult(o,s,c),this._edes[a].show()}}show(){this._element.style.display=`block`}hide(){this._element.style.display=`none`}};function Cr(e,t,n,r,i){let a=t.clone(),o=e.clone(),s=0,c=0,l=0,u=e.energy;if(i&&o.strength<=a.status.defence&&o.defence>=a.status.strength)return{cannotDamageMonster:!0,estimatedDamage:0};for(;;){c++;let e=n(o,a);if(a.status.energy-=e.damage,e.damage===0?l++:l=0,a.status.energy<=0)return{estimatedDamage:s};if(l>R.FIGHT_DRAW_TURN||e.aborted)return{noSettled:(u<=0||o.energy>0)&&a.status.energy>0,estimatedDamage:s};if(c>2e4)return{isOverMaxTurn:!0,estimatedDamage:0};c++;let t=r(a,o),i=Math.max(t.damage,0);if(i===0?l++:l=0,s+=i,o.energy=Math.max(o.energy-i,0),l>R.FIGHT_DRAW_TURN||t.aborted)return{noSettled:(u<=0||o.energy>0)&&a.status.energy>0,estimatedDamage:s};if(c>2e4)return{isOverMaxTurn:!0,estimatedDamage:0}}}var wr=function(e){return e[e.SAVE=0]=`SAVE`,e[e.LOAD=1]=`LOAD`,e}({});function Tr(e){return`下のボックスに前回のプレイで取得した
39
39
  復帰用パスワードを貼り付けてください。
40
40
  Java 版 WWA で取得したパスワードはご利用になれません。
41
41
  作成者が ${e?`マップの内容`:`ワールド名 か マップの暗証番号`} を変更した場合は
42
- それ以前に取得したパスワードは使えなくなります。`}var Tr=`下記テキストがデータ復帰用のパスワードになっています。
42
+ それ以前に取得したパスワードは使えなくなります。`}var Er=`下記テキストがデータ復帰用のパスワードになっています。
43
43
  コピーしてメモ帳などのテキストエディタに貼り付けて
44
- 保存してください。`,Er=class{constructor(e,t,n){this._wwa=e,this._parent=t,this._isDisallowLoadOldSave=n,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`,e=>{this._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`,()=>{this._wwa.hidePasswordWindow()}),this._cancelButtonElement=document.createElement(`button`),this._cancelButtonElement.textContent=`キャンセル`,this._cancelButtonElement.addEventListener(`click`,()=>{this._wwa.hidePasswordWindow(!0)}),this._copyButtonElement=document.createElement(`button`),this._copyButtonElement.textContent=`コピー`,this._copyButtonElement.addEventListener(`click`,async()=>{await navigator.clipboard.writeText(this.password),this._copyButtonElement.textContent=`コピーしました`,this._copyButtonElement.disabled=!0,setTimeout(()=>{this._copyButtonElement&&(this._copyButtonElement.textContent=`コピー`,this._copyButtonElement.disabled=!1)},this.COPIED_MESSAGE_DISPLAY_MS)}),this._buttonWrapperElement.appendChild(this._okButtonElement),this._buttonWrapperElement.appendChild(this._cancelButtonElement),this._buttonWrapperElement.appendChild(this._copyButtonElement),this._mode=1,this._element.appendChild(this._descriptionElement),this._element.appendChild(this._passwordBoxElement),this._element.appendChild(this._buttonWrapperElement),this._parent.appendChild(this._element),this.update()}get mode(){return this._mode}set mode(e){this._mode=e,e===1&&(this.password=``)}get password(){return this._passwordBoxElement.value}set password(e){this._passwordBoxElement.value=e}show(e){e!==void 0&&(this.mode=e),this._isVisible=!0,this.update()}hide(){this._isVisible=!1,this.update()}update(){var e=``;if(this._mode===1){e=wr(this._isDisallowLoadOldSave);try{this._passwordBoxElement.removeAttribute(`readonly`)}catch{}this._cancelButtonElement.style.display=`inline`,this._copyButtonElement.style.display=`none`}else e=Tr,this._passwordBoxElement.setAttribute(`readonly`,`readonly`),this._cancelButtonElement.style.display=`none`,this._copyButtonElement.style.display=`inline`;var t=e.split(`
45
- `);this._descriptionElement.textContent=``;for(var n=0;n<t.length;n++){var r=document.createElement(`span`);r.textContent=t[n],this._descriptionElement.appendChild(r),this._descriptionElement.appendChild(document.createElement(`br`))}this._isVisible?this._element.style.display=`block`:this._element.style.display=`none`}};function Dr(e,t){return`
44
+ 保存してください。`,Dr=class{constructor(e,t,n){this._wwa=e,this._parent=t,this._isDisallowLoadOldSave=n,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`,e=>{this._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`,()=>{this._wwa.hidePasswordWindow()}),this._cancelButtonElement=document.createElement(`button`),this._cancelButtonElement.textContent=`キャンセル`,this._cancelButtonElement.addEventListener(`click`,()=>{this._wwa.hidePasswordWindow(!0)}),this._copyButtonElement=document.createElement(`button`),this._copyButtonElement.textContent=`コピー`,this._copyButtonElement.addEventListener(`click`,async()=>{await navigator.clipboard.writeText(this.password),this._copyButtonElement.textContent=`コピーしました`,this._copyButtonElement.disabled=!0,setTimeout(()=>{this._copyButtonElement&&(this._copyButtonElement.textContent=`コピー`,this._copyButtonElement.disabled=!1)},this.COPIED_MESSAGE_DISPLAY_MS)}),this._buttonWrapperElement.appendChild(this._okButtonElement),this._buttonWrapperElement.appendChild(this._cancelButtonElement),this._buttonWrapperElement.appendChild(this._copyButtonElement),this._mode=1,this._element.appendChild(this._descriptionElement),this._element.appendChild(this._passwordBoxElement),this._element.appendChild(this._buttonWrapperElement),this._parent.appendChild(this._element),this.update()}get mode(){return this._mode}set mode(e){this._mode=e,e===1&&(this.password=``)}get password(){return this._passwordBoxElement.value}set password(e){this._passwordBoxElement.value=e}show(e){e!==void 0&&(this.mode=e),this._isVisible=!0,this.update()}hide(){this._isVisible=!1,this.update()}update(){var e=``;if(this._mode===1){e=Tr(this._isDisallowLoadOldSave);try{this._passwordBoxElement.removeAttribute(`readonly`)}catch{}this._cancelButtonElement.style.display=`inline`,this._copyButtonElement.style.display=`none`}else e=Er,this._passwordBoxElement.setAttribute(`readonly`,`readonly`),this._cancelButtonElement.style.display=`none`,this._copyButtonElement.style.display=`inline`;var t=e.split(`
45
+ `);this._descriptionElement.textContent=``;for(var n=0;n<t.length;n++){var r=document.createElement(`span`);r.textContent=t[n],this._descriptionElement.appendChild(r),this._descriptionElement.appendChild(document.createElement(`br`))}this._isVisible?this._element.style.display=`block`:this._element.style.display=`none`}};function Or(e,t){return`
46
46
  <canvas id="wwa-map" class="wwa-canvas" width="440" height="440">
47
47
  このブラウザは、Canvas要素をサポートしていません。
48
48
  </canvas>
@@ -86,30 +86,30 @@ ${e?`
86
86
  <canvas id="progress-panel" width="${R.SCREEN_WIDTH}" height="${R.SCREEN_HEIGHT}"></canvas>
87
87
  </div>`}
88
88
  ${t?Fe():``}
89
- `}function Or(){return`ontouchstart`in window&&`ontouchend`in window&&`ontouchmove`in window}function kr(e,t,n){var r=document.createElement(`style`);r.type=`text/css`,r.setAttribute(`id`,R.WWA_STYLE_TAG_ID),Ie(`head`)[0].appendChild(r),e.innerHTML=Dr(t!==null,n),t!==null&&(U(`wwa-cover`).style.backgroundImage=`url(${t})`,U(`wwa-cover`).style.backgroundRepeat=`no-repeat`,U(`wwa-cover`).style.backgroundPosition=`0 0`)}var Ar=class e{static{this.ROW_MAX=8}static{this.COL_MAX=3}static{this.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`]]}static{this.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`]]}update(){this.counter>0&&this.counter--}cursor_wait(){this.counter=R.CONTROLL_WAIT_FRAME}allClear(){this.col=0,this.row=0,this.counter=0}controll(t){if(!(this.counter>0))switch(t){case E.DOWN:this.row<e.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case E.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case E.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case E.RIGHT:this.col<e.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait());break}}ok(){this.close();var t=null;t=Re(e.CLICK_DOM_QUERY_TABLE[this.row][this.col]),t.classList.contains(`item-click-border`)||this.allClear();var n=new MouseEvent(`click`,{view:window,bubbles:!0,cancelable:!0});return t.dispatchEvent(n)}ng(){this.close()}close(){var t=null,n,r;for(n=0;n<e.COL_MAX;n++)for(r=0;r<e.ROW_MAX;r++)t=U(e.DOM_ID_TABLE[r][n]),t.classList.contains(`onpress`)&&t.classList.remove(`onpress`)}openView(){this.close();var t=null;t=U(e.DOM_ID_TABLE[this.row][this.col]),t.classList.add(`onpress`)}init(){this.allClear(),this.openView()}constructor(){this.allClear()}},G=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r():typeof define==`function`&&define.amd?define([],r):n.CryptoJS=r()})(e,function(){var e=e||function(e,t){var n;if(typeof window<`u`&&window.crypto&&(n=window.crypto),typeof self<`u`&&self.crypto&&(n=self.crypto),typeof globalThis<`u`&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<`u`&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<`u`&&global.crypto&&(n=global.crypto),!n&&typeof require==`function`)try{n=Dn()}catch{}var r=function(){if(n){if(typeof n.getRandomValues==`function`)try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes==`function`)try{return n.randomBytes(4).readInt32LE()}catch{}}throw Error(`Native crypto module could not be used to get secure random number.`)},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},o=a.lib={},s=o.Base=function(){return{extend:function(e){var t=i(this);return e&&t.mixIn(e),(!t.hasOwnProperty(`init`)||this.init===t.init)&&(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty(`toString`)&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),c=o.WordArray=s.extend({init:function(e,n){e=this.words=e||[],n==t?this.sigBytes=e.length*4:this.sigBytes=n},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new c.init(t,e)}}),l=a.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((a&15).toString(16))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new c.init(n,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch{throw Error(`Malformed UTF-8 data`)}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){typeof e==`string`&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,a=r.sigBytes,o=this.blockSize,s=a/(o*4);s=t?e.ceil(s):e.max((s|0)-this._minBufferSize,0);var l=s*o,u=e.min(l*4,a);if(l){for(var d=0;d<l;d+=o)this._doProcessBlock(i,d);n=i.splice(0,l),r.sigBytes-=u}return new c.init(n,u)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:512/32,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new m.HMAC.init(e,n).finalize(t)}}});var m=a.algo={};return a}(Math);return e})})),jr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=n.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],n==t?this.sigBytes=e.length*8:this.sigBytes=n},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return a.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}})})(),e})})),Mr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){if(typeof ArrayBuffer==`function`){var t=e.lib.WordArray,n=t.init,r=t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||typeof Uint8ClampedArray<`u`&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i<t;i++)r[i>>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)};r.prototype=t}})(),e.lib.WordArray})})),Nr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(a))}return r.join(``)},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,t*2)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);r.push(String.fromCharCode(o))}return r.join(``)},parse:function(e){for(var t=e.length,r=[],a=0;a<t;a++)r[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return n.create(r,t*2)}};function i(e){return e<<8&4278255360|e>>>8&16711935}})(),e.enc.Utf16})})),Pr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=t[a>>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,c=t[a+2>>>2]>>>24-(a+2)%4*8&255,l=o<<16|s<<8|c,u=0;u<4&&a+u*.75<n;u++)i.push(r.charAt(l>>>6*(3-u)&63));var d=r.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join(``)},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var a=0;a<n.length;a++)r[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);s!==-1&&(t=s)}return i(e,t,r)},_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`};function i(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}})(),e.enc.Base64})})),Fr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Base64url={stringify:function(e,t){t===void 0&&(t=!0);var n=e.words,r=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var a=[],o=0;o<r;o+=3)for(var s=n[o>>>2]>>>24-o%4*8&255,c=n[o+1>>>2]>>>24-(o+1)%4*8&255,l=n[o+2>>>2]>>>24-(o+2)%4*8&255,u=s<<16|c<<8|l,d=0;d<4&&o+d*.75<r;d++)a.push(i.charAt(u>>>6*(3-d)&63));var f=i.charAt(64);if(f)for(;a.length%4;)a.push(f);return a.join(``)},parse:function(e,t){t===void 0&&(t=!0);var n=e.length,r=t?this._safe_map:this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var o=0;o<r.length;o++)a[r.charCodeAt(o)]=o}var s=r.charAt(64);if(s){var c=e.indexOf(s);c!==-1&&(n=c)}return i(e,n,a)},_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,_safe_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`};function i(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}})(),e.enc.Base64url})})),Ir=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[];(function(){for(var e=0;e<64;e++)s[e]=t.abs(t.sin(e+1))*4294967296|0})();var c=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var a=this._hash.words,o=e[t+0],c=e[t+1],p=e[t+2],m=e[t+3],h=e[t+4],g=e[t+5],_=e[t+6],v=e[t+7],y=e[t+8],b=e[t+9],x=e[t+10],S=e[t+11],C=e[t+12],w=e[t+13],ee=e[t+14],T=e[t+15],E=a[0],D=a[1],O=a[2],k=a[3];E=l(E,D,O,k,o,7,s[0]),k=l(k,E,D,O,c,12,s[1]),O=l(O,k,E,D,p,17,s[2]),D=l(D,O,k,E,m,22,s[3]),E=l(E,D,O,k,h,7,s[4]),k=l(k,E,D,O,g,12,s[5]),O=l(O,k,E,D,_,17,s[6]),D=l(D,O,k,E,v,22,s[7]),E=l(E,D,O,k,y,7,s[8]),k=l(k,E,D,O,b,12,s[9]),O=l(O,k,E,D,x,17,s[10]),D=l(D,O,k,E,S,22,s[11]),E=l(E,D,O,k,C,7,s[12]),k=l(k,E,D,O,w,12,s[13]),O=l(O,k,E,D,ee,17,s[14]),D=l(D,O,k,E,T,22,s[15]),E=u(E,D,O,k,c,5,s[16]),k=u(k,E,D,O,_,9,s[17]),O=u(O,k,E,D,S,14,s[18]),D=u(D,O,k,E,o,20,s[19]),E=u(E,D,O,k,g,5,s[20]),k=u(k,E,D,O,x,9,s[21]),O=u(O,k,E,D,T,14,s[22]),D=u(D,O,k,E,h,20,s[23]),E=u(E,D,O,k,b,5,s[24]),k=u(k,E,D,O,ee,9,s[25]),O=u(O,k,E,D,m,14,s[26]),D=u(D,O,k,E,y,20,s[27]),E=u(E,D,O,k,w,5,s[28]),k=u(k,E,D,O,p,9,s[29]),O=u(O,k,E,D,v,14,s[30]),D=u(D,O,k,E,C,20,s[31]),E=d(E,D,O,k,g,4,s[32]),k=d(k,E,D,O,y,11,s[33]),O=d(O,k,E,D,S,16,s[34]),D=d(D,O,k,E,ee,23,s[35]),E=d(E,D,O,k,c,4,s[36]),k=d(k,E,D,O,h,11,s[37]),O=d(O,k,E,D,v,16,s[38]),D=d(D,O,k,E,x,23,s[39]),E=d(E,D,O,k,w,4,s[40]),k=d(k,E,D,O,o,11,s[41]),O=d(O,k,E,D,m,16,s[42]),D=d(D,O,k,E,_,23,s[43]),E=d(E,D,O,k,b,4,s[44]),k=d(k,E,D,O,C,11,s[45]),O=d(O,k,E,D,T,16,s[46]),D=d(D,O,k,E,p,23,s[47]),E=f(E,D,O,k,o,6,s[48]),k=f(k,E,D,O,v,10,s[49]),O=f(O,k,E,D,ee,15,s[50]),D=f(D,O,k,E,g,21,s[51]),E=f(E,D,O,k,C,6,s[52]),k=f(k,E,D,O,m,10,s[53]),O=f(O,k,E,D,x,15,s[54]),D=f(D,O,k,E,c,21,s[55]),E=f(E,D,O,k,y,6,s[56]),k=f(k,E,D,O,T,10,s[57]),O=f(O,k,E,D,_,15,s[58]),D=f(D,O,k,E,w,21,s[59]),E=f(E,D,O,k,h,6,s[60]),k=f(k,E,D,O,S,10,s[61]),O=f(O,k,E,D,p,15,s[62]),D=f(D,O,k,E,b,21,s[63]),a[0]=a[0]+E|0,a[1]=a[1]+D|0,a[2]=a[2]+O|0,a[3]=a[3]+k|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;n[i>>>5]|=128<<24-i%32;var a=t.floor(r/4294967296),o=r;n[(i+64>>>9<<4)+15]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,n[(i+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,e.sigBytes=(n.length+1)*4,this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+i+o;return(s<<a|s>>>32-a)+t}function u(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,n,r,i,a,o){var s=e+(t^n^r)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+i+o;return(s<<a|s>>>32-a)+t}n.MD5=a._createHelper(c),n.HmacMD5=a._createHmacHelper(c)})(Math),e.MD5})})),Lr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],s=n[3],c=n[4],l=0;l<80;l++){if(l<16)o[l]=e[t+l]|0;else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+c+o[l];l<20?d+=(i&a|~i&s)+1518500249:l<40?d+=(i^a^s)+1859775393:l<60?d+=(i&a|i&s|a&s)-1894007588:d+=(i^a^s)-899497514,c=s,s=a,a=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=Math.floor(n/4294967296),t[(r+64>>>9<<4)+15]=n,e.sigBytes=t.length*4,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)})(),e.SHA1})})),Rr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],c=[];(function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return(e-(e|0))*4294967296|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,1/2))),c[i]=n(t.pow(r,1/3)),i++),r++})();var l=[],u=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],d=n[6],f=n[7],p=0;p<64;p++){if(p<16)l[p]=e[t+p]|0;else{var m=l[p-15],h=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,g=l[p-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[p]=h+l[p-7]+_+l[p-16]}var v=s&u^~s&d,y=r&i^r&a^i&a,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),x=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),S=f+x+v+c[p]+l[p],C=b+y;f=d,d=u,u=s,s=o+S|0,o=a,a=i,i=r,r=S+C|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;return n[i>>>5]|=128<<24-i%32,n[(i+64>>>9<<4)+14]=t.floor(r/4294967296),n[(i+64>>>9<<4)+15]=r,e.sigBytes=n.length*4,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(u),n.HmacSHA256=a._createHmacHelper(u)})(Math),e.SHA256})})),zr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Rr()):typeof define==`function`&&define.amd?define([`./core`,`./sha256`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.algo,i=r.SHA256,a=r.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=i._createHelper(a),t.HmacSHA224=i._createHmacHelper(a)})(),e.SHA224})})),Br=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),jr()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,a=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];(function(){for(var e=0;e<80;e++)l[e]=s()})();var u=o.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],d=n[6],f=n[7],p=r.high,m=r.low,h=i.high,g=i.low,_=a.high,v=a.low,y=o.high,b=o.low,x=s.high,S=s.low,C=u.high,w=u.low,ee=d.high,T=d.low,E=f.high,D=f.low,O=p,k=m,A=h,te=g,j=_,M=v,ne=y,re=b,ie=x,N=S,P=C,ae=w,oe=ee,se=T,ce=E,F=D,I=0;I<80;I++){var le,ue,L=l[I];if(I<16)ue=L.high=e[t+I*2]|0,le=L.low=e[t+I*2+1]|0;else{var de=l[I-15],fe=de.high,pe=de.low,R=(fe>>>1|pe<<31)^(fe>>>8|pe<<24)^fe>>>7,me=(pe>>>1|fe<<31)^(pe>>>8|fe<<24)^(pe>>>7|fe<<25),he=l[I-2],ge=he.high,_e=he.low,ve=(ge>>>19|_e<<13)^(ge<<3|_e>>>29)^ge>>>6,ye=(_e>>>19|ge<<13)^(_e<<3|ge>>>29)^(_e>>>6|ge<<26),z=l[I-7],be=z.high,xe=z.low,Se=l[I-16],Ce=Se.high,B=Se.low;le=me+xe,ue=R+be+ +(le>>>0<me>>>0),le+=ye,ue=ue+ve+ +(le>>>0<ye>>>0),le+=B,ue=ue+Ce+ +(le>>>0<B>>>0),L.high=ue,L.low=le}var V=ie&P^~ie&oe,we=N&ae^~N&se,Te=O&A^O&j^A&j,Ee=k&te^k&M^te&M,H=(O>>>28|k<<4)^(O<<30|k>>>2)^(O<<25|k>>>7),De=(k>>>28|O<<4)^(k<<30|O>>>2)^(k<<25|O>>>7),Oe=(ie>>>14|N<<18)^(ie>>>18|N<<14)^(ie<<23|N>>>9),ke=(N>>>14|ie<<18)^(N>>>18|ie<<14)^(N<<23|ie>>>9),Ae=c[I],je=Ae.high,Me=Ae.low,Ne=F+ke,Pe=ce+Oe+ +(Ne>>>0<F>>>0),Ne=Ne+we,Pe=Pe+V+ +(Ne>>>0<we>>>0),Ne=Ne+Me,Pe=Pe+je+ +(Ne>>>0<Me>>>0),Ne=Ne+le,Pe=Pe+ue+ +(Ne>>>0<le>>>0),Fe=De+Ee,U=H+Te+ +(Fe>>>0<De>>>0);ce=oe,F=se,oe=P,se=ae,P=ie,ae=N,N=re+Ne|0,ie=ne+Pe+ +(N>>>0<re>>>0)|0,ne=j,re=M,j=A,M=te,A=O,te=k,k=Ne+Fe|0,O=Pe+U+ +(k>>>0<Ne>>>0)|0}m=r.low=m+k,r.high=p+O+ +(m>>>0<k>>>0),g=i.low=g+te,i.high=h+A+ +(g>>>0<te>>>0),v=a.low=v+M,a.high=_+j+ +(v>>>0<M>>>0),b=o.low=b+re,o.high=y+ne+ +(b>>>0<re>>>0),S=s.low=S+N,s.high=x+ie+ +(S>>>0<N>>>0),w=u.low=w+ae,u.high=C+P+ +(w>>>0<ae>>>0),T=d.low=T+se,d.high=ee+oe+ +(T>>>0<se>>>0),D=f.low=D+F,f.high=E+ce+ +(D>>>0<F>>>0)},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+128>>>10<<5)+30]=Math.floor(n/4294967296),t[(r+128>>>10<<5)+31]=n,e.sigBytes=t.length*4,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:1024/32});t.SHA512=n._createHelper(u),t.HmacSHA512=n._createHmacHelper(u)})(),e.SHA512})})),Vr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),jr(),Br()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`,`./sha512`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.x64,r=n.Word,i=n.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.extend({_doReset:function(){this._hash=new i.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 e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)})(),e.SHA384})})),Hr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),jr()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.x64.Word,s=n.algo,c=[],l=[],u=[];(function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=t%5,i=(2*e+3*t)%5;e=r,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var a=1,s=0;s<24;s++){for(var d=0,f=0,p=0;p<7;p++){if(a&1){var m=(1<<p)-1;m<32?f^=1<<m:d^=1<<m-32}a&128?a=a<<1^113:a<<=1}u[s]=o.create(d,f)}})();var d=[];(function(){for(var e=0;e<25;e++)d[e]=o.create()})();var f=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var a=e[t+2*i],o=e[t+2*i+1];a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,o=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360;var s=n[i];s.high^=o,s.low^=a}for(var f=0;f<24;f++){for(var p=0;p<5;p++){for(var m=0,h=0,g=0;g<5;g++){var s=n[p+5*g];m^=s.high,h^=s.low}var _=d[p];_.high=m,_.low=h}for(var p=0;p<5;p++)for(var v=d[(p+4)%5],y=d[(p+1)%5],b=y.high,x=y.low,m=v.high^(b<<1|x>>>31),h=v.low^(x<<1|b>>>31),g=0;g<5;g++){var s=n[p+5*g];s.high^=m,s.low^=h}for(var S=1;S<25;S++){var m,h,s=n[S],C=s.high,w=s.low,ee=c[S];ee<32?(m=C<<ee|w>>>32-ee,h=w<<ee|C>>>32-ee):(m=w<<ee-32|C>>>64-ee,h=C<<ee-32|w>>>64-ee);var T=d[l[S]];T.high=m,T.low=h}var E=d[0],D=n[0];E.high=D.high,E.low=D.low;for(var p=0;p<5;p++)for(var g=0;g<5;g++){var S=p+5*g,s=n[S],O=d[S],k=d[(p+1)%5+5*g],A=d[(p+2)%5+5*g];s.high=O.high^~k.high&A.high,s.low=O.low^~k.low&A.low}var s=n[0],te=u[f];s.high^=te.high,s.low^=te.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes*8;var r=e.sigBytes*8,a=this.blockSize*32;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/a)*a>>>5)-1]|=128,e.sigBytes=n.length*4,this._process();for(var o=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u<c;u++){var d=o[u],f=d.high,p=d.low;f=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,p=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,l.push(p),l.push(f)}return new i.init(l,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=a._createHelper(f),n.HmacSHA3=a._createHmacHelper(f)})(Math),e.SHA3})})),Ur=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.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]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.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]),d=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=a.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}for(var a=this._hash.words,o=d.words,p=f.words,b=s.words,x=c.words,S=l.words,C=u.words,w,ee,T,E,D,O=w=a[0],k=ee=a[1],A=T=a[2],te=E=a[3],j=D=a[4],M,n=0;n<80;n+=1)M=w+e[t+b[n]]|0,n<16?M+=m(ee,T,E)+o[0]:n<32?M+=h(ee,T,E)+o[1]:n<48?M+=g(ee,T,E)+o[2]:n<64?M+=_(ee,T,E)+o[3]:M+=v(ee,T,E)+o[4],M|=0,M=y(M,S[n]),M=M+D|0,w=D,D=E,E=y(T,10),T=ee,ee=M,M=O+e[t+x[n]]|0,n<16?M+=v(k,A,te)+p[0]:n<32?M+=_(k,A,te)+p[1]:n<48?M+=g(k,A,te)+p[2]:n<64?M+=h(k,A,te)+p[3]:M+=m(k,A,te)+p[4],M|=0,M=y(M,C[n]),M=M+j|0,O=j,j=te,te=y(A,10),A=k,k=M;M=a[1]+T+te|0,a[1]=a[2]+E+j|0,a[2]=a[3]+D+O|0,a[3]=a[4]+w+k|0,a[4]=a[0]+ee+A|0,a[0]=M},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,e.sigBytes=(t.length+1)*4,this._process();for(var i=this._hash,a=i.words,o=0;o<5;o++){var s=a[o];a[o]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}return i},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function m(e,t,n){return e^t^n}function h(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function _(e,t,n){return e&n|t&~n}function v(e,t,n){return e^(t|~n)}function y(e,t){return e<<t|e>>>32-t}n.RIPEMD160=a._createHelper(p),n.HmacRIPEMD160=a._createHmacHelper(p)})(Math),e.RIPEMD160})})),Wr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){(function(){var t=e,n=t.lib.Base,r=t.enc.Utf8,i=t.algo;i.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,typeof t==`string`&&(t=r.parse(t));var n=e.blockSize,i=n*4;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,c=o.words,l=0;l<n;l++)s[l]^=1549556828,c[l]^=909522486;a.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})})()})})),Gr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Rr(),Wr()):typeof define==`function`&&define.amd?define([`./core`,`./sha256`,`./hmac`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.SHA256,s=a.HMAC,c=a.PBKDF2=r.extend({cfg:r.extend({keySize:128/32,hasher:o,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=s.create(n.hasher,e),a=i.create(),o=i.create([1]),c=a.words,l=o.words,u=n.keySize,d=n.iterations;c.length<u;){var f=r.update(t).finalize(o);r.reset();for(var p=f.words,m=p.length,h=f,g=1;g<d;g++){h=r.finalize(h),r.reset();for(var _=h.words,v=0;v<m;v++)p[v]^=_[v]}a.concat(f),l[0]++}return a.sigBytes=u*4,a}});t.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)}})(),e.PBKDF2})})),Kr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Lr(),Wr()):typeof define==`function`&&define.amd?define([`./core`,`./sha1`,`./hmac`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,a=r.hasher.create(),o=i.create(),s=o.words,c=r.keySize,l=r.iterations;s.length<c;){n&&a.update(n),n=a.update(e).finalize(t),a.reset();for(var u=1;u<l;u++)n=a.finalize(n),a.reset();o.concat(n)}return o.sigBytes=c*4,o}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}})(),e.EvpKDF})})),qr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Kr()):typeof define==`function`&&define.amd?define([`./core`,`./evpkdf`],r):r(n.CryptoJS)})(e,function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var c=s.Base64,l=n.algo.EvpKDF,u=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return typeof e==`string`?S:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=n.mode={},f=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=f.extend();e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=a}});function n(e,n,r){var i,a=this._iv;a?(i=a,this._iv=t):i=this._prevBlock;for(var o=0;o<r;o++)e[n+o]^=i[o]}return e}(),m=n.pad={},h=m.Pkcs7={pad:function(e,t){for(var n=t*4,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var c=a.create(o,r);e.concat(c)},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:p,padding:h}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:128/32});var g=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),_=n.format={},v=_.OpenSSL={stringify:function(e){var t,n=e.ciphertext,r=e.salt;return t=r?a.create([1398893684,1701076831]).concat(r).concat(n):n,t.toString(c)},parse:function(e){var t,n=c.parse(e),r=n.words;return r[0]==1398893684&&r[1]==1701076831&&(t=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:v}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),a=i.finalize(t),o=i.cfg;return g.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return typeof e==`string`?t.parse(e,this):e}}),b=n.kdf={},x=b.OpenSSL={execute:function(e,t,n,r,i){if(r||=a.random(64/8),i)var o=l.create({keySize:t+n,hasher:i}).compute(e,r);else var o=l.create({keySize:t+n}).compute(e,r);var s=a.create(o.words.slice(t),n*4);return o.sigBytes=t*4,g.create({key:o,iv:s,salt:r})}},S=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:x}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=r.kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=i.iv;var a=y.encrypt.call(this,e,t,i.key,r);return a.mixIn(i),a},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()})})),Jr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i,r),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);n.call(this,e,t,i,r),this._prevBlock=a}});function n(e,t,n,r){var i,a=this._iv;a?(i=a.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var o=0;o<n;o++)e[t+o]^=i[o]}return t}(),e.mode.CFB})})),Yr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CTR=function(){var t=e.lib.BlockCipherMode.extend();return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);n.encryptBlock(o,0),a[r-1]=a[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=o[s]}}),t}(),e.mode.CTR})})),Xr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CTRGladman=function(){var t=e.lib.BlockCipherMode.extend();function n(e){if((e>>24&255)==255){var t=e>>16&255,n=e>>8&255,r=e&255;t===255?(t=0,n===255?(n=0,r===255?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}function r(e){return(e[0]=n(e[0]))===0&&(e[1]=n(e[1])),e}return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),r(o);var s=o.slice(0);n.encryptBlock(s,0);for(var c=0;c<i;c++)e[t+c]^=s[c]}}),t}(),e.mode.CTRGladman})})),Zr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.OFB=function(){var t=e.lib.BlockCipherMode.extend();return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._keystream;i&&(a=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(a,0);for(var o=0;o<r;o++)e[t+o]^=a[o]}}),t}(),e.mode.OFB})})),Qr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.ECB=function(){var t=e.lib.BlockCipherMode.extend();return t.Encryptor=t.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),t}(),e.mode.ECB})})),$r=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=t*4,i=r-n%r,a=n+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Ansix923})})),ei=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.Iso10126={pad:function(t,n){var r=n*4,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Iso10126})})),ti=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})})),ni=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=t*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){for(var t=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},e.pad.ZeroPadding})})),ri=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})})),ii=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib.CipherParams,i=n.enc.Hex,a=n.format;a.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return r.create({ciphertext:t})}}})(),e.format.Hex})})),ai=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Pr(),Ir(),Kr(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[];(function(){for(var e=[],t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var n=0,r=0,t=0;t<256;t++){var m=r^r<<1^r<<2^r<<3^r<<4;m=m>>>8^m&255^99,i[n]=m,a[m]=n;var h=e[n],g=e[h],_=e[g],v=e[m]*257^m*16843008;o[n]=v<<24|v>>>8,s[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,l[n]=v;var v=_*16843009^g*65537^h*257^n*16843008;u[m]=v<<24|v>>>8,d[m]=v<<16|v>>>16,f[m]=v<<8|v>>>24,p[m]=v,n?(n=h^e[e[e[_^h]]],r^=e[e[r]]):n=r=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],h=r.AES=n.extend({_doReset:function(){var e;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var t=this._keyPriorReset=this._key,n=t.words,r=t.sigBytes/4,a=((this._nRounds=r+6)+1)*4,o=this._keySchedule=[],s=0;s<a;s++)s<r?o[s]=n[s]:(e=o[s-1],s%r?r>6&&s%r==4&&(e=i[e>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[e&255]):(e=e<<8|e>>>24,e=i[e>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[e&255],e^=m[s/r|0]<<24),o[s]=o[s-r]^e);for(var c=this._invKeySchedule=[],l=0;l<a;l++){var s=a-l;if(l%4)var e=o[s];else var e=o[s-4];l<4||s<=4?c[l]=e:c[l]=u[i[e>>>24]]^d[i[e>>>16&255]]^f[i[e>>>8&255]]^p[i[e&255]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,s,c,l,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,f,p,a);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,a,o,s){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],f=e[t+3]^n[3],p=4,m=1;m<c;m++){var h=r[l>>>24]^i[u>>>16&255]^a[d>>>8&255]^o[f&255]^n[p++],g=r[u>>>24]^i[d>>>16&255]^a[f>>>8&255]^o[l&255]^n[p++],_=r[d>>>24]^i[f>>>16&255]^a[l>>>8&255]^o[u&255]^n[p++],v=r[f>>>24]^i[l>>>16&255]^a[u>>>8&255]^o[d&255]^n[p++];l=h,u=g,d=_,f=v}var h=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[d>>>8&255]<<8|s[f&255])^n[p++],g=(s[u>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[l&255])^n[p++],_=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[l>>>8&255]<<8|s[u&255])^n[p++],v=(s[f>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[d&255])^n[p++];e[t]=h,e[t+1]=g,e[t+2]=_,e[t+3]=v},keySize:256/32});t.AES=n._createHelper(h)})(),e.AES})})),oi=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Pr(),Ir(),Kr(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.BlockCipher,a=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],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=o[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){for(var l=i[a]=[],u=c[a],n=0;n<24;n++)l[n/6|0]|=t[(s[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(s[n+24]-1+u)%28]<<31-n%6;l[0]=l[0]<<1|l[0]>>>31;for(var n=1;n<7;n++)l[n]=l[n]>>>(n-1)*4+3;l[7]=l[7]<<5|l[7]>>>27}for(var d=this._invSubKeys=[],n=0;n<16;n++)d[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=l[c][((o^i[c])&u[c])>>>0];this._lBlock=o,this._rBlock=a^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function f(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function p(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}t.DES=i._createHelper(d);var m=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(e.length!==2&&e.length!==4&&e.length<6)throw Error(`Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.`);var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(r.create(t)),this._des2=d.createEncryptor(r.create(n)),this._des3=d.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:192/32,ivSize:64/32,blockSize:64/32});t.TripleDES=i._createHelper(m)})(),e.TripleDES})})),si=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Pr(),Ir(),Kr(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;for(var i=0,a=0;i<256;i++){var o=i%n,s=t[o>>>2]>>>24-o%4*8&255;a=(a+r[i]+s)%256;var c=r[i];r[i]=r[a],r[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:256/32,ivSize:0});function a(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){t=(t+1)%256,n=(n+e[t])%256;var a=e[t];e[t]=e[n],e[n]=a,r|=e[(e[t]+e[n])%256]<<24-i*8}return this._i=t,this._j=n,r}t.RC4=n._createHelper(i);var o=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});t.RC4Drop=n._createHelper(o)})(),e.RC4})})),ci=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Pr(),Ir(),Kr(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],a=[],o=[],s=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=(e[n]<<8|e[n]>>>24)&16711935|(e[n]<<24|e[n]>>>8)&4278255360;var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var n=0;n<4;n++)c.call(this);for(var n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],l=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,d=l>>>16|u&4294901760,f=u<<16|l&65535;i[0]^=l,i[1]^=d,i[2]^=u,i[3]^=f,i[4]^=l,i[5]^=d,i[6]^=u,i[7]^=f;for(var n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=(i[r]<<8|i[r]>>>24)&16711935|(i[r]<<24|i[r]>>>8)&4278255360,e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+ +(t[0]>>>0<a[0]>>>0)|0,t[2]=t[2]+886263092+ +(t[1]>>>0<a[1]>>>0)|0,t[3]=t[3]+1295307597+ +(t[2]>>>0<a[2]>>>0)|0,t[4]=t[4]+3545052371+ +(t[3]>>>0<a[3]>>>0)|0,t[5]=t[5]+886263092+ +(t[4]>>>0<a[4]>>>0)|0,t[6]=t[6]+1295307597+ +(t[5]>>>0<a[5]>>>0)|0,t[7]=t[7]+3545052371+ +(t[6]>>>0<a[6]>>>0)|0,this._b=+(t[7]>>>0<a[7]>>>0);for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16;o[n]=((i*i>>>17)+i*s>>>15)+s*s^((r&4294901760)*r|0)+((r&65535)*r|0)}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.Rabbit=n._createHelper(s)})(),e.Rabbit})})),li=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Pr(),Ir(),Kr(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],a=[],o=[],s=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var i=0;i<4;i++)c.call(this);for(var i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var a=t.words,o=a[0],s=a[1],l=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,d=l>>>16|u&4294901760,f=u<<16|l&65535;r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=f,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=f;for(var i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=(i[r]<<8|i[r]>>>24)&16711935|(i[r]<<24|i[r]>>>8)&4278255360,e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+ +(t[0]>>>0<a[0]>>>0)|0,t[2]=t[2]+886263092+ +(t[1]>>>0<a[1]>>>0)|0,t[3]=t[3]+1295307597+ +(t[2]>>>0<a[2]>>>0)|0,t[4]=t[4]+3545052371+ +(t[3]>>>0<a[3]>>>0)|0,t[5]=t[5]+886263092+ +(t[4]>>>0<a[4]>>>0)|0,t[6]=t[6]+1295307597+ +(t[5]>>>0<a[5]>>>0)|0,t[7]=t[7]+3545052371+ +(t[6]>>>0<a[6]>>>0)|0,this._b=+(t[7]>>>0<a[7]>>>0);for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16;o[n]=((i*i>>>17)+i*s>>>15)+s*s^((r&4294901760)*r|0)+((r&65535)*r|0)}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.RabbitLegacy=n._createHelper(s)})(),e.RabbitLegacy})})),ui=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Pr(),Ir(),Kr(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.BlockCipher,r=t.algo;let i=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function s(e,t){let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=t&255,o=e.sbox[0][n]+e.sbox[1][r];return o^=e.sbox[2][i],o+=e.sbox[3][a],o}function c(e,t,n){let r=t,i=n,a;for(let t=0;t<16;++t)r^=e.pbox[t],i=s(e,r)^i,a=r,r=i,i=a;return a=r,r=i,i=a,i^=e.pbox[16],r^=e.pbox[17],{left:r,right:i}}function l(e,t,n){let r=t,i=n,a;for(let t=17;t>1;--t)r^=e.pbox[t],i=s(e,r)^i,a=r,r=i,i=a;return a=r,r=i,i=a,i^=e.pbox[1],r^=e.pbox[0],{left:r,right:i}}function u(e,t,n){for(let t=0;t<4;t++){e.sbox[t]=[];for(let n=0;n<256;n++)e.sbox[t][n]=a[t][n]}let r=0;for(let a=0;a<18;a++)e.pbox[a]=i[a]^t[r],r++,r>=n&&(r=0);let o=0,s=0,l=0;for(let t=0;t<18;t+=2)l=c(e,o,s),o=l.left,s=l.right,e.pbox[t]=o,e.pbox[t+1]=s;for(let t=0;t<4;t++)for(let n=0;n<256;n+=2)l=c(e,o,s),o=l.left,s=l.right,e.sbox[t][n]=o,e.sbox[t][n+1]=s;return!0}var d=r.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var e=this._keyPriorReset=this._key,t=e.words;u(o,t,e.sigBytes/4)}},encryptBlock:function(e,t){var n=c(o,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},decryptBlock:function(e,t){var n=l(o,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},blockSize:64/32,keySize:128/32,ivSize:64/32});t.Blowfish=n._createHelper(d)})(),e.Blowfish})})),di=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),jr(),Mr(),Nr(),Pr(),Fr(),Ir(),Lr(),Rr(),zr(),Br(),Vr(),Hr(),Ur(),Wr(),Gr(),Kr(),qr(),Jr(),Yr(),Xr(),Zr(),Qr(),$r(),ei(),ti(),ni(),ri(),ii(),ai(),oi(),si(),ci(),li(),ui()):typeof define==`function`&&define.amd?define(`./core,./x64-core,./lib-typedarrays,./enc-utf16,./enc-base64,./enc-base64url,./md5,./sha1,./sha256,./sha224,./sha512,./sha384,./sha3,./ripemd160,./hmac,./pbkdf2,./evpkdf,./cipher-core,./mode-cfb,./mode-ctr,./mode-ctr-gladman,./mode-ofb,./mode-ecb,./pad-ansix923,./pad-iso10126,./pad-iso97971,./pad-zeropadding,./pad-nopadding,./format-hex,./aes,./tripledes,./rc4,./rabbit,./rabbit-legacy,./blowfish`.split(`,`),r):n.CryptoJS=r(n.CryptoJS)})(e,function(e){return e})}))();function fi(e,t){return`^ /${e*231+8310+t}P+>A[]`}function pi(e){return`^ /${e*231+8310}P+>A[]`}function mi(e,t){return console.warn(di.enc.Utf8.parse(e)),di.AES.encrypt(di.enc.Utf8.parse(e),pi(t)).toString()}function hi(e,t,n){return di.AES.decrypt(e,fi(t,n)).toString(di.enc.Utf8)}function gi(e,t){return di.AES.decrypt(e,pi(t)).toString(di.enc.Utf8)}function _i(e){return(0,di.MD5)(e).toString()}var{parse:vi,stringify:yi}=JSON,{keys:bi}=Object,xi=String,Si=`string`,Ci={},wi=`object`,Ti=(e,t)=>t,Ei=e=>e instanceof xi?xi(e):e,Di=(e,t)=>typeof t===Si?new xi(t):t,Oi=(e,t,n,r)=>i=>{for(let a=bi(i),{length:o}=a,s=0;s<o;s++){let o=a[s],c=i[o];if(c instanceof xi){let a=e[+c];typeof a===wi&&!n.has(a)?(n.add(a),i[o]=Ci,t.push({o:i,k:o,r:a})):i[o]=r.call(i,o,a)}else i[o]!==Ci&&(i[o]=r.call(i,o,c))}return i},ki=(e,t,n)=>{let r=xi(t.push(n)-1);return e.set(n,r),r},Ai=(e,t)=>{let n=vi(e,Di).map(Ei),r=t||Ti,i=n[0];if(typeof i===wi&&i){let e=[],t=Oi(n,e,new Set,r);i=t(i);let a=0;for(;a<e.length;){let{o:n,k:i,r:o}=e[a++];n[i]=r.call(n,i,t(o))}}return r.call({"":i},``,i)},ji=(e,t,n)=>{let r=t&&typeof t===wi?(e,n)=>e===``||-1<t.indexOf(e)?n:void 0:t||Ti,i=new Map,a=[],o=[],s=+ki(i,a,r.call({"":e},``,e)),c=!s;for(;s<a.length;)c=!0,o[s]=yi(a[s++],l,n);return`[`+o.join(`,`)+`]`;function l(e,t){if(c)return c=!c,t;let n=r.call(this,e,t);switch(typeof n){case wi:if(n===null)return n;case Si:return i.get(n)||ki(i,a,n)}return n}},Mi=e=>vi(ji(e)),Ni=e=>Ai(yi(e)),Pi=Object.freeze({MAP:`map`,MAP_OBJECT:`mapObject`,SYSTEM_MESSAGE:`systemMessage`,USER_VAR:`userVar`,USER_NAMED_VAR:`userNamedVar`}),Fi=Object.freeze({mapAttribute:!0,objectAttribute:!0,message:!0}),Ii=class{},Li=class{static{this._usingByteFlag=!1}static{this.MIN_LOOP_COUNT=3}static{this._restartData=void 0}static{this._mapByteLength=0}static{this._firstRandomMapObjectUtf8Table=new Ii}static compress(e,t={}){var n=Object.create(null),r,i;for(r in e)if(!Fi[r]){switch(i=e[r],typeof i){case`number`:case`string`:case`boolean`:if(this._restartData[r]===i&&r!==`worldName`)continue;break;case`object`:if(i===null){if(this._restartData[r]===i)continue}else if(i=this.compressObject(r,i,this._restartData[r],t),i===void 0)continue;break;case`undefined`:break;case`function`:continue}n[r]=i}return n}static compressObject(e,t,n,r={}){var i,a,o,s;switch(e){case Pi.MAP:case Pi.MAP_OBJECT:var c,l,u,f,p,m,h,g,_,v,y,b,x,S;for(p in i=Object.create(null),_=Object.create(null),g=Object.create(null),t)for(f in a=t[p],o=n[p],s=Object.create(null),l=-1,a)h=a[f],h!==o[f]&&(s[f]=h,_[h]===void 0&&(_[h]=Object.create(null)),y=_[h],y[p]===void 0&&(y[p]=[]),x=y[p],x.push(Number(f)));for(b in _)for(p in y=_[b],g[b]===void 0&&(g[b]=Object.create(null)),v=g[b],i[b]===void 0&&(i[b]=[]),l=-1,y)x=y[p],x.length===1?(m=x[0],v[m]===void 0&&(v[m]=[]),S=v[m],S.push(Number(p))):(c=Number(p),u=c-l-1,l=c,i[b].push(this.getCompressArray(x),u));for(b in g)for(f in h=Number(b),v=g[b],l=-1,v)S=v[f],c=Number(f),u=c-l-1,l=c,S.length===1?i[b].push(u,S[0]):i[b].push(u,this.getCompressArray(S));var C=[];for(b in l=-1,i)c=Number(b),u=c-l-1,l=c,C.push(u,i[b]);return this._usingByteFlag&&JSON.stringify(C).length>=this._mapByteLength?this.compressMapAllObject(t,n,this._firstRandomMapObjectUtf8Table[e]):C;case Pi.SYSTEM_MESSAGE:i=Object.create(null);var e,w;for(e in t)w=t[e],n[e]!==w&&(i[e]=w);break;case Pi.USER_VAR:return this.compressUserVars(t);case Pi.USER_NAMED_VAR:if(!(t instanceof Map))throw TypeError(`USER_NAMED_VAR が正しい形式でないためセーブできません`);return{version:2,data:Mi(d(t))};default:return t}if(Object.keys(i).length!==0)return i}static compressUserVars(e){return e.map((e,t)=>[t,e]).filter(([e,t])=>t!==0)}static compressMapAllObject(e,t,n){var r,i,a,o,s,c,l,u,d=this._restartData.mapWidth,f,p,m,h,g,_,v,y,b=new Uint8Array(this._mapByteLength),x=-1,S;for(a=0,o=0,c=0,l=0,y=0,m=[],_=Object.create(null),f=[],p=[],i=0;i<d;i++)for(r=0;r<d;r++)u=e[i][r],u!==t[i][r]&&(x===-1&&(x=o),b[o]=b[o]|1<<a,c=o,_[u]===void 0&&(_[u]=new Ri(u,y++)),_[u].count++),a++,a===8&&(a=0,o++);for(s in _)v=_[s].index,m[v]=_[s];for(h in m.sort(this.idSort),g=Object.create(null),m)u=m[h].id,g[u]=Number(h),f[h]=u;for(i=0;i<d;i++)for(r=0;r<d;r++)u=e[i][r],u!==t[i][r]&&(p[l++]=g[u]);if(n){for(S=b.length,x=-1,c=0,o=0;o<S;o++)b[o]=b[o]&~n[o],b[o]!==0&&(x===-1&&(x=o),c=o);x===-1&&(x=0,c=0)}return[x,b.subarray(x,c+1),f,this.indexListCompress(p,f.length)]}static indexListCompress(e,t){var n=[],r,i,a,o=e.length,s,c,l;for(i=0,r=0;r<o;r++){for(s=e[r],l=0,a=r+1;a<o&&(c=e[a],s===c);a++)l++,r=a;switch(l){case 0:n[i++]=s;break;case 1:n[i++]=s,n[i++]=s;break;default:n[i++]=s,n[i++]=t+l;break}}return n}static idSort(e,t){return t.count-e.count}static getCompressArray(e){var t=[],n=-1,r,i,a,o=e.length,s,c,l;for(s=0,a=0;a<o;a++){for(i=e[a],r=i-n,c=0,l=a;l<o-1&&e[l]+1===e[l+1];)l++,c++;c<this.MIN_LOOP_COUNT?t[s++]=r:(a=l,i+=c,t[s++]=0,t[s++]=r,t[s++]=c-this.MIN_LOOP_COUNT),n=i}return t}static getDecompressArray(e){var t=[],n=-1,r,i,a,o=e.length,s,c;for(a=0,c=0;a<o;a++)if(r=e[a],r===0){for(r=e[++a],i=n+r,s=i+e[++a]+this.MIN_LOOP_COUNT;i<=s;i++)t[c++]=i;n=s}else i=n+r,t[c++]=i,n=i;return t}static decompress(e){var t=structuredClone(this._restartData),n,r;for(n in e){switch(r=e[n],typeof r){case`number`:case`string`:case`boolean`:break;case`object`:r!==null&&(r=this.decompressObject(n,r,t[n]));break;case`undefined`:break;case`function`:continue}t[n]=r}return[t,{isWorldNameEmpty:e.worldName===void 0}]}static decompressObject(e,t,n,r={}){var i,e;switch(e){case Pi.MAP:case Pi.MAP_OBJECT:var a,o,s,c,l,d,f;i=Object.create(null),o=-1;var p,m,h=t;if(m=h.length,m===4&&typeof h[0]==`number`&&(h[1]instanceof Uint8Array||h[1]instanceof Array)&&h[2]instanceof Array&&h[3]instanceof Array)return this.decompressAllMapObject(h,n,this._firstRandomMapObjectUtf8Table[e]),n;for(p=0;p<m;p+=2)s=Number(h[p]),a=o+s+1,o=a,d=a,i[a]=h[p+1];var g,_;for(f in i){for(d=Number(f),h=i[f],m=h.length,g=[],_=[],p=0;p<m;p+=2){var v=h[p],y=h[p+1];v instanceof Array&&(v=this.getDecompressArray(v)),y instanceof Array&&(y=this.getDecompressArray(y)),typeof v==`object`?g.push({x:v,y}):_.push({x:v,y})}for(var b in o=-1,g)if(s=Number(g[b].y),a=o+s+1,o=a,v=g[b].x,l=String(a),v instanceof Array)for(h=v,m=h.length,p=0;p<m;p++)c=String(h[p]),n[l][c]=d;else c=String(v),n[l][c]=d;for(b in o=-1,_)if(s=Number(_[b].x),a=o+s+1,o=a,y=_[b].y,c=String(a),y instanceof Array)for(h=y,m=h.length,p=0;p<m;p++)l=String(h[p]),n[l][c]=d;else l=String(y),n[l][c]=d}return n;case Pi.USER_VAR:return this.decompressUserVars(t);case Pi.USER_NAMED_VAR:if(!t)return t;if(Array.isArray(t))return new Map(structuredClone(t).map(([e,t])=>[e,u(t)]));if(t.version!==2||typeof t.data!=`object`)throw TypeError(`セーブデータが壊れています`);return u(Ni(t.data));case Pi.SYSTEM_MESSAGE:default:if(!n)if(t)n=n instanceof Array?[]:Object.create(null);else return;for(e in t)n[e]=t[e];return n}}static decompressUserVars(e){return e.reduce((e,[t,n])=>(e[t]=n,e),this.generateEmptyUserVars())}static generateEmptyUserVars(){let e=Array(R.USER_VAR_NUM);for(let t=0;t<R.USER_VAR_NUM;t++)e[t]=0;return e}static decompressAllMapObject(e,t,n){var r,i,a,o,s,c,a,l=this._restartData.mapWidth,u,d,f,p,m,h=new Uint8Array(this._mapByteLength),r,i,o,s,g,c,_=0;_=e[0],f=e[2],u=e[3];var v=e[1];if(h.set(v,_),n)for(g=h.length,s=0;s<g;s++)h[s]=h[s]|n[s];d=[];var y=f.length,g=u.length,b,x,S,C,w;for(b=0,x=0;b<g;b++){if(p=u[b],p>=y)for(S=p-y,C=0;C<S;C++)d[x++]=w;else d[x++]=p;w=p}for(o=0,s=0,c=0,m=0,g=h.length,s=0;s<g;s++)for(o=0;o<8;o++){if(h[s]&1<<o){if(p=d[m++],p===void 0)return!1;a=f[p],r=c%l,i=c/l|0,t[i][r]=a}c++}return!0}static setRestartData(e,t){this._restartData=e,this._mapByteLength=Math.ceil(e.mapWidth*e.mapWidth/8),this._firstRandomMapObjectUtf8Table[Pi.MAP_OBJECT]=this.getChangedUint8Array(t[Pi.MAP_OBJECT],e[Pi.MAP_OBJECT])}static getChangedUint8Array(e,t){var n,r,i,a,o=this._restartData.mapWidth,s=new Uint8Array(this._mapByteLength),c=-1;for(i=0,a=0,r=0;r<o;r++)for(n=0;n<o;n++)e[r][n]!==t[r][n]&&(c===-1&&(c=a),s[a]=s[a]|1<<i),i++,i===8&&(i=0,a++);return s}static getStartWWAData(e){if(!e)return this._restartData;try{var t=JSON.parse(e)}catch{return this._restartData}if(t){var n;try{if([n]=this.decompress(t),n)return n}catch{}}return this._restartData}static usingByte(e){this._usingByteFlag=e}},Ri=class{constructor(e,t){this.id=0,this.index=0,this.count=0,this.id=e,this.index=t}},zi=class{constructor(e,t){this._id=0,this.flag=!1,this.date=void 0,this.cvs=void 0,this.ctx=void 0,this.quickSaveData=void 0,this._id=e,this._parent=t,this.cvs=document.createElement(`canvas`),this.cvs.width=me.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=me.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext(`2d`,{alpha:!1})}showQickLoad(){U(`cell-load`).textContent=he.QUICK_LOAD}save(e,t){return this._statusEnergy=t.statusEnergy,this.ctx.clearRect(0,0,this.cvs.width,this.cvs.height),this.ctx.drawImage(e,0,0,e.width,e.height,0,0,this.cvs.width,this.cvs.height),this.quickSaveData=t,this.flag=!0,this.date=new Date,this.showQickLoad(),!0}getStatusEnergy(){return this.flag?this._statusEnergy:-1}load(){return this.quickSaveData}saveDataSet(e,t,n){try{this.quickSaveData=t,this._statusEnergy=t.statusEnergy,this.date=n,this.flag=!0;var r=document.createElement(`img`);r.src=e,r.addEventListener(`load`,()=>{this.flag=!0,this.ctx.drawImage(r,0,0,r.width,r.height,0,0,this.cvs.width,this.cvs.height)}),this.showQickLoad()}catch{}}getDateText(){let e,t,n,r,i,a;return this.date?(e=this.date.getFullYear(),t=this.date.getMonth()+1,n=this.date.getDate(),r=this.date.getHours(),i=this.date.getMinutes(),a=this.date.getSeconds(),e=(`000`+e).slice(-4),t=(`0`+t).slice(-2),n=(`0`+n).slice(-2),r=(`0`+r).slice(-2),i=(`0`+i).slice(-2),a=(`0`+a).slice(-2),e+`/`+t+`/`+n+` `+r+`:`+i+`:`+a):``}isLastSaveData(){return this===this._parent.getLastSaveData()}},Bi=class extends zi{save(e,t){var n=super.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,t,this.date),n}},Vi=class e extends Array{constructor(){super(),Object.setPrototypeOf(this,Object.create(e.prototype))}hasSaveData(){for(var e=0;e<me.QUICK_SAVE_MAX;e++)if(this[e].flag)return!0;return!1}getLastSaveData(){for(var e,t,n=0;n<me.QUICK_SAVE_MAX;n++)t=this[n],t.flag&&(e?t.date&&e.date&&t.date.getTime()>e.date.getTime()&&(e=t):e=t);return e}},Hi=e=>typeof e.isGameOverDisabled==`boolean`?e.isGameOverDisabled===!0?{...e,isGameOverDisabled:void 0,gameOverPolicy:`never`}:e.isGameOverDisabled===!1?{...e,isGameOverDisabled:void 0,gameOverPolicy:`default`}:e:e,Ui=e=>Hi(e),Wi=class e extends Vi{static{this.doNotAnything=()=>{}}constructor(t,n,r=e.prototype){super(),this.IDBTransaction={READ_ONLY:`readonly`,READ_WRITE:`readwrite`,VERSION_CHANGE:`versionchangetransaction`},this.keyPath=[`id`,`url`],Object.setPrototypeOf(this,Object.create(r));for(var i=0;i<me.QUICK_SAVE_MAX;i++)this[i]=new Bi(i,this);this.onCheckLoadingSaveData=t,this.onCompleteLoadingSaveData=n,this.createDataBase(),this.selectSaveData()}indexDBOpen(){return indexedDB.open(me.INDEXEDDB_DB_NAME,201205201)}createDataBase(){try{var t=this.indexDBOpen();t.onupgradeneeded=e=>{var n=t.result,r={keyPath:this.keyPath};n.objectStoreNames.contains(me.INDEXEDDB_TABLE_NAME)||n.createObjectStore(me.INDEXEDDB_TABLE_NAME,r).createIndex(`url`,`url`,{unique:!1})},t.onsuccess=e.doNotAnything,t.onerror=e.doNotAnything,t.onblocked=e.doNotAnything}catch{}}getObjectStore(e){let t=e;try{var n=t.transaction(me.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(me.INDEXEDDB_TABLE_NAME)}catch{return}return n}makeSaveDataItem(e,t,n,r){return{url:location.href,id:e,hash:Yi.checkOriginalMapString,image:t.toDataURL(),data:n,date:r,worldName:Yi.worldName,mapDataRevisionKey:Yi.mapDataRevisionKey}}getSaveDataResult(e,t){let n=e.index(`url`),r=IDBKeyRange.only(location.href),i=n.getAll(r);i.onsuccess=()=>{t(i.result)}}dbUpdateSaveData(t,n,r,i){let a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=()=>{let o=this.getObjectStore(a.result),s=Li.compress(r),c=this.makeSaveDataItem(t,n,s,i);this.selectDatas[t]=c;let l=o.put(c);l.onsuccess=e.doNotAnything,l.onerror=e.doNotAnything},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything}dbDeleteSaveData(t){let n=this.indexDBOpen();n.onupgradeneeded=e.doNotAnything,n.onsuccess=()=>{let e=this.getObjectStore(n.result);t.forEach(t=>{e.delete([t,location.href])})},n.onerror=e.doNotAnything,n.onblocked=e.doNotAnything}selectSaveData(){let t=this.indexDBOpen();t.onupgradeneeded=e.doNotAnything,t.onsuccess=()=>{let e=this.getObjectStore(t.result);this.selectDatas=[],this.getSaveDataResult(e,e=>{var t,n,r;let i=[];for(n=e.length,t=0;t<n;t++){var a=e[t];try{r={id:a.id,hash:a.hash,data:a.data,date:a.date,image:a.image,worldName:a.worldName,mapDataRevisionKey:a.mapDataRevisionKey}}catch{continue}let n=this.onCheckLoadingSaveData(r.worldName,r.hash,r.mapDataRevisionKey);if(n!==null){i.push({id:r.id,cause:n});continue}if(!this[r.id])continue;let o=Ui(Li.decompress(r.data)[0]);this[r.id].saveDataSet(r.image,o,r.date)}i.length>0&&this.dbDeleteSaveData(i.map(e=>e.id));let o=i.map(e=>e.cause).filter((e,t,n)=>n.indexOf(e)===t);this.onCompleteLoadingSaveData(o)})},t.onerror=e.doNotAnything,t.onblocked=e.doNotAnything}},Gi=class extends zi{},Ki=class e extends Vi{constructor(){super(),this._saveNo=0,this._lastAutoSaveMove=0,this._autoInterval=me.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(this,Object.create(e.prototype));for(var t=0;t<me.QUICK_SAVE_MAX;t++)this[t]=new Gi(t,this);this._saveNo=0,this._lastAutoSaveMove=0}resumeStart(){this._lastAutoSaveMove=-1}setPlayer(e){this._lastAutoSaveMove=e.getMoveCount()}isAutoSaveFrame(e){if(this._autoInterval===0)return!1;var t=e.getMoveCount();return this._lastAutoSaveMove>=t||t%this._autoInterval!==0?!1:(this._lastAutoSaveMove=t,!0)}autoSave(e,t){this[this._saveNo].save(e,t),this._saveNo++,this._saveNo%=me.QUICK_SAVE_MAX}setAutoSaveInterval(e){if(e<0){console.warn(`オートセーブの歩数 (${e}) に負の値が設定されています。`);return}this._autoInterval=e|0}};function qi(e,t){return(0,di.MD5)(e+t).toString()}var Ji=function(e){return e.UNMATCHED_WORLD_NAME=`UNMATCHED_WORLD_NAME`,e.UNMATCHED_WORLD_PASS_NUMBER=`UNMATCHED_WORLD_PASS_NUMBER`,e.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA=`DISALLOW_OLD_REVISION_WORLD_SAVE_DATA`,e}({}),Yi=class e{constructor(t,n,r,i,a){e.checkOriginalMapString=t.checkOriginalMapString,e.worldName=n,e.mapDataRevisionKey=qi(n,r),this._wwaDBSaveList=new Wi(i,a),this._wwaLogSaveList=new Ki,this.selectDBSaveDataList()}resumeStart(){this._wwaLogSaveList.resumeStart()}isAutoSaveFrame(e){return this._wwaLogSaveList.isAutoSaveFrame(e)}autoSave(e,t){this._wwaLogSaveList.autoSave(e,t)}selectDBSaveDataList(){this.list=this._wwaDBSaveList}selectLogSaveDataList(){this.list=this._wwaLogSaveList}save(e,t,n){var r=this.list[n];return r?r.save(e,t):!1}load(e){var t=this.list[e];return t?t.load():null}hasSaveData(){return this.list.hasSaveData()}setAutoSaveInterval(e){return this._wwaLogSaveList.setAutoSaveInterval(e)}getFirstSaveChoiceCallInfo(e){return e?N.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?N.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?N.CALL_BY_LOG_QUICK_LOAD:N.CALL_BY_PASSWORD_LOAD}getSecondSaveChoiceCallInfo(e){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?N.CALL_BY_LOG_QUICK_LOAD:e?N.CALL_BY_PASSWORD_LOAD:N.NONE}gameStart(e,t){this._wwaLogSaveList.setPlayer(t),this.quickSaveButtonUpdate(e)}quickSaveButtonUpdate(e){e.disableSaveFlag?U(`cell-save`).textContent=he.EMPTY_SAVE:U(`cell-save`).textContent=he.QUICK_SAVE}},Xi=class{constructor(e,t,n,r,i){this.id=e,this.fileName=t,this.audioContext=n,this.audioGain=r,this.disposeBufferSource=e=>{try{e.stop(),e.disconnect(this.audioGain),e.buffer=null}catch{}e.onended=null},typeof this.id==`number`&&typeof i==`boolean`&&console.warn(`サウンドID ${this.id} に対して isBgm (${i}) が指定されていますが、サウンドIDが数字の場合は自動でBGMかどうかを判定するため、この指定は無視されます。`),this._isBgm=typeof this.id==`number`?this.id>=p.BGM_LB:!!i,this.audioContext=n,this.audioGain=r,this.audioBuffer=null,this.bufferSources=[],this.isLoaded=!1,this.delayBgmTimeoutId=null,this.load()}async fetchSoundFile(){try{return await fetch(this.fileName)}catch{console.warn(`サウンドID ${this.id} の音声ファイルの取得失敗 (fetch)`);return}}async getArrayBuffer(e){try{return await e.arrayBuffer()}catch{console.warn(`サウンドID ${this.id} の音声ファイルの取得失敗 (arrayBuffer)`);return}}async load(e=0){if(e>=10){console.log(`サウンドID ${this.id} の音声ファイルの取得失敗 (最大リトライ回数超過)`),this.isExceededMaxRetryCount=!0;return}let t=await this.fetchSoundFile();if(!t){this.retry(e);return}if(t.status!==0&&t.status!==200){console.warn(`サウンドID ${this.id} の音声ファイルが見つかりません! HTTPエラー番号: ${t.status}`),this.cancelLoad();return}let n=await this.getArrayBuffer(t);if(!n){this.retry(e);return}this.audioContext.decodeAudioData(n,t=>{if(t.length===0){console.log(`サウンドID ${this.id} の音声ファイルのバッファサイズが 0 です `),this.retry(e);return}this.setData(t)})}retry(e){window.setTimeout(async()=>{await this.load(e+1)},100)}setData(e){this.audioBuffer=e,this.isLoaded=!0}cancelLoad(){this.audioBuffer=null,this.isLoaded=!0}play(e=0,t=!1,n){let r=this.audioContext.createBufferSource();this.bufferSources.push(r),r.buffer=this.audioBuffer,(this.isBgm()||t)&&(r.loop=!0),r.connect(this.audioGain);let i=r.duration;(!isFinite(i)||i<0||typeof i!=`number`)&&(i=0),r.onended=()=>{let e=this.bufferSources.indexOf(r);e!==-1&&this.bufferSources.splice(e,1),this.disposeBufferSource(r),n?.()},this.delayBgmTimeoutId=window.setTimeout(()=>{this.delayBgmTimeoutId=null,r.start()},e),this.audioGain.connect(this.audioContext.destination)}pause(){this.delayBgmTimeoutId!==null&&(window.clearTimeout(this.delayBgmTimeoutId),this.delayBgmTimeoutId=null),this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0}isBgm(){return this._isBgm===!0}hasData(){return this.audioBuffer!==null}isPlaying(){return this.hasData()||this.delayBgmTimeoutId!==null}isLoading(){return!this.isLoaded}isError(){return this.isExceededMaxRetryCount||this.isLoaded&&this.audioBuffer===null}},Zi=class{constructor(e){this.target=e??document.createElement(`div`)}dispatch(e,t){let n=new CustomEvent(e,{detail:t});this.target.dispatchEvent(n)}addListener(e,t){let n=e=>t(e.detail);return this.target.addEventListener(e,n),n}removeListener(e,t){this.target.removeEventListener(e,t)}},Qi={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},$i=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,ea={5:$i,"5module":$i+` export import`,6:$i+` const class extends export import super`},ta=/^in(stanceof)?$/,na=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,ra=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_`,ia=RegExp(`[`+na+`]`),aa=RegExp(`[`+na+ra+`]`);na=ra=null;var oa=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],sa=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function ca(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}}function la(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ia.test(String.fromCharCode(e)):t===!1?!1:ca(e,oa)}function ua(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&aa.test(String.fromCharCode(e)):t===!1?!1:ca(e,oa)||ca(e,sa)}var K=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function da(e,t){return new K(e,{beforeExpr:!0,binop:t})}var fa={beforeExpr:!0},pa={startsExpr:!0},ma={};function q(e,t){return t===void 0&&(t={}),t.keyword=e,ma[e]=new K(e,t)}var J={num:new K(`num`,pa),regexp:new K(`regexp`,pa),string:new K(`string`,pa),name:new K(`name`,pa),eof:new K(`eof`),bracketL:new K(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new K(`]`),braceL:new K(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new K(`}`),parenL:new K(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new K(`)`),comma:new K(`,`,fa),semi:new K(`;`,fa),colon:new K(`:`,fa),dot:new K(`.`),question:new K(`?`,fa),questionDot:new K(`?.`),arrow:new K(`=>`,fa),template:new K(`template`),invalidTemplate:new K(`invalidTemplate`),ellipsis:new K(`...`,fa),backQuote:new K("`",pa),dollarBraceL:new K("${",{beforeExpr:!0,startsExpr:!0}),eq:new K(`=`,{beforeExpr:!0,isAssign:!0}),assign:new K(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new K(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new K(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:da(`||`,1),logicalAND:da(`&&`,2),bitwiseOR:da(`|`,3),bitwiseXOR:da(`^`,4),bitwiseAND:da(`&`,5),equality:da(`==/!=/===/!==`,6),relational:da(`</>/<=/>=`,7),bitShift:da(`<</>>/>>>`,8),plusMin:new K(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:da(`%`,10),star:da(`*`,10),slash:da(`/`,10),starstar:new K(`**`,{beforeExpr:!0}),coalesce:da(`??`,1),_break:q(`break`),_case:q(`case`,fa),_catch:q(`catch`),_continue:q(`continue`),_debugger:q(`debugger`),_default:q(`default`,fa),_do:q(`do`,{isLoop:!0,beforeExpr:!0}),_else:q(`else`,fa),_finally:q(`finally`),_for:q(`for`,{isLoop:!0}),_function:q(`function`,pa),_if:q(`if`),_return:q(`return`,fa),_switch:q(`switch`),_throw:q(`throw`,fa),_try:q(`try`),_var:q(`var`),_const:q(`const`),_while:q(`while`,{isLoop:!0}),_with:q(`with`),_new:q(`new`,{beforeExpr:!0,startsExpr:!0}),_this:q(`this`,pa),_super:q(`super`,pa),_class:q(`class`,pa),_extends:q(`extends`,fa),_export:q(`export`),_import:q(`import`,pa),_null:q(`null`,pa),_true:q(`true`,pa),_false:q(`false`,pa),_in:q(`in`,{beforeExpr:!0,binop:7}),_instanceof:q(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:q(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:q(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:q(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},ha=/\r\n?|\n|\u2028|\u2029/,ga=new RegExp(ha.source,`g`);function _a(e,t){return e===10||e===13||!t&&(e===8232||e===8233)}var va=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,ya=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ba=Object.prototype,xa=ba.hasOwnProperty,Sa=ba.toString;function Ca(e,t){return xa.call(e,t)}var wa=Array.isArray||(function(e){return Sa.call(e)===`[object Array]`});function Ta(e){return RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`)}var Ea=function(e,t){this.line=e,this.column=t};Ea.prototype.offset=function(e){return new Ea(this.line,this.column+e)};var Da=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function Oa(e,t){for(var n=1,r=0;;){ga.lastIndex=r;var i=ga.exec(e);if(i&&i.index<t)++n,r=i.index+i[0].length;else return new Ea(n,t-r)}}var ka={ecmaVersion:10,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function Aa(e){var t={};for(var n in ka)t[n]=e&&Ca(e,n)?e[n]:ka[n];if(t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,wa(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return wa(t.onComment)&&(t.onComment=ja(t,t.onComment)),t}function ja(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new Da(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var Ma=1,Na=2,Pa=Ma|Na,Fa=4,Ia=8,La=16,Ra=32,za=64,Ba=128;function Va(e,t){return Na|(e?Fa:0)|(t?Ia:0)}var Ha=0,Ua=1,Wa=2,Ga=3,Ka=4,qa=5,Ja=function(e,t,n){this.options=e=Aa(e),this.sourceFile=e.sourceFile,this.keywords=Ta(ea[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;if(e.allowReserved!==!0){for(var i=e.ecmaVersion;!(r=Qi[i]);i--);e.sourceType===`module`&&(r+=` await`)}this.reservedWords=Ta(r);var a=(r?r+` `:``)+Qi.strict;this.reservedWordsStrict=Ta(a),this.reservedWordsStrictBind=Ta(a+` `+Qi.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
90
- `,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ha).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=J.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Ma),this.regexpState=null},Ya={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};Ja.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Ya.inFunction.get=function(){return(this.currentVarScope().flags&Na)>0},Ya.inGenerator.get=function(){return(this.currentVarScope().flags&Ia)>0},Ya.inAsync.get=function(){return(this.currentVarScope().flags&Fa)>0},Ya.allowSuper.get=function(){return(this.currentThisScope().flags&za)>0},Ya.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ba)>0},Ya.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ja.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&Na)>0},Ja.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},Ja.parse=function(e,t){return new this(t,e).parse()},Ja.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},Ja.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(Ja.prototype,Ya);var Xa=Ja.prototype,Za=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;Xa.strictDirective=function(e){for(;;){ya.lastIndex=e,e+=ya.exec(this.input)[0].length;var t=Za.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){ya.lastIndex=e+t[0].length;var n=ya.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||ha.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,ya.lastIndex=e,e+=ya.exec(this.input)[0].length,this.input[e]===`;`&&e++}},Xa.eat=function(e){return this.type===e?(this.next(),!0):!1},Xa.isContextual=function(e){return this.type===J.name&&this.value===e&&!this.containsEsc},Xa.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Xa.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Xa.canInsertSemicolon=function(){return this.type===J.eof||this.type===J.braceR||ha.test(this.input.slice(this.lastTokEnd,this.start))},Xa.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Xa.semicolon=function(){!this.eat(J.semi)&&!this.insertSemicolon()&&this.unexpected()},Xa.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Xa.expect=function(e){this.eat(e)||this.unexpected()},Xa.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};function Qa(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}Xa.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,`Parenthesized pattern`)}},Xa.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Xa.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Xa.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var Y=Ja.prototype;Y.parseTopLevel=function(e){var t={};for(e.body||=[];this.type!==J.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,`Program`)};var $a={kind:`loop`},eo={kind:`switch`};Y.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;ya.lastIndex=this.pos;var t=ya.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91)return!0;if(e)return!1;if(r===123)return!0;if(la(r,!0)){for(var i=n+1;ua(this.input.charCodeAt(i),!0);)++i;var a=this.input.slice(n,i);if(!ta.test(a))return!0}return!1},Y.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;ya.lastIndex=this.pos;var e=ya.exec(this.input),t=this.pos+e[0].length;return!ha.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!ua(this.input.charAt(t+8)))},Y.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=J._var,a=`let`),r){case J._break:case J._continue:return this.parseBreakContinueStatement(i,r.keyword);case J._debugger:return this.parseDebuggerStatement(i);case J._do:return this.parseDoStatement(i);case J._for:return this.parseForStatement(i);case J._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case J._class:return e&&this.unexpected(),this.parseClass(i,!0);case J._if:return this.parseIfStatement(i);case J._return:return this.parseReturnStatement(i);case J._switch:return this.parseSwitchStatement(i);case J._throw:return this.parseThrowStatement(i);case J._try:return this.parseTryStatement(i);case J._const:case J._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case J._while:return this.parseWhileStatement(i);case J._with:return this.parseWithStatement(i);case J.braceL:return this.parseBlock(!0,i);case J.semi:return this.parseEmptyStatement(i);case J._export:case J._import:if(this.options.ecmaVersion>10&&r===J._import){ya.lastIndex=this.pos;var o=ya.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===J._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.value,u=this.parseExpression();return r===J.name&&u.type===`Identifier`&&this.eat(J.colon)?this.parseLabeledStatement(i,l,u,e):this.parseExpressionStatement(i,u)}},Y.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(J.semi)||this.insertSemicolon()?e.label=null:this.type===J.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},Y.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},Y.parseDoStatement=function(e){return this.next(),this.labels.push($a),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(J._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(J.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},Y.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push($a),this.enterScope(0),this.expect(J.parenL),this.type===J.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===J._var||this.type===J._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),(this.type===J._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===J._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var a=new Qa,o=this.parseExpression(!0,a);return this.type===J._in||this.options.ecmaVersion>=6&&this.isContextual(`of`)?(this.options.ecmaVersion>=9&&(this.type===J._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(o,!1,a),this.checkLVal(o),this.parseForIn(e,o)):(this.checkExpressionErrors(a,!0),t>-1&&this.unexpected(t),this.parseFor(e,o))},Y.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,no|(n?0:ro),!1,t)},Y.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(J._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},Y.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,`'return' outside of function`),this.next(),this.eat(J.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},Y.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(J.braceL),this.labels.push(eo),this.enterScope(0);for(var t,n=!1;this.type!==J.braceR;)if(this.type===J._case||this.type===J._default){var r=this.type===J._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(J.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},Y.parseThrowStatement=function(e){return this.next(),ha.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var to=[];Y.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===J._catch){var t=this.startNode();if(this.next(),this.eat(J.parenL)){t.param=this.parseBindingAtom();var n=t.param.type===`Identifier`;this.enterScope(n?Ra:0),this.checkLVal(t.param,n?Ka:Wa),this.expect(J.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(J._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},Y.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},Y.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push($a),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},Y.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},Y.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},Y.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===J._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},Y.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},Y.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(J.braceL),e&&this.enterScope(0);this.type!==J.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},Y.parseFor=function(e,t){return e.init=t,this.expect(J.semi),e.test=this.type===J.semi?null:this.parseExpression(),this.expect(J.semi),e.update=this.type===J.parenR?null:this.parseExpression(),this.expect(J.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},Y.parseForIn=function(e,t){var n=this.type===J._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)?this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`):t.type===`AssignmentPattern`&&this.raise(t.start,`Invalid left-hand side in for-loop`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(J.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},Y.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(J.eq)?r.init=this.parseMaybeAssign(t):n===`const`&&!(this.type===J._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():r.id.type!==`Identifier`&&!(t&&(this.type===J._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):r.init=null,e.declarations.push(this.finishNode(r,`VariableDeclarator`)),!this.eat(J.comma))break}return e},Y.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,t===`var`?Ua:Wa,!1)};var no=1,ro=2,io=4;Y.parseFunction=function(e,t,n,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===J.star&&t&ro&&this.unexpected(),e.generator=this.eat(J.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&no&&(e.id=t&io&&this.type!==J.name?null:this.parseIdent(),e.id&&!(t&ro)&&this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Ua:Wa:Ga));var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Va(e.async,e.generator)),t&no||(e.id=this.type===J.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&no?`FunctionDeclaration`:`FunctionExpression`)},Y.parseFunctionParams=function(e){this.expect(J.parenL),e.params=this.parseBindingList(J.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Y.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(J.braceL);this.type!==J.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(r.body.push(a),a.type===`MethodDefinition`&&a.kind===`constructor`&&(i&&this.raise(a.start,`Duplicate constructor in the same class`),i=!0))}return this.strict=n,this.next(),e.body=this.finishNode(r,`ClassBody`),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},Y.parseClassElement=function(e){var t=this;if(this.eat(J.semi))return null;var n=this.startNode(),r=function(e,r){r===void 0&&(r=!1);var i=t.start,a=t.startLoc;return t.eatContextual(e)?t.type!==J.parenL&&(!r||!t.canInsertSemicolon())?!0:(n.key&&t.unexpected(),n.computed=!1,n.key=t.startNodeAt(i,a),n.key.name=e,t.finishNode(n.key,`Identifier`),!1):!1};n.kind=`method`,n.static=r(`static`);var i=this.eat(J.star),a=!1;i||(this.options.ecmaVersion>=8&&r(`async`,!0)?(a=!0,i=this.options.ecmaVersion>=9&&this.eat(J.star)):r(`get`)?n.kind=`get`:r(`set`)&&(n.kind=`set`)),n.key||this.parsePropertyName(n);var o=n.key,s=!1;return!n.computed&&!n.static&&(o.type===`Identifier`&&o.name===`constructor`||o.type===`Literal`&&o.value===`constructor`)?(n.kind!==`method`&&this.raise(o.start,`Constructor can't have get/set modifier`),i&&this.raise(o.start,`Constructor can't be a generator`),a&&this.raise(o.start,`Constructor can't be an async method`),n.kind=`constructor`,s=e):n.static&&o.type===`Identifier`&&o.name===`prototype`&&this.raise(o.start,`Classes may not have a static property named prototype`),this.parseClassMethod(n,i,a,s),n.kind===`get`&&n.value.params.length!==0&&this.raiseRecoverable(n.value.start,`getter should have no params`),n.kind===`set`&&n.value.params.length!==1&&this.raiseRecoverable(n.value.start,`setter should have exactly one param`),n.kind===`set`&&n.value.params[0].type===`RestElement`&&this.raiseRecoverable(n.value.params[0].start,`Setter cannot use rest params`),n},Y.parseClassMethod=function(e,t,n,r){return e.value=this.parseMethod(t,n,r),this.finishNode(e,`MethodDefinition`)},Y.parseClassId=function(e,t){this.type===J.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,Wa,!1)):(t===!0&&this.unexpected(),e.id=null)},Y.parseClassSuper=function(e){e.superClass=this.eat(J._extends)?this.parseExprSubscripts():null},Y.parseExport=function(e,t){if(this.next(),this.eat(J.star))return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==J.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`);if(this.eat(J._default)){this.checkExport(t,`default`,this.lastTokStart);var n;if(this.type===J._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,no|io,!1,n)}else if(this.type===J._class){var i=this.startNode();e.declaration=this.parseClass(i,`nullableID`)}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,`ExportDefaultDeclaration`)}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==J.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,o=e.specifiers;a<o.length;a+=1){var s=o[a];this.checkUnreserved(s.local),this.checkLocalExport(s.local)}e.source=null}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},Y.checkExport=function(e,t,n){e&&(Ca(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},Y.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t.name,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`?this.checkPatternExport(e,t.argument):n===`ParenthesizedExpression`&&this.checkPatternExport(e,t.expression)},Y.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},Y.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},Y.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(J.braceL);!this.eat(J.braceR);){if(n)n=!1;else if(this.expect(J.comma),this.afterTrailingComma(J.braceR))break;var r=this.startNode();r.local=this.parseIdent(!0),r.exported=this.eatContextual(`as`)?this.parseIdent(!0):r.local,this.checkExport(e,r.exported.name,r.exported.start),t.push(this.finishNode(r,`ExportSpecifier`))}return t},Y.parseImport=function(e){return this.next(),this.type===J.string?(e.specifiers=to,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===J.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},Y.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===J.name){var n=this.startNode();if(n.local=this.parseIdent(),this.checkLVal(n.local,Wa),e.push(this.finishNode(n,`ImportDefaultSpecifier`)),!this.eat(J.comma))return e}if(this.type===J.star){var r=this.startNode();return this.next(),this.expectContextual(`as`),r.local=this.parseIdent(),this.checkLVal(r.local,Wa),e.push(this.finishNode(r,`ImportNamespaceSpecifier`)),e}for(this.expect(J.braceL);!this.eat(J.braceR);){if(t)t=!1;else if(this.expect(J.comma),this.afterTrailingComma(J.braceR))break;var i=this.startNode();i.imported=this.parseIdent(!0),this.eatContextual(`as`)?i.local=this.parseIdent():(this.checkUnreserved(i.imported),i.local=i.imported),this.checkLVal(i.local,Wa),e.push(this.finishNode(i,`ImportSpecifier`))}return e},Y.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},Y.isDirectiveCandidate=function(e){return e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var ao=Ja.prototype;ao.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);case`AssignmentPattern`:break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},ao.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},ao.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},ao.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==J.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},ao.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case J.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(J.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case J.braceL:return this.parseObj(!0)}return this.parseIdent()},ao.parseBindingList=function(e,t,n){for(var r=[],i=!0;!this.eat(e);)if(i?i=!1:this.expect(J.comma),t&&this.type===J.comma)r.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===J.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),r.push(a),this.type===J.comma&&this.raise(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else{var o=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(o),r.push(o)}return r},ao.parseBindingListItem=function(e){return e},ao.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(J.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},ao.checkLVal=function(e,t,n){switch(t===void 0&&(t=Ha),e.type){case`Identifier`:t===Wa&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(t?`Binding `:`Assigning to `)+e.name+` in strict mode`),n&&(Ca(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Ha&&t!==qa&&this.declareName(e.name,t,e.start);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:t&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLVal(a,t,n)}break;case`Property`:this.checkLVal(e.value,t,n);break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLVal(c,t,n)}break;case`AssignmentPattern`:this.checkLVal(e.left,t,n);break;case`RestElement`:this.checkLVal(e.argument,t,n);break;case`ParenthesizedExpression`:this.checkLVal(e.expression,t,n);break;default:this.raise(e.start,(t?`Binding`:`Assigning to`)+` rvalue`)}};var X=Ja.prototype;X.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},X.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===J.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(J.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},X.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new Qa,r=!0);var o=this.start,s=this.startLoc;(this.type===J.parenL||this.type===J.name)&&(this.potentialArrowAt=this.start);var c=this.parseMaybeConditional(e,t);if(n&&(c=n.call(this,c,o,s)),this.type.isAssign){var l=this.startNodeAt(o,s);return l.operator=this.value,l.left=this.type===J.eq?this.toAssignable(c,!1,t):c,r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.left.start&&(t.shorthandAssign=-1),this.checkLVal(c),this.next(),l.right=this.parseMaybeAssign(e),this.finishNode(l,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),c},X.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(J.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(J.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},X.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},X.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==J._in)&&a>r){var o=this.type===J.logicalOR||this.type===J.logicalAND,s=this.type===J.coalesce;s&&(a=J.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===J.coalesce||s&&(this.type===J.logicalOR||this.type===J.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},X.buildBinary=function(e,t,n,r,i,a){var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},X.parseMaybeUnary=function(e,t){var n=this.start,r=this.startLoc,i;if(this.isContextual(`await`)&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))i=this.parseAwait(),t=!0;else if(this.type.prefix){var a=this.startNode(),o=this.type===J.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),o?this.checkLVal(a.argument):this.strict&&a.operator===`delete`&&a.argument.type===`Identifier`?this.raiseRecoverable(a.start,`Deleting local variable in strict mode`):t=!0,i=this.finishNode(a,o?`UpdateExpression`:`UnaryExpression`)}else{if(i=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var s=this.startNodeAt(n,r);s.operator=this.value,s.prefix=!1,s.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(s,`UpdateExpression`)}}return!t&&this.eat(J.starstar)?this.buildBinary(n,r,i,this.parseMaybeUnary(null,!1),`**`,!1):i},X.parseExprSubscripts=function(e){var t=this.start,n=this.startLoc,r=this.parseExprAtom(e);if(r.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return r;var i=this.parseSubscripts(r,t,n);return e&&i.type===`MemberExpression`&&(e.parenthesizedAssign>=i.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=i.start&&(e.parenthesizedBind=-1)),i},X.parseSubscripts=function(e,t,n,r){for(var i=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,n,r,i,a);if(o.optional&&(a=!0),o===e||o.type===`ArrowFunctionExpression`){if(a){var s=this.startNodeAt(t,n);s.expression=o,o=this.finishNode(s,`ChainExpression`)}return o}e=o}},X.parseSubscript=function(e,t,n,r,i,a){var o=this.options.ecmaVersion>=11,s=o&&this.eat(J.questionDot);r&&s&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var c=this.eat(J.bracketL);if(c||s&&this.type!==J.parenL&&this.type!==J.backQuote||this.eat(J.dot)){var l=this.startNodeAt(t,n);l.object=e,l.property=c?this.parseExpression():this.parseIdent(this.options.allowReserved!==`never`),l.computed=!!c,c&&this.expect(J.bracketR),o&&(l.optional=s),e=this.finishNode(l,`MemberExpression`)}else if(!r&&this.eat(J.parenL)){var u=new Qa,d=this.yieldPos,f=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var m=this.parseExprList(J.parenR,this.options.ecmaVersion>=8,!1,u);if(i&&!s&&!this.canInsertSemicolon()&&this.eat(J.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=d,this.awaitPos=f,this.awaitIdentPos=p,this.parseArrowExpression(this.startNodeAt(t,n),m,!0);this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=f||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;var h=this.startNodeAt(t,n);h.callee=e,h.arguments=m,o&&(h.optional=s),e=this.finishNode(h,`CallExpression`)}else if(this.type===J.backQuote){(s||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var g=this.startNodeAt(t,n);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,`TaggedTemplateExpression`)}return e},X.parseExprAtom=function(e){this.type===J.slash&&this.readRegexp();var t,n=this.potentialArrowAt===this.start;switch(this.type){case J._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),t=this.startNode(),this.next(),this.type===J.parenL&&!this.allowDirectSuper&&this.raise(t.start,`super() call outside constructor of a subclass`),this.type!==J.dot&&this.type!==J.bracketL&&this.type!==J.parenL&&this.unexpected(),this.finishNode(t,`Super`);case J._this:return t=this.startNode(),this.next(),this.finishNode(t,`ThisExpression`);case J.name:var r=this.start,i=this.startLoc,a=this.containsEsc,o=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&o.name===`async`&&!this.canInsertSemicolon()&&this.eat(J._function))return this.parseFunction(this.startNodeAt(r,i),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(J.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[o],!1);if(this.options.ecmaVersion>=8&&o.name===`async`&&this.type===J.name&&!a)return o=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(J.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[o],!0)}return o;case J.regexp:var s=this.value;return t=this.parseLiteral(s.value),t.regex={pattern:s.pattern,flags:s.flags},t;case J.num:case J.string:return this.parseLiteral(this.value);case J._null:case J._true:case J._false:return t=this.startNode(),t.value=this.type===J._null?null:this.type===J._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,`Literal`);case J.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),l;case J.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(J.bracketR,!0,!0,e),this.finishNode(t,`ArrayExpression`);case J.braceL:return this.parseObj(!1,e);case J._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case J._class:return this.parseClass(this.startNode(),!1);case J._new:return this.parseNew();case J.backQuote:return this.parseTemplate();case J._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},X.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`);var t=this.parseIdent(!0);switch(this.type){case J.parenL:return this.parseDynamicImport(e);case J.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},X.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(J.parenR)){var t=this.start;this.eat(J.comma)&&this.eat(J.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},X.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},X.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,``)),this.next(),this.finishNode(t,`Literal`)},X.parseParenExpression=function(){this.expect(J.parenL);var e=this.parseExpression();return this.expect(J.parenR),e},X.parseParenAndDistinguishExpression=function(e){var t=this.start,n=this.startLoc,r,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,s=[],c=!0,l=!1,u=new Qa,d=this.yieldPos,f=this.awaitPos,p;for(this.yieldPos=0,this.awaitPos=0;this.type!==J.parenR;)if(c?c=!1:this.expect(J.comma),i&&this.afterTrailingComma(J.parenR,!0)){l=!0;break}else if(this.type===J.ellipsis){p=this.start,s.push(this.parseParenItem(this.parseRestBinding())),this.type===J.comma&&this.raise(this.start,`Comma is not permitted after the rest element`);break}else s.push(this.parseMaybeAssign(!1,u,this.parseParenItem));var m=this.start,h=this.startLoc;if(this.expect(J.parenR),e&&!this.canInsertSemicolon()&&this.eat(J.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=f,this.parseParenArrowList(t,n,s);(!s.length||l)&&this.unexpected(this.lastTokStart),p&&this.unexpected(p),this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=f||this.awaitPos,s.length>1?(r=this.startNodeAt(a,o),r.expressions=s,this.finishNodeAt(r,`SequenceExpression`,m,h)):r=s[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(t,n);return g.expression=r,this.finishNode(g,`ParenthesizedExpression`)}else return r},X.parseParenItem=function(e){return e},X.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var oo=[];X.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(J.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.inNonArrowFunction()||this.raiseRecoverable(e.start,`'new.target' can only be used in functions`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc,a=this.type===J._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0),a&&e.callee.type===`ImportExpression`&&this.raise(r,`Cannot use new with import()`),this.eat(J.parenL)?e.arguments=this.parseExprList(J.parenR,this.options.ecmaVersion>=8,!1):e.arguments=oo,this.finishNode(e,`NewExpression`)},X.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===J.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
91
- `),cooked:this.value},this.next(),n.tail=this.type===J.backQuote,this.finishNode(n,`TemplateElement`)},X.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===J.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(J.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(J.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},X.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===J.name||this.type===J.num||this.type===J.string||this.type===J.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===J.star)&&!ha.test(this.input.slice(this.lastTokEnd,this.start))},X.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(J.braceR);){if(r)r=!1;else if(this.expect(J.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(J.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},X.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(J.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===J.comma&&this.raise(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(this.type===J.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),n.argument=this.parseMaybeAssign(!1,t),this.type===J.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(J.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(J.star),this.parsePropertyName(n,t)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},X.parsePropertyValue=function(e,t,n,r,i,a,o,s){if((n||r)&&this.type===J.colon&&this.unexpected(),this.eat(J.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`;else if(this.options.ecmaVersion>=6&&this.type===J.parenL)t&&this.unexpected(),e.kind=`init`,e.method=!0,e.value=this.parseMethod(n,r);else if(!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==J.comma&&this.type!==J.braceR&&this.type!==J.eq){(n||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c=e.kind===`get`?0:1;if(e.value.params.length!==c){var l=e.value.start;e.kind===`get`?this.raiseRecoverable(l,`getter should have no params`):this.raiseRecoverable(l,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind=`init`,t?e.value=this.parseMaybeDefault(i,a,e.key):this.type===J.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected()},X.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(J.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(J.bracketR),e.key;e.computed=!1}return e.key=this.type===J.num||this.type===J.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},X.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},X.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Va(t,r.generator)|za|(n?Ba:0)),this.expect(J.parenL),r.params=this.parseBindingList(J.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},X.parseArrowExpression=function(e,t,n){var r=this.yieldPos,i=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(Va(n,!1)|La),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=r,this.awaitPos=i,this.awaitIdentPos=a,this.finishNode(e,`ArrowFunctionExpression`)},X.parseFunctionBody=function(e,t,n){var r=t&&this.type!==J.braceL,i=this.strict,a=!1;if(r)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!i||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var s=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!i&&!a&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,qa),e.body=this.parseBlock(!1,void 0,a&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=s}this.exitScope()},X.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},X.checkParams=function(e,t){for(var n={},r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLVal(a,Ua,t?null:n)}},X.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(J.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===J.comma?o=null:this.type===J.ellipsis?(o=this.parseSpread(r),r&&this.type===J.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},X.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},X.parseIdent=function(e,t){var n=this.startNode();return this.type===J.name?n.name=this.value:this.type.keyword?(n.name=this.type.keyword,(n.name===`class`||n.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(n,`Identifier`),e||(this.checkUnreserved(n),n.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=n.start)),n},X.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===J.semi||this.canInsertSemicolon()||this.type!==J.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(J.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},X.parseAwait=function(){this.awaitPos||=this.start;var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!1),this.finishNode(e,`AwaitExpression`)};var so=Ja.prototype;so.raise=function(e,t){var n=Oa(this.input,e);t+=` (`+n.line+`:`+n.column+`)`;var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},so.raiseRecoverable=so.raise,so.curPosition=function(){if(this.options.locations)return new Ea(this.curLine,this.pos-this.lineStart)};var co=Ja.prototype,lo=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};co.enterScope=function(e){this.scopeStack.push(new lo(e))},co.exitScope=function(){this.scopeStack.pop()},co.treatFunctionsAsVarInScope=function(e){return e.flags&Na||!this.inModule&&e.flags&Ma},co.declareName=function(e,t,n){var r=!1;if(t===Wa){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Ma&&delete this.undefinedExports[e]}else if(t===Ka)this.currentScope().lexical.push(e);else if(t===Ga){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&Ra&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&Ma&&delete this.undefinedExports[e],s.flags&Pa)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},co.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},co.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},co.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Pa)return t}},co.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Pa&&!(t.flags&La))return t}};var uo=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new Da(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},fo=Ja.prototype;fo.startNode=function(){return new uo(this,this.start,this.startLoc)},fo.startNodeAt=function(e,t){return new uo(this,e,t)};function po(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}fo.finishNode=function(e,t){return po.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},fo.finishNodeAt=function(e,t,n,r){return po.call(this,e,t,n,r)};var mo=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},ho={b_stat:new mo(`{`,!1),b_expr:new mo(`{`,!0),b_tmpl:new mo("${",!1),p_stat:new mo(`(`,!1),p_expr:new mo(`(`,!0),q_tmpl:new mo("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new mo(`function`,!1),f_expr:new mo(`function`,!0),f_expr_gen:new mo(`function`,!0,!1,null,!0),f_gen:new mo(`function`,!1,!1,null,!0)},go=Ja.prototype;go.initialContext=function(){return[ho.b_stat]},go.braceIsBlock=function(e){var t=this.curContext();return t===ho.f_expr||t===ho.f_stat?!0:e===J.colon&&(t===ho.b_stat||t===ho.b_expr)?!t.isExpr:e===J._return||e===J.name&&this.exprAllowed?ha.test(this.input.slice(this.lastTokEnd,this.start)):e===J._else||e===J.semi||e===J.eof||e===J.parenR||e===J.arrow?!0:e===J.braceL?t===ho.b_stat:e===J._var||e===J._const||e===J.name?!1:!this.exprAllowed},go.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},go.updateContext=function(e){var t,n=this.type;n.keyword&&e===J.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},J.parenR.updateContext=J.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===ho.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},J.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ho.b_stat:ho.b_expr),this.exprAllowed=!0},J.dollarBraceL.updateContext=function(){this.context.push(ho.b_tmpl),this.exprAllowed=!0},J.parenL.updateContext=function(e){var t=e===J._if||e===J._for||e===J._with||e===J._while;this.context.push(t?ho.p_stat:ho.p_expr),this.exprAllowed=!0},J.incDec.updateContext=function(){},J._function.updateContext=J._class.updateContext=function(e){e.beforeExpr&&e!==J.semi&&e!==J._else&&!(e===J._return&&ha.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===J.colon||e===J.braceL)&&this.curContext()===ho.b_stat)?this.context.push(ho.f_expr):this.context.push(ho.f_stat),this.exprAllowed=!1},J.backQuote.updateContext=function(){this.curContext()===ho.q_tmpl?this.context.pop():this.context.push(ho.q_tmpl),this.exprAllowed=!1},J.star.updateContext=function(e){if(e===J._function){var t=this.context.length-1;this.context[t]===ho.f_expr?this.context[t]=ho.f_expr_gen:this.context[t]=ho.f_gen}this.exprAllowed=!0},J.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==J.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var _o=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,vo=_o+` Extended_Pictographic`,yo={9:_o,10:vo,11:vo},bo=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,xo=`Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,So=xo+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,Co={9:xo,10:So,11:So+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`},wo={};function To(e){var t=wo[e]={binary:Ta(yo[e]+` `+bo),nonBinary:{General_Category:Ta(bo),Script:Ta(Co[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}To(9),To(10),To(11);var Z=Ja.prototype,Eo=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``),this.unicodeProperties=wo[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};Eo.prototype.reset=function(e,t,n){var r=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9},Eo.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},Eo.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},Eo.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},Eo.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},Eo.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Eo.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Eo.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e?(this.advance(t),!0):!1};function Do(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}Z.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=0;r<n.length;r++){var i=n.charAt(r);t.indexOf(i)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(i,r+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`)}},Z.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},Z.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames.indexOf(r)===-1&&e.raise(`Invalid named capture referenced`)}},Z.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},Z.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Z.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},Z.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Z.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},Z.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Z.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},Z.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Z.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Z.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}e.pos=t}return!1},Z.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},Z.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Z.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},Z.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Oo(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Oo(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Z.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!Oo(n);)e.advance();return e.pos!==t},Z.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},Z.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise(`Duplicate capture group name`),e.groupNames.push(e.lastStringValue);return}e.raise(`Invalid group`)}},Z.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},Z.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Do(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Do(e.lastIntValue);return!0}return!1},Z.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),ko(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function ko(e){return la(e,!0)||e===36||e===95}Z.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Ao(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Ao(e){return ua(e,!0)||e===36||e===95||e===8204||e===8205}Z.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},Z.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Z.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},Z.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Z.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Z.regexp_eatZero=function(e){return e.current()===48&&!Io(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},Z.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},Z.regexp_eatControlLetter=function(e){var t=e.current();return jo(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function jo(e){return e>=65&&e<=90||e>=97&&e<=122}Z.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Mo(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function Mo(e){return e>=0&&e<=1114111}Z.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},Z.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1},Z.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(No(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise(`Invalid property name`)}return!1};function No(e){return e===100||e===68||e===115||e===83||e===119||e===87}Z.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},Z.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Ca(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},Z.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise(`Invalid property name`)},Z.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Po(t=e.current());)e.lastStringValue+=Do(t),e.advance();return e.lastStringValue!==``};function Po(e){return jo(e)||e===95}Z.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Fo(t=e.current());)e.lastStringValue+=Do(t),e.advance();return e.lastStringValue!==``};function Fo(e){return Po(e)||Io(e)}Z.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Z.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise(`Unterminated character class`)}return!1},Z.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},Z.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||zo(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r===93?!1:(e.lastIntValue=r,e.advance(),!0)},Z.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Z.regexp_eatClassControlLetter=function(e){var t=e.current();return Io(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},Z.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},Z.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Io(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Io(e){return e>=48&&e<=57}Z.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Lo(n=e.current());)e.lastIntValue=16*e.lastIntValue+Ro(n),e.advance();return e.pos!==t};function Lo(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ro(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Z.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},Z.regexp_eatOctalDigit=function(e){var t=e.current();return zo(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function zo(e){return e>=48&&e<=55}Z.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Lo(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Ro(i),e.advance()}return!0};var Bo=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Da(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Q=Ja.prototype;Q.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Bo(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Q.getToken=function(){return this.next(),new Bo(this)},typeof Symbol<`u`&&(Q[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===J.eof,value:t}}}}),Q.curContext=function(){return this.context[this.context.length-1]},Q.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(J.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Q.readToken=function(e){return la(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Q.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=57344)return e;var t=this.input.charCodeAt(this.pos+1);return(e<<10)+t-56613888},Q.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations){ga.lastIndex=t;for(var r;(r=ga.exec(this.input))&&r.index<this.pos;)++this.curLine,this.lineStart=r.index+r[0].length}this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Q.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!_a(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Q.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&va.test(String.fromCharCode(e)))++this.pos;else break loop}}},Q.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Q.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(J.ellipsis)):(++this.pos,this.finishToken(J.dot))},Q.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(J.assign,2):this.finishOp(J.slash,1)},Q.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?J.star:J.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=J.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(J.assign,n+1):this.finishOp(r,n)},Q.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(J.assign,3):this.finishOp(e===124?J.logicalOR:J.logicalAND,2):t===61?this.finishOp(J.assign,2):this.finishOp(e===124?J.bitwiseOR:J.bitwiseAND,1)},Q.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(J.assign,2):this.finishOp(J.bitwiseXOR,1)},Q.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ha.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(J.incDec,2):t===61?this.finishOp(J.assign,2):this.finishOp(J.plusMin,1)},Q.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(J.assign,n+1):this.finishOp(J.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(J.relational,n))},Q.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(J.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(J.arrow)):this.finishOp(e===61?J.eq:J.prefix,1)},Q.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(J.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(J.assign,3):this.finishOp(J.coalesce,2)}return this.finishOp(J.question,1)},Q.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(J.parenL);case 41:return++this.pos,this.finishToken(J.parenR);case 59:return++this.pos,this.finishToken(J.semi);case 44:return++this.pos,this.finishToken(J.comma);case 91:return++this.pos,this.finishToken(J.bracketL);case 93:return++this.pos,this.finishToken(J.bracketR);case 123:return++this.pos,this.finishToken(J.braceL);case 125:return++this.pos,this.finishToken(J.braceR);case 58:return++this.pos,this.finishToken(J.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(J.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(J.prefix,1)}this.raise(this.pos,`Unexpected character '`+Uo(e)+`'`)},Q.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Q.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(ha.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new Eo(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(J.regexp,{pattern:i,flags:o,value:c})},Q.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Vo(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Ho(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Q.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Ho(this.input.slice(t,this.pos)),++this.pos):la(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(J.num,n)},Q.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Ho(this.input.slice(t,this.pos));return++this.pos,la(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(J.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),la(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Vo(this.input.slice(t,this.pos),n);return this.finishToken(J.num,a)},Q.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t};function Uo(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}Q.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(_a(r,this.options.ecmaVersion>=10)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(J.string,t)};var Wo={};Q.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Wo)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Q.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Wo;this.raise(e,t)},Q.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===J.template||this.type===J.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(J.dollarBraceL)):(++this.pos,this.finishToken(J.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(J.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(_a(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
89
+ `}function kr(){return`ontouchstart`in window&&`ontouchend`in window&&`ontouchmove`in window}function Ar(e,t,n){var r=document.createElement(`style`);r.type=`text/css`,r.setAttribute(`id`,R.WWA_STYLE_TAG_ID),Ie(`head`)[0].appendChild(r),e.innerHTML=Or(t!==null,n),t!==null&&(U(`wwa-cover`).style.backgroundImage=`url(${t})`,U(`wwa-cover`).style.backgroundRepeat=`no-repeat`,U(`wwa-cover`).style.backgroundPosition=`0 0`)}var jr=class e{static{this.ROW_MAX=8}static{this.COL_MAX=3}static{this.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`]]}static{this.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`]]}update(){this.counter>0&&this.counter--}cursor_wait(){this.counter=R.CONTROLL_WAIT_FRAME}allClear(){this.col=0,this.row=0,this.counter=0}controll(t){if(!(this.counter>0))switch(t){case E.DOWN:this.row<e.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case E.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case E.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case E.RIGHT:this.col<e.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait());break}}ok(){this.close();var t=null;t=Re(e.CLICK_DOM_QUERY_TABLE[this.row][this.col]),t.classList.contains(`item-click-border`)||this.allClear();var n=new MouseEvent(`click`,{view:window,bubbles:!0,cancelable:!0});return t.dispatchEvent(n)}ng(){this.close()}close(){var t=null,n,r;for(n=0;n<e.COL_MAX;n++)for(r=0;r<e.ROW_MAX;r++)t=U(e.DOM_ID_TABLE[r][n]),t.classList.contains(`onpress`)&&t.classList.remove(`onpress`)}openView(){this.close();var t=null;t=U(e.DOM_ID_TABLE[this.row][this.col]),t.classList.add(`onpress`)}init(){this.allClear(),this.openView()}constructor(){this.allClear()}},G=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r():typeof define==`function`&&define.amd?define([],r):n.CryptoJS=r()})(e,function(){var e=e||function(e,t){var n;if(typeof window<`u`&&window.crypto&&(n=window.crypto),typeof self<`u`&&self.crypto&&(n=self.crypto),typeof globalThis<`u`&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<`u`&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<`u`&&global.crypto&&(n=global.crypto),!n&&typeof require==`function`)try{n=Dn()}catch{}var r=function(){if(n){if(typeof n.getRandomValues==`function`)try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes==`function`)try{return n.randomBytes(4).readInt32LE()}catch{}}throw Error(`Native crypto module could not be used to get secure random number.`)},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},o=a.lib={},s=o.Base=function(){return{extend:function(e){var t=i(this);return e&&t.mixIn(e),(!t.hasOwnProperty(`init`)||this.init===t.init)&&(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty(`toString`)&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),c=o.WordArray=s.extend({init:function(e,n){e=this.words=e||[],n==t?this.sigBytes=e.length*4:this.sigBytes=n},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new c.init(t,e)}}),l=a.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((a&15).toString(16))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new c.init(n,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch{throw Error(`Malformed UTF-8 data`)}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){typeof e==`string`&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,a=r.sigBytes,o=this.blockSize,s=a/(o*4);s=t?e.ceil(s):e.max((s|0)-this._minBufferSize,0);var l=s*o,u=e.min(l*4,a);if(l){for(var d=0;d<l;d+=o)this._doProcessBlock(i,d);n=i.splice(0,l),r.sigBytes-=u}return new c.init(n,u)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:512/32,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new m.HMAC.init(e,n).finalize(t)}}});var m=a.algo={};return a}(Math);return e})})),Mr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=n.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],n==t?this.sigBytes=e.length*8:this.sigBytes=n},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return a.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}})})(),e})})),Nr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){if(typeof ArrayBuffer==`function`){var t=e.lib.WordArray,n=t.init,r=t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||typeof Uint8ClampedArray<`u`&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i<t;i++)r[i>>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)};r.prototype=t}})(),e.lib.WordArray})})),Pr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(a))}return r.join(``)},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,t*2)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);r.push(String.fromCharCode(o))}return r.join(``)},parse:function(e){for(var t=e.length,r=[],a=0;a<t;a++)r[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return n.create(r,t*2)}};function i(e){return e<<8&4278255360|e>>>8&16711935}})(),e.enc.Utf16})})),Fr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=t[a>>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,c=t[a+2>>>2]>>>24-(a+2)%4*8&255,l=o<<16|s<<8|c,u=0;u<4&&a+u*.75<n;u++)i.push(r.charAt(l>>>6*(3-u)&63));var d=r.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join(``)},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var a=0;a<n.length;a++)r[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);s!==-1&&(t=s)}return i(e,t,r)},_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`};function i(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}})(),e.enc.Base64})})),Ir=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Base64url={stringify:function(e,t){t===void 0&&(t=!0);var n=e.words,r=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var a=[],o=0;o<r;o+=3)for(var s=n[o>>>2]>>>24-o%4*8&255,c=n[o+1>>>2]>>>24-(o+1)%4*8&255,l=n[o+2>>>2]>>>24-(o+2)%4*8&255,u=s<<16|c<<8|l,d=0;d<4&&o+d*.75<r;d++)a.push(i.charAt(u>>>6*(3-d)&63));var f=i.charAt(64);if(f)for(;a.length%4;)a.push(f);return a.join(``)},parse:function(e,t){t===void 0&&(t=!0);var n=e.length,r=t?this._safe_map:this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var o=0;o<r.length;o++)a[r.charCodeAt(o)]=o}var s=r.charAt(64);if(s){var c=e.indexOf(s);c!==-1&&(n=c)}return i(e,n,a)},_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,_safe_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`};function i(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}})(),e.enc.Base64url})})),Lr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[];(function(){for(var e=0;e<64;e++)s[e]=t.abs(t.sin(e+1))*4294967296|0})();var c=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var a=this._hash.words,o=e[t+0],c=e[t+1],p=e[t+2],m=e[t+3],h=e[t+4],g=e[t+5],_=e[t+6],v=e[t+7],y=e[t+8],b=e[t+9],x=e[t+10],S=e[t+11],C=e[t+12],w=e[t+13],ee=e[t+14],T=e[t+15],E=a[0],D=a[1],O=a[2],k=a[3];E=l(E,D,O,k,o,7,s[0]),k=l(k,E,D,O,c,12,s[1]),O=l(O,k,E,D,p,17,s[2]),D=l(D,O,k,E,m,22,s[3]),E=l(E,D,O,k,h,7,s[4]),k=l(k,E,D,O,g,12,s[5]),O=l(O,k,E,D,_,17,s[6]),D=l(D,O,k,E,v,22,s[7]),E=l(E,D,O,k,y,7,s[8]),k=l(k,E,D,O,b,12,s[9]),O=l(O,k,E,D,x,17,s[10]),D=l(D,O,k,E,S,22,s[11]),E=l(E,D,O,k,C,7,s[12]),k=l(k,E,D,O,w,12,s[13]),O=l(O,k,E,D,ee,17,s[14]),D=l(D,O,k,E,T,22,s[15]),E=u(E,D,O,k,c,5,s[16]),k=u(k,E,D,O,_,9,s[17]),O=u(O,k,E,D,S,14,s[18]),D=u(D,O,k,E,o,20,s[19]),E=u(E,D,O,k,g,5,s[20]),k=u(k,E,D,O,x,9,s[21]),O=u(O,k,E,D,T,14,s[22]),D=u(D,O,k,E,h,20,s[23]),E=u(E,D,O,k,b,5,s[24]),k=u(k,E,D,O,ee,9,s[25]),O=u(O,k,E,D,m,14,s[26]),D=u(D,O,k,E,y,20,s[27]),E=u(E,D,O,k,w,5,s[28]),k=u(k,E,D,O,p,9,s[29]),O=u(O,k,E,D,v,14,s[30]),D=u(D,O,k,E,C,20,s[31]),E=d(E,D,O,k,g,4,s[32]),k=d(k,E,D,O,y,11,s[33]),O=d(O,k,E,D,S,16,s[34]),D=d(D,O,k,E,ee,23,s[35]),E=d(E,D,O,k,c,4,s[36]),k=d(k,E,D,O,h,11,s[37]),O=d(O,k,E,D,v,16,s[38]),D=d(D,O,k,E,x,23,s[39]),E=d(E,D,O,k,w,4,s[40]),k=d(k,E,D,O,o,11,s[41]),O=d(O,k,E,D,m,16,s[42]),D=d(D,O,k,E,_,23,s[43]),E=d(E,D,O,k,b,4,s[44]),k=d(k,E,D,O,C,11,s[45]),O=d(O,k,E,D,T,16,s[46]),D=d(D,O,k,E,p,23,s[47]),E=f(E,D,O,k,o,6,s[48]),k=f(k,E,D,O,v,10,s[49]),O=f(O,k,E,D,ee,15,s[50]),D=f(D,O,k,E,g,21,s[51]),E=f(E,D,O,k,C,6,s[52]),k=f(k,E,D,O,m,10,s[53]),O=f(O,k,E,D,x,15,s[54]),D=f(D,O,k,E,c,21,s[55]),E=f(E,D,O,k,y,6,s[56]),k=f(k,E,D,O,T,10,s[57]),O=f(O,k,E,D,_,15,s[58]),D=f(D,O,k,E,w,21,s[59]),E=f(E,D,O,k,h,6,s[60]),k=f(k,E,D,O,S,10,s[61]),O=f(O,k,E,D,p,15,s[62]),D=f(D,O,k,E,b,21,s[63]),a[0]=a[0]+E|0,a[1]=a[1]+D|0,a[2]=a[2]+O|0,a[3]=a[3]+k|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;n[i>>>5]|=128<<24-i%32;var a=t.floor(r/4294967296),o=r;n[(i+64>>>9<<4)+15]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,n[(i+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,e.sigBytes=(n.length+1)*4,this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+i+o;return(s<<a|s>>>32-a)+t}function u(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,n,r,i,a,o){var s=e+(t^n^r)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+i+o;return(s<<a|s>>>32-a)+t}n.MD5=a._createHelper(c),n.HmacMD5=a._createHmacHelper(c)})(Math),e.MD5})})),Rr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],s=n[3],c=n[4],l=0;l<80;l++){if(l<16)o[l]=e[t+l]|0;else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+c+o[l];l<20?d+=(i&a|~i&s)+1518500249:l<40?d+=(i^a^s)+1859775393:l<60?d+=(i&a|i&s|a&s)-1894007588:d+=(i^a^s)-899497514,c=s,s=a,a=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=Math.floor(n/4294967296),t[(r+64>>>9<<4)+15]=n,e.sigBytes=t.length*4,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)})(),e.SHA1})})),zr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],c=[];(function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return(e-(e|0))*4294967296|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,1/2))),c[i]=n(t.pow(r,1/3)),i++),r++})();var l=[],u=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],d=n[6],f=n[7],p=0;p<64;p++){if(p<16)l[p]=e[t+p]|0;else{var m=l[p-15],h=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,g=l[p-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[p]=h+l[p-7]+_+l[p-16]}var v=s&u^~s&d,y=r&i^r&a^i&a,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),x=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),S=f+x+v+c[p]+l[p],C=b+y;f=d,d=u,u=s,s=o+S|0,o=a,a=i,i=r,r=S+C|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;return n[i>>>5]|=128<<24-i%32,n[(i+64>>>9<<4)+14]=t.floor(r/4294967296),n[(i+64>>>9<<4)+15]=r,e.sigBytes=n.length*4,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(u),n.HmacSHA256=a._createHmacHelper(u)})(Math),e.SHA256})})),Br=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),zr()):typeof define==`function`&&define.amd?define([`./core`,`./sha256`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.algo,i=r.SHA256,a=r.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=i._createHelper(a),t.HmacSHA224=i._createHmacHelper(a)})(),e.SHA224})})),Vr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Mr()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,a=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];(function(){for(var e=0;e<80;e++)l[e]=s()})();var u=o.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],d=n[6],f=n[7],p=r.high,m=r.low,h=i.high,g=i.low,_=a.high,v=a.low,y=o.high,b=o.low,x=s.high,S=s.low,C=u.high,w=u.low,ee=d.high,T=d.low,E=f.high,D=f.low,O=p,k=m,A=h,te=g,j=_,M=v,ne=y,re=b,ie=x,N=S,P=C,ae=w,oe=ee,se=T,ce=E,F=D,I=0;I<80;I++){var le,ue,L=l[I];if(I<16)ue=L.high=e[t+I*2]|0,le=L.low=e[t+I*2+1]|0;else{var de=l[I-15],fe=de.high,pe=de.low,R=(fe>>>1|pe<<31)^(fe>>>8|pe<<24)^fe>>>7,me=(pe>>>1|fe<<31)^(pe>>>8|fe<<24)^(pe>>>7|fe<<25),he=l[I-2],ge=he.high,_e=he.low,ve=(ge>>>19|_e<<13)^(ge<<3|_e>>>29)^ge>>>6,ye=(_e>>>19|ge<<13)^(_e<<3|ge>>>29)^(_e>>>6|ge<<26),z=l[I-7],be=z.high,xe=z.low,Se=l[I-16],Ce=Se.high,B=Se.low;le=me+xe,ue=R+be+ +(le>>>0<me>>>0),le+=ye,ue=ue+ve+ +(le>>>0<ye>>>0),le+=B,ue=ue+Ce+ +(le>>>0<B>>>0),L.high=ue,L.low=le}var V=ie&P^~ie&oe,we=N&ae^~N&se,Te=O&A^O&j^A&j,Ee=k&te^k&M^te&M,H=(O>>>28|k<<4)^(O<<30|k>>>2)^(O<<25|k>>>7),De=(k>>>28|O<<4)^(k<<30|O>>>2)^(k<<25|O>>>7),Oe=(ie>>>14|N<<18)^(ie>>>18|N<<14)^(ie<<23|N>>>9),ke=(N>>>14|ie<<18)^(N>>>18|ie<<14)^(N<<23|ie>>>9),Ae=c[I],je=Ae.high,Me=Ae.low,Ne=F+ke,Pe=ce+Oe+ +(Ne>>>0<F>>>0),Ne=Ne+we,Pe=Pe+V+ +(Ne>>>0<we>>>0),Ne=Ne+Me,Pe=Pe+je+ +(Ne>>>0<Me>>>0),Ne=Ne+le,Pe=Pe+ue+ +(Ne>>>0<le>>>0),Fe=De+Ee,U=H+Te+ +(Fe>>>0<De>>>0);ce=oe,F=se,oe=P,se=ae,P=ie,ae=N,N=re+Ne|0,ie=ne+Pe+ +(N>>>0<re>>>0)|0,ne=j,re=M,j=A,M=te,A=O,te=k,k=Ne+Fe|0,O=Pe+U+ +(k>>>0<Ne>>>0)|0}m=r.low=m+k,r.high=p+O+ +(m>>>0<k>>>0),g=i.low=g+te,i.high=h+A+ +(g>>>0<te>>>0),v=a.low=v+M,a.high=_+j+ +(v>>>0<M>>>0),b=o.low=b+re,o.high=y+ne+ +(b>>>0<re>>>0),S=s.low=S+N,s.high=x+ie+ +(S>>>0<N>>>0),w=u.low=w+ae,u.high=C+P+ +(w>>>0<ae>>>0),T=d.low=T+se,d.high=ee+oe+ +(T>>>0<se>>>0),D=f.low=D+F,f.high=E+ce+ +(D>>>0<F>>>0)},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+128>>>10<<5)+30]=Math.floor(n/4294967296),t[(r+128>>>10<<5)+31]=n,e.sigBytes=t.length*4,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:1024/32});t.SHA512=n._createHelper(u),t.HmacSHA512=n._createHmacHelper(u)})(),e.SHA512})})),Hr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Mr(),Vr()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`,`./sha512`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.x64,r=n.Word,i=n.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.extend({_doReset:function(){this._hash=new i.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 e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)})(),e.SHA384})})),Ur=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Mr()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.x64.Word,s=n.algo,c=[],l=[],u=[];(function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=t%5,i=(2*e+3*t)%5;e=r,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var a=1,s=0;s<24;s++){for(var d=0,f=0,p=0;p<7;p++){if(a&1){var m=(1<<p)-1;m<32?f^=1<<m:d^=1<<m-32}a&128?a=a<<1^113:a<<=1}u[s]=o.create(d,f)}})();var d=[];(function(){for(var e=0;e<25;e++)d[e]=o.create()})();var f=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var a=e[t+2*i],o=e[t+2*i+1];a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,o=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360;var s=n[i];s.high^=o,s.low^=a}for(var f=0;f<24;f++){for(var p=0;p<5;p++){for(var m=0,h=0,g=0;g<5;g++){var s=n[p+5*g];m^=s.high,h^=s.low}var _=d[p];_.high=m,_.low=h}for(var p=0;p<5;p++)for(var v=d[(p+4)%5],y=d[(p+1)%5],b=y.high,x=y.low,m=v.high^(b<<1|x>>>31),h=v.low^(x<<1|b>>>31),g=0;g<5;g++){var s=n[p+5*g];s.high^=m,s.low^=h}for(var S=1;S<25;S++){var m,h,s=n[S],C=s.high,w=s.low,ee=c[S];ee<32?(m=C<<ee|w>>>32-ee,h=w<<ee|C>>>32-ee):(m=w<<ee-32|C>>>64-ee,h=C<<ee-32|w>>>64-ee);var T=d[l[S]];T.high=m,T.low=h}var E=d[0],D=n[0];E.high=D.high,E.low=D.low;for(var p=0;p<5;p++)for(var g=0;g<5;g++){var S=p+5*g,s=n[S],O=d[S],k=d[(p+1)%5+5*g],A=d[(p+2)%5+5*g];s.high=O.high^~k.high&A.high,s.low=O.low^~k.low&A.low}var s=n[0],te=u[f];s.high^=te.high,s.low^=te.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes*8;var r=e.sigBytes*8,a=this.blockSize*32;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/a)*a>>>5)-1]|=128,e.sigBytes=n.length*4,this._process();for(var o=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u<c;u++){var d=o[u],f=d.high,p=d.low;f=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,p=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,l.push(p),l.push(f)}return new i.init(l,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=a._createHelper(f),n.HmacSHA3=a._createHmacHelper(f)})(Math),e.SHA3})})),Wr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.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]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.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]),d=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=a.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}for(var a=this._hash.words,o=d.words,p=f.words,b=s.words,x=c.words,S=l.words,C=u.words,w,ee,T,E,D,O=w=a[0],k=ee=a[1],A=T=a[2],te=E=a[3],j=D=a[4],M,n=0;n<80;n+=1)M=w+e[t+b[n]]|0,n<16?M+=m(ee,T,E)+o[0]:n<32?M+=h(ee,T,E)+o[1]:n<48?M+=g(ee,T,E)+o[2]:n<64?M+=_(ee,T,E)+o[3]:M+=v(ee,T,E)+o[4],M|=0,M=y(M,S[n]),M=M+D|0,w=D,D=E,E=y(T,10),T=ee,ee=M,M=O+e[t+x[n]]|0,n<16?M+=v(k,A,te)+p[0]:n<32?M+=_(k,A,te)+p[1]:n<48?M+=g(k,A,te)+p[2]:n<64?M+=h(k,A,te)+p[3]:M+=m(k,A,te)+p[4],M|=0,M=y(M,C[n]),M=M+j|0,O=j,j=te,te=y(A,10),A=k,k=M;M=a[1]+T+te|0,a[1]=a[2]+E+j|0,a[2]=a[3]+D+O|0,a[3]=a[4]+w+k|0,a[4]=a[0]+ee+A|0,a[0]=M},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,e.sigBytes=(t.length+1)*4,this._process();for(var i=this._hash,a=i.words,o=0;o<5;o++){var s=a[o];a[o]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}return i},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function m(e,t,n){return e^t^n}function h(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function _(e,t,n){return e&n|t&~n}function v(e,t,n){return e^(t|~n)}function y(e,t){return e<<t|e>>>32-t}n.RIPEMD160=a._createHelper(p),n.HmacRIPEMD160=a._createHmacHelper(p)})(Math),e.RIPEMD160})})),Gr=s(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(G()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){(function(){var t=e,n=t.lib.Base,r=t.enc.Utf8,i=t.algo;i.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,typeof t==`string`&&(t=r.parse(t));var n=e.blockSize,i=n*4;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,c=o.words,l=0;l<n;l++)s[l]^=1549556828,c[l]^=909522486;a.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})})()})})),Kr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),zr(),Gr()):typeof define==`function`&&define.amd?define([`./core`,`./sha256`,`./hmac`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.SHA256,s=a.HMAC,c=a.PBKDF2=r.extend({cfg:r.extend({keySize:128/32,hasher:o,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=s.create(n.hasher,e),a=i.create(),o=i.create([1]),c=a.words,l=o.words,u=n.keySize,d=n.iterations;c.length<u;){var f=r.update(t).finalize(o);r.reset();for(var p=f.words,m=p.length,h=f,g=1;g<d;g++){h=r.finalize(h),r.reset();for(var _=h.words,v=0;v<m;v++)p[v]^=_[v]}a.concat(f),l[0]++}return a.sigBytes=u*4,a}});t.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)}})(),e.PBKDF2})})),qr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Rr(),Gr()):typeof define==`function`&&define.amd?define([`./core`,`./sha1`,`./hmac`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,a=r.hasher.create(),o=i.create(),s=o.words,c=r.keySize,l=r.iterations;s.length<c;){n&&a.update(n),n=a.update(e).finalize(t),a.reset();for(var u=1;u<l;u++)n=a.finalize(n),a.reset();o.concat(n)}return o.sigBytes=c*4,o}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}})(),e.EvpKDF})})),Jr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),qr()):typeof define==`function`&&define.amd?define([`./core`,`./evpkdf`],r):r(n.CryptoJS)})(e,function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var c=s.Base64,l=n.algo.EvpKDF,u=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return typeof e==`string`?S:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=n.mode={},f=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=f.extend();e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=a}});function n(e,n,r){var i,a=this._iv;a?(i=a,this._iv=t):i=this._prevBlock;for(var o=0;o<r;o++)e[n+o]^=i[o]}return e}(),m=n.pad={},h=m.Pkcs7={pad:function(e,t){for(var n=t*4,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var c=a.create(o,r);e.concat(c)},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:p,padding:h}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:128/32});var g=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),_=n.format={},v=_.OpenSSL={stringify:function(e){var t,n=e.ciphertext,r=e.salt;return t=r?a.create([1398893684,1701076831]).concat(r).concat(n):n,t.toString(c)},parse:function(e){var t,n=c.parse(e),r=n.words;return r[0]==1398893684&&r[1]==1701076831&&(t=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:v}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),a=i.finalize(t),o=i.cfg;return g.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return typeof e==`string`?t.parse(e,this):e}}),b=n.kdf={},x=b.OpenSSL={execute:function(e,t,n,r,i){if(r||=a.random(64/8),i)var o=l.create({keySize:t+n,hasher:i}).compute(e,r);else var o=l.create({keySize:t+n}).compute(e,r);var s=a.create(o.words.slice(t),n*4);return o.sigBytes=t*4,g.create({key:o,iv:s,salt:r})}},S=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:x}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=r.kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=i.iv;var a=y.encrypt.call(this,e,t,i.key,r);return a.mixIn(i),a},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()})})),Yr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i,r),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);n.call(this,e,t,i,r),this._prevBlock=a}});function n(e,t,n,r){var i,a=this._iv;a?(i=a.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var o=0;o<n;o++)e[t+o]^=i[o]}return t}(),e.mode.CFB})})),Xr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CTR=function(){var t=e.lib.BlockCipherMode.extend();return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);n.encryptBlock(o,0),a[r-1]=a[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=o[s]}}),t}(),e.mode.CTR})})),Zr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CTRGladman=function(){var t=e.lib.BlockCipherMode.extend();function n(e){if((e>>24&255)==255){var t=e>>16&255,n=e>>8&255,r=e&255;t===255?(t=0,n===255?(n=0,r===255?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}function r(e){return(e[0]=n(e[0]))===0&&(e[1]=n(e[1])),e}return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),r(o);var s=o.slice(0);n.encryptBlock(s,0);for(var c=0;c<i;c++)e[t+c]^=s[c]}}),t}(),e.mode.CTRGladman})})),Qr=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.OFB=function(){var t=e.lib.BlockCipherMode.extend();return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._keystream;i&&(a=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(a,0);for(var o=0;o<r;o++)e[t+o]^=a[o]}}),t}(),e.mode.OFB})})),$r=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.ECB=function(){var t=e.lib.BlockCipherMode.extend();return t.Encryptor=t.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),t}(),e.mode.ECB})})),ei=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=t*4,i=r-n%r,a=n+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Ansix923})})),ti=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.Iso10126={pad:function(t,n){var r=n*4,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Iso10126})})),ni=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})})),ri=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=t*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){for(var t=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},e.pad.ZeroPadding})})),ii=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})})),ai=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib.CipherParams,i=n.enc.Hex,a=n.format;a.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return r.create({ciphertext:t})}}})(),e.format.Hex})})),oi=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Fr(),Lr(),qr(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[];(function(){for(var e=[],t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var n=0,r=0,t=0;t<256;t++){var m=r^r<<1^r<<2^r<<3^r<<4;m=m>>>8^m&255^99,i[n]=m,a[m]=n;var h=e[n],g=e[h],_=e[g],v=e[m]*257^m*16843008;o[n]=v<<24|v>>>8,s[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,l[n]=v;var v=_*16843009^g*65537^h*257^n*16843008;u[m]=v<<24|v>>>8,d[m]=v<<16|v>>>16,f[m]=v<<8|v>>>24,p[m]=v,n?(n=h^e[e[e[_^h]]],r^=e[e[r]]):n=r=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],h=r.AES=n.extend({_doReset:function(){var e;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var t=this._keyPriorReset=this._key,n=t.words,r=t.sigBytes/4,a=((this._nRounds=r+6)+1)*4,o=this._keySchedule=[],s=0;s<a;s++)s<r?o[s]=n[s]:(e=o[s-1],s%r?r>6&&s%r==4&&(e=i[e>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[e&255]):(e=e<<8|e>>>24,e=i[e>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[e&255],e^=m[s/r|0]<<24),o[s]=o[s-r]^e);for(var c=this._invKeySchedule=[],l=0;l<a;l++){var s=a-l;if(l%4)var e=o[s];else var e=o[s-4];l<4||s<=4?c[l]=e:c[l]=u[i[e>>>24]]^d[i[e>>>16&255]]^f[i[e>>>8&255]]^p[i[e&255]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,s,c,l,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,f,p,a);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,a,o,s){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],f=e[t+3]^n[3],p=4,m=1;m<c;m++){var h=r[l>>>24]^i[u>>>16&255]^a[d>>>8&255]^o[f&255]^n[p++],g=r[u>>>24]^i[d>>>16&255]^a[f>>>8&255]^o[l&255]^n[p++],_=r[d>>>24]^i[f>>>16&255]^a[l>>>8&255]^o[u&255]^n[p++],v=r[f>>>24]^i[l>>>16&255]^a[u>>>8&255]^o[d&255]^n[p++];l=h,u=g,d=_,f=v}var h=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[d>>>8&255]<<8|s[f&255])^n[p++],g=(s[u>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[l&255])^n[p++],_=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[l>>>8&255]<<8|s[u&255])^n[p++],v=(s[f>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[d&255])^n[p++];e[t]=h,e[t+1]=g,e[t+2]=_,e[t+3]=v},keySize:256/32});t.AES=n._createHelper(h)})(),e.AES})})),si=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Fr(),Lr(),qr(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.BlockCipher,a=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],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=o[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){for(var l=i[a]=[],u=c[a],n=0;n<24;n++)l[n/6|0]|=t[(s[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(s[n+24]-1+u)%28]<<31-n%6;l[0]=l[0]<<1|l[0]>>>31;for(var n=1;n<7;n++)l[n]=l[n]>>>(n-1)*4+3;l[7]=l[7]<<5|l[7]>>>27}for(var d=this._invSubKeys=[],n=0;n<16;n++)d[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=l[c][((o^i[c])&u[c])>>>0];this._lBlock=o,this._rBlock=a^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function f(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function p(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}t.DES=i._createHelper(d);var m=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(e.length!==2&&e.length!==4&&e.length<6)throw Error(`Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.`);var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(r.create(t)),this._des2=d.createEncryptor(r.create(n)),this._des3=d.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:192/32,ivSize:64/32,blockSize:64/32});t.TripleDES=i._createHelper(m)})(),e.TripleDES})})),ci=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Fr(),Lr(),qr(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;for(var i=0,a=0;i<256;i++){var o=i%n,s=t[o>>>2]>>>24-o%4*8&255;a=(a+r[i]+s)%256;var c=r[i];r[i]=r[a],r[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:256/32,ivSize:0});function a(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){t=(t+1)%256,n=(n+e[t])%256;var a=e[t];e[t]=e[n],e[n]=a,r|=e[(e[t]+e[n])%256]<<24-i*8}return this._i=t,this._j=n,r}t.RC4=n._createHelper(i);var o=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});t.RC4Drop=n._createHelper(o)})(),e.RC4})})),li=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Fr(),Lr(),qr(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],a=[],o=[],s=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=(e[n]<<8|e[n]>>>24)&16711935|(e[n]<<24|e[n]>>>8)&4278255360;var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var n=0;n<4;n++)c.call(this);for(var n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],l=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,d=l>>>16|u&4294901760,f=u<<16|l&65535;i[0]^=l,i[1]^=d,i[2]^=u,i[3]^=f,i[4]^=l,i[5]^=d,i[6]^=u,i[7]^=f;for(var n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=(i[r]<<8|i[r]>>>24)&16711935|(i[r]<<24|i[r]>>>8)&4278255360,e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+ +(t[0]>>>0<a[0]>>>0)|0,t[2]=t[2]+886263092+ +(t[1]>>>0<a[1]>>>0)|0,t[3]=t[3]+1295307597+ +(t[2]>>>0<a[2]>>>0)|0,t[4]=t[4]+3545052371+ +(t[3]>>>0<a[3]>>>0)|0,t[5]=t[5]+886263092+ +(t[4]>>>0<a[4]>>>0)|0,t[6]=t[6]+1295307597+ +(t[5]>>>0<a[5]>>>0)|0,t[7]=t[7]+3545052371+ +(t[6]>>>0<a[6]>>>0)|0,this._b=+(t[7]>>>0<a[7]>>>0);for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16;o[n]=((i*i>>>17)+i*s>>>15)+s*s^((r&4294901760)*r|0)+((r&65535)*r|0)}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.Rabbit=n._createHelper(s)})(),e.Rabbit})})),ui=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Fr(),Lr(),qr(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],a=[],o=[],s=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var i=0;i<4;i++)c.call(this);for(var i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var a=t.words,o=a[0],s=a[1],l=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,d=l>>>16|u&4294901760,f=u<<16|l&65535;r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=f,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=f;for(var i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=(i[r]<<8|i[r]>>>24)&16711935|(i[r]<<24|i[r]>>>8)&4278255360,e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+ +(t[0]>>>0<a[0]>>>0)|0,t[2]=t[2]+886263092+ +(t[1]>>>0<a[1]>>>0)|0,t[3]=t[3]+1295307597+ +(t[2]>>>0<a[2]>>>0)|0,t[4]=t[4]+3545052371+ +(t[3]>>>0<a[3]>>>0)|0,t[5]=t[5]+886263092+ +(t[4]>>>0<a[4]>>>0)|0,t[6]=t[6]+1295307597+ +(t[5]>>>0<a[5]>>>0)|0,t[7]=t[7]+3545052371+ +(t[6]>>>0<a[6]>>>0)|0,this._b=+(t[7]>>>0<a[7]>>>0);for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16;o[n]=((i*i>>>17)+i*s>>>15)+s*s^((r&4294901760)*r|0)+((r&65535)*r|0)}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.RabbitLegacy=n._createHelper(s)})(),e.RabbitLegacy})})),di=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Fr(),Lr(),qr(),Jr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.BlockCipher,r=t.algo;let i=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function s(e,t){let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=t&255,o=e.sbox[0][n]+e.sbox[1][r];return o^=e.sbox[2][i],o+=e.sbox[3][a],o}function c(e,t,n){let r=t,i=n,a;for(let t=0;t<16;++t)r^=e.pbox[t],i=s(e,r)^i,a=r,r=i,i=a;return a=r,r=i,i=a,i^=e.pbox[16],r^=e.pbox[17],{left:r,right:i}}function l(e,t,n){let r=t,i=n,a;for(let t=17;t>1;--t)r^=e.pbox[t],i=s(e,r)^i,a=r,r=i,i=a;return a=r,r=i,i=a,i^=e.pbox[1],r^=e.pbox[0],{left:r,right:i}}function u(e,t,n){for(let t=0;t<4;t++){e.sbox[t]=[];for(let n=0;n<256;n++)e.sbox[t][n]=a[t][n]}let r=0;for(let a=0;a<18;a++)e.pbox[a]=i[a]^t[r],r++,r>=n&&(r=0);let o=0,s=0,l=0;for(let t=0;t<18;t+=2)l=c(e,o,s),o=l.left,s=l.right,e.pbox[t]=o,e.pbox[t+1]=s;for(let t=0;t<4;t++)for(let n=0;n<256;n+=2)l=c(e,o,s),o=l.left,s=l.right,e.sbox[t][n]=o,e.sbox[t][n+1]=s;return!0}var d=r.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var e=this._keyPriorReset=this._key,t=e.words;u(o,t,e.sigBytes/4)}},encryptBlock:function(e,t){var n=c(o,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},decryptBlock:function(e,t){var n=l(o,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},blockSize:64/32,keySize:128/32,ivSize:64/32});t.Blowfish=n._createHelper(d)})(),e.Blowfish})})),fi=s(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(G(),Mr(),Nr(),Pr(),Fr(),Ir(),Lr(),Rr(),zr(),Br(),Vr(),Hr(),Ur(),Wr(),Gr(),Kr(),qr(),Jr(),Yr(),Xr(),Zr(),Qr(),$r(),ei(),ti(),ni(),ri(),ii(),ai(),oi(),si(),ci(),li(),ui(),di()):typeof define==`function`&&define.amd?define(`./core,./x64-core,./lib-typedarrays,./enc-utf16,./enc-base64,./enc-base64url,./md5,./sha1,./sha256,./sha224,./sha512,./sha384,./sha3,./ripemd160,./hmac,./pbkdf2,./evpkdf,./cipher-core,./mode-cfb,./mode-ctr,./mode-ctr-gladman,./mode-ofb,./mode-ecb,./pad-ansix923,./pad-iso10126,./pad-iso97971,./pad-zeropadding,./pad-nopadding,./format-hex,./aes,./tripledes,./rc4,./rabbit,./rabbit-legacy,./blowfish`.split(`,`),r):n.CryptoJS=r(n.CryptoJS)})(e,function(e){return e})}))();function pi(e,t){return`^ /${e*231+8310+t}P+>A[]`}function mi(e){return`^ /${e*231+8310}P+>A[]`}function hi(e,t){return console.warn(fi.enc.Utf8.parse(e)),fi.AES.encrypt(fi.enc.Utf8.parse(e),mi(t)).toString()}function gi(e,t,n){return fi.AES.decrypt(e,pi(t,n)).toString(fi.enc.Utf8)}function _i(e,t){return fi.AES.decrypt(e,mi(t)).toString(fi.enc.Utf8)}function vi(e){return(0,fi.MD5)(e).toString()}var{parse:yi,stringify:bi}=JSON,{keys:xi}=Object,Si=String,Ci=`string`,wi={},Ti=`object`,Ei=(e,t)=>t,Di=e=>e instanceof Si?Si(e):e,Oi=(e,t)=>typeof t===Ci?new Si(t):t,ki=(e,t,n,r)=>i=>{for(let a=xi(i),{length:o}=a,s=0;s<o;s++){let o=a[s],c=i[o];if(c instanceof Si){let a=e[+c];typeof a===Ti&&!n.has(a)?(n.add(a),i[o]=wi,t.push({o:i,k:o,r:a})):i[o]=r.call(i,o,a)}else i[o]!==wi&&(i[o]=r.call(i,o,c))}return i},Ai=(e,t,n)=>{let r=Si(t.push(n)-1);return e.set(n,r),r},ji=(e,t)=>{let n=yi(e,Oi).map(Di),r=t||Ei,i=n[0];if(typeof i===Ti&&i){let e=[],t=ki(n,e,new Set,r);i=t(i);let a=0;for(;a<e.length;){let{o:n,k:i,r:o}=e[a++];n[i]=r.call(n,i,t(o))}}return r.call({"":i},``,i)},Mi=(e,t,n)=>{let r=t&&typeof t===Ti?(e,n)=>e===``||-1<t.indexOf(e)?n:void 0:t||Ei,i=new Map,a=[],o=[],s=+Ai(i,a,r.call({"":e},``,e)),c=!s;for(;s<a.length;)c=!0,o[s]=bi(a[s++],l,n);return`[`+o.join(`,`)+`]`;function l(e,t){if(c)return c=!c,t;let n=r.call(this,e,t);switch(typeof n){case Ti:if(n===null)return n;case Ci:return i.get(n)||Ai(i,a,n)}return n}},Ni=e=>yi(Mi(e)),Pi=e=>ji(bi(e)),Fi=Object.freeze({MAP:`map`,MAP_OBJECT:`mapObject`,SYSTEM_MESSAGE:`systemMessage`,USER_VAR:`userVar`,USER_NAMED_VAR:`userNamedVar`}),Ii=Object.freeze({mapAttribute:!0,objectAttribute:!0,message:!0}),Li=class{},Ri=class{static{this._usingByteFlag=!1}static{this.MIN_LOOP_COUNT=3}static{this._restartData=void 0}static{this._mapByteLength=0}static{this._firstRandomMapObjectUtf8Table=new Li}static compress(e,t={}){var n=Object.create(null),r,i;for(r in e)if(!Ii[r]){switch(i=e[r],typeof i){case`number`:case`string`:case`boolean`:if(this._restartData[r]===i&&r!==`worldName`)continue;break;case`object`:if(i===null){if(this._restartData[r]===i)continue}else if(i=this.compressObject(r,i,this._restartData[r],t),i===void 0)continue;break;case`undefined`:break;case`function`:continue}n[r]=i}return n}static compressObject(e,t,n,r={}){var i,a,o,s;switch(e){case Fi.MAP:case Fi.MAP_OBJECT:var c,l,u,f,p,m,h,g,_,v,y,b,x,S;for(p in i=Object.create(null),_=Object.create(null),g=Object.create(null),t)for(f in a=t[p],o=n[p],s=Object.create(null),l=-1,a)h=a[f],h!==o[f]&&(s[f]=h,_[h]===void 0&&(_[h]=Object.create(null)),y=_[h],y[p]===void 0&&(y[p]=[]),x=y[p],x.push(Number(f)));for(b in _)for(p in y=_[b],g[b]===void 0&&(g[b]=Object.create(null)),v=g[b],i[b]===void 0&&(i[b]=[]),l=-1,y)x=y[p],x.length===1?(m=x[0],v[m]===void 0&&(v[m]=[]),S=v[m],S.push(Number(p))):(c=Number(p),u=c-l-1,l=c,i[b].push(this.getCompressArray(x),u));for(b in g)for(f in h=Number(b),v=g[b],l=-1,v)S=v[f],c=Number(f),u=c-l-1,l=c,S.length===1?i[b].push(u,S[0]):i[b].push(u,this.getCompressArray(S));var C=[];for(b in l=-1,i)c=Number(b),u=c-l-1,l=c,C.push(u,i[b]);return this._usingByteFlag&&JSON.stringify(C).length>=this._mapByteLength?this.compressMapAllObject(t,n,this._firstRandomMapObjectUtf8Table[e]):C;case Fi.SYSTEM_MESSAGE:i=Object.create(null);var e,w;for(e in t)w=t[e],n[e]!==w&&(i[e]=w);break;case Fi.USER_VAR:return this.compressUserVars(t);case Fi.USER_NAMED_VAR:if(!(t instanceof Map))throw TypeError(`USER_NAMED_VAR が正しい形式でないためセーブできません`);return{version:2,data:Ni(d(t))};default:return t}if(Object.keys(i).length!==0)return i}static compressUserVars(e){return e.map((e,t)=>[t,e]).filter(([e,t])=>t!==0)}static compressMapAllObject(e,t,n){var r,i,a,o,s,c,l,u,d=this._restartData.mapWidth,f,p,m,h,g,_,v,y,b=new Uint8Array(this._mapByteLength),x=-1,S;for(a=0,o=0,c=0,l=0,y=0,m=[],_=Object.create(null),f=[],p=[],i=0;i<d;i++)for(r=0;r<d;r++)u=e[i][r],u!==t[i][r]&&(x===-1&&(x=o),b[o]=b[o]|1<<a,c=o,_[u]===void 0&&(_[u]=new zi(u,y++)),_[u].count++),a++,a===8&&(a=0,o++);for(s in _)v=_[s].index,m[v]=_[s];for(h in m.sort(this.idSort),g=Object.create(null),m)u=m[h].id,g[u]=Number(h),f[h]=u;for(i=0;i<d;i++)for(r=0;r<d;r++)u=e[i][r],u!==t[i][r]&&(p[l++]=g[u]);if(n){for(S=b.length,x=-1,c=0,o=0;o<S;o++)b[o]=b[o]&~n[o],b[o]!==0&&(x===-1&&(x=o),c=o);x===-1&&(x=0,c=0)}return[x,b.subarray(x,c+1),f,this.indexListCompress(p,f.length)]}static indexListCompress(e,t){var n=[],r,i,a,o=e.length,s,c,l;for(i=0,r=0;r<o;r++){for(s=e[r],l=0,a=r+1;a<o&&(c=e[a],s===c);a++)l++,r=a;switch(l){case 0:n[i++]=s;break;case 1:n[i++]=s,n[i++]=s;break;default:n[i++]=s,n[i++]=t+l;break}}return n}static idSort(e,t){return t.count-e.count}static getCompressArray(e){var t=[],n=-1,r,i,a,o=e.length,s,c,l;for(s=0,a=0;a<o;a++){for(i=e[a],r=i-n,c=0,l=a;l<o-1&&e[l]+1===e[l+1];)l++,c++;c<this.MIN_LOOP_COUNT?t[s++]=r:(a=l,i+=c,t[s++]=0,t[s++]=r,t[s++]=c-this.MIN_LOOP_COUNT),n=i}return t}static getDecompressArray(e){var t=[],n=-1,r,i,a,o=e.length,s,c;for(a=0,c=0;a<o;a++)if(r=e[a],r===0){for(r=e[++a],i=n+r,s=i+e[++a]+this.MIN_LOOP_COUNT;i<=s;i++)t[c++]=i;n=s}else i=n+r,t[c++]=i,n=i;return t}static decompress(e){var t=structuredClone(this._restartData),n,r;for(n in e){switch(r=e[n],typeof r){case`number`:case`string`:case`boolean`:break;case`object`:r!==null&&(r=this.decompressObject(n,r,t[n]));break;case`undefined`:break;case`function`:continue}t[n]=r}return[t,{isWorldNameEmpty:e.worldName===void 0}]}static decompressObject(e,t,n,r={}){var i,e;switch(e){case Fi.MAP:case Fi.MAP_OBJECT:var a,o,s,c,l,d,f;i=Object.create(null),o=-1;var p,m,h=t;if(m=h.length,m===4&&typeof h[0]==`number`&&(h[1]instanceof Uint8Array||h[1]instanceof Array)&&h[2]instanceof Array&&h[3]instanceof Array)return this.decompressAllMapObject(h,n,this._firstRandomMapObjectUtf8Table[e]),n;for(p=0;p<m;p+=2)s=Number(h[p]),a=o+s+1,o=a,d=a,i[a]=h[p+1];var g,_;for(f in i){for(d=Number(f),h=i[f],m=h.length,g=[],_=[],p=0;p<m;p+=2){var v=h[p],y=h[p+1];v instanceof Array&&(v=this.getDecompressArray(v)),y instanceof Array&&(y=this.getDecompressArray(y)),typeof v==`object`?g.push({x:v,y}):_.push({x:v,y})}for(var b in o=-1,g)if(s=Number(g[b].y),a=o+s+1,o=a,v=g[b].x,l=String(a),v instanceof Array)for(h=v,m=h.length,p=0;p<m;p++)c=String(h[p]),n[l][c]=d;else c=String(v),n[l][c]=d;for(b in o=-1,_)if(s=Number(_[b].x),a=o+s+1,o=a,y=_[b].y,c=String(a),y instanceof Array)for(h=y,m=h.length,p=0;p<m;p++)l=String(h[p]),n[l][c]=d;else l=String(y),n[l][c]=d}return n;case Fi.USER_VAR:return this.decompressUserVars(t);case Fi.USER_NAMED_VAR:if(!t)return t;if(Array.isArray(t))return new Map(structuredClone(t).map(([e,t])=>[e,u(t)]));if(t.version!==2||typeof t.data!=`object`)throw TypeError(`セーブデータが壊れています`);return u(Pi(t.data));case Fi.SYSTEM_MESSAGE:default:if(!n)if(t)n=n instanceof Array?[]:Object.create(null);else return;for(e in t)n[e]=t[e];return n}}static decompressUserVars(e){return e.reduce((e,[t,n])=>(e[t]=n,e),this.generateEmptyUserVars())}static generateEmptyUserVars(){let e=Array(R.USER_VAR_NUM);for(let t=0;t<R.USER_VAR_NUM;t++)e[t]=0;return e}static decompressAllMapObject(e,t,n){var r,i,a,o,s,c,a,l=this._restartData.mapWidth,u,d,f,p,m,h=new Uint8Array(this._mapByteLength),r,i,o,s,g,c,_=0;_=e[0],f=e[2],u=e[3];var v=e[1];if(h.set(v,_),n)for(g=h.length,s=0;s<g;s++)h[s]=h[s]|n[s];d=[];var y=f.length,g=u.length,b,x,S,C,w;for(b=0,x=0;b<g;b++){if(p=u[b],p>=y)for(S=p-y,C=0;C<S;C++)d[x++]=w;else d[x++]=p;w=p}for(o=0,s=0,c=0,m=0,g=h.length,s=0;s<g;s++)for(o=0;o<8;o++){if(h[s]&1<<o){if(p=d[m++],p===void 0)return!1;a=f[p],r=c%l,i=c/l|0,t[i][r]=a}c++}return!0}static setRestartData(e,t){this._restartData=e,this._mapByteLength=Math.ceil(e.mapWidth*e.mapWidth/8),this._firstRandomMapObjectUtf8Table[Fi.MAP_OBJECT]=this.getChangedUint8Array(t[Fi.MAP_OBJECT],e[Fi.MAP_OBJECT])}static getChangedUint8Array(e,t){var n,r,i,a,o=this._restartData.mapWidth,s=new Uint8Array(this._mapByteLength),c=-1;for(i=0,a=0,r=0;r<o;r++)for(n=0;n<o;n++)e[r][n]!==t[r][n]&&(c===-1&&(c=a),s[a]=s[a]|1<<i),i++,i===8&&(i=0,a++);return s}static getStartWWAData(e){if(!e)return this._restartData;try{var t=JSON.parse(e)}catch{return this._restartData}if(t){var n;try{if([n]=this.decompress(t),n)return n}catch{}}return this._restartData}static usingByte(e){this._usingByteFlag=e}},zi=class{constructor(e,t){this.id=0,this.index=0,this.count=0,this.id=e,this.index=t}},Bi=class{constructor(e,t){this._id=0,this.flag=!1,this.date=void 0,this.cvs=void 0,this.ctx=void 0,this.quickSaveData=void 0,this._id=e,this._parent=t,this.cvs=document.createElement(`canvas`),this.cvs.width=me.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=me.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext(`2d`,{alpha:!1})}showQickLoad(){U(`cell-load`).textContent=he.QUICK_LOAD}save(e,t){return this._statusEnergy=t.statusEnergy,this.ctx.clearRect(0,0,this.cvs.width,this.cvs.height),this.ctx.drawImage(e,0,0,e.width,e.height,0,0,this.cvs.width,this.cvs.height),this.quickSaveData=t,this.flag=!0,this.date=new Date,this.showQickLoad(),!0}getStatusEnergy(){return this.flag?this._statusEnergy:-1}load(){return this.quickSaveData}saveDataSet(e,t,n){try{this.quickSaveData=t,this._statusEnergy=t.statusEnergy,this.date=n,this.flag=!0;var r=document.createElement(`img`);r.src=e,r.addEventListener(`load`,()=>{this.flag=!0,this.ctx.drawImage(r,0,0,r.width,r.height,0,0,this.cvs.width,this.cvs.height)}),this.showQickLoad()}catch{}}getDateText(){let e,t,n,r,i,a;return this.date?(e=this.date.getFullYear(),t=this.date.getMonth()+1,n=this.date.getDate(),r=this.date.getHours(),i=this.date.getMinutes(),a=this.date.getSeconds(),e=(`000`+e).slice(-4),t=(`0`+t).slice(-2),n=(`0`+n).slice(-2),r=(`0`+r).slice(-2),i=(`0`+i).slice(-2),a=(`0`+a).slice(-2),e+`/`+t+`/`+n+` `+r+`:`+i+`:`+a):``}isLastSaveData(){return this===this._parent.getLastSaveData()}},Vi=class extends Bi{save(e,t){var n=super.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,t,this.date),n}},Hi=class e extends Array{constructor(){super(),Object.setPrototypeOf(this,Object.create(e.prototype))}hasSaveData(){for(var e=0;e<me.QUICK_SAVE_MAX;e++)if(this[e].flag)return!0;return!1}getLastSaveData(){for(var e,t,n=0;n<me.QUICK_SAVE_MAX;n++)t=this[n],t.flag&&(e?t.date&&e.date&&t.date.getTime()>e.date.getTime()&&(e=t):e=t);return e}},Ui=e=>e.gameOverPolicy===`except-macro`?{...e,gameOverPolicy:`except-assignment`}:typeof e.isGameOverDisabled==`boolean`?e.isGameOverDisabled===!0?{...e,isGameOverDisabled:void 0,gameOverPolicy:`never`}:e.isGameOverDisabled===!1?{...e,isGameOverDisabled:void 0,gameOverPolicy:`default`}:e:e,Wi=e=>Ui(e),Gi=class e extends Hi{static{this.doNotAnything=()=>{}}constructor(t,n,r=e.prototype){super(),this.IDBTransaction={READ_ONLY:`readonly`,READ_WRITE:`readwrite`,VERSION_CHANGE:`versionchangetransaction`},this.keyPath=[`id`,`url`],Object.setPrototypeOf(this,Object.create(r));for(var i=0;i<me.QUICK_SAVE_MAX;i++)this[i]=new Vi(i,this);this.onCheckLoadingSaveData=t,this.onCompleteLoadingSaveData=n,this.createDataBase(),this.selectSaveData()}indexDBOpen(){return indexedDB.open(me.INDEXEDDB_DB_NAME,201205201)}createDataBase(){try{var t=this.indexDBOpen();t.onupgradeneeded=e=>{var n=t.result,r={keyPath:this.keyPath};n.objectStoreNames.contains(me.INDEXEDDB_TABLE_NAME)||n.createObjectStore(me.INDEXEDDB_TABLE_NAME,r).createIndex(`url`,`url`,{unique:!1})},t.onsuccess=e.doNotAnything,t.onerror=e.doNotAnything,t.onblocked=e.doNotAnything}catch{}}getObjectStore(e){let t=e;try{var n=t.transaction(me.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(me.INDEXEDDB_TABLE_NAME)}catch{return}return n}makeSaveDataItem(e,t,n,r){return{url:location.href,id:e,hash:Xi.checkOriginalMapString,image:t.toDataURL(),data:n,date:r,worldName:Xi.worldName,mapDataRevisionKey:Xi.mapDataRevisionKey}}getSaveDataResult(e,t){let n=e.index(`url`),r=IDBKeyRange.only(location.href),i=n.getAll(r);i.onsuccess=()=>{t(i.result)}}dbUpdateSaveData(t,n,r,i){let a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=()=>{let o=this.getObjectStore(a.result),s=Ri.compress(r),c=this.makeSaveDataItem(t,n,s,i);this.selectDatas[t]=c;let l=o.put(c);l.onsuccess=e.doNotAnything,l.onerror=e.doNotAnything},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything}dbDeleteSaveData(t){let n=this.indexDBOpen();n.onupgradeneeded=e.doNotAnything,n.onsuccess=()=>{let e=this.getObjectStore(n.result);t.forEach(t=>{e.delete([t,location.href])})},n.onerror=e.doNotAnything,n.onblocked=e.doNotAnything}selectSaveData(){let t=this.indexDBOpen();t.onupgradeneeded=e.doNotAnything,t.onsuccess=()=>{let e=this.getObjectStore(t.result);this.selectDatas=[],this.getSaveDataResult(e,e=>{var t,n,r;let i=[];for(n=e.length,t=0;t<n;t++){var a=e[t];try{r={id:a.id,hash:a.hash,data:a.data,date:a.date,image:a.image,worldName:a.worldName,mapDataRevisionKey:a.mapDataRevisionKey}}catch{continue}let n=this.onCheckLoadingSaveData(r.worldName,r.hash,r.mapDataRevisionKey);if(n!==null){i.push({id:r.id,cause:n});continue}if(!this[r.id])continue;let o=Wi(Ri.decompress(r.data)[0]);this[r.id].saveDataSet(r.image,o,r.date)}i.length>0&&this.dbDeleteSaveData(i.map(e=>e.id));let o=i.map(e=>e.cause).filter((e,t,n)=>n.indexOf(e)===t);this.onCompleteLoadingSaveData(o)})},t.onerror=e.doNotAnything,t.onblocked=e.doNotAnything}},Ki=class extends Bi{},qi=class e extends Hi{constructor(){super(),this._saveNo=0,this._lastAutoSaveMove=0,this._autoInterval=me.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(this,Object.create(e.prototype));for(var t=0;t<me.QUICK_SAVE_MAX;t++)this[t]=new Ki(t,this);this._saveNo=0,this._lastAutoSaveMove=0}resumeStart(){this._lastAutoSaveMove=-1}setPlayer(e){this._lastAutoSaveMove=e.getMoveCount()}isAutoSaveFrame(e){if(this._autoInterval===0)return!1;var t=e.getMoveCount();return this._lastAutoSaveMove>=t||t%this._autoInterval!==0?!1:(this._lastAutoSaveMove=t,!0)}autoSave(e,t){this[this._saveNo].save(e,t),this._saveNo++,this._saveNo%=me.QUICK_SAVE_MAX}setAutoSaveInterval(e){if(e<0){console.warn(`オートセーブの歩数 (${e}) に負の値が設定されています。`);return}this._autoInterval=e|0}};function Ji(e,t){return(0,fi.MD5)(e+t).toString()}var Yi=function(e){return e.UNMATCHED_WORLD_NAME=`UNMATCHED_WORLD_NAME`,e.UNMATCHED_WORLD_PASS_NUMBER=`UNMATCHED_WORLD_PASS_NUMBER`,e.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA=`DISALLOW_OLD_REVISION_WORLD_SAVE_DATA`,e}({}),Xi=class e{constructor(t,n,r,i,a){e.checkOriginalMapString=t.checkOriginalMapString,e.worldName=n,e.mapDataRevisionKey=Ji(n,r),this._wwaDBSaveList=new Gi(i,a),this._wwaLogSaveList=new qi,this.selectDBSaveDataList()}resumeStart(){this._wwaLogSaveList.resumeStart()}isAutoSaveFrame(e){return this._wwaLogSaveList.isAutoSaveFrame(e)}autoSave(e,t){this._wwaLogSaveList.autoSave(e,t)}selectDBSaveDataList(){this.list=this._wwaDBSaveList}selectLogSaveDataList(){this.list=this._wwaLogSaveList}save(e,t,n){var r=this.list[n];return r?r.save(e,t):!1}load(e){var t=this.list[e];return t?t.load():null}hasSaveData(){return this.list.hasSaveData()}setAutoSaveInterval(e){return this._wwaLogSaveList.setAutoSaveInterval(e)}getFirstSaveChoiceCallInfo(e){return e?N.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?N.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?N.CALL_BY_LOG_QUICK_LOAD:N.CALL_BY_PASSWORD_LOAD}getSecondSaveChoiceCallInfo(e){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?N.CALL_BY_LOG_QUICK_LOAD:e?N.CALL_BY_PASSWORD_LOAD:N.NONE}gameStart(e,t){this._wwaLogSaveList.setPlayer(t),this.quickSaveButtonUpdate(e)}quickSaveButtonUpdate(e){e.disableSaveFlag?U(`cell-save`).textContent=he.EMPTY_SAVE:U(`cell-save`).textContent=he.QUICK_SAVE}},Zi=class{constructor(e,t,n,r,i){this.id=e,this.fileName=t,this.audioContext=n,this.audioGain=r,this.disposeBufferSource=e=>{try{e.stop(),e.disconnect(this.audioGain),e.buffer=null}catch{}e.onended=null},typeof this.id==`number`&&typeof i==`boolean`&&console.warn(`サウンドID ${this.id} に対して isBgm (${i}) が指定されていますが、サウンドIDが数字の場合は自動でBGMかどうかを判定するため、この指定は無視されます。`),this._isBgm=typeof this.id==`number`?this.id>=p.BGM_LB:!!i,this.audioContext=n,this.audioGain=r,this.audioBuffer=null,this.bufferSources=[],this.isLoaded=!1,this.delayBgmTimeoutId=null,this.load()}async fetchSoundFile(){try{return await fetch(this.fileName)}catch{console.warn(`サウンドID ${this.id} の音声ファイルの取得失敗 (fetch)`);return}}async getArrayBuffer(e){try{return await e.arrayBuffer()}catch{console.warn(`サウンドID ${this.id} の音声ファイルの取得失敗 (arrayBuffer)`);return}}async load(e=0){if(e>=10){console.log(`サウンドID ${this.id} の音声ファイルの取得失敗 (最大リトライ回数超過)`),this.isExceededMaxRetryCount=!0;return}let t=await this.fetchSoundFile();if(!t){this.retry(e);return}if(t.status!==0&&t.status!==200){console.warn(`サウンドID ${this.id} の音声ファイルが見つかりません! HTTPエラー番号: ${t.status}`),this.cancelLoad();return}let n=await this.getArrayBuffer(t);if(!n){this.retry(e);return}this.audioContext.decodeAudioData(n,t=>{if(t.length===0){console.log(`サウンドID ${this.id} の音声ファイルのバッファサイズが 0 です `),this.retry(e);return}this.setData(t)})}retry(e){window.setTimeout(async()=>{await this.load(e+1)},100)}setData(e){this.audioBuffer=e,this.isLoaded=!0}cancelLoad(){this.audioBuffer=null,this.isLoaded=!0}play(e=0,t=!1,n){let r=this.audioContext.createBufferSource();this.bufferSources.push(r),r.buffer=this.audioBuffer,(this.isBgm()||t)&&(r.loop=!0),r.connect(this.audioGain);let i=r.duration;(!isFinite(i)||i<0||typeof i!=`number`)&&(i=0),r.onended=()=>{let e=this.bufferSources.indexOf(r);e!==-1&&this.bufferSources.splice(e,1),this.disposeBufferSource(r),n?.()},this.delayBgmTimeoutId=window.setTimeout(()=>{this.delayBgmTimeoutId=null,r.start()},e),this.audioGain.connect(this.audioContext.destination)}pause(){this.delayBgmTimeoutId!==null&&(window.clearTimeout(this.delayBgmTimeoutId),this.delayBgmTimeoutId=null),this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0}isBgm(){return this._isBgm===!0}hasData(){return this.audioBuffer!==null}isPlaying(){return this.hasData()||this.delayBgmTimeoutId!==null}isLoading(){return!this.isLoaded}isError(){return this.isExceededMaxRetryCount||this.isLoaded&&this.audioBuffer===null}},Qi=class{constructor(e){this.target=e??document.createElement(`div`)}dispatch(e,t){let n=new CustomEvent(e,{detail:t});this.target.dispatchEvent(n)}addListener(e,t){let n=e=>t(e.detail);return this.target.addEventListener(e,n),n}removeListener(e,t){this.target.removeEventListener(e,t)}},$i={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},ea=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,ta={5:ea,"5module":ea+` export import`,6:ea+` const class extends export import super`},na=/^in(stanceof)?$/,ra=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,ia=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_`,aa=RegExp(`[`+ra+`]`),oa=RegExp(`[`+ra+ia+`]`);ra=ia=null;var sa=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],ca=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function la(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}}function ua(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&aa.test(String.fromCharCode(e)):t===!1?!1:la(e,sa)}function da(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&oa.test(String.fromCharCode(e)):t===!1?!1:la(e,sa)||la(e,ca)}var K=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function fa(e,t){return new K(e,{beforeExpr:!0,binop:t})}var pa={beforeExpr:!0},ma={startsExpr:!0},ha={};function q(e,t){return t===void 0&&(t={}),t.keyword=e,ha[e]=new K(e,t)}var J={num:new K(`num`,ma),regexp:new K(`regexp`,ma),string:new K(`string`,ma),name:new K(`name`,ma),eof:new K(`eof`),bracketL:new K(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new K(`]`),braceL:new K(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new K(`}`),parenL:new K(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new K(`)`),comma:new K(`,`,pa),semi:new K(`;`,pa),colon:new K(`:`,pa),dot:new K(`.`),question:new K(`?`,pa),questionDot:new K(`?.`),arrow:new K(`=>`,pa),template:new K(`template`),invalidTemplate:new K(`invalidTemplate`),ellipsis:new K(`...`,pa),backQuote:new K("`",ma),dollarBraceL:new K("${",{beforeExpr:!0,startsExpr:!0}),eq:new K(`=`,{beforeExpr:!0,isAssign:!0}),assign:new K(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new K(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new K(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:fa(`||`,1),logicalAND:fa(`&&`,2),bitwiseOR:fa(`|`,3),bitwiseXOR:fa(`^`,4),bitwiseAND:fa(`&`,5),equality:fa(`==/!=/===/!==`,6),relational:fa(`</>/<=/>=`,7),bitShift:fa(`<</>>/>>>`,8),plusMin:new K(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:fa(`%`,10),star:fa(`*`,10),slash:fa(`/`,10),starstar:new K(`**`,{beforeExpr:!0}),coalesce:fa(`??`,1),_break:q(`break`),_case:q(`case`,pa),_catch:q(`catch`),_continue:q(`continue`),_debugger:q(`debugger`),_default:q(`default`,pa),_do:q(`do`,{isLoop:!0,beforeExpr:!0}),_else:q(`else`,pa),_finally:q(`finally`),_for:q(`for`,{isLoop:!0}),_function:q(`function`,ma),_if:q(`if`),_return:q(`return`,pa),_switch:q(`switch`),_throw:q(`throw`,pa),_try:q(`try`),_var:q(`var`),_const:q(`const`),_while:q(`while`,{isLoop:!0}),_with:q(`with`),_new:q(`new`,{beforeExpr:!0,startsExpr:!0}),_this:q(`this`,ma),_super:q(`super`,ma),_class:q(`class`,ma),_extends:q(`extends`,pa),_export:q(`export`),_import:q(`import`,ma),_null:q(`null`,ma),_true:q(`true`,ma),_false:q(`false`,ma),_in:q(`in`,{beforeExpr:!0,binop:7}),_instanceof:q(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:q(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:q(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:q(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},ga=/\r\n?|\n|\u2028|\u2029/,_a=new RegExp(ga.source,`g`);function va(e,t){return e===10||e===13||!t&&(e===8232||e===8233)}var ya=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,ba=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,xa=Object.prototype,Sa=xa.hasOwnProperty,Ca=xa.toString;function wa(e,t){return Sa.call(e,t)}var Ta=Array.isArray||(function(e){return Ca.call(e)===`[object Array]`});function Ea(e){return RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`)}var Da=function(e,t){this.line=e,this.column=t};Da.prototype.offset=function(e){return new Da(this.line,this.column+e)};var Oa=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function ka(e,t){for(var n=1,r=0;;){_a.lastIndex=r;var i=_a.exec(e);if(i&&i.index<t)++n,r=i.index+i[0].length;else return new Da(n,t-r)}}var Aa={ecmaVersion:10,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function ja(e){var t={};for(var n in Aa)t[n]=e&&wa(e,n)?e[n]:Aa[n];if(t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,Ta(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return Ta(t.onComment)&&(t.onComment=Ma(t,t.onComment)),t}function Ma(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new Oa(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var Na=1,Pa=2,Fa=Na|Pa,Ia=4,La=8,Ra=16,za=32,Ba=64,Va=128;function Ha(e,t){return Pa|(e?Ia:0)|(t?La:0)}var Ua=0,Wa=1,Ga=2,Ka=3,qa=4,Ja=5,Ya=function(e,t,n){this.options=e=ja(e),this.sourceFile=e.sourceFile,this.keywords=Ea(ta[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;if(e.allowReserved!==!0){for(var i=e.ecmaVersion;!(r=$i[i]);i--);e.sourceType===`module`&&(r+=` await`)}this.reservedWords=Ea(r);var a=(r?r+` `:``)+$i.strict;this.reservedWordsStrict=Ea(a),this.reservedWordsStrictBind=Ea(a+` `+$i.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
90
+ `,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ga).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=J.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Na),this.regexpState=null},Xa={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};Ya.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Xa.inFunction.get=function(){return(this.currentVarScope().flags&Pa)>0},Xa.inGenerator.get=function(){return(this.currentVarScope().flags&La)>0},Xa.inAsync.get=function(){return(this.currentVarScope().flags&Ia)>0},Xa.allowSuper.get=function(){return(this.currentThisScope().flags&Ba)>0},Xa.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Va)>0},Xa.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ya.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&Pa)>0},Ya.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},Ya.parse=function(e,t){return new this(t,e).parse()},Ya.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},Ya.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(Ya.prototype,Xa);var Za=Ya.prototype,Qa=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;Za.strictDirective=function(e){for(;;){ba.lastIndex=e,e+=ba.exec(this.input)[0].length;var t=Qa.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){ba.lastIndex=e+t[0].length;var n=ba.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||ga.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,ba.lastIndex=e,e+=ba.exec(this.input)[0].length,this.input[e]===`;`&&e++}},Za.eat=function(e){return this.type===e?(this.next(),!0):!1},Za.isContextual=function(e){return this.type===J.name&&this.value===e&&!this.containsEsc},Za.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Za.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Za.canInsertSemicolon=function(){return this.type===J.eof||this.type===J.braceR||ga.test(this.input.slice(this.lastTokEnd,this.start))},Za.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Za.semicolon=function(){!this.eat(J.semi)&&!this.insertSemicolon()&&this.unexpected()},Za.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Za.expect=function(e){this.eat(e)||this.unexpected()},Za.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};function $a(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}Za.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,`Parenthesized pattern`)}},Za.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Za.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Za.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var Y=Ya.prototype;Y.parseTopLevel=function(e){var t={};for(e.body||=[];this.type!==J.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,`Program`)};var eo={kind:`loop`},to={kind:`switch`};Y.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;ba.lastIndex=this.pos;var t=ba.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91)return!0;if(e)return!1;if(r===123)return!0;if(ua(r,!0)){for(var i=n+1;da(this.input.charCodeAt(i),!0);)++i;var a=this.input.slice(n,i);if(!na.test(a))return!0}return!1},Y.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;ba.lastIndex=this.pos;var e=ba.exec(this.input),t=this.pos+e[0].length;return!ga.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!da(this.input.charAt(t+8)))},Y.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=J._var,a=`let`),r){case J._break:case J._continue:return this.parseBreakContinueStatement(i,r.keyword);case J._debugger:return this.parseDebuggerStatement(i);case J._do:return this.parseDoStatement(i);case J._for:return this.parseForStatement(i);case J._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case J._class:return e&&this.unexpected(),this.parseClass(i,!0);case J._if:return this.parseIfStatement(i);case J._return:return this.parseReturnStatement(i);case J._switch:return this.parseSwitchStatement(i);case J._throw:return this.parseThrowStatement(i);case J._try:return this.parseTryStatement(i);case J._const:case J._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case J._while:return this.parseWhileStatement(i);case J._with:return this.parseWithStatement(i);case J.braceL:return this.parseBlock(!0,i);case J.semi:return this.parseEmptyStatement(i);case J._export:case J._import:if(this.options.ecmaVersion>10&&r===J._import){ba.lastIndex=this.pos;var o=ba.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===J._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.value,u=this.parseExpression();return r===J.name&&u.type===`Identifier`&&this.eat(J.colon)?this.parseLabeledStatement(i,l,u,e):this.parseExpressionStatement(i,u)}},Y.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(J.semi)||this.insertSemicolon()?e.label=null:this.type===J.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},Y.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},Y.parseDoStatement=function(e){return this.next(),this.labels.push(eo),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(J._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(J.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},Y.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(eo),this.enterScope(0),this.expect(J.parenL),this.type===J.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===J._var||this.type===J._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),(this.type===J._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===J._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var a=new $a,o=this.parseExpression(!0,a);return this.type===J._in||this.options.ecmaVersion>=6&&this.isContextual(`of`)?(this.options.ecmaVersion>=9&&(this.type===J._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(o,!1,a),this.checkLVal(o),this.parseForIn(e,o)):(this.checkExpressionErrors(a,!0),t>-1&&this.unexpected(t),this.parseFor(e,o))},Y.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,ro|(n?0:io),!1,t)},Y.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(J._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},Y.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,`'return' outside of function`),this.next(),this.eat(J.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},Y.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(J.braceL),this.labels.push(to),this.enterScope(0);for(var t,n=!1;this.type!==J.braceR;)if(this.type===J._case||this.type===J._default){var r=this.type===J._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(J.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},Y.parseThrowStatement=function(e){return this.next(),ga.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var no=[];Y.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===J._catch){var t=this.startNode();if(this.next(),this.eat(J.parenL)){t.param=this.parseBindingAtom();var n=t.param.type===`Identifier`;this.enterScope(n?za:0),this.checkLVal(t.param,n?qa:Ga),this.expect(J.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(J._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},Y.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},Y.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(eo),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},Y.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},Y.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},Y.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===J._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},Y.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},Y.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(J.braceL),e&&this.enterScope(0);this.type!==J.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},Y.parseFor=function(e,t){return e.init=t,this.expect(J.semi),e.test=this.type===J.semi?null:this.parseExpression(),this.expect(J.semi),e.update=this.type===J.parenR?null:this.parseExpression(),this.expect(J.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},Y.parseForIn=function(e,t){var n=this.type===J._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)?this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`):t.type===`AssignmentPattern`&&this.raise(t.start,`Invalid left-hand side in for-loop`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(J.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},Y.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(J.eq)?r.init=this.parseMaybeAssign(t):n===`const`&&!(this.type===J._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():r.id.type!==`Identifier`&&!(t&&(this.type===J._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):r.init=null,e.declarations.push(this.finishNode(r,`VariableDeclarator`)),!this.eat(J.comma))break}return e},Y.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,t===`var`?Wa:Ga,!1)};var ro=1,io=2,ao=4;Y.parseFunction=function(e,t,n,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===J.star&&t&io&&this.unexpected(),e.generator=this.eat(J.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&ro&&(e.id=t&ao&&this.type!==J.name?null:this.parseIdent(),e.id&&!(t&io)&&this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Wa:Ga:Ka));var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ha(e.async,e.generator)),t&ro||(e.id=this.type===J.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&ro?`FunctionDeclaration`:`FunctionExpression`)},Y.parseFunctionParams=function(e){this.expect(J.parenL),e.params=this.parseBindingList(J.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Y.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(J.braceL);this.type!==J.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(r.body.push(a),a.type===`MethodDefinition`&&a.kind===`constructor`&&(i&&this.raise(a.start,`Duplicate constructor in the same class`),i=!0))}return this.strict=n,this.next(),e.body=this.finishNode(r,`ClassBody`),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},Y.parseClassElement=function(e){var t=this;if(this.eat(J.semi))return null;var n=this.startNode(),r=function(e,r){r===void 0&&(r=!1);var i=t.start,a=t.startLoc;return t.eatContextual(e)?t.type!==J.parenL&&(!r||!t.canInsertSemicolon())?!0:(n.key&&t.unexpected(),n.computed=!1,n.key=t.startNodeAt(i,a),n.key.name=e,t.finishNode(n.key,`Identifier`),!1):!1};n.kind=`method`,n.static=r(`static`);var i=this.eat(J.star),a=!1;i||(this.options.ecmaVersion>=8&&r(`async`,!0)?(a=!0,i=this.options.ecmaVersion>=9&&this.eat(J.star)):r(`get`)?n.kind=`get`:r(`set`)&&(n.kind=`set`)),n.key||this.parsePropertyName(n);var o=n.key,s=!1;return!n.computed&&!n.static&&(o.type===`Identifier`&&o.name===`constructor`||o.type===`Literal`&&o.value===`constructor`)?(n.kind!==`method`&&this.raise(o.start,`Constructor can't have get/set modifier`),i&&this.raise(o.start,`Constructor can't be a generator`),a&&this.raise(o.start,`Constructor can't be an async method`),n.kind=`constructor`,s=e):n.static&&o.type===`Identifier`&&o.name===`prototype`&&this.raise(o.start,`Classes may not have a static property named prototype`),this.parseClassMethod(n,i,a,s),n.kind===`get`&&n.value.params.length!==0&&this.raiseRecoverable(n.value.start,`getter should have no params`),n.kind===`set`&&n.value.params.length!==1&&this.raiseRecoverable(n.value.start,`setter should have exactly one param`),n.kind===`set`&&n.value.params[0].type===`RestElement`&&this.raiseRecoverable(n.value.params[0].start,`Setter cannot use rest params`),n},Y.parseClassMethod=function(e,t,n,r){return e.value=this.parseMethod(t,n,r),this.finishNode(e,`MethodDefinition`)},Y.parseClassId=function(e,t){this.type===J.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,Ga,!1)):(t===!0&&this.unexpected(),e.id=null)},Y.parseClassSuper=function(e){e.superClass=this.eat(J._extends)?this.parseExprSubscripts():null},Y.parseExport=function(e,t){if(this.next(),this.eat(J.star))return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==J.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`);if(this.eat(J._default)){this.checkExport(t,`default`,this.lastTokStart);var n;if(this.type===J._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,ro|ao,!1,n)}else if(this.type===J._class){var i=this.startNode();e.declaration=this.parseClass(i,`nullableID`)}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,`ExportDefaultDeclaration`)}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==J.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var a=0,o=e.specifiers;a<o.length;a+=1){var s=o[a];this.checkUnreserved(s.local),this.checkLocalExport(s.local)}e.source=null}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},Y.checkExport=function(e,t,n){e&&(wa(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},Y.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t.name,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`?this.checkPatternExport(e,t.argument):n===`ParenthesizedExpression`&&this.checkPatternExport(e,t.expression)},Y.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},Y.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},Y.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(J.braceL);!this.eat(J.braceR);){if(n)n=!1;else if(this.expect(J.comma),this.afterTrailingComma(J.braceR))break;var r=this.startNode();r.local=this.parseIdent(!0),r.exported=this.eatContextual(`as`)?this.parseIdent(!0):r.local,this.checkExport(e,r.exported.name,r.exported.start),t.push(this.finishNode(r,`ExportSpecifier`))}return t},Y.parseImport=function(e){return this.next(),this.type===J.string?(e.specifiers=no,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===J.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},Y.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===J.name){var n=this.startNode();if(n.local=this.parseIdent(),this.checkLVal(n.local,Ga),e.push(this.finishNode(n,`ImportDefaultSpecifier`)),!this.eat(J.comma))return e}if(this.type===J.star){var r=this.startNode();return this.next(),this.expectContextual(`as`),r.local=this.parseIdent(),this.checkLVal(r.local,Ga),e.push(this.finishNode(r,`ImportNamespaceSpecifier`)),e}for(this.expect(J.braceL);!this.eat(J.braceR);){if(t)t=!1;else if(this.expect(J.comma),this.afterTrailingComma(J.braceR))break;var i=this.startNode();i.imported=this.parseIdent(!0),this.eatContextual(`as`)?i.local=this.parseIdent():(this.checkUnreserved(i.imported),i.local=i.imported),this.checkLVal(i.local,Ga),e.push(this.finishNode(i,`ImportSpecifier`))}return e},Y.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},Y.isDirectiveCandidate=function(e){return e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var oo=Ya.prototype;oo.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);case`AssignmentPattern`:break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},oo.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},oo.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},oo.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==J.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},oo.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case J.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(J.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case J.braceL:return this.parseObj(!0)}return this.parseIdent()},oo.parseBindingList=function(e,t,n){for(var r=[],i=!0;!this.eat(e);)if(i?i=!1:this.expect(J.comma),t&&this.type===J.comma)r.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===J.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),r.push(a),this.type===J.comma&&this.raise(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else{var o=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(o),r.push(o)}return r},oo.parseBindingListItem=function(e){return e},oo.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(J.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},oo.checkLVal=function(e,t,n){switch(t===void 0&&(t=Ua),e.type){case`Identifier`:t===Ga&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(t?`Binding `:`Assigning to `)+e.name+` in strict mode`),n&&(wa(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Ua&&t!==Ja&&this.declareName(e.name,t,e.start);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:t&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLVal(a,t,n)}break;case`Property`:this.checkLVal(e.value,t,n);break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLVal(c,t,n)}break;case`AssignmentPattern`:this.checkLVal(e.left,t,n);break;case`RestElement`:this.checkLVal(e.argument,t,n);break;case`ParenthesizedExpression`:this.checkLVal(e.expression,t,n);break;default:this.raise(e.start,(t?`Binding`:`Assigning to`)+` rvalue`)}};var X=Ya.prototype;X.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},X.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===J.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(J.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},X.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new $a,r=!0);var o=this.start,s=this.startLoc;(this.type===J.parenL||this.type===J.name)&&(this.potentialArrowAt=this.start);var c=this.parseMaybeConditional(e,t);if(n&&(c=n.call(this,c,o,s)),this.type.isAssign){var l=this.startNodeAt(o,s);return l.operator=this.value,l.left=this.type===J.eq?this.toAssignable(c,!1,t):c,r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.left.start&&(t.shorthandAssign=-1),this.checkLVal(c),this.next(),l.right=this.parseMaybeAssign(e),this.finishNode(l,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),c},X.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(J.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(J.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},X.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},X.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==J._in)&&a>r){var o=this.type===J.logicalOR||this.type===J.logicalAND,s=this.type===J.coalesce;s&&(a=J.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===J.coalesce||s&&(this.type===J.logicalOR||this.type===J.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},X.buildBinary=function(e,t,n,r,i,a){var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},X.parseMaybeUnary=function(e,t){var n=this.start,r=this.startLoc,i;if(this.isContextual(`await`)&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))i=this.parseAwait(),t=!0;else if(this.type.prefix){var a=this.startNode(),o=this.type===J.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),o?this.checkLVal(a.argument):this.strict&&a.operator===`delete`&&a.argument.type===`Identifier`?this.raiseRecoverable(a.start,`Deleting local variable in strict mode`):t=!0,i=this.finishNode(a,o?`UpdateExpression`:`UnaryExpression`)}else{if(i=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var s=this.startNodeAt(n,r);s.operator=this.value,s.prefix=!1,s.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(s,`UpdateExpression`)}}return!t&&this.eat(J.starstar)?this.buildBinary(n,r,i,this.parseMaybeUnary(null,!1),`**`,!1):i},X.parseExprSubscripts=function(e){var t=this.start,n=this.startLoc,r=this.parseExprAtom(e);if(r.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return r;var i=this.parseSubscripts(r,t,n);return e&&i.type===`MemberExpression`&&(e.parenthesizedAssign>=i.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=i.start&&(e.parenthesizedBind=-1)),i},X.parseSubscripts=function(e,t,n,r){for(var i=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,n,r,i,a);if(o.optional&&(a=!0),o===e||o.type===`ArrowFunctionExpression`){if(a){var s=this.startNodeAt(t,n);s.expression=o,o=this.finishNode(s,`ChainExpression`)}return o}e=o}},X.parseSubscript=function(e,t,n,r,i,a){var o=this.options.ecmaVersion>=11,s=o&&this.eat(J.questionDot);r&&s&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var c=this.eat(J.bracketL);if(c||s&&this.type!==J.parenL&&this.type!==J.backQuote||this.eat(J.dot)){var l=this.startNodeAt(t,n);l.object=e,l.property=c?this.parseExpression():this.parseIdent(this.options.allowReserved!==`never`),l.computed=!!c,c&&this.expect(J.bracketR),o&&(l.optional=s),e=this.finishNode(l,`MemberExpression`)}else if(!r&&this.eat(J.parenL)){var u=new $a,d=this.yieldPos,f=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var m=this.parseExprList(J.parenR,this.options.ecmaVersion>=8,!1,u);if(i&&!s&&!this.canInsertSemicolon()&&this.eat(J.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=d,this.awaitPos=f,this.awaitIdentPos=p,this.parseArrowExpression(this.startNodeAt(t,n),m,!0);this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=f||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;var h=this.startNodeAt(t,n);h.callee=e,h.arguments=m,o&&(h.optional=s),e=this.finishNode(h,`CallExpression`)}else if(this.type===J.backQuote){(s||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var g=this.startNodeAt(t,n);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,`TaggedTemplateExpression`)}return e},X.parseExprAtom=function(e){this.type===J.slash&&this.readRegexp();var t,n=this.potentialArrowAt===this.start;switch(this.type){case J._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),t=this.startNode(),this.next(),this.type===J.parenL&&!this.allowDirectSuper&&this.raise(t.start,`super() call outside constructor of a subclass`),this.type!==J.dot&&this.type!==J.bracketL&&this.type!==J.parenL&&this.unexpected(),this.finishNode(t,`Super`);case J._this:return t=this.startNode(),this.next(),this.finishNode(t,`ThisExpression`);case J.name:var r=this.start,i=this.startLoc,a=this.containsEsc,o=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&o.name===`async`&&!this.canInsertSemicolon()&&this.eat(J._function))return this.parseFunction(this.startNodeAt(r,i),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(J.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[o],!1);if(this.options.ecmaVersion>=8&&o.name===`async`&&this.type===J.name&&!a)return o=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(J.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[o],!0)}return o;case J.regexp:var s=this.value;return t=this.parseLiteral(s.value),t.regex={pattern:s.pattern,flags:s.flags},t;case J.num:case J.string:return this.parseLiteral(this.value);case J._null:case J._true:case J._false:return t=this.startNode(),t.value=this.type===J._null?null:this.type===J._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,`Literal`);case J.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),l;case J.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(J.bracketR,!0,!0,e),this.finishNode(t,`ArrayExpression`);case J.braceL:return this.parseObj(!1,e);case J._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case J._class:return this.parseClass(this.startNode(),!1);case J._new:return this.parseNew();case J.backQuote:return this.parseTemplate();case J._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},X.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`);var t=this.parseIdent(!0);switch(this.type){case J.parenL:return this.parseDynamicImport(e);case J.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},X.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(J.parenR)){var t=this.start;this.eat(J.comma)&&this.eat(J.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},X.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},X.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,``)),this.next(),this.finishNode(t,`Literal`)},X.parseParenExpression=function(){this.expect(J.parenL);var e=this.parseExpression();return this.expect(J.parenR),e},X.parseParenAndDistinguishExpression=function(e){var t=this.start,n=this.startLoc,r,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,s=[],c=!0,l=!1,u=new $a,d=this.yieldPos,f=this.awaitPos,p;for(this.yieldPos=0,this.awaitPos=0;this.type!==J.parenR;)if(c?c=!1:this.expect(J.comma),i&&this.afterTrailingComma(J.parenR,!0)){l=!0;break}else if(this.type===J.ellipsis){p=this.start,s.push(this.parseParenItem(this.parseRestBinding())),this.type===J.comma&&this.raise(this.start,`Comma is not permitted after the rest element`);break}else s.push(this.parseMaybeAssign(!1,u,this.parseParenItem));var m=this.start,h=this.startLoc;if(this.expect(J.parenR),e&&!this.canInsertSemicolon()&&this.eat(J.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=f,this.parseParenArrowList(t,n,s);(!s.length||l)&&this.unexpected(this.lastTokStart),p&&this.unexpected(p),this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=f||this.awaitPos,s.length>1?(r=this.startNodeAt(a,o),r.expressions=s,this.finishNodeAt(r,`SequenceExpression`,m,h)):r=s[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(t,n);return g.expression=r,this.finishNode(g,`ParenthesizedExpression`)}else return r},X.parseParenItem=function(e){return e},X.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var so=[];X.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(J.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.inNonArrowFunction()||this.raiseRecoverable(e.start,`'new.target' can only be used in functions`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc,a=this.type===J._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0),a&&e.callee.type===`ImportExpression`&&this.raise(r,`Cannot use new with import()`),this.eat(J.parenL)?e.arguments=this.parseExprList(J.parenR,this.options.ecmaVersion>=8,!1):e.arguments=so,this.finishNode(e,`NewExpression`)},X.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===J.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
91
+ `),cooked:this.value},this.next(),n.tail=this.type===J.backQuote,this.finishNode(n,`TemplateElement`)},X.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===J.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(J.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(J.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},X.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===J.name||this.type===J.num||this.type===J.string||this.type===J.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===J.star)&&!ga.test(this.input.slice(this.lastTokEnd,this.start))},X.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(J.braceR);){if(r)r=!1;else if(this.expect(J.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(J.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},X.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(J.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===J.comma&&this.raise(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(this.type===J.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),n.argument=this.parseMaybeAssign(!1,t),this.type===J.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(J.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(J.star),this.parsePropertyName(n,t)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},X.parsePropertyValue=function(e,t,n,r,i,a,o,s){if((n||r)&&this.type===J.colon&&this.unexpected(),this.eat(J.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`;else if(this.options.ecmaVersion>=6&&this.type===J.parenL)t&&this.unexpected(),e.kind=`init`,e.method=!0,e.value=this.parseMethod(n,r);else if(!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==J.comma&&this.type!==J.braceR&&this.type!==J.eq){(n||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c=e.kind===`get`?0:1;if(e.value.params.length!==c){var l=e.value.start;e.kind===`get`?this.raiseRecoverable(l,`getter should have no params`):this.raiseRecoverable(l,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)}else this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind=`init`,t?e.value=this.parseMaybeDefault(i,a,e.key):this.type===J.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected()},X.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(J.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(J.bracketR),e.key;e.computed=!1}return e.key=this.type===J.num||this.type===J.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},X.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},X.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ha(t,r.generator)|Ba|(n?Va:0)),this.expect(J.parenL),r.params=this.parseBindingList(J.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},X.parseArrowExpression=function(e,t,n){var r=this.yieldPos,i=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(Ha(n,!1)|Ra),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=r,this.awaitPos=i,this.awaitIdentPos=a,this.finishNode(e,`ArrowFunctionExpression`)},X.parseFunctionBody=function(e,t,n){var r=t&&this.type!==J.braceL,i=this.strict,a=!1;if(r)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!i||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var s=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!i&&!a&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,Ja),e.body=this.parseBlock(!1,void 0,a&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=s}this.exitScope()},X.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},X.checkParams=function(e,t){for(var n={},r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLVal(a,Wa,t?null:n)}},X.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(J.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===J.comma?o=null:this.type===J.ellipsis?(o=this.parseSpread(r),r&&this.type===J.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},X.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},X.parseIdent=function(e,t){var n=this.startNode();return this.type===J.name?n.name=this.value:this.type.keyword?(n.name=this.type.keyword,(n.name===`class`||n.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(n,`Identifier`),e||(this.checkUnreserved(n),n.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=n.start)),n},X.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===J.semi||this.canInsertSemicolon()||this.type!==J.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(J.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},X.parseAwait=function(){this.awaitPos||=this.start;var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!1),this.finishNode(e,`AwaitExpression`)};var co=Ya.prototype;co.raise=function(e,t){var n=ka(this.input,e);t+=` (`+n.line+`:`+n.column+`)`;var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},co.raiseRecoverable=co.raise,co.curPosition=function(){if(this.options.locations)return new Da(this.curLine,this.pos-this.lineStart)};var lo=Ya.prototype,uo=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};lo.enterScope=function(e){this.scopeStack.push(new uo(e))},lo.exitScope=function(){this.scopeStack.pop()},lo.treatFunctionsAsVarInScope=function(e){return e.flags&Pa||!this.inModule&&e.flags&Na},lo.declareName=function(e,t,n){var r=!1;if(t===Ga){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Na&&delete this.undefinedExports[e]}else if(t===qa)this.currentScope().lexical.push(e);else if(t===Ka){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&za&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&Na&&delete this.undefinedExports[e],s.flags&Fa)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},lo.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},lo.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},lo.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fa)return t}},lo.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fa&&!(t.flags&Ra))return t}};var fo=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new Oa(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},po=Ya.prototype;po.startNode=function(){return new fo(this,this.start,this.startLoc)},po.startNodeAt=function(e,t){return new fo(this,e,t)};function mo(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}po.finishNode=function(e,t){return mo.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},po.finishNodeAt=function(e,t,n,r){return mo.call(this,e,t,n,r)};var ho=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},go={b_stat:new ho(`{`,!1),b_expr:new ho(`{`,!0),b_tmpl:new ho("${",!1),p_stat:new ho(`(`,!1),p_expr:new ho(`(`,!0),q_tmpl:new ho("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ho(`function`,!1),f_expr:new ho(`function`,!0),f_expr_gen:new ho(`function`,!0,!1,null,!0),f_gen:new ho(`function`,!1,!1,null,!0)},_o=Ya.prototype;_o.initialContext=function(){return[go.b_stat]},_o.braceIsBlock=function(e){var t=this.curContext();return t===go.f_expr||t===go.f_stat?!0:e===J.colon&&(t===go.b_stat||t===go.b_expr)?!t.isExpr:e===J._return||e===J.name&&this.exprAllowed?ga.test(this.input.slice(this.lastTokEnd,this.start)):e===J._else||e===J.semi||e===J.eof||e===J.parenR||e===J.arrow?!0:e===J.braceL?t===go.b_stat:e===J._var||e===J._const||e===J.name?!1:!this.exprAllowed},_o.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},_o.updateContext=function(e){var t,n=this.type;n.keyword&&e===J.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},J.parenR.updateContext=J.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===go.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},J.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?go.b_stat:go.b_expr),this.exprAllowed=!0},J.dollarBraceL.updateContext=function(){this.context.push(go.b_tmpl),this.exprAllowed=!0},J.parenL.updateContext=function(e){var t=e===J._if||e===J._for||e===J._with||e===J._while;this.context.push(t?go.p_stat:go.p_expr),this.exprAllowed=!0},J.incDec.updateContext=function(){},J._function.updateContext=J._class.updateContext=function(e){e.beforeExpr&&e!==J.semi&&e!==J._else&&!(e===J._return&&ga.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===J.colon||e===J.braceL)&&this.curContext()===go.b_stat)?this.context.push(go.f_expr):this.context.push(go.f_stat),this.exprAllowed=!1},J.backQuote.updateContext=function(){this.curContext()===go.q_tmpl?this.context.pop():this.context.push(go.q_tmpl),this.exprAllowed=!1},J.star.updateContext=function(e){if(e===J._function){var t=this.context.length-1;this.context[t]===go.f_expr?this.context[t]=go.f_expr_gen:this.context[t]=go.f_gen}this.exprAllowed=!0},J.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==J.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var vo=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,yo=vo+` Extended_Pictographic`,bo={9:vo,10:yo,11:yo},xo=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,So=`Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,Co=So+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,wo={9:So,10:Co,11:Co+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`},To={};function Eo(e){var t=To[e]={binary:Ea(bo[e]+` `+xo),nonBinary:{General_Category:Ea(xo),Script:Ea(wo[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}Eo(9),Eo(10),Eo(11);var Z=Ya.prototype,Do=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``),this.unicodeProperties=To[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};Do.prototype.reset=function(e,t,n){var r=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9},Do.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},Do.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},Do.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},Do.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},Do.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Do.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Do.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e?(this.advance(t),!0):!1};function Oo(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}Z.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=0;r<n.length;r++){var i=n.charAt(r);t.indexOf(i)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(i,r+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`)}},Z.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},Z.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames.indexOf(r)===-1&&e.raise(`Invalid named capture referenced`)}},Z.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},Z.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Z.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},Z.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Z.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},Z.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Z.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},Z.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Z.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Z.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}e.pos=t}return!1},Z.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},Z.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Z.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},Z.regexp_eatSyntaxCharacter=function(e){var t=e.current();return ko(t)?(e.lastIntValue=t,e.advance(),!0):!1};function ko(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Z.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!ko(n);)e.advance();return e.pos!==t},Z.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},Z.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise(`Duplicate capture group name`),e.groupNames.push(e.lastStringValue);return}e.raise(`Invalid group`)}},Z.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},Z.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Oo(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Oo(e.lastIntValue);return!0}return!1},Z.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Ao(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Ao(e){return ua(e,!0)||e===36||e===95}Z.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),jo(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function jo(e){return da(e,!0)||e===36||e===95||e===8204||e===8205}Z.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},Z.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Z.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},Z.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Z.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Z.regexp_eatZero=function(e){return e.current()===48&&!Lo(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},Z.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},Z.regexp_eatControlLetter=function(e){var t=e.current();return Mo(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Mo(e){return e>=65&&e<=90||e>=97&&e<=122}Z.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&No(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function No(e){return e>=0&&e<=1114111}Z.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},Z.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1},Z.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Po(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise(`Invalid property name`)}return!1};function Po(e){return e===100||e===68||e===115||e===83||e===119||e===87}Z.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},Z.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){wa(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},Z.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise(`Invalid property name`)},Z.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Fo(t=e.current());)e.lastStringValue+=Oo(t),e.advance();return e.lastStringValue!==``};function Fo(e){return Mo(e)||e===95}Z.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Io(t=e.current());)e.lastStringValue+=Oo(t),e.advance();return e.lastStringValue!==``};function Io(e){return Fo(e)||Lo(e)}Z.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Z.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise(`Unterminated character class`)}return!1},Z.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},Z.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Bo(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r===93?!1:(e.lastIntValue=r,e.advance(),!0)},Z.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Z.regexp_eatClassControlLetter=function(e){var t=e.current();return Lo(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},Z.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},Z.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Lo(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Lo(e){return e>=48&&e<=57}Z.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ro(n=e.current());)e.lastIntValue=16*e.lastIntValue+zo(n),e.advance();return e.pos!==t};function Ro(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function zo(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Z.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},Z.regexp_eatOctalDigit=function(e){var t=e.current();return Bo(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Bo(e){return e>=48&&e<=55}Z.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Ro(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+zo(i),e.advance()}return!0};var Vo=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Oa(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Q=Ya.prototype;Q.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Vo(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Q.getToken=function(){return this.next(),new Vo(this)},typeof Symbol<`u`&&(Q[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===J.eof,value:t}}}}),Q.curContext=function(){return this.context[this.context.length-1]},Q.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(J.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Q.readToken=function(e){return ua(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Q.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=57344)return e;var t=this.input.charCodeAt(this.pos+1);return(e<<10)+t-56613888},Q.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations){_a.lastIndex=t;for(var r;(r=_a.exec(this.input))&&r.index<this.pos;)++this.curLine,this.lineStart=r.index+r[0].length}this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Q.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!va(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Q.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&ya.test(String.fromCharCode(e)))++this.pos;else break loop}}},Q.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Q.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(J.ellipsis)):(++this.pos,this.finishToken(J.dot))},Q.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(J.assign,2):this.finishOp(J.slash,1)},Q.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?J.star:J.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=J.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(J.assign,n+1):this.finishOp(r,n)},Q.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(J.assign,3):this.finishOp(e===124?J.logicalOR:J.logicalAND,2):t===61?this.finishOp(J.assign,2):this.finishOp(e===124?J.bitwiseOR:J.bitwiseAND,1)},Q.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(J.assign,2):this.finishOp(J.bitwiseXOR,1)},Q.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ga.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(J.incDec,2):t===61?this.finishOp(J.assign,2):this.finishOp(J.plusMin,1)},Q.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(J.assign,n+1):this.finishOp(J.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(J.relational,n))},Q.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(J.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(J.arrow)):this.finishOp(e===61?J.eq:J.prefix,1)},Q.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(J.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(J.assign,3):this.finishOp(J.coalesce,2)}return this.finishOp(J.question,1)},Q.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(J.parenL);case 41:return++this.pos,this.finishToken(J.parenR);case 59:return++this.pos,this.finishToken(J.semi);case 44:return++this.pos,this.finishToken(J.comma);case 91:return++this.pos,this.finishToken(J.bracketL);case 93:return++this.pos,this.finishToken(J.bracketR);case 123:return++this.pos,this.finishToken(J.braceL);case 125:return++this.pos,this.finishToken(J.braceR);case 58:return++this.pos,this.finishToken(J.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(J.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(J.prefix,1)}this.raise(this.pos,`Unexpected character '`+Wo(e)+`'`)},Q.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Q.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(ga.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new Do(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(J.regexp,{pattern:i,flags:o,value:c})},Q.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Ho(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Uo(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Q.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Uo(this.input.slice(t,this.pos)),++this.pos):ua(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(J.num,n)},Q.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Uo(this.input.slice(t,this.pos));return++this.pos,ua(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(J.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),ua(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Ho(this.input.slice(t,this.pos),n);return this.finishToken(J.num,a)},Q.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t};function Wo(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}Q.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(va(r,this.options.ecmaVersion>=10)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(J.string,t)};var Go={};Q.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Go)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Q.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Go;this.raise(e,t)},Q.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===J.template||this.type===J.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(J.dollarBraceL)):(++this.pos,this.finishToken(J.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(J.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(va(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
92
92
  `;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else ++this.pos}},Q.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(J.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,`Unterminated template`)},Q.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
93
- `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Uo(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(e){var n=this.pos-1;return this.invalidStringToken(n,`Invalid escape sequence in template string`),null}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return _a(t)?``:String.fromCharCode(t)}},Q.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Q.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(ua(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?la:ua)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Uo(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Q.readWord=function(){var e=this.readWord1(),t=J.name;return this.keywords.test(e)&&(t=ma[e]),this.finishToken(t,e)},Ja.acorn={Parser:Ja,version:`7.4.1`,defaultOptions:ka,Position:Ea,SourceLocation:Da,getLineInfo:Oa,Node:uo,TokenType:K,tokTypes:J,keywordTypes:ma,TokContext:mo,tokContexts:ho,isIdentifierChar:ua,isIdentifierStart:la,Token:Bo,isNewLine:_a,lineBreak:ha,lineBreakG:ga,nonASCIIwhitespace:va};function Go(e,t){return Ja.parse(e,t)}function Ko(e){return[`ArrayOrObject1D`,`ArrayOrObject2D`,`ArrayOrObject3DPlus`,`Literal`,`Symbol`,`UnaryOperation`,`BinaryOperation`,`Random`,`CallDefinedFunction`,`AnyFunction`,`ConditionalExpression`,`ArrayExpression`,`ObjectExpression`].includes(e.type)}function qo(e){return e.type===`Program`?e.body.map(e=>$(e)):[$(e)]}function $(e){switch(e.type){case`Program`:return us(e);case`ExpressionStatement`:return ds(e);case`AssignmentExpression`:return fs(e);case`MemberExpression`:return hs(e);case`UnaryExpression`:return ps(e);case`BinaryExpression`:return ms(e);case`Identifier`:return gs(e);case`Literal`:return _s(e);case`CallExpression`:return as(e);case`IfStatement`:return is(e);case`BlockStatement`:return rs(e);case`FunctionDeclaration`:return Jo(e);case`ForStatement`:return ns(e);case`BreakStatement`:return es(e);case`ReturnStatement`:return ts(e);case`ContinueStatement`:return $o(e);case`UpdateExpression`:return Yo(e);case`LogicalExpression`:return Xo(e);case`TemplateLiteral`:return Zo(e);case`TemplateElement`:return Qo(e);case`ConditionalExpression`:return vs(e);case`Property`:return ys(e);case`ObjectExpression`:return bs(e);case`ArrayExpression`:return xs(e);default:throw console.log(e),Error(`未定義の AST ノードです :`+e.type)}}function Jo(e){return{type:`DefinedFunction`,functionName:e.id.name,body:$(e.body)}}function Yo(e){return{type:`UpdateExpression`,operator:e.operator,argument:$(e.argument)}}function Xo(e){return{type:`LogicalExpression`,operator:e.operator,left:$(e.left),right:$(e.right)}}function Zo(e){return{type:`TemplateLiteral`,expressions:e.expressions.map(e=>$(e)),quasis:e.quasis.map(e=>$(e))}}function Qo(e){return{type:`TemplateElement`,value:e.value}}function $o(e){return{type:`Continue`,label:e.label}}function es(e){return{type:`Break`,label:e.label}}function ts(e){return{type:`Return`,argument:$(e.argument)}}function ns(e){return{type:`ForStatement`,body:e.body.body.map(e=>$(e)),init:$(e.init),test:$(e.test),update:$(e.update)}}function rs(e){return{type:`BlockStatement`,value:e.body.map(e=>$(e))}}function is(e){return{type:`IfStatement`,consequent:$(e.consequent),test:$(e.test),alternate:e.alternate?$(e.alternate):void 0}}function as(e){let t=e.callee.name;switch(t){case`RAND`:return ls(e.arguments);case`JUMPGATE`:return cs(e.arguments);case`MSG`:case`MESSAGE`:return ss(e.arguments);case`MUSIC`:case`SOUND`:case`BGM_STOP`:case`STOP_BGM`:case`SOUND_STOP`:case`STOP_SOUND`:case`ALL_SOUND_STOP`:case`STOP_ALL_SOUND`:case`SAVE`:case`LOG`:case`ABLE_CHANGE_SPEED`:case`SET_SPEED`:case`CHANGE_GAMEOVER_POS`:case`DEL_PLAYER`:case`RESTART_GAME`:case`URL_JUMPGATE`:case`HIDE_STATUS`:case`PARTS`:case`FACE`:case`EFFECT`:case`CHANGE_PLAYER_IMAGE`:case`CHANGE_PLAYER_IMG`:case`HAS_ITEM`:case`REMOVE_ITEM`:case`MOVE`:case`PARTS_MOVE`:case`IS_PLAYER_WAITING_MESSAGE`:case`IS_MANUAL_PAUSE`:case`IS_PLAYER_WAITING_ENTER`:case`GET_UNIXTIME`:case`GET_DATE_YEAR`:case`GET_DATE_MONTH`:case`GET_DATE_DAY`:case`GET_DATE_HOUR`:case`GET_DATE_MINUTES`:case`GET_DATE_SECONDS`:case`GET_DATE_MILLISECONDS`:case`GET_DATE_WEEKDAY`:case`CHANGE_SYSMSG`:case`PICTURE`:case`PICTURE_FROM_PARTS`:case`CLEAR_ALL_PICTURES`:case`HAS_PICTURE`:case`SHOW_USER_DEF_VAR`:case`ABS`:case`POW`:case`SQRT`:case`SIN`:case`COS`:case`TAN`:case`GET_GAMEOVER_POS_X`:case`GET_GAMEOVER_POS_Y`:case`ABORT_BATTLE`:case`EXIT`:case`GET_IMG_POS_X`:case`GET_IMG_POS_Y`:case`LENGTH`:case`IS_NUMBER`:case`MANUAL_PAUSE`:case`WAIT_ENTER`:case`COLOR`:case`EFFITEM`:case`CHANGE_BOM_IMG`:case`CHANGE_BOM_IMAGE`:case`CHANGE_CLICK_IMAGE`:case`CHANGE_CLICK_IMG`:case`CHANGE_FRAME_IMAGE`:case`CHANGE_FRAME_IMG`:case`CHANGE_YESNO_IMAGE`:case`CHANGE_YESNO_IMG`:case`NO_GAMEOVER`:case`DEFAULT`:case`DIR_MAP`:case`CHANGE_SOUND_ATTACK`:case`CHANGE_SOUND_DECISION`:return os(e.arguments,t);default:return{type:`CallDefinedFunction`,functionName:t}}}function os(e,t){return{type:`AnyFunction`,functionName:t,value:e.map(e=>$(e))}}function ss(e){return{type:`Msg`,value:$(e[0])}}function cs(e){if(e.length<2)throw Error(`RAND関数には引数が2つ必要です。`);let t={x:e[0],y:e[1]};return{type:`Jumpgate`,x:$(t.x),y:$(t.y)}}function ls(e){if(e.length<1)throw Error(`RAND関数には引数が必要です。`);return{type:`Random`,value:$(e[0])}}function us(e){if(e.body.length!==1)throw Error(`bodyが1以外の場合評価できません。`);return $(e.body[0])}function ds(e){return $(e.expression)}function fs(e){let t=$(e.left),n=$(e.right);if(!Ko(n))throw Error(`値以外を代入式の右辺に設定できません`);switch(e.operator){case`=`:case`+=`:case`-=`:case`*=`:case`/=`:if(t.type===`ArrayOrObject2D`){if(t.name===`m`||t.name===`o`)return{type:`PartsAssignment`,partsKind:t.name===`m`?`map`:`object`,destinationX:t.indecies[0],destinationY:t.indecies[1],value:n,operator:e.operator};if(t.name===`v`)return{type:`UserVariableAssignment`,index:[t.indecies[0],t.indecies[1]],value:n,operator:e.operator};throw Error(`想定していない記号が2次元配列ででてきました`)}else if(t.type===`ArrayOrObject1D`){if(t.name===`ITEM`)return{type:`ItemAssignment`,itemBoxPosition1to12:t.indecies[0],value:n,operator:e.operator};if(t.name===`v`)return{type:`UserVariableAssignment`,index:[t.indecies[0]],value:n,operator:e.operator};if(t.name===`LP`)return{type:`LoopPointerAssignment`,index:t.indecies[0],value:n,operator:e.operator};throw Error(`1次元配列にて想定していないシンボルが指定されました ${t.name}`)}else if(t.type===`Symbol`){if(t.name===`m`||t.name===`o`||t.name===`v`||t.name===`ITEM`||t.name===`X`||t.name===`Y`||t.name===`ID`||t.name===`TYPE`||t.name===`CX`||t.name===`CY`||t.name===`PICTURE`||t.name===`PLAYER_PX`||t.name===`PLAYER_PY`||t.name===`MOVE_SPEED`||t.name===`MOVE_FRAME_TIME`||t.name===`LP`||t.name===`undefined`)throw Error(`このシンボルには代入できません`);if(t.name===`AT_TOTAL`)throw Error(`"装備品込みの攻撃力(AT_TOTAL)への代入はできません。"`);if(t.name===`DF_TOTAL`)throw Error(`"装備品込みの防御力(DF_TOTAL)への代入はできません。"`);if(t.name===`ENEMY_HP`||t.name===`ENEMY_AT`||t.name===`ENEMY_DF`||t.name===`ENEMY_GD`)throw Error(`敵ステータス (ENEMY_HP, ENEMY_AT, ENEMY_DF, ENEMY_GD) への代入はできません。`);return{type:`SpecialParameterAssignment`,kind:t.name,value:n,operator:e.operator}}else if(t.type===`Literal`)throw Error(`数値には代入できません`);else if(t.type===`ArrayOrObject3DPlus`&&t.name===`v`)return{type:`UserVariableAssignment`,index:t.indecies,value:n,operator:e.operator};else throw Error(`代入できません`);default:throw Error(`想定していないオペレーターです`)}}function ps(e){let t=$(e.argument);if(![`+`,`-`,`!`].includes(e.operator))throw Error(`未定義の演算子です :`+e.operator);if(!Ko(t))throw Error(`単項演算子が適用できません`);return{type:`UnaryOperation`,operator:e.operator,argument:t}}function ms(e){let t=$(e.left),n=$(e.right);if(!Ko(t)||!Ko(n))throw Error(`左辺または右辺が評価不能です`);switch(e.operator){case`+`:case`-`:case`*`:case`/`:case`%`:case`>`:case`<`:case`>=`:case`<=`:case`==`:case`!=`:return{type:`BinaryOperation`,operator:e.operator,left:t,right:n};default:throw Error(`未定義の演算子です :`+e.operator)}}function hs(e){let t=$(e.object),n=$(e.property);if(t.type===`Symbol`){if(![`v`,`m`,`o`,`ITEM`,`LP`,`PICTURE`].includes(t.name))throw Error(`このシンボルは配列にできません`);if(Ko(n))return{type:`ArrayOrObject1D`,name:t.name,indecies:[n]};throw Error(`WWAでは存在しない構文です`)}else if(t.type===`ArrayOrObject1D`){if(t.name===`ITEM`||t.name===`PICTURE`)throw Error(`この配列は2次元以上にはできません。`);if(Ko(n))return{type:`ArrayOrObject2D`,name:t.name,indecies:[...t.indecies,n]};throw Error(`WWAでは存在しない構文です`)}else if(t.type===`ArrayOrObject2D`||t.type===`ArrayOrObject3DPlus`){if(t.name===`m`||t.name===`o`)throw Error(`この配列は3次元以上にはできません。`);if(t.name===`v`&&Ko(n))return{type:`ArrayOrObject3DPlus`,name:t.name,indecies:[...t.indecies,n]}}else throw Error(`WWAでは存在しない構文です`)}function gs(e){switch(e.name){case`m`:case`o`:case`ITEM`:case`X`:case`Y`:case`ID`:case`TYPE`:case`PX`:case`PY`:case`CX`:case`CY`:case`v`:case`HP`:case`HPMAX`:case`AT`:case`AT_TOTAL`:case`DF`:case`DF_TOTAL`:case`GD`:case`STEP`:case`TIME`:case`PDIR`:case`i`:case`j`:case`k`:case`LOOPLIMIT`:case`ITEM_ID`:case`ITEM_POS`:case`ENEMY_HP`:case`ENEMY_AT`:case`ENEMY_DF`:case`PICTURE`:case`PLAYER_PX`:case`PLAYER_PY`:case`MOVE_SPEED`:case`MOVE_FRAME_TIME`:case`LP`:case`undefined`:return{type:`Symbol`,name:e.name};default:return{type:`Literal`,value:e.name}}}function _s(e){return{type:`Literal`,value:e.value}}function vs(e){let t=$(e.consequent),n=$(e.alternate);return{type:`ConditionalExpression`,consequent:t,test:$(e.test),alternate:n}}function ys(e){let t=$(e.key);if(t.type===`Symbol`)throw Error(`Object のキー ${t.name} は予約されているため、使用できません。`);if(t.type!==`Literal`)throw Error(`Object のキーが不正です。 Literal を期待していましたが、実際は ${t.type} でした。`);return{type:`Property`,key:t,value:$(e.value)}}function bs(e){return{type:`ObjectExpression`,properties:e.properties.map(ys)}}function xs(e){return{type:`ArrayExpression`,elements:e.elements.map($)}}var Ss=[j.OBJECT,j.MAP],Cs=e=>Math.abs(e)<2**-52;function ws(e){switch(typeof e){case`object`:if(e===null)break;return Array.isArray(e)?e.length:Object.keys(e).length;case`string`:return e.length}throw Error(`LENGTH: 対応できない値が指定されています。`)}var Ts=(e,t)=>(e-t)*R.CHIP_SIZE,Es=(e,t)=>(e-t)*R.CHIP_SIZE,Ds=Object.freeze({"=":(e,t)=>t,"+=":(e,t)=>e+t,"-=":(e,t)=>e-t,"*=":(e,t)=>e*t,"/=":(e,t)=>e/t}),Os=class{constructor(e){this.wwa=e,this.loop_limit=1e5,this.state={messagePageAdditionalQueue:[]}}setTriggerParts(e,t,n){this.state={...this.state,triggerParts:{id:e,type:t,position:n}}}clearTemporaryState(){this.state={...this.state,triggerParts:void 0,messagePageAdditionalQueue:[]}}setEarnedItem(e,t){this.state={...this.state,earnedItem:{partsId:e,itemPos1To12:t}}}clearEarnedItem(){this.state={...this.state,earnedItem:void 0}}setBattleDamageCalculationMode(e){this.state={...this.state,battleDamageCalculation:{estimatingParams:e}}}clearBattleDamageCalculationMode(){this.state={...this.state,battleDamageCalculation:void 0}}evalWwaNodes(e){return this.evalWwaNode({type:`BlockStatement`,value:e})}evalWwaNode(e){if(!(e.type===`BlockStatement`&&Array.isArray(e.value)&&e.value.length===0))try{return new ks(this).evalWwaNode(e)}catch(e){if(e instanceof As||e instanceof js)return e.value;throw e}}addPageAdditionalItem(e){this.state.messagePageAdditionalQueue.push(e)}pickPageAdditionalQueue(){let e=[...this.state.messagePageAdditionalQueue];return this.state.messagePageAdditionalQueue=[],e}updateLoopLimit(e){this.loop_limit=e}},ks=class{constructor(e){this.generator=e,this.for_id={i:null,j:null,k:null,LP:[],loopCount:0,break_flag:!1,continue_flag:!1}}evalWwaNodes(e){let t;return e.forEach(e=>{t=this.evalWwaNode(e)}),t}evalWwaNode(e){if(!(this.for_id.break_flag||this.for_id.continue_flag))switch(e.type){case`UnaryOperation`:return this.evalUnaryOperation(e);case`BinaryOperation`:return this.evalBinaryOperation(e);case`Symbol`:return this.evalSymbol(e);case`ArrayOrObject1D`:return this.evalArrayOrObject1D(e);case`ArrayOrObject2D`:return this.evalArrayOrObject2D(e);case`ArrayOrObject3DPlus`:return this.evalArrayOrObject3DPlus(e);case`Literal`:return this.evalLiteral(e);case`UserVariableAssignment`:return this.evalSetUserVariable(e);case`SpecialParameterAssignment`:return this.evalSetSpecialParameter(e);case`Random`:return this.evalRandom(e);case`Jumpgate`:return this.evalJumpgate(e);case`Msg`:return this.evalMessage(e);case`ItemAssignment`:return this.itemAssignment(e);case`IfStatement`:return this.ifStatement(e);case`BlockStatement`:return this.blockStatement(e);case`PartsAssignment`:return this.partsAssignment(e);case`ForStatement`:return this.forStateMent(e);case`AnyFunction`:return this.wrapCallFunction(e,e=>this.evalAnyFunction(e));case`CallDefinedFunction`:return this.wrapCallFunction(e,e=>this.callDefinedFunction(e));case`Break`:return this.breakStatement(e);case`Return`:throw new As(this.returnStatement(e));case`Continue`:return this.contunueStatment(e);case`UpdateExpression`:return this.updateExpression(e);case`LogicalExpression`:return this.logicalExpression(e);case`TemplateLiteral`:return this.convertTemplateLiteral(e);case`ConditionalExpression`:return this.convertConditionalExpression(e);case`Property`:return this.property(e);case`ObjectExpression`:return this.objectExpression(e);case`ArrayExpression`:return this.arrayExpression(e);case`LoopPointerAssignment`:return this.convertLoopPointerExpression(e);default:throw console.log(e),Error(`未定義または未実装のノードです`)}}wrapCallFunction(e,t){try{return t(e)}catch(e){if(e instanceof As)return e.value;throw e}}callDefinedFunction(e){let t=this.generator.wwa.getUserScript(e.functionName);if(t===null)throw Error(`未定義の関数が呼び出されました: ${e.functionName}`);return this.evalWwaNode(t)}updateExpression(e){if(e.argument.type!==`ArrayOrObject1D`&&e.argument.type!==`ArrayOrObject2D`&&e.argument.type!==`Symbol`)throw Error(`node.argument.typeが インクリメント/デクリメントできる対象ではありません。: ${e.argument.type}`);let t=t=>{switch(e.operator){case`++`:return t+1;case`--`:return t-1;default:throw Error(`想定外のOperatorが渡されました :`+e.operator)}},n=this.evalWwaNode(e.argument),r={type:`Literal`,value:t(n)};switch(e.argument.type){case`ArrayOrObject1D`:if(e.argument.name===`v`)this.evalSetUserVariable({type:`UserVariableAssignment`,index:[e.argument.indecies[0]],value:r});else if(e.argument.name===`ITEM`)this.itemAssignment({type:`ItemAssignment`,itemBoxPosition1to12:e.argument.indecies[0],value:r});else if(e.argument.name===`LP`)this.convertLoopPointerExpression({type:`LoopPointerAssignment`,index:e.argument.indecies[0],value:r,operator:`=`});else throw Error(`このリテラルはインクリメント/デクリメントできません: ${e.argument.type}`);break;case`ArrayOrObject2D`:{let t={type:`PartsAssignment`,destinationX:e.argument.indecies[0],destinationY:e.argument.indecies[1],value:r,operator:`=`};if(e.argument.name===`m`)this.partsAssignment({...t,partsKind:`map`});else if(e.argument.name===`o`)this.partsAssignment({...t,partsKind:`object`});else throw Error(`このリテラルはインクリメント/デクリメントできません: ${e.argument.type}`);break}case`Symbol`:{let t={type:`SpecialParameterAssignment`,kind:e.argument.name,value:r};this.evalSetSpecialParameter(t);break}}return n}logicalExpression(e){let t=this.evalWwaNode(e.left),n=this.evalWwaNode(e.right);switch(e.operator){case`||`:return t||n;case`&&`:return t&&n;default:throw Error(`存在しない論理式です!: `+e.operator)}}convertTemplateLiteral(e){let t=e.expressions.map(e=>this.evalWwaNode(e)),n=e.quasis.map(e=>e.value.cooked),r=``;return n.forEach((e,n)=>{r+=e,t[n]!==void 0&&(r+=t[n])}),r}contunueStatment(e){this.for_id.continue_flag=!0}breakStatement(e){this.for_id.break_flag=!0}returnStatement(e){return this.evalWwaNode(e.argument)}forStateMent(e){let t=e.init;for((()=>{if(`kind`in t)switch(t.kind){case`i`:if(this.for_id.i!==null)throw Error(`iの値が既に外側のforループで使われています。`);break;case`j`:if(this.for_id.j!==null)throw Error(`jの値が既に外側のforループで使われています。`);break;case`k`:if(this.for_id.k!==null)throw Error(`kの値が既に外側のforループで使われています。`);break;default:throw console.log(e),Error(`予想外の変数がfor文内で使用されました :`+t.kind)}else switch(t.type){case`LoopPointerAssignment`:let n=Number(this.evalWwaNode(t.index));if(Number.isNaN(n))throw Error(`LPのIndex値はNumberでないといけません。: ${n}`);if(this.for_id.LP[n]!==null&&this.for_id.LP[n]!==void 0)throw Error(`LP[${n}]の値が既に外側のforループで使われています。`);break;default:throw console.log(e),Error(`予想外の1次元配列がfor文内で使用されました :`+t)}this.evalWwaNode(e.init)})();this.evalWwaNode(e.test);this.evalWwaNode(e.update)){if(this.for_id.loopCount++,this.for_id.loopCount>this.generator.loop_limit)throw Error(`処理回数が多すぎます!
94
- 上限値は LOOPLIMIT で変えられます。`);if(this.for_id.break_flag||!this.evalWwaNode(e.test))break;this.evalWwaNodes(e.body),this.for_id.continue_flag=!1}if(this.for_id.break_flag=!1,`kind`in t)switch(t.kind){case`i`:this.for_id.i=null;break;case`j`:this.for_id.j=null;break;case`k`:this.for_id.k=null;break}else switch(t.type){case`LoopPointerAssignment`:let e=Number(this.evalWwaNode(t.index));this.for_id.LP[e]=null;break}}_checkArgsLength(e,t){if(t.value.length<e)throw Error(`関数 ${t.functionName} の引数が不足しています!`)}evalAnyFunction(e){let t=this.generator.wwa.getGameStatus();switch(e.functionName){case`MUSIC`:case`SOUND`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]),n=e.value[1]?this.evalWwaNode(e.value[1]):void 0,r=e.value[2]?this.evalWwaNode(e.value[2]):!1;return this.generator.wwa.playSound(t,{loopPlaying:n,bgmDelayDurationMs:r>=0?r:void 0}),t}case`BGM_STOP`:case`STOP_BGM`:this.generator.wwa.stopBgm();return;case`SOUND_STOP`:case`STOP_SOUND`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);return this.generator.wwa.stopSound(t,{includeBgm:!0}),t}case`STOP_SOUNDS`:case`ALL_SOUND_STOP`:case`STOP_ALL_SOUND`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);this.generator.wwa.stopAllSound({includeBgm:!!t});return}case`SAVE`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);return this.generator.wwa.disableSave(t),t}case`LOG`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);console.log(t instanceof Map?d(t):t);return}case`ABLE_CHANGE_SPEED`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);return this.generator.wwa.speedChangeJudge(t),t}case`SET_SPEED`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));this.generator.wwa.setPlayerSpeedIndex(t);return}case`CHANGE_GAMEOVER_POS`:{this._checkArgsLength(2,e);let t={x:Number(this.evalWwaNode(e.value[0])),y:Number(this.evalWwaNode(e.value[1]))};if(t.x<0||t.x>=this.generator.wwa.getMapWidth()||t.y<0||t.y>this.generator.wwa.getMapWidth())throw Error(`マップの範囲外が指定されています!`);this.generator.wwa.setGameOverPosition(new S(t.x,t.y));return}case`DEL_PLAYER`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);this.generator.wwa.setDelPlayer(t);return}case`RESTART_GAME`:this.generator.wwa.restartGame();return;case`URL_JUMPGATE`:throw Error(`URL_JUMPGATE 関数は調整中のためご利用になれません`);case`HIDE_STATUS`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=!!this.evalWwaNode(e.value[1]);this.generator.wwa.hideStatus(t,n);return}case`PARTS`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=e.value[2]?Number(this.evalWwaNode(e.value[2])):0,i=e.value[3]?!!this.evalWwaNode(e.value[3]):!1;if(t<0||n<0)throw Error(`パーツ番号が不正です`);if(!Ss.includes(r))throw Error(`パーツ種別が不明です`);this.generator.wwa.replaceParts(t,n,r,i);return}case`FACE`:{this._checkArgsLength(6,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=Number(this.evalWwaNode(e.value[2])),i=Number(this.evalWwaNode(e.value[3])),a=Number(this.evalWwaNode(e.value[4])),o=Number(this.evalWwaNode(e.value[5]));if(t<0||n<0||r<0||i<0||a<0||o<0)throw Error(`各引数は0以上の整数でなければなりません。`);this.generator.addPageAdditionalItem({type:`face`,data:{face:new w(new S(t,n),new S(r,i),new S(a,o))}});return}case`EFFECT`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));if(t<0)throw Error(`待ち時間は0以上の整数でなければなりません。`);if(t===0){this.generator.wwa.stopEffect();return}let n=[];for(let t=1;t<e.value.length;t+=2){let r=Number(this.evalWwaNode(e.value[t]));if(r<0)throw Error(`画像のパーツ座標指定は0以上の整数でなければなりません。`);if(t+1===e.value.length)throw Error(`画像のパーツ座標指定で、Y座標が指定されていません。`);let i=Number(this.evalWwaNode(e.value[t+1]));if(i<0)throw Error(`画像のパーツ座標指定は0以上の整数でなければなりません。`);n.push(new S(r,i))}this.generator.wwa.setEffect(t,n);return}case`CHANGE_PLAYER_IMAGE`:case`CHANGE_PLAYER_IMG`:{this._checkArgsLength(2,e);let t=new S(Number(this.evalWwaNode(e.value[0])),Number(this.evalWwaNode(e.value[1])));this.generator.wwa.setPlayerImgCoord(t);return}case`HAS_ITEM`:{this._checkArgsLength(1,e);let n=Number(this.evalWwaNode(e.value[0]));return t.itemBox.includes(n)}case`REMOVE_ITEM`:{this._checkArgsLength(1,e);let n=Number(this.evalWwaNode(e.value[0])),r=e.value[1]?this.evalWwaNode(e.value[1])===1:!1,i=0;for(let e=0;e<t.itemBox.length;e++)if(n===t.itemBox[e]&&(this.generator.wwa.setPlayerGetItem(e+1,0),i++,!r))return i;return i}case`MOVE`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));if(t<=0||t>9)throw Error(`MOVEの移動先は2/4/6/8で指定してください!`);return this.generator.wwa.movePlayer(t),this.generator.wwa.movePlayer(t),0}case`PARTS_MOVE`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));return this.generator.wwa.setMoveMacroWaitingToPlayer(t),0}case`IS_PLAYER_WAITING_MESSAGE`:return this.generator.wwa.isPlayerWaitingMessage();case`IS_MANUAL_PAUSE`:case`IS_PLAYER_WAITING_ENTER`:return this.generator.wwa.isManualPause();case`GET_UNIXTIME`:return Math.floor(new Date().getTime()/1e3);case`GET_DATE_YEAR`:return new Date().getFullYear();case`GET_DATE_MONTH`:return new Date().getMonth()+1;case`GET_DATE_DAY`:return new Date().getDate();case`GET_DATE_HOUR`:return new Date().getHours();case`GET_DATE_MINUTES`:return new Date().getMinutes();case`GET_DATE_SECONDS`:return new Date().getSeconds();case`GET_DATE_MILLISECONDS`:return new Date().getMilliseconds();case`GET_DATE_WEEKDAY`:return new Date().getDay();case`SHOW_USER_DEF_VAR`:console.log(this.generator.wwa.getAllUserNameVar());return;case`CHANGE_SYSMSG`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]),n=e.value.length>=2?this.evalWwaNode(e.value[1]):void 0,r=this.resolveSystemMessageKeyFromMacroArg(t);if(!r)throw Error(`このIDのシステムメッセージは未定義です。`);if(typeof n==`number`||typeof n==`string`||typeof n==`boolean`)this.generator.wwa.overwriteSystemMessage(r,String(n));else if(n==null)this.generator.wwa.overwriteSystemMessage(r,void 0);else throw Error(`この値は文字列に変換できないため、システムメッセージを表示できません。`);break}case`PICTURE`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=e.value.length>=2?this.evalWwaNode(e.value[1]):void 0;if(n===void 0){this.generator.wwa.deletePictureRegistry(t);return}if(n instanceof Map)this.generator.wwa.setPictureRegistryFromObject(t,d(n));else if(typeof n==`string`)this.generator.wwa.setPictureRegistryFromRawText(t,n);else throw Error(`ピクチャのプロパティ定義は文字列あるいはオブジェクトである必要があります。`);break}case`PICTURE_FROM_PARTS`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1]));if(n===0){this.generator.wwa.deletePictureRegistry(t);return}let r=e.value.length>=3?Number(this.evalWwaNode(e.value[2])):j.OBJECT;if(!Ss.includes(r))throw Error(`パーツ種別が不明です`);let i=this.generator.wwa.getGameStatus();this.generator.wwa.setPictureRegistry(t,n,r,i.playerCoord);break}case`CLEAR_ALL_PICTURES`:this.generator.wwa.clearAllPictures();break;case`HAS_PICTURE`:{this._checkArgsLength(1,e);let n=Number(this.evalWwaNode(e.value[0]));return t.wwaData.pictureRegistry.some(e=>e.layerNumber===n)}case`ABS`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));return Math.abs(t)}case`POW`:return this._checkArgsLength(2,e),Number(this.evalWwaNode(e.value[0]))**+Number(this.evalWwaNode(e.value[1]));case`SQRT`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));return Math.sqrt(t)}case`SIN`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=Math.sin(t*Math.PI/180);return Cs(n)?0:n}case`COS`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=Math.cos(t*Math.PI/180);return Cs(n)?0:n}case`TAN`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=Math.tan(t*Math.PI/180);return Cs(n)?0:n}case`GET_GAMEOVER_POS_X`:return this.generator.wwa.getGemeOverPosition().x;case`GET_GAMEOVER_POS_Y`:return this.generator.wwa.getGemeOverPosition().y;case`ABORT_BATTLE`:throw this.generator.state.battleDamageCalculation&&(this.generator.state.battleDamageCalculation.aborted=!0),new js(`ABORT_BATTLE`);case`EXIT`:throw new js(`EXIT`,this.evalWwaNode(e.value[0]));case`GET_IMG_POS_X`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=(e.value[1]===void 0?0:Number(this.evalWwaNode(e.value[1])))===0?j.OBJECT:j.MAP;if(n===j.OBJECT){let n=e.value[2]===void 0?!0:Number(this.evalWwaNode(e.value[2]))===0,r=this.generator.wwa.getObjectInfo(t),i=n?r[R.ATR_X]:r[R.ATR_X2];return Math.floor(i/R.CHIP_SIZE)}else if(n===j.MAP){let e=this.generator.wwa.getMapInfo(t)[R.ATR_X];return Math.floor(e/R.CHIP_SIZE)}throw Error(`GET_IMG_POS_X: 指定したIDのパーツのTypeが異常です。`)}case`GET_IMG_POS_Y`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=(e.value[1]===void 0?0:Number(this.evalWwaNode(e.value[1])))===0?j.OBJECT:j.MAP;if(n===j.OBJECT){let n=e.value[2]===void 0?!0:Number(this.evalWwaNode(e.value[2]))===0,r=this.generator.wwa.getObjectInfo(t),i=n?r[R.ATR_Y]:r[R.ATR_Y2];return Math.floor(i/R.CHIP_SIZE)}else if(n===j.MAP){let e=this.generator.wwa.getMapInfo(t)[R.ATR_Y];return Math.floor(e/R.CHIP_SIZE)}throw Error(`GET_IMG_POS_Y: 指定したIDのパーツのTypeが異常です。`)}case`LENGTH`:return this._checkArgsLength(1,e),ws(this.evalWwaNode(e.value[0]));case`IS_NUMBER`:return this._checkArgsLength(1,e),typeof this.evalWwaNode(e.value[0])==`number`;case`MANUAL_PAUSE`:case`WAIT_ENTER`:this.generator.wwa.manualPause({functionNames:{cancelPause:e.value[0]?this.evalWwaNode(e.value[0]):``,up:e.value[1]?this.evalWwaNode(e.value[1]):``,down:e.value[2]?this.evalWwaNode(e.value[2]):``,right:e.value[3]?this.evalWwaNode(e.value[3]):``,left:e.value[4]?this.evalWwaNode(e.value[4]):``}});return;case`COLOR`:{this._checkArgsLength(4,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=Number(this.evalWwaNode(e.value[2])),i=Number(this.evalWwaNode(e.value[3]));if(t<0||t>5)throw Error(`種別は0から5までです`);if(n<0||n>255||r<0||r>255||i<0||i>255)throw Error(`色が範囲外です`);this.generator.wwa.changeStyleRule(t,n,r,i);return}case`EFFITEM`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);this.generator.wwa.updateItemEffectEnabled(t);return}case`CHANGE_BOM_IMAGE`:case`CHANGE_BOM_IMG`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1]));if(t<0||n<0)throw Error(`座標は0以上の整数ではありません`);this.generator.wwa.setBattleEffectCoord(new S(t,n));return}case`CHANGE_CLICK_IMAGE`:case`CHANGE_CLICK_IMG`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1]));if(t<0||n<0)throw Error(`引数が0以上の整数ではありません`);this.generator.wwa.setImgClick(new S(t,n));return}case`CHANGE_FRAME_IMAGE`:case`CHANGE_FRAME_IMG`:{this._checkArgsLength(3,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=Number(this.evalWwaNode(e.value[2]));if(n<0||r<0)throw Error(`座標は正でなければなりません。`);switch(t){case L.ENERGY:case L.STRENGTH:case L.DEFENCE:case L.GOLD:this.generator.wwa.setStatusIconCoord(t,new S(n,r));break;case L.WIDE_CELL_ROW:this.generator.wwa.setWideCellCoord(new S(n,r));break;case L.ITEM_BG:this.generator.wwa.setItemboxBackgroundPosition({x:n,y:r});break;case L.MAIN_FRAME:this.generator.wwa.setFrameCoord(new S(n,r));break;default:throw Error(`種別が不正です。`)}return}case`CHANGE_YESNO_IMAGE`:case`CHANGE_YESNO_IMG`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1]));this.generator.wwa.setYesNoImgCoord(new S(t,n));return}case`NO_GAMEOVER`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);this.generator.wwa.setGameOverPolicy(t);return}case`DEFAULT`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);this.generator.wwa.setObjectNotCollapseOnPartsOnPlayer(t);return}case`DIR_MAP`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=e.value[2]===void 0?j.OBJECT:Number(this.evalWwaNode(e.value[2]));if(t<0)throw Error(`パーツ番号が不正です`);if(r===j.OBJECT){if(t>=this.generator.wwa.getObjectPartsNum())throw Error(`パーツ番号が不正です`)}else if(t>=this.generator.wwa.getMapPartsNum())throw Error(`パーツ番号が不正です`);this.generator.wwa.appearPartsByDirection(n,t,r);return}case`CHANGE_SOUND_DECISION`:if(this.generator.wwa.getSoundEnabled()){this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);this.generator.wwa.checkSoundEnabled(t),this.generator.wwa.setDecisionSound(t)}return;case`CHANGE_SOUND_ATTACK`:if(this.generator.wwa.getSoundEnabled()){this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);this.generator.wwa.checkSoundEnabled(t),this.generator.wwa.setAttackSound(t)}return;default:throw Error(`未定義の関数が指定されました: `+e.functionName)}}resolveSystemMessageKeyFromMacroArg(e){if(typeof e==`string`)return v(e)?e:void 0;if(typeof e==`number`)return y(e)}partsAssignment(e){let t=this.generator.wwa.getGameStatus(),n=this.evalWwaNode(e.destinationX),r=this.evalWwaNode(e.destinationY);if(typeof n!=`number`||typeof r!=`number`)throw Error(`座標は数値で指定してください (${n}, ${r})`);new C(this.generator.wwa,n,r);let i=e.partsKind===`map`?j.MAP:j.OBJECT,a=this.resolveParts(i,n,r),o=this.evalWwaNode(e.value);switch(e.operator){case`=`:case`+=`:case`-=`:case`*=`:case`/=`:{let s=Ds[e.operator](a,o)|0;if(s<0)throw Error(`負値のパーツ番号 ${s} は代入できません`);this.generator.wwa.appearPartsEval(t.playerCoord,`${n}`,`${r}`,s,i);break}default:throw Error(`演算子 ${e.operator} は partsAssignment では使えません`)}}resolveParts(e,t,n){let r=this.generator.wwa.getGameStatus();switch(e){case j.MAP:return r.wwaData.map[n][t];case j.OBJECT:return r.wwaData.mapObject[n][t];default:throw Error(`存在しないPartsTypeです`,e)}}blockStatement(e){return this.evalWwaNodes(e.value)}ifStatement(e){if(this.evalWwaNode(e.test))return this.evalWwaNode(e.consequent);if(e.alternate)return this.evalWwaNode(e.alternate)}convertConditionalExpression(e){let t=this.evalWwaNode(e.test)?e.consequent:e.alternate;return this.evalWwaNode(t)}property(e){let t=this.evalWwaNode(e.key);if(!f(t))throw Error(`オブジェクトのキーはプリミティブ値でなければなりません。: ${t}`);return[String(this.evalWwaNode(e.key)),this.evalWwaNode(e.value)]}objectExpression(e){let t=e.properties.map(e=>this.evalWwaNode(e));return new Map(t)}arrayExpression(e){return e.elements.map(e=>this.evalWwaNode(e))}convertLoopPointerExpression(e){let t=this.evalWwaNode(e.value),n=this.evalWwaNode(e.index);switch(e.operator){case`+=`:this.for_id.LP[n]=t;break;case`-=`:this.for_id.LP[n]=t;break;case`/=`:this.for_id.LP[n]=t;break;case`*=`:this.for_id.LP[n]=t;break;default:this.for_id.LP[n]=t;break}return 0}itemAssignment(e){let t=this.evalWwaNode(e.itemBoxPosition1to12);if(typeof t!=`number`||t<0||t>12)throw Error(`ITEMの添字に想定外の値が入っています。0以上12以下の添字を指定してください。: `+t);let n=this.evalWwaNode(e.value);switch(e.operator){case`=`:this.generator.wwa.setPlayerGetItem(t,n|0);break;case`+=`:case`-=`:case`*=`:case`/=`:{if(t===0)throw Error(`複合代入では ITEM[0] への操作はできません`);let r=this.generator.wwa.getGameStatus().itemBox[t-1],i=Ds[e.operator](r,n)|0;if(i<0)throw Error(`負値のパーツ番号 ${i} は代入できません`);this.generator.wwa.setPlayerGetItem(t,i);break}default:throw Error(`演算子 ${e.operator} は itemAssignment では使えません`)}}evalMessage(e){let t=this.evalWwaNode(e.value),n=this.generator.pickPageAdditionalQueue();this.generator.wwa.handleMsgFunction({message:String(t),additionalItems:n})}evalJumpgate(e){let t=this.evalWwaNode(e.x),n=this.evalWwaNode(e.y);if(isNaN(t)||isNaN(n))throw Error(`飛び先の値が数値になっていません。 x=${t} / y=${n}`);this.generator.wwa.forcedJumpGate(t,n)}evalRandom(e){let t=this.evalWwaNode(e.value);return Math.floor(Math.random()*t)}evalSetSpecialParameter(e){let t=this.evalWwaNode(e.value);if(!this.generator.wwa||isNaN(t))return t;let n=this.evalSymbol({type:`Symbol`,name:e.kind});if(Array.isArray(n))throw Error(`配列Objectに対して直接代入は出来ません: ${n}`);let r=(()=>{switch(e.operator){case`+=`:return n+t;case`-=`:return n-t;case`*=`:return n*t;case`/=`:return n/t;default:return t}})();switch(e.kind){case`PX`:return this.generator.wwa.jumpSpecifiedXPos(r),r;case`PY`:return this.generator.wwa.jumpSpecifiedYPos(r),r;case`AT`:return this.generator.wwa.setPlayerStatus(ue.STRENGTH,r,!1),r;case`DF`:return this.generator.wwa.setPlayerStatus(ue.DEFENCE,r,!1),r;case`GD`:return this.generator.wwa.setPlayerStatus(ue.GOLD,r,!1),r;case`HP`:return this.generator.wwa.setPlayerStatus(ue.ENERGY,r,!1),r;case`HPMAX`:return this.generator.wwa.setPlayerEnergyMax(r),r;case`i`:return this.for_id.i=this.evalWwaNode(e.value),this.for_id.i;case`j`:return this.for_id.j=this.evalWwaNode(e.value),this.for_id.j;case`k`:return this.for_id.k=this.evalWwaNode(e.value),this.for_id.k;case`LOOPLIMIT`:{let t=this.evalWwaNode(e.value);return this.generator.updateLoopLimit(t),t}default:console.error(`未実装の要素です: `+e.kind);return}}evalSetUserVariable(e){if(e.index.length>1){let t=this.evalWwaNode(e.value),n=e.index.map(e=>this.evalWwaNode(e));this.generator.wwa.setUserVarIndecies(n,t,e.operator);return}else{let t=this.evalWwaNode(e.value);if(!this.generator.wwa)return t;let n=this.evalWwaNode(e.index[0]);return this.generator.wwa.setUserVar(n,t,e.operator),t}}evalUnaryOperation(e){switch(e.operator){case`+`:return this.evalWwaNode(e.argument);case`-`:return-this.evalWwaNode(e.argument);case`!`:return!this.evalWwaNode(e.argument);default:throw Error(`存在しない単項演算子です`)}}evalBinaryOperation(e){let t=this.evalWwaNode(e.left),n=this.evalWwaNode(e.right);switch(e.operator){case`+`:return t+n;case`-`:return t-n;case`*`:return t*n;case`/`:return n===0?0:Math.floor(t/n);case`%`:return n===0?0:t%n;case`>`:return t>n;case`>=`:return t>=n;case`<`:return t<n;case`<=`:return t<=n;case`==`:return t==n;case`!=`:return t!=n;default:throw Error(`存在しない単項演算子です`)}}evalSymbol(e){let t=this.generator.wwa.getGameStatus(),n=this.generator.wwa.getEnemyStatus();switch(e.name){case`X`:return this.generator.state.triggerParts?.position.x??t.playerCoord.x;case`Y`:return this.generator.state.triggerParts?.position.y??t.playerCoord.y;case`ID`:return this.generator.state.triggerParts?.id??-1;case`TYPE`:return this.generator.state.triggerParts?.type??-1;case`PX`:return t.playerCoord.x;case`PY`:return t.playerCoord.y;case`CX`:return t.cameraCoord.x;case`CY`:return t.cameraCoord.y;case`AT`:return t.bareStatus.strength;case`AT_TOTAL`:return this.generator.state.battleDamageCalculation?.estimatingParams?.playerStatus.strength??t.totalStatus.strength;case`DF`:return t.bareStatus.defence;case`DF_TOTAL`:return this.generator.state.battleDamageCalculation?.estimatingParams?.playerStatus.defence??t.totalStatus.defence;case`GD`:return this.generator.state.battleDamageCalculation?.estimatingParams?.playerStatus.gold??t.totalStatus.gold;case`HP`:return this.generator.state.battleDamageCalculation?.estimatingParams?.playerStatus.energy??t.totalStatus.energy;case`HPMAX`:return t.energyMax;case`STEP`:return t.moveCount;case`TIME`:return t.playTime;case`PDIR`:return t.playerDirection;case`i`:return this.for_id.i;case`j`:return this.for_id.j;case`k`:return this.for_id.k;case`LOOPLIMIT`:return this.generator.loop_limit;case`ITEM_ID`:return this.generator.state.earnedItem?.partsId??-1;case`ITEM_POS`:return this.generator.state.earnedItem?.itemPos1To12??-1;case`ENEMY_HP`:return this.generator.state.battleDamageCalculation?.estimatingParams?.enemyStatus.energy??(typeof n==`number`?-1:n.energy);case`ENEMY_AT`:return this.generator.state.battleDamageCalculation?.estimatingParams?.enemyStatus.strength??(typeof n==`number`?-1:n.strength);case`ENEMY_DF`:return this.generator.state.battleDamageCalculation?.estimatingParams?.enemyStatus.defence??(typeof n==`number`?-1:n.defence);case`ENEMY_GD`:return this.generator.state.battleDamageCalculation?.estimatingParams?.enemyStatus.gold??(typeof n==`number`?-1:n.gold);case`PICTURE`:throw Error(`この機能はまだ実装されていません!`);case`PLAYER_PX`:return Ts(t.playerCoord.x,t.cameraCoord.x);case`PLAYER_PY`:return Es(t.playerCoord.y,t.cameraCoord.y);case`MOVE_SPEED`:return de[t.gameSpeedIndex];case`MOVE_FRAME_TIME`:return R.CHIP_SIZE/de[t.gameSpeedIndex];case`LP`:return this.for_id.LP;case`undefined`:return;default:throw Error(`このシンボルは取得できません`)}}evalArrayOrObject1D(e){let t=this.evalWwaNode(e.indecies[0]);if(typeof t!=`number`)switch(e.name){case`v`:return this.generator.wwa.getUserNameVar(t);default:throw Error(`このシンボルは取得できません`)}let n=this.generator.wwa.getGameStatus();switch(e.name){case`v`:return this.generator.wwa.getUserVar(t);case`ITEM`:if(t<1||t>12)throw Error(`ITEMの添字に想定外の値が入っています。1以上12以下の添字を指定してください。: `+t);return n.itemBox[t-1];case`PICTURE`:throw Error(`この機能はまだ実装されていません!`);case`LP`:return this.for_id.LP[t];default:throw Error(`このシンボルは取得できません`)}}evalArrayOrObject2D(e){switch(e.name){case`m`:case`o`:let t=this.evalWwaNode(e.indecies[0]),n=this.evalWwaNode(e.indecies[1]);if(typeof t!=`number`||typeof n!=`number`)throw Error(`座標は数値で指定してください (${t}, ${n})`);new C(this.generator.wwa,t,n);let r=e.name===`o`?j.OBJECT:j.MAP;return this.generator.wwa.getPartsID(new S(t,n),r);case`v`:{let t=e.indecies[0].value,n=this.generator.wwa.getUserNameVar(t);if(n===null||!Array.isArray(n)&&typeof n!=`object`&&typeof n!=`string`)throw Error(`指定したユーザー定義変数: v["${t}"] は配列・オブジェクト・文字列ではありません`);return Ke(n,this.evalWwaNode(e.indecies[1]))}default:throw Error(`このシンボルは取得できません`)}}evalArrayOrObject3DPlus(e){let t=e.indecies.map(e=>this.evalWwaNode(e)),n=this.generator.wwa.getUserNameVar(t[0]);return t.slice(1).reduce((e,t)=>Ke(e,t),n)}evalLiteral(e){return e.value}},As=class{constructor(e){this.value=e}},js=class{constructor(e,t){this.reason=e,this.value=t}};function Ms(e){return Go(e,{ecmaVersion:2020})}var Ns=async e=>{try{let t=await fetch(e);return t.status===200||t.status===304?{kind:`data`,data:await new Response(t.body).text(),fileName:e}:{kind:`httpError`,errorMessage:`ファイル ${e} が読み込めませんでした。ステータスコード: ${t.status}`,fileName:e}}catch(t){return{kind:`otherError`,errorMessage:t.message,fileName:e}}},Ps=`user-variable-label`;function Fs(){let e=document.createElement(`div`);return e.textContent=`-`,e.setAttribute(`aria-hidden`,`true`),e.classList.add(Ps),e}function Is(e,t){e.textContent!==t&&(e.textContent=t)}var Ls=`-`,Rs=`user-variable-card`,zs=`user-variable-card--is-trimmed`;function Bs({index:e,value:t}){let n=document.createElement(`div`);n.classList.add(Rs),Gs(t)&&n.classList.add(zs),n.dataset.varIndex=String(e);let{cardIndexElement:r,cardIndexLabelElement:i}=Vs(e),a=Hs(t);return n.appendChild(r),n.appendChild(a),{cardElement:n,cardIndexElement:r,cardIndexLabelElement:i,cardValueElement:a}}function Vs(e){let t=document.createElement(`div`);t.classList.add(`index`),t.textContent=String(e),typeof e==`string`&&t.setAttribute(`title`,e);let n=Fs();return t.appendChild(n),{cardIndexElement:t,cardIndexLabelElement:n}}function Hs(e){let t=document.createElement(`div`);return t.classList.add(`value`),typeof e==`string`&&t.setAttribute(`title`,Ge(e)),Ws(t,e),t}function Us(e,t){e.dataset.labelledVarIndex=`true`,e.addEventListener(`mouseover`,()=>t.removeAttribute(`aria-hidden`)),e.addEventListener(`mouseleave`,()=>t.setAttribute(`aria-hidden`,`true`))}function Ws(e,t){let n=Ge(t);e.textContent!==n&&(e.textContent=t===void 0?Ls:Ge(t))}function Gs(e){return typeof e!=`object`}var Ks=`user-variable-list`;function qs({kind:e,elementStore:t}){let n=document.createElement(`ul`);return n.classList.add(Ks),e===`numbered`&&Array.from({length:R.USER_VAR_NUM}).map((e,n)=>Js({elementStore:t,index:n})).forEach(e=>n.appendChild(e)),n}function Js({elementStore:e,index:t,value:n}){let r=document.createElement(`li`),i=Bs({index:t,value:n});return e.updateUserVarElementInfo(t,i),r.appendChild(i.cardElement),r}function Ys(e,t,{index:n,value:r}){t.appendChild(Js({elementStore:e,index:n,value:r}))}var Xs=`information`;function Zs(){let e=document.createElement(`p`);return e.classList.add(Xs),Qs(e,`強調されている番号にカーソルを乗せると説明が表示されます。`),e}function Qs(e,t,n=!1){e.textContent=`${n?`【エラー】`:``}${t}`}function $s({elementStore:e,heading:t,contentVisibilityToggleButton:n,information:r}){let i=document.createElement(`header`);if(i.appendChild(tc({heading:t,contentVisibilityToggleButton:n})),r){let t=Zs();i.appendChild(t),e.updateNamedUserVarInformationElement(t)}return i}function ec(e,t){e.textContent=t?`▲隠す`:`▼表示`}function tc({heading:e,contentVisibilityToggleButton:t}){let n=document.createElement(`div`);n.classList.add(`heading-area`);let r=document.createElement(`h2`);r.textContent=e.text,n.appendChild(r);let i=document.createElement(`button`);return i.classList.add(`content-visibility-toggle-button`),ec(i,!0),t.onClick&&i.addEventListener(`click`,t.onClick.bind(i)),n.appendChild(i),n}var nc=`user-variable-list-section`;function rc({kind:e,elementStore:t}){let n=document.createElement(`section`);n.classList.add(nc),n.dataset.kind=e;let r=qs({kind:e,elementStore:t});t.updateUserVarListElement(e,r);let i=$s({elementStore:t,heading:{text:e===`named`?`名前つき変数一覧`:`変数一覧`},information:(e===`numbered`||void 0)&&{},contentVisibilityToggleButton:{onClick:e=>{let n=t.getNamedUserVarInformationElement();n&&(r.getAttribute(`aria-hidden`)===`true`?ic(r,n,e.target):ac(r,n,e.target))}}});return n.appendChild(i),n.appendChild(r),t.updateUserVarListElement(e,r),n}function ic(e,t,n){e.removeAttribute(`aria-hidden`),t instanceof HTMLElement&&t.removeAttribute(`aria-hidden`),n instanceof HTMLElement&&ec(n,!0)}function ac(e,t,n){e.setAttribute(`aria-hidden`,`true`),t instanceof HTMLElement&&t.setAttribute(`aria-hidden`,`true`),n instanceof HTMLElement&&ec(n,!1)}function oc(){let e=new Map,t=new Map,n=new Map,r=null;return{getAllNamedUserVarIndeciesSet:()=>new Set(t.keys()),updateUserVarElementInfo:(n,r)=>{if(typeof n==`number`)e.set(n,r);else if(typeof n==`string`)t.set(n,r);else throw TypeError(`Invalid index: ${n}`)},getUserVarElementInfo:n=>{if(typeof n==`number`)return e.get(n);if(typeof n==`string`)return t.get(n);throw TypeError(`Invalid index: ${n}`)},deleteUserVarElementInfo:n=>{if(typeof n==`number`)e.delete(n);else if(typeof n==`string`)t.delete(n);else throw TypeError(`Invalid index: ${n}`)},getUserVarListElement:e=>n.get(e),updateUserVarListElement:(e,t)=>{n.set(e,t)},deleteUserVarListElement:e=>{n.delete(e)},getNamedUserVarInformationElement:()=>r,updateNamedUserVarInformationElement:e=>{r=e},deleteNamedUserVarInformationElement:()=>{r=null},dispose:()=>{e.clear(),t.clear(),n.clear(),r=null}}}function sc(e,t){let n=e.getAllNamedUserVarIndeciesSet(),r=e.getUserVarListElement(`named`);for(let[i,a]of t){let t=e.getUserVarElementInfo(i)?.cardValueElement;n.delete(i),t?Ws(t,a):Ys(e,r,{index:i,value:a})}for(let t of n){let n=e.getUserVarElementInfo(t)?.cardElement.parentElement;n instanceof HTMLLIElement&&(e.getUserVarListElement(`named`)?.removeChild(n),e.deleteUserVarElementInfo(t))}}function cc(e,t){Array.from({length:R.USER_VAR_NUM}).map((n,r)=>{let i=e.getUserVarElementInfo(r)?.cardValueElement;i&&Ws(i,t[r])})}function lc(e,t){Array.from({length:R.USER_VAR_NUM}).map((n,r)=>{let i=t[r];if(!i)return;let a=e.getUserVarElementInfo(r);if(!a)return;let o=a.cardIndexElement,s=a.cardIndexLabelElement;Is(s,i),Us(o,s)})}function uc(e,t,n=!1){Qs(e.getNamedUserVarInformationElement(),t,n)}var dc=`wwa-vardump-wrapper`;function fc(e){let t=Le(e),n=oc();return t instanceof HTMLElement?(t.classList.add(dc),t.appendChild(rc({kind:`named`,elementStore:n})),t.appendChild(rc({kind:`numbered`,elementStore:n})),{updateAllVariables:({namedUserVar:e,userVar:t})=>{e&&sc(n,e),t&&cc(n,t)},numberedUserVariable:{updateValues:e=>cc(n,e),updateLabels:e=>lc(n,e),updateInformation:(e,t=!1)=>uc(n,e,t)},namedUserVariable:{updateValues:e=>sc(n,e)}}):null}function pc(){return{mapdata:``,urlGateEnable:!1,titleImg:void 0,audioDir:`./audio/`,classicModeEnable:!1,itemEffectEnable:!0,useGoToWwa:!1,lookingAround:!1,autoSave:!0,disallowLoadOldSave:!1,resumeSaveData:void 0,varDump:null,userVarNamesFile:void 0,displayUserVars:!1,virtualPadEnable:!1,virtualPadViewportFitEnable:!1,virtualPadControllerElm:void 0,userDefinedScriptsFile:`./script/script_file_list.json`}}var mc;function hc(e,t,n){var r=new ge;return r.current=e,r.total=t,r.stage=n,r}var gc=class{constructor(e=pc()){this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0,this._windowCloseWaitingMessageDisplayRequests=[],this._playerAndObjectsStopWaitingMessageDisplayRequests=[],this._windowCloseWaitingJumpGateRequest=void 0,this._debugConsoleElement=void 0,this.audioExtension=``,this.soundLoadedCheckTimer=void 0,this._playTimeCalculator=void 0,this._varDump=null,this.userDefinedFunctions={},this.convertWwaNodes=e=>qo(Ms(e)),this.mainCaller=()=>this._main(),this.soundCheckCaller=()=>this.checkAllSoundLoaded(),this._checkTurnKeyPressed=()=>this._keyStore.checkHitKey(V.KEY_ESC)||this._keyStore.checkHitKey(V.KEY_SHIFT)||this._keyStore.checkHitKey(V.KEY_N),this._saveDataList=[],this.wwaCustomEventEmitter=new Zi(U(`wwa-wrapper`));let t;window.addEventListener(`click`,e=>{this._isActive=!1}),U(`wwa-wrapper`).addEventListener(`click`,e=>{e.stopPropagation(),this._isActive=!0}),this._isActive=!0,e.titleImg===void 0?(this._hasTitleImg=!1,this._cvsCover=U(`progress-panel`),t=this._cvsCover.getContext(`2d`),t.fillStyle=`rgb(0, 0, 0)`):this._hasTitleImg=!0;try{this._hasTitleImg?(U(`unstable-version-warning`).textContent=`この WWA Wing は [不安定版] です。`,U(`version`).textContent=`WWA Wing Ver.4.0.6`):this._setLoadingMessage(t,0)}catch{}this._varDump=e.varDump;let n=window.AudioContext||window.webkitAudioContext;n&&(this.audioContext=new n,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));let r=new Audio;if(r.canPlayType(`audio/mpeg`)!==`no`&&r.canPlayType(`audio/mpeg`)!==``?this.audioExtension=`mp3`:this.audioExtension=`m4a`,this._isURLGateEnable=e.urlGateEnable,this._isClassicModeEnable=e.classicModeEnable,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new x(0,0,0,0),e.audioDir?e.audioDir[e.audioDir.length-1]!==`/`&&(e.audioDir+=`/`):e.audioDir=`./audio/`,this._audioDirectory=e.audioDir,this._bottomButtonType=e.useGoToWwa?T.GOTO_WWA:T.BATTLE_REPORT,this._userVarNameList=[],this.evalCalcWwaNodeGenerator=new Os(this),this.userDevice=new M,location.href.match(/^file/))switch(this.userDevice.device){case re.GAME:switch(this.userDevice.os){case ne.NINTENDO:R.BATTLE_INTERVAL_FRAME_NUM=5;break}this._bottomButtonType=T.GAME_END;break;default:alert(`【警告】直接HTMLファイルを開いているようです。
93
+ `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Wo(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(e){var n=this.pos-1;return this.invalidStringToken(n,`Invalid escape sequence in template string`),null}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return va(t)?``:String.fromCharCode(t)}},Q.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Q.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(da(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?ua:da)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Wo(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Q.readWord=function(){var e=this.readWord1(),t=J.name;return this.keywords.test(e)&&(t=ha[e]),this.finishToken(t,e)},Ya.acorn={Parser:Ya,version:`7.4.1`,defaultOptions:Aa,Position:Da,SourceLocation:Oa,getLineInfo:ka,Node:fo,TokenType:K,tokTypes:J,keywordTypes:ha,TokContext:ho,tokContexts:go,isIdentifierChar:da,isIdentifierStart:ua,Token:Vo,isNewLine:va,lineBreak:ga,lineBreakG:_a,nonASCIIwhitespace:ya};function Ko(e,t){return Ya.parse(e,t)}function qo(e){return[`ArrayOrObject1D`,`ArrayOrObject2D`,`ArrayOrObject3DPlus`,`Literal`,`Symbol`,`UnaryOperation`,`BinaryOperation`,`Random`,`CallDefinedFunction`,`AnyFunction`,`ConditionalExpression`,`ArrayExpression`,`ObjectExpression`].includes(e.type)}function Jo(e){return e.type===`Program`?e.body.map(e=>$(e)):[$(e)]}function $(e){switch(e.type){case`Program`:return ds(e);case`ExpressionStatement`:return fs(e);case`AssignmentExpression`:return ps(e);case`MemberExpression`:return gs(e);case`UnaryExpression`:return ms(e);case`BinaryExpression`:return hs(e);case`Identifier`:return _s(e);case`Literal`:return vs(e);case`CallExpression`:return os(e);case`IfStatement`:return as(e);case`BlockStatement`:return is(e);case`FunctionDeclaration`:return Yo(e);case`ForStatement`:return rs(e);case`BreakStatement`:return ts(e);case`ReturnStatement`:return ns(e);case`ContinueStatement`:return es(e);case`UpdateExpression`:return Xo(e);case`LogicalExpression`:return Zo(e);case`TemplateLiteral`:return Qo(e);case`TemplateElement`:return $o(e);case`ConditionalExpression`:return ys(e);case`Property`:return bs(e);case`ObjectExpression`:return xs(e);case`ArrayExpression`:return Ss(e);default:throw console.log(e),Error(`未定義の AST ノードです :`+e.type)}}function Yo(e){return{type:`DefinedFunction`,functionName:e.id.name,body:$(e.body)}}function Xo(e){return{type:`UpdateExpression`,operator:e.operator,argument:$(e.argument)}}function Zo(e){return{type:`LogicalExpression`,operator:e.operator,left:$(e.left),right:$(e.right)}}function Qo(e){return{type:`TemplateLiteral`,expressions:e.expressions.map(e=>$(e)),quasis:e.quasis.map(e=>$(e))}}function $o(e){return{type:`TemplateElement`,value:e.value}}function es(e){return{type:`Continue`,label:e.label}}function ts(e){return{type:`Break`,label:e.label}}function ns(e){return{type:`Return`,argument:$(e.argument)}}function rs(e){return{type:`ForStatement`,body:e.body.body.map(e=>$(e)),init:$(e.init),test:$(e.test),update:$(e.update)}}function is(e){return{type:`BlockStatement`,value:e.body.map(e=>$(e))}}function as(e){return{type:`IfStatement`,consequent:$(e.consequent),test:$(e.test),alternate:e.alternate?$(e.alternate):void 0}}function os(e){let t=e.callee.name;switch(t){case`RAND`:return us(e.arguments);case`JUMPGATE`:return ls(e.arguments);case`MSG`:case`MESSAGE`:return cs(e.arguments);case`MUSIC`:case`SOUND`:case`BGM_STOP`:case`STOP_BGM`:case`SOUND_STOP`:case`STOP_SOUND`:case`ALL_SOUND_STOP`:case`STOP_ALL_SOUND`:case`SAVE`:case`LOG`:case`ABLE_CHANGE_SPEED`:case`SET_SPEED`:case`CHANGE_GAMEOVER_POS`:case`DEL_PLAYER`:case`RESTART_GAME`:case`URL_JUMPGATE`:case`HIDE_STATUS`:case`PARTS`:case`FACE`:case`EFFECT`:case`CHANGE_PLAYER_IMAGE`:case`CHANGE_PLAYER_IMG`:case`HAS_ITEM`:case`REMOVE_ITEM`:case`MOVE`:case`PARTS_MOVE`:case`IS_PLAYER_WAITING_MESSAGE`:case`IS_MANUAL_PAUSE`:case`IS_PLAYER_WAITING_ENTER`:case`GET_UNIXTIME`:case`GET_DATE_YEAR`:case`GET_DATE_MONTH`:case`GET_DATE_DAY`:case`GET_DATE_HOUR`:case`GET_DATE_MINUTES`:case`GET_DATE_SECONDS`:case`GET_DATE_MILLISECONDS`:case`GET_DATE_WEEKDAY`:case`CHANGE_SYSMSG`:case`PICTURE`:case`PICTURE_FROM_PARTS`:case`CLEAR_ALL_PICTURES`:case`HAS_PICTURE`:case`SHOW_USER_DEF_VAR`:case`ABS`:case`POW`:case`SQRT`:case`SIN`:case`COS`:case`TAN`:case`GET_GAMEOVER_POS_X`:case`GET_GAMEOVER_POS_Y`:case`ABORT_BATTLE`:case`EXIT`:case`GET_IMG_POS_X`:case`GET_IMG_POS_Y`:case`LENGTH`:case`IS_NUMBER`:case`MANUAL_PAUSE`:case`WAIT_ENTER`:case`CANCEL_MANUAL_PAUSE`:case`CANCEL_WAIT_ENTER`:case`COLOR`:case`EFFITEM`:case`CHANGE_BOM_IMG`:case`CHANGE_BOM_IMAGE`:case`CHANGE_CLICK_IMAGE`:case`CHANGE_CLICK_IMG`:case`CHANGE_FRAME_IMAGE`:case`CHANGE_FRAME_IMG`:case`CHANGE_YESNO_IMAGE`:case`CHANGE_YESNO_IMG`:case`NO_GAMEOVER`:case`DEFAULT`:case`DIR_MAP`:case`CHANGE_SOUND_ATTACK`:case`CHANGE_SOUND_DECISION`:return ss(e.arguments,t);default:return{type:`CallDefinedFunction`,functionName:t}}}function ss(e,t){return{type:`AnyFunction`,functionName:t,value:e.map(e=>$(e))}}function cs(e){return{type:`Msg`,value:$(e[0])}}function ls(e){if(e.length<2)throw Error(`RAND関数には引数が2つ必要です。`);let t={x:e[0],y:e[1]};return{type:`Jumpgate`,x:$(t.x),y:$(t.y)}}function us(e){if(e.length<1)throw Error(`RAND関数には引数が必要です。`);return{type:`Random`,value:$(e[0])}}function ds(e){if(e.body.length!==1)throw Error(`bodyが1以外の場合評価できません。`);return $(e.body[0])}function fs(e){return $(e.expression)}function ps(e){let t=$(e.left),n=$(e.right);if(!qo(n))throw Error(`値以外を代入式の右辺に設定できません`);switch(e.operator){case`=`:case`+=`:case`-=`:case`*=`:case`/=`:if(t.type===`ArrayOrObject2D`){if(t.name===`m`||t.name===`o`)return{type:`PartsAssignment`,partsKind:t.name===`m`?`map`:`object`,destinationX:t.indecies[0],destinationY:t.indecies[1],value:n,operator:e.operator};if(t.name===`v`)return{type:`UserVariableAssignment`,index:[t.indecies[0],t.indecies[1]],value:n,operator:e.operator};throw Error(`想定していない記号が2次元配列ででてきました`)}else if(t.type===`ArrayOrObject1D`){if(t.name===`ITEM`)return{type:`ItemAssignment`,itemBoxPosition1to12:t.indecies[0],value:n,operator:e.operator};if(t.name===`v`)return{type:`UserVariableAssignment`,index:[t.indecies[0]],value:n,operator:e.operator};if(t.name===`LP`)return{type:`LoopPointerAssignment`,index:t.indecies[0],value:n,operator:e.operator};throw Error(`1次元配列にて想定していないシンボルが指定されました ${t.name}`)}else if(t.type===`Symbol`){if(t.name===`m`||t.name===`o`||t.name===`v`||t.name===`ITEM`||t.name===`X`||t.name===`Y`||t.name===`ID`||t.name===`TYPE`||t.name===`CX`||t.name===`CY`||t.name===`PICTURE`||t.name===`PLAYER_PX`||t.name===`PLAYER_PY`||t.name===`MOVE_SPEED`||t.name===`MOVE_FRAME_TIME`||t.name===`LP`||t.name===`undefined`)throw Error(`このシンボルには代入できません`);if(t.name===`AT_TOTAL`)throw Error(`"装備品込みの攻撃力(AT_TOTAL)への代入はできません。"`);if(t.name===`DF_TOTAL`)throw Error(`"装備品込みの防御力(DF_TOTAL)への代入はできません。"`);if(t.name===`ENEMY_HP`||t.name===`ENEMY_AT`||t.name===`ENEMY_DF`||t.name===`ENEMY_GD`)throw Error(`敵ステータス (ENEMY_HP, ENEMY_AT, ENEMY_DF, ENEMY_GD) への代入はできません。`);return{type:`SpecialParameterAssignment`,kind:t.name,value:n,operator:e.operator}}else if(t.type===`Literal`)throw Error(`数値には代入できません`);else if(t.type===`ArrayOrObject3DPlus`&&t.name===`v`)return{type:`UserVariableAssignment`,index:t.indecies,value:n,operator:e.operator};else throw Error(`代入できません`);default:throw Error(`想定していないオペレーターです`)}}function ms(e){let t=$(e.argument);if(![`+`,`-`,`!`].includes(e.operator))throw Error(`未定義の演算子です :`+e.operator);if(!qo(t))throw Error(`単項演算子が適用できません`);return{type:`UnaryOperation`,operator:e.operator,argument:t}}function hs(e){let t=$(e.left),n=$(e.right);if(!qo(t)||!qo(n))throw Error(`左辺または右辺が評価不能です`);switch(e.operator){case`+`:case`-`:case`*`:case`/`:case`%`:case`>`:case`<`:case`>=`:case`<=`:case`==`:case`!=`:return{type:`BinaryOperation`,operator:e.operator,left:t,right:n};default:throw Error(`未定義の演算子です :`+e.operator)}}function gs(e){let t=$(e.object),n=$(e.property);if(t.type===`Symbol`){if(![`v`,`m`,`o`,`ITEM`,`LP`,`PICTURE`].includes(t.name))throw Error(`このシンボルは配列にできません`);if(qo(n))return{type:`ArrayOrObject1D`,name:t.name,indecies:[n]};throw Error(`WWAでは存在しない構文です`)}else if(t.type===`ArrayOrObject1D`){if(t.name===`ITEM`||t.name===`PICTURE`)throw Error(`この配列は2次元以上にはできません。`);if(qo(n))return{type:`ArrayOrObject2D`,name:t.name,indecies:[...t.indecies,n]};throw Error(`WWAでは存在しない構文です`)}else if(t.type===`ArrayOrObject2D`||t.type===`ArrayOrObject3DPlus`){if(t.name===`m`||t.name===`o`)throw Error(`この配列は3次元以上にはできません。`);if(t.name===`v`&&qo(n))return{type:`ArrayOrObject3DPlus`,name:t.name,indecies:[...t.indecies,n]}}else throw Error(`WWAでは存在しない構文です`)}function _s(e){switch(e.name){case`m`:case`o`:case`ITEM`:case`X`:case`Y`:case`ID`:case`TYPE`:case`PX`:case`PY`:case`CX`:case`CY`:case`v`:case`HP`:case`HPMAX`:case`AT`:case`AT_TOTAL`:case`DF`:case`DF_TOTAL`:case`GD`:case`STEP`:case`TIME`:case`PDIR`:case`i`:case`j`:case`k`:case`LOOPLIMIT`:case`ITEM_ID`:case`ITEM_POS`:case`ENEMY_HP`:case`ENEMY_AT`:case`ENEMY_DF`:case`PICTURE`:case`PLAYER_PX`:case`PLAYER_PY`:case`MOVE_SPEED`:case`MOVE_FRAME_TIME`:case`LP`:case`undefined`:return{type:`Symbol`,name:e.name};default:return{type:`Literal`,value:e.name}}}function vs(e){return{type:`Literal`,value:e.value}}function ys(e){let t=$(e.consequent),n=$(e.alternate);return{type:`ConditionalExpression`,consequent:t,test:$(e.test),alternate:n}}function bs(e){let t=$(e.key);if(t.type===`Symbol`)throw Error(`Object のキー ${t.name} は予約されているため、使用できません。`);if(t.type!==`Literal`)throw Error(`Object のキーが不正です。 Literal を期待していましたが、実際は ${t.type} でした。`);return{type:`Property`,key:t,value:$(e.value)}}function xs(e){return{type:`ObjectExpression`,properties:e.properties.map(bs)}}function Ss(e){return{type:`ArrayExpression`,elements:e.elements.map($)}}var Cs=[j.OBJECT,j.MAP],ws=e=>Math.abs(e)<2**-52;function Ts(e){switch(typeof e){case`object`:if(e===null)break;return Array.isArray(e)?e.length:Object.keys(e).length;case`string`:return e.length}throw Error(`LENGTH: 対応できない値が指定されています。`)}var Es=(e,t)=>(e-t)*R.CHIP_SIZE,Ds=(e,t)=>(e-t)*R.CHIP_SIZE,Os=class{constructor(e){this.value=e}},ks=Object.freeze({"=":(e,t)=>t,"+=":(e,t)=>e+t,"-=":(e,t)=>e-t,"*=":(e,t)=>e*t,"/=":(e,t)=>e/t}),As=class{constructor(e){this.wwa=e,this.loop_limit=1e5,this.state={messagePageAdditionalQueue:[]}}setTriggerParts(e,t,n){this.state={...this.state,triggerParts:{id:e,type:t,position:n}}}clearTemporaryState(){this.state={...this.state,triggerParts:void 0,messagePageAdditionalQueue:[]}}setEarnedItem(e,t){this.state={...this.state,earnedItem:{partsId:e,itemPos1To12:t}}}clearEarnedItem(){this.state={...this.state,earnedItem:void 0}}setBattleDamageCalculationMode(e){this.state={...this.state,battleDamageCalculation:{estimatingParams:e}}}clearBattleDamageCalculationMode(){this.state={...this.state,battleDamageCalculation:void 0}}evalWwaNodes(e){try{return this.evalWwaNodeInternal({type:`BlockStatement`,value:e})}catch(e){if(e instanceof Os)return{isGameOver:!0,value:e.value};throw e}}evalWwaNode(e){try{return{isGameOver:!1,value:this.evalWwaNodeInternal(e)}}catch(e){if(e instanceof Os)return{isGameOver:!0,value:e.value};throw e}}evalWwaNodeInternal(e){if(!(e.type===`BlockStatement`&&Array.isArray(e.value)&&e.value.length===0))try{return new js(this).evalWwaNode(e)}catch(e){if(e instanceof Ms)return e.value;if(e instanceof Ns)switch(e.reason){case`ABORT_BATTLE`:case`EXIT`:return e.value;case`GAME_OVER`:throw new Os(e.value);default:throw TypeError(`ExitInformationのreasonが不正です: `+e.reason)}else throw e}}addPageAdditionalItem(e){this.state.messagePageAdditionalQueue.push(e)}pickPageAdditionalQueue(){let e=[...this.state.messagePageAdditionalQueue];return this.state.messagePageAdditionalQueue=[],e}updateLoopLimit(e){this.loop_limit=e}},js=class{constructor(e){this.generator=e,this.for_id={i:null,j:null,k:null,LP:[],loopCount:0,break_flag:!1,continue_flag:!1}}evalWwaNodes(e){let t;return e.forEach(e=>{t=this.evalWwaNode(e)}),t}evalWwaNode(e){if(!(this.for_id.break_flag||this.for_id.continue_flag))switch(e.type){case`UnaryOperation`:return this.evalUnaryOperation(e);case`BinaryOperation`:return this.evalBinaryOperation(e);case`Symbol`:return this.evalSymbol(e);case`ArrayOrObject1D`:return this.evalArrayOrObject1D(e);case`ArrayOrObject2D`:return this.evalArrayOrObject2D(e);case`ArrayOrObject3DPlus`:return this.evalArrayOrObject3DPlus(e);case`Literal`:return this.evalLiteral(e);case`UserVariableAssignment`:return this.evalSetUserVariable(e);case`SpecialParameterAssignment`:return this.evalSetSpecialParameter(e);case`Random`:return this.evalRandom(e);case`Jumpgate`:return this.evalJumpgate(e);case`Msg`:return this.evalMessage(e);case`ItemAssignment`:return this.itemAssignment(e);case`IfStatement`:return this.ifStatement(e);case`BlockStatement`:return this.blockStatement(e);case`PartsAssignment`:return this.partsAssignment(e);case`ForStatement`:return this.forStateMent(e);case`AnyFunction`:return this.wrapCallFunction(e,e=>this.evalAnyFunction(e));case`CallDefinedFunction`:return this.wrapCallFunction(e,e=>this.callDefinedFunction(e));case`Break`:return this.breakStatement(e);case`Return`:throw new Ms(this.returnStatement(e));case`Continue`:return this.contunueStatment(e);case`UpdateExpression`:return this.updateExpression(e);case`LogicalExpression`:return this.logicalExpression(e);case`TemplateLiteral`:return this.convertTemplateLiteral(e);case`ConditionalExpression`:return this.convertConditionalExpression(e);case`Property`:return this.property(e);case`ObjectExpression`:return this.objectExpression(e);case`ArrayExpression`:return this.arrayExpression(e);case`LoopPointerAssignment`:return this.convertLoopPointerExpression(e);default:throw console.log(e),Error(`未定義または未実装のノードです`)}}wrapCallFunction(e,t){try{return t(e)}catch(e){if(e instanceof Ms)return e.value;throw e}}callDefinedFunction(e){let t=this.generator.wwa.getUserScript(e.functionName);if(t===null)throw Error(`未定義の関数が呼び出されました: ${e.functionName}`);return this.evalWwaNode(t)}updateExpression(e){if(e.argument.type!==`ArrayOrObject1D`&&e.argument.type!==`ArrayOrObject2D`&&e.argument.type!==`Symbol`)throw Error(`node.argument.typeが インクリメント/デクリメントできる対象ではありません。: ${e.argument.type}`);let t=t=>{switch(e.operator){case`++`:return t+1;case`--`:return t-1;default:throw Error(`想定外のOperatorが渡されました :`+e.operator)}},n=this.evalWwaNode(e.argument),r={type:`Literal`,value:t(n)};switch(e.argument.type){case`ArrayOrObject1D`:if(e.argument.name===`v`)this.evalSetUserVariable({type:`UserVariableAssignment`,index:[e.argument.indecies[0]],value:r});else if(e.argument.name===`ITEM`)this.itemAssignment({type:`ItemAssignment`,itemBoxPosition1to12:e.argument.indecies[0],value:r});else if(e.argument.name===`LP`)this.convertLoopPointerExpression({type:`LoopPointerAssignment`,index:e.argument.indecies[0],value:r,operator:`=`});else throw Error(`このリテラルはインクリメント/デクリメントできません: ${e.argument.type}`);break;case`ArrayOrObject2D`:{let t={type:`PartsAssignment`,destinationX:e.argument.indecies[0],destinationY:e.argument.indecies[1],value:r,operator:`=`};if(e.argument.name===`m`)this.partsAssignment({...t,partsKind:`map`});else if(e.argument.name===`o`)this.partsAssignment({...t,partsKind:`object`});else throw Error(`このリテラルはインクリメント/デクリメントできません: ${e.argument.type}`);break}case`Symbol`:{let t={type:`SpecialParameterAssignment`,kind:e.argument.name,value:r};this.evalSetSpecialParameter(t);break}}return n}logicalExpression(e){let t=this.evalWwaNode(e.left),n=this.evalWwaNode(e.right);switch(e.operator){case`||`:return t||n;case`&&`:return t&&n;default:throw Error(`存在しない論理式です!: `+e.operator)}}convertTemplateLiteral(e){let t=e.expressions.map(e=>this.evalWwaNode(e)),n=e.quasis.map(e=>e.value.cooked),r=``;return n.forEach((e,n)=>{r+=e,t[n]!==void 0&&(r+=t[n])}),r}contunueStatment(e){this.for_id.continue_flag=!0}breakStatement(e){this.for_id.break_flag=!0}returnStatement(e){return this.evalWwaNode(e.argument)}forStateMent(e){let t=e.init;for((()=>{if(`kind`in t)switch(t.kind){case`i`:if(this.for_id.i!==null)throw Error(`iの値が既に外側のforループで使われています。`);break;case`j`:if(this.for_id.j!==null)throw Error(`jの値が既に外側のforループで使われています。`);break;case`k`:if(this.for_id.k!==null)throw Error(`kの値が既に外側のforループで使われています。`);break;default:throw console.log(e),Error(`予想外の変数がfor文内で使用されました :`+t.kind)}else switch(t.type){case`LoopPointerAssignment`:let n=Number(this.evalWwaNode(t.index));if(Number.isNaN(n))throw Error(`LPのIndex値はNumberでないといけません。: ${n}`);if(this.for_id.LP[n]!==null&&this.for_id.LP[n]!==void 0)throw Error(`LP[${n}]の値が既に外側のforループで使われています。`);break;default:throw console.log(e),Error(`予想外の1次元配列がfor文内で使用されました :`+t)}this.evalWwaNode(e.init)})();this.evalWwaNode(e.test);this.evalWwaNode(e.update)){if(this.for_id.loopCount++,this.for_id.loopCount>this.generator.loop_limit)throw Error(`処理回数が多すぎます!
94
+ 上限値は LOOPLIMIT で変えられます。`);if(this.for_id.break_flag||!this.evalWwaNode(e.test))break;this.evalWwaNodes(e.body),this.for_id.continue_flag=!1}if(this.for_id.break_flag=!1,`kind`in t)switch(t.kind){case`i`:this.for_id.i=null;break;case`j`:this.for_id.j=null;break;case`k`:this.for_id.k=null;break}else switch(t.type){case`LoopPointerAssignment`:let e=Number(this.evalWwaNode(t.index));this.for_id.LP[e]=null;break}}_checkArgsLength(e,t){if(t.value.length<e)throw Error(`関数 ${t.functionName} の引数が不足しています!`)}evalAnyFunction(e){let t=this.generator.wwa.getGameStatus();switch(e.functionName){case`MUSIC`:case`SOUND`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]),n=e.value[1]?this.evalWwaNode(e.value[1]):void 0,r=e.value[2]?this.evalWwaNode(e.value[2]):!1;return this.generator.wwa.playSound(t,{loopPlaying:n,bgmDelayDurationMs:r>=0?r:void 0}),t}case`BGM_STOP`:case`STOP_BGM`:this.generator.wwa.stopBgm();return;case`SOUND_STOP`:case`STOP_SOUND`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);return this.generator.wwa.stopSound(t,{includeBgm:!0}),t}case`STOP_SOUNDS`:case`ALL_SOUND_STOP`:case`STOP_ALL_SOUND`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);this.generator.wwa.stopAllSound({includeBgm:!!t});return}case`SAVE`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);return this.generator.wwa.disableSave(t),t}case`LOG`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);console.log(t instanceof Map?d(t):t);return}case`ABLE_CHANGE_SPEED`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);return this.generator.wwa.speedChangeJudge(t),t}case`SET_SPEED`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));this.generator.wwa.setPlayerSpeedIndex(t);return}case`CHANGE_GAMEOVER_POS`:{this._checkArgsLength(2,e);let t={x:Number(this.evalWwaNode(e.value[0])),y:Number(this.evalWwaNode(e.value[1]))};if(t.x<0||t.x>=this.generator.wwa.getMapWidth()||t.y<0||t.y>this.generator.wwa.getMapWidth())throw Error(`マップの範囲外が指定されています!`);this.generator.wwa.setGameOverPosition(new S(t.x,t.y));return}case`DEL_PLAYER`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);this.generator.wwa.setDelPlayer(t);return}case`RESTART_GAME`:this.generator.wwa.restartGame();return;case`URL_JUMPGATE`:throw Error(`URL_JUMPGATE 関数は調整中のためご利用になれません`);case`HIDE_STATUS`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=!!this.evalWwaNode(e.value[1]);this.generator.wwa.hideStatus(t,n);return}case`PARTS`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=e.value[2]?Number(this.evalWwaNode(e.value[2])):0,i=e.value[3]?!!this.evalWwaNode(e.value[3]):!1;if(t<0||n<0)throw Error(`パーツ番号が不正です`);if(!Cs.includes(r))throw Error(`パーツ種別が不明です`);this.generator.wwa.replaceParts(t,n,r,i);return}case`FACE`:{this._checkArgsLength(6,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=Number(this.evalWwaNode(e.value[2])),i=Number(this.evalWwaNode(e.value[3])),a=Number(this.evalWwaNode(e.value[4])),o=Number(this.evalWwaNode(e.value[5]));if(t<0||n<0||r<0||i<0||a<0||o<0)throw Error(`各引数は0以上の整数でなければなりません。`);this.generator.addPageAdditionalItem({type:`face`,data:{face:new w(new S(t,n),new S(r,i),new S(a,o))}});return}case`EFFECT`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));if(t<0)throw Error(`待ち時間は0以上の整数でなければなりません。`);if(t===0){this.generator.wwa.stopEffect();return}let n=[];for(let t=1;t<e.value.length;t+=2){let r=Number(this.evalWwaNode(e.value[t]));if(r<0)throw Error(`画像のパーツ座標指定は0以上の整数でなければなりません。`);if(t+1===e.value.length)throw Error(`画像のパーツ座標指定で、Y座標が指定されていません。`);let i=Number(this.evalWwaNode(e.value[t+1]));if(i<0)throw Error(`画像のパーツ座標指定は0以上の整数でなければなりません。`);n.push(new S(r,i))}this.generator.wwa.setEffect(t,n);return}case`CHANGE_PLAYER_IMAGE`:case`CHANGE_PLAYER_IMG`:{this._checkArgsLength(2,e);let t=new S(Number(this.evalWwaNode(e.value[0])),Number(this.evalWwaNode(e.value[1])));this.generator.wwa.setPlayerImgCoord(t);return}case`HAS_ITEM`:{this._checkArgsLength(1,e);let n=Number(this.evalWwaNode(e.value[0]));return t.itemBox.includes(n)}case`REMOVE_ITEM`:{this._checkArgsLength(1,e);let n=Number(this.evalWwaNode(e.value[0])),r=e.value[1]?this.evalWwaNode(e.value[1])===1:!1,i=0;for(let e=0;e<t.itemBox.length;e++)if(n===t.itemBox[e]&&(this.generator.wwa.setPlayerGetItem(e+1,0),i++,!r))return i;return i}case`MOVE`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));if(t<=0||t>9)throw Error(`MOVEの移動先は2/4/6/8で指定してください!`);return this.generator.wwa.movePlayer(t),this.generator.wwa.movePlayer(t),0}case`PARTS_MOVE`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));return this.generator.wwa.setMoveMacroWaitingToPlayer(t),0}case`IS_PLAYER_WAITING_MESSAGE`:return this.generator.wwa.isPlayerWaitingMessage();case`IS_MANUAL_PAUSE`:case`IS_PLAYER_WAITING_ENTER`:return this.generator.wwa.isManualPause();case`GET_UNIXTIME`:return Math.floor(new Date().getTime()/1e3);case`GET_DATE_YEAR`:return new Date().getFullYear();case`GET_DATE_MONTH`:return new Date().getMonth()+1;case`GET_DATE_DAY`:return new Date().getDate();case`GET_DATE_HOUR`:return new Date().getHours();case`GET_DATE_MINUTES`:return new Date().getMinutes();case`GET_DATE_SECONDS`:return new Date().getSeconds();case`GET_DATE_MILLISECONDS`:return new Date().getMilliseconds();case`GET_DATE_WEEKDAY`:return new Date().getDay();case`SHOW_USER_DEF_VAR`:console.log(this.generator.wwa.getAllUserNameVar());return;case`CHANGE_SYSMSG`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]),n=e.value.length>=2?this.evalWwaNode(e.value[1]):void 0,r=this.resolveSystemMessageKeyFromMacroArg(t);if(!r)throw Error(`このIDのシステムメッセージは未定義です。`);if(typeof n==`number`||typeof n==`string`||typeof n==`boolean`)this.generator.wwa.overwriteSystemMessage(r,String(n));else if(n==null)this.generator.wwa.overwriteSystemMessage(r,void 0);else throw Error(`この値は文字列に変換できないため、システムメッセージを表示できません。`);break}case`PICTURE`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=e.value.length>=2?this.evalWwaNode(e.value[1]):void 0;if(n===void 0){this.generator.wwa.deletePictureRegistry(t);return}if(n instanceof Map)this.generator.wwa.setPictureRegistryFromObject(t,d(n));else if(typeof n==`string`)this.generator.wwa.setPictureRegistryFromRawText(t,n);else throw Error(`ピクチャのプロパティ定義は文字列あるいはオブジェクトである必要があります。`);break}case`PICTURE_FROM_PARTS`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1]));if(n===0){this.generator.wwa.deletePictureRegistry(t);return}let r=e.value.length>=3?Number(this.evalWwaNode(e.value[2])):j.OBJECT;if(!Cs.includes(r))throw Error(`パーツ種別が不明です`);let i=this.generator.wwa.getGameStatus();this.generator.wwa.setPictureRegistry(t,n,r,i.playerCoord);break}case`CLEAR_ALL_PICTURES`:this.generator.wwa.clearAllPictures();break;case`HAS_PICTURE`:{this._checkArgsLength(1,e);let n=Number(this.evalWwaNode(e.value[0]));return t.wwaData.pictureRegistry.some(e=>e.layerNumber===n)}case`ABS`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));return Math.abs(t)}case`POW`:return this._checkArgsLength(2,e),Number(this.evalWwaNode(e.value[0]))**+Number(this.evalWwaNode(e.value[1]));case`SQRT`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0]));return Math.sqrt(t)}case`SIN`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=Math.sin(t*Math.PI/180);return ws(n)?0:n}case`COS`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=Math.cos(t*Math.PI/180);return ws(n)?0:n}case`TAN`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=Math.tan(t*Math.PI/180);return ws(n)?0:n}case`GET_GAMEOVER_POS_X`:return this.generator.wwa.getGemeOverPosition().x;case`GET_GAMEOVER_POS_Y`:return this.generator.wwa.getGemeOverPosition().y;case`ABORT_BATTLE`:throw this.generator.state.battleDamageCalculation&&(this.generator.state.battleDamageCalculation.aborted=!0),new Ns(`ABORT_BATTLE`);case`EXIT`:throw new Ns(`EXIT`,this.evalWwaNode(e.value[0]));case`GET_IMG_POS_X`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=(e.value[1]===void 0?0:Number(this.evalWwaNode(e.value[1])))===0?j.OBJECT:j.MAP;if(n===j.OBJECT){let n=e.value[2]===void 0?!0:Number(this.evalWwaNode(e.value[2]))===0,r=this.generator.wwa.getObjectInfo(t),i=n?r[R.ATR_X]:r[R.ATR_X2];return Math.floor(i/R.CHIP_SIZE)}else if(n===j.MAP){let e=this.generator.wwa.getMapInfo(t)[R.ATR_X];return Math.floor(e/R.CHIP_SIZE)}throw Error(`GET_IMG_POS_X: 指定したIDのパーツのTypeが異常です。`)}case`GET_IMG_POS_Y`:{this._checkArgsLength(1,e);let t=Number(this.evalWwaNode(e.value[0])),n=(e.value[1]===void 0?0:Number(this.evalWwaNode(e.value[1])))===0?j.OBJECT:j.MAP;if(n===j.OBJECT){let n=e.value[2]===void 0?!0:Number(this.evalWwaNode(e.value[2]))===0,r=this.generator.wwa.getObjectInfo(t),i=n?r[R.ATR_Y]:r[R.ATR_Y2];return Math.floor(i/R.CHIP_SIZE)}else if(n===j.MAP){let e=this.generator.wwa.getMapInfo(t)[R.ATR_Y];return Math.floor(e/R.CHIP_SIZE)}throw Error(`GET_IMG_POS_Y: 指定したIDのパーツのTypeが異常です。`)}case`LENGTH`:return this._checkArgsLength(1,e),Ts(this.evalWwaNode(e.value[0]));case`IS_NUMBER`:return this._checkArgsLength(1,e),typeof this.evalWwaNode(e.value[0])==`number`;case`MANUAL_PAUSE`:case`WAIT_ENTER`:{let t=this.evalWwaNode(e.value[0]),n=t===`__BLOCK`;this.generator.wwa.manualPause({functionNames:{cancelPause:t&&!n?t:``,up:e.value[1]?this.evalWwaNode(e.value[1]):``,down:e.value[2]?this.evalWwaNode(e.value[2]):``,right:e.value[3]?this.evalWwaNode(e.value[3]):``,left:e.value[4]?this.evalWwaNode(e.value[4]):``},blockingCancelPauseByPlayer:n});return}case`CANCEL_MANUAL_PAUSE`:case`CANCEL_WAIT_ENTER`:this.generator.wwa.cancelManualPause();return;case`COLOR`:{this._checkArgsLength(4,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=Number(this.evalWwaNode(e.value[2])),i=Number(this.evalWwaNode(e.value[3]));if(t<0||t>5)throw Error(`種別は0から5までです`);if(n<0||n>255||r<0||r>255||i<0||i>255)throw Error(`色が範囲外です`);this.generator.wwa.changeStyleRule(t,n,r,i);return}case`EFFITEM`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);this.generator.wwa.updateItemEffectEnabled(t);return}case`CHANGE_BOM_IMAGE`:case`CHANGE_BOM_IMG`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1]));if(t<0||n<0)throw Error(`座標は0以上の整数ではありません`);this.generator.wwa.setBattleEffectCoord(new S(t,n));return}case`CHANGE_CLICK_IMAGE`:case`CHANGE_CLICK_IMG`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1]));if(t<0||n<0)throw Error(`引数が0以上の整数ではありません`);this.generator.wwa.setImgClick(new S(t,n));return}case`CHANGE_FRAME_IMAGE`:case`CHANGE_FRAME_IMG`:{this._checkArgsLength(3,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=Number(this.evalWwaNode(e.value[2]));if(n<0||r<0)throw Error(`座標は正でなければなりません。`);switch(t){case L.ENERGY:case L.STRENGTH:case L.DEFENCE:case L.GOLD:this.generator.wwa.setStatusIconCoord(t,new S(n,r));break;case L.WIDE_CELL_ROW:this.generator.wwa.setWideCellCoord(new S(n,r));break;case L.ITEM_BG:this.generator.wwa.setItemboxBackgroundPosition({x:n,y:r});break;case L.MAIN_FRAME:this.generator.wwa.setFrameCoord(new S(n,r));break;default:throw Error(`種別が不正です。`)}return}case`CHANGE_YESNO_IMAGE`:case`CHANGE_YESNO_IMG`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1]));this.generator.wwa.setYesNoImgCoord(new S(t,n));return}case`NO_GAMEOVER`:{this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);this.generator.wwa.setGameOverPolicy(t);return}case`DEFAULT`:{this._checkArgsLength(1,e);let t=!!this.evalWwaNode(e.value[0]);this.generator.wwa.setObjectNotCollapseOnPartsOnPlayer(t);return}case`DIR_MAP`:{this._checkArgsLength(2,e);let t=Number(this.evalWwaNode(e.value[0])),n=Number(this.evalWwaNode(e.value[1])),r=e.value[2]===void 0?j.OBJECT:Number(this.evalWwaNode(e.value[2]));if(t<0)throw Error(`パーツ番号が不正です`);if(r===j.OBJECT){if(t>=this.generator.wwa.getObjectPartsNum())throw Error(`パーツ番号が不正です`)}else if(t>=this.generator.wwa.getMapPartsNum())throw Error(`パーツ番号が不正です`);this.generator.wwa.appearPartsByDirection(n,t,r);return}case`CHANGE_SOUND_DECISION`:if(this.generator.wwa.getSoundEnabled()){this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);this.generator.wwa.checkSoundEnabled(t),this.generator.wwa.setDecisionSound(t)}return;case`CHANGE_SOUND_ATTACK`:if(this.generator.wwa.getSoundEnabled()){this._checkArgsLength(1,e);let t=this.evalWwaNode(e.value[0]);this.generator.wwa.checkSoundEnabled(t),this.generator.wwa.setAttackSound(t)}return;default:throw Error(`未定義の関数が指定されました: `+e.functionName)}}resolveSystemMessageKeyFromMacroArg(e){if(typeof e==`string`)return v(e)?e:void 0;if(typeof e==`number`)return y(e)}partsAssignment(e){let t=this.generator.wwa.getGameStatus(),n=this.evalWwaNode(e.destinationX),r=this.evalWwaNode(e.destinationY);if(typeof n!=`number`||typeof r!=`number`)throw Error(`座標は数値で指定してください (${n}, ${r})`);new C(this.generator.wwa,n,r);let i=e.partsKind===`map`?j.MAP:j.OBJECT,a=this.resolveParts(i,n,r),o=this.evalWwaNode(e.value);switch(e.operator){case`=`:case`+=`:case`-=`:case`*=`:case`/=`:{let s=ks[e.operator](a,o)|0;if(s<0)throw Error(`負値のパーツ番号 ${s} は代入できません`);this.generator.wwa.appearPartsEval(t.playerCoord,`${n}`,`${r}`,s,i);break}default:throw Error(`演算子 ${e.operator} は partsAssignment では使えません`)}}resolveParts(e,t,n){let r=this.generator.wwa.getGameStatus();switch(e){case j.MAP:return r.wwaData.map[n][t];case j.OBJECT:return r.wwaData.mapObject[n][t];default:throw Error(`存在しないPartsTypeです`,e)}}blockStatement(e){return this.evalWwaNodes(e.value)}ifStatement(e){if(this.evalWwaNode(e.test))return this.evalWwaNode(e.consequent);if(e.alternate)return this.evalWwaNode(e.alternate)}convertConditionalExpression(e){let t=this.evalWwaNode(e.test)?e.consequent:e.alternate;return this.evalWwaNode(t)}property(e){let t=this.evalWwaNode(e.key);if(!f(t))throw Error(`オブジェクトのキーはプリミティブ値でなければなりません。: ${t}`);return[String(this.evalWwaNode(e.key)),this.evalWwaNode(e.value)]}objectExpression(e){let t=e.properties.map(e=>this.evalWwaNode(e));return new Map(t)}arrayExpression(e){return e.elements.map(e=>this.evalWwaNode(e))}convertLoopPointerExpression(e){let t=this.evalWwaNode(e.value),n=this.evalWwaNode(e.index);switch(e.operator){case`+=`:this.for_id.LP[n]=t;break;case`-=`:this.for_id.LP[n]=t;break;case`/=`:this.for_id.LP[n]=t;break;case`*=`:this.for_id.LP[n]=t;break;default:this.for_id.LP[n]=t;break}return 0}itemAssignment(e){let t=this.evalWwaNode(e.itemBoxPosition1to12);if(typeof t!=`number`||t<0||t>12)throw Error(`ITEMの添字に想定外の値が入っています。0以上12以下の添字を指定してください。: `+t);let n=this.evalWwaNode(e.value);switch(e.operator){case`=`:this.generator.wwa.setPlayerGetItem(t,n|0);break;case`+=`:case`-=`:case`*=`:case`/=`:{if(t===0)throw Error(`複合代入では ITEM[0] への操作はできません`);let r=this.generator.wwa.getGameStatus().itemBox[t-1],i=ks[e.operator](r,n)|0;if(i<0)throw Error(`負値のパーツ番号 ${i} は代入できません`);this.generator.wwa.setPlayerGetItem(t,i);break}default:throw Error(`演算子 ${e.operator} は itemAssignment では使えません`)}}evalMessage(e){let t=this.evalWwaNode(e.value),n=this.generator.pickPageAdditionalQueue();this.generator.wwa.handleMsgFunction({message:String(t),additionalItems:n})}evalJumpgate(e){let t=this.evalWwaNode(e.x),n=this.evalWwaNode(e.y);if(isNaN(t)||isNaN(n))throw Error(`飛び先の値が数値になっていません。 x=${t} / y=${n}`);this.generator.wwa.forcedJumpGate(t,n)}evalRandom(e){let t=this.evalWwaNode(e.value);return Math.floor(Math.random()*t)}evalSetSpecialParameter(e){let t=this.evalWwaNode(e.value);if(!this.generator.wwa||isNaN(t))return t;let n=this.evalSymbol({type:`Symbol`,name:e.kind});if(Array.isArray(n))throw Error(`配列Objectに対して直接代入は出来ません: ${n}`);let r=(()=>{switch(e.operator){case`+=`:return n+t;case`-=`:return n-t;case`*=`:return n*t;case`/=`:return n/t;default:return t}})();switch(e.kind){case`PX`:return this.generator.wwa.jumpSpecifiedXPos(r),r;case`PY`:return this.generator.wwa.jumpSpecifiedYPos(r),r;case`AT`:return this.generator.wwa.setPlayerStatus(ue.STRENGTH,r,!0),r;case`DF`:return this.generator.wwa.setPlayerStatus(ue.DEFENCE,r,!0),r;case`GD`:return this.generator.wwa.setPlayerStatus(ue.GOLD,r,!0),r;case`HP`:{let{isGameOver:e}=this.generator.wwa.setPlayerStatus(ue.ENERGY,r,!0);if(e)throw new Ns(`GAME_OVER`);return r}case`HPMAX`:return this.generator.wwa.setPlayerEnergyMax(r),r;case`i`:return this.for_id.i=this.evalWwaNode(e.value),this.for_id.i;case`j`:return this.for_id.j=this.evalWwaNode(e.value),this.for_id.j;case`k`:return this.for_id.k=this.evalWwaNode(e.value),this.for_id.k;case`LOOPLIMIT`:{let t=this.evalWwaNode(e.value);return this.generator.updateLoopLimit(t),t}default:console.error(`未実装の要素です: `+e.kind);return}}evalSetUserVariable(e){if(e.index.length>1){let t=this.evalWwaNode(e.value),n=e.index.map(e=>this.evalWwaNode(e));this.generator.wwa.setUserVarIndecies(n,t,e.operator);return}else{let t=this.evalWwaNode(e.value);if(!this.generator.wwa)return t;let n=this.evalWwaNode(e.index[0]);return this.generator.wwa.setUserVar(n,t,e.operator),t}}evalUnaryOperation(e){switch(e.operator){case`+`:return this.evalWwaNode(e.argument);case`-`:return-this.evalWwaNode(e.argument);case`!`:return!this.evalWwaNode(e.argument);default:throw Error(`存在しない単項演算子です`)}}evalBinaryOperation(e){let t=this.evalWwaNode(e.left),n=this.evalWwaNode(e.right);switch(e.operator){case`+`:return t+n;case`-`:return t-n;case`*`:return t*n;case`/`:return n===0?0:Math.floor(t/n);case`%`:return n===0?0:t%n;case`>`:return t>n;case`>=`:return t>=n;case`<`:return t<n;case`<=`:return t<=n;case`==`:return t==n;case`!=`:return t!=n;default:throw Error(`存在しない単項演算子です`)}}evalSymbol(e){let t=this.generator.wwa.getGameStatus(),n=this.generator.wwa.getEnemyStatus();switch(e.name){case`X`:return this.generator.state.triggerParts?.position.x??t.playerCoord.x;case`Y`:return this.generator.state.triggerParts?.position.y??t.playerCoord.y;case`ID`:return this.generator.state.triggerParts?.id??-1;case`TYPE`:return this.generator.state.triggerParts?.type??-1;case`PX`:return t.playerCoord.x;case`PY`:return t.playerCoord.y;case`CX`:return t.cameraCoord.x;case`CY`:return t.cameraCoord.y;case`AT`:return t.bareStatus.strength;case`AT_TOTAL`:return this.generator.state.battleDamageCalculation?.estimatingParams?.playerStatus.strength??t.totalStatus.strength;case`DF`:return t.bareStatus.defence;case`DF_TOTAL`:return this.generator.state.battleDamageCalculation?.estimatingParams?.playerStatus.defence??t.totalStatus.defence;case`GD`:return this.generator.state.battleDamageCalculation?.estimatingParams?.playerStatus.gold??t.totalStatus.gold;case`HP`:return this.generator.state.battleDamageCalculation?.estimatingParams?.playerStatus.energy??t.totalStatus.energy;case`HPMAX`:return t.energyMax;case`STEP`:return t.moveCount;case`TIME`:return t.playTime;case`PDIR`:return t.playerDirection;case`i`:return this.for_id.i;case`j`:return this.for_id.j;case`k`:return this.for_id.k;case`LOOPLIMIT`:return this.generator.loop_limit;case`ITEM_ID`:return this.generator.state.earnedItem?.partsId??-1;case`ITEM_POS`:return this.generator.state.earnedItem?.itemPos1To12??-1;case`ENEMY_HP`:return this.generator.state.battleDamageCalculation?.estimatingParams?.enemyStatus.energy??(typeof n==`number`?-1:n.energy);case`ENEMY_AT`:return this.generator.state.battleDamageCalculation?.estimatingParams?.enemyStatus.strength??(typeof n==`number`?-1:n.strength);case`ENEMY_DF`:return this.generator.state.battleDamageCalculation?.estimatingParams?.enemyStatus.defence??(typeof n==`number`?-1:n.defence);case`ENEMY_GD`:return this.generator.state.battleDamageCalculation?.estimatingParams?.enemyStatus.gold??(typeof n==`number`?-1:n.gold);case`PICTURE`:throw Error(`この機能はまだ実装されていません!`);case`PLAYER_PX`:return Es(t.playerCoord.x,t.cameraCoord.x);case`PLAYER_PY`:return Ds(t.playerCoord.y,t.cameraCoord.y);case`MOVE_SPEED`:return de[t.gameSpeedIndex];case`MOVE_FRAME_TIME`:return R.CHIP_SIZE/de[t.gameSpeedIndex];case`LP`:return this.for_id.LP;case`undefined`:return;default:throw Error(`このシンボルは取得できません`)}}evalArrayOrObject1D(e){let t=this.evalWwaNode(e.indecies[0]);if(typeof t!=`number`)switch(e.name){case`v`:return this.generator.wwa.getUserNameVar(t);default:throw Error(`このシンボルは取得できません`)}let n=this.generator.wwa.getGameStatus();switch(e.name){case`v`:return this.generator.wwa.getUserVar(t);case`ITEM`:if(t<1||t>12)throw Error(`ITEMの添字に想定外の値が入っています。1以上12以下の添字を指定してください。: `+t);return n.itemBox[t-1];case`PICTURE`:throw Error(`この機能はまだ実装されていません!`);case`LP`:return this.for_id.LP[t];default:throw Error(`このシンボルは取得できません`)}}evalArrayOrObject2D(e){switch(e.name){case`m`:case`o`:let t=this.evalWwaNode(e.indecies[0]),n=this.evalWwaNode(e.indecies[1]);if(typeof t!=`number`||typeof n!=`number`)throw Error(`座標は数値で指定してください (${t}, ${n})`);new C(this.generator.wwa,t,n);let r=e.name===`o`?j.OBJECT:j.MAP;return this.generator.wwa.getPartsID(new S(t,n),r);case`v`:{let t=e.indecies[0].value,n=this.generator.wwa.getUserNameVar(t);if(n===null||!Array.isArray(n)&&typeof n!=`object`&&typeof n!=`string`)throw Error(`指定したユーザー定義変数: v["${t}"] は配列・オブジェクト・文字列ではありません`);return Ke(n,this.evalWwaNode(e.indecies[1]))}default:throw Error(`このシンボルは取得できません`)}}evalArrayOrObject3DPlus(e){let t=e.indecies.map(e=>this.evalWwaNode(e)),n=this.generator.wwa.getUserNameVar(t[0]);return t.slice(1).reduce((e,t)=>Ke(e,t),n)}evalLiteral(e){return e.value}},Ms=class{constructor(e){this.value=e}},Ns=class{constructor(e,t){this.reason=e,this.value=t}};function Ps(e){return Ko(e,{ecmaVersion:2020})}var Fs=async e=>{try{let t=await fetch(e);return t.status===200||t.status===304?{kind:`data`,data:await new Response(t.body).text(),fileName:e}:{kind:`httpError`,errorMessage:`ファイル ${e} が読み込めませんでした。ステータスコード: ${t.status}`,fileName:e}}catch(t){return{kind:`otherError`,errorMessage:t.message,fileName:e}}},Is=`user-variable-label`;function Ls(){let e=document.createElement(`div`);return e.textContent=`-`,e.setAttribute(`aria-hidden`,`true`),e.classList.add(Is),e}function Rs(e,t){e.textContent!==t&&(e.textContent=t)}var zs=`-`,Bs=`user-variable-card`,Vs=`user-variable-card--is-trimmed`;function Hs({index:e,value:t}){let n=document.createElement(`div`);n.classList.add(Bs),qs(t)&&n.classList.add(Vs),n.dataset.varIndex=String(e);let{cardIndexElement:r,cardIndexLabelElement:i}=Us(e),a=Ws(t);return n.appendChild(r),n.appendChild(a),{cardElement:n,cardIndexElement:r,cardIndexLabelElement:i,cardValueElement:a}}function Us(e){let t=document.createElement(`div`);t.classList.add(`index`),t.textContent=String(e),typeof e==`string`&&t.setAttribute(`title`,e);let n=Ls();return t.appendChild(n),{cardIndexElement:t,cardIndexLabelElement:n}}function Ws(e){let t=document.createElement(`div`);return t.classList.add(`value`),typeof e==`string`&&t.setAttribute(`title`,Ge(e)),Ks(t,e),t}function Gs(e,t){e.dataset.labelledVarIndex=`true`,e.addEventListener(`mouseover`,()=>t.removeAttribute(`aria-hidden`)),e.addEventListener(`mouseleave`,()=>t.setAttribute(`aria-hidden`,`true`))}function Ks(e,t){let n=Ge(t);e.textContent!==n&&(e.textContent=t===void 0?zs:Ge(t))}function qs(e){return typeof e!=`object`}var Js=`user-variable-list`;function Ys({kind:e,elementStore:t}){let n=document.createElement(`ul`);return n.classList.add(Js),e===`numbered`&&Array.from({length:R.USER_VAR_NUM}).map((e,n)=>Xs({elementStore:t,index:n})).forEach(e=>n.appendChild(e)),n}function Xs({elementStore:e,index:t,value:n}){let r=document.createElement(`li`),i=Hs({index:t,value:n});return e.updateUserVarElementInfo(t,i),r.appendChild(i.cardElement),r}function Zs(e,t,{index:n,value:r}){t.appendChild(Xs({elementStore:e,index:n,value:r}))}var Qs=`information`;function $s(){let e=document.createElement(`p`);return e.classList.add(Qs),ec(e,`強調されている番号にカーソルを乗せると説明が表示されます。`),e}function ec(e,t,n=!1){e.textContent=`${n?`【エラー】`:``}${t}`}function tc({elementStore:e,heading:t,contentVisibilityToggleButton:n,information:r}){let i=document.createElement(`header`);if(i.appendChild(rc({heading:t,contentVisibilityToggleButton:n})),r){let t=$s();i.appendChild(t),e.updateNamedUserVarInformationElement(t)}return i}function nc(e,t){e.textContent=t?`▲隠す`:`▼表示`}function rc({heading:e,contentVisibilityToggleButton:t}){let n=document.createElement(`div`);n.classList.add(`heading-area`);let r=document.createElement(`h2`);r.textContent=e.text,n.appendChild(r);let i=document.createElement(`button`);return i.classList.add(`content-visibility-toggle-button`),nc(i,!0),t.onClick&&i.addEventListener(`click`,t.onClick.bind(i)),n.appendChild(i),n}var ic=`user-variable-list-section`;function ac({kind:e,elementStore:t}){let n=document.createElement(`section`);n.classList.add(ic),n.dataset.kind=e;let r=Ys({kind:e,elementStore:t});t.updateUserVarListElement(e,r);let i=tc({elementStore:t,heading:{text:e===`named`?`名前つき変数一覧`:`変数一覧`},information:(e===`numbered`||void 0)&&{},contentVisibilityToggleButton:{onClick:e=>{let n=t.getNamedUserVarInformationElement();n&&(r.getAttribute(`aria-hidden`)===`true`?oc(r,n,e.target):sc(r,n,e.target))}}});return n.appendChild(i),n.appendChild(r),t.updateUserVarListElement(e,r),n}function oc(e,t,n){e.removeAttribute(`aria-hidden`),t instanceof HTMLElement&&t.removeAttribute(`aria-hidden`),n instanceof HTMLElement&&nc(n,!0)}function sc(e,t,n){e.setAttribute(`aria-hidden`,`true`),t instanceof HTMLElement&&t.setAttribute(`aria-hidden`,`true`),n instanceof HTMLElement&&nc(n,!1)}function cc(){let e=new Map,t=new Map,n=new Map,r=null;return{getAllNamedUserVarIndeciesSet:()=>new Set(t.keys()),updateUserVarElementInfo:(n,r)=>{if(typeof n==`number`)e.set(n,r);else if(typeof n==`string`)t.set(n,r);else throw TypeError(`Invalid index: ${n}`)},getUserVarElementInfo:n=>{if(typeof n==`number`)return e.get(n);if(typeof n==`string`)return t.get(n);throw TypeError(`Invalid index: ${n}`)},deleteUserVarElementInfo:n=>{if(typeof n==`number`)e.delete(n);else if(typeof n==`string`)t.delete(n);else throw TypeError(`Invalid index: ${n}`)},getUserVarListElement:e=>n.get(e),updateUserVarListElement:(e,t)=>{n.set(e,t)},deleteUserVarListElement:e=>{n.delete(e)},getNamedUserVarInformationElement:()=>r,updateNamedUserVarInformationElement:e=>{r=e},deleteNamedUserVarInformationElement:()=>{r=null},dispose:()=>{e.clear(),t.clear(),n.clear(),r=null}}}function lc(e,t){let n=e.getAllNamedUserVarIndeciesSet(),r=e.getUserVarListElement(`named`);for(let[i,a]of t){let t=e.getUserVarElementInfo(i)?.cardValueElement;n.delete(i),t?Ks(t,a):Zs(e,r,{index:i,value:a})}for(let t of n){let n=e.getUserVarElementInfo(t)?.cardElement.parentElement;n instanceof HTMLLIElement&&(e.getUserVarListElement(`named`)?.removeChild(n),e.deleteUserVarElementInfo(t))}}function uc(e,t){Array.from({length:R.USER_VAR_NUM}).map((n,r)=>{let i=e.getUserVarElementInfo(r)?.cardValueElement;i&&Ks(i,t[r])})}function dc(e,t){Array.from({length:R.USER_VAR_NUM}).map((n,r)=>{let i=t[r];if(!i)return;let a=e.getUserVarElementInfo(r);if(!a)return;let o=a.cardIndexElement,s=a.cardIndexLabelElement;Rs(s,i),Gs(o,s)})}function fc(e,t,n=!1){ec(e.getNamedUserVarInformationElement(),t,n)}var pc=`wwa-vardump-wrapper`;function mc(e){let t=Le(e),n=cc();return t instanceof HTMLElement?(t.classList.add(pc),t.appendChild(ac({kind:`named`,elementStore:n})),t.appendChild(ac({kind:`numbered`,elementStore:n})),{updateAllVariables:({namedUserVar:e,userVar:t})=>{e&&lc(n,e),t&&uc(n,t)},numberedUserVariable:{updateValues:e=>uc(n,e),updateLabels:e=>dc(n,e),updateInformation:(e,t=!1)=>fc(n,e,t)},namedUserVariable:{updateValues:e=>lc(n,e)}}):null}function hc(){return{mapdata:``,urlGateEnable:!1,titleImg:void 0,audioDir:`./audio/`,classicModeEnable:!1,itemEffectEnable:!0,useGoToWwa:!1,lookingAround:!1,autoSave:!0,disallowLoadOldSave:!1,resumeSaveData:void 0,varDump:null,userVarNamesFile:void 0,displayUserVars:!1,virtualPadEnable:!1,virtualPadViewportFitEnable:!1,virtualPadControllerElm:void 0,userDefinedScriptsFile:`./script/script_file_list.json`,frameRateDisplayingPattern:`default-off`}}var gc;function _c(e,t,n){var r=new ge;return r.current=e,r.total=t,r.stage=n,r}var vc=class{constructor(e=hc()){this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0,this._windowCloseWaitingMessageDisplayRequests=[],this._playerAndObjectsStopWaitingMessageDisplayRequests=[],this._windowCloseWaitingJumpGateRequest=void 0,this._debugConsoleElement=void 0,this._frameRateDisplayingPattern=`default-off`,this.audioExtension=``,this.soundLoadedCheckTimer=void 0,this._playTimeCalculator=void 0,this._varDump=null,this.userDefinedFunctions={},this.convertWwaNodes=e=>Jo(Ps(e)),this._prevTimeStamp=-1,this._accumlatedTimeMs=0,this._samplingTimeMs=0,this._frameCountForMeasureFps=0,this.mainCaller=e=>{if(this._prevTimeStamp<0){this._prevTimeStamp=e,requestAnimationFrame(this.mainCaller.bind(this));return}let t=e-this._prevTimeStamp;this._prevTimeStamp=e,this._accumlatedTimeMs+=t,this._accumlatedTimeMs>=R.INTERVAL_MS&&(this._accumlatedTimeMs-=R.INTERVAL_MS,this._accumlatedTimeMs>R.INTERVAL_MS*2&&(this._accumlatedTimeMs=0),this._main(),this._frameCountForMeasureFps++),this._samplingTimeMs+=t,this._samplingTimeMs>=1e3&&(this._gameFrameRateWindow?.updateCurrentFps(this._frameCountForMeasureFps/(this._samplingTimeMs/1e3)),this._frameCountForMeasureFps=0,this._samplingTimeMs=0),requestAnimationFrame(this.mainCaller.bind(this))},this.soundCheckCaller=()=>this.checkAllSoundLoaded(),this._checkTurnKeyPressed=()=>this._keyStore.checkHitKey(V.KEY_ESC)||this._keyStore.checkHitKey(V.KEY_SHIFT)||this._keyStore.checkHitKey(V.KEY_N),this._saveDataList=[],this.wwaCustomEventEmitter=new Qi(U(`wwa-wrapper`));let t;window.addEventListener(`click`,e=>{this._isActive=!1}),U(`wwa-wrapper`).addEventListener(`click`,e=>{e.stopPropagation(),this._isActive=!0}),this._isActive=!0,e.titleImg===void 0?(this._hasTitleImg=!1,this._cvsCover=U(`progress-panel`),t=this._cvsCover.getContext(`2d`),t.fillStyle=`rgb(0, 0, 0)`):this._hasTitleImg=!0;try{this._hasTitleImg?(U(`unstable-version-warning`).textContent=`この WWA Wing は [超安定版] です。`,U(`version`).textContent=`WWA Wing Ver.4.0.8-fps-measure.based-on.4.0.7`):this._setLoadingMessage(t,0)}catch{}this._varDump=e.varDump;let n=window.AudioContext||window.webkitAudioContext;n&&(this.audioContext=new n,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));let r=new Audio;if(r.canPlayType(`audio/mpeg`)!==`no`&&r.canPlayType(`audio/mpeg`)!==``?this.audioExtension=`mp3`:this.audioExtension=`m4a`,this._isURLGateEnable=e.urlGateEnable,this._isClassicModeEnable=e.classicModeEnable,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new x(0,0,0,0),e.audioDir?e.audioDir[e.audioDir.length-1]!==`/`&&(e.audioDir+=`/`):e.audioDir=`./audio/`,this._audioDirectory=e.audioDir,this._bottomButtonType=e.useGoToWwa?T.GOTO_WWA:T.BATTLE_REPORT,this._userVarNameList=[],this.evalCalcWwaNodeGenerator=new As(this),this.userDevice=new M,location.href.match(/^file/))switch(this.userDevice.device){case re.GAME:switch(this.userDevice.os){case ne.NINTENDO:R.BATTLE_INTERVAL_FRAME_NUM=5;break}this._bottomButtonType=T.GAME_END;break;default:alert(`【警告】直接HTMLファイルを開いているようです。
95
95
  このプログラムは正常に動作しない可能性があります。
96
96
  マップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。
97
- `+(this.userDevice.browser===ie.FIREFOX?`Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。`:``));break}switch(this.userDevice.device){case re.VR:case re.GAME:this._usePassword=!1;break;default:this._usePassword=!0;break}switch(U(`cell-save`).textContent=he.QUICK_SAVE,this._usePassword?U(`cell-load`).textContent=he.PASSWORD:U(`cell-load`).textContent=he.EMPTY_LOAD,this._bottomButtonType){case T.GOTO_WWA:U(`cell-gotowwa`).textContent=he.GOTO_WWA;break;case T.BATTLE_REPORT:U(`cell-gotowwa`).textContent=he.BATTLE_REPORT;break;case T.GAME_END:U(`cell-gotowwa`).textContent=he.GAME_END;break}let i=performance.now();console.log(`WWA のロード処理を開始します`),Promise.all([new Promise(async n=>{let r=performance.now();console.log(`(A-1) マップデータ ${e.mapdata} のロードを開始します`);let i=new Zi,a=t=>{i.removeListener(`mapData`,a),i.removeListener(`progress`,o),i.removeListener(`error`,s),console.log(`(A-1) マップデータ ${e.mapdata} のロードが完了しました (${performance.now()-r}ms)`),n(t)},o=e=>this._setProgressBar(e),s=e=>{throw this._setErrorMessage(`下記のエラーが発生しました。:
97
+ `+(this.userDevice.browser===ie.FIREFOX?`Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。`:``));break}switch(this.userDevice.device){case re.VR:case re.GAME:this._usePassword=!1;break;default:this._usePassword=!0;break}switch(U(`cell-save`).textContent=he.QUICK_SAVE,this._usePassword?U(`cell-load`).textContent=he.PASSWORD:U(`cell-load`).textContent=he.EMPTY_LOAD,this._bottomButtonType){case T.GOTO_WWA:U(`cell-gotowwa`).textContent=he.GOTO_WWA;break;case T.BATTLE_REPORT:U(`cell-gotowwa`).textContent=he.BATTLE_REPORT;break;case T.GAME_END:U(`cell-gotowwa`).textContent=he.GAME_END;break}let i=performance.now();console.log(`WWA のロード処理を開始します`),Promise.all([new Promise(async n=>{let r=performance.now();console.log(`(A-1) マップデータ ${e.mapdata} のロードを開始します`);let i=new Qi,a=t=>{i.removeListener(`mapData`,a),i.removeListener(`progress`,o),i.removeListener(`error`,s),console.log(`(A-1) マップデータ ${e.mapdata} のロードが完了しました (${performance.now()-r}ms)`),n(t)},o=e=>this._setProgressBar(e),s=e=>{throw this._setErrorMessage(`下記のエラーが発生しました。:
98
98
  `+e.message,t),Error(`MapData Load Error: `+e.message)};i.addListener(`mapData`,a),i.addListener(`progress`,o),i.addListener(`error`,s),await new jn(e.mapdata,i).requestAndLoadMapData()}).then(t=>{let n=performance.now();console.log(`(A-2) マップデータからリスタートデータの作成を開始します`),t.isItemEffectEnabled=e.itemEffectEnable;let r=e.mapdata.split(`/`);r.pop(),r.push(t.mapCGName),t.mapCGName=r.join(`/`);let i={wwaData:t,restartData:structuredClone(t),checkOriginalMapString:this._generateMapDataHash(t)};return console.log(`(A-2) マップデータからのリスタートデータの作成が完了しました (${performance.now()-n}ms)`),i}).then(e=>new Promise(n=>{let r=performance.now();console.log(`(A-3) マップ画像 ${e.wwaData.mapCGName} のロードを開始します`);let i=new Image;i.src=e.wwaData.mapCGName,i.decode().then(()=>{console.log(`(A-3) マップ画像 ${e.wwaData.mapCGName} のロードが完了しました (${performance.now()-r}ms)`),n(e)}).catch(()=>{throw this._setErrorMessage(`画像ファイル「`+e.wwaData.mapCGName+`」が見つかりませんでした。
99
99
  管理者の方へ: データがアップロードされているか、
100
- パーミッションを確かめてください。`,t),Error(`Map CG Image Load Error`)})})),new Promise(async t=>{if(this._canDisplayUserVars=e.displayUserVars,!this._canDisplayUserVars){console.log(`(B) ユーザー変数の表示機能は無効化されています`),t();return}let n=performance.now();console.log(`(B) ユーザー変数名一覧のロードおよび初期化を開始します (名前一覧ファイル: ${e.userVarNamesFile??`未指定`})`),this._inlineUserVarViewer={topUserVarIndex:{named:0,numbered:0},isVisible:!1,kind:`numbered`};let r=await(e.userVarNamesFile?Bn(e.userVarNamesFile):{kind:`noFileSpecified`,errorMessage:`data-wwa-user-var-names-file 属性に、変数の説明を記したファイル名を書くことで、その説明を表示できます。詳しくはマニュアルをご覧ください。`});switch(this.setUserVarStatus(r,e.userVarNamesFile),r.kind){case`data`:console.log(`(B) ユーザー変数名一覧のロードおよび初期化が完了しました (${performance.now()-n}ms)`);break;case`noFileSpecified`:console.log(`(B) ユーザー変数名一覧のロードはスキップされました (${performance.now()-n}ms)`);break;default:console.warn(`(B) ユーザー変数名一覧のロード中にエラーが発生しました (${performance.now()-n}ms)`),console.warn(`(B) `+r.errorMessage);break}t()}),new Promise(async t=>{let n=performance.now(),r=e.userDefinedScriptsFile??`./script/script_file_list.json`;console.log(`(C) 外部 WWA Script のロード・解析を開始します (リストファイル: ${r})`);let i=await Bn(r);if(i?.kind===`data`&&Array.isArray(i.data)){console.log(`(C) これらの外部 WWA Script がロードされます:`,i.data);let e=i.data.map(e=>Ns(e));(await Promise.allSettled(e)).forEach(e=>{if(e.status!==`fulfilled`){alert(`(C) 外部スクリプト ${e.reason.fileName} のロード中にエラーが発生しました。\nこのままゲームを開始することはできますが、正常に動作しない可能性が高いです。\n\n詳細:\n${e.reason.message}`),console.error(e.reason.message);return}switch(e.value.kind){case`data`:try{this.setUserScript(e.value)}catch(t){alert(`外部スクリプト ${e.value.fileName} の解析中にエラーが発生しました。\nこのままゲームを開始することはできますが、正常に動作しない可能性が高いです。\n\n詳細:\n${t instanceof Error?t.message:String(t)}`),console.error(`(C) 外部スクリプト ${e.value.fileName} の解析中にエラーが発生しました。`,t)}return;case`httpError`:console.warn(`(C) 外部スクリプト ${e.value.fileName} が見つからなかったか、その他のHTTPエラーが発生しました。`,e.value.errorMessage);return;case`otherError`:alert(`外部スクリプト ${e.value.fileName} のロード中にエラーが発生しました。\nこのままゲームを開始することはできますが、正常に動作しない可能性が高いです。\n\n詳細:\n${e.value.errorMessage}`),console.error(`(C) 外部スクリプト ${e.value.fileName} のロード中にエラーが発生しました。`,e.value.errorMessage);return;default:alert(`外部スクリプトの解析中に予期せぬエラーが発生しました`),console.error(`(C) 外部スクリプト ${e.value.fileName} の解析中に予期せぬエラーが発生しました`,e.value);return}})}else console.log(`(C) 外部 WWA Script のリスト ${r} が見つからなかったか、内容が不正だったため、外部スクリプトはロードされませんでした。`);console.log(`(C) 外部 WWA Script のロード・解析が完了しました (${performance.now()-n}ms)`),t()})]).then(([{wwaData:e,restartData:t,checkOriginalMapString:n}])=>{this._wwaData=e,this._restartData=t,this.checkOriginalMapString=n,console.log(`WWAのロード処理が完了しました。(${performance.now()-i}ms)`)}).then(()=>{try{this._hasTitleImg?U(`version`).textContent+=` (Map data Ver. `+Math.floor(this._wwaData.version/10)+`.`+this._wwaData.version%10+`)`:this._setLoadingMessage(t,1)}catch{}this.initCSSRule(),this._setProgressBar(hc(0,4,_e.GAME_INIT)),this._setLoadingMessage(t,2);let n=this._wwaData.mapCGName.replace(`(`,`\\(`).replace(`)`,`\\)`),r=e=>{e.style.backgroundImage=`url(`+n+`)`};Array.prototype.forEach.call(ze(`div.item-cell`),e=>{e.style.backgroundPosition=`-${this._wwaData.imgItemboxX*R.CHIP_SIZE}px -${this._wwaData.imgItemboxY*R.CHIP_SIZE}px`,e.style.backgroundImage=`url(`+n+`)`}),Array.prototype.forEach.call(ze(`div.wide-cell-row`),e=>{e.style.backgroundPosition=`-160px -120px`,e.style.backgroundImage=`url(`+n+`)`}),Array.prototype.forEach.call(ze(`.item-cell>.item-click-border`),e=>{e.style.backgroundImage=`url('`+R.ITEM_BORDER_IMG_DATA_URL+`')`,e.style.backgroundPosition=`0 0`,e.style.display=`none`,e.style.cursor=`pointer`}),Array.prototype.forEach.call(ze(`.item-cell>.item-disp`),r),Array.prototype.forEach.call(ze(`div.wide-cell-row>.status-icon`),r),this.setStatusIconCoord(L.ENERGY,new S(this._wwaData.imgStatusEnergyX,this._wwaData.imgStatusEnergyY)),this.setStatusIconCoord(L.STRENGTH,new S(this._wwaData.imgStatusStrengthX,this._wwaData.imgStatusStrengthY)),this.setStatusIconCoord(L.DEFENCE,new S(this._wwaData.imgStatusDefenceX,this._wwaData.imgStatusDefenceY)),this.setStatusIconCoord(L.GOLD,new S(this._wwaData.imgStatusGoldX,this._wwaData.imgStatusGoldY)),this._setProgressBar(hc(1,4,_e.GAME_INIT)),this._setLoadingMessage(t,3),this._mapIDTableCreate(),this._replaceAllRandomObjects(),this._cvs=U(`wwa-map`);var i=this._cvs.getContext(`2d`,{alpha:!1});i.fillStyle=`rgba( 255, 255, 255, 0.5)`,i.fillRect(0,0,440,440);var a=new C(this,this._wwaData.playerX,this._wwaData.playerY);this._camera=new Wn(a),this._itemMenu=new Ar;var o=new x(this._wwaData.statusEnergy,this._wwaData.statusStrength,this._wwaData.statusDefence,this._wwaData.statusGold);this._player=new qn(this,a,this._camera,o,this._wwaData.statusEnergyMax,this._wwaData.moves,this._wwaData.gameSpeedIndex),this._userVar={numbered:Array.from({length:R.USER_VAR_NUM}).map(()=>0),named:new Map},this._objectMovingDataManager=new Xn(this,this._player),this._camera.setPlayer(this._player),this._keyStore=new we,this._mouseStore=new Ee,e.virtualPadEnable?(this._virtualPadButtonElements={BUTTON_ENTER:U(`wwa-enter-button`),BUTTON_ESC:U(`wwa-esc-button`),BUTTON_FAST:U(`wwa-fast-button`),BUTTON_SLOW:U(`wwa-slow-button`),BUTTON_LEFT:U(`wwa-left-button`),BUTTON_UP:U(`wwa-up-button`),BUTTON_RIGHT:U(`wwa-right-button`),BUTTON_DOWN:U(`wwa-down-button`)},this._virtualPadStore=new Me(this._virtualPadButtonElements,Or(),U(`wwa-virtualpad-right`),U(`wwa-virtualpad-left`),this._setVirtualPadTouch.bind(this),this._setVirtualPadLeave.bind(this)),vc(e.virtualPadControllerElm,()=>{this._virtualPadStore.toggleVisible()})):(this._virtualPadButtonElements=null,this._virtualPadStore=new Me({})),this._debugConsoleElement=yc(U(`wwa-debug-console-area`)),this._debugConsoleElement?.querySelector(`.script-running-button`).addEventListener(`click`,()=>{this._debugEvalString()}),this._gamePadStore=new De,this._pages=[],this._yesNoJudge=k.UNSELECTED,this._yesNoJudgeInNextFrame=k.UNSELECTED,this._yesNoChoiceCallInfo=N.NONE,this._prevFrameEventExected=!1,this._isLastPage=!1,this._reservedPartsAppearances=[],this._reservedJumpDestination=void 0,this._shouldSetNextPage=!1,this._passwordLoadExecInNextFrame=!1,this._pageExecuting=!1,this._messageWindow=new yr(this,50,180,340,0,this._wwaData.mapCGName,!1,!0,!1,U(`wwa-wrapper`)),this._scoreWindow=new vr(this,new S(50,50),!1,U(`wwa-wrapper`)),this._wwaSave=new Yi(mc,mc._wwaData.worldName,mc._wwaData.worldPassNumber,this._checkSaveDataCompatibility.bind(this),e=>{if(e.length>0){let t=`これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。`;e.forEach(e=>{switch(e){case Ji.UNMATCHED_WORLD_NAME:t+=`
101
- ・制作者によるマップデータのワールド名の変更`;break;case Ji.UNMATCHED_WORLD_PASS_NUMBER:t+=`
102
- ・制作者によるマップデータの暗証番号の変更`;break;case Ji.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:t+=`
103
- ・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)`;break}}),alert(t)}}),this._isDisallowLoadOldSave=e.disallowLoadOldSave,this._messageWindow.setWWASave(this._wwaSave),Li.setRestartData(this._restartData,this._wwaData),this.clearFaces();let s=U(`wwa-wrapper`).getAttribute(`data-wwa-resume-savedata`);if(typeof s==`string`&&(this._useSuspend=!0,s)){var c=Li.getStartWWAData(s);this._restartData!==c&&(this._applyQuickLoad(c),this._wwaSave.resumeStart())}let l=U(`wwa-wrapper`).getAttribute(`data-wwa-autosave`);l!==null&&this._wwaSave.setAutoSaveInterval(Number(l)|0);let u=U(`wwa-wrapper`).getAttribute(`data-wwa-looking-around`);if(this._useLookingAround=!(u&&u.match(/false/i)),this._setProgressBar(hc(2,4,_e.GAME_INIT)),this._setLoadingMessage(t,4),window.addEventListener(`keydown`,e=>{if(this._isActive){switch(this.userDevice.os){case ne.NINTENDO:e.preventDefault(),e.stopPropagation();return}if(this._keyStore.setPressInfo(e.keyCode),e.keyCode===V.KEY_F5){e.preventDefault();return}this._player.isWaitingMessageOrManualPause()?(e.keyCode===V.KEY_DOWN||e.keyCode===V.KEY_LEFT||e.keyCode===V.KEY_RIGHT||e.keyCode===V.KEY_UP||e.keyCode===V.KEY_SHIFT||e.keyCode===V.KEY_ENTER||e.keyCode===V.KEY_ESC||e.keyCode===V.KEY_SPACE)&&e.preventDefault():this._player.isWaitingPasswordWindow()||(e.keyCode===V.KEY_DOWN||e.keyCode===V.KEY_LEFT||e.keyCode===V.KEY_RIGHT||e.keyCode===V.KEY_UP||e.keyCode===V.KEY_SHIFT||e.keyCode===V.KEY_ENTER||e.keyCode===V.KEY_1||e.keyCode===V.KEY_2||e.keyCode===V.KEY_3||e.keyCode===V.KEY_A||e.keyCode===V.KEY_C||e.keyCode===V.KEY_D||e.keyCode===V.KEY_E||e.keyCode===V.KEY_M||e.keyCode===V.KEY_N||e.keyCode===V.KEY_Q||e.keyCode===V.KEY_S||e.keyCode===V.KEY_W||e.keyCode===V.KEY_X||e.keyCode===V.KEY_Y||e.keyCode===V.KEY_Z||e.keyCode===V.KEY_ESC||e.keyCode===V.KEY_F1||e.keyCode===V.KEY_F2||e.keyCode===V.KEY_F3||e.keyCode===V.KEY_F4||e.keyCode===V.KEY_F6||e.keyCode===V.KEY_F7||e.keyCode===V.KEY_F8||e.keyCode===V.KEY_F12||e.keyCode===V.KEY_SPACE)&&e.preventDefault()}}),window.addEventListener(`keyup`,e=>{if(this._isActive){switch(this.userDevice.os){case ne.NINTENDO:e.preventDefault(),e.stopPropagation();return}this._keyStore.setReleaseInfo(e.keyCode),(e.keyCode===V.KEY_F5||(e.keyCode===V.KEY_DOWN||e.keyCode===V.KEY_LEFT||e.keyCode===V.KEY_RIGHT||e.keyCode===V.KEY_UP||e.keyCode===V.KEY_SHIFT||e.keyCode===V.KEY_ENTER||e.keyCode===V.KEY_0||e.keyCode===V.KEY_1||e.keyCode===V.KEY_2||e.keyCode===V.KEY_3||e.keyCode===V.KEY_4||e.keyCode===V.KEY_5||e.keyCode===V.KEY_6||e.keyCode===V.KEY_7||e.keyCode===V.KEY_8||e.keyCode===V.KEY_9||e.keyCode===V.KEY_A||e.keyCode===V.KEY_C||e.keyCode===V.KEY_D||e.keyCode===V.KEY_E||e.keyCode===V.KEY_M||e.keyCode===V.KEY_N||e.keyCode===V.KEY_Q||e.keyCode===V.KEY_S||e.keyCode===V.KEY_W||e.keyCode===V.KEY_X||e.keyCode===V.KEY_Y||e.keyCode===V.KEY_Z||e.keyCode===V.KEY_ESC||e.keyCode===V.KEY_NUM0||e.keyCode===V.KEY_NUM1||e.keyCode===V.KEY_NUM2||e.keyCode===V.KEY_NUM3||e.keyCode===V.KEY_NUM4||e.keyCode===V.KEY_NUM5||e.keyCode===V.KEY_NUM6||e.keyCode===V.KEY_NUM7||e.keyCode===V.KEY_NUM8||e.keyCode===V.KEY_NUM9||e.keyCode===V.KEY_F1||e.keyCode===V.KEY_F3||e.keyCode===V.KEY_F4||e.keyCode===V.KEY_F6||e.keyCode===V.KEY_F7||e.keyCode===V.KEY_F8||e.keyCode===V.KEY_F9||e.keyCode===V.KEY_F12||e.keyCode===V.KEY_SPACE)&&!this._player.isWaitingMessageOrManualPause()&&!this._player.isWaitingPasswordWindow())&&e.preventDefault()}}),window.addEventListener(`blur`,e=>{this._keyStore.allClear(),this._mouseStore.clear(),this._virtualPadStore.allClear()}),window.addEventListener(`contextmenu`,e=>{this._keyStore.allClear(),this._mouseStore.clear(),this._virtualPadStore.allClear()}),window.addEventListener(`help`,e=>{this._isActive&&e.preventDefault()}),this._mouseControllerElement=U(`wwa-controller`),this._mouseControllerElement.addEventListener(`mousedown`,e=>{if(this._isActive&&e.which===1){if(this._mouseStore.getMouseState()!==Te.NONE){e.preventDefault();return}let t=Be(e.clientX,e.clientY),n=this._player.getDrawingCenterPosition(),r=t.substract(n),i=Math.abs(r.x),a=Math.abs(r.y),o,s=!1;if(i<R.CHIP_SIZE&&a<R.CHIP_SIZE){switch(n.x/R.CHIP_SIZE|0){case 0:s=!0,o=E.LEFT;break;case R.H_PARTS_NUM_IN_WINDOW-1:s=!0,o=E.RIGHT;break}switch(n.y/R.CHIP_SIZE|0){case 0:s=!0,o=E.UP;break;case R.V_PARTS_NUM_IN_WINDOW-1:s=!0,o=E.DOWN;break}}s||(r.y>0&&a>i?o=E.DOWN:r.y<0&&a>i?o=E.UP:r.x>0&&a<i?o=E.RIGHT:r.x<0&&a<i&&(o=E.LEFT)),this._mouseStore.setPressInfo(o,0)}}),this._mouseControllerElement.addEventListener(`mouseleave`,e=>{this._mouseStore.clear()}),this._mouseControllerElement.addEventListener(`mouseup`,e=>{this._isActive&&e.which===1&&(this._mouseStore.setReleaseInfo(),e.preventDefault())}),window.TouchEvent){if(this.audioContext){let e=()=>{this.audioContext.createBufferSource().start(0),this._mouseControllerElement.removeEventListener(`touchstart`,e),e=null};this._mouseControllerElement.addEventListener(`touchstart`,e)}this._mouseControllerElement.addEventListener(`touchstart`,e=>{if(!this._isActive)return;if(this._mouseStore.getMouseState()!==Te.NONE){e.preventDefault();return}let t=e.changedTouches,n=t.length;for(let e=0;e<n;e++){let n=t[e],r=Be(n.clientX,n.clientY),i=this._player.getDrawingCenterPosition(),a=r.substract(i),o=Math.abs(a.x),s=Math.abs(a.y),c,l=!1;if(o<R.CHIP_SIZE&&s<R.CHIP_SIZE){switch(i.x/R.CHIP_SIZE|0){case 0:l=!0,c=E.LEFT;break;case R.H_PARTS_NUM_IN_WINDOW-1:l=!0,c=E.RIGHT;break}switch(i.y/R.CHIP_SIZE|0){case 0:l=!0,c=E.UP;break;case R.V_PARTS_NUM_IN_WINDOW-1:l=!0,c=E.DOWN;break}}l||(a.y>0&&s>o?c=E.DOWN:a.y<0&&s>o?c=E.UP:a.x>0&&s<o?c=E.RIGHT:a.x<0&&s<o&&(c=E.LEFT)),this._mouseStore.setPressInfo(c,n.identifier)}e.cancelable&&e.preventDefault()});let e=e=>{if(this._isActive){for(let t=0;t<e.changedTouches.length;t++)if(this._mouseStore.getTouchID()===e.changedTouches[t].identifier){this._mouseStore.setReleaseInfo(),e.preventDefault();break}}};this._mouseControllerElement.addEventListener(`touchend`,e),this._mouseControllerElement.addEventListener(`touchcancel`,e)}U(`button-load`).addEventListener(`click`,()=>{(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onselectbutton(P.QUICK_LOAD)}),U(`button-save`).addEventListener(`click`,()=>{(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onselectbutton(P.QUICK_SAVE)}),U(`button-restart`).addEventListener(`click`,()=>{(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onselectbutton(P.RESTART_GAME)}),U(`button-gotowwa`).addEventListener(`click`,()=>{(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onselectbutton(P.GOTO_WWA,!1,!1)}),Array.prototype.forEach.call(ze(`.wide-cell-row`),e=>{e.addEventListener(`click`,()=>{this._displayHelp()})}),this._frameCoord=new S(R.IMGPOS_DEFAULT_FRAME_X,R.IMGPOS_DEFAULT_YESNO_Y),this._battleEffectCoord=new S(R.IMGPOS_DEFAULT_BATTLE_EFFECT_X,R.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),this._battleEstimateWindow=new xr(this,this._wwaData.mapCGName,U(`wwa-wrapper`)),this._passwordWindow=new Er(this,U(`wwa-wrapper`),e.disallowLoadOldSave),this._monsterWindow=new _r(this,new S(50,180),340,60,!1,U(`wwa-wrapper`),this._wwaData.mapCGName),this._setProgressBar(hc(3,4,_e.GAME_INIT)),this._isLoadedSound=!1,this._temporaryInputDisable=!1,this._paintSkipByDoorOpen=!1,this._clearFacesInNextFrame=!1,this._useConsole=!1,this._playTimeCalculator=new Oe,this.wwaCustomEvent(`wwa_startup`),this._cgManager=new Un(i,this._wwaData.mapCGName,this._frameCoord,this,e.pictureImageNamesFile,()=>{this._isSkippedSoundMessage=!0;let n=()=>{switch(this.userDevice.device){case re.PC:this.registerSystemMessagePage(`ゲームを開始します。
100
+ パーミッションを確かめてください。`,t),Error(`Map CG Image Load Error`)})})),new Promise(async t=>{if(this._canDisplayUserVars=e.displayUserVars,!this._canDisplayUserVars){console.log(`(B) ユーザー変数の表示機能は無効化されています`),t();return}let n=performance.now();console.log(`(B) ユーザー変数名一覧のロードおよび初期化を開始します (名前一覧ファイル: ${e.userVarNamesFile??`未指定`})`),this._inlineUserVarViewer={topUserVarIndex:{named:0,numbered:0},isVisible:!1,kind:`numbered`};let r=await(e.userVarNamesFile?Bn(e.userVarNamesFile):{kind:`noFileSpecified`,errorMessage:`data-wwa-user-var-names-file 属性に、変数の説明を記したファイル名を書くことで、その説明を表示できます。詳しくはマニュアルをご覧ください。`});switch(this.setUserVarStatus(r,e.userVarNamesFile),r.kind){case`data`:console.log(`(B) ユーザー変数名一覧のロードおよび初期化が完了しました (${performance.now()-n}ms)`);break;case`noFileSpecified`:console.log(`(B) ユーザー変数名一覧のロードはスキップされました (${performance.now()-n}ms)`);break;default:console.warn(`(B) ユーザー変数名一覧のロード中にエラーが発生しました (${performance.now()-n}ms)`),console.warn(`(B) `+r.errorMessage);break}t()}),new Promise(async t=>{let n=performance.now(),r=e.userDefinedScriptsFile??`./script/script_file_list.json`;console.log(`(C) 外部 WWA Script のロード・解析を開始します (リストファイル: ${r})`);let i=await Bn(r);if(i?.kind===`data`&&Array.isArray(i.data)){console.log(`(C) これらの外部 WWA Script がロードされます:`,i.data);let e=i.data.map(e=>Fs(e));(await Promise.allSettled(e)).forEach(e=>{if(e.status!==`fulfilled`){alert(`(C) 外部スクリプト ${e.reason.fileName} のロード中にエラーが発生しました。\nこのままゲームを開始することはできますが、正常に動作しない可能性が高いです。\n\n詳細:\n${e.reason.message}`),console.error(e.reason.message);return}switch(e.value.kind){case`data`:try{this.setUserScript(e.value)}catch(t){alert(`外部スクリプト ${e.value.fileName} の解析中にエラーが発生しました。\nこのままゲームを開始することはできますが、正常に動作しない可能性が高いです。\n\n詳細:\n${t instanceof Error?t.message:String(t)}`),console.error(`(C) 外部スクリプト ${e.value.fileName} の解析中にエラーが発生しました。`,t)}return;case`httpError`:console.warn(`(C) 外部スクリプト ${e.value.fileName} が見つからなかったか、その他のHTTPエラーが発生しました。`,e.value.errorMessage);return;case`otherError`:alert(`外部スクリプト ${e.value.fileName} のロード中にエラーが発生しました。\nこのままゲームを開始することはできますが、正常に動作しない可能性が高いです。\n\n詳細:\n${e.value.errorMessage}`),console.error(`(C) 外部スクリプト ${e.value.fileName} のロード中にエラーが発生しました。`,e.value.errorMessage);return;default:alert(`外部スクリプトの解析中に予期せぬエラーが発生しました`),console.error(`(C) 外部スクリプト ${e.value.fileName} の解析中に予期せぬエラーが発生しました`,e.value);return}})}else console.log(`(C) 外部 WWA Script のリスト ${r} が見つからなかったか、内容が不正だったため、外部スクリプトはロードされませんでした。`);console.log(`(C) 外部 WWA Script のロード・解析が完了しました (${performance.now()-n}ms)`),t()})]).then(([{wwaData:e,restartData:t,checkOriginalMapString:n}])=>{this._wwaData=e,this._restartData=t,this.checkOriginalMapString=n,console.log(`WWAのロード処理が完了しました。(${performance.now()-i}ms)`)}).then(()=>{try{this._hasTitleImg?U(`version`).textContent+=` (Map data Ver. `+Math.floor(this._wwaData.version/10)+`.`+this._wwaData.version%10+`)`:this._setLoadingMessage(t,1)}catch{}this.initCSSRule(),this._setProgressBar(_c(0,4,_e.GAME_INIT)),this._setLoadingMessage(t,2);let n=this._wwaData.mapCGName.replace(`(`,`\\(`).replace(`)`,`\\)`),r=e=>{e.style.backgroundImage=`url(`+n+`)`};Array.prototype.forEach.call(ze(`div.item-cell`),e=>{e.style.backgroundPosition=`-${this._wwaData.imgItemboxX*R.CHIP_SIZE}px -${this._wwaData.imgItemboxY*R.CHIP_SIZE}px`,e.style.backgroundImage=`url(`+n+`)`}),Array.prototype.forEach.call(ze(`div.wide-cell-row`),e=>{e.style.backgroundPosition=`-160px -120px`,e.style.backgroundImage=`url(`+n+`)`}),Array.prototype.forEach.call(ze(`.item-cell>.item-click-border`),e=>{e.style.backgroundImage=`url('`+R.ITEM_BORDER_IMG_DATA_URL+`')`,e.style.backgroundPosition=`0 0`,e.style.display=`none`,e.style.cursor=`pointer`}),Array.prototype.forEach.call(ze(`.item-cell>.item-disp`),r),Array.prototype.forEach.call(ze(`div.wide-cell-row>.status-icon`),r),this.setStatusIconCoord(L.ENERGY,new S(this._wwaData.imgStatusEnergyX,this._wwaData.imgStatusEnergyY)),this.setStatusIconCoord(L.STRENGTH,new S(this._wwaData.imgStatusStrengthX,this._wwaData.imgStatusStrengthY)),this.setStatusIconCoord(L.DEFENCE,new S(this._wwaData.imgStatusDefenceX,this._wwaData.imgStatusDefenceY)),this.setStatusIconCoord(L.GOLD,new S(this._wwaData.imgStatusGoldX,this._wwaData.imgStatusGoldY)),this._setProgressBar(_c(1,4,_e.GAME_INIT)),this._setLoadingMessage(t,3),this._mapIDTableCreate(),this._replaceAllRandomObjects(),this._cvs=U(`wwa-map`);var i=this._cvs.getContext(`2d`,{alpha:!1});i.fillStyle=`rgba( 255, 255, 255, 0.5)`,i.fillRect(0,0,440,440);var a=new C(this,this._wwaData.playerX,this._wwaData.playerY);this._camera=new Wn(a),this._itemMenu=new jr;var o=new x(this._wwaData.statusEnergy,this._wwaData.statusStrength,this._wwaData.statusDefence,this._wwaData.statusGold);this._player=new qn(this,a,this._camera,o,this._wwaData.statusEnergyMax,this._wwaData.moves,this._wwaData.gameSpeedIndex),this._userVar={numbered:Array.from({length:R.USER_VAR_NUM}).map(()=>0),named:new Map},this._objectMovingDataManager=new Xn(this,this._player),this._camera.setPlayer(this._player),this._keyStore=new we,this._mouseStore=new Ee,e.virtualPadEnable?(this._virtualPadButtonElements={BUTTON_ENTER:U(`wwa-enter-button`),BUTTON_ESC:U(`wwa-esc-button`),BUTTON_FAST:U(`wwa-fast-button`),BUTTON_SLOW:U(`wwa-slow-button`),BUTTON_LEFT:U(`wwa-left-button`),BUTTON_UP:U(`wwa-up-button`),BUTTON_RIGHT:U(`wwa-right-button`),BUTTON_DOWN:U(`wwa-down-button`)},this._virtualPadStore=new Me(this._virtualPadButtonElements,kr(),U(`wwa-virtualpad-right`),U(`wwa-virtualpad-left`),this._setVirtualPadTouch.bind(this),this._setVirtualPadLeave.bind(this)),bc(e.virtualPadControllerElm,()=>{this._virtualPadStore.toggleVisible()})):(this._virtualPadButtonElements=null,this._virtualPadStore=new Me({})),this._debugConsoleElement=xc(U(`wwa-debug-console-area`)),this._debugConsoleElement?.querySelector(`.script-running-button`).addEventListener(`click`,()=>{this._debugEvalString()}),this._gamePadStore=new De,this._pages=[],this._yesNoJudge=k.UNSELECTED,this._yesNoJudgeInNextFrame=k.UNSELECTED,this._yesNoChoiceCallInfo=N.NONE,this._prevFrameEventExected=!1,this._isLastPage=!1,this._reservedPartsAppearances=[],this._reservedJumpDestination=void 0,this._shouldSetNextPage=!1,this._passwordLoadExecInNextFrame=!1,this._pageExecuting=!1,this._messageWindow=new yr(this,50,180,340,0,this._wwaData.mapCGName,!1,!0,!1,U(`wwa-wrapper`)),this._scoreWindow=new vr(this,new S(50,50),!1,U(`wwa-wrapper`)),this._wwaSave=new Xi(gc,gc._wwaData.worldName,gc._wwaData.worldPassNumber,this._checkSaveDataCompatibility.bind(this),e=>{if(e.length>0){let t=`これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。`;e.forEach(e=>{switch(e){case Yi.UNMATCHED_WORLD_NAME:t+=`
101
+ ・制作者によるマップデータのワールド名の変更`;break;case Yi.UNMATCHED_WORLD_PASS_NUMBER:t+=`
102
+ ・制作者によるマップデータの暗証番号の変更`;break;case Yi.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:t+=`
103
+ ・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)`;break}}),alert(t)}}),this._isDisallowLoadOldSave=e.disallowLoadOldSave,this._messageWindow.setWWASave(this._wwaSave),Ri.setRestartData(this._restartData,this._wwaData),this.clearFaces();let s=U(`wwa-wrapper`).getAttribute(`data-wwa-resume-savedata`);if(typeof s==`string`&&(this._useSuspend=!0,s)){var c=Ri.getStartWWAData(s);this._restartData!==c&&(this._applyQuickLoad(c),this._wwaSave.resumeStart())}let l=U(`wwa-wrapper`).getAttribute(`data-wwa-autosave`);l!==null&&this._wwaSave.setAutoSaveInterval(Number(l)|0);let u=U(`wwa-wrapper`).getAttribute(`data-wwa-looking-around`);if(this._useLookingAround=!(u&&u.match(/false/i)),this._setProgressBar(_c(2,4,_e.GAME_INIT)),this._setLoadingMessage(t,4),window.addEventListener(`keydown`,e=>{if(this._isActive){switch(this.userDevice.os){case ne.NINTENDO:e.preventDefault(),e.stopPropagation();return}if(this._keyStore.setPressInfo(e.keyCode),e.keyCode===V.KEY_F5){e.preventDefault();return}this._player.isWaitingMessageOrManualPause()?(e.keyCode===V.KEY_DOWN||e.keyCode===V.KEY_LEFT||e.keyCode===V.KEY_RIGHT||e.keyCode===V.KEY_UP||e.keyCode===V.KEY_SHIFT||e.keyCode===V.KEY_ENTER||e.keyCode===V.KEY_ESC||e.keyCode===V.KEY_SPACE)&&e.preventDefault():this._player.isWaitingPasswordWindow()||(e.keyCode===V.KEY_DOWN||e.keyCode===V.KEY_LEFT||e.keyCode===V.KEY_RIGHT||e.keyCode===V.KEY_UP||e.keyCode===V.KEY_SHIFT||e.keyCode===V.KEY_ENTER||e.keyCode===V.KEY_1||e.keyCode===V.KEY_2||e.keyCode===V.KEY_3||e.keyCode===V.KEY_A||e.keyCode===V.KEY_C||e.keyCode===V.KEY_D||e.keyCode===V.KEY_E||e.keyCode===V.KEY_M||e.keyCode===V.KEY_N||e.keyCode===V.KEY_Q||e.keyCode===V.KEY_S||e.keyCode===V.KEY_W||e.keyCode===V.KEY_X||e.keyCode===V.KEY_Y||e.keyCode===V.KEY_Z||e.keyCode===V.KEY_ESC||e.keyCode===V.KEY_F1||e.keyCode===V.KEY_F2||e.keyCode===V.KEY_F3||e.keyCode===V.KEY_F4||e.keyCode===V.KEY_F6||e.keyCode===V.KEY_F7||e.keyCode===V.KEY_F8||e.keyCode===V.KEY_F12||e.keyCode===V.KEY_SPACE)&&e.preventDefault()}}),window.addEventListener(`keyup`,e=>{if(this._isActive){switch(this.userDevice.os){case ne.NINTENDO:e.preventDefault(),e.stopPropagation();return}this._keyStore.setReleaseInfo(e.keyCode),(e.keyCode===V.KEY_F5||(e.keyCode===V.KEY_DOWN||e.keyCode===V.KEY_LEFT||e.keyCode===V.KEY_RIGHT||e.keyCode===V.KEY_UP||e.keyCode===V.KEY_SHIFT||e.keyCode===V.KEY_ENTER||e.keyCode===V.KEY_0||e.keyCode===V.KEY_1||e.keyCode===V.KEY_2||e.keyCode===V.KEY_3||e.keyCode===V.KEY_4||e.keyCode===V.KEY_5||e.keyCode===V.KEY_6||e.keyCode===V.KEY_7||e.keyCode===V.KEY_8||e.keyCode===V.KEY_9||e.keyCode===V.KEY_A||e.keyCode===V.KEY_C||e.keyCode===V.KEY_D||e.keyCode===V.KEY_E||e.keyCode===V.KEY_M||e.keyCode===V.KEY_N||e.keyCode===V.KEY_Q||e.keyCode===V.KEY_S||e.keyCode===V.KEY_W||e.keyCode===V.KEY_X||e.keyCode===V.KEY_Y||e.keyCode===V.KEY_Z||e.keyCode===V.KEY_ESC||e.keyCode===V.KEY_NUM0||e.keyCode===V.KEY_NUM1||e.keyCode===V.KEY_NUM2||e.keyCode===V.KEY_NUM3||e.keyCode===V.KEY_NUM4||e.keyCode===V.KEY_NUM5||e.keyCode===V.KEY_NUM6||e.keyCode===V.KEY_NUM7||e.keyCode===V.KEY_NUM8||e.keyCode===V.KEY_NUM9||e.keyCode===V.KEY_F1||e.keyCode===V.KEY_F3||e.keyCode===V.KEY_F4||e.keyCode===V.KEY_F6||e.keyCode===V.KEY_F7||e.keyCode===V.KEY_F8||e.keyCode===V.KEY_F9||e.keyCode===V.KEY_F12||e.keyCode===V.KEY_SPACE)&&!this._player.isWaitingMessageOrManualPause()&&!this._player.isWaitingPasswordWindow())&&e.preventDefault()}}),window.addEventListener(`blur`,e=>{this._keyStore.allClear(),this._mouseStore.clear(),this._virtualPadStore.allClear()}),window.addEventListener(`contextmenu`,e=>{this._keyStore.allClear(),this._mouseStore.clear(),this._virtualPadStore.allClear()}),window.addEventListener(`help`,e=>{this._isActive&&e.preventDefault()}),this._mouseControllerElement=U(`wwa-controller`),this._mouseControllerElement.addEventListener(`mousedown`,e=>{if(this._isActive&&e.which===1){if(this._mouseStore.getMouseState()!==Te.NONE){e.preventDefault();return}let t=Be(e.clientX,e.clientY),n=this._player.getDrawingCenterPosition(),r=t.substract(n),i=Math.abs(r.x),a=Math.abs(r.y),o,s=!1;if(i<R.CHIP_SIZE&&a<R.CHIP_SIZE){switch(n.x/R.CHIP_SIZE|0){case 0:s=!0,o=E.LEFT;break;case R.H_PARTS_NUM_IN_WINDOW-1:s=!0,o=E.RIGHT;break}switch(n.y/R.CHIP_SIZE|0){case 0:s=!0,o=E.UP;break;case R.V_PARTS_NUM_IN_WINDOW-1:s=!0,o=E.DOWN;break}}s||(r.y>0&&a>i?o=E.DOWN:r.y<0&&a>i?o=E.UP:r.x>0&&a<i?o=E.RIGHT:r.x<0&&a<i&&(o=E.LEFT)),this._mouseStore.setPressInfo(o,0)}}),this._mouseControllerElement.addEventListener(`mouseleave`,e=>{this._mouseStore.clear()}),this._mouseControllerElement.addEventListener(`mouseup`,e=>{this._isActive&&e.which===1&&(this._mouseStore.setReleaseInfo(),e.preventDefault())}),window.TouchEvent){if(this.audioContext){let e=()=>{this.audioContext.createBufferSource().start(0),this._mouseControllerElement.removeEventListener(`touchstart`,e),e=null};this._mouseControllerElement.addEventListener(`touchstart`,e)}this._mouseControllerElement.addEventListener(`touchstart`,e=>{if(!this._isActive)return;if(this._mouseStore.getMouseState()!==Te.NONE){e.preventDefault();return}let t=e.changedTouches,n=t.length;for(let e=0;e<n;e++){let n=t[e],r=Be(n.clientX,n.clientY),i=this._player.getDrawingCenterPosition(),a=r.substract(i),o=Math.abs(a.x),s=Math.abs(a.y),c,l=!1;if(o<R.CHIP_SIZE&&s<R.CHIP_SIZE){switch(i.x/R.CHIP_SIZE|0){case 0:l=!0,c=E.LEFT;break;case R.H_PARTS_NUM_IN_WINDOW-1:l=!0,c=E.RIGHT;break}switch(i.y/R.CHIP_SIZE|0){case 0:l=!0,c=E.UP;break;case R.V_PARTS_NUM_IN_WINDOW-1:l=!0,c=E.DOWN;break}}l||(a.y>0&&s>o?c=E.DOWN:a.y<0&&s>o?c=E.UP:a.x>0&&s<o?c=E.RIGHT:a.x<0&&s<o&&(c=E.LEFT)),this._mouseStore.setPressInfo(c,n.identifier)}e.cancelable&&e.preventDefault()});let e=e=>{if(this._isActive){for(let t=0;t<e.changedTouches.length;t++)if(this._mouseStore.getTouchID()===e.changedTouches[t].identifier){this._mouseStore.setReleaseInfo(),e.preventDefault();break}}};this._mouseControllerElement.addEventListener(`touchend`,e),this._mouseControllerElement.addEventListener(`touchcancel`,e)}if(U(`button-load`).addEventListener(`click`,()=>{(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onselectbutton(P.QUICK_LOAD)}),U(`button-save`).addEventListener(`click`,()=>{(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onselectbutton(P.QUICK_SAVE)}),U(`button-restart`).addEventListener(`click`,()=>{(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onselectbutton(P.RESTART_GAME)}),U(`button-gotowwa`).addEventListener(`click`,()=>{(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onselectbutton(P.GOTO_WWA,!1,!1)}),Array.prototype.forEach.call(ze(`.wide-cell-row`),e=>{e.addEventListener(`click`,()=>{this._displayHelp()})}),this._frameCoord=new S(R.IMGPOS_DEFAULT_FRAME_X,R.IMGPOS_DEFAULT_YESNO_Y),this._battleEffectCoord=new S(R.IMGPOS_DEFAULT_BATTLE_EFFECT_X,R.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),this._battleEstimateWindow=new Sr(this,this._wwaData.mapCGName,U(`wwa-wrapper`)),this._passwordWindow=new Dr(this,U(`wwa-wrapper`),e.disallowLoadOldSave),this._monsterWindow=new _r(this,new S(50,180),340,60,!1,U(`wwa-wrapper`),this._wwaData.mapCGName),this._setProgressBar(_c(3,4,_e.GAME_INIT)),this._gameFrameRateWindow=new br(U(`wwa-wrapper`),e.frameRateDisplayingPattern===`always`?void 0:()=>this._gameFrameRateWindow.hide()),e.frameRateDisplayingPattern===`default-off`||e.frameRateDisplayingPattern===`never`)this._gameFrameRateWindow.hide();else if(e.frameRateDisplayingPattern===`default-on`||e.frameRateDisplayingPattern===`always`)this._gameFrameRateWindow.updateTargetFps(R.TARGET_FPS),this._gameFrameRateWindow.show();else throw TypeError(`Invalid framerateDisplayingPattern: ${e.frameRateDisplayingPattern}`);this._frameRateDisplayingPattern=this.userDevice.device===re.GAME?`never`:e.frameRateDisplayingPattern,this._isLoadedSound=!1,this._temporaryInputDisable=!1,this._paintSkipByDoorOpen=!1,this._clearFacesInNextFrame=!1,this._useConsole=!1,this._playTimeCalculator=new Oe,this.wwaCustomEvent(`wwa_startup`),this._cgManager=new Un(i,this._wwaData.mapCGName,this._frameCoord,this,e.pictureImageNamesFile,()=>{this._isSkippedSoundMessage=!0;let n=()=>{switch(this.userDevice.device){case re.PC:this.registerSystemMessagePage(`ゲームを開始します。
104
104
  画面をクリックしてください。`,!1);break;case re.SP:this.registerSystemMessagePage(`ゲームを開始します。
105
105
  画面にふれてください。`,!1);break}},r=this.resolveSystemMessage(g.CONFIRM_LOAD_SOUND);if(r===`ON`){this._isLoadedSound=!0,n(),this._setLoadingMessage(t,_e.AUDIO),this.loadSound().then(()=>window.requestAnimationFrame(this.soundCheckCaller));return}else if(r===`OFF`){this._isLoadedSound=!1,n(),this.openGameWindow();return}if(this._isSkippedSoundMessage=!1,this._hasTitleImg||t.clearRect(0,0,R.SCREEN_WIDTH,R.SCREEN_HEIGHT),this._usePassword){let n=r;e.displayUserVars&&(n+=`
106
106
 
107
107
  ※変数表示が有効になっています。
108
108
  公開前に必ずHTMLファイル内の
109
109
  data-wwa-display-user-vars="true"
110
- を消してください。`),this._messageWindow.setMessage(n),this._messageWindow.show(),this._setProgressBar(hc(4,4,_e.GAME_INIT));var i=setInterval(()=>{this._keyStore.update(),this._gamePadStore.update(),this._virtualPadStore.update(),this._yesNoJudgeInNextFrame===k.UNSELECTED&&(this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_Y)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)?this._yesNoJudgeInNextFrame=k.YES:(this._keyStore.getKeyState(V.KEY_N)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_ESC)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`))&&(this._yesNoJudgeInNextFrame=k.NO)),this._yesNoJudgeInNextFrame===k.YES?(clearInterval(i),this._messageWindow.update(),this._yesNoJudge=this._yesNoJudgeInNextFrame,this._messageWindow.setInputDisable(),setTimeout(()=>{this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoJudge=k.UNSELECTED,this._yesNoJudgeInNextFrame=k.UNSELECTED,this._isLoadedSound=!0,this._setLoadingMessage(t,_e.AUDIO),this.loadSound().then(()=>window.requestAnimationFrame(this.soundCheckCaller))},R.YESNO_PRESS_DISP_FRAME_NUM*R.DEFAULT_FRAME_INTERVAL)):this._yesNoJudgeInNextFrame===k.NO&&(clearInterval(i),this._messageWindow.update(),this._yesNoJudge=this._yesNoJudgeInNextFrame,this._messageWindow.setInputDisable(),setTimeout(()=>{this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoJudge=k.UNSELECTED,this._yesNoJudgeInNextFrame=k.UNSELECTED,this._isLoadedSound=!1,this.openGameWindow()},R.YESNO_PRESS_DISP_FRAME_NUM*R.DEFAULT_FRAME_INTERVAL))},R.DEFAULT_FRAME_INTERVAL)}else clearInterval(i),this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoJudge=k.UNSELECTED,this._yesNoJudgeInNextFrame=k.UNSELECTED,this._isLoadedSound=!0,this.loadSound().then(()=>window.requestAnimationFrame(this.soundCheckCaller))}),console.log(`WWA_START`),this.wwaCustomEvent(`wwa_start`);let d=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_WWA_START;if(d)try{this.evalCalcWwaNodeGenerator.evalWwaNode(d)}catch(e){alert(`CALL_WWA_START でエラーが発生しました。\n\n詳細:\n${e.message}`),console.error(e.message)}})}setEvalCalcWwaNodeEarnedItem(e,t){this.evalCalcWwaNodeGenerator.setEarnedItem(e,t)}clearEvalCalcWwaNodeEarnedItem(){this.evalCalcWwaNodeGenerator.clearEarnedItem()}callGetItemUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GET_ITEM;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}callGetItemFullUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GET_ITEM_FULL;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}callUseItemUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_USE_ITEM;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}callJumpGateUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_JUMPGATE;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}callUserDefinedBattleDamageFunction(e,t){let n=this.getUserDefinedDamageFunctionNode(e);if(n){this.evalCalcWwaNodeGenerator.setBattleDamageCalculationMode(t);try{let t=this.evalCalcWwaNodeGenerator.evalWwaNode(n),r=this.evalCalcWwaNodeGenerator.state.battleDamageCalculation.aborted;return this.evalCalcWwaNodeGenerator.clearBattleDamageCalculationMode(),r?{damage:0,aborted:r}:typeof t==`number`?{damage:this.toAssignableValue(t),aborted:r}:(console.warn(`${e} のダメージ計算結果が数値になりませんでした。(結果: ${t})。このターンのダメージは無効になります。`),{damage:0,aborted:r})}catch(t){return console.warn(`${e} のダメージ計算中にエラーが発生しました。このターンのダメージは無効になります。`),console.warn(t),{damage:0,hasError:!0}}}}getUserDefinedDamageFunctionNode(e){return this.userDefinedFunctions?.[{playerToEnemy:`CALC_PLAYER_TO_ENEMY_DAMAGE`,enemyToPlayer:`CALC_ENEMY_TO_PLAYER_DAMAGE`}[e]]}callMoveUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_MOVE;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}callCameraMoveUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_CAMERA_MOVE;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}getUserScript(e){return this.userDefinedFunctions&&this.userDefinedFunctions[e]||null}setUserScript(e){if(e.kind!==`data`){console.error(e);return}this.convertWwaNodes(e.data).forEach(e=>{if(e.type===`DefinedFunction`&&this.userDefinedFunctions){let t=e.functionName;this.userDefinedFunctions[t]=e.body}})}callUserScript(e){let t=this.getUserScript(e);t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)}setUserVarStatus(e,t){if(e){if(e.kind===`noFileSpecified`){this._varDump?.numberedUserVariable.updateInformation(e.errorMessage,!1);return}if(e.kind!==`data`){this._userVarNameListRequestError=e,this._varDump?.numberedUserVariable.updateInformation(this._userVarNameListRequestError.errorMessage,!0);return}if(!e.data||typeof e.data!=`object`){this._userVarNameListRequestError={kind:`notObject`,errorMessage:`ユーザ変数一覧 ${t} が正しい形式で書かれていません。`},this._varDump?.numberedUserVariable.updateInformation(this._userVarNameListRequestError.errorMessage,!0);return}this._userVarNameList=this.convertUserVariableNameListToArray(e.data),this._varDump?.numberedUserVariable.updateLabels(this._userVarNameList)}}convertUserVariableNameListToArray(e){let t=Array(R.USER_VAR_NUM);for(let e=0;e<R.USER_VAR_NUM;e++)t[e]=void 0;return Object.keys(e).forEach(n=>{let r=parseInt(n,10);typeof e[n]!=`string`||typeof n!=`string`||isNaN(r)||r<0||r>=R.USER_VAR_NUM||(t[r]=e[n])}),t}_setProgressBar(e){this._hasTitleImg&&(e.stage<=R.LOAD_STAGE_MAX_EXCEPT_AUDIO?(U(`progress-message-container`).textContent=e.stage===R.LOAD_STAGE_MAX_EXCEPT_AUDIO?`World Name: `+this._wwaData.worldName:ve[e.stage],U(`progress-bar`).style.width=(1*e.stage+e.current/e.total*1)/(R.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*R.MAP_WINDOW_WIDTH+`px`,U(`progress-disp`).textContent=((1*e.stage+e.current/e.total*1)/(R.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+`%`):(this._usePassword?U(`progress-message-container`).textContent=`効果音/BGMを読み込んでいます。(スペースキーでスキップ)`:U(`progress-message-container`).textContent=`ゲームデータを読み込んでいます。`,U(`progress-bar-audio`).style.width=e.current*R.MAP_WINDOW_WIDTH/e.total+`px`,U(`progress-disp`).textContent=(e.current/e.total*100).toFixed(2)+`%`))}_setLoadingMessage(e,t){if(!this._hasTitleImg)if(t<=0)e.font=be.TITLE+`px `+R.LOADING_FONT,e.fillText(ye[0],z.TITLE_X,z.TITLE_Y),e.font=be.FOOTER+`px `+R.LOADING_FONT,e.fillText(`WWA Wing Ver.4.0.6`,z.FOOTER_X,z.COPYRIGHT_Y);else if(t<=ye.length)e.font=be.LOADING+`px `+R.LOADING_FONT,t>=2&&(e.clearRect(z.LOADING_X,z.LOADING_Y+z.LINE*(t-3),R.SCREEN_WIDTH-z.LOADING_X,z.LINE),e.fillText(ye[t-1]+` Complete!`,z.LOADING_X,z.LOADING_Y+z.LINE*(t-2))),t<ye.length&&e.fillText(ye[t],z.LOADING_X,z.LOADING_Y+z.LINE*(t-1)),t==1&&(e.font=be.FOOTER+`px `+R.LOADING_FONT,e.fillText(`World Name `+this._wwaData.worldName,z.FOOTER_X,z.WORLD_Y),e.fillText(` (Map data Ver. `+Math.floor(this._wwaData.version/10)+`.`+this._wwaData.version%10+`)`,z.FOOTER_X,z.WORLD_Y+z.LINE));else{var n=this._isSkippedSoundMessage?z.LOADING_Y+z.LINE*(ye.length-1):z.FOOTER_Y;t<=_e.AUDIO?e.fillText(`Now Sound data Loading .....`,z.LOADING_X,n):(e.clearRect(z.LOADING_X,n-z.LINE,R.SCREEN_WIDTH-z.LOADING_X,z.LINE),e.fillText(`Now Sound data Loading ..... Complete!`,z.LOADING_X,n))}}_setErrorMessage(e,t){this._hasTitleImg?alert(e):(t.clearRect(0,0,R.SCREEN_WIDTH,R.SCREEN_HEIGHT),t.font=be.ERRROR+`px `+R.LOADING_FONT,e.split(`
111
- `).forEach(function(e,n){t.fillText(e,z.ERROR_X,z.ERROR_Y+z.LINE*n)}))}createSoundInstance(e){if(e===0||e===p.NO_SOUND||this._soundMap.has(e))return;let t=`${this._audioDirectory}${e}.${this.audioExtension}`;this._soundMap.set(e,new Xi(e,t,this.audioContext,this.audioGain))}async loadSound(){this._soundMap=new Map,console.log(`(D) サウンドのロードを開始します。`),console.log(`(D-1) システムサウンドのロードを開始します。`),this.createSoundInstance(p.DECISION),this.createSoundInstance(p.ATTACK),console.log(`(D-2) 背景パーツ記載のサウンドのロードを開始します。`);for(let e=1;e<this._wwaData.mapPartsMax;e++){let t=this._wwaData.mapAttribute[e][R.ATR_SOUND];this.createSoundInstance(t)}console.log(`(D-3) 物体パーツ記載のサウンドのロードを開始します。`);for(let e=1;e<this._wwaData.objPartsMax;e++){if(this._wwaData.objectAttribute[e][R.ATR_TYPE]===R.OBJECT_RANDOM)continue;let t=this._wwaData.objectAttribute[e][R.ATR_SOUND];this.createSoundInstance(t)}console.log(`(D-4) $sound マクロ記載のサウンドのロードを開始します。`),this._wwaData.message.forEach(e=>e.split(`
112
- `).forEach(e=>{let t=e.match(/^\$sound=(\d+)/);if(!t||t.length<2)return;let n=parseInt(t[1],10);!isNaN(n)&&0<n&&n<p.NO_SOUND&&this.createSoundInstance(n)})),console.log(`(D-4) マップから抽出したサウンド番号一覧:`,Array.from(this._soundMap.keys())),await this.loadCustomSound(),console.log(`(D-6) 次のサウンドがロードされます:`,Array.from(this._soundMap.keys()).sort((e,t)=>typeof e==`number`?typeof t==`number`?e-t:-1:typeof t==`number`?1:e.localeCompare(t))),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1}async loadCustomSound(){let e=this._audioDirectory+`sound-list.json`;console.log(`(D-5) サウンドリストファイル: ${e} の解析を開始します。`);let t=await Bn(e);if(t?.kind!==`data`||!Array.isArray(t.data)){console.warn(`(D-5) カスタムオーディオファイルのリストの取得に失敗しました。リストファイルが存在するか、正しい形式で書かれているかを確認してください。 (リストファイル: ${e})`);return}t.data.forEach(e=>{switch(typeof e){case`number`:this.createSoundInstance(e);return;case`string`:{if(e.startsWith(`#`))return;let t=Number(e);if(e.includes(`/`)||e.includes(`\\`)||t<=0||t>2**53-1||t==p.NO_SOUND){console.warn(`(D-5) 無効なサウンドIDが指定されました: ${e}`);return}if(!Number.isNaN(t)){console.warn(`(D-5) 文字列で数値のサウンドIDが与えられました。数値として解釈します。 (指定されたサウンドID: `+e+`)`),this.createSoundInstance(t);return}this.createSoundInstance(e);return}case`object`:if(!e)return;if(Array.isArray(e)){if(e.length!==2){console.warn(`(D-5) 配列形式でサウンドIDを与える場合は2要素で与えてください: ${JSON.stringify(e)}`);return}try{e.forEach(t=>{if(typeof t!=`number`||t<=0||t>2**53-1)throw Error(`(D-5) 無効なサウンドIDが指定されました: ${JSON.stringify(e)}`)})}catch(e){console.warn(e.message);return}let[t,n]=e;if(t>n){console.warn(`(D-5) サウンドIDが配列形式で与えられていますが、from (${t}) が to (${n}) より大きくなっています: ${JSON.stringify(e)}`);return}for(let e=t;e<=n;e++){if(e==p.NO_SOUND){console.warn(`(D-5) サウンドID ${e} が範囲に含まれていますが、これは停止用に使用している値で無効なのでスキップします。`);continue}this.createSoundInstance(e)}return}console.warn(`(D-5) サウンドIDがオブジェクトのようですが、現在この記法はサポートされていません: ${JSON.stringify(e)}`);return;default:console.warn(`(D-5) この形式のサウンドIDはサポートされていません: ${e}`);return}})}checkAllSoundLoaded(){let e=0,t=0;if(!this._hasTitleImg)var n=this._cvsCover.getContext(`2d`);if(this._keyStore.update(),this._keyStore.getKeyState(V.KEY_SPACE)===B.KEYDOWN&&(this._soundLoadSkipFlag=!0),this._soundMap.forEach(n=>{!n||n.isError()||(t++,n.hasData()&&e++)}),e<t&&!this._soundLoadSkipFlag){this._setProgressBar(hc(e,t,_e.AUDIO)),window.requestAnimationFrame(this.soundCheckCaller);return}this._setProgressBar(hc(R.SOUND_MAX,R.SOUND_MAX,_e.AUDIO)),this._setLoadingMessage(n,_e.FINISH),console.log(`(D-7) サウンドのロードが完了しました。`),this.openGameWindow()}_setSoundLoadedCheckTimer(e){let t=this._soundMap.get(e);!t||t.isError()||(this.soundLoadedCheckTimer=window.setInterval(()=>{this._wwaData.bgm===e?t.hasData()?(t.play(this._wwaData.bgmDelayDurationMs),this._wwaData.bgm=e,this._clearSoundLoadedCheckTimer()):t.isError()&&this._clearSoundLoadedCheckTimer():this._clearSoundLoadedCheckTimer()},100))}_clearSoundLoadedCheckTimer(){this.soundLoadedCheckTimer&&=(clearInterval(this.soundLoadedCheckTimer),void 0)}getSoundEnabled(){return this._isLoadedSound}checkSoundEnabled(e){this._soundMap.get(e).hasData()}stopBgm(){let e=this._soundMap.get(this._wwaData.bgm);e?.isPlaying()&&e.pause(),this._wwaData.bgm=0}stopSound(e,t){if(this.soundIsBgm(e)){t.includeBgm&&this._wwaData.bgm===e&&this.stopBgm();return}let n=this._soundMap.get(e);n?.isPlaying()&&n.pause()}stopAllSound(e){this._soundMap.keys().forEach(t=>this.stopSound(t,e))}playSound(e,t={}){let n=this.soundIsBgm(e),r=t.loopPlaying===void 0?n:t.loopPlaying;if(!this._isLoadedSound){e===p.NO_SOUND?this._wwaData.bgm=0:n&&(this._wwaData.bgm=r?e:0);return}if(typeof e==`number`&&(e<0||e>=R.SOUND_MAX)){console.warn(`サウンド番号が範囲外です。`);return}if(n&&this._wwaData.bgm===e||((e===p.NO_SOUND||n)&&this._wwaData.bgm!==0&&this.stopBgm(),e===0||e===p.NO_SOUND))return;let i=this._soundMap.get(e);if(!i){console.warn(`サウンドID ${e} は、マップデータにも ${this._audioDirectory}sound-list.json にも出現しないため、再生できません。`);return}i.hasData()?n?(i?.play(t.bgmDelayDurationMs??this._wwaData.bgmDelayDurationMs,r,()=>{e===this._wwaData.bgm&&!r&&(this._wwaData.bgm=0)}),this._wwaData.bgm=e):i?.play(0,r):n&&(this._wwaData.bgm=r?e:0,this._setSoundLoadedCheckTimer(e))}playDecisionSound(){this.playSound(this._wwaData.decisionSound??p.DECISION)}playAttackSound(){this.playSound(this._wwaData.attackSound??p.ATTACK)}setDecisionSound(e){if(this.soundIsBgm(e)){console.warn(`決定音にBGMを設定することはできません。`);return}this._wwaData.decisionSound=e}setAttackSound(e){if(this.soundIsBgm(e)){console.warn(`攻撃音にBGMを設定することはできません。`);return}this._wwaData.attackSound=e}soundIsBgm(e){switch(typeof e){case`number`:return e>=p.BGM_LB;case`string`:return e.match(/^bgm_/i)!==null;default:throw TypeError(`Invalid soundId type: ${typeof e}`)}}openGameWindow(){var e=this._player.getPosition();U(`wwa-cover`).style.opacity=`0`,this.getObjectIdByPosition(e)!==0&&this._player.setPartsAppearedFlag();var t=U(`wwa-wrapper`).getAttribute(`data-wwa-resume-savedata`);if(typeof t==`string`&&(this._useSuspend=!0,t)){var n=Li.getStartWWAData(t);this._restartData!==n&&(this._applyQuickLoad(n),this._wwaSave.resumeStart())}setTimeout(()=>{U(`wwa-wrapper`).removeChild(U(`wwa-cover`)),this._main()},R.SPLASH_SCREEN_DISP_MILLS)}onselectitem(e){if(this._player.canUseItem(e)){U(`item`+(e-1)).classList.add(`onpress`),this.playDecisionSound();let r=this.resolveSystemMessage(g.CONFIRM_USE_ITEM);if(r===`BLANK`){this._player.readyToUseItem(e);var t=this._player.useItem(),n=this.getObjectAttributeById(t,R.ATR_STRING);this.registerPageByMessage(this.getMessageById(n),{showChoice:!1,isSystemMessage:!1,triggerParts:{id:t,type:j.OBJECT,position:this._player.getPosition().getPartsCoord()}})}else this.registerPageByMessage(r,{showChoice:!0,isSystemMessage:!0}),this._yesNoChoiceCallInfo=N.CALL_BY_ITEM_USE,this._yesNoUseItemPos=e;return!0}return!1}onselectbutton(e,t=!1,n=!1){var r=U(F[e]);if(this.playDecisionSound(),this._itemMenu.close(),r.classList.add(`onpress`),e===P.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(t),this._yesNoChoiceCallInfo){case N.CALL_BY_QUICK_LOAD:case N.CALL_BY_LOG_QUICK_LOAD:var i,a=``;switch(this._yesNoChoiceCallInfo){case N.CALL_BY_QUICK_LOAD:a=`読み込むデータを選んでください。`,this._wwaSave.selectDBSaveDataList();break;case N.CALL_BY_LOG_QUICK_LOAD:a=`読み込むオートセーブを選んでください。`,this._wwaSave.selectLogSaveDataList();break}switch(i=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),i){case N.CALL_BY_LOG_QUICK_LOAD:this.registerSystemMessagePage(a+`
110
+ を消してください。`),this._messageWindow.setMessage(n),this._messageWindow.show(),this._setProgressBar(_c(4,4,_e.GAME_INIT));var i=setInterval(()=>{this._keyStore.update(),this._gamePadStore.update(),this._virtualPadStore.update(),this._yesNoJudgeInNextFrame===k.UNSELECTED&&(this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_Y)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)?this._yesNoJudgeInNextFrame=k.YES:(this._keyStore.getKeyState(V.KEY_N)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_ESC)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`))&&(this._yesNoJudgeInNextFrame=k.NO)),this._yesNoJudgeInNextFrame===k.YES?(clearInterval(i),this._messageWindow.update(),this._yesNoJudge=this._yesNoJudgeInNextFrame,this._messageWindow.setInputDisable(),setTimeout(()=>{this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoJudge=k.UNSELECTED,this._yesNoJudgeInNextFrame=k.UNSELECTED,this._isLoadedSound=!0,this._setLoadingMessage(t,_e.AUDIO),this.loadSound().then(()=>window.requestAnimationFrame(this.soundCheckCaller))},R.YESNO_PRESS_DISP_FRAME_NUM*R.DEFAULT_FRAME_INTERVAL)):this._yesNoJudgeInNextFrame===k.NO&&(clearInterval(i),this._messageWindow.update(),this._yesNoJudge=this._yesNoJudgeInNextFrame,this._messageWindow.setInputDisable(),setTimeout(()=>{this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoJudge=k.UNSELECTED,this._yesNoJudgeInNextFrame=k.UNSELECTED,this._isLoadedSound=!1,this.openGameWindow()},R.YESNO_PRESS_DISP_FRAME_NUM*R.DEFAULT_FRAME_INTERVAL))},R.DEFAULT_FRAME_INTERVAL)}else clearInterval(i),this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoJudge=k.UNSELECTED,this._yesNoJudgeInNextFrame=k.UNSELECTED,this._isLoadedSound=!0,this.loadSound().then(()=>window.requestAnimationFrame(this.soundCheckCaller))}),console.log(`WWA_START`),this.wwaCustomEvent(`wwa_start`);let d=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_WWA_START;if(d)try{this.evalCalcWwaNodeGenerator.evalWwaNode(d)}catch(e){alert(`CALL_WWA_START でエラーが発生しました。\n\n詳細:\n${e.message}`),console.error(e.message)}})}setEvalCalcWwaNodeEarnedItem(e,t){this.evalCalcWwaNodeGenerator.setEarnedItem(e,t)}clearEvalCalcWwaNodeEarnedItem(){this.evalCalcWwaNodeGenerator.clearEarnedItem()}callGetItemUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GET_ITEM;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}callGetItemFullUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GET_ITEM_FULL;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}callUseItemUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_USE_ITEM;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}callJumpGateUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_JUMPGATE;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}callUserDefinedBattleDamageFunction(e,t){let n=this.getUserDefinedDamageFunctionNode(e);if(n){this.evalCalcWwaNodeGenerator.setBattleDamageCalculationMode(t);try{let{isGameOver:t,value:r}=this.evalCalcWwaNodeGenerator.evalWwaNode(n);if(t)throw Error(`戦闘予測関数でゲームオーバーが発生しました。戦闘予測関数でプレイヤー生命力を操作しないでください。`);let i=this.evalCalcWwaNodeGenerator.state.battleDamageCalculation.aborted;return this.evalCalcWwaNodeGenerator.clearBattleDamageCalculationMode(),i?{damage:0,aborted:i}:typeof r==`number`?{damage:this.toAssignableValue(r),aborted:i}:(console.warn(`${e} のダメージ計算結果が数値になりませんでした。(結果: ${r})。このターンのダメージは無効になります。`),{damage:0,aborted:i})}catch(t){return console.warn(`${e} のダメージ計算中にエラーが発生しました。このターンのダメージは無効になります。`),console.warn(t),{damage:0,hasError:!0}}}}getUserDefinedDamageFunctionNode(e){return this.userDefinedFunctions?.[{playerToEnemy:`CALC_PLAYER_TO_ENEMY_DAMAGE`,enemyToPlayer:`CALC_ENEMY_TO_PLAYER_DAMAGE`}[e]]}callMoveUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_MOVE;if(e){let{isGameOver:t}=this.evalCalcWwaNodeGenerator.evalWwaNode(e);return{isGameOver:t}}return{}}callCameraMoveUserDefineFunction(){let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_CAMERA_MOVE;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}getUserScript(e){return this.userDefinedFunctions&&this.userDefinedFunctions[e]||null}setUserScript(e){if(e.kind!==`data`){console.error(e);return}this.convertWwaNodes(e.data).forEach(e=>{if(e.type===`DefinedFunction`&&this.userDefinedFunctions){let t=e.functionName;this.userDefinedFunctions[t]=e.body}})}callUserScript(e){let t=this.getUserScript(e);t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)}setUserVarStatus(e,t){if(e){if(e.kind===`noFileSpecified`){this._varDump?.numberedUserVariable.updateInformation(e.errorMessage,!1);return}if(e.kind!==`data`){this._userVarNameListRequestError=e,this._varDump?.numberedUserVariable.updateInformation(this._userVarNameListRequestError.errorMessage,!0);return}if(!e.data||typeof e.data!=`object`){this._userVarNameListRequestError={kind:`notObject`,errorMessage:`ユーザ変数一覧 ${t} が正しい形式で書かれていません。`},this._varDump?.numberedUserVariable.updateInformation(this._userVarNameListRequestError.errorMessage,!0);return}this._userVarNameList=this.convertUserVariableNameListToArray(e.data),this._varDump?.numberedUserVariable.updateLabels(this._userVarNameList)}}convertUserVariableNameListToArray(e){let t=Array(R.USER_VAR_NUM);for(let e=0;e<R.USER_VAR_NUM;e++)t[e]=void 0;return Object.keys(e).forEach(n=>{let r=parseInt(n,10);typeof e[n]!=`string`||typeof n!=`string`||isNaN(r)||r<0||r>=R.USER_VAR_NUM||(t[r]=e[n])}),t}_setProgressBar(e){this._hasTitleImg&&(e.stage<=R.LOAD_STAGE_MAX_EXCEPT_AUDIO?(U(`progress-message-container`).textContent=e.stage===R.LOAD_STAGE_MAX_EXCEPT_AUDIO?`World Name: `+this._wwaData.worldName:ve[e.stage],U(`progress-bar`).style.width=(1*e.stage+e.current/e.total*1)/(R.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*R.MAP_WINDOW_WIDTH+`px`,U(`progress-disp`).textContent=((1*e.stage+e.current/e.total*1)/(R.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+`%`):(this._usePassword?U(`progress-message-container`).textContent=`効果音/BGMを読み込んでいます。(スペースキーでスキップ)`:U(`progress-message-container`).textContent=`ゲームデータを読み込んでいます。`,U(`progress-bar-audio`).style.width=e.current*R.MAP_WINDOW_WIDTH/e.total+`px`,U(`progress-disp`).textContent=(e.current/e.total*100).toFixed(2)+`%`))}_setLoadingMessage(e,t){if(!this._hasTitleImg)if(t<=0)e.font=be.TITLE+`px `+R.LOADING_FONT,e.fillText(ye[0],z.TITLE_X,z.TITLE_Y),e.font=be.FOOTER+`px `+R.LOADING_FONT,e.fillText(`WWA Wing Ver.4.0.8-fps-measure.based-on.4.0.7`,z.FOOTER_X,z.COPYRIGHT_Y);else if(t<=ye.length)e.font=be.LOADING+`px `+R.LOADING_FONT,t>=2&&(e.clearRect(z.LOADING_X,z.LOADING_Y+z.LINE*(t-3),R.SCREEN_WIDTH-z.LOADING_X,z.LINE),e.fillText(ye[t-1]+` Complete!`,z.LOADING_X,z.LOADING_Y+z.LINE*(t-2))),t<ye.length&&e.fillText(ye[t],z.LOADING_X,z.LOADING_Y+z.LINE*(t-1)),t==1&&(e.font=be.FOOTER+`px `+R.LOADING_FONT,e.fillText(`World Name `+this._wwaData.worldName,z.FOOTER_X,z.WORLD_Y),e.fillText(` (Map data Ver. `+Math.floor(this._wwaData.version/10)+`.`+this._wwaData.version%10+`)`,z.FOOTER_X,z.WORLD_Y+z.LINE));else{var n=this._isSkippedSoundMessage?z.LOADING_Y+z.LINE*(ye.length-1):z.FOOTER_Y;t<=_e.AUDIO?e.fillText(`Now Sound data Loading .....`,z.LOADING_X,n):(e.clearRect(z.LOADING_X,n-z.LINE,R.SCREEN_WIDTH-z.LOADING_X,z.LINE),e.fillText(`Now Sound data Loading ..... Complete!`,z.LOADING_X,n))}}_setErrorMessage(e,t){this._hasTitleImg?alert(e):(t.clearRect(0,0,R.SCREEN_WIDTH,R.SCREEN_HEIGHT),t.font=be.ERRROR+`px `+R.LOADING_FONT,e.split(`
111
+ `).forEach(function(e,n){t.fillText(e,z.ERROR_X,z.ERROR_Y+z.LINE*n)}))}createSoundInstance(e){if(e===0||e===p.NO_SOUND||this._soundMap.has(e))return;let t=`${this._audioDirectory}${e}.${this.audioExtension}`;this._soundMap.set(e,new Zi(e,t,this.audioContext,this.audioGain))}async loadSound(){this._soundMap=new Map,console.log(`(D) サウンドのロードを開始します。`),console.log(`(D-1) システムサウンドのロードを開始します。`),this.createSoundInstance(p.DECISION),this.createSoundInstance(p.ATTACK),console.log(`(D-2) 背景パーツ記載のサウンドのロードを開始します。`);for(let e=1;e<this._wwaData.mapPartsMax;e++){let t=this._wwaData.mapAttribute[e][R.ATR_SOUND];this.createSoundInstance(t)}console.log(`(D-3) 物体パーツ記載のサウンドのロードを開始します。`);for(let e=1;e<this._wwaData.objPartsMax;e++){if(this._wwaData.objectAttribute[e][R.ATR_TYPE]===R.OBJECT_RANDOM)continue;let t=this._wwaData.objectAttribute[e][R.ATR_SOUND];this.createSoundInstance(t)}console.log(`(D-4) $sound マクロ記載のサウンドのロードを開始します。`),this._wwaData.message.forEach(e=>e.split(`
112
+ `).forEach(e=>{let t=e.match(/^\$sound=(\d+)/);if(!t||t.length<2)return;let n=parseInt(t[1],10);!isNaN(n)&&0<n&&n<p.NO_SOUND&&this.createSoundInstance(n)})),console.log(`(D-4) マップから抽出したサウンド番号一覧:`,Array.from(this._soundMap.keys())),await this.loadCustomSound(),console.log(`(D-6) 次のサウンドがロードされます:`,Array.from(this._soundMap.keys()).sort((e,t)=>typeof e==`number`?typeof t==`number`?e-t:-1:typeof t==`number`?1:e.localeCompare(t))),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1}async loadCustomSound(){let e=this._audioDirectory+`sound-list.json`;console.log(`(D-5) サウンドリストファイル: ${e} の解析を開始します。`);let t=await Bn(e);if(t?.kind!==`data`||!Array.isArray(t.data)){console.warn(`(D-5) カスタムオーディオファイルのリストの取得に失敗しました。リストファイルが存在するか、正しい形式で書かれているかを確認してください。 (リストファイル: ${e})`);return}t.data.forEach(e=>{switch(typeof e){case`number`:this.createSoundInstance(e);return;case`string`:{if(e.startsWith(`#`))return;let t=Number(e);if(e.includes(`/`)||e.includes(`\\`)||t<=0||t>2**53-1||t==p.NO_SOUND){console.warn(`(D-5) 無効なサウンドIDが指定されました: ${e}`);return}if(!Number.isNaN(t)){console.warn(`(D-5) 文字列で数値のサウンドIDが与えられました。数値として解釈します。 (指定されたサウンドID: `+e+`)`),this.createSoundInstance(t);return}this.createSoundInstance(e);return}case`object`:if(!e)return;if(Array.isArray(e)){if(e.length!==2){console.warn(`(D-5) 配列形式でサウンドIDを与える場合は2要素で与えてください: ${JSON.stringify(e)}`);return}try{e.forEach(t=>{if(typeof t!=`number`||t<=0||t>2**53-1)throw Error(`(D-5) 無効なサウンドIDが指定されました: ${JSON.stringify(e)}`)})}catch(e){console.warn(e.message);return}let[t,n]=e;if(t>n){console.warn(`(D-5) サウンドIDが配列形式で与えられていますが、from (${t}) が to (${n}) より大きくなっています: ${JSON.stringify(e)}`);return}for(let e=t;e<=n;e++){if(e==p.NO_SOUND){console.warn(`(D-5) サウンドID ${e} が範囲に含まれていますが、これは停止用に使用している値で無効なのでスキップします。`);continue}this.createSoundInstance(e)}return}console.warn(`(D-5) サウンドIDがオブジェクトのようですが、現在この記法はサポートされていません: ${JSON.stringify(e)}`);return;default:console.warn(`(D-5) この形式のサウンドIDはサポートされていません: ${e}`);return}})}checkAllSoundLoaded(){let e=0,t=0;if(!this._hasTitleImg)var n=this._cvsCover.getContext(`2d`);if(this._keyStore.update(),this._keyStore.getKeyState(V.KEY_SPACE)===B.KEYDOWN&&(this._soundLoadSkipFlag=!0),this._soundMap.forEach(n=>{!n||n.isError()||(t++,n.hasData()&&e++)}),e<t&&!this._soundLoadSkipFlag){this._setProgressBar(_c(e,t,_e.AUDIO)),window.requestAnimationFrame(this.soundCheckCaller);return}if(this._setProgressBar(_c(R.SOUND_MAX,R.SOUND_MAX,_e.AUDIO)),this._setLoadingMessage(n,_e.FINISH),this._soundLoadSkipFlag){let e=Array.from(this._soundMap.entries());console.warn(`(D-7) サウンドのロードがスキップされました。現時点でエラーでない以下のサウンドはバックグラウンドで引き続きロードを試みます:`,e.filter(([e,t])=>!t.hasData()&&!t.isError()).map(([e,t])=>e))}else console.log(`(D-7) サウンドのロードが完了しました。`);this.openGameWindow()}_setSoundLoadedCheckTimer(e){let t=this._soundMap.get(e);!t||t.isError()||(this.soundLoadedCheckTimer=window.setInterval(()=>{this._wwaData.bgm===e?t.hasData()?(t.play(this._wwaData.bgmDelayDurationMs),this._wwaData.bgm=e,this._clearSoundLoadedCheckTimer()):t.isError()&&this._clearSoundLoadedCheckTimer():this._clearSoundLoadedCheckTimer()},100))}_clearSoundLoadedCheckTimer(){this.soundLoadedCheckTimer&&=(clearInterval(this.soundLoadedCheckTimer),void 0)}getSoundEnabled(){return this._isLoadedSound}checkSoundEnabled(e){this._soundMap.get(e).hasData()}stopBgm(){let e=this._soundMap.get(this._wwaData.bgm);e?.isPlaying()&&e.pause(),this._wwaData.bgm=0}stopSound(e,t){if(this.soundIsBgm(e)){t.includeBgm&&this._wwaData.bgm===e&&this.stopBgm();return}let n=this._soundMap.get(e);n?.isPlaying()&&n.pause()}stopAllSound(e){this._soundMap.keys().forEach(t=>this.stopSound(t,e))}playSound(e,t={}){let n=this.soundIsBgm(e),r=t.loopPlaying===void 0?n:t.loopPlaying;if(!this._isLoadedSound){e===p.NO_SOUND?this._wwaData.bgm=0:n&&(this._wwaData.bgm=r?e:0);return}if(typeof e==`number`&&(e<0||e>=R.SOUND_MAX)){console.warn(`サウンド番号が範囲外です。`);return}if(n&&this._wwaData.bgm===e||((e===p.NO_SOUND||n)&&this._wwaData.bgm!==0&&this.stopBgm(),e===0||e===p.NO_SOUND))return;let i=this._soundMap.get(e);if(!i){console.warn(`サウンドID ${e} は、マップデータにも ${this._audioDirectory}sound-list.json にも出現しないため、再生できません。`);return}i.hasData()?n?(i?.play(t.bgmDelayDurationMs??this._wwaData.bgmDelayDurationMs,r,()=>{e===this._wwaData.bgm&&!r&&(this._wwaData.bgm=0)}),this._wwaData.bgm=e):i?.play(0,r):n&&(this._wwaData.bgm=r?e:0,this._setSoundLoadedCheckTimer(e))}playDecisionSound(){this.playSound(this._wwaData.decisionSound??p.DECISION)}playAttackSound(){this.playSound(this._wwaData.attackSound??p.ATTACK)}setDecisionSound(e){if(this.soundIsBgm(e)){console.warn(`決定音にBGMを設定することはできません。`);return}this._wwaData.decisionSound=e}setAttackSound(e){if(this.soundIsBgm(e)){console.warn(`攻撃音にBGMを設定することはできません。`);return}this._wwaData.attackSound=e}soundIsBgm(e){switch(typeof e){case`number`:return e>=p.BGM_LB;case`string`:return e.match(/^bgm_/i)!==null;default:throw TypeError(`Invalid soundId type: ${typeof e}`)}}openGameWindow(){var e=this._player.getPosition();U(`wwa-cover`).style.opacity=`0`,this.getObjectIdByPosition(e)!==0&&this._player.setPartsAppearedFlag();var t=U(`wwa-wrapper`).getAttribute(`data-wwa-resume-savedata`);if(typeof t==`string`&&(this._useSuspend=!0,t)){var n=Ri.getStartWWAData(t);this._restartData!==n&&(this._applyQuickLoad(n),this._wwaSave.resumeStart())}setTimeout(()=>{U(`wwa-wrapper`).removeChild(U(`wwa-cover`)),requestAnimationFrame(this.mainCaller.bind(this))},R.SPLASH_SCREEN_DISP_MILLS)}onselectitem(e){if(this._player.canUseItem(e)){U(`item`+(e-1)).classList.add(`onpress`),this.playDecisionSound();let r=this.resolveSystemMessage(g.CONFIRM_USE_ITEM);if(r===`BLANK`){this._player.readyToUseItem(e);var t=this._player.useItem(),n=this.getObjectAttributeById(t,R.ATR_STRING);this.registerPageByMessage(this.getMessageById(n),{showChoice:!1,isSystemMessage:!1,triggerParts:{id:t,type:j.OBJECT,position:this._player.getPosition().getPartsCoord()}})}else this.registerPageByMessage(r,{showChoice:!0,isSystemMessage:!0}),this._yesNoChoiceCallInfo=N.CALL_BY_ITEM_USE,this._yesNoUseItemPos=e;return!0}return!1}onselectbutton(e,t=!1,n=!1){var r=U(F[e]);if(this.playDecisionSound(),this._itemMenu.close(),r.classList.add(`onpress`),e===P.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(t),this._yesNoChoiceCallInfo){case N.CALL_BY_QUICK_LOAD:case N.CALL_BY_LOG_QUICK_LOAD:var i,a=``;switch(this._yesNoChoiceCallInfo){case N.CALL_BY_QUICK_LOAD:a=`読み込むデータを選んでください。`,this._wwaSave.selectDBSaveDataList();break;case N.CALL_BY_LOG_QUICK_LOAD:a=`読み込むオートセーブを選んでください。`,this._wwaSave.selectLogSaveDataList();break}switch(i=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),i){case N.CALL_BY_LOG_QUICK_LOAD:this.registerSystemMessagePage(a+`
113
113
  →Noでオートセーブ復帰画面に移ります。`,!0);break;case N.CALL_BY_PASSWORD_LOAD:this.registerSystemMessagePage(a+`
114
114
  →Noでデータ復帰用パスワードの
115
115
   入力選択ができます。`,!0);break;case N.NONE:this.registerSystemMessagePage(a,!0);break}break;case N.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled();break}else if(e===P.QUICK_SAVE)this._wwaData.disableSaveFlag?this.registerSystemMessagePage(`ここではセーブ機能は
@@ -117,16 +117,16 @@ ${t?Fe():``}
117
117
  →Noでデータ復帰用パスワードの
118
118
   表示選択ができます。`,!0),this._yesNoChoiceCallInfo=N.CALL_BY_QUICK_SAVE):(this.registerSystemMessagePage(`データの一時保存先を選んでください。`,!0),this._yesNoChoiceCallInfo=N.CALL_BY_QUICK_SAVE));else if(e===P.RESTART_GAME)this.registerSystemMessagePage(`初めからスタートしなおしますか?`,!0),this._yesNoChoiceCallInfo=N.CALL_BY_RESTART_GAME;else if(e===P.GOTO_WWA)if(n)this._bottomButtonType!==T.GOTO_WWA&&U(F[P.GOTO_WWA]).classList.remove(`onpress`),this.registerSystemMessagePage(`WWAの公式サイトを開きますか?`,!0),this._yesNoChoiceCallInfo=N.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case T.GOTO_WWA:this._yesNoChoiceCallInfo=N.CALL_BY_GOTO_WWA,this.registerSystemMessagePage(`WWAの公式サイトを開きますか?`,!0);break;case T.GAME_END:this._yesNoChoiceCallInfo=N.CALL_BY_END_GAME,this.registerSystemMessagePage(`WWAゲームを終了しますか?`,!0);break;case T.BATTLE_REPORT:this.launchBattleEstimateWindow();break}}onpasswordloadcalled(){this._usePassword?(U(F[P.QUICK_LOAD]).classList.add(`onpress`),this.registerSystemMessagePage(`データ復帰用のパスワードを入力しますか?`,!0),this._yesNoChoiceCallInfo=N.CALL_BY_PASSWORD_LOAD):this.registerSystemMessagePage(`セーブデータがありません。`)}onpasswordsavecalled(){U(F[P.QUICK_SAVE]).classList.add(`onpress`),this._wwaData.disableSaveFlag?this.registerSystemMessagePage(`ここではセーブ機能は
119
119
  使用できません。`):this._useSuspend?(this.registerSystemMessagePage(`ゲームを中断しますか?`,!0),this._yesNoChoiceCallInfo=N.CALL_BY_SUSPEND):this._usePassword&&(this.registerSystemMessagePage(`データ復帰用のパスワードを表示しますか?`,!0),this._yesNoChoiceCallInfo=N.CALL_BY_PASSWORD_SAVE)}onpasssuspendsavecalled(){U(F[P.QUICK_SAVE]).classList.add(`onpress`),this._wwaData.disableSaveFlag?this.registerSystemMessagePage(`ここではセーブ機能は
120
- 使用できません。`):(this.registerSystemMessagePage(`ゲームを中断しますか?`,!0),this._yesNoChoiceCallInfo=N.CALL_BY_SUSPEND)}onitemmenucalled(){this.registerSystemMessagePage(`右のメニューを選択してください。`),this._messageWindow.setItemMenuChoice(!0),this.playDecisionSound(),this._itemMenu.openView()}onchangespeed(e){if(!this._wwaData.permitChangeGameSpeed){this.registerSystemMessagePageByKey(g.GAME_SPEED_CHANGE_DISABLED);return}switch(e){case ae.UP:this._player.speedUp();break;case ae.DOWN:this._player.speedDown();break}let t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_CHANGE_SPEED;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t),this.registerSystemMessagePageByKey(g.GAME_SPEED_CHANGED)}isBattleSpeedIndexForQuickBattle(e){return R.QUICK_BATTLE_SPEED_INDECIES.some(t=>t===e)}_main(){this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._virtualPadStore.update(),this._gamePadStore.update();let e=this._reservedPartsAppearances.length>0;if(this._reservedPartsAppearances.forEach(e=>this.appearParts(e)),this._reservedPartsAppearances=[],this._waitFrame-- >0){e&&this._drawAll(),window.requestAnimationFrame(this.mainCaller);return}if(this._waitFrame=0,this._yesNoJudgeInNextFrame!==void 0&&(this._yesNoJudge=this._yesNoJudgeInNextFrame,this._yesNoJudgeInNextFrame=void 0),this._clearFacesInNextFrame&&=(this.clearFaces(),!1),this._pageExecuting=!0,this._pages.length>0&&this._shouldSetNextPage)for(this._shouldSetNextPage=!1;this._pages.length>0;){let e=this._pages.shift(),t=er.executeNodes(e.firstNode,e.triggerParts);if(t.isError===!0){this._isLastPage=!1;break}this._reservedMoveMacroTurn!==void 0&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0);let n=t.messages.filter(e=>!e.isEmpty()),r=!!e.scoreOption;if(r&&n.length===0&&n.push(this._createSimpleMessage(`スコアを表示します。`,e.triggerParts)),e.additionalItems&&e.additionalItems.forEach(e=>{switch(e.type){case`face`:this.addFace(e.data.face)}}),n.length>0){let t=n.map(e=>e.generatePrintableMessage()).join(`
121
- `);this._messageWindow.setMessage(t),this._messageWindow.setYesNoChoice(e.showChoice),this._messageWindow.setPositionByPlayerPosition(this._faces.length!==0,r,e.isSystemMessage,this._player.getPosition(),this._camera.getPosition()),r&&(this._lastScoreOptions=e.scoreOption,this.updateScore(e.scoreOption),this._scoreWindow.show()),this._player.setMessageWaiting(),this._isLastPage=e.isLastPage,this._shouldSetNextPage=!1;break}if(this._pages.length===0){if(this._hideMessageWindow().newPageGenerated||this._dispatchWindowClosedTimeRequests().newPageGenerated)continue;this.clearFaces();break}}if(this._pageExecuting=!1,this._reservedJumpDestination&&=(this._player.jumpTo(this._reservedJumpDestination),void 0),this._player.mainFrameCount(),this._player.isControllable()){if(this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(N.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame())this._player.updateDelayFrame();else{let e=this._player.getDir(),t=[NaN,NaN,V.KEY_DOWN,NaN,V.KEY_LEFT,NaN,V.KEY_RIGHT,NaN,V.KEY_UP,NaN][e];this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(V.KEY_LEFT)===B.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(V.KEY_UP)===B.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(V.KEY_RIGHT)===B.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(V.KEY_DOWN)===B.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(E.LEFT)===Te.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(E.UP)===Te.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(E.RIGHT)===Te.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(E.DOWN)===Te.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(t)?this._checkTurnKeyPressed()?this._player.setDir(e):(this._player.controll(e),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(V.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(V.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(V.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(V.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(E.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(E.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(E.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(E.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(H.BUTTON_INDEX_B)?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(H.BUTTON_INDEX_B)?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(H.BUTTON_INDEX_B)?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(H.BUTTON_INDEX_B)?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton(`BUTTON_LEFT`)?this._virtualPadStore.checkTouchingButton(`BUTTON_ESC`)?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton(`BUTTON_UP`)?this._virtualPadStore.checkTouchingButton(`BUTTON_ESC`)?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton(`BUTTON_RIGHT`)?this._virtualPadStore.checkTouchingButton(`BUTTON_ESC`)?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton(`BUTTON_DOWN`)?this._virtualPadStore.checkTouchingButton(`BUTTON_ESC`)?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(V.KEY_1)===B.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(V.KEY_2)===B.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(V.KEY_3)===B.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(V.KEY_Q)===B.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(V.KEY_W)===B.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(V.KEY_E)===B.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(V.KEY_A)===B.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(V.KEY_S)===B.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(V.KEY_D)===B.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(V.KEY_Z)===B.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(V.KEY_X)===B.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(V.KEY_C)===B.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(V.KEY_I)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_MINUS)||this._virtualPadStore.checkTouchButton(`BUTTON_SLOW`)?this.onchangespeed(ae.DOWN):this._keyStore.getKeyState(V.KEY_P)===B.KEYDOWN||this._keyStore.checkHitKey(V.KEY_F2)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_PLUS)||this._virtualPadStore.checkTouchButton(`BUTTON_FAST`)?this.onchangespeed(ae.UP):this._keyStore.getKeyState(V.KEY_F1)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_M)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(V.KEY_F3)?(this.playDecisionSound(),this.onselectbutton(P.QUICK_LOAD,!0)):this._keyStore.checkHitKey(V.KEY_F4)?(this.playDecisionSound(),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(V.KEY_F5)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_ZR)?this.onselectbutton(P.QUICK_LOAD):this._keyStore.checkHitKey(V.KEY_F6)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_ZL)?this.onselectbutton(P.QUICK_SAVE):this._keyStore.checkHitKey(V.KEY_F7)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_R)?this.onselectbutton(P.RESTART_GAME):this._keyStore.checkHitKey(V.KEY_F8)?this.onselectbutton(P.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(V.KEY_F9)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_X)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`)?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(V.KEY_V)?this._displayUserVars():this._keyStore.checkHitKey(V.KEY_X)?this._debugConsoleElement&&!this._player.isControllable()&&this._debugEvalString():(this._keyStore.checkHitKey(V.KEY_F12)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_Y))&&this._displayHelp());let n=(e,t)=>({key:V[`KEY_${e}`],func:t});[...`0123456789`.split(``).map(e=>n(e,`CALL_PUSH_${e}`)),...`0123456789`.split(``).map(e=>n(`NUM${e}`,`CALL_PUSH_${e}`)),...`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``).map(e=>n(e,`CALL_PUSH_${e}`)),...[`ENTER`,`SHIFT`,`ESC`,`SPACE`,`LEFT`,`RIGHT`,`UP`,`DOWN`].map(e=>n(e,`CALL_PUSH_${e}`))].forEach(e=>{if(this._keyStore.checkHitKey(e.key)){let t=this.userDefinedFunctions&&this.userDefinedFunctions[e.func];t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)}})}this._keyStore.memorizeKeyStateOnControllableFrame(),this._mouseStore.memorizeMouseStateOnControllableFrame()}else if(this._player.isJumped())this._camera.isResetting()||this._player.processAfterJump();else if(this._player.isMoving())this._player.move(),this._objectMovingDataManager.update(),this._player.getPosition().isJustPosition()&&this._dispatchPlayerAndObjectsStopTimeRequests();else if(this._player.isWaitingMessage()){if(this._messageWindow.isVisible()||this._messageWindow.show(),this._messageWindow.isYesNoChoice())this._messageWindow.isSaveChoice()&&(this._messageWindow.saveUpdate(),this._messageWindow.isSaveClose()||(this._keyStore.checkHitKey(V.KEY_LEFT)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchButton(`BUTTON_LEFT`)?this._messageWindow.saveControll(E.LEFT):this._keyStore.checkHitKey(V.KEY_UP)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchButton(`BUTTON_UP`)?this._messageWindow.saveControll(E.UP):this._keyStore.checkHitKey(V.KEY_RIGHT)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchButton(`BUTTON_RIGHT`)?this._messageWindow.saveControll(E.RIGHT):(this._keyStore.checkHitKey(V.KEY_DOWN)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchButton(`BUTTON_DOWN`))&&this._messageWindow.saveControll(E.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===k.UNSELECTED&&(this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_Y)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)?this._yesNoJudge=k.YES:(this._keyStore.getKeyState(V.KEY_N)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_ESC)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`))&&(this._yesNoJudge=k.NO)),(this._yesNoJudge===k.YES||this._yesNoJudge===k.NO)&&(this.playDecisionSound(),this._yesNoDispCounter=R.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(V.KEY_LEFT)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchingButton(`BUTTON_LEFT`)?this._itemMenu.controll(E.LEFT):this._keyStore.checkHitKey(V.KEY_UP)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchingButton(`BUTTON_UP`)?this._itemMenu.controll(E.UP):this._keyStore.checkHitKey(V.KEY_RIGHT)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchingButton(`BUTTON_RIGHT`)?this._itemMenu.controll(E.RIGHT):(this._keyStore.checkHitKey(V.KEY_DOWN)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchingButton(`BUTTON_DOWN`))&&this._itemMenu.controll(E.DOWN),this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_Y)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`))this._setNextPage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(E.LEFT)||this._mouseStore.checkClickMouse(E.UP)||this._mouseStore.checkClickMouse(E.RIGHT)||this._mouseStore.checkClickMouse(E.DOWN)||this._keyStore.getKeyState(V.KEY_N)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_ESC)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`)){for(var t=0;t<F.length;t++){var n=U(F[t]);n.classList.contains(`onpress`)&&n.classList.remove(`onpress`)}this._itemMenu.ng(),this._setNextPage(),this.playDecisionSound(),this._messageWindow.setItemMenuChoice(!1)}}else{var r=this._keyStore.getKeyStateForMessageCheck(V.KEY_ENTER),i=this._keyStore.getKeyStateForMessageCheck(V.KEY_SPACE),a=this._keyStore.getKeyStateForMessageCheck(V.KEY_ESC);if(r===B.KEYDOWN||r===B.KEYPRESS_MESSAGECHANGE||i===B.KEYDOWN||i===B.KEYPRESS_MESSAGECHANGE||a===B.KEYDOWN||a===B.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===Te.MOUSEDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`)){for(var t=0;t<F.length;t++){var n=U(F[t]);n.classList.contains(`onpress`)&&n.classList.remove(`onpress`)}this._setNextPage()}}if(this._inlineUserVarViewer?.isVisible){let e=this._inlineUserVarViewer.kind,t=!1,n=e===`named`?this._userVar.named.size:R.USER_VAR_NUM;this._keyStore.getKeyState(V.KEY_DOWN)===B.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex[e]++,t=!0),this._keyStore.getKeyState(V.KEY_UP)===B.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex[e]--,t=!0),this._keyStore.getKeyState(V.KEY_RIGHT)===B.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex[e]+=R.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,t=!0),this._keyStore.getKeyState(V.KEY_LEFT)===B.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex[e]-=R.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,t=!0),this._keyStore.getKeyState(V.KEY_V)===B.KEYDOWN&&(this._inlineUserVarViewer.kind===`named`?this._inlineUserVarViewer.kind=`numbered`:this._inlineUserVarViewer.kind===`numbered`&&(this._inlineUserVarViewer.kind=`named`),t=!0),this._inlineUserVarViewer.topUserVarIndex[e]<0&&(this._inlineUserVarViewer.topUserVarIndex[e]+=n),this._inlineUserVarViewer.topUserVarIndex[e]>n&&(this._inlineUserVarViewer.topUserVarIndex[e]-=n),t&&(this._setNextPage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars())}}else if(this._player.isWaitingEstimateWindow())(this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_SPACE)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`))&&this.hideBattleEstimateWindow();else if(this._player.isFighting())this._player.fight(),this._monsterWindow.update(this._monster);else if(this._player.isWaitingMoveMacro())this._player.isMoveObjectAutoExecTime()&&(this.moveObjects(!1),this._player.resetMoveObjectAutoExecTimer()),this._objectMovingDataManager.update();else if(this._player.isManualPause()){let e=this._player.getManualPauseInformation();if(this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyStateForMessageCheck(V.KEY_SPACE)===B.KEYDOWN||this._keyStore.getKeyStateForMessageCheck(V.KEY_ESC)===B.KEYDOWN||this._mouseStore.getMouseState()===Te.MOUSEDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`)){let t=e?.functionNames.cancelPause??``;if(this._player.clearWaitingMessageOrManualPause(),t!==``)try{this.evalCalcWwaNodeGenerator.evalWwaNode({type:`CallDefinedFunction`,functionName:t})}catch(e){console.error(e)}}[{keyCode:V.KEY_UP,funcKey:`up`},{keyCode:V.KEY_DOWN,funcKey:`down`},{keyCode:V.KEY_RIGHT,funcKey:`right`},{keyCode:V.KEY_LEFT,funcKey:`left`}].forEach(({keyCode:t,funcKey:n})=>{let r=e?.functionNames[n]??``;if(this._keyStore.getKeyState(t)===B.KEYDOWN&&r!==``)try{this.evalCalcWwaNodeGenerator.evalWwaNode({type:`CallDefinedFunction`,functionName:r})}catch(e){console.error(e)}})}if(this.updatePicturesAnimation(),this._cgManager.picture.updateFrameTimerValue(),this._prevFrameEventExected=!1,this._player.getPosition().isJustPosition()&&this._camera.getPosition().isScreenTopPosition()){if(!this._shouldTreatWillMessageDisplay(this._pages)&&!this._player.isPausing()){this._player.isPartsAppearedTime()&&this._player.clearPartsAppearedFlag(),this._replaceRandomObjectsInScreen();var o=this.checkMap();o||this.checkObject(),this._prevFrameEventExected=o}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==k.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}this._passwordLoadExecInNextFrame&&=(this._stopUpdateByLoadFlag=!0,this._loadType=oe.PASSWORD,this._player.clearPasswordWindowWaiting(),!1),this._drawAll(),this._mainCallCounter++,this._mainCallCounter%=1e9,(!this._player.isWaitingMessageOrManualPause()||!this._isClassicModeEnable)&&(this._animationCounter=(this._animationCounter+1)%(R.ANIMATION_REP_HALF_FRAME*2),(this._animationCounter===0||this._animationCounter===R.ANIMATION_REP_HALF_FRAME+1)&&this.updateAllPicturesCache()),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessageOrManualPause()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&--this._statusPressCounter.energy===0&&U(`disp-energy`).classList.remove(`onpress`),this._statusPressCounter.strength>0&&--this._statusPressCounter.strength===0&&U(`disp-strength`).classList.remove(`onpress`),this._statusPressCounter.defence>0&&--this._statusPressCounter.defence===0&&U(`disp-defence`).classList.remove(`onpress`),this._statusPressCounter.gold>0&&--this._statusPressCounter.gold===0&&U(`disp-gold`).classList.remove(`onpress`)),this._player.isWaitingMoveMacro()&&(this._player.decrementMoveObjectAutoExecTimer(),this._player.isWaitingMoveMacro()||this._dispatchPlayerAndObjectsStopTimeRequests()),this._stopUpdateByLoadFlag?this._fadeout(()=>{if(this._loadType===oe.QUICK_LOAD){this._quickLoad(),this.wwaCustomEvent(`wwa_quickload`);let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_QUICKLOAD;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}else if(this._loadType===oe.RESTART_GAME){this.restartGame(),this.wwaCustomEvent(`wwa_restert`);let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_RESTART;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}else if(this._loadType===oe.PASSWORD){this._applyQuickLoad(this._passwordSaveExtractData),this._passwordSaveExtractData=void 0,this.wwaCustomEvent(`wwa_passwordload`);let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_PASSWORDLOAD;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}setTimeout(this.mainCaller,R.DEFAULT_FRAME_INTERVAL,this)}):window.requestAnimationFrame(this.mainCaller),this._varDump?.updateAllVariables({userVar:this._userVar.numbered,namedUserVar:this._userVar.named});let s=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_FRAME;s&&this.evalCalcWwaNodeGenerator.evalWwaNode(s)}vibration(e){this._gamePadStore.vibration(e)}_isMainAnimation(){return this._animationCounter>R.ANIMATION_REP_HALF_FRAME}_drawAll(){var e=this._camera.getPosition().getPartsCoord(),t=this._camera.getPosition().getOffsetCoord(),n=R.MAP_WINDOW_HEIGHT,r,i,a=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen){this._paintSkipByDoorOpen=!1;return}if(this._cgManager.clearCanvas(0,0,R.MAP_WINDOW_WIDTH,R.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,R.MAP_WINDOW_WIDTH,R.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(this._camera.getPreviousPosition()!==null)var o=this._camera.getPreviousPosition().getPartsCoord(),s=this._camera.getPreviousPosition().getOffsetCoord();n=this._camera.getTransitionStepNum()*R.CHIP_SIZE}var c=!1;if(n!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=n,c=!0),(e.x!==this._cgManager.cpPartsLog.x||e.y!==this._cgManager.cpPartsLog.y)&&(this._cgManager.cpPartsLog.x=e.x,this._cgManager.cpPartsLog.y=e.y,c=!0),c&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(o,s,n,!0),this._drawPlayer(o,s,n,!0),this._drawObjects(o,s,n,!0),this._camera.isFinalStep()))var l=255,u=setInterval(()=>{var e=U(`wwa-fader`);if(l-=R.FADEOUT_SPEED*3,l<=0){clearInterval(u),e.style.backgroundColor=`transparent`,e.removeAttribute(`style`),e.style.display=`none`;return}e.style.opacity=l/255+``},20);this._drawMap(e,t,n,!1,c),this._drawPlayer(e,t,n),this._drawObjects(e,t,n,!1,c),this._player.isFighting()&&!this._player.isBattleStartFrame()&&(r=this._player.isTurn()?this._monster.position.x:a.x,i=this._player.isTurn()?this._monster.position.y:a.y,this._cgManager.drawCanvas(this._battleEffectCoord.x,this._battleEffectCoord.y,R.CHIP_SIZE*(r-e.x)-t.x,R.CHIP_SIZE*(i-e.y)-t.y)),this._drawEffect(),this._drawPictures(),this._drawFaces(),this._drawFrame()}_drawMap(e,t,n,r=!1,i=!1){if(e!==void 0){var a=Math.max(0,e.x-1),o=Math.min(this._wwaData.mapWidth-1,e.x+R.H_PARTS_NUM_IN_WINDOW),s=Math.max(0,e.y-1),c=Math.min(this._wwaData.mapWidth-1,e.y+R.V_PARTS_NUM_IN_WINDOW),l=0;if(r)for(var u=a;u<=o;u++)for(var d=s;d<=c;d++){var f=this._wwaData.map[d][u],p=this._wwaData.mapAttribute[f][R.ATR_X]/R.CHIP_SIZE,m=this._wwaData.mapAttribute[f][R.ATR_Y]/R.CHIP_SIZE,h=R.CHIP_SIZE*(u-e.x)-t.x,g=R.CHIP_SIZE*(d-e.y)-t.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,m,h,g,n)}else{for(var u=a;u<=o;u++)for(var d=s;d<=c;d++){var f=this._wwaData.map[d][u];this._cgManager.mapCache[l]!==f&&(this._cgManager.mapCache[l]=f,i=!0),l++}if(i){this._cgManager.clearBackCanvasWithLowerYLimit(n);for(var u=a;u<=o;u++)for(var d=s;d<=c;d++){var f=this._wwaData.map[d][u],p=this._wwaData.mapAttribute[f][R.ATR_X]/R.CHIP_SIZE,m=this._wwaData.mapAttribute[f][R.ATR_Y]/R.CHIP_SIZE,h=R.CHIP_SIZE*(u-e.x)-t.x,g=R.CHIP_SIZE*(d-e.y)-t.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,m,h,g,n)}}this._cgManager.drawBackCanvas()}}}_drawPlayer(e,t,n,r=!1){if(e===void 0||this._wwaData.delPlayerFlag)return;let i=this._player.getPosition().getPartsCoord(),a=this._player.getPosition().getOffsetCoord(),o=[NaN,NaN,2,NaN,4,NaN,6,NaN,0,NaN][this._player.getDir()],s=(i.x-e.x)*R.CHIP_SIZE+a.x-t.x,c=(i.y-e.y)*R.CHIP_SIZE+a.y-t.y,l;l=this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessageOrManualPause()?this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]:this._player.isMovingImage()?this._wwaData.playerImgPosX+o+1:this._wwaData.playerImgPosX+o,r?this._cgManager.drawCanvasWithLowerYLimit(l,this._wwaData.playerImgPosY,s,c,n):this._cgManager.drawCanvasWithUpperYLimit(l,this._wwaData.playerImgPosY,s,c,n)}_drawObjects(e,t,n,r=!1,i=!1){if(e!==void 0){var a=Math.max(0,e.x-1),o=Math.min(this._wwaData.mapWidth-1,e.x+R.H_PARTS_NUM_IN_WINDOW),s=Math.max(0,e.y-1),c=Math.min(this._wwaData.mapWidth-1,e.y+R.V_PARTS_NUM_IN_WINDOW),l,u=0,d=this._isMainAnimation(),f,p,m,h,g,_,v,y,b,x,C,w,T,E=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(r)for(b=a;b<=o;b++)for(x=s;x<=c;x++)E&&new S(b,x).equals(this._monster.position)||(C=this._wwaData.mapObject[x][b],l=new S(0,0),this._wwaData.objectAttribute[C][R.ATR_MOVE]!==se.STATIC&&(y=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new S(b,x)),y!==null&&(l=y)),h=R.CHIP_SIZE*(b-e.x)+l.x-t.x,g=R.CHIP_SIZE*(x-e.y)+l.y-t.y,f=d||this._wwaData.objectAttribute[C][R.ATR_X2]===0&&this._wwaData.objectAttribute[C][R.ATR_Y2]===0,p=this._wwaData.objectAttribute[C][f?R.ATR_X:R.ATR_X2]/R.CHIP_SIZE,m=this._wwaData.objectAttribute[C][f?R.ATR_Y:R.ATR_Y2]/R.CHIP_SIZE,_=this._wwaData.objectAttribute[C][R.ATR_TYPE],v=this._wwaData.objectAttribute[C][R.ATR_NUMBER],C!==0&&!this._checkNoDrawObject(new S(b,x),_,v)&&this._cgManager.copyObjectCanvasWithLowerYLimit(+!!d,p,m,h,g,n));else{var D=[],O=[],k,A,te;for(b=a;b<=o;b++)for(x=s;x<=c;x++)w=C=this._wwaData.mapObject[x][b],_=this._wwaData.objectAttribute[C][R.ATR_TYPE],v=this._wwaData.objectAttribute[C][R.ATR_NUMBER],this._checkNoDrawObject(new S(b,x),_,v)&&(w=0),A=this._wwaData.objectAttribute[C][R.ATR_MOVE]===se.STATIC,w!==0&&(te=!!(E&&new S(b,x).equals(this._monster.position)),A?O.push(new ee(C,b,x,A,te)):(D.push(new ee(C,b,x,A,te)),w=0),te&&(w=0)),this._cgManager.mapObjectCache[u]!==w&&(this._cgManager.mapObjectCache[u]=w,i=!0),u++;i&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(n),Array.prototype.push.apply(D,O));var j,M=D.length;for(j=0;j<M;j++)if(k=D[j],b=k.x,x=k.y,C=k.partsIDObj,A=k.isStatic,te=k.isFighting,h=R.CHIP_SIZE*(b-e.x)-t.x,g=R.CHIP_SIZE*(x-e.y)-t.y,A){if(te)continue;for(T=0;T<2;T++)f=!!T||this._wwaData.objectAttribute[C][R.ATR_X2]===0&&this._wwaData.objectAttribute[C][R.ATR_Y2]===0,p=this._wwaData.objectAttribute[C][f?R.ATR_X:R.ATR_X2]/R.CHIP_SIZE,m=this._wwaData.objectAttribute[C][f?R.ATR_Y:R.ATR_Y2]/R.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(T,p,m,h,g,n)}else y=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new S(b,x)),y!==null&&(h+=y.x,g+=y.y),f=d||this._wwaData.objectAttribute[C][R.ATR_X2]===0&&this._wwaData.objectAttribute[C][R.ATR_Y2]===0,p=this._wwaData.objectAttribute[C][f?R.ATR_X:R.ATR_X2]/R.CHIP_SIZE,m=this._wwaData.objectAttribute[C][f?R.ATR_Y:R.ATR_Y2]/R.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(p,m,h,g,n);this._cgManager.drawObjectCanvas(+!!d)}}}_drawEffect(){if(!(this._wwaData.effectCoords.length===0||this._wwaData.effectWaits===0)){var e=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(e)}}_drawFaces(){for(var e=0;e<this._faces.length;e++)this._cgManager.drawCanvasWithSize(this._faces[e].srcPos.x,this._faces[e].srcPos.y,this._faces[e].srcSize.x,this._faces[e].srcSize.y,this._faces[e].destPos.x,this._faces[e].destPos.y)}_drawFrame(){this._cgManager.drawFrame()}_drawPictures(){this._cgManager.drawPictures()}_checkNoDrawObject(e,t,n){var r=this._player.getPosition(),i=r.getPartsCoord();return!r.isJustPosition()||i.x!==e.x||i.y!==e.y||this._wwaData.objectNoCollapseDefaultFlag?!1:t===R.OBJECT_DOOR&&n===0?!0:t===R.OBJECT_STATUS||t===R.OBJECT_MESSAGE||t===R.OBJECT_ITEM||t===R.OBJECT_SELL||t===R.OBJECT_BUY||t===R.OBJECT_SELL||t===R.OBJECT_LOCALGATE}getMapWidth(){if(this._wwaData===void 0)throw Error(`マップデータがロードされていません`);return this._wwaData.mapWidth}getMapIdByPosition(e){var t=e.getPartsCoord();return this._wwaData.map[t.y][t.x]}getObjectIdByPosition(e){var t=e.getPartsCoord();return this._wwaData.mapObject[t.y][t.x]}getMapTypeByPosition(e){var t=e.getPartsCoord(),n=this._wwaData.map[t.y][t.x];return this._wwaData.mapAttribute[n][R.ATR_TYPE]}getObjectTypeByPosition(e){var t=e.getPartsCoord(),n=this._wwaData.mapObject[t.y][t.x];return this._wwaData.objectAttribute[n][R.ATR_TYPE]}getMapAttributeByPosition(e,t){var n=e.getPartsCoord(),r=this._wwaData.map[n.y][n.x];return this._wwaData.mapAttribute[r][t]}isCurrentPosMapPartsIncludingMessage(e){return this.getMapAttributeByPosition(e,R.ATR_STRING)!==0}getObjectAttributeByPosition(e,t){var n=e.getPartsCoord(),r=this._wwaData.mapObject[n.y][n.x];return this._wwaData.objectAttribute[r][t]}getMapAttributeById(e,t){return this._wwaData.mapAttribute[e][t]}getObjectAttributeById(e,t){return this._wwaData.objectAttribute[e][t]}getObjectCropXById(e){return this._wwaData.objectAttribute[e][R.ATR_X]}getObjectCropYById(e){return this._wwaData.objectAttribute[e][R.ATR_Y]}getMessageById(e){return this._wwaData.message[e]}getSystemMessageById(e){return this._wwaData.systemMessage[e]}getMapInfo(e){return this._wwaData.mapAttribute[e]}checkMap(e){var t=this._player.getPosition().getPartsCoord();e??=t;var n=this._wwaData.map[e.y][e.x],r=this.getMapInfo(n)[R.ATR_TYPE],i=e.x===t.x&&e.y===t.y,a=!1;return i&&this._player.getLastExecPartsIDOnSamePosition(j.MAP)===n?!1:(r===R.MAP_STREET?a=this._execMapStreetEvent(e,n,r):r===R.MAP_WALL?a=this._execMapWallEvent(e,n,r):r===R.MAP_LOCALGATE?a=this._execMapLocalGateEvent(e,n,r):r===R.MAP_URLGATE&&(a=this._execMapUrlGateEvent(e,n,r)),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(j.MAP,n),a)}getObjectInfo(e){return this._wwaData.objectAttribute[e]}checkObject(e){var t=this._player.getPosition().getPartsCoord();e??=t;var n=this._wwaData.mapObject[e.y][e.x],r=this.getObjectInfo(n)[R.ATR_TYPE],i=e.x===t.x&&e.y===t.y;i&&this._player.getLastExecPartsIDOnSamePosition(j.OBJECT)===n||(r===R.OBJECT_NORMAL?this._execObjectNormalEvent(e,n,r):r===R.OBJECT_MESSAGE?this._execObjectMessageEvent(e,n,r):r===R.OBJECT_MONSTER?this._execObjectMonsterEvent(e,n,r):r===R.OBJECT_ITEM?this._execObjectItemEvent(e,n,r):r===R.OBJECT_DOOR?this._execObjectDoorEvent(e,n,r):r===R.OBJECT_STATUS?this._execObjectStatusEvent(e,n,r):r===R.OBJECT_BUY?this._execObjectBuyEvent(e,n,r):r===R.OBJECT_SELL?this._execObjectSellEvent(e,n,r):r===R.OBJECT_URLGATE?this._execObjectUrlGateEvent(e,n,r):r===R.OBJECT_SCORE?this._execObjectScoreEvent(e,n,r):r===R.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(e,n,r):r===R.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(e,n,r),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(j.OBJECT,n))}_execMapStreetEvent(e,t,n){var r=this._wwaData.mapAttribute[t][R.ATR_ITEM];if(r!==0&&!this._player.hasItem(r))return!1;this.reserveAppearPartsInNextFrame(e,A.MAP,t);let i=this._wwaData.mapAttribute[t][R.ATR_STRING],a=this._wwaData.message[i],o=this._wwaData.mapAttribute[t][R.ATR_NUMBER];return this._waitFrame+=o*R.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.registerPageByMessage(a,{triggerParts:{id:t,type:j.MAP,position:e.clone()}}),this.playSound(this._wwaData.mapAttribute[t][R.ATR_SOUND]),i!==0&&this._shouldTreatWillMessageDisplay(this._pages)||o!==0}_shouldTreatWillMessageDisplay(e){return e.reduce((e,t)=>e||!hr(t.firstNode),!1)}_execMapWallEvent(e,t,n){var r=this.getObjectIdByPosition(e.convertIntoPosition(this)),i=this.getObjectAttributeById(r,R.ATR_TYPE);if(r===0||i===R.OBJECT_NORMAL||i===R.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(r,R.ATR_ITEM))||this.getObjectAttributeById(i,R.ATR_MODE)===R.PASSABLE_OBJECT)){this.reserveAppearPartsInNextFrame(e,A.MAP,t);var a=this._wwaData.mapAttribute[t][R.ATR_STRING],o=this._wwaData.message[a];return this.registerPageByMessage(o,{triggerParts:{id:t,type:j.MAP,position:e.clone()}}),this.playSound(this._wwaData.mapAttribute[t][R.ATR_SOUND]),!1}return!1}_execMapLocalGateEvent(e,t,n){var r=this._player.getPosition().getPartsCoord(),i=this._wwaData.mapAttribute[t][R.ATR_JUMP_X],a=this._wwaData.mapAttribute[t][R.ATR_JUMP_Y];return i>R.RELATIVE_COORD_LOWER&&(i=e.x+i-R.RELATIVE_COORD_BIAS),a>R.RELATIVE_COORD_LOWER&&(a=e.y+a-R.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(e,A.MAP,t),0<=i&&0<=a&&i<this._wwaData.mapWidth&&a<this._wwaData.mapWidth&&(i!==r.x||a!==r.y)?(this.reserveJumpInNextFrame(new C(this,i,a,0,0)),this.playSound(this._wwaData.mapAttribute[t][R.ATR_SOUND]),!0):!1}_execMapUrlGateEvent(e,t,n){var r=this._wwaData.mapAttribute[t][R.ATR_STRING];if(!this._isURLGateEnable)return!0;let i=this.resolveSystemMessage(g.CONFIRM_ENTER_URL_GATE);if(i===`BLANK`){location.href=Ve(this._wwaData.message[r].split(/\s/g)[0]);return}return this.registerSystemMessagePage(i,!0),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[r].split(/\s/g)[0],!0}_execObjectNormalEvent(e,t,n){}_execObjectMessageEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r],a=this._player.getPosition().getPartsCoord(),o=this._wwaData.objectAttribute[t][R.ATR_SOUND];e.x===a.x&&e.y===a.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e),this.registerPageByMessage(i,{triggerParts:{id:t,type:j.OBJECT,position:e}}),this._waitFrame+=this._wwaData.objectAttribute[t][R.ATR_NUMBER]*R.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.reserveAppearPartsInNextFrame(e,A.OBJECT,t),this.playSound(o)}_execObjectStatusEvent(e,t,n){var r=new x(this._wwaData.objectAttribute[t][R.ATR_ENERGY],this._wwaData.objectAttribute[t][R.ATR_STRENGTH],this._wwaData.objectAttribute[t][R.ATR_DEFENCE],this._wwaData.objectAttribute[t][R.ATR_GOLD]),i=this._wwaData.objectAttribute[t][R.ATR_STRING],a=this._wwaData.message[i],o=this._player.getStatusWithoutEquipments();if(r.strength>R.STATUS_MINUS_BORDER&&o.strength<r.strength-R.STATUS_MINUS_BORDER||r.defence>R.STATUS_MINUS_BORDER&&o.defence<r.defence-R.STATUS_MINUS_BORDER||r.gold>R.STATUS_MINUS_BORDER&&o.gold<r.gold-R.STATUS_MINUS_BORDER){this.setPartsOnPosition(j.OBJECT,0,e),this._keyStore.allClear(),this._mouseStore.clear();return}if(r.energy=r.energy>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-r.energy:r.energy,r.strength=r.strength>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-r.strength:r.strength,r.defence=r.defence>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-r.defence:r.defence,r.gold=r.gold>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-r.gold:r.gold,this._player.addStatusAll(r),this.setStatusChangedEffect(r),this._player.isDead()&&this._wwaData.objectAttribute[t][R.ATR_ENERGY]!==0&&this.shouldApplyGameOver({isCalledByMacro:!1})){this.gameover();return}this.registerPageByMessage(a,{triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this.setPartsOnPosition(j.OBJECT,0,e),this.reserveAppearPartsInNextFrame(e,A.OBJECT,t),this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectMonsterEvent(e,t,n){this._monster=this._createMonster(t,e,()=>{this._monster=void 0,this._monsterWindow.hide(),this._dispatchWindowClosedTimeRequests()}),this._player.startBattleWith(this._monster)}_execObjectBuyEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r],a=this._player.getPosition().getPartsCoord();e.x===a.x&&e.y===a.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e),this.registerPageByMessage(i,{showChoice:!0,triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectSellEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r],a=this._player.getPosition().getPartsCoord();e.x===a.x&&e.y===a.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e),this.registerPageByMessage(i,{showChoice:!0,triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectItemEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r];try{var a=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),o=(e.x-a.x)*R.CHIP_SIZE,s=(e.y-a.y)*R.CHIP_SIZE;this._player.addItem(t,this._wwaData.objectAttribute[t][R.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new S(o,s),itemBoxBackgroundImageCoord:new S(this._wwaData.imgItemboxX*R.CHIP_SIZE,this._wwaData.imgItemboxY*R.CHIP_SIZE)}:void 0),this.setPartsOnPosition(j.OBJECT,0,e),this._wwaData.objectAttribute[t][R.ATR_MODE]!==0||(this.registerPageByMessage(i,{triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this.reserveAppearPartsInNextFrame(e,A.OBJECT,t))}catch{this.registerSystemMessagePageByKey(g.ITEM_BOX_FULL)}this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectDoorEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_ITEM],i=this._wwaData.objectAttribute[t][R.ATR_STRING],a=this._wwaData.message[i];this._player.hasItem(r)&&(this._wwaData.objectAttribute[t][R.ATR_MODE]===0&&this._player.removeItemByPartsID(r),this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND]),this.registerPageByMessage(a,{triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this.setPartsOnPosition(j.OBJECT,0,e),this.reserveAppearPartsInNextFrame(e,A.OBJECT,t),this._paintSkipByDoorOpen=!0)}_execObjectYesNoChoiceEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r],a=this._player.getPosition().getPartsCoord();e.x===a.x&&e.y===a.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e),this.registerPageByMessage(i,{showChoice:!0,triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectLocalGateEvent(e,t,n){var r=this._player.getPosition().getPartsCoord();e.x===r.x&&e.y===r.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e);var i=this._wwaData.objectAttribute[t][R.ATR_JUMP_X],a=this._wwaData.objectAttribute[t][R.ATR_JUMP_Y];i>R.RELATIVE_COORD_LOWER&&(i=r.x+i-R.RELATIVE_COORD_BIAS),a>R.RELATIVE_COORD_LOWER&&(a=r.y+a-R.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(e,A.OBJECT,t),0<=i&&0<=a&&i<this._wwaData.mapWidth&&a<this._wwaData.mapWidth&&(i!==r.x||a!==r.y)&&(this.reserveJumpInNextFrame(new C(this,i,a,0,0)),this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND]))}_execObjectUrlGateEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING];if(!this._isURLGateEnable)return;let i=this.resolveSystemMessage(g.CONFIRM_ENTER_URL_GATE);if(i===`BLANK`){location.href=Ve(this._wwaData.message[r].split(/\s/g)[0]);return}this.registerSystemMessagePage(i,!0),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[r].split(/\s/g)[0]}_execObjectScoreEvent(e,t,n){let r=this._wwaData.objectAttribute[t][R.ATR_STRING];this.registerPageByMessage(this._wwaData.message[r],{triggerParts:{id:t,type:j.OBJECT,position:e},scoreOption:{rates:{energy:this._wwaData.objectAttribute[t][R.ATR_ENERGY],strength:this._wwaData.objectAttribute[t][R.ATR_STRENGTH],defence:this._wwaData.objectAttribute[t][R.ATR_DEFENCE],gold:this._wwaData.objectAttribute[t][R.ATR_GOLD]}}}),this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}updateScore(e){let t=e||this._lastScoreOptions;if(!t)return;let n=this._player.getStatus().calculateScore(t);this._scoreWindow.update(n)}_execChoiceWindowObjectSellEvent(){if(!this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_GOLD]))return this.registerSystemMessagePageByKey(g.NO_MONEY),{};if(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ITEM]!==0){let e=this._yesNoChoicePartsCoord,t=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),n=(e.x-t.x)*R.CHIP_SIZE,r=(e.y-t.y)*R.CHIP_SIZE,i=this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ITEM],a=this._wwaData.objectAttribute[i][R.ATR_NUMBER];try{this._player.addItem(i,a,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new S(n,r),itemBoxBackgroundImageCoord:new S(this._wwaData.imgItemboxX*R.CHIP_SIZE,this._wwaData.imgItemboxY*R.CHIP_SIZE)}:void 0)}catch{return this.registerSystemMessagePageByKey(g.ITEM_BOX_FULL),{}}}let e=new x(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_GOLD]);return e.energy=e.energy>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-e.energy:e.energy,this.setStatusChangedEffect(e),this._player.addStatusAll(e),this._player.isDead()&&this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ENERGY]!==0&&this.shouldApplyGameOver({isCalledByMacro:!1})?(this.gameover(),{isGameOver:!0}):(this.appearParts({pos:this._yesNoChoicePartsCoord,triggerType:A.OBJECT,triggerPartsId:this._yesNoChoicePartsID}),{})}_execChoiceWindowRunningEvent(){var e,t;if(--this._yesNoDispCounter===0){if(this._yesNoJudge===k.YES){if(this._yesNoChoiceCallInfo===N.CALL_BY_MAP_PARTS)e=this._wwaData.mapAttribute[this._yesNoChoicePartsID][R.ATR_TYPE],e===R.MAP_URLGATE&&(location.href=Ve(this._yesNoURL));else if(this._yesNoChoiceCallInfo===N.CALL_BY_OBJECT_PARTS)if(e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_TYPE],e===R.OBJECT_BUY)this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ITEM])?(this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ITEM]),t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_GOLD],this._player.earnGold(t),this.setStatusChangedEffect(new x(0,0,0,t)),this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)):this.registerSystemMessagePageByKey(g.NO_ITEM);else if(e===R.OBJECT_SELL){let{isGameOver:e}=this._execChoiceWindowObjectSellEvent();if(e)return}else e===R.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.CHOICE_YES,this._yesNoChoicePartsID):e===R.OBJECT_URLGATE&&(location.href=Ve(this._yesNoURL));else this._yesNoChoiceCallInfo===N.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===N.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),U(F[P.QUICK_LOAD]).classList.remove(`onpress`),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=oe.QUICK_LOAD)):this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),U(F[P.QUICK_SAVE]).classList.remove(`onpress`),this._quickSave(N.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===N.CALL_BY_RESTART_GAME?(U(F[P.RESTART_GAME]).classList.remove(`onpress`),this._stopUpdateByLoadFlag=!0,this._loadType=oe.RESTART_GAME):this._yesNoChoiceCallInfo===N.CALL_BY_END_GAME?(window.history.back(-1),U(F[P.GOTO_WWA]).classList.remove(`onpress`)):this._yesNoChoiceCallInfo===N.CALL_BY_GOTO_WWA?(location.href=Ve(R.WWA_HOME),U(F[P.GOTO_WWA]).classList.remove(`onpress`)):this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_LOAD?(U(F[P.QUICK_LOAD]).classList.remove(`onpress`),this._player.setPasswordWindowWating(),this._passwordWindow.show(Cr.LOAD)):this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_SAVE?(U(F[P.QUICK_SAVE]).classList.remove(`onpress`),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(N.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Cr.SAVE)):this._yesNoChoiceCallInfo===N.CALL_BY_SUSPEND&&(U(F[P.QUICK_SAVE]).classList.remove(`onpress`),this._quickSave(N.CALL_BY_SUSPEND));this._yesNoJudge=k.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===k.NO){if(this._yesNoChoiceCallInfo===N.CALL_BY_MAP_PARTS)e=this._wwaData.mapAttribute[this._yesNoChoicePartsID][R.ATR_TYPE],R.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===N.CALL_BY_OBJECT_PARTS)e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_TYPE],e===R.OBJECT_BUY||e===R.OBJECT_SELL||(e===R.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.CHOICE_NO,this._yesNoChoicePartsID):R.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===N.CALL_BY_ITEM_USE)U(`item`+(this._yesNoUseItemPos-1)).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===N.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case N.NONE:U(F[P.QUICK_LOAD]).classList.remove(`onpress`);break;case N.CALL_BY_PASSWORD_LOAD:this._yesNoJudge=k.UNSELECTED,this.onpasswordloadcalled();return;case N.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var n=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=k.UNSELECTED,n){case N.CALL_BY_PASSWORD_LOAD:this.registerSystemMessagePage(`読み込むオートセーブを選んでください。
120
+ 使用できません。`):(this.registerSystemMessagePage(`ゲームを中断しますか?`,!0),this._yesNoChoiceCallInfo=N.CALL_BY_SUSPEND)}onitemmenucalled(){this.registerSystemMessagePage(`右のメニューを選択してください。`),this._messageWindow.setItemMenuChoice(!0),this.playDecisionSound(),this._itemMenu.openView()}onchangespeed(e){if(!this._wwaData.permitChangeGameSpeed){this.registerSystemMessagePageByKey(g.GAME_SPEED_CHANGE_DISABLED);return}switch(e){case ae.UP:this._player.speedUp();break;case ae.DOWN:this._player.speedDown();break}let t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_CHANGE_SPEED;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t),this.registerSystemMessagePageByKey(g.GAME_SPEED_CHANGED)}isBattleSpeedIndexForQuickBattle(e){return R.QUICK_BATTLE_SPEED_INDECIES.some(t=>t===e)}_main(){if(this._stopUpdateByLoadFlag)return;this._temporaryInputDisable=!1,this._keyStore.update(),this._mouseStore.update(),this._virtualPadStore.update(),this._gamePadStore.update();let e=this._reservedPartsAppearances.length>0;if(this._reservedPartsAppearances.forEach(e=>this.appearParts(e)),this._reservedPartsAppearances=[],this._waitFrame-- >0){e&&this._drawAll();return}if(this._waitFrame=0,this._yesNoJudgeInNextFrame!==void 0&&(this._yesNoJudge=this._yesNoJudgeInNextFrame,this._yesNoJudgeInNextFrame=void 0),this._clearFacesInNextFrame&&=(this.clearFaces(),!1),this._pageExecuting=!0,this._pages.length>0&&this._shouldSetNextPage)for(this._shouldSetNextPage=!1;this._pages.length>0;){let e=this._pages.shift(),t=er.executeNodes(e.firstNode,e.triggerParts);if(t.isError===!0){this._isLastPage=!1;break}this._reservedMoveMacroTurn!==void 0&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0);let n=t.messages.filter(e=>!e.isEmpty()),r=!!e.scoreOption;if(r&&n.length===0&&n.push(this._createSimpleMessage(`スコアを表示します。`,e.triggerParts)),e.additionalItems&&e.additionalItems.forEach(e=>{switch(e.type){case`face`:this.addFace(e.data.face)}}),n.length>0){let t=n.map(e=>e.generatePrintableMessage()).join(`
121
+ `);this._messageWindow.setMessage(t),this._messageWindow.setYesNoChoice(e.showChoice),this._messageWindow.setPositionByPlayerPosition(this._faces.length!==0,r,e.isSystemMessage,this._player.getPosition(),this._camera.getPosition()),r&&(this._lastScoreOptions=e.scoreOption,this.updateScore(e.scoreOption),this._scoreWindow.show()),this._player.setMessageWaiting(),this._isLastPage=e.isLastPage,this._shouldSetNextPage=!1;break}if(this._pages.length===0){if(this._hideMessageWindow().newPageGenerated||this._dispatchWindowClosedTimeRequests().newPageGenerated)continue;this.clearFaces();break}}if(this._pageExecuting=!1,this._reservedJumpDestination&&=(this._player.jumpTo(this._reservedJumpDestination),void 0),this._player.mainFrameCount(),this._player.isControllable()){if(this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(N.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame())this._player.updateDelayFrame();else{let e=this._player.getDir(),t=[NaN,NaN,V.KEY_DOWN,NaN,V.KEY_LEFT,NaN,V.KEY_RIGHT,NaN,V.KEY_UP,NaN][e];this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(V.KEY_LEFT)===B.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(V.KEY_UP)===B.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(V.KEY_RIGHT)===B.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(V.KEY_DOWN)===B.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(E.LEFT)===Te.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(E.UP)===Te.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(E.RIGHT)===Te.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(E.DOWN)===Te.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(t)?this._checkTurnKeyPressed()?this._player.setDir(e):(this._player.controll(e),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(V.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(V.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(V.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(V.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(E.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(E.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(E.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(E.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(H.BUTTON_INDEX_B)?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(H.BUTTON_INDEX_B)?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(H.BUTTON_INDEX_B)?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(H.BUTTON_INDEX_B)?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton(`BUTTON_LEFT`)?this._virtualPadStore.checkTouchingButton(`BUTTON_ESC`)?this._player.setDir(E.LEFT):(this._player.controll(E.LEFT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton(`BUTTON_UP`)?this._virtualPadStore.checkTouchingButton(`BUTTON_ESC`)?this._player.setDir(E.UP):(this._player.controll(E.UP),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton(`BUTTON_RIGHT`)?this._virtualPadStore.checkTouchingButton(`BUTTON_ESC`)?this._player.setDir(E.RIGHT):(this._player.controll(E.RIGHT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton(`BUTTON_DOWN`)?this._virtualPadStore.checkTouchingButton(`BUTTON_ESC`)?this._player.setDir(E.DOWN):(this._player.controll(E.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(V.KEY_1)===B.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(V.KEY_2)===B.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(V.KEY_3)===B.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(V.KEY_Q)===B.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(V.KEY_W)===B.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(V.KEY_E)===B.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(V.KEY_A)===B.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(V.KEY_S)===B.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(V.KEY_D)===B.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(V.KEY_Z)===B.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(V.KEY_X)===B.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(V.KEY_C)===B.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(V.KEY_I)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_MINUS)||this._virtualPadStore.checkTouchButton(`BUTTON_SLOW`)?this.onchangespeed(ae.DOWN):this._keyStore.getKeyState(V.KEY_P)===B.KEYDOWN||this._keyStore.checkHitKey(V.KEY_F2)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_PLUS)||this._virtualPadStore.checkTouchButton(`BUTTON_FAST`)?this.onchangespeed(ae.UP):this._keyStore.getKeyState(V.KEY_F1)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_M)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(V.KEY_F3)?(this.playDecisionSound(),this.onselectbutton(P.QUICK_LOAD,!0)):this._keyStore.checkHitKey(V.KEY_F4)?(this.playDecisionSound(),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(V.KEY_F5)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_ZR)?this.onselectbutton(P.QUICK_LOAD):this._keyStore.checkHitKey(V.KEY_F6)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_ZL)?this.onselectbutton(P.QUICK_SAVE):this._keyStore.checkHitKey(V.KEY_F7)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_R)?this.onselectbutton(P.RESTART_GAME):this._keyStore.checkHitKey(V.KEY_F8)?this.onselectbutton(P.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(V.KEY_F9)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_X)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`)?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(V.KEY_V)?this._displayUserVars():this._keyStore.checkHitKey(V.KEY_X)?this._debugConsoleElement&&!this._player.isControllable()&&this._debugEvalString():this._keyStore.checkHitKey(V.KEY_F12)||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_Y)?this._displayHelp():this._keyStore.checkHitKey(V.KEY_F)&&(this._frameRateDisplayingPattern===`default-off`||this._frameRateDisplayingPattern===`default-on`)&&(this._gameFrameRateWindow.toggleVisibility(),this._gameFrameRateWindow.updateTargetFps(R.TARGET_FPS)));let n=(e,t)=>({key:V[`KEY_${e}`],func:t});[...`0123456789`.split(``).map(e=>n(e,`CALL_PUSH_${e}`)),...`0123456789`.split(``).map(e=>n(`NUM${e}`,`CALL_PUSH_${e}`)),...`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``).map(e=>n(e,`CALL_PUSH_${e}`)),...[`ENTER`,`SHIFT`,`ESC`,`SPACE`,`LEFT`,`RIGHT`,`UP`,`DOWN`].map(e=>n(e,`CALL_PUSH_${e}`))].forEach(e=>{if(this._keyStore.checkHitKey(e.key)){let t=this.userDefinedFunctions&&this.userDefinedFunctions[e.func];t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)}})}this._keyStore.memorizeKeyStateOnControllableFrame(),this._mouseStore.memorizeMouseStateOnControllableFrame()}else if(this._player.isJumped())this._camera.isResetting()||this._player.processAfterJump();else if(this._player.isMoving())this._player.move(),this._objectMovingDataManager.update(),this._player.getPosition().isJustPosition()&&this._dispatchPlayerAndObjectsStopTimeRequests();else if(this._player.isWaitingMessage()){if(this._messageWindow.isVisible()||this._messageWindow.show(),this._messageWindow.isYesNoChoice())this._messageWindow.isSaveChoice()&&(this._messageWindow.saveUpdate(),this._messageWindow.isSaveClose()||(this._keyStore.checkHitKey(V.KEY_LEFT)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchButton(`BUTTON_LEFT`)?this._messageWindow.saveControll(E.LEFT):this._keyStore.checkHitKey(V.KEY_UP)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchButton(`BUTTON_UP`)?this._messageWindow.saveControll(E.UP):this._keyStore.checkHitKey(V.KEY_RIGHT)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchButton(`BUTTON_RIGHT`)?this._messageWindow.saveControll(E.RIGHT):(this._keyStore.checkHitKey(V.KEY_DOWN)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchButton(`BUTTON_DOWN`))&&this._messageWindow.saveControll(E.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===k.UNSELECTED&&(this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_Y)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)?this._yesNoJudge=k.YES:(this._keyStore.getKeyState(V.KEY_N)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_ESC)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`))&&(this._yesNoJudge=k.NO)),(this._yesNoJudge===k.YES||this._yesNoJudge===k.NO)&&(this.playDecisionSound(),this._yesNoDispCounter=R.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(V.KEY_LEFT)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchingButton(`BUTTON_LEFT`)?this._itemMenu.controll(E.LEFT):this._keyStore.checkHitKey(V.KEY_UP)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchingButton(`BUTTON_UP`)?this._itemMenu.controll(E.UP):this._keyStore.checkHitKey(V.KEY_RIGHT)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchingButton(`BUTTON_RIGHT`)?this._itemMenu.controll(E.RIGHT):(this._keyStore.checkHitKey(V.KEY_DOWN)||this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchingButton(`BUTTON_DOWN`))&&this._itemMenu.controll(E.DOWN),this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_Y)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`))this._setNextPage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(E.LEFT)||this._mouseStore.checkClickMouse(E.UP)||this._mouseStore.checkClickMouse(E.RIGHT)||this._mouseStore.checkClickMouse(E.DOWN)||this._keyStore.getKeyState(V.KEY_N)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_ESC)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`)){for(var t=0;t<F.length;t++){var n=U(F[t]);n.classList.contains(`onpress`)&&n.classList.remove(`onpress`)}this._itemMenu.ng(),this._setNextPage(),this.playDecisionSound(),this._messageWindow.setItemMenuChoice(!1)}}else{var r=this._keyStore.getKeyStateForMessageCheck(V.KEY_ENTER),i=this._keyStore.getKeyStateForMessageCheck(V.KEY_SPACE),a=this._keyStore.getKeyStateForMessageCheck(V.KEY_ESC);if(r===B.KEYDOWN||r===B.KEYPRESS_MESSAGECHANGE||i===B.KEYDOWN||i===B.KEYPRESS_MESSAGECHANGE||a===B.KEYDOWN||a===B.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===Te.MOUSEDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`)){for(var t=0;t<F.length;t++){var n=U(F[t]);n.classList.contains(`onpress`)&&n.classList.remove(`onpress`)}this._setNextPage()}}if(this._inlineUserVarViewer?.isVisible){let e=this._inlineUserVarViewer.kind,t=!1,n=e===`named`?this._userVar.named.size:R.USER_VAR_NUM;this._keyStore.getKeyState(V.KEY_DOWN)===B.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex[e]++,t=!0),this._keyStore.getKeyState(V.KEY_UP)===B.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex[e]--,t=!0),this._keyStore.getKeyState(V.KEY_RIGHT)===B.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex[e]+=R.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,t=!0),this._keyStore.getKeyState(V.KEY_LEFT)===B.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex[e]-=R.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,t=!0),this._keyStore.getKeyState(V.KEY_V)===B.KEYDOWN&&(this._inlineUserVarViewer.kind===`named`?this._inlineUserVarViewer.kind=`numbered`:this._inlineUserVarViewer.kind===`numbered`&&(this._inlineUserVarViewer.kind=`named`),t=!0),this._inlineUserVarViewer.topUserVarIndex[e]<0&&(this._inlineUserVarViewer.topUserVarIndex[e]+=n),this._inlineUserVarViewer.topUserVarIndex[e]>n&&(this._inlineUserVarViewer.topUserVarIndex[e]-=n),t&&(this._setNextPage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars())}}else if(this._player.isWaitingEstimateWindow())(this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyState(V.KEY_SPACE)===B.KEYDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`))&&this.hideBattleEstimateWindow();else if(this._player.isFighting())this._player.fight(),this._monsterWindow.update(this._monster);else if(this._player.isWaitingMoveMacro())this._player.isMoveObjectAutoExecTime()&&(this.moveObjects(!1),this._player.resetMoveObjectAutoExecTimer()),this._objectMovingDataManager.update();else if(this._player.isManualPause()){let e=this._player.getManualPauseInformation();if(!e.blockingCancelPauseByPlayer&&(this._keyStore.getKeyState(V.KEY_ENTER)===B.KEYDOWN||this._keyStore.getKeyStateForMessageCheck(V.KEY_SPACE)===B.KEYDOWN||this._keyStore.getKeyStateForMessageCheck(V.KEY_ESC)===B.KEYDOWN||this._mouseStore.getMouseState()===Te.MOUSEDOWN||this._gamePadStore.buttonTrigger(H.BUTTON_INDEX_A,H.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton(`BUTTON_ENTER`)||this._virtualPadStore.checkTouchButton(`BUTTON_ESC`))){let t=e?.functionNames.cancelPause??``;if(this._player.clearWaitingMessageOrManualPause(),t!==``)try{this.evalCalcWwaNodeGenerator.evalWwaNode({type:`CallDefinedFunction`,functionName:t})}catch(e){console.error(e)}}[{keyCode:V.KEY_UP,funcKey:`up`},{keyCode:V.KEY_DOWN,funcKey:`down`},{keyCode:V.KEY_RIGHT,funcKey:`right`},{keyCode:V.KEY_LEFT,funcKey:`left`}].forEach(({keyCode:t,funcKey:n})=>{let r=e?.functionNames[n]??``;if(this._keyStore.getKeyState(t)===B.KEYDOWN&&r!==``)try{this.evalCalcWwaNodeGenerator.evalWwaNode({type:`CallDefinedFunction`,functionName:r})}catch(e){console.error(e)}})}if(this.updatePicturesAnimation(),this._cgManager.picture.updateFrameTimerValue(),this._prevFrameEventExected=!1,this._player.getPosition().isJustPosition()&&this._camera.getPosition().isScreenTopPosition()){if(!this._shouldTreatWillMessageDisplay(this._pages)&&!this._player.isPausing()){this._player.isPartsAppearedTime()&&this._player.clearPartsAppearedFlag(),this._replaceRandomObjectsInScreen();var o=this.checkMap();o||this.checkObject(),this._prevFrameEventExected=o}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==k.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}this._passwordLoadExecInNextFrame&&=(this._stopUpdateByLoadFlag=!0,this._loadType=oe.PASSWORD,this._player.clearPasswordWindowWaiting(),!1),this._drawAll(),this._mainCallCounter++,this._mainCallCounter%=1e9,(!this._player.isWaitingMessageOrManualPause()||!this._isClassicModeEnable)&&(this._animationCounter=(this._animationCounter+1)%(R.ANIMATION_REP_HALF_FRAME*2),(this._animationCounter===0||this._animationCounter===R.ANIMATION_REP_HALF_FRAME+1)&&this.updateAllPicturesCache()),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessageOrManualPause()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&--this._statusPressCounter.energy===0&&U(`disp-energy`).classList.remove(`onpress`),this._statusPressCounter.strength>0&&--this._statusPressCounter.strength===0&&U(`disp-strength`).classList.remove(`onpress`),this._statusPressCounter.defence>0&&--this._statusPressCounter.defence===0&&U(`disp-defence`).classList.remove(`onpress`),this._statusPressCounter.gold>0&&--this._statusPressCounter.gold===0&&U(`disp-gold`).classList.remove(`onpress`)),this._player.isWaitingMoveMacro()&&(this._player.decrementMoveObjectAutoExecTimer(),this._player.isWaitingMoveMacro()||this._dispatchPlayerAndObjectsStopTimeRequests()),this._stopUpdateByLoadFlag&&this._fadeout(()=>{if(this._stopUpdateByLoadFlag=!1,this._loadType===oe.QUICK_LOAD){this._quickLoad(),this.wwaCustomEvent(`wwa_quickload`);let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_QUICKLOAD;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}else if(this._loadType===oe.RESTART_GAME){this.restartGame(),this.wwaCustomEvent(`wwa_restert`);let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_RESTART;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}else if(this._loadType===oe.PASSWORD){this._applyQuickLoad(this._passwordSaveExtractData),this._passwordSaveExtractData=void 0,this.wwaCustomEvent(`wwa_passwordload`);let e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_PASSWORDLOAD;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e)}}),this._varDump?.updateAllVariables({userVar:this._userVar.numbered,namedUserVar:this._userVar.named});let s=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_FRAME;s&&this.evalCalcWwaNodeGenerator.evalWwaNode(s)}vibration(e){this._gamePadStore.vibration(e)}_isMainAnimation(){return this._animationCounter>R.ANIMATION_REP_HALF_FRAME}_drawAll(){var e=this._camera.getPosition().getPartsCoord(),t=this._camera.getPosition().getOffsetCoord(),n=R.MAP_WINDOW_HEIGHT,r,i,a=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen){this._paintSkipByDoorOpen=!1;return}if(this._cgManager.clearCanvas(0,0,R.MAP_WINDOW_WIDTH,R.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,R.MAP_WINDOW_WIDTH,R.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(this._camera.getPreviousPosition()!==null)var o=this._camera.getPreviousPosition().getPartsCoord(),s=this._camera.getPreviousPosition().getOffsetCoord();n=this._camera.getTransitionStepNum()*R.CHIP_SIZE}var c=!1;if(n!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=n,c=!0),(e.x!==this._cgManager.cpPartsLog.x||e.y!==this._cgManager.cpPartsLog.y)&&(this._cgManager.cpPartsLog.x=e.x,this._cgManager.cpPartsLog.y=e.y,c=!0),c&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(o,s,n,!0),this._drawPlayer(o,s,n,!0),this._drawObjects(o,s,n,!0),this._camera.isFinalStep()))var l=255,u=setInterval(()=>{var e=U(`wwa-fader`);if(l-=R.FADEOUT_SPEED*3,l<=0){clearInterval(u),e.style.backgroundColor=`transparent`,e.removeAttribute(`style`),e.style.display=`none`;return}e.style.opacity=l/255+``},20);this._drawMap(e,t,n,!1,c),this._drawPlayer(e,t,n),this._drawObjects(e,t,n,!1,c),this._player.isFighting()&&!this._player.isBattleStartFrame()&&(r=this._player.isTurn()?this._monster.position.x:a.x,i=this._player.isTurn()?this._monster.position.y:a.y,this._cgManager.drawCanvas(this._battleEffectCoord.x,this._battleEffectCoord.y,R.CHIP_SIZE*(r-e.x)-t.x,R.CHIP_SIZE*(i-e.y)-t.y)),this._drawEffect(),this._drawPictures(),this._drawFaces(),this._drawFrame()}_drawMap(e,t,n,r=!1,i=!1){if(e!==void 0){var a=Math.max(0,e.x-1),o=Math.min(this._wwaData.mapWidth-1,e.x+R.H_PARTS_NUM_IN_WINDOW),s=Math.max(0,e.y-1),c=Math.min(this._wwaData.mapWidth-1,e.y+R.V_PARTS_NUM_IN_WINDOW),l=0;if(r)for(var u=a;u<=o;u++)for(var d=s;d<=c;d++){var f=this._wwaData.map[d][u],p=this._wwaData.mapAttribute[f][R.ATR_X]/R.CHIP_SIZE,m=this._wwaData.mapAttribute[f][R.ATR_Y]/R.CHIP_SIZE,h=R.CHIP_SIZE*(u-e.x)-t.x,g=R.CHIP_SIZE*(d-e.y)-t.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,m,h,g,n)}else{for(var u=a;u<=o;u++)for(var d=s;d<=c;d++){var f=this._wwaData.map[d][u];this._cgManager.mapCache[l]!==f&&(this._cgManager.mapCache[l]=f,i=!0),l++}if(i){this._cgManager.clearBackCanvasWithLowerYLimit(n);for(var u=a;u<=o;u++)for(var d=s;d<=c;d++){var f=this._wwaData.map[d][u],p=this._wwaData.mapAttribute[f][R.ATR_X]/R.CHIP_SIZE,m=this._wwaData.mapAttribute[f][R.ATR_Y]/R.CHIP_SIZE,h=R.CHIP_SIZE*(u-e.x)-t.x,g=R.CHIP_SIZE*(d-e.y)-t.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,m,h,g,n)}}this._cgManager.drawBackCanvas()}}}_drawPlayer(e,t,n,r=!1){if(e===void 0||this._wwaData.delPlayerFlag)return;let i=this._player.getPosition().getPartsCoord(),a=this._player.getPosition().getOffsetCoord(),o=[NaN,NaN,2,NaN,4,NaN,6,NaN,0,NaN][this._player.getDir()],s=(i.x-e.x)*R.CHIP_SIZE+a.x-t.x,c=(i.y-e.y)*R.CHIP_SIZE+a.y-t.y,l;l=this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessageOrManualPause()?this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]:this._player.isMovingImage()?this._wwaData.playerImgPosX+o+1:this._wwaData.playerImgPosX+o,r?this._cgManager.drawCanvasWithLowerYLimit(l,this._wwaData.playerImgPosY,s,c,n):this._cgManager.drawCanvasWithUpperYLimit(l,this._wwaData.playerImgPosY,s,c,n)}_drawObjects(e,t,n,r=!1,i=!1){if(e!==void 0){var a=Math.max(0,e.x-1),o=Math.min(this._wwaData.mapWidth-1,e.x+R.H_PARTS_NUM_IN_WINDOW),s=Math.max(0,e.y-1),c=Math.min(this._wwaData.mapWidth-1,e.y+R.V_PARTS_NUM_IN_WINDOW),l,u=0,d=this._isMainAnimation(),f,p,m,h,g,_,v,y,b,x,C,w,T,E=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(r)for(b=a;b<=o;b++)for(x=s;x<=c;x++)E&&new S(b,x).equals(this._monster.position)||(C=this._wwaData.mapObject[x][b],l=new S(0,0),this._wwaData.objectAttribute[C][R.ATR_MOVE]!==se.STATIC&&(y=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new S(b,x)),y!==null&&(l=y)),h=R.CHIP_SIZE*(b-e.x)+l.x-t.x,g=R.CHIP_SIZE*(x-e.y)+l.y-t.y,f=d||this._wwaData.objectAttribute[C][R.ATR_X2]===0&&this._wwaData.objectAttribute[C][R.ATR_Y2]===0,p=this._wwaData.objectAttribute[C][f?R.ATR_X:R.ATR_X2]/R.CHIP_SIZE,m=this._wwaData.objectAttribute[C][f?R.ATR_Y:R.ATR_Y2]/R.CHIP_SIZE,_=this._wwaData.objectAttribute[C][R.ATR_TYPE],v=this._wwaData.objectAttribute[C][R.ATR_NUMBER],C!==0&&!this._checkNoDrawObject(new S(b,x),_,v)&&this._cgManager.copyObjectCanvasWithLowerYLimit(+!!d,p,m,h,g,n));else{var D=[],O=[],k,A,te;for(b=a;b<=o;b++)for(x=s;x<=c;x++)w=C=this._wwaData.mapObject[x][b],_=this._wwaData.objectAttribute[C][R.ATR_TYPE],v=this._wwaData.objectAttribute[C][R.ATR_NUMBER],this._checkNoDrawObject(new S(b,x),_,v)&&(w=0),A=this._wwaData.objectAttribute[C][R.ATR_MOVE]===se.STATIC,w!==0&&(te=!!(E&&new S(b,x).equals(this._monster.position)),A?O.push(new ee(C,b,x,A,te)):(D.push(new ee(C,b,x,A,te)),w=0),te&&(w=0)),this._cgManager.mapObjectCache[u]!==w&&(this._cgManager.mapObjectCache[u]=w,i=!0),u++;i&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(n),Array.prototype.push.apply(D,O));var j,M=D.length;for(j=0;j<M;j++)if(k=D[j],b=k.x,x=k.y,C=k.partsIDObj,A=k.isStatic,te=k.isFighting,h=R.CHIP_SIZE*(b-e.x)-t.x,g=R.CHIP_SIZE*(x-e.y)-t.y,A){if(te)continue;for(T=0;T<2;T++)f=!!T||this._wwaData.objectAttribute[C][R.ATR_X2]===0&&this._wwaData.objectAttribute[C][R.ATR_Y2]===0,p=this._wwaData.objectAttribute[C][f?R.ATR_X:R.ATR_X2]/R.CHIP_SIZE,m=this._wwaData.objectAttribute[C][f?R.ATR_Y:R.ATR_Y2]/R.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(T,p,m,h,g,n)}else y=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new S(b,x)),y!==null&&(h+=y.x,g+=y.y),f=d||this._wwaData.objectAttribute[C][R.ATR_X2]===0&&this._wwaData.objectAttribute[C][R.ATR_Y2]===0,p=this._wwaData.objectAttribute[C][f?R.ATR_X:R.ATR_X2]/R.CHIP_SIZE,m=this._wwaData.objectAttribute[C][f?R.ATR_Y:R.ATR_Y2]/R.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(p,m,h,g,n);this._cgManager.drawObjectCanvas(+!!d)}}}_drawEffect(){if(!(this._wwaData.effectCoords.length===0||this._wwaData.effectWaits===0)){var e=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(e)}}_drawFaces(){for(var e=0;e<this._faces.length;e++)this._cgManager.drawCanvasWithSize(this._faces[e].srcPos.x,this._faces[e].srcPos.y,this._faces[e].srcSize.x,this._faces[e].srcSize.y,this._faces[e].destPos.x,this._faces[e].destPos.y)}_drawFrame(){this._cgManager.drawFrame()}_drawPictures(){this._cgManager.drawPictures()}_checkNoDrawObject(e,t,n){var r=this._player.getPosition(),i=r.getPartsCoord();return!r.isJustPosition()||i.x!==e.x||i.y!==e.y||this._wwaData.objectNoCollapseDefaultFlag?!1:t===R.OBJECT_DOOR&&n===0?!0:t===R.OBJECT_STATUS||t===R.OBJECT_MESSAGE||t===R.OBJECT_ITEM||t===R.OBJECT_SELL||t===R.OBJECT_BUY||t===R.OBJECT_SELL||t===R.OBJECT_LOCALGATE}getMapWidth(){if(this._wwaData===void 0)throw Error(`マップデータがロードされていません`);return this._wwaData.mapWidth}getMapIdByPosition(e){var t=e.getPartsCoord();return this._wwaData.map[t.y][t.x]}getObjectIdByPosition(e){var t=e.getPartsCoord();return this._wwaData.mapObject[t.y][t.x]}getMapTypeByPosition(e){var t=e.getPartsCoord(),n=this._wwaData.map[t.y][t.x];return this._wwaData.mapAttribute[n][R.ATR_TYPE]}getObjectTypeByPosition(e){var t=e.getPartsCoord(),n=this._wwaData.mapObject[t.y][t.x];return this._wwaData.objectAttribute[n][R.ATR_TYPE]}getMapAttributeByPosition(e,t){var n=e.getPartsCoord(),r=this._wwaData.map[n.y][n.x];return this._wwaData.mapAttribute[r][t]}isCurrentPosMapPartsIncludingMessage(e){return this.getMapAttributeByPosition(e,R.ATR_STRING)!==0}getObjectAttributeByPosition(e,t){var n=e.getPartsCoord(),r=this._wwaData.mapObject[n.y][n.x];return this._wwaData.objectAttribute[r][t]}getMapAttributeById(e,t){return this._wwaData.mapAttribute[e][t]}getObjectAttributeById(e,t){return this._wwaData.objectAttribute[e][t]}getObjectCropXById(e){return this._wwaData.objectAttribute[e][R.ATR_X]}getObjectCropYById(e){return this._wwaData.objectAttribute[e][R.ATR_Y]}getMessageById(e){return this._wwaData.message[e]}getSystemMessageById(e){return this._wwaData.systemMessage[e]}getMapInfo(e){return this._wwaData.mapAttribute[e]}checkMap(e){var t=this._player.getPosition().getPartsCoord();e??=t;var n=this._wwaData.map[e.y][e.x],r=this.getMapInfo(n)[R.ATR_TYPE],i=e.x===t.x&&e.y===t.y,a=!1;return i&&this._player.getLastExecPartsIDOnSamePosition(j.MAP)===n?!1:(r===R.MAP_STREET?a=this._execMapStreetEvent(e,n,r):r===R.MAP_WALL?a=this._execMapWallEvent(e,n,r):r===R.MAP_LOCALGATE?a=this._execMapLocalGateEvent(e,n,r):r===R.MAP_URLGATE&&(a=this._execMapUrlGateEvent(e,n,r)),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(j.MAP,n),a)}getObjectInfo(e){return this._wwaData.objectAttribute[e]}checkObject(e){var t=this._player.getPosition().getPartsCoord();e??=t;var n=this._wwaData.mapObject[e.y][e.x],r=this.getObjectInfo(n)[R.ATR_TYPE],i=e.x===t.x&&e.y===t.y;i&&this._player.getLastExecPartsIDOnSamePosition(j.OBJECT)===n||(r===R.OBJECT_NORMAL?this._execObjectNormalEvent(e,n,r):r===R.OBJECT_MESSAGE?this._execObjectMessageEvent(e,n,r):r===R.OBJECT_MONSTER?this._execObjectMonsterEvent(e,n,r):r===R.OBJECT_ITEM?this._execObjectItemEvent(e,n,r):r===R.OBJECT_DOOR?this._execObjectDoorEvent(e,n,r):r===R.OBJECT_STATUS?this._execObjectStatusEvent(e,n,r):r===R.OBJECT_BUY?this._execObjectBuyEvent(e,n,r):r===R.OBJECT_SELL?this._execObjectSellEvent(e,n,r):r===R.OBJECT_URLGATE?this._execObjectUrlGateEvent(e,n,r):r===R.OBJECT_SCORE?this._execObjectScoreEvent(e,n,r):r===R.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(e,n,r):r===R.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(e,n,r),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(j.OBJECT,n))}_execMapStreetEvent(e,t,n){var r=this._wwaData.mapAttribute[t][R.ATR_ITEM];if(r!==0&&!this._player.hasItem(r))return!1;this.reserveAppearPartsInNextFrame(e,A.MAP,t);let i=this._wwaData.mapAttribute[t][R.ATR_STRING],a=this._wwaData.message[i],o=this._wwaData.mapAttribute[t][R.ATR_NUMBER];return this._waitFrame+=o*R.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.registerPageByMessage(a,{triggerParts:{id:t,type:j.MAP,position:e.clone()}}),this.playSound(this._wwaData.mapAttribute[t][R.ATR_SOUND]),i!==0&&this._shouldTreatWillMessageDisplay(this._pages)||o!==0}_shouldTreatWillMessageDisplay(e){return e.reduce((e,t)=>e||!hr(t.firstNode),!1)}_execMapWallEvent(e,t,n){var r=this.getObjectIdByPosition(e.convertIntoPosition(this)),i=this.getObjectAttributeById(r,R.ATR_TYPE);if(r===0||i===R.OBJECT_NORMAL||i===R.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(r,R.ATR_ITEM))||this.getObjectAttributeById(i,R.ATR_MODE)===R.PASSABLE_OBJECT)){this.reserveAppearPartsInNextFrame(e,A.MAP,t);var a=this._wwaData.mapAttribute[t][R.ATR_STRING],o=this._wwaData.message[a];return this.registerPageByMessage(o,{triggerParts:{id:t,type:j.MAP,position:e.clone()}}),this.playSound(this._wwaData.mapAttribute[t][R.ATR_SOUND]),!1}return!1}_execMapLocalGateEvent(e,t,n){var r=this._player.getPosition().getPartsCoord(),i=this._wwaData.mapAttribute[t][R.ATR_JUMP_X],a=this._wwaData.mapAttribute[t][R.ATR_JUMP_Y];return i>R.RELATIVE_COORD_LOWER&&(i=e.x+i-R.RELATIVE_COORD_BIAS),a>R.RELATIVE_COORD_LOWER&&(a=e.y+a-R.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(e,A.MAP,t),0<=i&&0<=a&&i<this._wwaData.mapWidth&&a<this._wwaData.mapWidth&&(i!==r.x||a!==r.y)?(this.reserveJumpInNextFrame(new C(this,i,a,0,0)),this.playSound(this._wwaData.mapAttribute[t][R.ATR_SOUND]),!0):!1}_execMapUrlGateEvent(e,t,n){var r=this._wwaData.mapAttribute[t][R.ATR_STRING];if(!this._isURLGateEnable)return!0;let i=this.resolveSystemMessage(g.CONFIRM_ENTER_URL_GATE);if(i===`BLANK`){location.href=Ve(this._wwaData.message[r].split(/\s/g)[0]);return}return this.registerSystemMessagePage(i,!0),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[r].split(/\s/g)[0],!0}_execObjectNormalEvent(e,t,n){}_execObjectMessageEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r],a=this._player.getPosition().getPartsCoord(),o=this._wwaData.objectAttribute[t][R.ATR_SOUND];e.x===a.x&&e.y===a.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e),this.registerPageByMessage(i,{triggerParts:{id:t,type:j.OBJECT,position:e}}),this._waitFrame+=this._wwaData.objectAttribute[t][R.ATR_NUMBER]*R.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.reserveAppearPartsInNextFrame(e,A.OBJECT,t),this.playSound(o)}_execObjectStatusEvent(e,t,n){var r=new x(this._wwaData.objectAttribute[t][R.ATR_ENERGY],this._wwaData.objectAttribute[t][R.ATR_STRENGTH],this._wwaData.objectAttribute[t][R.ATR_DEFENCE],this._wwaData.objectAttribute[t][R.ATR_GOLD]),i=this._wwaData.objectAttribute[t][R.ATR_STRING],a=this._wwaData.message[i],o=this._player.getStatusWithoutEquipments();if(r.strength>R.STATUS_MINUS_BORDER&&o.strength<r.strength-R.STATUS_MINUS_BORDER||r.defence>R.STATUS_MINUS_BORDER&&o.defence<r.defence-R.STATUS_MINUS_BORDER||r.gold>R.STATUS_MINUS_BORDER&&o.gold<r.gold-R.STATUS_MINUS_BORDER){this.setPartsOnPosition(j.OBJECT,0,e),this._keyStore.allClear(),this._mouseStore.clear();return}if(r.energy=r.energy>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-r.energy:r.energy,r.strength=r.strength>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-r.strength:r.strength,r.defence=r.defence>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-r.defence:r.defence,r.gold=r.gold>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-r.gold:r.gold,this._player.addStatusAll(r),this.setStatusChangedEffect(r),this._player.isDead()&&this._wwaData.objectAttribute[t][R.ATR_ENERGY]!==0&&this.shouldApplyGameOver({isAssignment:!1})){this.gameover();return}this.registerPageByMessage(a,{triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this.setPartsOnPosition(j.OBJECT,0,e),this.reserveAppearPartsInNextFrame(e,A.OBJECT,t),this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectMonsterEvent(e,t,n){this._monster=this._createMonster(t,e,()=>{this._monster=void 0,this._monsterWindow.hide(),this._dispatchWindowClosedTimeRequests()}),this._player.startBattleWith(this._monster)}_execObjectBuyEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r],a=this._player.getPosition().getPartsCoord();e.x===a.x&&e.y===a.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e),this.registerPageByMessage(i,{showChoice:!0,triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectSellEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r],a=this._player.getPosition().getPartsCoord();e.x===a.x&&e.y===a.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e),this.registerPageByMessage(i,{showChoice:!0,triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectItemEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r];try{var a=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),o=(e.x-a.x)*R.CHIP_SIZE,s=(e.y-a.y)*R.CHIP_SIZE;this._player.addItem(t,this._wwaData.objectAttribute[t][R.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new S(o,s),itemBoxBackgroundImageCoord:new S(this._wwaData.imgItemboxX*R.CHIP_SIZE,this._wwaData.imgItemboxY*R.CHIP_SIZE)}:void 0),this.setPartsOnPosition(j.OBJECT,0,e),this._wwaData.objectAttribute[t][R.ATR_MODE]!==0||(this.registerPageByMessage(i,{triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this.reserveAppearPartsInNextFrame(e,A.OBJECT,t))}catch{this.registerSystemMessagePageByKey(g.ITEM_BOX_FULL)}this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectDoorEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_ITEM],i=this._wwaData.objectAttribute[t][R.ATR_STRING],a=this._wwaData.message[i];this._player.hasItem(r)&&(this._wwaData.objectAttribute[t][R.ATR_MODE]===0&&this._player.removeItemByPartsID(r),this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND]),this.registerPageByMessage(a,{triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this.setPartsOnPosition(j.OBJECT,0,e),this.reserveAppearPartsInNextFrame(e,A.OBJECT,t),this._paintSkipByDoorOpen=!0)}_execObjectYesNoChoiceEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING],i=this._wwaData.message[r],a=this._player.getPosition().getPartsCoord();e.x===a.x&&e.y===a.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e),this.registerPageByMessage(i,{showChoice:!0,triggerParts:{id:t,type:j.OBJECT,position:e.clone()}}),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}_execObjectLocalGateEvent(e,t,n){var r=this._player.getPosition().getPartsCoord();e.x===r.x&&e.y===r.y&&!this._wwaData.objectNoCollapseDefaultFlag&&this.setPartsOnPosition(j.OBJECT,0,e);var i=this._wwaData.objectAttribute[t][R.ATR_JUMP_X],a=this._wwaData.objectAttribute[t][R.ATR_JUMP_Y];i>R.RELATIVE_COORD_LOWER&&(i=r.x+i-R.RELATIVE_COORD_BIAS),a>R.RELATIVE_COORD_LOWER&&(a=r.y+a-R.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(e,A.OBJECT,t),0<=i&&0<=a&&i<this._wwaData.mapWidth&&a<this._wwaData.mapWidth&&(i!==r.x||a!==r.y)&&(this.reserveJumpInNextFrame(new C(this,i,a,0,0)),this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND]))}_execObjectUrlGateEvent(e,t,n){var r=this._wwaData.objectAttribute[t][R.ATR_STRING];if(!this._isURLGateEnable)return;let i=this.resolveSystemMessage(g.CONFIRM_ENTER_URL_GATE);if(i===`BLANK`){location.href=Ve(this._wwaData.message[r].split(/\s/g)[0]);return}this.registerSystemMessagePage(i,!0),this._yesNoChoicePartsCoord=e,this._yesNoChoicePartsID=t,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[r].split(/\s/g)[0]}_execObjectScoreEvent(e,t,n){let r=this._wwaData.objectAttribute[t][R.ATR_STRING];this.registerPageByMessage(this._wwaData.message[r],{triggerParts:{id:t,type:j.OBJECT,position:e},scoreOption:{rates:{energy:this._wwaData.objectAttribute[t][R.ATR_ENERGY],strength:this._wwaData.objectAttribute[t][R.ATR_STRENGTH],defence:this._wwaData.objectAttribute[t][R.ATR_DEFENCE],gold:this._wwaData.objectAttribute[t][R.ATR_GOLD]}}}),this.playSound(this._wwaData.objectAttribute[t][R.ATR_SOUND])}updateScore(e){let t=e||this._lastScoreOptions;if(!t)return;let n=this._player.getStatus().calculateScore(t);this._scoreWindow.update(n)}_execChoiceWindowObjectSellEvent(){if(!this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_GOLD]))return this.registerSystemMessagePageByKey(g.NO_MONEY),{};if(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ITEM]!==0){let e=this._yesNoChoicePartsCoord,t=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),n=(e.x-t.x)*R.CHIP_SIZE,r=(e.y-t.y)*R.CHIP_SIZE,i=this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ITEM],a=this._wwaData.objectAttribute[i][R.ATR_NUMBER];try{this._player.addItem(i,a,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new S(n,r),itemBoxBackgroundImageCoord:new S(this._wwaData.imgItemboxX*R.CHIP_SIZE,this._wwaData.imgItemboxY*R.CHIP_SIZE)}:void 0)}catch{return this.registerSystemMessagePageByKey(g.ITEM_BOX_FULL),{}}}let e=new x(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_GOLD]);return e.energy=e.energy>R.STATUS_MINUS_BORDER?R.STATUS_MINUS_BORDER-e.energy:e.energy,this.setStatusChangedEffect(e),this._player.addStatusAll(e),this._player.isDead()&&this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ENERGY]!==0&&this.shouldApplyGameOver({isAssignment:!1})?(this.gameover(),{isGameOver:!0}):(this.appearParts({pos:this._yesNoChoicePartsCoord,triggerType:A.OBJECT,triggerPartsId:this._yesNoChoicePartsID}),{})}_execChoiceWindowRunningEvent(){var e,t;if(--this._yesNoDispCounter===0){if(this._yesNoJudge===k.YES){if(this._yesNoChoiceCallInfo===N.CALL_BY_MAP_PARTS)e=this._wwaData.mapAttribute[this._yesNoChoicePartsID][R.ATR_TYPE],e===R.MAP_URLGATE&&(location.href=Ve(this._yesNoURL));else if(this._yesNoChoiceCallInfo===N.CALL_BY_OBJECT_PARTS)if(e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_TYPE],e===R.OBJECT_BUY)this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ITEM])?(this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_ITEM]),t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_GOLD],this._player.earnGold(t),this.setStatusChangedEffect(new x(0,0,0,t)),this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)):this.registerSystemMessagePageByKey(g.NO_ITEM);else if(e===R.OBJECT_SELL){let{isGameOver:e}=this._execChoiceWindowObjectSellEvent();if(e)return}else e===R.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.CHOICE_YES,this._yesNoChoicePartsID):e===R.OBJECT_URLGATE&&(location.href=Ve(this._yesNoURL));else this._yesNoChoiceCallInfo===N.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===N.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),U(F[P.QUICK_LOAD]).classList.remove(`onpress`),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=oe.QUICK_LOAD)):this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),U(F[P.QUICK_SAVE]).classList.remove(`onpress`),this._quickSave(N.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===N.CALL_BY_RESTART_GAME?(U(F[P.RESTART_GAME]).classList.remove(`onpress`),this._stopUpdateByLoadFlag=!0,this._loadType=oe.RESTART_GAME):this._yesNoChoiceCallInfo===N.CALL_BY_END_GAME?(window.history.back(-1),U(F[P.GOTO_WWA]).classList.remove(`onpress`)):this._yesNoChoiceCallInfo===N.CALL_BY_GOTO_WWA?(location.href=Ve(R.WWA_HOME),U(F[P.GOTO_WWA]).classList.remove(`onpress`)):this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_LOAD?(U(F[P.QUICK_LOAD]).classList.remove(`onpress`),this._player.setPasswordWindowWating(),this._passwordWindow.show(wr.LOAD)):this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_SAVE?(U(F[P.QUICK_SAVE]).classList.remove(`onpress`),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(N.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(wr.SAVE)):this._yesNoChoiceCallInfo===N.CALL_BY_SUSPEND&&(U(F[P.QUICK_SAVE]).classList.remove(`onpress`),this._quickSave(N.CALL_BY_SUSPEND));this._yesNoJudge=k.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===k.NO){if(this._yesNoChoiceCallInfo===N.CALL_BY_MAP_PARTS)e=this._wwaData.mapAttribute[this._yesNoChoicePartsID][R.ATR_TYPE],R.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===N.CALL_BY_OBJECT_PARTS)e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][R.ATR_TYPE],e===R.OBJECT_BUY||e===R.OBJECT_SELL||(e===R.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.CHOICE_NO,this._yesNoChoicePartsID):R.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===N.CALL_BY_ITEM_USE)U(`item`+(this._yesNoUseItemPos-1)).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===N.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case N.NONE:U(F[P.QUICK_LOAD]).classList.remove(`onpress`);break;case N.CALL_BY_PASSWORD_LOAD:this._yesNoJudge=k.UNSELECTED,this.onpasswordloadcalled();return;case N.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var n=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=k.UNSELECTED,n){case N.CALL_BY_PASSWORD_LOAD:this.registerSystemMessagePage(`読み込むオートセーブを選んでください。
122
122
  →Noでデータ復帰用パスワードの
123
-  入力選択ができます。`,!0);break;case N.NONE:this.registerSystemMessagePage(`読み込むオートセーブを選んでください。`,!0);break}return}else if(this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_SAVE)if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend){this._yesNoJudge=k.UNSELECTED,this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled();return}else U(F[P.QUICK_SAVE]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_RESTART_GAME)U(F[P.RESTART_GAME]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_END_GAME)U(F[P.GOTO_WWA]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_GOTO_WWA)U(F[P.GOTO_WWA]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_LOAD)U(F[P.QUICK_LOAD]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_SAVE)U(F[P.QUICK_SAVE]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_SUSPEND)if(this._usePassword){this._yesNoJudge=k.UNSELECTED,this.onpasswordsavecalled();return}else U(F[P.QUICK_SAVE]).classList.remove(`onpress`);this._yesNoJudge=k.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)}}}_dispatchWindowClosedTimeRequests(){if(this._windowCloseWaitingJumpGateRequest&&this.forcedJumpGate(this._windowCloseWaitingJumpGateRequest.x,this._windowCloseWaitingJumpGateRequest.y),this._windowCloseWaitingMessageDisplayRequests.length>0){let e=this._windowCloseWaitingMessageDisplayRequests.shift();return this.registerPageByMessage(e.message,{additionalItems:e.additionalItems}),{newPageGenerated:!0}}return{newPageGenerated:!1}}_dispatchPlayerAndObjectsStopTimeRequests(){this._playerAndObjectsStopWaitingGameSpeedChangeRequest&&=(this.setPlayerSpeedIndex(this._playerAndObjectsStopWaitingGameSpeedChangeRequest.speedIndex),void 0),this._playerAndObjectsStopWaitingMessageDisplayRequests.length>0&&(this.registerPageByMessage(this._playerAndObjectsStopWaitingMessageDisplayRequests.map(e=>e.message).join(`<p>`),{additionalItems:this._playerAndObjectsStopWaitingMessageDisplayRequests.map(e=>e.additionalItems).flat()}),this._playerAndObjectsStopWaitingMessageDisplayRequests=[])}_clearAllRequests(){this._playerAndObjectsStopWaitingMessageDisplayRequests=[],this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0,this._windowCloseWaitingJumpGateRequest=void 0,this._windowCloseWaitingMessageDisplayRequests=[]}reserveMessageDisplayWhenShouldOpen(e){this._player.isWaitingMessageOrManualPause()||this._player.isFighting()||this._player.isWaitingPasswordWindow()||this._player.isWaitingEstimateWindow()?this._windowCloseWaitingMessageDisplayRequests.push(e):this._player.isMoving()||this._player.isWaitingMoveMacro()?this._playerAndObjectsStopWaitingMessageDisplayRequests.push(e):this.registerPageByMessage(e.message,{additionalItems:e.additionalItems})}handleMsgFunction(e){this._pageExecuting?this._windowCloseWaitingMessageDisplayRequests.push(e):this.reserveMessageDisplayWhenShouldOpen(e)}registerSystemMessagePage(e,t=!1){this.registerPageByMessage(e,{showChoice:t,isSystemMessage:!0})}registerSystemMessagePageByKey(e){let t=this.resolveSystemMessage(e);t!==`BLANK`&&this.registerPageByMessage(t,{isSystemMessage:!0})}_createSimpleMessage(e,t){return new nr(e,()=>this.generateTokenValues(t),(e,t)=>this._execEvalString(e,t))}registerPageByMessage(e,{showChoice:t=!1,isSystemMessage:n=!1,triggerParts:r={id:0,type:j.OBJECT,position:new S(0,0)},scoreOption:i=void 0,additionalItems:a=[]}={}){let o=pr(e,{triggerParts:r,isSystemMessage:n,showChoice:t,scoreOption:i,additionalItems:a},e=>$n(this,r,e),(e,t)=>this._execEvalString(e,t),e=>this.generateTokenValues(e));this._pages=this._pages.concat(o),this._shouldSetNextPage=!0}appearParts({pos:e,triggerType:t,triggerPartsId:n}){var r,i=t===A.CHOICE_NO?R.APPERANCE_PARTS_MIN_INDEX_NO:R.APPERANCE_PARTS_MIN_INDEX,a=t===A.CHOICE_YES?R.APPERANCE_PARTS_MAX_INDEX_YES:R.APPERANCE_PARTS_MAX_INDEX,o,s,c,l,u;for(t===A.MAP?(n=n===0?this._wwaData.map[e.y][e.x]:n,r=j.MAP):(n=n===0?this._wwaData.mapObject[e.y][e.x]:n,r=j.OBJECT),u=i;u<=a;u++){var d=R.ATR_APPERANCE_BASE+u*R.REL_ATR_APPERANCE_UNIT_LENGTH,f=d+R.REL_ATR_APPERANCE_ID,p=d+R.REL_ATR_APPERANCE_X,m=d+R.REL_ATR_APPERANCE_Y,h=d+R.REL_ATR_APPERANCE_TYPE;if(o=r===j.MAP?this._wwaData.mapAttribute[n][f]:this._wwaData.objectAttribute[n][f],s=r===j.MAP?this._wwaData.mapAttribute[n][h]:this._wwaData.objectAttribute[n][h],c=r===j.MAP?this._wwaData.mapAttribute[n][p]:this._wwaData.objectAttribute[n][p],l=r===j.MAP?this._wwaData.mapAttribute[n][m]:this._wwaData.objectAttribute[n][m],c===R.PLAYER_COORD?(c=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):c>R.RELATIVE_COORD_LOWER&&(c=e.x+c-R.RELATIVE_COORD_BIAS),l===R.PLAYER_COORD?(l=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):l>R.RELATIVE_COORD_LOWER&&(l=e.y+l-R.RELATIVE_COORD_BIAS),!(c===0&&l===0))try{if(new C(this,c,l,0,0),s===j.MAP){if(o>=this._wwaData.mapPartsMax)throw Error(`背景パーツの範囲外IDが指定されました`);var g=new S(c,l);this.setPartsOnPosition(j.MAP,o,g)}else{if(o>=this._wwaData.objPartsMax)throw Error(`物体パーツの範囲外IDが指定されました`);var g=new S(c,l);this.setPartsOnPosition(j.OBJECT,o,g),this._replaceRandomObject(new S(c,l)),c===this._player.getPosition().getPartsCoord().x&&l===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch{}}}reserveAppearPartsInNextFrame(e,t,n=0){this._reservedPartsAppearances.push({pos:e,triggerType:t,triggerPartsId:n})}reserveJumpInNextFrame(e){this._reservedJumpDestination=e}appearPartsByDirection(e,t,n){var r=this._player.getPosition().getPartsCoord(),i=this._player.getDir(),a=D[i],o=O[i];this.appearPartsEval(r,(a>=0?`+`:`-`)+Math.abs(a)*e,(o>=0?`+`:`-`)+Math.abs(o)*e,t,n)}appearPartsEval(e,t,n,r,i){var a,o,s=this._player.getPosition().getPartsCoord();if(t===`P`||t===`p`)a=s.x;else if(t[0]===`+`)a=e.x+parseInt(t.substr(1));else if(t[0]===`-`)a=e.x-parseInt(t.substr(1));else if(a=parseInt(t),isNaN(a))throw Error(`座標として解釈できない文字が含まれています。`);if(n===`P`||n===`p`)o=s.y;else if(n[0]===`+`)o=e.y+parseInt(n.substr(1));else if(n[0]===`-`)o=e.y-parseInt(n.substr(1));else if(o=parseInt(n),isNaN(o))throw Error(`座標として解釈できない文字が含まれています。`);try{if(new C(this,a,o,0,0),i===j.MAP){if(r>=this._wwaData.mapPartsMax)throw Error(`背景パーツの範囲外IDが指定されました`);var c=new S(a,o);this.setPartsOnPosition(j.MAP,r,c)}else{if(r>=this._wwaData.objPartsMax)throw Error(`物体パーツの範囲外IDが指定されました`);var c=new S(a,o);this.setPartsOnPosition(j.OBJECT,r,c),this._replaceRandomObject(new S(a,o)),a===this._player.getPosition().getPartsCoord().x&&o===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch{}}getPartsID(e,t){if(e.x<0||e.y<0)throw Error(`想定外の座標が指定されました`);return t===j.MAP?this._wwaData.map[e.y][e.x]:this._wwaData.mapObject[e.y][e.x]}_replaceRandomObject(e){var t=this._wwaData.mapObject[e.y][e.x],n=this._wwaData.objectAttribute[t][R.ATR_TYPE],r,i;if(n===R.OBJECT_RANDOM){for(var a=0;a<R.RANDOM_ITERATION_MAX;a++){if(i=Math.floor(Math.random()*10),r=this._wwaData.objectAttribute[t][R.ATR_RANDOM_BASE+i],r>=this._wwaData.objPartsMax){r=0;break}if(this._wwaData.objectAttribute[r][R.ATR_TYPE]!==R.OBJECT_RANDOM)break;t=r}this.setPartsOnPosition(j.OBJECT,r,e)}}_replaceRandomObjectsInScreen(){for(var e=this._camera.getPosition().getPartsCoord(),t=Math.max(0,e.x-1),n=Math.min(this._wwaData.mapWidth-1,e.x+R.H_PARTS_NUM_IN_WINDOW),r=Math.max(0,e.y-1),i=Math.min(this._wwaData.mapWidth-1,e.y+R.V_PARTS_NUM_IN_WINDOW),a=t;a<=n;a++)for(var o=r;o<=i;o++)this._replaceRandomObject(new S(a,o))}_replaceAllRandomObjects(){for(var e=0;e<this._wwaData.mapWidth;e++)for(var t=0;t<this._wwaData.mapWidth;t++)this._replaceRandomObject(new S(e,t))}gameover(){var e=this._wwaData.gameoverX,t=this._wwaData.gameoverY;this._yesNoJudge=k.UNSELECTED,this._pages=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._player.clearWaitingMessageOrManualPause(),this._messageWindow.clear(),this._messageWindow.setYesNoChoice(!1),this._waitFrame=0,this._temporaryInputDisable=!0,this._shouldSetNextPage=!1,this._reservedPartsAppearances=[],this._reservedJumpDestination=void 0,this._clearAllRequests(),this._player.jumpTo(new C(this,e,t,0,0));let n=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GAMEOVER;n&&this.evalCalcWwaNodeGenerator.evalWwaNode(n)}setYesNoInput(e){this._yesNoJudgeInNextFrame=e}getYesNoState(){return this._yesNoJudgeInNextFrame===void 0?this._yesNoJudge:this._yesNoJudgeInNextFrame}setStatusChangedEffect(e){this._wwaData.isItemEffectEnabled&&(e.strength!==0&&(U(`disp-strength`).classList.add(`onpress`),this._statusPressCounter.strength=R.STATUS_CHANGED_EFFECT_FRAME_NUM),e.defence!==0&&(U(`disp-defence`).classList.add(`onpress`),this._statusPressCounter.defence=R.STATUS_CHANGED_EFFECT_FRAME_NUM),e instanceof x&&(e.energy!==0&&(U(`disp-energy`).classList.add(`onpress`),this._statusPressCounter.energy=R.STATUS_CHANGED_EFFECT_FRAME_NUM),e.gold!==0&&(U(`disp-gold`).classList.add(`onpress`),this._statusPressCounter.gold=R.STATUS_CHANGED_EFFECT_FRAME_NUM)))}setPartsOnPosition(e,t,n){var r,i,a=n.y<<Ce.BITSHIFT|n.x;e===j.MAP?(r=this._wwaData.map[n.y][n.x],t=this.loadMapPartsID(t),r=this.loadMapPartsID(r),this._wwaData.map[n.y][n.x]=t,i=this._mapIDTable[r].indexOf(a),i!==-1&&this._mapIDTable[r].splice(i,1),i=this._mapIDTable[t].indexOf(a),i===-1&&this._mapIDTable[t].push(a)):(r=this._wwaData.mapObject[n.y][n.x],t=this.loadMapPartsObjectID(t),r=this.loadMapPartsObjectID(r),this._wwaData.mapObject[n.y][n.x]=t,i=this._mapObjectIDTable[r].indexOf(a),i!==-1&&this._mapObjectIDTable[r].splice(i,1),i=this._mapObjectIDTable[t].indexOf(a),i===-1&&this._mapObjectIDTable[t].push(a))}_countSamePartsLength(e,t){var n;for(n=t+1;n<e.length&&e[n]===e[n-1];n++);return n-t}_compressMap(e){for(var t=[],n=0;n<e.length;n++){t[n]=[];for(var r=0;r<e[n].length;){var i=this._countSamePartsLength(e[n],r);t[n].push([e[n][r],i]),r+=i}}return t}_decompressMap(e){for(var t=[],n=0;n<e.length;n++){t[n]=[];for(var r=0;r<e[n].length;r++)for(var i=e[n][r][1],a=0;a<i;a++)t[n].push(e[n][r][0])}return t}_generateMapDataHash(e){var t=`A`,n=0,r=0,i=0;for(i=0;i<e.map.length;i++){for(r=0;r<e.map[i].length;)n=this._countSamePartsLength(e.map[i],r),t+=e.map[i][r]+`|`+n+`/`,r+=n;for(r=0;r<e.mapObject[i].length;)n=this._countSamePartsLength(e.mapObject[i],r),t+=e.mapObject[i][r]+`|`+n+`/`,r+=n}for(var a=0;a<e.mapAttribute.length;a++)for(var o=0;o<e.mapAttribute[a].length;o++)t+=e.mapAttribute[a][o]+`/`;for(var s=0;s<e.objectAttribute.length;s++)for(var c=0;c<e.objectAttribute[s].length;c++)t+=e.objectAttribute[s][c]+`/`;return t+=`Z`,_i(t)}_generateSaveDataHash(e){var t=this._generateMapDataHash(e),n=[];for(var r in e)r===`map`||r===`mapObject`||r===`mapCompressed`||r===`mapObjectCompressed`||r===`mapAttribute`||r===`objectAttribute`||r===`checkString`||n.push(r);n.sort();for(var i=0;i<n.length;i++)t+=He(e[n[i]]);return _i(t)}compressSystem(){return Li}_quickSave(e){let t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_SAVE;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t);var n=structuredClone(this._wwaData),r=this._player.getPosition().getPartsCoord(),i=this._player.getStatusWithoutEquipments();switch(n.itemBox=this._player.getCopyOfItemBox(),n.playerX=r.x,n.playerY=r.y,n.statusEnergyMax=this._player.getEnergyMax(),n.statusEnergy=i.energy,n.statusStrength=i.strength,n.statusDefence=i.defence,n.statusGold=i.gold,n.moves=this._player.getMoveCount(),n.frameCount=this._player.getFrameCount(),n.gameSpeedIndex=this._player.getSpeedIndex(),n.playTime=this._playTimeCalculator?.calculateTimeMs()??0,n.userVar=this._userVar.numbered.slice(),n.userNamedVar=structuredClone(this._userVar.named),e){case N.CALL_BY_LOG_QUICK_SAVE:case N.CALL_BY_QUICK_SAVE:case N.CALL_BY_SUSPEND:break;case N.CALL_BY_PASSWORD_SAVE:n.checkOriginalMapString=this.checkOriginalMapString,n.checkString=this._generateSaveDataHash(n);break}switch(n.message=void 0,n.mapAttribute=void 0,n.objectAttribute=void 0,e){case N.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,n),this.wwaCustomEvent(`wwa_quicksave`,{data:n}),``;case N.CALL_BY_PASSWORD_SAVE:let e=Li.compress(n,{isPassword:!0});e.isCompress=1;let t=JSON.stringify(e);return this.wwaCustomEvent(`wwa_passwordsave`,{data:n,compress:e}),mi(t,this._wwaData.worldPassNumber);case N.CALL_BY_SUSPEND:this.wwaCustomEvent(`wwa_suspend`,{data:n,compress:Li.compress(n)});break;case N.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent(`wwa_autosave`,{data:n}),this._wwaSave.autoSave(this._cvs,n);break}}wwaCustomEvent(e,t={}){this.wwaCustomEventEmitter.dispatch(e,t)}_decodePassword(e){let t=``,n;try{t=gi(e,this._wwaData.worldPassNumber)}catch(e){n=e}if(!t){console.warn(`新方式でのパスワード暗号化解除失敗:`,n);try{t=hi(e,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(e){n=e}}if(!t){console.warn(`旧方式でのパスワード暗号化解除失敗:`,n);let e=n&&n.message?n.message:``;throw Error(`パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、
123
+  入力選択ができます。`,!0);break;case N.NONE:this.registerSystemMessagePage(`読み込むオートセーブを選んでください。`,!0);break}return}else if(this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_SAVE)if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend){this._yesNoJudge=k.UNSELECTED,this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled();return}else U(F[P.QUICK_SAVE]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_RESTART_GAME)U(F[P.RESTART_GAME]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_END_GAME)U(F[P.GOTO_WWA]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_GOTO_WWA)U(F[P.GOTO_WWA]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_LOAD)U(F[P.QUICK_LOAD]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_SAVE)U(F[P.QUICK_SAVE]).classList.remove(`onpress`);else if(this._yesNoChoiceCallInfo===N.CALL_BY_SUSPEND)if(this._usePassword){this._yesNoJudge=k.UNSELECTED,this.onpasswordsavecalled();return}else U(F[P.QUICK_SAVE]).classList.remove(`onpress`);this._yesNoJudge=k.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)}}}_dispatchWindowClosedTimeRequests(){if(this._windowCloseWaitingJumpGateRequest&&this.forcedJumpGate(this._windowCloseWaitingJumpGateRequest.x,this._windowCloseWaitingJumpGateRequest.y),this._windowCloseWaitingMessageDisplayRequests.length>0){let e=this._windowCloseWaitingMessageDisplayRequests.shift();return this.registerPageByMessage(e.message,{additionalItems:e.additionalItems}),{newPageGenerated:!0}}return{newPageGenerated:!1}}_dispatchPlayerAndObjectsStopTimeRequests(){this._playerAndObjectsStopWaitingGameSpeedChangeRequest&&=(this.setPlayerSpeedIndex(this._playerAndObjectsStopWaitingGameSpeedChangeRequest.speedIndex),void 0),this._playerAndObjectsStopWaitingMessageDisplayRequests.length>0&&(this.registerPageByMessage(this._playerAndObjectsStopWaitingMessageDisplayRequests.map(e=>e.message).join(`<p>`),{additionalItems:this._playerAndObjectsStopWaitingMessageDisplayRequests.map(e=>e.additionalItems).flat()}),this._playerAndObjectsStopWaitingMessageDisplayRequests=[])}_clearAllRequests(){this._playerAndObjectsStopWaitingMessageDisplayRequests=[],this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0,this._windowCloseWaitingJumpGateRequest=void 0,this._windowCloseWaitingMessageDisplayRequests=[]}reserveMessageDisplayWhenShouldOpen(e){this._player.isWaitingMessageOrManualPause()||this._player.isFighting()||this._player.isWaitingPasswordWindow()||this._player.isWaitingEstimateWindow()?this._windowCloseWaitingMessageDisplayRequests.push(e):this._player.isMoving()||this._player.isWaitingMoveMacro()?this._playerAndObjectsStopWaitingMessageDisplayRequests.push(e):this.registerPageByMessage(e.message,{additionalItems:e.additionalItems})}handleMsgFunction(e){this._pageExecuting?this._windowCloseWaitingMessageDisplayRequests.push(e):this.reserveMessageDisplayWhenShouldOpen(e)}registerSystemMessagePage(e,t=!1){this.registerPageByMessage(e,{showChoice:t,isSystemMessage:!0})}registerSystemMessagePageByKey(e){let t=this.resolveSystemMessage(e);t!==`BLANK`&&this.registerPageByMessage(t,{isSystemMessage:!0})}_createSimpleMessage(e,t){return new nr(e,()=>this.generateTokenValues(t),(e,t)=>this._execEvalString(e,t))}registerPageByMessage(e,{showChoice:t=!1,isSystemMessage:n=!1,triggerParts:r={id:0,type:j.OBJECT,position:new S(0,0)},scoreOption:i=void 0,additionalItems:a=[]}={}){let o=pr(e,{triggerParts:r,isSystemMessage:n,showChoice:t,scoreOption:i,additionalItems:a},e=>$n(this,r,e),(e,t)=>this._execEvalString(e,t),e=>this.generateTokenValues(e));this._pages=this._pages.concat(o),this._shouldSetNextPage=!0}appearParts({pos:e,triggerType:t,triggerPartsId:n}){var r,i=t===A.CHOICE_NO?R.APPERANCE_PARTS_MIN_INDEX_NO:R.APPERANCE_PARTS_MIN_INDEX,a=t===A.CHOICE_YES?R.APPERANCE_PARTS_MAX_INDEX_YES:R.APPERANCE_PARTS_MAX_INDEX,o,s,c,l,u;for(t===A.MAP?(n=n===0?this._wwaData.map[e.y][e.x]:n,r=j.MAP):(n=n===0?this._wwaData.mapObject[e.y][e.x]:n,r=j.OBJECT),u=i;u<=a;u++){var d=R.ATR_APPERANCE_BASE+u*R.REL_ATR_APPERANCE_UNIT_LENGTH,f=d+R.REL_ATR_APPERANCE_ID,p=d+R.REL_ATR_APPERANCE_X,m=d+R.REL_ATR_APPERANCE_Y,h=d+R.REL_ATR_APPERANCE_TYPE;if(o=r===j.MAP?this._wwaData.mapAttribute[n][f]:this._wwaData.objectAttribute[n][f],s=r===j.MAP?this._wwaData.mapAttribute[n][h]:this._wwaData.objectAttribute[n][h],c=r===j.MAP?this._wwaData.mapAttribute[n][p]:this._wwaData.objectAttribute[n][p],l=r===j.MAP?this._wwaData.mapAttribute[n][m]:this._wwaData.objectAttribute[n][m],c===R.PLAYER_COORD?(c=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):c>R.RELATIVE_COORD_LOWER&&(c=e.x+c-R.RELATIVE_COORD_BIAS),l===R.PLAYER_COORD?(l=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):l>R.RELATIVE_COORD_LOWER&&(l=e.y+l-R.RELATIVE_COORD_BIAS),!(c===0&&l===0))try{if(new C(this,c,l,0,0),s===j.MAP){if(o>=this._wwaData.mapPartsMax)throw Error(`背景パーツの範囲外IDが指定されました`);var g=new S(c,l);this.setPartsOnPosition(j.MAP,o,g)}else{if(o>=this._wwaData.objPartsMax)throw Error(`物体パーツの範囲外IDが指定されました`);var g=new S(c,l);this.setPartsOnPosition(j.OBJECT,o,g),this._replaceRandomObject(new S(c,l)),c===this._player.getPosition().getPartsCoord().x&&l===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch{}}}reserveAppearPartsInNextFrame(e,t,n=0){this._reservedPartsAppearances.push({pos:e,triggerType:t,triggerPartsId:n})}reserveJumpInNextFrame(e){this._reservedJumpDestination=e}appearPartsByDirection(e,t,n){var r=this._player.getPosition().getPartsCoord(),i=this._player.getDir(),a=D[i],o=O[i];this.appearPartsEval(r,(a>=0?`+`:`-`)+Math.abs(a)*e,(o>=0?`+`:`-`)+Math.abs(o)*e,t,n)}appearPartsEval(e,t,n,r,i){var a,o,s=this._player.getPosition().getPartsCoord();if(t===`P`||t===`p`)a=s.x;else if(t[0]===`+`)a=e.x+parseInt(t.substr(1));else if(t[0]===`-`)a=e.x-parseInt(t.substr(1));else if(a=parseInt(t),isNaN(a))throw Error(`座標として解釈できない文字が含まれています。`);if(n===`P`||n===`p`)o=s.y;else if(n[0]===`+`)o=e.y+parseInt(n.substr(1));else if(n[0]===`-`)o=e.y-parseInt(n.substr(1));else if(o=parseInt(n),isNaN(o))throw Error(`座標として解釈できない文字が含まれています。`);try{if(new C(this,a,o,0,0),i===j.MAP){if(r>=this._wwaData.mapPartsMax)throw Error(`背景パーツの範囲外IDが指定されました`);var c=new S(a,o);this.setPartsOnPosition(j.MAP,r,c)}else{if(r>=this._wwaData.objPartsMax)throw Error(`物体パーツの範囲外IDが指定されました`);var c=new S(a,o);this.setPartsOnPosition(j.OBJECT,r,c),this._replaceRandomObject(new S(a,o)),a===this._player.getPosition().getPartsCoord().x&&o===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch{}}getPartsID(e,t){if(e.x<0||e.y<0)throw Error(`想定外の座標が指定されました`);return t===j.MAP?this._wwaData.map[e.y][e.x]:this._wwaData.mapObject[e.y][e.x]}_replaceRandomObject(e){var t=this._wwaData.mapObject[e.y][e.x],n=this._wwaData.objectAttribute[t][R.ATR_TYPE],r,i;if(n===R.OBJECT_RANDOM){for(var a=0;a<R.RANDOM_ITERATION_MAX;a++){if(i=Math.floor(Math.random()*10),r=this._wwaData.objectAttribute[t][R.ATR_RANDOM_BASE+i],r>=this._wwaData.objPartsMax){r=0;break}if(this._wwaData.objectAttribute[r][R.ATR_TYPE]!==R.OBJECT_RANDOM)break;t=r}this.setPartsOnPosition(j.OBJECT,r,e)}}_replaceRandomObjectsInScreen(){for(var e=this._camera.getPosition().getPartsCoord(),t=Math.max(0,e.x-1),n=Math.min(this._wwaData.mapWidth-1,e.x+R.H_PARTS_NUM_IN_WINDOW),r=Math.max(0,e.y-1),i=Math.min(this._wwaData.mapWidth-1,e.y+R.V_PARTS_NUM_IN_WINDOW),a=t;a<=n;a++)for(var o=r;o<=i;o++)this._replaceRandomObject(new S(a,o))}_replaceAllRandomObjects(){for(var e=0;e<this._wwaData.mapWidth;e++)for(var t=0;t<this._wwaData.mapWidth;t++)this._replaceRandomObject(new S(e,t))}gameover(){var e=this._wwaData.gameoverX,t=this._wwaData.gameoverY;this._yesNoJudge=k.UNSELECTED,this._pages=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._player.clearWaitingMessageOrManualPause(),this._messageWindow.clear(),this._messageWindow.setYesNoChoice(!1),this._waitFrame=0,this._temporaryInputDisable=!0,this._shouldSetNextPage=!1,this._reservedPartsAppearances=[],this._reservedJumpDestination=void 0,this._clearAllRequests(),this._player.jumpTo(new C(this,e,t,0,0));let n=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GAMEOVER;n&&this.evalCalcWwaNodeGenerator.evalWwaNode(n)}setYesNoInput(e){this._yesNoJudgeInNextFrame=e}getYesNoState(){return this._yesNoJudgeInNextFrame===void 0?this._yesNoJudge:this._yesNoJudgeInNextFrame}setStatusChangedEffect(e){this._wwaData.isItemEffectEnabled&&(e.strength!==0&&(U(`disp-strength`).classList.add(`onpress`),this._statusPressCounter.strength=R.STATUS_CHANGED_EFFECT_FRAME_NUM),e.defence!==0&&(U(`disp-defence`).classList.add(`onpress`),this._statusPressCounter.defence=R.STATUS_CHANGED_EFFECT_FRAME_NUM),e instanceof x&&(e.energy!==0&&(U(`disp-energy`).classList.add(`onpress`),this._statusPressCounter.energy=R.STATUS_CHANGED_EFFECT_FRAME_NUM),e.gold!==0&&(U(`disp-gold`).classList.add(`onpress`),this._statusPressCounter.gold=R.STATUS_CHANGED_EFFECT_FRAME_NUM)))}setPartsOnPosition(e,t,n){var r,i,a=n.y<<Ce.BITSHIFT|n.x;e===j.MAP?(r=this._wwaData.map[n.y][n.x],t=this.loadMapPartsID(t),r=this.loadMapPartsID(r),this._wwaData.map[n.y][n.x]=t,i=this._mapIDTable[r].indexOf(a),i!==-1&&this._mapIDTable[r].splice(i,1),i=this._mapIDTable[t].indexOf(a),i===-1&&this._mapIDTable[t].push(a)):(r=this._wwaData.mapObject[n.y][n.x],t=this.loadMapPartsObjectID(t),r=this.loadMapPartsObjectID(r),this._wwaData.mapObject[n.y][n.x]=t,i=this._mapObjectIDTable[r].indexOf(a),i!==-1&&this._mapObjectIDTable[r].splice(i,1),i=this._mapObjectIDTable[t].indexOf(a),i===-1&&this._mapObjectIDTable[t].push(a))}_countSamePartsLength(e,t){var n;for(n=t+1;n<e.length&&e[n]===e[n-1];n++);return n-t}_compressMap(e){for(var t=[],n=0;n<e.length;n++){t[n]=[];for(var r=0;r<e[n].length;){var i=this._countSamePartsLength(e[n],r);t[n].push([e[n][r],i]),r+=i}}return t}_decompressMap(e){for(var t=[],n=0;n<e.length;n++){t[n]=[];for(var r=0;r<e[n].length;r++)for(var i=e[n][r][1],a=0;a<i;a++)t[n].push(e[n][r][0])}return t}_generateMapDataHash(e){var t=`A`,n=0,r=0,i=0;for(i=0;i<e.map.length;i++){for(r=0;r<e.map[i].length;)n=this._countSamePartsLength(e.map[i],r),t+=e.map[i][r]+`|`+n+`/`,r+=n;for(r=0;r<e.mapObject[i].length;)n=this._countSamePartsLength(e.mapObject[i],r),t+=e.mapObject[i][r]+`|`+n+`/`,r+=n}for(var a=0;a<e.mapAttribute.length;a++)for(var o=0;o<e.mapAttribute[a].length;o++)t+=e.mapAttribute[a][o]+`/`;for(var s=0;s<e.objectAttribute.length;s++)for(var c=0;c<e.objectAttribute[s].length;c++)t+=e.objectAttribute[s][c]+`/`;return t+=`Z`,vi(t)}_generateSaveDataHash(e){var t=this._generateMapDataHash(e),n=[];for(var r in e)r===`map`||r===`mapObject`||r===`mapCompressed`||r===`mapObjectCompressed`||r===`mapAttribute`||r===`objectAttribute`||r===`checkString`||n.push(r);n.sort();for(var i=0;i<n.length;i++)t+=He(e[n[i]]);return vi(t)}compressSystem(){return Ri}_quickSave(e){let t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_SAVE;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t);var n=structuredClone(this._wwaData),r=this._player.getPosition().getPartsCoord(),i=this._player.getStatusWithoutEquipments();switch(n.itemBox=this._player.getCopyOfItemBox(),n.playerX=r.x,n.playerY=r.y,n.statusEnergyMax=this._player.getEnergyMax(),n.statusEnergy=i.energy,n.statusStrength=i.strength,n.statusDefence=i.defence,n.statusGold=i.gold,n.moves=this._player.getMoveCount(),n.frameCount=this._player.getFrameCount(),n.gameSpeedIndex=this._player.getSpeedIndex(),n.playTime=this._playTimeCalculator?.calculateTimeMs()??0,n.userVar=this._userVar.numbered.slice(),n.userNamedVar=structuredClone(this._userVar.named),e){case N.CALL_BY_LOG_QUICK_SAVE:case N.CALL_BY_QUICK_SAVE:case N.CALL_BY_SUSPEND:break;case N.CALL_BY_PASSWORD_SAVE:n.checkOriginalMapString=this.checkOriginalMapString,n.checkString=this._generateSaveDataHash(n);break}switch(n.message=void 0,n.mapAttribute=void 0,n.objectAttribute=void 0,e){case N.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,n),this.wwaCustomEvent(`wwa_quicksave`,{data:n}),``;case N.CALL_BY_PASSWORD_SAVE:let e=Ri.compress(n,{isPassword:!0});e.isCompress=1;let t=JSON.stringify(e);return this.wwaCustomEvent(`wwa_passwordsave`,{data:n,compress:e}),hi(t,this._wwaData.worldPassNumber);case N.CALL_BY_SUSPEND:this.wwaCustomEvent(`wwa_suspend`,{data:n,compress:Ri.compress(n)});break;case N.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent(`wwa_autosave`,{data:n}),this._wwaSave.autoSave(this._cvs,n);break}}wwaCustomEvent(e,t={}){this.wwaCustomEventEmitter.dispatch(e,t)}_decodePassword(e){let t=``,n;try{t=_i(e,this._wwaData.worldPassNumber)}catch(e){n=e}if(!t){console.warn(`新方式でのパスワード暗号化解除失敗:`,n);try{t=gi(e,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(e){n=e}}if(!t){console.warn(`旧方式でのパスワード暗号化解除失敗:`,n);let e=n&&n.message?n.message:``;throw Error(`パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、
124
124
  パスワードが壊れているために正常にセーブデータが復元できませんでした。
125
125
  `+e)}var r;try{r=JSON.parse(t)}catch{throw Error(`マップデータ以外のものが暗号化されたか、マップデータに何かが不足しているようです。
126
- JSON PARSE FAILED`)}if(r.isCompress){delete r.isCompress;let[e,t]=Li.decompress(r);return[Ui(e),t]}else return[r,{isWorldNameEmpty:!1}]}_quickLoad(e=!1,t=null,n=!0){if(!e&&this._wwaSave.hasSaveData()===void 0&&t===null)throw Error(`セーブデータがありません。`);let r,i=!1;if(t!==null){let e=this._decodePassword(t);r=e[0],i=e[1].isWorldNameEmpty}else r=structuredClone(e?this._restartData:this._messageWindow.load());if(r.message=structuredClone(this._restartData.message),r.mapAttribute=structuredClone(this._restartData.mapAttribute),r.objectAttribute=structuredClone(this._restartData.objectAttribute),r.map===void 0&&(r.map=this._decompressMap(r.mapCompressed)),r.mapObject===void 0&&(r.mapObject=this._decompressMap(r.mapObjectCompressed)),delete r.mapCompressed,delete r.mapObjectCompressed,t!==null){if(!i&&r.worldName!==this._wwaData.worldName)throw console.error(`Invalid title`,`(password)=${r.worldName} (current map)=${this._wwaData.worldName}`),Error(`前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。
126
+ JSON PARSE FAILED`)}if(r.isCompress){delete r.isCompress;let[e,t]=Ri.decompress(r);return[Wi(e),t]}else return[r,{isWorldNameEmpty:!1}]}_quickLoad(e=!1,t=null,n=!0){if(!e&&this._wwaSave.hasSaveData()===void 0&&t===null)throw Error(`セーブデータがありません。`);let r,i=!1;if(t!==null){let e=this._decodePassword(t);r=e[0],i=e[1].isWorldNameEmpty}else r=structuredClone(e?this._restartData:this._messageWindow.load());if(r.message=structuredClone(this._restartData.message),r.mapAttribute=structuredClone(this._restartData.mapAttribute),r.objectAttribute=structuredClone(this._restartData.objectAttribute),r.map===void 0&&(r.map=this._decompressMap(r.mapCompressed)),r.mapObject===void 0&&(r.mapObject=this._decompressMap(r.mapObjectCompressed)),delete r.mapCompressed,delete r.mapObjectCompressed,t!==null){if(!i&&r.worldName!==this._wwaData.worldName)throw console.error(`Invalid title`,`(password)=${r.worldName} (current map)=${this._wwaData.worldName}`),Error(`前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。
127
127
  予めご了承ください。`);let e=this.checkOriginalMapString;if(this._isDisallowLoadOldSave&&r.checkOriginalMapString!==e)throw console.error(`Invalid hash`,`(password)=${r.checkOriginalMapString} (current map)=${e}`),Error(`前回パスワード取得時から、制作者によってマップが変更されたためロードできませんでした。
128
128
  (マップデータ制作者の設定により、内容が変更されると以前のパスワードは利用できなくなります。)
129
- 予めご了承ください。`);console.log(`Valid Password!`)}return n&&this._applyQuickLoad(r),r}_applyQuickLoad(e){this._userVar.named=e.userNamedVar,this._userVar.numbered=e.userVar,this._player.setEnergyMax(e.statusEnergyMax),this._player.setEnergy(e.statusEnergy),this._player.setStrength(e.statusStrength),this._player.setDefence(e.statusDefence),this._player.setGold(e.statusGold),this._player.setMoveCount(e.moves),this._player.setFrameCount(e.frameCount),this._player.clearItemBox();for(var t=0;t<e.itemBox.length;t++)this._player.addItem(e.itemBox[t],t+1,!0);this._player.systemJumpTo(new C(this,e.playerX,e.playerY,0,0)),e.bgm===0?this.playSound(p.NO_SOUND):this.playSound(e.bgm,{bgmDelayDurationMs:e.bgmDelayDurationMs}),this.setImgClick(new S(e.imgClickX,e.imgClickY)),this.getObjectIdByPosition(this._player.getPosition())!==0&&this._player.setPartsAppearedFlag(),this._clearAllRequests(),this._playTimeCalculator=new Oe(e.playTime),this._wwaData=e,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(L.ENERGY,new S(e.imgStatusEnergyX,e.imgStatusEnergyY)),this.setStatusIconCoord(L.STRENGTH,new S(e.imgStatusStrengthX,e.imgStatusStrengthY)),this.setStatusIconCoord(L.DEFENCE,new S(e.imgStatusDefenceX,e.imgStatusDefenceY)),this.setStatusIconCoord(L.GOLD,new S(e.imgStatusGoldX,e.imgStatusGoldY)),this.setWideCellCoord(new S(e.imgWideCellX,e.imgWideCellY)),this.setItemboxBackgroundPosition({x:e.imgItemboxX,y:e.imgItemboxY}),this.setFrameCoord(new S(e.imgFrameX,e.imgFrameY)),this.setPlayerSpeedIndex(e.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._cgManager.restorePictures(this._wwaData.pictureRegistry),this.updateAllPicturesCache(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)}_mapIDTableCreate(){var e;for(this._mapIDTable=[],this._mapObjectIDTable=[],e=0;e<this._wwaData.mapPartsMax;e++)this._mapIDTable[e]=[];for(e=0;e<this._wwaData.objPartsMax;e++)this._mapObjectIDTable[e]=[];for(var t=0;t<this._wwaData.mapWidth;t++)for(var n=0;n<this._wwaData.mapWidth;n++){var r=n<<Ce.BITSHIFT|t;e=this._wwaData.map[n][t],this._mapIDTable[e]instanceof Array||(this._mapIDTable[e]=[]),this._mapIDTable[e].push(r),e=this._wwaData.mapObject[n][t],this._mapObjectIDTable[e]instanceof Array||(this._mapObjectIDTable[e]=[]),this._mapObjectIDTable[e].push(r)}}restartGame(){this._quickLoad(!0)}_fadeout(e){var t=0,n=R.MAP_WINDOW_WIDTH,r=R.FADEOUT_SPEED,i=U(`wwa-fader`);i.style.display=`block`;var a=setInterval(()=>{if(t+=r,n-=r*2,n<=0||t*2>R.MAP_WINDOW_WIDTH){i.removeAttribute(`style`),i.style.display=`block`,i.style.borderWidth=`0`,i.style.width=R.MAP_WINDOW_WIDTH+`px`,i.style.height=R.MAP_WINDOW_HEIGHT+`px`,i.style.backgroundColor=`#808080`,clearInterval(a),e();return}i.style.width=n+`px`,i.style.height=n+`px`,i.style.borderWidth=t+`px`},20)}moveObjects(e){var t=this._camera.getPosition();this._player.getPosition(),t.getPartsCoord();var n=t.getPartsCoord().x,r=t.getPartsCoord().y,i,a,o;if(!(this.getMapAttributeByPosition(this._player.getPosition(),R.ATR_TYPE)===R.MAP_LOCALGATE||this.getObjectAttributeByPosition(this._player.getPosition(),R.ATR_TYPE)===R.OBJECT_LOCALGATE)){for(i=Array(R.V_PARTS_NUM_IN_WINDOW+2),this.hoge=Array(R.V_PARTS_NUM_IN_WINDOW+2),o=-1;o<=R.V_PARTS_NUM_IN_WINDOW;o++)for(i[o+1]=Array(R.H_PARTS_NUM_IN_WINDOW+2),this.hoge[o+1]=Array(R.H_PARTS_NUM_IN_WINDOW+2),a=-1;a<=R.H_PARTS_NUM_IN_WINDOW;a++){if(r+o<0||r+o>=this._wwaData.mapWidth||n+a<0||n+a>=this._wwaData.mapWidth){i[o+1][a+1]=0,this.hoge[o+1][a+1]=0;continue}try{var s=new C(this,n+a,r+o,0,0),c=s.getPartsCoord()}catch{i[o+1][a+1]=0,this.hoge[o+1][a+1]=0;continue}this._wwaData.mapObject[c.y][c.x],i[o+1][a+1]=this._wwaData.mapObject[c.y][c.x],this.hoge[o+1][a+1]=-this._wwaData.mapObject[c.y][c.x]}for(a=-1;a<=R.H_PARTS_NUM_IN_WINDOW;a++)if(!(n+a<0||n+a>=this._wwaData.mapWidth)){for(o=-1;o<=R.V_PARTS_NUM_IN_WINDOW;o++)if(!(r+o<0||r+o>=this._wwaData.mapWidth)){try{var s=new C(this,n+a,r+o,0,0),c=s.getPartsCoord()}catch{continue}var l=this._wwaData.mapObject[c.y][c.x];if(!(l===0||this._wwaData.objectAttribute[l][R.ATR_MOVE]===se.STATIC||this._wwaData.objectAttribute[l][R.ATR_TYPE]===R.OBJECT_LOCALGATE||this._wwaData.objectAttribute[l][R.ATR_TYPE]===R.OBJECT_RANDOM)&&!(this._wwaData.objectAttribute[l][R.ATR_MOVE]!==se.CHASE_PLAYER&&this._wwaData.objectAttribute[l][R.ATR_MOVE]!==se.RUN_OUT&&this._wwaData.objectAttribute[l][R.ATR_MOVE]!==se.HANG_AROUND)){var u=this._wwaData.objectAttribute[l][R.ATR_MOVE];if(u!==se.HANG_AROUND){var d=this._getCandidateCoord(e,s,u),f=new S(d.x,c.y),p=new S(c.x,d.y),m=null,h;if(this._objectCanMoveTo(e,d,i))this._setObjectsInNextFrame(c,d,n,r,i,l);else{var g=this._getSecondCandidateMoveMode(e,c,d,f,p,this._wwaData.objectAttribute[l][R.ATR_TYPE]===R.OBJECT_MONSTER,i);g===ce.MODE_X?this._setObjectsInNextFrame(c,f,n,r,i,l):g===ce.MODE_Y?this._setObjectsInNextFrame(c,p,n,r,i,l):(m=this._getThirdCandidate(e,s,d,u,i),m!==null&&!this._wwaData.isOldMove?this._setObjectsInNextFrame(c,m,n,r,i,l):(h=this._getRandomMoveCoord(e,s,i),this._setObjectsInNextFrame(c,h,n,r,i,l)))}}else h=this._getRandomMoveCoord(e,s,i),this._setObjectsInNextFrame(c,h,n,r,i,l)}}}}}_getCandidateCoord(e,t,n){var r=t.getPartsCoord();this._player.getPosition().getOffsetCoord(),this._player.getPosition().getPartsCoord();try{var i=e?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord()}catch{throw Error(`予期せぬ方向への移動のようです。`)}var a=r.clone(),o=0,s=0;return n===se.CHASE_PLAYER?(o=r.x>i.x?-1:+(r.x<i.x),s=r.y>i.y?-1:+(r.y<i.y)):n===se.RUN_OUT&&(o=r.x>i.x?1:r.x<i.x?-1:0,s=r.y>i.y?1:r.y<i.y?-1:0),a.x+=o,a.y+=s,a.x=Math.min(this._wwaData.mapWidth-1,Math.max(0,a.x)),a.y=Math.min(this._wwaData.mapWidth-1,Math.max(0,a.y)),a}_getSecondCandidateMoveMode(e,t,n,r,i,a,o){return e&&((this._player.getDir()===E.UP||this._player.getDir()===E.DOWN)&&a||(this._player.getDir()===E.LEFT||this._player.getDir()===E.RIGHT)&&!a)?this._objectCanMoveTo(e,i,o)?ce.MODE_Y:this._objectCanMoveTo(e,r,o)?ce.MODE_X:ce.UNDECIDED:this._objectCanMoveTo(e,r,o)?ce.MODE_X:this._objectCanMoveTo(e,i,o)?ce.MODE_Y:ce.UNDECIDED}_getThirdCandidate(e,t,n,r,i){var a=r===se.CHASE_PLAYER?1:r===se.RUN_OUT?-1:0,o=e?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),s=t.getPartsCoord(),c;return o.x!==s.x&&(c=new S(n.x,s.y+1*a),this._objectCanMoveTo(e,c,i)||(c=new S(n.x,s.y-1*a),this._objectCanMoveTo(e,c,i))||(c=new S(s.x,s.y+1*a),this._objectCanMoveTo(e,c,i))||(c=new S(s.x,s.y-1*a),this._objectCanMoveTo(e,c,i)))||o.y!==s.y&&(c=new S(s.x+1*a,n.y),this._objectCanMoveTo(e,c,i)||(c=new S(s.x-1*a,n.y),this._objectCanMoveTo(e,c,i))||(c=new S(s.x+1*a,s.y),this._objectCanMoveTo(e,c,i))||(c=new S(s.x-1*a,s.y),this._objectCanMoveTo(e,c,i)))?c:null}_getRandomMoveCoord(e,t,n){let r=t.getPartsCoord(),i=r.clone(),a=this._wwaData.isOldMove?R.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:R.RANDOM_MOVE_ITERATION_NUM;for(let t=0;t<a;t++){let t=[-1,1,0,0,-1,-1,1,1],a=[0,0,1,-1,1,-1,1,-1],o=Math.floor(Math.random()*t.length);if(i.x=r.x+t[o],i.y=r.y+a[o],this._objectCanMoveTo(e,i,n))return i}return r}isPrevFrameEventExecuted(){return this._prevFrameEventExected}_objectCanMoveTo(e,t,n){if(t.x<0||t.y<0||this._wwaData.mapWidth<=t.x||this._wwaData.mapWidth<=t.y)return!1;var r=this._wwaData.map[t.y][t.x],i=this._wwaData.mapObject[t.y][t.x],a=this._wwaData.mapAttribute[r][R.ATR_TYPE],o=this._camera.getPosition(),s=o.getPartsCoord().x,c=o.getPartsCoord().y;if(r===0&&!this.isOldMap()||a===R.MAP_WALL)return!1;var l=t.x-s+1,u=t.y-c+1;if(0<=l&&0<=u&&l<n.length&&u<n.length){if(n[u][l]!==0)return!1}else if(i!==0)return!1;if(e){if(this._player.getPosition().getNextJustPosition().getPartsCoord().equals(t))return!1}else if(this._player.getPosition().getPartsCoord().equals(t))return!1;return!0}_setObjectsInNextFrame(e,t,n,r,i,a){var o=t.x-n+1,s=t.y-r+1;0<=t.x&&t.x<=this._wwaData.mapWidth&&0<=t.y&&t.y<=this._wwaData.mapWidth&&(0<=o&&o<i.length&&0<=s&&s<i.length&&(i[e.y-r+1][e.x-n+1]=0,i[t.y-r+1][t.x-n+1]=a,this.hoge[t.y-r+1][t.x-n+1]=a),this._objectMovingDataManager.add(a,e.convertIntoPosition(this),t.convertIntoPosition(this),e.getDirectionTo(t)))}launchBattleEstimateWindow(){let e=this._camera.getPosition().getPartsCoord(),t=Math.max(0,e.x),n=Math.min(this._wwaData.mapWidth-1,e.x+R.H_PARTS_NUM_IN_WINDOW-1),r=Math.max(0,e.y),i=Math.min(this._wwaData.mapWidth-1,e.y+R.V_PARTS_NUM_IN_WINDOW-1),a=[];this.playDecisionSound();for(let e=t;e<=n;e++)for(let t=r;t<=i;t++){let n=this._wwaData.mapObject[t][e];this._wwaData.objectAttribute[n][R.ATR_TYPE]!==R.OBJECT_MONSTER||a.find(e=>e.partsID===n)||a.push(this._createMonster(n,new S(e,t)))}if(this._bottomButtonType===T.BATTLE_REPORT&&U(F[P.GOTO_WWA]).classList.add(`onpress`),a.length===0)return U(F[P.GOTO_WWA]).classList.remove(`onpress`),this.hideBattleEstimateWindow(),!1;this._battleEstimateWindow.update(this._player.getStatus(),a,(e,t)=>this._player.calcBattleResultForPlayerTurn(e,t.status,!0),(e,t)=>this._player.calcBattleResultForEnemyTurn(e.status,t,!0),this.isUsingDefaultDamageCalcFunction()),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating();let o=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_BATTLE_REPORT;return o&&this.evalCalcWwaNodeGenerator.evalWwaNode(o),!0}isUsingDefaultDamageCalcFunction(){return this.getUserDefinedDamageFunctionNode(`enemyToPlayer`)===void 0&&this.getUserDefinedDamageFunctionNode(`playerToEnemy`)===void 0}_createMonster(e,t,n){return new Jn(e,t,new S(this._wwaData.objectAttribute[e][R.ATR_X],this._wwaData.objectAttribute[e][R.ATR_Y]),new x(this._wwaData.objectAttribute[e][R.ATR_ENERGY],this._wwaData.objectAttribute[e][R.ATR_STRENGTH],this._wwaData.objectAttribute[e][R.ATR_DEFENCE],this._wwaData.objectAttribute[e][R.ATR_GOLD]),this._wwaData.message[this._wwaData.objectAttribute[e][R.ATR_STRING]],this._wwaData.objectAttribute[e][R.ATR_ITEM],n)}hideBattleEstimateWindow(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),U(F[P.GOTO_WWA]).classList.remove(`onpress`),this._dispatchWindowClosedTimeRequests()}hidePasswordWindow(e=!1){if(this._passwordWindow.hide(),e||this._passwordWindow.mode===Cr.SAVE){this._player.clearPasswordWindowWaiting(),this._dispatchWindowClosedTimeRequests();return}try{var t=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(e){this._player.clearPasswordWindowWaiting(),this._dispatchWindowClosedTimeRequests(),alert(`セーブデータの復元に失敗しました。
129
+ 予めご了承ください。`);console.log(`Valid Password!`)}return n&&this._applyQuickLoad(r),r}_applyQuickLoad(e){this._userVar.named=e.userNamedVar,this._userVar.numbered=e.userVar,this._player.setEnergyMax(e.statusEnergyMax),this._player.setEnergy(e.statusEnergy),this._player.setStrength(e.statusStrength),this._player.setDefence(e.statusDefence),this._player.setGold(e.statusGold),this._player.setMoveCount(e.moves),this._player.setFrameCount(e.frameCount),this._player.clearItemBox();for(var t=0;t<e.itemBox.length;t++)this._player.addItem(e.itemBox[t],t+1,!0);this._player.systemJumpTo(new C(this,e.playerX,e.playerY,0,0)),e.bgm===0?this.playSound(p.NO_SOUND):this.playSound(e.bgm,{bgmDelayDurationMs:e.bgmDelayDurationMs}),this.setImgClick(new S(e.imgClickX,e.imgClickY)),this.getObjectIdByPosition(this._player.getPosition())!==0&&this._player.setPartsAppearedFlag(),this._clearAllRequests(),this._playTimeCalculator=new Oe(e.playTime),this._wwaData=e,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(L.ENERGY,new S(e.imgStatusEnergyX,e.imgStatusEnergyY)),this.setStatusIconCoord(L.STRENGTH,new S(e.imgStatusStrengthX,e.imgStatusStrengthY)),this.setStatusIconCoord(L.DEFENCE,new S(e.imgStatusDefenceX,e.imgStatusDefenceY)),this.setStatusIconCoord(L.GOLD,new S(e.imgStatusGoldX,e.imgStatusGoldY)),this.setWideCellCoord(new S(e.imgWideCellX,e.imgWideCellY)),this.setItemboxBackgroundPosition({x:e.imgItemboxX,y:e.imgItemboxY}),this.setFrameCoord(new S(e.imgFrameX,e.imgFrameY)),this.setPlayerSpeedIndex(e.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._cgManager.restorePictures(this._wwaData.pictureRegistry),this.updateAllPicturesCache(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)}_mapIDTableCreate(){var e;for(this._mapIDTable=[],this._mapObjectIDTable=[],e=0;e<this._wwaData.mapPartsMax;e++)this._mapIDTable[e]=[];for(e=0;e<this._wwaData.objPartsMax;e++)this._mapObjectIDTable[e]=[];for(var t=0;t<this._wwaData.mapWidth;t++)for(var n=0;n<this._wwaData.mapWidth;n++){var r=n<<Ce.BITSHIFT|t;e=this._wwaData.map[n][t],this._mapIDTable[e]instanceof Array||(this._mapIDTable[e]=[]),this._mapIDTable[e].push(r),e=this._wwaData.mapObject[n][t],this._mapObjectIDTable[e]instanceof Array||(this._mapObjectIDTable[e]=[]),this._mapObjectIDTable[e].push(r)}}restartGame(){this._quickLoad(!0)}_fadeout(e){var t=0,n=R.MAP_WINDOW_WIDTH,r=R.FADEOUT_SPEED,i=U(`wwa-fader`);i.style.display=`block`;var a=setInterval(()=>{if(t+=r,n-=r*2,n<=0||t*2>R.MAP_WINDOW_WIDTH){i.removeAttribute(`style`),i.style.display=`block`,i.style.borderWidth=`0`,i.style.width=R.MAP_WINDOW_WIDTH+`px`,i.style.height=R.MAP_WINDOW_HEIGHT+`px`,i.style.backgroundColor=`#808080`,clearInterval(a),e();return}i.style.width=n+`px`,i.style.height=n+`px`,i.style.borderWidth=t+`px`},20)}moveObjects(e){var t=this._camera.getPosition();this._player.getPosition(),t.getPartsCoord();var n=t.getPartsCoord().x,r=t.getPartsCoord().y,i,a,o;if(!(this.getMapAttributeByPosition(this._player.getPosition(),R.ATR_TYPE)===R.MAP_LOCALGATE||this.getObjectAttributeByPosition(this._player.getPosition(),R.ATR_TYPE)===R.OBJECT_LOCALGATE)){for(i=Array(R.V_PARTS_NUM_IN_WINDOW+2),this.hoge=Array(R.V_PARTS_NUM_IN_WINDOW+2),o=-1;o<=R.V_PARTS_NUM_IN_WINDOW;o++)for(i[o+1]=Array(R.H_PARTS_NUM_IN_WINDOW+2),this.hoge[o+1]=Array(R.H_PARTS_NUM_IN_WINDOW+2),a=-1;a<=R.H_PARTS_NUM_IN_WINDOW;a++){if(r+o<0||r+o>=this._wwaData.mapWidth||n+a<0||n+a>=this._wwaData.mapWidth){i[o+1][a+1]=0,this.hoge[o+1][a+1]=0;continue}try{var s=new C(this,n+a,r+o,0,0),c=s.getPartsCoord()}catch{i[o+1][a+1]=0,this.hoge[o+1][a+1]=0;continue}this._wwaData.mapObject[c.y][c.x],i[o+1][a+1]=this._wwaData.mapObject[c.y][c.x],this.hoge[o+1][a+1]=-this._wwaData.mapObject[c.y][c.x]}for(a=-1;a<=R.H_PARTS_NUM_IN_WINDOW;a++)if(!(n+a<0||n+a>=this._wwaData.mapWidth)){for(o=-1;o<=R.V_PARTS_NUM_IN_WINDOW;o++)if(!(r+o<0||r+o>=this._wwaData.mapWidth)){try{var s=new C(this,n+a,r+o,0,0),c=s.getPartsCoord()}catch{continue}var l=this._wwaData.mapObject[c.y][c.x];if(!(l===0||this._wwaData.objectAttribute[l][R.ATR_MOVE]===se.STATIC||this._wwaData.objectAttribute[l][R.ATR_TYPE]===R.OBJECT_LOCALGATE||this._wwaData.objectAttribute[l][R.ATR_TYPE]===R.OBJECT_RANDOM)&&!(this._wwaData.objectAttribute[l][R.ATR_MOVE]!==se.CHASE_PLAYER&&this._wwaData.objectAttribute[l][R.ATR_MOVE]!==se.RUN_OUT&&this._wwaData.objectAttribute[l][R.ATR_MOVE]!==se.HANG_AROUND)){var u=this._wwaData.objectAttribute[l][R.ATR_MOVE];if(u!==se.HANG_AROUND){var d=this._getCandidateCoord(e,s,u),f=new S(d.x,c.y),p=new S(c.x,d.y),m=null,h;if(this._objectCanMoveTo(e,d,i))this._setObjectsInNextFrame(c,d,n,r,i,l);else{var g=this._getSecondCandidateMoveMode(e,c,d,f,p,this._wwaData.objectAttribute[l][R.ATR_TYPE]===R.OBJECT_MONSTER,i);g===ce.MODE_X?this._setObjectsInNextFrame(c,f,n,r,i,l):g===ce.MODE_Y?this._setObjectsInNextFrame(c,p,n,r,i,l):(m=this._getThirdCandidate(e,s,d,u,i),m!==null&&!this._wwaData.isOldMove?this._setObjectsInNextFrame(c,m,n,r,i,l):(h=this._getRandomMoveCoord(e,s,i),this._setObjectsInNextFrame(c,h,n,r,i,l)))}}else h=this._getRandomMoveCoord(e,s,i),this._setObjectsInNextFrame(c,h,n,r,i,l)}}}}}_getCandidateCoord(e,t,n){var r=t.getPartsCoord();this._player.getPosition().getOffsetCoord(),this._player.getPosition().getPartsCoord();try{var i=e?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord()}catch{throw Error(`予期せぬ方向への移動のようです。`)}var a=r.clone(),o=0,s=0;return n===se.CHASE_PLAYER?(o=r.x>i.x?-1:+(r.x<i.x),s=r.y>i.y?-1:+(r.y<i.y)):n===se.RUN_OUT&&(o=r.x>i.x?1:r.x<i.x?-1:0,s=r.y>i.y?1:r.y<i.y?-1:0),a.x+=o,a.y+=s,a.x=Math.min(this._wwaData.mapWidth-1,Math.max(0,a.x)),a.y=Math.min(this._wwaData.mapWidth-1,Math.max(0,a.y)),a}_getSecondCandidateMoveMode(e,t,n,r,i,a,o){return e&&((this._player.getDir()===E.UP||this._player.getDir()===E.DOWN)&&a||(this._player.getDir()===E.LEFT||this._player.getDir()===E.RIGHT)&&!a)?this._objectCanMoveTo(e,i,o)?ce.MODE_Y:this._objectCanMoveTo(e,r,o)?ce.MODE_X:ce.UNDECIDED:this._objectCanMoveTo(e,r,o)?ce.MODE_X:this._objectCanMoveTo(e,i,o)?ce.MODE_Y:ce.UNDECIDED}_getThirdCandidate(e,t,n,r,i){var a=r===se.CHASE_PLAYER?1:r===se.RUN_OUT?-1:0,o=e?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),s=t.getPartsCoord(),c;return o.x!==s.x&&(c=new S(n.x,s.y+1*a),this._objectCanMoveTo(e,c,i)||(c=new S(n.x,s.y-1*a),this._objectCanMoveTo(e,c,i))||(c=new S(s.x,s.y+1*a),this._objectCanMoveTo(e,c,i))||(c=new S(s.x,s.y-1*a),this._objectCanMoveTo(e,c,i)))||o.y!==s.y&&(c=new S(s.x+1*a,n.y),this._objectCanMoveTo(e,c,i)||(c=new S(s.x-1*a,n.y),this._objectCanMoveTo(e,c,i))||(c=new S(s.x+1*a,s.y),this._objectCanMoveTo(e,c,i))||(c=new S(s.x-1*a,s.y),this._objectCanMoveTo(e,c,i)))?c:null}_getRandomMoveCoord(e,t,n){let r=t.getPartsCoord(),i=r.clone(),a=this._wwaData.isOldMove?R.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:R.RANDOM_MOVE_ITERATION_NUM;for(let t=0;t<a;t++){let t=[-1,1,0,0,-1,-1,1,1],a=[0,0,1,-1,1,-1,1,-1],o=Math.floor(Math.random()*t.length);if(i.x=r.x+t[o],i.y=r.y+a[o],this._objectCanMoveTo(e,i,n))return i}return r}isPrevFrameEventExecuted(){return this._prevFrameEventExected}_objectCanMoveTo(e,t,n){if(t.x<0||t.y<0||this._wwaData.mapWidth<=t.x||this._wwaData.mapWidth<=t.y)return!1;var r=this._wwaData.map[t.y][t.x],i=this._wwaData.mapObject[t.y][t.x],a=this._wwaData.mapAttribute[r][R.ATR_TYPE],o=this._camera.getPosition(),s=o.getPartsCoord().x,c=o.getPartsCoord().y;if(r===0&&!this.isOldMap()||a===R.MAP_WALL)return!1;var l=t.x-s+1,u=t.y-c+1;if(0<=l&&0<=u&&l<n.length&&u<n.length){if(n[u][l]!==0)return!1}else if(i!==0)return!1;if(e){if(this._player.getPosition().getNextJustPosition().getPartsCoord().equals(t))return!1}else if(this._player.getPosition().getPartsCoord().equals(t))return!1;return!0}_setObjectsInNextFrame(e,t,n,r,i,a){var o=t.x-n+1,s=t.y-r+1;0<=t.x&&t.x<=this._wwaData.mapWidth&&0<=t.y&&t.y<=this._wwaData.mapWidth&&(0<=o&&o<i.length&&0<=s&&s<i.length&&(i[e.y-r+1][e.x-n+1]=0,i[t.y-r+1][t.x-n+1]=a,this.hoge[t.y-r+1][t.x-n+1]=a),this._objectMovingDataManager.add(a,e.convertIntoPosition(this),t.convertIntoPosition(this),e.getDirectionTo(t)))}launchBattleEstimateWindow(){let e=this._camera.getPosition().getPartsCoord(),t=Math.max(0,e.x),n=Math.min(this._wwaData.mapWidth-1,e.x+R.H_PARTS_NUM_IN_WINDOW-1),r=Math.max(0,e.y),i=Math.min(this._wwaData.mapWidth-1,e.y+R.V_PARTS_NUM_IN_WINDOW-1),a=[];this.playDecisionSound();for(let e=t;e<=n;e++)for(let t=r;t<=i;t++){let n=this._wwaData.mapObject[t][e];this._wwaData.objectAttribute[n][R.ATR_TYPE]!==R.OBJECT_MONSTER||a.find(e=>e.partsID===n)||a.push(this._createMonster(n,new S(e,t)))}if(this._bottomButtonType===T.BATTLE_REPORT&&U(F[P.GOTO_WWA]).classList.add(`onpress`),a.length===0)return U(F[P.GOTO_WWA]).classList.remove(`onpress`),this.hideBattleEstimateWindow(),!1;this._battleEstimateWindow.update(this._player.getStatus(),a,(e,t)=>this._player.calcBattleResultForPlayerTurn(e,t.status,!0),(e,t)=>this._player.calcBattleResultForEnemyTurn(e.status,t,!0),this.isUsingDefaultDamageCalcFunction()),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating();let o=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_BATTLE_REPORT;return o&&this.evalCalcWwaNodeGenerator.evalWwaNode(o),!0}isUsingDefaultDamageCalcFunction(){return this.getUserDefinedDamageFunctionNode(`enemyToPlayer`)===void 0&&this.getUserDefinedDamageFunctionNode(`playerToEnemy`)===void 0}_createMonster(e,t,n){return new Jn(e,t,new S(this._wwaData.objectAttribute[e][R.ATR_X],this._wwaData.objectAttribute[e][R.ATR_Y]),new x(this._wwaData.objectAttribute[e][R.ATR_ENERGY],this._wwaData.objectAttribute[e][R.ATR_STRENGTH],this._wwaData.objectAttribute[e][R.ATR_DEFENCE],this._wwaData.objectAttribute[e][R.ATR_GOLD]),this._wwaData.message[this._wwaData.objectAttribute[e][R.ATR_STRING]],this._wwaData.objectAttribute[e][R.ATR_ITEM],n)}hideBattleEstimateWindow(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),U(F[P.GOTO_WWA]).classList.remove(`onpress`),this._dispatchWindowClosedTimeRequests()}hidePasswordWindow(e=!1){if(this._passwordWindow.hide(),e||this._passwordWindow.mode===wr.SAVE){this._player.clearPasswordWindowWaiting(),this._dispatchWindowClosedTimeRequests();return}try{var t=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(e){this._player.clearPasswordWindowWaiting(),this._dispatchWindowClosedTimeRequests(),alert(`セーブデータの復元に失敗しました。
130
130
  エラー詳細:
131
131
  `+e.message);return}this._passwordLoadExecInNextFrame=!0,this._passwordSaveExtractData=t}_displayUserVars(){if(!this._canDisplayUserVars||!this._inlineUserVarViewer)return;let e=``;if(this._inlineUserVarViewer.isVisible=!0,this._player.isControllable()){let t=[...this._userVar.named];if(this._inlineUserVarViewer.kind===`named`)if(e=`名前つき変数一覧
132
132
  `,t.length===0)e+=`名前つき変数はありません
@@ -150,7 +150,7 @@ JSON PARSE FAILED`)}if(r.isCompress){delete r.isCompress;let[e,t]=Li.decompress(
150
150
  ZR:一時保存データの読み込み
151
151
  +: 移動速度を上げる
152
152
  -: 移動速度を落とす
153
-  WWA Wing バージョン:4.0.6
153
+  WWA Wing バージョン:4.0.8-fps-measure.based-on.4.0.7
154
154
   マップデータ バージョン: `+Math.floor(this._wwaData.version/10)+`.`+this._wwaData.version%10;break;case ne.PLAY_STATION:e=` 【操作方法】
155
155
  〇:Yes,戦闘結果予測の表示
156
156
  ×:No
@@ -163,7 +163,7 @@ OPTIONS: 移動速度を上げる
163
163
  SHARE: 移動速度を落とす
164
164
    現在の移動回数:`+this._player.getMoveCount()+`
165
165
  `+(t?`  プレイ時間:`+t+`
166
- `:``)+` WWA Wing バージョン:4.0.6
166
+ `:``)+` WWA Wing バージョン:4.0.8-fps-measure.based-on.4.0.7
167
167
   マップデータ バージョン: `+Math.floor(this._wwaData.version/10)+`.`+this._wwaData.version%10;break;case ne.XBOX:e=` 【操作方法】
168
168
  B:Yes,戦闘結果予測の表示
169
169
  A:No
@@ -176,7 +176,7 @@ MENU: 移動速度を上げる
176
176
  WINDOW: 移動速度を落とす
177
177
    現在の移動回数:`+this._player.getMoveCount()+`
178
178
  `+(t?`  プレイ時間:`+t+`
179
- `:``)+` WWA Wing バージョン:4.0.6
179
+ `:``)+` WWA Wing バージョン:4.0.8-fps-measure.based-on.4.0.7
180
180
   マップデータ バージョン: `+Math.floor(this._wwaData.version/10)+`.`+this._wwaData.version%10;break;default:return}break;case re.SP:return;case re.VR:return;case re.PC:e=` 【操作方法】
181
181
  F1、M:戦闘結果予測の表示
182
182
  F3:復帰用パスワード入力
@@ -189,12 +189,13 @@ WINDOW: 移動速度を落とす
189
189
  キーボードの「123、QWE、ASD、ZXC」は右のアイテムボックスに対応。
190
190
  「Enter、Y」はYes,
191
191
  「Esc、N」はNoに対応。
192
-    I: 移動速度を落とす/
192
+ `+(this._frameRateDisplayingPattern!==`never`&&this._frameRateDisplayingPattern!==`always`?`F:FPS表示切り替え
193
+ `:``)+`   I: 移動速度を落とす/
193
194
  F2、P: 移動速度を上げる
194
195
    現在の移動回数:`+this._player.getMoveCount()+`
195
196
  `+(t?`  プレイ時間:`+t+`
196
- `:``)+` WWA Wing バージョン:4.0.6
197
-  マップデータ バージョン: `+Math.floor(this._wwaData.version/10)+`.`+this._wwaData.version%10;break;default:return}e&&this.registerSystemMessagePage(e)}}_setNextPage(){if(this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&this._scoreWindow.hide(),this._isLastPage&&this._reservedMoveMacroTurn!==void 0&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),this._pages.length===0){let{newPageGenerated:e}=this._hideMessageWindow();e||(this.clearFaces(),this._dispatchWindowClosedTimeRequests())}else this._shouldSetNextPage=!0;this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)}_hideMessageWindow(){let e=this._player.isReadyToUseItem()?this._player.useItem():0,t=this.getObjectAttributeById(e,R.ATR_STRING);return t===0?(this._messageWindow.isVisible()&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.isManualPause()||this._player.clearWaitingMessageOrManualPause(),{newPageGenerated:!1}):(this.registerPageByMessage(this.getMessageById(t),{triggerParts:{id:e,type:j.OBJECT,position:this._player.getPosition().getPartsCoord()}}),{newPageGenerated:this._pages.length!==0})}getPlayerPositon(){return this._player.getPosition()}loadMapPartsObjectID(e){return e|=0,e<0||e>=this._wwaData.objPartsMax?0:e}loadMapPartsID(e){return e|=0,e<0||e>=this._wwaData.mapPartsMax?0:e}replaceParts(e,t,n=j.OBJECT,r=!1){var i=this._camera.getPosition().getPartsCoord(),a=r?Math.max(0,i.x):0,o=r?Math.min(this._wwaData.mapWidth-1,i.x+R.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,s=r?Math.max(0,i.y):0,c=r?Math.min(this._wwaData.mapWidth-1,i.y+R.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;r=a!==0||o!==this._wwaData.mapWidth-1||s!==0||c!==this._wwaData.mapWidth-1;var l,u,d,f,p,m,h,g;if(n===j.OBJECT)if(e=this.loadMapPartsObjectID(e),t=this.loadMapPartsObjectID(t),f=this._mapObjectIDTable[e].concat(),h=this._mapObjectIDTable[e],h.length=0,g=this._mapObjectIDTable[t],u=f.length,r)for(d=0;d<u;d++)l=f[d],p=l&Ce.BITMASK,m=l>>>Ce.BITSHIFT&Ce.BITMASK,a<=p&&p<=o&&s<=m&&m<=c?(this._wwaData.mapObject[m][p]=t,g.push(l)):h.push(l);else{for(d=0;d<u;d++)l=f[d],p=l&Ce.BITMASK,m=l>>>Ce.BITSHIFT&Ce.BITMASK,this._wwaData.mapObject[m][p]=t;Array.prototype.push.apply(g,f)}else if(e=this.loadMapPartsID(e),t=this.loadMapPartsID(t),f=this._mapIDTable[e].concat(),h=this._mapIDTable[e],h.length=0,g=this._mapIDTable[t],u=f.length,r)for(d=0;d<u;d++)l=f[d],p=l&Ce.BITMASK,m=l>>>Ce.BITSHIFT&Ce.BITMASK,a<=p&&p<=o&&s<=m&&m<=c?(this._wwaData.map[m][p]=t,g.push(l)):h.push(l);else{for(d=0;d<u;d++)l=f[d],p=l&Ce.BITMASK,m=l>>>Ce.BITSHIFT&Ce.BITMASK,this._wwaData.map[m][p]=t;Array.prototype.push.apply(g,f)}}getYesNoImgCoord(){return new S(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)}setYesNoImgCoord(e){return this._wwaData.yesnoImgPosX=e.x,this._wwaData.yesnoImgPosY=e.y,e}getPlayerImgCoord(){return new S(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)}setPlayerImgCoord(e){return this._wwaData.playerImgPosX=e.x,this._wwaData.playerImgPosY=e.y,e}setPlayerEnergyMax(e){return this._player.setEnergyMax(this.toValidStatusValue(e))}getMapPartsNum(){return this._wwaData.mapPartsMax}getObjectPartsNum(){return this._wwaData.objPartsMax}setMoveMacroWaitingToPlayer(e){this._reservedMoveMacroTurn=e}disableSave(e){return this._wwaData.disableSaveFlag=e,this._wwaSave.quickSaveButtonUpdate(this._wwaData),e}isOldMap(){return this._wwaData.isOldMap}setOldMap(e){return this._wwaData.isOldMap=e}setObjectNotCollapseOnPartsOnPlayer(e){return this._wwaData.objectNoCollapseDefaultFlag=e}setGameOverPosition(e){if(e.x<0||e.x>=this.getMapWidth()||e.y<0||e.y>=this.getMapWidth())throw Error(`マップの範囲外が指定されています!`);return this._wwaData.gameoverX=e.x,this._wwaData.gameoverY=e.y,e}getGemeOverPosition(){return new S(this._wwaData.gameoverX,this._wwaData.gameoverY)}toValidStatusValue(e){return this.isNotNumberTypeOrNaN(e)||e<0?0:Math.floor(e)}setPlayerStatus(e,t,n){if(e===ue.ENERGY){if(this._player.setEnergy(this.toValidStatusValue(t)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:n}))return this.gameover(),{isGameOver:!0}}else if(e===ue.STRENGTH)this._player.setStrength(this.toValidStatusValue(t));else if(e===ue.DEFENCE)this._player.setDefence(this.toValidStatusValue(t));else if(e===ue.GOLD)this._player.setGold(this.toValidStatusValue(t));else if(e===ue.MOVES)this._player.setMoveCount(this.toValidStatusValue(t));else throw Error(`未定義のステータスタイプです`);return{}}setDelPlayer(e){return this._wwaData.delPlayerFlag=e}setPlayerGetItem(e,t){try{this._player.addItem(t,e,!0)}catch{}}setStatusIconCoord(e,t){let n=t.x*R.CHIP_SIZE,r=t.y*R.CHIP_SIZE,i=e=>{let t=Re(`${e}>.status-icon`);t.style.backgroundPosition=`-${n}px -${r}px`};switch(e){case L.ENERGY:this._wwaData.imgStatusEnergyX=t.x,this._wwaData.imgStatusEnergyY=t.y,i(`#disp-energy`);break;case L.STRENGTH:this._wwaData.imgStatusStrengthX=t.x,this._wwaData.imgStatusStrengthY=t.y,i(`#disp-strength`);break;case L.DEFENCE:this._wwaData.imgStatusDefenceX=t.x,this._wwaData.imgStatusDefenceY=t.y,i(`#disp-defence`);break;case L.GOLD:this._wwaData.imgStatusGoldX=t.x,this._wwaData.imgStatusGoldY=t.y,i(`#disp-gold`);break;default:throw Error(`種別が不正です。`)}return t.clone()}setWideCellCoord(e){this._wwaData.imgWideCellX=e.x,this._wwaData.imgWideCellY=e.y;let t=e.x*R.CHIP_SIZE,n=e.y*R.CHIP_SIZE;return Array.prototype.forEach.call(ze(`div.wide-cell-row`),e=>{e.style.backgroundPosition=`-`+t+`px -`+n+`px`}),e.clone()}setFrameCoord(e){return this._wwaData.imgFrameX=e.x,this._wwaData.imgFrameY=e.y,this._cgManager.setFrameImage(e),e.clone()}setBattleEffectCoord(e){return this._battleEffectCoord=e.clone()}canInput(){return!this._temporaryInputDisable&&!this._cgManager.picture.isWaiting()}setEffect(e,t){this._wwaData.effectWaits=e,this._wwaData.effectCoords=t,this.updateEffect()}stopEffect(){this._wwaData.effectCoords=[],this.updateEffect()}updateEffect(){this._cgManager.updateEffects(this._wwaData.effectCoords)}updateAllPicturesCache(){this._cgManager.updateAllPicturesCache(this._isMainAnimation())}updatePicturesAnimation(){this._player.isPausing()||this._cgManager.updatePicturesAnimation(this._isMainAnimation())}setImgClick(e){if(this._wwaData.imgClickX=e.x,this._wwaData.imgClickY=e.y,e.equals(new S(0,0)))Array.prototype.forEach.call(ze(`.item-cell>.item-click-border`),e=>{e.style.backgroundImage=`url('`+R.ITEM_BORDER_IMG_DATA_URL+`')`,e.style.backgroundPosition=`0 0`});else{var t=this._wwaData.mapCGName.replace(`(`,`\\(`).replace(`)`,`\\)`);Array.prototype.forEach.call(ze(`.item-cell>.item-click-border`),n=>{n.style.backgroundImage=`url('`+t+`')`,n.style.backgroundPosition=`-`+e.x*R.CHIP_SIZE+`px -`+e.y*R.CHIP_SIZE+`px`})}}addFace(e){this._faces.push(e),this._messageWindow.setPositionByPlayerPosition(this._faces.length!==0,this._scoreWindow.isVisible(),!1,this._player.getPosition(),this._camera.getPosition())}clearFaces(){this._faces=[]}updateItemEffectEnabled(e){this._wwaData.isItemEffectEnabled=e}setOldMove(e){this._wwaData.isOldMove=e}setGameOverPolicy(e){switch(e){case 0:this._wwaData.gameOverPolicy=`default`;return;case 1:this._wwaData.gameOverPolicy=`never`;return;case 2:this._wwaData.gameOverPolicy=`except-macro`;return;default:return}}setBgmDelay(e){this._wwaData.bgmDelayDurationMs=e}setPictureRegistry(e,t,n,r,i){let a=n===j.OBJECT?this._wwaData.objectAttribute[t]:n===j.MAP?this._wwaData.mapAttribute[t]:null;if(a===null)throw Error(`対応していないパーツ番号です。`);let o=this.getMessageById(a[R.ATR_STRING]);if(!o)throw n===j.OBJECT?Error(`物体パーツ ${t} 番に対応したテキストが見つかりませんでした。`):Error(`背景パーツ ${t} 番に対応したテキストが見つかりませんでした。`);let s=this._returnEvalString(`(`+o+`)`),c=this._cgManager.picture.registerPictureFromRawRegistry({layerNumber:e,imgPosX:(a[R.ATR_X]??0)/R.CHIP_SIZE,imgPosX2:(a[R.ATR_X2]??0)/R.CHIP_SIZE,imgPosY:(a[R.ATR_Y]??0)/R.CHIP_SIZE,imgPosY2:(a[R.ATR_Y2]??0)/R.CHIP_SIZE,triggerPartsX:r.x,triggerPartsY:r.y,soundNumber:a[R.ATR_SOUND]??0,properties:d(s)},t,n,i);this._wwaData.pictureRegistry=c,this.updateAllPicturesCache()}setPictureRegistryFromRawText(e,t){let n=this._cgManager.picture.registerPictureFromRawText(e,t);this._wwaData.pictureRegistry=n,this.updateAllPicturesCache()}setPictureRegistryFromObject(e,t){let n=this._cgManager.picture.registerPictureFromObject(e,t);this._wwaData.pictureRegistry=n,this.updateAllPicturesCache()}deletePictureRegistry(e){let t=this._cgManager.picture.deletePicture(e);this._wwaData.pictureRegistry=t}clearAllPictures(){this._cgManager.picture.clearAllPictures(),this._wwaData.pictureRegistry=[]}initCSSRule(){this._styleElm=U(R.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()}updateCSSRule(){if(this._stylePos===void 0)this._stylePos=[,,];else if(this._sheet.addRule!==void 0)for(var e=0;e<this._stylePos.length;e++)this._sheet.removeRule(this._stylePos[this._styleElm[e]]);else for(var e=0;e<this._stylePos.length;e++)this._sheet.deleteRule(this._stylePos[this._styleElm[e]]);let t=`div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window`,n=this._isClassicModeEnable?1:.9,r=`
197
+ `:``)+` WWA Wing バージョン:4.0.8-fps-measure.based-on.4.0.7
198
+  マップデータ バージョン: `+Math.floor(this._wwaData.version/10)+`.`+this._wwaData.version%10;break;default:return}e&&this.registerSystemMessagePage(e)}}_setNextPage(){if(this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&this._scoreWindow.hide(),this._isLastPage&&this._reservedMoveMacroTurn!==void 0&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),this._pages.length===0){let{newPageGenerated:e}=this._hideMessageWindow();e||(this.clearFaces(),this._dispatchWindowClosedTimeRequests())}else this._shouldSetNextPage=!0;this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)}_hideMessageWindow(){let e=this._player.isReadyToUseItem()?this._player.useItem():0,t=this.getObjectAttributeById(e,R.ATR_STRING);return t===0?(this._messageWindow.isVisible()&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.isManualPause()||this._player.clearWaitingMessageOrManualPause(),{newPageGenerated:!1}):(this.registerPageByMessage(this.getMessageById(t),{triggerParts:{id:e,type:j.OBJECT,position:this._player.getPosition().getPartsCoord()}}),{newPageGenerated:this._pages.length!==0})}getPlayerPositon(){return this._player.getPosition()}loadMapPartsObjectID(e){return e|=0,e<0||e>=this._wwaData.objPartsMax?0:e}loadMapPartsID(e){return e|=0,e<0||e>=this._wwaData.mapPartsMax?0:e}replaceParts(e,t,n=j.OBJECT,r=!1){var i=this._camera.getPosition().getPartsCoord(),a=r?Math.max(0,i.x):0,o=r?Math.min(this._wwaData.mapWidth-1,i.x+R.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,s=r?Math.max(0,i.y):0,c=r?Math.min(this._wwaData.mapWidth-1,i.y+R.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;r=a!==0||o!==this._wwaData.mapWidth-1||s!==0||c!==this._wwaData.mapWidth-1;var l,u,d,f,p,m,h,g;if(n===j.OBJECT)if(e=this.loadMapPartsObjectID(e),t=this.loadMapPartsObjectID(t),f=this._mapObjectIDTable[e].concat(),h=this._mapObjectIDTable[e],h.length=0,g=this._mapObjectIDTable[t],u=f.length,r)for(d=0;d<u;d++)l=f[d],p=l&Ce.BITMASK,m=l>>>Ce.BITSHIFT&Ce.BITMASK,a<=p&&p<=o&&s<=m&&m<=c?(this._wwaData.mapObject[m][p]=t,g.push(l)):h.push(l);else{for(d=0;d<u;d++)l=f[d],p=l&Ce.BITMASK,m=l>>>Ce.BITSHIFT&Ce.BITMASK,this._wwaData.mapObject[m][p]=t;Array.prototype.push.apply(g,f)}else if(e=this.loadMapPartsID(e),t=this.loadMapPartsID(t),f=this._mapIDTable[e].concat(),h=this._mapIDTable[e],h.length=0,g=this._mapIDTable[t],u=f.length,r)for(d=0;d<u;d++)l=f[d],p=l&Ce.BITMASK,m=l>>>Ce.BITSHIFT&Ce.BITMASK,a<=p&&p<=o&&s<=m&&m<=c?(this._wwaData.map[m][p]=t,g.push(l)):h.push(l);else{for(d=0;d<u;d++)l=f[d],p=l&Ce.BITMASK,m=l>>>Ce.BITSHIFT&Ce.BITMASK,this._wwaData.map[m][p]=t;Array.prototype.push.apply(g,f)}}getYesNoImgCoord(){return new S(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)}setYesNoImgCoord(e){return this._wwaData.yesnoImgPosX=e.x,this._wwaData.yesnoImgPosY=e.y,e}getPlayerImgCoord(){return new S(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)}setPlayerImgCoord(e){return this._wwaData.playerImgPosX=e.x,this._wwaData.playerImgPosY=e.y,e}setPlayerEnergyMax(e){return this._player.setEnergyMax(this.toValidStatusValue(e))}getMapPartsNum(){return this._wwaData.mapPartsMax}getObjectPartsNum(){return this._wwaData.objPartsMax}setMoveMacroWaitingToPlayer(e){this._reservedMoveMacroTurn=e}disableSave(e){return this._wwaData.disableSaveFlag=e,this._wwaSave.quickSaveButtonUpdate(this._wwaData),e}isOldMap(){return this._wwaData.isOldMap}setOldMap(e){return this._wwaData.isOldMap=e}setObjectNotCollapseOnPartsOnPlayer(e){return this._wwaData.objectNoCollapseDefaultFlag=e}setGameOverPosition(e){if(e.x<0||e.x>=this.getMapWidth()||e.y<0||e.y>=this.getMapWidth())throw Error(`マップの範囲外が指定されています!`);return this._wwaData.gameoverX=e.x,this._wwaData.gameoverY=e.y,e}getGemeOverPosition(){return new S(this._wwaData.gameoverX,this._wwaData.gameoverY)}toValidStatusValue(e){return this.isNotNumberTypeOrNaN(e)||e<0?0:Math.floor(e)}setPlayerStatus(e,t,n){if(e===ue.ENERGY){if(this._player.setEnergy(this.toValidStatusValue(t)),this._player.isDead()&&this.shouldApplyGameOver({isAssignment:n}))return this.gameover(),{isGameOver:!0}}else if(e===ue.STRENGTH)this._player.setStrength(this.toValidStatusValue(t));else if(e===ue.DEFENCE)this._player.setDefence(this.toValidStatusValue(t));else if(e===ue.GOLD)this._player.setGold(this.toValidStatusValue(t));else if(e===ue.MOVES)this._player.setMoveCount(this.toValidStatusValue(t));else throw Error(`未定義のステータスタイプです`);return{}}setDelPlayer(e){return this._wwaData.delPlayerFlag=e}setPlayerGetItem(e,t){try{this._player.addItem(t,e,!0)}catch{}}setStatusIconCoord(e,t){let n=t.x*R.CHIP_SIZE,r=t.y*R.CHIP_SIZE,i=e=>{let t=Re(`${e}>.status-icon`);t.style.backgroundPosition=`-${n}px -${r}px`};switch(e){case L.ENERGY:this._wwaData.imgStatusEnergyX=t.x,this._wwaData.imgStatusEnergyY=t.y,i(`#disp-energy`);break;case L.STRENGTH:this._wwaData.imgStatusStrengthX=t.x,this._wwaData.imgStatusStrengthY=t.y,i(`#disp-strength`);break;case L.DEFENCE:this._wwaData.imgStatusDefenceX=t.x,this._wwaData.imgStatusDefenceY=t.y,i(`#disp-defence`);break;case L.GOLD:this._wwaData.imgStatusGoldX=t.x,this._wwaData.imgStatusGoldY=t.y,i(`#disp-gold`);break;default:throw Error(`種別が不正です。`)}return t.clone()}setWideCellCoord(e){this._wwaData.imgWideCellX=e.x,this._wwaData.imgWideCellY=e.y;let t=e.x*R.CHIP_SIZE,n=e.y*R.CHIP_SIZE;return Array.prototype.forEach.call(ze(`div.wide-cell-row`),e=>{e.style.backgroundPosition=`-`+t+`px -`+n+`px`}),e.clone()}setFrameCoord(e){return this._wwaData.imgFrameX=e.x,this._wwaData.imgFrameY=e.y,this._cgManager.setFrameImage(e),e.clone()}setBattleEffectCoord(e){return this._battleEffectCoord=e.clone()}canInput(){return!this._temporaryInputDisable&&!this._cgManager.picture.isWaiting()}setEffect(e,t){this._wwaData.effectWaits=e,this._wwaData.effectCoords=t,this.updateEffect()}stopEffect(){this._wwaData.effectCoords=[],this.updateEffect()}updateEffect(){this._cgManager.updateEffects(this._wwaData.effectCoords)}updateAllPicturesCache(){this._cgManager.updateAllPicturesCache(this._isMainAnimation())}updatePicturesAnimation(){this._player.isPausing()||this._cgManager.updatePicturesAnimation(this._isMainAnimation())}setImgClick(e){if(this._wwaData.imgClickX=e.x,this._wwaData.imgClickY=e.y,e.equals(new S(0,0)))Array.prototype.forEach.call(ze(`.item-cell>.item-click-border`),e=>{e.style.backgroundImage=`url('`+R.ITEM_BORDER_IMG_DATA_URL+`')`,e.style.backgroundPosition=`0 0`});else{var t=this._wwaData.mapCGName.replace(`(`,`\\(`).replace(`)`,`\\)`);Array.prototype.forEach.call(ze(`.item-cell>.item-click-border`),n=>{n.style.backgroundImage=`url('`+t+`')`,n.style.backgroundPosition=`-`+e.x*R.CHIP_SIZE+`px -`+e.y*R.CHIP_SIZE+`px`})}}addFace(e){this._faces.push(e),this._messageWindow.setPositionByPlayerPosition(this._faces.length!==0,this._scoreWindow.isVisible(),!1,this._player.getPosition(),this._camera.getPosition())}clearFaces(){this._faces=[]}updateItemEffectEnabled(e){this._wwaData.isItemEffectEnabled=e}setOldMove(e){this._wwaData.isOldMove=e}setGameOverPolicy(e){switch(e){case 0:this._wwaData.gameOverPolicy=`default`;return;case 1:this._wwaData.gameOverPolicy=`never`;return;case 2:this._wwaData.gameOverPolicy=`except-assignment`;return;default:return}}setBgmDelay(e){this._wwaData.bgmDelayDurationMs=e}setPictureRegistry(e,t,n,r,i){let a=n===j.OBJECT?this._wwaData.objectAttribute[t]:n===j.MAP?this._wwaData.mapAttribute[t]:null;if(a===null)throw Error(`対応していないパーツ番号です。`);let o=this.getMessageById(a[R.ATR_STRING]);if(!o)throw n===j.OBJECT?Error(`物体パーツ ${t} 番に対応したテキストが見つかりませんでした。`):Error(`背景パーツ ${t} 番に対応したテキストが見つかりませんでした。`);let s=this._returnEvalString(`(`+o+`)`),c=this._cgManager.picture.registerPictureFromRawRegistry({layerNumber:e,imgPosX:(a[R.ATR_X]??0)/R.CHIP_SIZE,imgPosX2:(a[R.ATR_X2]??0)/R.CHIP_SIZE,imgPosY:(a[R.ATR_Y]??0)/R.CHIP_SIZE,imgPosY2:(a[R.ATR_Y2]??0)/R.CHIP_SIZE,triggerPartsX:r.x,triggerPartsY:r.y,soundNumber:a[R.ATR_SOUND]??0,properties:d(s)},t,n,i);this._wwaData.pictureRegistry=c,this.updateAllPicturesCache()}setPictureRegistryFromRawText(e,t){let n=this._cgManager.picture.registerPictureFromRawText(e,t);this._wwaData.pictureRegistry=n,this.updateAllPicturesCache()}setPictureRegistryFromObject(e,t){let n=this._cgManager.picture.registerPictureFromObject(e,t);this._wwaData.pictureRegistry=n,this.updateAllPicturesCache()}deletePictureRegistry(e){let t=this._cgManager.picture.deletePicture(e);this._wwaData.pictureRegistry=t}clearAllPictures(){this._cgManager.picture.clearAllPictures(),this._wwaData.pictureRegistry=[]}initCSSRule(){this._styleElm=U(R.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()}updateCSSRule(){if(this._stylePos===void 0)this._stylePos=[,,];else if(this._sheet.addRule!==void 0)for(var e=0;e<this._stylePos.length;e++)this._sheet.removeRule(this._stylePos[this._styleElm[e]]);else for(var e=0;e<this._stylePos.length;e++)this._sheet.deleteRule(this._stylePos[this._styleElm[e]]);let t=`div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window`,n=this._isClassicModeEnable?1:.9,r=`
198
199
  background-color: rgba(${this._wwaData.frameColorR}, ${this._wwaData.frameColorG}, ${this._wwaData.frameColorB}, ${n});
199
200
  border-color: rgba(${this._wwaData.frameOutColorR}, ${this._wwaData.frameOutColorG}, ${this._wwaData.frameOutColorB}, 1);
200
201
  color: rgba(${this._wwaData.fontColorR}, ${this._wwaData.fontColorG}, ${this._wwaData.fontColorB}, 1);
@@ -202,14 +203,14 @@ white-space: pre-wrap;
202
203
  `,i=`div#wwa-sidebar`,a=`
203
204
  color: rgba(${this._wwaData.statusColorR}, ${this._wwaData.statusColorG}, ${this._wwaData.statusColorB},1);
204
205
  font-weight: bold;
205
- `;this._sheet.addRule===void 0?(this._stylePos[Se.MESSAGE_WINDOW]=this._sheet.insertRule(`${t} { ${r} }`,0),this._stylePos[Se.SIDEBAR]=this._sheet.insertRule(`${i} { ${a} }`,1)):(this._stylePos[Se.MESSAGE_WINDOW]=this._sheet.addRule(t,r),this._stylePos[Se.SIDEBAR]=this._sheet.addRule(i,a))}changeStyleRule(e,t,n,r){e===xe.COLOR_FRAME?(this._wwaData.frameColorR=t,this._wwaData.frameColorG=n,this._wwaData.frameColorB=r):e===xe.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=t,this._wwaData.frameOutColorG=n,this._wwaData.frameOutColorB=r):e===xe.COLOR_STR?(this._wwaData.fontColorR=t,this._wwaData.fontColorG=n,this._wwaData.fontColorB=r):e===xe.COLOR_STATUS_STR&&(this._wwaData.statusColorR=t,this._wwaData.statusColorG=n,this._wwaData.statusColorB=r),this.updateCSSRule()}showMonsterWindow(){this._monsterWindow.show()}isClassicMode(){return this._isClassicModeEnable}isConsoleOutputMode(){return this._useConsole}forcedJumpGate(e,t){this._player.isWaitingMessageOrManualPause()?this._windowCloseWaitingJumpGateRequest={x:e,y:t}:(this._windowCloseWaitingJumpGateRequest=void 0,this._player.jumpTo(new C(this,e,t,0,0)))}setUserVarIndecies(e,t,n=`=`){let r=this._userVar.named.get(e[0]),i=e.length-1,a=e.slice(1,i).reduce((e,t)=>Ke(e,t),r),o=t,s=e[i];if(e.length>1){switch(n){case`=`:o=t;break;case`+=`:o=Ke(a,s)+t;break;case`-=`:if(typeof t!=`number`)throw TypeError(`その演算子は利用できません: ${n}`);o=Ke(a,s)-t;break;case`*=`:if(typeof t!=`number`)throw TypeError(`その演算子は利用できません: ${n}`);o=Ke(a,s)*t;break;case`/=`:if(typeof t!=`number`)throw TypeError(`その演算子は利用できません: ${n}`);o=Ke(a,s)/t;break;default:throw TypeError(`その演算子は利用できません: ${n}`)}if(Array.isArray(a))if(typeof s==`number`)a[s]=o;else throw TypeError(`配列の添字に数字以外は使えません: ${e[i]}`);else if(typeof a==`object`&&a)qe(a,String(s),o);else if(typeof a==`string`)throw TypeError(`文字列 "${a}" の特定の文字を直接書き換えることはできません`);else qe(a,s,o);this._userVar.named.set(e[0],r)}else throw Error(`indeciesの引数が足りていません: ${e}`)}setUserVar(e,t,n){let r=(e,t)=>{if(typeof e==`number`){if(typeof t!=`number`)throw TypeError(`数字index変数への数値以外の代入は今のところできません。あらかじめご了承ください。`);this._userVar.numbered[e]=typeof t==`number`?this.toAssignableValue(t):t}else this._userVar.named.set(e,t)},i=(e=>typeof e==`number`?this._userVar.numbered[e]:this._userVar.named.get(e))(e);if(typeof t==`number`)switch(n){case`+=`:if(typeof i==`number`)r(e,i+t);else if(typeof i==`string`)r(e,String(i)+t);else throw TypeError(`boolean に number は足せません`);break;case`-=`:if(typeof i==`number`)r(e,i-t);else throw TypeError(`string/boolean から number は引けません`);break;case`*=`:if(typeof i==`number`)r(e,i*t);else throw TypeError(`string/boolean に number はかけられません`);break;case`/=`:if(typeof i==`number`)r(e,i/t);else throw TypeError(`string/boolean は number で割れません`);break;default:r(e,t);break}else if(typeof t==`string`)switch(n){case`+=`:r(e,i+t);break;case`=`:r(e,t);break;default:throw TypeError(`文字列を -=, *=, /= で複合代入することはできません`)}else switch(n){case`+=`:if(typeof i==`string`)r(e,i+t);else throw TypeError(`number/boolean に boolean を足せません`);break;case`=`:r(e,t);break;default:throw TypeError(`booleanを -=, *=, /= で複合代入することはできません`)}this._messageWindow.update()}toAssignableValue(e){let t=Math.max(Math.min(e>0?Math.floor(e):Math.ceil(e),R.USER_VAR_NUM_MAX_VALUE),R.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(t)?0:t}isValidUserVarIndex(e){return typeof e==`number`&&e>=0&&e<R.USER_VAR_NUM&&(e|0)===e}isNotNumberTypeOrNaN(e){return typeof e!=`number`||e!==e}getUserVar(e){return this._userVar.numbered[e]}getUserNameVar(e){return this._userVar.named.get(e.toString())}getAllUserNameVar(){return d(this._userVar.named)}recUserPosition(e,t){var n=this._player.getPosition().getPartsCoord();this.setUserVar(e,n.x),this.setUserVar(t,n.y)}jumpRecUserPosition(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];!We(n,`v[${e}]`)||!We(r,`v[${t}]`)||this.forcedJumpGate(n,r)}jumpSpecifiedXPos(e){let t=this._player.getPosition().getPartsCoord();this.forcedJumpGate(e,t.y)}jumpSpecifiedYPos(e){let t=this._player.getPosition().getPartsCoord();this.forcedJumpGate(t.x,e)}outputUserVar(e){console.log(`Var[`+e+`] = `+this._userVar.numbered[e])}setUserVarHP(e){this.setUserVar(e,this._player.getStatus().energy)}setUserVarHPMAX(e){this.setUserVar(e,this._player.getEnergyMax())}setUserVarAT(e,t){switch(t){case`bare`:this.setUserVar(e,this._player.getStatusWithoutEquipments().strength);return;case`equipment`:this.setUserVar(e,this._player.getStatusOfEquipments().strength);return;default:this.setUserVar(e,this._player.getStatus().strength);return}}setUserVarDF(e,t){switch(t){case`bare`:this.setUserVar(e,this._player.getStatusWithoutEquipments().defence);return;case`equipment`:this.setUserVar(e,this._player.getStatusOfEquipments().defence);return;default:this.setUserVar(e,this._player.getStatus().defence);return}}setUserVarMONEY(e){this.setUserVar(e,this._player.getStatus().gold)}setHPUserVar(e,t){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let n=this._userVar.numbered[e];if(We(n,`v[${e}]`))return this._player.setEnergy(this.toValidStatusValue(n)),this._player.updateStatusValueBox(),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:t})?(this.gameover(),{isGameOver:!0}):{}}setHPMAXUserVar(e){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let t=this._userVar.numbered[e];We(t,`v[${e}]`)&&(this._player.setEnergyMax(this.toValidStatusValue(t)),this._player.updateStatusValueBox())}setATUserVar(e){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let t=this._userVar.numbered[e];We(t,`v[${e}]`)&&(this._player.setStrength(this.toValidStatusValue(t)),this._player.updateStatusValueBox())}setDFUserVar(e){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let t=this._userVar.numbered[e];We(t,`v[${e}]`)&&(this._player.setDefence(this.toValidStatusValue(t)),this._player.updateStatusValueBox())}setMONEYUserVar(e){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let t=this._userVar.numbered[e];We(t,`v[${e}]`)&&(this._player.setGold(this.toValidStatusValue(t)),this._player.updateStatusValueBox())}setUserVarStep(e){this.setUserVar(e,this._player.getMoveCount())}setUserVarVal(e,t){this.setUserVar(e,t)}setUserValOtherUserVal(e,t){this.setUserVar(e,this._userVar.numbered[t])}setUserValAdd(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];typeof n!=`boolean`&&typeof r!=`boolean`&&this.setUserVar(e,n+r)}setUserValSub(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];We(n,`v[${e}]`)&&We(r,`v[${t}]`)&&this.setUserVar(e,n-r)}setUserValMul(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];We(n,`v[${e}]`)&&We(r,`v[${t}]`)&&this.setUserVar(e,n*r)}setUserValDiv(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];We(n,`v[${e}]`)&&We(r,`v[${t}]`)&&this.setUserVar(e,r===0?0:n/r)}setUserValMod(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];We(n,`v[${e}]`)&&We(r,`v[${t}]`)&&this.setUserVar(e,r===0?0:n%r)}setUserValRandNum(e,t,n){this.setUserVar(e,Math.floor(Math.random()*this.toAssignableValue(t))+n)}speedChangeJudge(e){this._wwaData.permitChangeGameSpeed=e}execSetMacro(e=``,t){let n=Wt(e,this.generateTokenValues(t.triggerParts)),{assignee:r,rawValue:i}=n;switch(r){case`energy`:if(this._player.setEnergy(this.toValidStatusValue(i)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:!0}))return this._player.updateStatusValueBox(),this.gameover(),{isGameOver:!0};break;case`energyMax`:this._player.setEnergyMax(this.toValidStatusValue(i));break;case`strength`:this._player.setStrength(this.toValidStatusValue(i));break;case`defence`:this._player.setDefence(this.toValidStatusValue(i));break;case`gold`:this._player.setGold(this.toValidStatusValue(i));break;case`moveCount`:this._player.setMoveCount(this.toValidStatusValue(i));break;case`variable`:if(isNaN(n.index)||!this.isValidUserVarIndex(n.index))throw Error(`ユーザ変数の添字が範囲外です。`);this.setUserVar(n.index,this.toAssignableValue(i));break;case`map`:this.appearPartsEval(t.triggerParts.position,`${n.x}`,`${n.y}`,n.rawValue,j.MAP);break;case`mapObject`:this.appearPartsEval(t.triggerParts.position,`${n.x}`,`${n.y}`,n.rawValue,j.OBJECT);break;case`item`:this.setPlayerGetItem(n.boxIndex1to12,i);break;case`playerDirection`:this._player.setDir(i);break}return this._player.updateStatusValueBox(),{}}generateTokenValues(e){return{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:this._playTimeCalculator?.calculateTimeMs()??0,userVars:this._userVar.numbered,playerCoord:this._player.getPosition().getPartsCoord(),playerDirection:this._player.getDir(),itemBox:this._player.getCopyOfItemBox(),partsId:e?.id,partsType:e?.type,partsPosition:e?.position,map:this._wwaData.map,mapObject:this._wwaData.mapObject}}userVarUserIf(e,t){if(t[5]===void 0)throw Error(`$if の引数不足 str=`+t);let n=parseInt(t[0],10),r=parseInt(t[2],10);if(!this.isValidUserVarIndex(n)||!this.isValidUserVarIndex(r))throw Error(`判定対象のユーザ変数の添字が範囲外です!`);let i=this._userVar.numbered[n],a=t[1],o=this._userVar.numbered[r];if(!We(i,`v[${n}]`)||!We(o,`v[${r}]`))return;let s=e=>parseInt(e,10)?j.MAP:j.OBJECT;if(this.compareUserVar(i,a,o)){let n=parseInt(t[3],10),r=t[4],i=t[5],a=s(t[6]);this.appearPartsEval(e,r,i,n,a);return}if(t[9]===void 0)return;let c=parseInt(t[7],10),l=t[8],u=t[9],d=s(t[10]);this.appearPartsEval(e,l,u,c,d)}compareUserVar(e,t,n){switch(t){case`==`:return e===n;case`!=`:return e!==n;case`>=`:return e>=n;case`>`:return e>n;case`<=`:return e<=n;case`<`:return e<n;default:throw Error(`未定義の演算子です: ${t}`)}}setPlayerSpeedIndex(e){if(e<R.MIN_SPEED_INDEX||R.MAX_SPEED_INDEX<e)throw Error(`#set_speed の引数が異常です:`+e);if(this._player.isMoving()){this._playerAndObjectsStopWaitingGameSpeedChangeRequest={speedIndex:e};return}this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(e),this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0}setUserVarPlayTime(e){this.setUserVar(e,this._playTimeCalculator?.calculateTimeMs()??0)}hideStatus(e,t){if(e<0||e>pe.length)throw Error(`隠すパラメータは0から3の間で指定してください。`);this._changeStatusVisibility(pe[e],!t),this._player.updateStatusValueBox()}varMap(e,t,n,r,i){if(!this.isValidUserVarIndex(r))throw Error(`対象のユーザ変数の添字が範囲外です`);let a=this._userVar.numbered[r];if(typeof a!=`number`)throw Error(`数値でないパーツ番号は指定できません`);if(a<0)throw Error(`負のパーツ番号は指定できません`);if(i===j.OBJECT&&a>=this.getObjectPartsNum())throw Error(`物体パーツ番号の最大値を超えるパーツ番号が指定されました`);if(i===j.MAP&&a>=this.getMapPartsNum())throw Error(`背景パーツ番号の最大値を超えるパーツ番号が指定されました`);this.appearPartsEval(e,t,n,a,i)}setItemboxBackgroundPosition(e){this._wwaData.imgItemboxX=e.x,this._wwaData.imgItemboxY=e.y,Array.prototype.forEach.call(ze(`div.item-cell`),t=>{t.style.backgroundPosition=`-${e.x*R.CHIP_SIZE}px -${e.y*R.CHIP_SIZE}px`})}_getVirtualPadButton(e){if(!ke.includes(e))throw ReferenceError(`WWAの仮想パッド ${e} は存在しません。`);return this._virtualPadButtonElements[e]}_setVirtualPadTouch(e){this._getVirtualPadButton(e).classList.add(`wwa-virtualpad__button--pressed`)}_setVirtualPadLeave(e){this._getVirtualPadButton(e).classList.remove(`wwa-virtualpad__button--pressed`)}_actionGamePadButtonItemMacro(){if(!this._wwaData.gamePadButtonItemTable)return!1;var e=this._wwaData.gamePadButtonItemTable.length,t,n,r;for(t=0;t<e;t++)if(n=this._wwaData.gamePadButtonItemTable[t],n){switch(r=!1,t){case H.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_LEFT)&&(r=!0);break;case H.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_RIGHT)&&(r=!0);break;case H.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_UP)&&(r=!0);break;case H.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_DOWN)&&(r=!0);break}if(this._gamePadStore.buttonTrigger(t)&&(r=!0),r&&this.onselectitem(n))return!0}return!1}setGamePadButtonItemTable(e,t){if(!this._wwaData.gamePadButtonItemTable){var n,r;for(r in this._wwaData.gamePadButtonItemTable=[],H)n=r,this._wwaData.gamePadButtonItemTable[n]=0}this._wwaData.gamePadButtonItemTable.length>e&&(this._wwaData.gamePadButtonItemTable[e]=t)}_checkSaveDataCompatibility(e,t,n){return e!==void 0&&e!==this._wwaData.worldName?Ji.UNMATCHED_WORLD_NAME:n&&n!==qi(this._wwaData.worldName,this._wwaData.worldPassNumber)?Ji.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&t!==this.checkOriginalMapString?Ji.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null}isVisibleStatus(e){switch(e){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 Error(`存在しないステータスが与えられました`)}}_changeStatusVisibility(e,t){switch(e){case`energy`:this._wwaData.isVisibleStatusEnergy=t;return;case`strength`:this._wwaData.isVisibleStatusStrength=t;return;case`defence`:this._wwaData.isVisibleStatusDefence=t;return;case`gold`:this._wwaData.isVisibleStatusGold=t;return;default:throw Error(`存在しないステータスが与えられました`)}}shouldApplyGameOver({isCalledByMacro:e}){return e?this._wwaData.gameOverPolicy==="default":this._wwaData.gameOverPolicy==="default"||this._wwaData.gameOverPolicy===`except-macro`}getEnemyStatus(){return this._monster?this._monster.status:-1}setEnemyStatus(e){if(this._monster)this._monster.setStatus(e);else throw Error(`敵が存在しません`)}getGameStatus(){return{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:this._playTimeCalculator?.calculateTimeMs()??0,userVars:this._userVar.numbered,playerCoord:this._player.getPosition().getPartsCoord(),playerDirection:this._player.getDir(),cameraCoord:this._camera.getPosition().getPartsCoord(),itemBox:this._player.getCopyOfItemBox(),gameSpeedIndex:this._player.getSpeedIndex(),wwaData:this._wwaData}}_debugEvalString(){try{let e=this._debugConsoleElement.querySelector(`.console-text-area`);if(!(e instanceof HTMLTextAreaElement))throw Error(`要素 #wwa-debug-console > .console-text-area が textarea 要素でありません`);this._execEvalString(e.value)}catch(e){console.error(e),this.registerSystemMessagePage(`解析中にエラーが発生しました :
206
+ `;this._sheet.addRule===void 0?(this._stylePos[Se.MESSAGE_WINDOW]=this._sheet.insertRule(`${t} { ${r} }`,0),this._stylePos[Se.SIDEBAR]=this._sheet.insertRule(`${i} { ${a} }`,1)):(this._stylePos[Se.MESSAGE_WINDOW]=this._sheet.addRule(t,r),this._stylePos[Se.SIDEBAR]=this._sheet.addRule(i,a))}changeStyleRule(e,t,n,r){e===xe.COLOR_FRAME?(this._wwaData.frameColorR=t,this._wwaData.frameColorG=n,this._wwaData.frameColorB=r):e===xe.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=t,this._wwaData.frameOutColorG=n,this._wwaData.frameOutColorB=r):e===xe.COLOR_STR?(this._wwaData.fontColorR=t,this._wwaData.fontColorG=n,this._wwaData.fontColorB=r):e===xe.COLOR_STATUS_STR&&(this._wwaData.statusColorR=t,this._wwaData.statusColorG=n,this._wwaData.statusColorB=r),this.updateCSSRule()}showMonsterWindow(){this._monsterWindow.show()}isClassicMode(){return this._isClassicModeEnable}isConsoleOutputMode(){return this._useConsole}forcedJumpGate(e,t){this._player.isWaitingMessageOrManualPause()?this._windowCloseWaitingJumpGateRequest={x:e,y:t}:(this._windowCloseWaitingJumpGateRequest=void 0,this._player.jumpTo(new C(this,e,t,0,0)))}setUserVarIndecies(e,t,n=`=`){let r=this._userVar.named.get(e[0]),i=e.length-1,a=e.slice(1,i).reduce((e,t)=>Ke(e,t),r),o=t,s=e[i];if(e.length>1){switch(n){case`=`:o=t;break;case`+=`:o=Ke(a,s)+t;break;case`-=`:if(typeof t!=`number`)throw TypeError(`その演算子は利用できません: ${n}`);o=Ke(a,s)-t;break;case`*=`:if(typeof t!=`number`)throw TypeError(`その演算子は利用できません: ${n}`);o=Ke(a,s)*t;break;case`/=`:if(typeof t!=`number`)throw TypeError(`その演算子は利用できません: ${n}`);o=Ke(a,s)/t;break;default:throw TypeError(`その演算子は利用できません: ${n}`)}if(Array.isArray(a))if(typeof s==`number`)a[s]=o;else throw TypeError(`配列の添字に数字以外は使えません: ${e[i]}`);else if(typeof a==`object`&&a)qe(a,String(s),o);else if(typeof a==`string`)throw TypeError(`文字列 "${a}" の特定の文字を直接書き換えることはできません`);else qe(a,s,o);this._userVar.named.set(e[0],r)}else throw Error(`indeciesの引数が足りていません: ${e}`)}setUserVar(e,t,n){let r=(e,t)=>{if(typeof e==`number`){if(typeof t!=`number`)throw TypeError(`数字index変数への数値以外の代入は今のところできません。あらかじめご了承ください。`);this._userVar.numbered[e]=typeof t==`number`?this.toAssignableValue(t):t}else this._userVar.named.set(e,t)},i=(e=>typeof e==`number`?this._userVar.numbered[e]:this._userVar.named.get(e))(e);if(typeof t==`number`)switch(n){case`+=`:if(typeof i==`number`)r(e,i+t);else if(typeof i==`string`)r(e,String(i)+t);else throw TypeError(`boolean に number は足せません`);break;case`-=`:if(typeof i==`number`)r(e,i-t);else throw TypeError(`string/boolean から number は引けません`);break;case`*=`:if(typeof i==`number`)r(e,i*t);else throw TypeError(`string/boolean に number はかけられません`);break;case`/=`:if(typeof i==`number`)r(e,i/t);else throw TypeError(`string/boolean は number で割れません`);break;default:r(e,t);break}else if(typeof t==`string`)switch(n){case`+=`:r(e,i+t);break;case`=`:r(e,t);break;default:throw TypeError(`文字列を -=, *=, /= で複合代入することはできません`)}else switch(n){case`+=`:if(typeof i==`string`)r(e,i+t);else throw TypeError(`number/boolean に boolean を足せません`);break;case`=`:r(e,t);break;default:throw TypeError(`booleanを -=, *=, /= で複合代入することはできません`)}this._messageWindow.update()}toAssignableValue(e){let t=Math.max(Math.min(e>0?Math.floor(e):Math.ceil(e),R.USER_VAR_NUM_MAX_VALUE),R.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(t)?0:t}isValidUserVarIndex(e){return typeof e==`number`&&e>=0&&e<R.USER_VAR_NUM&&(e|0)===e}isNotNumberTypeOrNaN(e){return typeof e!=`number`||e!==e}getUserVar(e){return this._userVar.numbered[e]}getUserNameVar(e){return this._userVar.named.get(e.toString())}getAllUserNameVar(){return d(this._userVar.named)}recUserPosition(e,t){var n=this._player.getPosition().getPartsCoord();this.setUserVar(e,n.x),this.setUserVar(t,n.y)}jumpRecUserPosition(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];!We(n,`v[${e}]`)||!We(r,`v[${t}]`)||this.forcedJumpGate(n,r)}jumpSpecifiedXPos(e){let t=this._player.getPosition().getPartsCoord();this.forcedJumpGate(e,t.y)}jumpSpecifiedYPos(e){let t=this._player.getPosition().getPartsCoord();this.forcedJumpGate(t.x,e)}outputUserVar(e){console.log(`Var[`+e+`] = `+this._userVar.numbered[e])}setUserVarHP(e){this.setUserVar(e,this._player.getStatus().energy)}setUserVarHPMAX(e){this.setUserVar(e,this._player.getEnergyMax())}setUserVarAT(e,t){switch(t){case`bare`:this.setUserVar(e,this._player.getStatusWithoutEquipments().strength);return;case`equipment`:this.setUserVar(e,this._player.getStatusOfEquipments().strength);return;default:this.setUserVar(e,this._player.getStatus().strength);return}}setUserVarDF(e,t){switch(t){case`bare`:this.setUserVar(e,this._player.getStatusWithoutEquipments().defence);return;case`equipment`:this.setUserVar(e,this._player.getStatusOfEquipments().defence);return;default:this.setUserVar(e,this._player.getStatus().defence);return}}setUserVarMONEY(e){this.setUserVar(e,this._player.getStatus().gold)}setHPUserVar(e,t){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let n=this._userVar.numbered[e];if(We(n,`v[${e}]`))return this._player.setEnergy(this.toValidStatusValue(n)),this._player.updateStatusValueBox(),this._player.isDead()&&this.shouldApplyGameOver({isAssignment:t})?(this.gameover(),{isGameOver:!0}):{}}setHPMAXUserVar(e){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let t=this._userVar.numbered[e];We(t,`v[${e}]`)&&(this._player.setEnergyMax(this.toValidStatusValue(t)),this._player.updateStatusValueBox())}setATUserVar(e){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let t=this._userVar.numbered[e];We(t,`v[${e}]`)&&(this._player.setStrength(this.toValidStatusValue(t)),this._player.updateStatusValueBox())}setDFUserVar(e){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let t=this._userVar.numbered[e];We(t,`v[${e}]`)&&(this._player.setDefence(this.toValidStatusValue(t)),this._player.updateStatusValueBox())}setMONEYUserVar(e){if(!this.isValidUserVarIndex(e))throw Error(`ユーザ変数の添字が範囲外です。`);let t=this._userVar.numbered[e];We(t,`v[${e}]`)&&(this._player.setGold(this.toValidStatusValue(t)),this._player.updateStatusValueBox())}setUserVarStep(e){this.setUserVar(e,this._player.getMoveCount())}setUserVarVal(e,t){this.setUserVar(e,t)}setUserValOtherUserVal(e,t){this.setUserVar(e,this._userVar.numbered[t])}setUserValAdd(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];typeof n!=`boolean`&&typeof r!=`boolean`&&this.setUserVar(e,n+r)}setUserValSub(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];We(n,`v[${e}]`)&&We(r,`v[${t}]`)&&this.setUserVar(e,n-r)}setUserValMul(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];We(n,`v[${e}]`)&&We(r,`v[${t}]`)&&this.setUserVar(e,n*r)}setUserValDiv(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];We(n,`v[${e}]`)&&We(r,`v[${t}]`)&&this.setUserVar(e,r===0?0:n/r)}setUserValMod(e,t){let n=this._userVar.numbered[e],r=this._userVar.numbered[t];We(n,`v[${e}]`)&&We(r,`v[${t}]`)&&this.setUserVar(e,r===0?0:n%r)}setUserValRandNum(e,t,n){this.setUserVar(e,Math.floor(Math.random()*this.toAssignableValue(t))+n)}speedChangeJudge(e){this._wwaData.permitChangeGameSpeed=e}execSetMacro(e=``,t){let n=Wt(e,this.generateTokenValues(t.triggerParts)),{assignee:r,rawValue:i}=n;switch(r){case`energy`:if(this._player.setEnergy(this.toValidStatusValue(i)),this._player.isDead()&&this.shouldApplyGameOver({isAssignment:!0}))return this._player.updateStatusValueBox(),this.gameover(),{isGameOver:!0};break;case`energyMax`:this._player.setEnergyMax(this.toValidStatusValue(i));break;case`strength`:this._player.setStrength(this.toValidStatusValue(i));break;case`defence`:this._player.setDefence(this.toValidStatusValue(i));break;case`gold`:this._player.setGold(this.toValidStatusValue(i));break;case`moveCount`:this._player.setMoveCount(this.toValidStatusValue(i));break;case`variable`:if(isNaN(n.index)||!this.isValidUserVarIndex(n.index))throw Error(`ユーザ変数の添字が範囲外です。`);this.setUserVar(n.index,this.toAssignableValue(i));break;case`map`:this.appearPartsEval(t.triggerParts.position,`${n.x}`,`${n.y}`,n.rawValue,j.MAP);break;case`mapObject`:this.appearPartsEval(t.triggerParts.position,`${n.x}`,`${n.y}`,n.rawValue,j.OBJECT);break;case`item`:this.setPlayerGetItem(n.boxIndex1to12,i);break;case`playerDirection`:this._player.setDir(i);break}return this._player.updateStatusValueBox(),{}}generateTokenValues(e){return{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:this._playTimeCalculator?.calculateTimeMs()??0,userVars:this._userVar.numbered,playerCoord:this._player.getPosition().getPartsCoord(),playerDirection:this._player.getDir(),itemBox:this._player.getCopyOfItemBox(),partsId:e?.id,partsType:e?.type,partsPosition:e?.position,map:this._wwaData.map,mapObject:this._wwaData.mapObject}}userVarUserIf(e,t){if(t[5]===void 0)throw Error(`$if の引数不足 str=`+t);let n=parseInt(t[0],10),r=parseInt(t[2],10);if(!this.isValidUserVarIndex(n)||!this.isValidUserVarIndex(r))throw Error(`判定対象のユーザ変数の添字が範囲外です!`);let i=this._userVar.numbered[n],a=t[1],o=this._userVar.numbered[r];if(!We(i,`v[${n}]`)||!We(o,`v[${r}]`))return;let s=e=>parseInt(e,10)?j.MAP:j.OBJECT;if(this.compareUserVar(i,a,o)){let n=parseInt(t[3],10),r=t[4],i=t[5],a=s(t[6]);this.appearPartsEval(e,r,i,n,a);return}if(t[9]===void 0)return;let c=parseInt(t[7],10),l=t[8],u=t[9],d=s(t[10]);this.appearPartsEval(e,l,u,c,d)}compareUserVar(e,t,n){switch(t){case`==`:return e===n;case`!=`:return e!==n;case`>=`:return e>=n;case`>`:return e>n;case`<=`:return e<=n;case`<`:return e<n;default:throw Error(`未定義の演算子です: ${t}`)}}setPlayerSpeedIndex(e){if(e<R.MIN_SPEED_INDEX||R.MAX_SPEED_INDEX<e)throw Error(`#set_speed の引数が異常です:`+e);if(this._player.isMoving()){this._playerAndObjectsStopWaitingGameSpeedChangeRequest={speedIndex:e};return}this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(e),this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0}setUserVarPlayTime(e){this.setUserVar(e,this._playTimeCalculator?.calculateTimeMs()??0)}hideStatus(e,t){if(e<0||e>pe.length)throw Error(`隠すパラメータは0から3の間で指定してください。`);this._changeStatusVisibility(pe[e],!t),this._player.updateStatusValueBox()}varMap(e,t,n,r,i){if(!this.isValidUserVarIndex(r))throw Error(`対象のユーザ変数の添字が範囲外です`);let a=this._userVar.numbered[r];if(typeof a!=`number`)throw Error(`数値でないパーツ番号は指定できません`);if(a<0)throw Error(`負のパーツ番号は指定できません`);if(i===j.OBJECT&&a>=this.getObjectPartsNum())throw Error(`物体パーツ番号の最大値を超えるパーツ番号が指定されました`);if(i===j.MAP&&a>=this.getMapPartsNum())throw Error(`背景パーツ番号の最大値を超えるパーツ番号が指定されました`);this.appearPartsEval(e,t,n,a,i)}setItemboxBackgroundPosition(e){this._wwaData.imgItemboxX=e.x,this._wwaData.imgItemboxY=e.y,Array.prototype.forEach.call(ze(`div.item-cell`),t=>{t.style.backgroundPosition=`-${e.x*R.CHIP_SIZE}px -${e.y*R.CHIP_SIZE}px`})}_getVirtualPadButton(e){if(!ke.includes(e))throw ReferenceError(`WWAの仮想パッド ${e} は存在しません。`);return this._virtualPadButtonElements[e]}_setVirtualPadTouch(e){this._getVirtualPadButton(e).classList.add(`wwa-virtualpad__button--pressed`)}_setVirtualPadLeave(e){this._getVirtualPadButton(e).classList.remove(`wwa-virtualpad__button--pressed`)}_actionGamePadButtonItemMacro(){if(!this._wwaData.gamePadButtonItemTable)return!1;var e=this._wwaData.gamePadButtonItemTable.length,t,n,r;for(t=0;t<e;t++)if(n=this._wwaData.gamePadButtonItemTable[t],n){switch(r=!1,t){case H.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_LEFT)&&(r=!0);break;case H.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_RIGHT)&&(r=!0);break;case H.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_UP)&&(r=!0);break;case H.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(H.BUTTON_CROSS_KEY_DOWN)&&(r=!0);break}if(this._gamePadStore.buttonTrigger(t)&&(r=!0),r&&this.onselectitem(n))return!0}return!1}setGamePadButtonItemTable(e,t){if(!this._wwaData.gamePadButtonItemTable){var n,r;for(r in this._wwaData.gamePadButtonItemTable=[],H)n=r,this._wwaData.gamePadButtonItemTable[n]=0}this._wwaData.gamePadButtonItemTable.length>e&&(this._wwaData.gamePadButtonItemTable[e]=t)}_checkSaveDataCompatibility(e,t,n){return e!==void 0&&e!==this._wwaData.worldName?Yi.UNMATCHED_WORLD_NAME:n&&n!==Ji(this._wwaData.worldName,this._wwaData.worldPassNumber)?Yi.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&t!==this.checkOriginalMapString?Yi.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null}isVisibleStatus(e){switch(e){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 Error(`存在しないステータスが与えられました`)}}_changeStatusVisibility(e,t){switch(e){case`energy`:this._wwaData.isVisibleStatusEnergy=t;return;case`strength`:this._wwaData.isVisibleStatusStrength=t;return;case`defence`:this._wwaData.isVisibleStatusDefence=t;return;case`gold`:this._wwaData.isVisibleStatusGold=t;return;default:throw Error(`存在しないステータスが与えられました`)}}shouldApplyGameOver({isAssignment:e}){return e?this._wwaData.gameOverPolicy==="default":this._wwaData.gameOverPolicy==="default"||this._wwaData.gameOverPolicy===`except-assignment`}getEnemyStatus(){return this._monster?this._monster.status:-1}setEnemyStatus(e){if(this._monster)this._monster.setStatus(e);else throw Error(`敵が存在しません`)}getGameStatus(){return{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:this._playTimeCalculator?.calculateTimeMs()??0,userVars:this._userVar.numbered,playerCoord:this._player.getPosition().getPartsCoord(),playerDirection:this._player.getDir(),cameraCoord:this._camera.getPosition().getPartsCoord(),itemBox:this._player.getCopyOfItemBox(),gameSpeedIndex:this._player.getSpeedIndex(),wwaData:this._wwaData}}_debugEvalString(){try{let e=this._debugConsoleElement.querySelector(`.console-text-area`);if(!(e instanceof HTMLTextAreaElement))throw Error(`要素 #wwa-debug-console > .console-text-area が textarea 要素でありません`);this._execEvalString(e.value)}catch(e){console.error(e),this.registerSystemMessagePage(`解析中にエラーが発生しました :
206
207
  `+e.message)}}_execEvalString(e,t){try{let n=this.convertWwaNodes(e);t&&this.evalCalcWwaNodeGenerator.setTriggerParts(t.id,t.type,t.position),this.evalCalcWwaNodeGenerator.evalWwaNodes(n),this.evalCalcWwaNodeGenerator.clearTemporaryState()}catch(e){console.error(e),this.registerSystemMessagePage(`解析中にエラーが発生しました :
207
- `+e.message)}}_returnEvalString(e){try{let t=$(Ms(`(`+e+`)`));return this.evalCalcWwaNodeGenerator.evalWwaNode(t)}catch(e){console.error(e),this.registerSystemMessagePage(`解析中にエラーが発生しました :
208
+ `+e.message)}}_returnEvalString(e){try{let t=$(Ps(`(`+e+`)`));return this.evalCalcWwaNodeGenerator.evalWwaNode(t).value}catch(e){console.error(e),this.registerSystemMessagePage(`解析中にエラーが発生しました :
208
209
  `+e.message,!1)}}movePlayer(e){this._player.controll(e)}isPlayerWaitingMessage(){return this._player.isWaitingMessageOrManualPause()}isManualPause(){return this._player.isManualPause()}_loadSystemMessage(e){if(this._wwaData.customSystemMessages[e])return this._wwaData.customSystemMessages[e];let t=_[e];if(t.mapdataParams)switch(t.mapdataParams.messageArea){case`message`:{let e=this._wwaData.message[t.mapdataParams.index];return e===``?t.defaultText:e}case`systemMessage`:{let e=this._wwaData.systemMessage[t.mapdataParams.index];return e===``?t.defaultText:e}default:throw Error(`システムエラー: システムメッセージの設定がおかしいようです`)}return t.defaultText}resolveSystemMessage(e){let t=this._loadSystemMessage(e);switch(e){case g.ITEM_SELECT_TUTORIAL:return t.replaceAll(`%HOW_TO_USE_ITEM%`,(()=>{switch(this.userDevice.device){case re.PC:return`右のボックスを選択する`;case re.VR:return`右のボックスをクリックする`;case re.SP:return`右のボックスをタップする`;case re.GAME:switch(this.userDevice.os){case ne.NINTENDO:return`Xボタンを押すか、右のボックスをタップする`;case ne.PLAY_STATION:return`△ボタンを押す`;case ne.XBOX:return`Yボタンを押す`;default:return`右のボックスを選択する`}default:return`右のボックスを選択する`}})());case g.GAME_SPEED_CHANGED:{let e=this._player.getSpeedIndex();return t.replaceAll(`%GAME_SPEED_NAME%`,fe[e]).replaceAll(`%HIGH_SPEED_MESSAGE%`,this.isBattleSpeedIndexForQuickBattle(e)?`戦闘も速くなります。
209
- `:``).replaceAll(`%MAX_SPEED_INDEX%`,String(R.MAX_SPEED_INDEX+1)).replaceAll(`%GAME_SPEED_INDEX%`,String(e+1)).replaceAll(`%SPEED_UP_BUTTON%`,this.userDevice.os===ne.NINTENDO?`+ボタン`:`Pキー`).replaceAll(`%SPEED_DOWN_BUTTON%`,this.userDevice.os===ne.NINTENDO?`-ボタン`:`Iキー`)}default:return t}}overwriteSystemMessage(e,t){this._wwaData.customSystemMessages[e]=t}manualPause(e){this._player.setManualPause(e)}},_c=!1;function vc(e,t){if(e===null)return;let n=document.createElement(`button`);n.classList.add(`wwa-virtualpad-toggle-button`),n.textContent=`仮想パッド表示切り替え`,n.addEventListener(`click`,t),e.appendChild(n)}function yc(e){if(e===null)return;let t=document.createElement(`section`);t.setAttribute(`id`,`wwa-debug-console`);let n=document.createElement(`textarea`);n.setAttribute(`rows`,`10`),n.setAttribute(`cols`,`60`),n.textContent=`v["money"] = 100;
210
+ `:``).replaceAll(`%MAX_SPEED_INDEX%`,String(R.MAX_SPEED_INDEX+1)).replaceAll(`%GAME_SPEED_INDEX%`,String(e+1)).replaceAll(`%SPEED_UP_BUTTON%`,this.userDevice.os===ne.NINTENDO?`+ボタン`:`Pキー`).replaceAll(`%SPEED_DOWN_BUTTON%`,this.userDevice.os===ne.NINTENDO?`-ボタン`:`Iキー`)}default:return t}}overwriteSystemMessage(e,t){this._wwaData.customSystemMessages[e]=t}manualPause(e,t=!1){this._player.setManualPause(e,t)}cancelManualPause(){this._player.clearWaitingMessageOrManualPause()}},yc=!1;function bc(e,t){if(e===null)return;let n=document.createElement(`button`);n.classList.add(`wwa-virtualpad-toggle-button`),n.textContent=`仮想パッド表示切り替え`,n.addEventListener(`click`,t),e.appendChild(n)}function xc(e){if(e===null)return;let t=document.createElement(`section`);t.setAttribute(`id`,`wwa-debug-console`);let n=document.createElement(`textarea`);n.setAttribute(`rows`,`10`),n.setAttribute(`cols`,`60`),n.textContent=`v["money"] = 100;
210
211
  v["name"] = "ヤツロウ";
211
212
  MSG(v["name"]+"「俺の所持金は"+v["money"]+"ゴールドだ」");
212
213
  for(LP[0]=0; LP[0]<2; LP[0]++) {
213
214
  LOG(LP);
214
- }`;let r=e=>e.stopPropagation();n.addEventListener(`keydown`,r),n.addEventListener(`keypress`,r),n.addEventListener(`keyup`,r),n.classList.add(`console-text-area`),t.appendChild(n);let i=document.createElement(`button`);return i.classList.add(`script-running-button`),i.textContent=`実行(X)`,t.appendChild(i),e.appendChild(t),t}function bc(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i)){alert(`このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。
215
- ご利用の環境のサポートは、既に終了しています。`);return}Array.prototype.forEach.call(ze(`a.wwa-copyright`),e=>{e.addEventListener(`click`,()=>{_c=!0})}),window.addEventListener(`beforeunload`,e=>{var t=`このページを離れますか?`;if(_c)return _c=!1,e.returnValue=t,t});let e=U(`wwa-wrapper`).getAttribute(`data-wwa-title-img`),t=U(`wwa-wrapper`).getAttribute(`data-wwa-virtualpad-enable`),n=t!==null&&t.match(/^true$/i)!==null;kr(U(`wwa-wrapper`),e,n);var r=U(`wwa-wrapper`).getAttribute(`data-wwa-mapdata`),i=U(`wwa-wrapper`).getAttribute(`data-wwa-audio-dir`),a=U(`wwa-wrapper`).getAttribute(`data-wwa-var-dump-elm`);let o=null;var s=U(`wwa-wrapper`).getAttribute(`data-wwa-display-user-vars`)===`true`,c=U(`wwa-wrapper`).getAttribute(`data-wwa-user-var-names-file`);U(`wwa-wrapper`).hasAttribute(`data-wwa-var-dump-elm`)&&s&&(o=fc(a));var l=!0;U(`wwa-wrapper`).getAttribute(`data-wwa-urlgate-enable`).match(/^false$/i)&&(l=!1);var u=U(`wwa-wrapper`).getAttribute(`data-wwa-classic-mode-enable`),d=!1;u!==null&&u.match(/^true$/i)&&(d=!0);var f=!0,p=U(`wwa-wrapper`).getAttribute(`data-wwa-item-effect-enable`);p!==null&&p.match(/^false$/i)&&(f=!1);let m=!1,h=U(`wwa-wrapper`).getAttribute(`data-wwa-use-go-to-wwa`);h!==null&&h.match(/^true$/i)&&(m=!0);let g=U(`wwa-wrapper`).getAttribute(`data-wwa-virtualpad-viewport-fit-enable`);Or()&&g!==null&&g.match(/^true$/i)&&(Ne(),window.addEventListener(`resize`,Pe));let _=U(`wwa-wrapper`).getAttribute(`data-wwa-virtualpad-controller-elm`),v=n&&_?Re(_):null,y=U(`wwa-wrapper`).getAttribute(`data-wwa-picture-image-names-file`),b=(()=>{let e=U(`wwa-wrapper`).getAttribute(`data-wwa-disallow-load-old-save`);return!!(e!==null&&e.match(/^true$/i))})(),x=U(`wwa-wrapper`).getAttribute(`data-wwa-user-defined-scripts-file`);mc=new gc({mapdata:r,urlGateEnable:l,titleImg:e??void 0,audioDir:i,classicModeEnable:d,itemEffectEnable:f,useGoToWwa:m,disallowLoadOldSave:b,varDump:o,userVarNamesFile:c,displayUserVars:s,virtualPadEnable:n,virtualPadControllerElm:v,userDefinedScriptsFile:x,pictureImageNamesFile:y})}return document.readyState===`complete`?setTimeout(bc):window.addEventListener(`load`,function(){setTimeout(bc)}),e.WWA=gc,e.getProgress=hc,e})({});
215
+ }`;let r=e=>e.stopPropagation();n.addEventListener(`keydown`,r),n.addEventListener(`keypress`,r),n.addEventListener(`keyup`,r),n.classList.add(`console-text-area`),t.appendChild(n);let i=document.createElement(`button`);return i.classList.add(`script-running-button`),i.textContent=`実行(X)`,t.appendChild(i),e.appendChild(t),t}function Sc(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i)){alert(`このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。
216
+ ご利用の環境のサポートは、既に終了しています。`);return}Array.prototype.forEach.call(ze(`a.wwa-copyright`),e=>{e.addEventListener(`click`,()=>{yc=!0})}),window.addEventListener(`beforeunload`,e=>{var t=`このページを離れますか?`;if(yc)return yc=!1,e.returnValue=t,t});let e=U(`wwa-wrapper`).getAttribute(`data-wwa-title-img`),t=U(`wwa-wrapper`).getAttribute(`data-wwa-virtualpad-enable`),n=t!==null&&t.match(/^true$/i)!==null;Ar(U(`wwa-wrapper`),e,n);var r=U(`wwa-wrapper`).getAttribute(`data-wwa-mapdata`),i=U(`wwa-wrapper`).getAttribute(`data-wwa-audio-dir`),a=U(`wwa-wrapper`).getAttribute(`data-wwa-var-dump-elm`);let o=null;var s=U(`wwa-wrapper`).getAttribute(`data-wwa-display-user-vars`)===`true`,c=U(`wwa-wrapper`).getAttribute(`data-wwa-user-var-names-file`);U(`wwa-wrapper`).hasAttribute(`data-wwa-var-dump-elm`)&&s&&(o=mc(a));var l=!0;U(`wwa-wrapper`).getAttribute(`data-wwa-urlgate-enable`).match(/^false$/i)&&(l=!1);var u=U(`wwa-wrapper`).getAttribute(`data-wwa-classic-mode-enable`),d=!1;u!==null&&u.match(/^true$/i)&&(d=!0);var f=!0,p=U(`wwa-wrapper`).getAttribute(`data-wwa-item-effect-enable`);p!==null&&p.match(/^false$/i)&&(f=!1);let m=!1,h=U(`wwa-wrapper`).getAttribute(`data-wwa-use-go-to-wwa`);h!==null&&h.match(/^true$/i)&&(m=!0);let g=U(`wwa-wrapper`).getAttribute(`data-wwa-virtualpad-viewport-fit-enable`);kr()&&g!==null&&g.match(/^true$/i)&&(Ne(),window.addEventListener(`resize`,Pe));let _=U(`wwa-wrapper`).getAttribute(`data-wwa-virtualpad-controller-elm`),v=n&&_?Re(_):null,y=U(`wwa-wrapper`).getAttribute(`data-wwa-picture-image-names-file`),b=(()=>{let e=U(`wwa-wrapper`).getAttribute(`data-wwa-disallow-load-old-save`);return!!(e!==null&&e.match(/^true$/i))})(),x=U(`wwa-wrapper`).getAttribute(`data-wwa-user-defined-scripts-file`),S=U(`wwa-wrapper`).getAttribute(`data-wwa-frame-rate-displaying-pattern`)??`default-off`,C;S!==`default-off`&&S!==`default-on`&&S!==`always`&&S!==`never`?(console.warn(`data-wwa-frame-rate-displaying-pattern の値が不正です。default-off に設定します。`),C=`default-off`):C=S,gc=new vc({mapdata:r,urlGateEnable:l,titleImg:e??void 0,audioDir:i,classicModeEnable:d,itemEffectEnable:f,useGoToWwa:m,disallowLoadOldSave:b,varDump:o,userVarNamesFile:c,displayUserVars:s,virtualPadEnable:n,virtualPadControllerElm:v,userDefinedScriptsFile:x,pictureImageNamesFile:y,frameRateDisplayingPattern:C})}return document.readyState===`complete`?setTimeout(Sc):window.addEventListener(`load`,function(){setTimeout(Sc)}),e.WWA=vc,e.getProgress=_c,e})({});