nadesiko3 3.3.2 → 3.3.3

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/release/wnako3.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see wnako3.js.LICENSE.txt */
2
- (function(){var __webpack_modules__={7950:function(e){"use strict";var t="undefined"!=typeof navigator&&0<navigator.userAgent.toLowerCase().indexOf("firefox");function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function s(e,t){for(var n=t.slice(0,t.length-1),s=0;s<n.length;s++)n[s]=e[n[s].toLowerCase()];return n}function r(e){for(var t=(e=(e="string"!=typeof e?"":e).replace(/\s/g,"")).split(","),n=t.lastIndexOf("");0<=n;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var o={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":t?173:189,"=":t?61:187,";":t?59:186,"'":222,"[":219,"]":221,"\\":220},i={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},u={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},c={16:!1,18:!1,17:!1,91:!1},a={},f=1;f<20;f++)o["f".concat(f)]=111+f;var l=[],h=!1,p="all",d=[],_=function(e){return o[e.toLowerCase()]||i[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function y(e){p=e||"all"}function m(){return p||"all"}var g=function(e){var t=e.scope,n=e.method,o=e.splitKey,u=void 0===o?"+":o;r(e.key).forEach((function(e){var r,o=(e=e.split(u)).length,c="*"===(c=e[o-1])?"*":_(c);a[c]&&(t=t||m(),r=1<o?s(i,e):[],a[c]=a[c].filter((function(e){return!((!n||e.method===n)&&e.scope===t&&function(e,t){for(var n=e.length<t.length?t:e,s=e.length<t.length?e:t,r=!0,o=0;o<n.length;o++)~s.indexOf(n[o])||(r=!1);return r}(e.mods,r))})))}))};function v(e,t,n,s){var r;if(t.element===s&&(t.scope===n||"all"===t.scope)){for(var o in r=0<t.mods.length,c)Object.prototype.hasOwnProperty.call(c,o)&&(!c[o]&&~t.mods.indexOf(+o)||c[o]&&!~t.mods.indexOf(+o))&&(r=!1);(0!==t.mods.length||c[16]||c[18]||c[17]||c[91])&&!r&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function b(e,t){var n=a["*"],s=e.keyCode||e.which||e.charCode;if(k.filter.call(this,e)){if(~l.indexOf(s=93!==s&&224!==s?s:91)||229===s||l.push(s),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=u[t];e[t]&&!~l.indexOf(n)?l.push(n):!e[t]&&~l.indexOf(n)?l.splice(l.indexOf(n),1):"metaKey"!==t||!e[t]||3!==l.length||e.ctrlKey||e.shiftKey||e.altKey||(l=l.slice(l.indexOf(n)))})),s in c){for(var r in c[s]=!0,i)i[r]===s&&(k[r]=!0);if(!n)return}for(var o in c)Object.prototype.hasOwnProperty.call(c,o)&&(c[o]=e[u[o]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(~l.indexOf(17)||l.push(17),~l.indexOf(18)||l.push(18),c[17]=!0,c[18]=!0);var f=m();if(n)for(var h=0;h<n.length;h++)n[h].scope===f&&("keydown"===e.type&&n[h].keydown||"keyup"===e.type&&n[h].keyup)&&v(e,n[h],f,t);if(s in a)for(var p=0;p<a[s].length;p++)if(("keydown"===e.type&&a[s][p].keydown||"keyup"===e.type&&a[s][p].keyup)&&a[s][p].key){for(var d=a[s][p],y=d.key.split(d.splitKey),g=[],b=0;b<y.length;b++)g.push(_(y[b]));g.sort().join("")===l.sort().join("")&&v(e,d,f,t)}}}function k(e,t,o){l=[];var u=r(e),f=[],p="all",y=document,m=0,g=!1,v=!0,w="+";for(void 0===o&&"function"==typeof t&&(o=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(p=t.scope),t.element&&(y=t.element),t.keyup&&(g=t.keyup),void 0!==t.keydown&&(v=t.keydown),"string"==typeof t.splitKey&&(w=t.splitKey)),"string"==typeof t&&(p=t);m<u.length;m++)f=[],1<(e=u[m].split(w)).length&&(f=s(i,e)),(e="*"===(e=e[e.length-1])?"*":_(e))in a||(a[e]=[]),a[e].push({keyup:g,keydown:v,scope:p,mods:f,shortcut:u[m],method:o,key:u[m],splitKey:w,element:y});void 0!==y&&!function(e){return!!~d.indexOf(e)}(y)&&window&&(d.push(y),n(y,"keydown",(function(e){b(e,y)})),h||(h=!0,n(window,"focus",(function(){l=[]}))),n(y,"keyup",(function(e){b(e,y),function(e){var t=e.keyCode||e.which||e.charCode,n=l.indexOf(t);if(n<0||l.splice(n,1),e.key&&"meta"==e.key.toLowerCase()&&l.splice(0,l.length),(t=93!==t&&224!==t?t:91)in c)for(var s in c[t]=!1,i)i[s]===t&&(k[s]=!1)}(e)})))}var w,j,S={setScope:y,getScope:m,deleteScope:function(e,t){var n,s,r;for(r in e=e||m(),a)if(Object.prototype.hasOwnProperty.call(a,r))for(n=a[r],s=0;s<n.length;)n[s].scope===e?n.splice(s,1):s++;m()===e&&y(t||"all")},getPressedKeyCodes:function(){return l.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=_(e)),!!~l.indexOf(e)},filter:function(e){var t=(e=e.target||e.srcElement).tagName;return!(e.isContentEditable||!("INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t||e.readOnly))},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&g(e)}));else if("object"==typeof e)e.key&&g(e);else if("string"==typeof e){for(var t=arguments.length,n=Array(1<t?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];var r=n[0],o=n[1];"function"==typeof r&&(o=r,r=""),g({key:e,scope:r,method:o,splitKey:"+"})}}else Object.keys(a).forEach((function(e){return delete a[e]}))}};for(w in S)Object.prototype.hasOwnProperty.call(S,w)&&(k[w]=S[w]);"undefined"!=typeof window&&(j=window.hotkeys,k.noConflict=function(e){return e&&window.hotkeys===k&&(window.hotkeys=j),k},window.hotkeys=k),e.exports=k},3812:function(e,t,n){e.exports=n(7950)},1701:function(e,t,n){"use strict";n.d(t,{as:function(){return a},cg:function(){return i},ih:function(){return c},k:function(){return r},l0:function(){return f},t5:function(){return o},tO:function(){return u}});var s=n(4908);class r extends Error{constructor(e,t,n,r){const o=`${n||""}${void 0===r?"":`(${r+1}行目): `}`;super(`[${e}]${o}${t}\n[バージョン] ${s.Z.version}`),this.tag="["+e+"]",this.positionJa=o,this.msg=t}}class o extends r{constructor(e,t,n){super("インデントエラー",e,n,t),this.line=t,this.file=n}}class i extends r{constructor(e,t,n,s,r){super("字句解析エラー(内部エラー)",e,r,s),this.preprocessedCodeStartOffset=t,this.preprocessedCodeEndOffset=n,this.line=s,this.file=r}}class u extends r{constructor(e,t,n,s,r){super("字句解析エラー",e,r,s),this.startOffset=t,this.endOffset=n,this.line=s,this.file=r}}class c extends r{static fromNode(e,t,n){if(!t)return new c(e,void 0,null,null,void 0);const s="number"==typeof t.startOffset?t.startOffset:null,r=n&&"number"==typeof n.endOffset?n.endOffset:"number"==typeof t.endOffset?t.endOffset:null;return new c(e,t.line,s,r,t.file)}constructor(e,t,n,s,r){super("文法エラー",e,r,t),this.file=r,this.line=t,this.startOffset=n,this.endOffset=s}}class a extends r{constructor(e,t){const n=e instanceof Error&&e.constructor!==Error&&e.constructor!==a?e.constructor.name+": ":"",s=e instanceof Error?e.message:e+"";let r,o,i;void 0===t?(r=void 0,o=void 0):(i=/^l(-?\d+):(.*)$/.exec(t))?(r=+i[1],o=i[2]):(i=/^l(-?\d+)$/.exec(t))?(r=+i[1],o=void 0):(r=void 0,o=t),super("実行時エラー",`エラー『${n}${s}』が発生しました。`,o,r),this.error=e,this.lineNo=t,this.line=r,this.file=o}}class f extends r{constructor(e,t,n){super("取り込みエラー",e,n,t),this.file=n,this.line=t}}},5430:function(e,t,n){"use strict";n.d(t,{I:function(){return i},J:function(){return o}});var s=n(1701),r=n(4908);class o{constructor(e){this.nako_func={...e.nako_func},this.nako_test={},this.used_func=new Set,this.loop_id=1,this.numAsyncFn=0,this.usedAsyncFn=!1,this.flagLoop=!1,this.__self=e,this.genMode="sync",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0},this.warnUndefinedVar=!0,this.warnUndefinedReturnUserFunc=1,this.warnUndefinedCallingUserFunc=1,this.warnUndefinedCallingSystemFunc=1,this.warnUndefinedCalledUserFuncArgs=1}static isValidIdentifier(e){return/^(?!(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$)[$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}convLineno(e,t){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return 3===this.varslistSet.length?`__varslist[2][${JSON.stringify(e)}]`:o.isValidIdentifier(e)?e:`__vars[${JSON.stringify(e)}]`}static getFuncName(e){let t=e.replace(/[ぁ-ん]+$/,"");return""===t&&(t=e),t}static convPrint(e){return`__print(${e});`}static convRequire(e){const t=e.value;return this.convLineno(e,!1)+`__module['${t}'] = require('${t}');\n`}getVarsCode(){let e="";for(const t of Array.from(this.used_func.values())){const n=this.__self.__varslist[0][t],s=`this.__varslist[0]["${t}"]`;e+="function"==typeof n?s+"="+n.toString()+";\n":s+"="+JSON.stringify(n)+";\n"}return e}getDefFuncCode(e){let t="";t+="const __self = this.__self = this;\n",t+="const __varslist = this.__varslist;\n",t+="const __module = this.__module;\n",t+="const __v0 = this.__v0 = this.__varslist[0];\n",t+="const __v1 = this.__v1 = this.__varslist[1];\n",t+="const __vars = this.__vars = this.__varslist[2];\n";let n="";for(const e in this.nako_func){const t=this.nako_func[e].fn;n+=`//[DEF_FUNC name='${e}' asyncFn=${this.nako_func[e].asyncFn?"true":"false"}]\n__v1["${e}"]=${t};\n;//[/DEF_FUNC name='${e}']\n`}""!==n&&(t+="__v0.line='関数の定義';\n"+n);let s="";for(const e in this.__self.__module){const t=`!${e}:初期化`;this.varslistSet[0].names.has(t)&&(this.used_func.add(`!${e}:初期化`),s+=`__v0["!${e}:初期化"](__self);\n`)}if(""!==s&&(t+="__v0.line='プラグインの初期化';\n"+s),e){let n="const __tests = [];\n";for(const t in this.nako_test)if(!0===e||"string"==typeof e&&e===t){n+=`${this.nako_test[t].fn};\n;`}""!==n&&(t+="__v0.line='テストの定義';\n",t+=n+"\n")}return t}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}setFunc(e,t){this.__self.setFunc(e,t)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=[],n=e=>{for(let s=0;s<e.block.length;s++){const r=e.block[s];if("def_func"===r.type){const e=r.name.value;this.used_func.add(e),this.__self.__varslist[1][e]=function(){},this.varslistSet[1].names.add(e),this.nako_func[e]={josi:r.name.meta.josi,fn:"",type:"func",asyncFn:!1},t.push({name:e,node:r})}else("speed_mode"===r.type||"performance_monitor"===r.type)&&("block"===r.block.type?n(r.block):n(r))}};n(e);const r=new Set;0===this.speedMode.invalidSore&&r.add("それ"),this.varsSet={isFunction:!1,names:r,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet;const o=this.warnUndefinedVar;this.warnUndefinedVar=!1;for(let e of t)this.convDefFuncCommon(e.node,e.name);this.warnUndefinedVar=o}convGen(e,t){const n=this.convLineno(e,!1)+this._convGen(e,!0);return t?"":n}_convGen(e,t){let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"block":for(let t=0;t<e.block.length;t++){const s=e.block[t];n+=this._convGen(s,!1)}break;case"comment":case"eol":n+=this.convComment(e);break;case"break":n+=this.convCheckLoop(e,"break");break;case"continue":n+=this.convCheckLoop(e,"continue");break;case"end":n+="__varslist[0]['終']();";break;case"number":n+=e.value;break;case"string":n+=this.convString(e);break;case"def_local_var":n+=this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.convDefLocalVarlist(e);break;case"let":n+=this.convLet(e);break;case"inc":n+=this.convInc(e);break;case"word":case"variable":n+=this.convGetVar(e);break;case"op":case"calc":n+=this.convOp(e);break;case"renbun":n+=this.convRenbun(e);break;case"not":n+="(("+this._convGen(e.value,!0)+")?0:1)";break;case"func":case"func_pointer":case"calc_func":n+=this.convCallFunc(e,t);break;case"if":n+=this.convIf(e);break;case"tikuji":n+=this.convTikuji(e);break;case"for":n+=this.convFor(e);break;case"foreach":n+=this.convForeach(e);break;case"repeat_times":n+=this.convRepeatTimes(e);break;case"speed_mode":n+=this.convSpeedMode(e,t);break;case"performance_monitor":n+=this.convPerformanceMonitor(e,t);break;case"while":n+=this.convWhile(e);break;case"atohantei":n+=this.convAtohantei(e);break;case"switch":n+=this.convSwitch(e);break;case"let_array":n+=this.convLetArray(e);break;case"配列参照":n+=this.convRefArray(e);break;case"json_array":n+=this.convJsonArray(e);break;case"json_obj":n+=this.convJsonObj(e);break;case"func_obj":n+=this.convFuncObj(e);break;case"bool":n+=e.value?"true":"false";break;case"null":n+="null";break;case"def_test":n+=this.convDefTest(e);break;case"def_func":n+=this.convDefFunc(e);break;case"return":n+=this.convReturn(e);break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=o.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}findVar(e){if(this.varslistSet.length>3&&this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:this.varname(e)};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n)return"引数"===e||"それ"===e||"対象"===e||"対象キー"===e||this.warnUndefinedVar&&this.__self.logger.warn(`変数『${e}』は定義されていません。`,t),this.varsSet.names.add(e),this.varname(e);if(0===n.i){const o=this.__self.funclist[e];if(!o)return`${n.js}/*err:${r}*/`;if("const"===o.type||"var"===o.type)return n.js;if("func"===o.type){if(0===o.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;return this.genVar(t,e)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);const t=this.convLineno(e,!1);let n;if(e.value)n=this._convGen(e.value,!0);else{if(0!==this.speedMode.invalidSore)return t+"return;";n=this.varname("それ")}return 0===this.warnUndefinedReturnUserFunc?t+`return ${n};`:t+`return (function(a){if(a===undefined){__self.logger.warn('ユーザ関数からundefinedが返されています',{file:'${e.file}',line:${e.line}});};return a;})(${n});`}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return this.convLineno(e.line)+t+";"}convDefFuncCommon(e,t){let n="",s="";if(0!==this.performanceMonitor.userFunction){let e=t;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),n=`const performanceMonitorEnd = (function (key, type) {\nconst uf_start = performance.now() * 1000;\nreturn function () {\nconst el_time = performance.now() * 1000 - uf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=el_time;\nif(__self.__performance_monitor[key].min_usec>el_time){__self.__performance_monitor[key].min_usec=el_time;}\nif(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_monitor[key].max_usec=el_time;}\n}};})('${e}', 'user');try {\n`,s="} finally { performanceMonitorEnd(); }\n"}let r="";const i=new Set;0===this.speedMode.invalidSore&&i.add("それ"),this.varsSet={isFunction:!0,names:i,readonly:new Set},this.varslistSet.push(this.varsSet),r+=" var 引数 = arguments;\n",r+=" var __vars = {};\n";const u=Array.from(this.varsSet.names.values());let c="";const a=t?e.name.meta:e.meta;for(let n=0;n<a.varnames.length;n++){const s=a.varnames[n];0===this.warnUndefinedCalledUserFuncArgs?c+=` ${this.varname(s)} = arguments[${n}];\n`:c+=t?` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('ユーザ関数(${t})の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`:` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('匿名関数の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`,this.varsSet.names.add(s)}t&&(this.used_func.add(t),this.varslistSet[1].names.add(t),void 0===this.nako_func[t]&&(this.nako_func[t]={josi:e.name.meta.josi,fn:"",type:"func",asyncFn:!1}));const f=this.usedAsyncFn;this.usedAsyncFn=!1;c+=this._convGen(e.block,!1).split("\n").map((e=>" "+e)).join("\n")+"\n",0===this.speedMode.invalidSore&&(c+=` return (${this.varname("それ")});\n`),c+=s,t&&this.usedAsyncFn&&(this.nako_func[t].asyncFn=!0);let l=!1;for(const e of Array.from(this.varsSet.names.values()))u.includes(e)||(o.isValidIdentifier(e)?r+=` var ${e};\n`:l=!0);o.isValidIdentifier("それ")||0!==this.speedMode.invalidSore||(l=!0),0===this.speedMode.invalidSore&&(o.isValidIdentifier("それ")?r+=" var それ = '';\n":r+=` ${this.varname("それ")} = '';`);return c=(this.usedAsyncFn?"(async function(){\n":"(function(){\n")+n+r+c+"",c+="})",t&&(this.nako_func[t].fn=c,this.nako_func[t].asyncFn=this.usedAsyncFn,a.asyncFn=this.usedAsyncFn),this.usedAsyncFn=f,this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],t&&(this.__self.__varslist[1][t]=c),c}convDefTest(e){const t=e.name.value;let n=`__tests.push({ name: '${t}', f: () => {\n`;return n+=` ${this._convGen(e.block,!1)}\n}});`,this.nako_test[t]={josi:e.name.meta.josi,fn:n,type:"test_func"},""}convDefFunc(e){const t=o.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){return"{"+e.value.map((e=>`${this._convGen(e.key,!0)}:${this._convGen(e.value,!0)}`)).join(",")+"}"}convJsonArray(e){return"["+e.value.map((e=>this._convGen(e,!0))).join(",")+"]"}convRefArray(e){const t=this._convGen(e.name,!0),n=e.index;let s=t;for(let e=0;e<n.length;e++){s+="["+this._convGen(n[e],!0)+"]"}return s}convLetArray(e){const t=this._convGen(e.name,!0),n=e.index;let s="",r=t,o="";if(e.checkInit){const e="[0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0]";s+=`\n/*配列初期化*/if (!(${t} instanceof Array)) { ${t} = ${e}; console.log('初期化:${t}') };`;for(let r=0;r<n.length-1;r++){o+=`[${this._convGen(n[r],!0)}]`,s+=`\n/*配列初期化${r}*/if (!(${t}${o} instanceof Array)) { ${t}${o} = ${e}; };`}s+="\n"}for(let e=0;e<n.length;e++){r+="["+this._convGen(n[e],!0)+"]"}r+=" = "+this._convGen(e.value,!0)+";\n";return this.convLineno(e,!1)+s+r}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.loop_id++,s=`$nako_i${n}`,r=this._convGen(e.from,!0),o=this._convGen(e.to,!0);let i=this._convGen(e.inc,!0);null!=i&&null!=i&&"null"!=i||(i=1);const u=this.convGenLoop(e.block),c=`$nako_from${n}`,a=`$nako_to${n}`;let f="";0===this.speedMode.invalidSore&&(f=`${this.varname("それ")} = `);const l=`\n//[FOR id=${n}]\nconst ${c} = ${r};\nconst ${a} = ${o};\nif (${c} <= ${a}) { // up\n for (let ${s} = ${c}; ${s} <= ${a}; ${s}+= ${i}) {\n ${f}${t} = ${s};\n ${u}\n };\n} else { // down\n for (let ${s} = ${c}; ${s} >= ${a}; ${s}-= ${i}) {\n ${f}${t} = ${s};\n ${u}\n };\n};\n//[/FOR id=${n}]\n`;return this.convLineno(e,!1)+l}convForeach(e){let t;if(null===e.target){if(0!==this.speedMode.invalidSore)throw s.ih.fromNode("『反復』の対象がありません。",e);t=this.varname("それ")}else t=this._convGen(e.target,!0);let n='__v0["対象"]';e.name&&(n=this.varname(e.name.value),this.varsSet.names.add(e.name.value));const r=this.convGenLoop(e.block),o=this.loop_id++;let i="";0===this.speedMode.invalidSore&&(i=`${this.varname("それ")} = `);const u=`let $nako_foreach_v${o}=${t};\nfor (let $nako_i${o} in $nako_foreach_v${o}){\n if ($nako_foreach_v${o}.hasOwnProperty($nako_i${o})) {\n ${n} = ${i}$nako_foreach_v${o}[$nako_i${o}];\n __v0["対象キー"] = $nako_i${o};\n ${r}\n }\n};\n`;return this.convLineno(e,!1)+u}convRepeatTimes(e){const t=this.loop_id++,n=this._convGen(e.value,!0),s=this.convGenLoop(e.block);let r="";0===this.speedMode.invalidSore&&(r=`${this.varname("それ")} = `);const o=`let $nako_times_v${t} = ${n};\nfor(var $nako_i${t} = 1; $nako_i${t} <= $nako_times_v${t}; $nako_i${t}++){\n ${r}__v0["回数"] = $nako_i${t};\n `+s+"\n}\n";return this.convLineno(e,!1)+o}convSpeedMode(e,t){const n={...this.speedMode};e.options["行番号無し"]&&this.speedMode.lineNumbers++,e.options["暗黙の型変換無し"]&&this.speedMode.implicitTypeCasting++,e.options["強制ピュア"]&&this.speedMode.forcePure++,e.options["それ無効"]&&this.speedMode.invalidSore++;try{return this._convGen(e.block,t)}finally{this.speedMode=n}}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++;try{return this._convGen(e.block,t)}finally{this.performanceMonitor=n}}convWhile(e){const t=`while (${this._convGen(e.cond,!0)}){\n ${this.convGenLoop(e.block)}\n}\n`;return this.convLineno(e,!1)+t}convAtohantei(e){const t=`$nako_i${this.loop_id++}`,n=this._convGen(e.cond,!0),s=`for(;;) {\n ${this.convGenLoop(e.block)}\n let ${t} = ${n};\n if (${t}) { continue } else { break }\n}\n\n`;return this.convLineno(e,!1)+s}convSwitch(e){const t=this._convGen(e.value,!0),n=e.cases;let s="";for(let e=0;e<n.length;e++){const t=n[e][0],r=this.convGenLoop(n[e][1]);if("違えば"===t.type)s+=" default:\n";else{s+=` case ${this._convGen(t,!0)}:\n`}s+=` ${r}\n break\n`}const r=`switch (${t}){\n${s}\n}\n`;return this.convLineno(e,!1)+r}convIf(e){const t=this._convGen(e.expr,!0),n=this._convGen(e.block,!1),s=null===e.false_block?"":"else {"+this._convGen(e.false_block,!1)+"};\n";return this.convLineno(e,!1)+`if (${t}) {\n ${n}\n}`+s+";\n"}convTikuji(e){const t=`__tikuji${this.loop_id++}`;let n=`const ${t} = []\n`;for(let s=0;s<e.blocks.length;s++){const r=this._convGen(e.blocks[s],!1).replace(/\s+$/,"")+"\n";n+=`${t}.push(function(resolve, reject) {\n __self.resolve = resolve;\n __self.reject = reject;\n __self.resolveCount = 0;\n ${this.convLineno(e.blocks[s],!0)}\n ${r} if (__self.resolveCount === 0) resolve();\n}); // end of tikuji__\${pid}[{$i}]\n`}n+=`// end of ${t} \n`;let s=` ${t}.splice(0);\n __v0["エラーメッセージ"]=errMsg;\n`;if(null!=e.errorBlock){s+=this._convGen(e.errorBlock,!1).replace(/\s+$/,"")+"\n"}return n+=`const ${t}__reject = function(errMsg){\n${s}};\n`,n+="__self.resolve = undefined;\n",n+=`const ${t}__resolve = function(){\n`,n+=" setTimeout(function(){\n",n+=` if (${t}.length == 0) {return}\n`,n+=` const f = ${t}.shift()\n`,n+=` f(${t}__resolve, ${t}__reject);\n`,n+=" }, 0);\n",n+="};\n",n+=`${t}__resolve()\n`,this.convLineno(e,!1)+n}convFuncGetArgsCalcType(e,t,n){const s=[],r={};for(let e=0;e<n.args.length;e++){const t=n.args[e];0===e&&null===t&&0===this.speedMode.invalidSore?(s.push(this.varname("それ")),r.sore=!0):s.push(this._convGen(t,!0))}return[s,r]}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convCallFunc(e,t){const n=o.getFuncName(e.name),r=this.findVar(n);if(null===r)throw s.ih.fromNode(`関数『${n}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let i;if(0===r.i){if(i=this.__self.funclist[n],"func"!==i.type)throw s.ih.fromNode(`『${n}』は関数ではありません。`,e)}else i=this.nako_func[n],void 0===i&&(i={return_none:!1});if("func_pointer"===e.type)return r.js;const u=this.convFuncGetArgsCalcType(n,i,e),c=u[0],a=u[1];this.used_func.add(n),c.push("__self");let f="function",l="",h="";if(e.setter&&(l+=";__self.isSetter = true;\n",h+=";__self.isSetter = false;\n"),0===r.i&&this.varslistSet.length>3&&!0!==i.pure&&0===this.speedMode.forcePure){const e=[];for(const t of Array.from(this.varsSet.names.values()))o.isValidIdentifier(t)&&e.push({str:JSON.stringify(t),js:this.varname(t)});l+="__self.__locals = __vars;\n";for(const t of e)l+=`__self.__locals[${t.str}] = ${t.js};\n`;for(const t of e)"それ"!==t.js&&(h+=`${t.js} = __self.__locals[${t.str}];\n`)}a.sore&&(l+="/*[sore]*/");const p=(e,t)=>{let n="";for(const s of e.split("\n"))""!==s&&(n+=" ".repeat(t)+s+"\n");return n};let d;0===this.warnUndefinedCallingUserFunc&&0!==r.i||0===this.warnUndefinedCallingSystemFunc&&0===r.i?d=c.join(","):(d="",c.forEach((t=>{"__self"===t?d+=`,${t}`:0===r.i?d+=`,(function(a){if(a===undefined){__self.logger.warn('命令『${n}』の引数にundefinedを渡しています。',{file:'${e.file}',line:${e.line}});};return a;})(${t})`:d+=`,(function(a){if(a===undefined){__self.logger.warn('ユーザ関数『${n}』の引数にundefinedを渡しています。',{file:'${e.file}',line:${e.line}});};return a;})(${t})`})),d=d.substring(1));let _=`${r.js}(${d})`;if(i.asyncFn&&(f=`async ${f}`,_=`await ${_}`,this.numAsyncFn++,this.usedAsyncFn=!0),0===r.i&&0!==this.performanceMonitor.systemFunctionBody){let e=n;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),_=`(${f} (key, type) {\nconst sbf_start = performance.now() * 1000;\ntry {\nreturn `+_+";\n} finally {\nconst sbl_time = performance.now() * 1000 - sbf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sbl_time;\nif(__self.__performance_monitor[key].min_usec>sbl_time){__self.__performance_monitor[key].min_usec=sbl_time;}\nif(__self.__performance_monitor[key].max_usec<sbl_time){__self.__performance_monitor[key].max_usec=sbl_time;}\n"+`}}})('${n}_body', 'sysbody')\n`}let y="";if(i.return_none)y=""===h?""===l?`${_};\n`:`${l} ${_};\n`:`${l}try {\n${p(_,1)};\n} finally {\n${p(h,1)}}\n`;else{let n="";0===this.speedMode.invalidSore&&(n=`${this.varname("それ")} = `),y=""===l&&""===h?`(${n}${_})`:""===h?`(${f}(){\n${p(`${l};\nreturn ${n} ${_}`,1)}}).call(this)`:`(${f}(){\n${p(`${l}try {\n${p(`return ${n}${_};`,1)}\n} finally {\n${p(h,1)}}`,1)}}).call(this)`,("して"===e.josi||""===e.josi&&!t)&&(y+=";\n")}return 0===r.i&&0!==this.performanceMonitor.systemFunction&&(y="(function (key, type) {\nconst sf_start = performance.now() * 1000;\ntry {\nreturn "+y+";\n} finally {\nconst sl_time = performance.now() * 1000 - sf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sl_time;\nif(__self.__performance_monitor[key].min_usec>sl_time){__self.__performance_monitor[key].min_usec=sl_time;}\nif(__self.__performance_monitor[key].max_usec<sl_time){__self.__performance_monitor[key].max_usec=sl_time;}\n"+`}}})('${n}_sys', 'system')\n`),y}convRenbun(e){const t=this._convGen(e.right,!0);return`(function(){${this._convGen(e.left,!1)}; return ${t}}).call(this)`}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"};let n=e.operator,s=this._convGen(e.right,!0),r=this._convGen(e.left,!0);return"+"===n&&0===this.speedMode.implicitTypeCasting&&("number"!==e.left.type&&(r=`parseFloat(${r})`),"number"!==e.right.type&&(s=`parseFloat(${s})`)),"^"===n?`(Math.pow(${r}, ${s}))`:"÷÷"===n?`(Math.floor(${r} / ${s}))`:(t[n]&&(n=t[n]),`(${r} ${n} ${s})`)}convInc(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("加算する先の変数名がありません。",e);const n=e.name.value;let r=this.findVar(n),o="";null===r&&(this.varsSet.names.add(n),r=this.findVar(n));const i=r.js;return o+=`if (typeof(${i}) === 'undefined') { ${i} = 0; }`,o+=`${i} += ${t}`,";"+this.convLineno(e,!1)+o+"\n"}convLet(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("代入する先の変数名がありません。",e);const n=e.name.value,r=this.findVar(n);let o="";if(null===r)this.varsSet.names.add(n),o=`${this.varname(n)}=${t};`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);o=`${r.js}=${t};`}return";"+this.convLineno(e,!1)+o+"\n"}convDefLocalVar(e){const t=null===e.value?"null":this._convGen(e.value,!0),n=e.name.value,r=e.vartype;if(this.varsSet.names.has(n))throw s.ih.fromNode(`${r}『${n}』の二重定義はできません。`,e);this.varsSet.names.add(n),"定数"===r&&this.varsSet.readonly.add(n);const o=`${this.varname(n)}=${t};\n`;return this.convLineno(e,!1)+o}convDefLocalVarlist(e){let t="";const n=e.vartype,s=null===e.value?"null":this._convGen(e.value,!0);this.loop_id++;const r=`$nako_i${this.loop_id}`;t+=`${r}=${s}\n`,t+=`if (!(${r} instanceof Array)) { ${r}=[${r}] }\n`;for(const s in e.names){const o=e.names[s].value;this.varsSet.names.has(o),this.varsSet.names.add(o),"定数"===n&&this.varsSet.readonly.add(o);t+=`${this.varname(o)}=${r}[${s}];\n`}return this.convLineno(e,!1)+t}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n){const n=(t,n)=>'"+'+this.genVar(n,e)+'+"';t=t.replace(/\{(.+?)\}/g,n),t=t.replace(/{(.+?)}/g,n)}return'"'+t+'"'}convTryExcept(e){const t=this._convGen(e.block,!1),n=this._convGen(e.errBlock,!1);return this.convLineno(e,!1)+`try {\n${t}\n} catch (e) {\n __v0["エラーメッセージ"] = e.message;\n;\n`+`${n}}\n`}}function i(e,t,n){const i=new o(e);i.registerFunction(t);let u=i.convGen(t,!!n);if(u=i.getDefFuncCode(n)+u,u&&n&&(u+="\n__self._runTests(__tests);\n"),i.numAsyncFn>0){!("object"==typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>=0)&&(u=`\n// <nadesiko3::gen::async>\n(async () => { // async::main\n${u}\n}).call(this).catch(err => {\nif (!(err instanceof this.NakoRuntimeError)) {\n err = new this.NakoRuntimeError(err, this.__varslist[0].line);\n}\nthis.logger.error(err);\nthrow err;\n}); // async::main\n// <nadesiko3::gen::async>\n`)}e.logger.trace("--- generate ---\n"+u);return{runtimeEnv:u,standalone:`// <standaloneCode>\nconst path = require('path')\nconst nakoVersion = ${JSON.stringify(r.Z)};\n${s.k.toString()}\n${s.as.toString()}\nfunction __nako3safunc() {\nthis.logger = {\n error: (message) => { console.error(message) },\n send: (level, message) => { console.log(message) },\n};\nthis.__varslist = [{}, {}, {}];\nthis.__vars = this.__varslist[2];\nthis.__module = {};\nthis.__locals = {};\nthis.__genMode = 'sync';\ntry {\n${i.getVarsCode()}\n${u}\n} catch (err) {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, __varslist[0].line);\n }\n this.logger.error(err);\n throw err;\n}\n//\n} // end of __nako3safunc function\n__nako3safunc();\n// </standaloneCode>\n`,gen:i}}},2015:function(e,t,n){"use strict";n.d(t,{g:function(){return g}});var s=n(1701),r=n(4908),o=n(5430);const i="NOP",u="LBL",c="EOL",a="JMP",f="JMP_T",l="JMP_F",h="CALL",p="CALL_OBJ",d="RET",_="TRY",y="CODE";class m{constructor(e,t){this.type=e,this.value=t,this.no=-1,this.tag=0}}class g{static generate(e,t,n){const o=new g(e);o.registerFunction(t);let i=o.convGen(t,!!n);return i=o.getDefFuncCode(n)+i,e.logger.trace("--- generate(非同期モード) ---\n"+i),i&&n&&(i+="\n__self._runTests(__tests);\n"),{runtimeEnv:i,standalone:`const nakoVersion = ${JSON.stringify(r.Z)};\n${s.k.toString()}\n${s.as.toString()}\nthis.logger = {\n error(message) { console.error(message) },\n send(level, message) { console.log(message) },\n};\nthis.__varslist = [{}, {}, {}];\nthis.__vars = this.__varslist[2];\nthis.__module = {};\nthis.__locals = {};\nthis.__labels = {};\nthis.__code = [];\nthis.__callstack = [];\nthis.__stack = [];\nthis.__genMode = '非同期モード';\ntry {\n ${o.getVarsCode()}\n ${i}\n} catch (err) {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, this.__varslist[0].line);\n }\n this.logger.error(err);\n throw err;\n}`,gen:o}}constructor(e){this.nako_func={...e.nako_func},this.nako_test={},this.used_func=new Set,this.loopId=1,this.flagLoop=!1,this.codeId=0,this.codeArray=[],this.labelContinue=null,this.labelBreak=null,this.labels={},this.__self=e,this.genMode="非同期モード",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0}}convLineno(e,t){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return`sys.__vars[${JSON.stringify(e)}]`}getVarsCode(){let e="";for(const t of Array.from(this.used_func.values())){const n=this.__self.__varslist[0][t],s=`this.__varslist[0]["${t}"]`;e+="function"==typeof n?s+"="+n.toString()+";\n":s+"="+JSON.stringify(n)+";\n"}return e}getDefFuncCode(e){let t="";t+="const __self = this.__self = this;\n",t+="const __varslist = this.__varslist;\n",t+="const __module = this.__module;\n",t+="const __v0 = this.__v0 = this.__varslist[0];\n",t+="const __v1 = this.__v1 = this.__varslist[1];\n",t+="const __vars = this.__vars = this.__varslist[2];\n",t+="const __code = this.__code;\n";let n="";for(const e in this.nako_func){n+=`//[DEF_FUNC name='${e}']\n__v1["${e}"]=${this.nako_func[e].fn};\n;//[/DEF_FUNC name='${e}']\n`}""!==n&&(t+="__v0.line='関数の定義';\n"+n);let s="";for(const e in this.__self.__module){const t=`!${e}:初期化`;this.varslistSet[0].names.has(t)&&(this.used_func.add(`!${e}:初期化`),s+=`__v0["!${e}:初期化"](__self);\n`)}if(""!==s&&(t+="__v0.line='プラグインの初期化';\n"+s),e){let n="const __tests = [];\n";for(const t in this.nako_test)if(!0===e||"string"==typeof e&&e===t){n+=`${this.nako_test[t].fn};\n;`}""!==n&&(t+="__v0.line='テストの定義';\n",t+=n+"\n")}return t}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}setFunc(e,t){this.__self.setFunc(e,t)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=e=>{for(let n=0;n<e.block.length;n++){const s=e.block[n];if("def_func"===s.type){const e=s.name.value;this.used_func.add(e),this.__self.__varslist[1][e]=function(){},this.nako_func[e]={josi:s.name.meta.josi,fn:"",type:"func"}}else("speed_mode"===s.type||"performance_monitor"===s.type)&&("block"===s.block.type?t(s.block):t(s))}};t(e);const n=new Set;0===this.speedMode.invalidSore&&n.add("それ"),this.varsSet={isFunction:!1,names:n,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){this._convGen(e,!0);const n=new Set([a,f,l,h,_]);let s=this.codeArray;{s=s.filter((e=>e.type!==i));const e=new Set;s.forEach(((t,s,r)=>{n.has(t.type)&&e.add(t.value)})),s=s.filter(((t,n)=>t.type!==u||(15===t.tag||e.has(t.value))));let t=0;for(;t<s.length-1;)s[t].type!==c||s[t+1].type!==c?t++:s.splice(t+1,1);this.codeArray=s}s.forEach(((e,t)=>{e.type===u&&(this.labels[e.value]=t)})),s.forEach((e=>{n.has(e.type)&&e.no<0&&(e.no=this.labels[e.value])}));let r="";return s.forEach(((e,t)=>{switch(e.type){case i:r+=`case ${t}: break; // [NOP] ${e.value}\n`;break;case u:r+=`case ${t}: break; // [LABEL] ${e.value}\n`;break;case c:r+=`case ${t}: ${e.value}; break; // [EOL]\n`;break;case a:r+=`case ${t}: sys.nextIndex = ${e.no}; break; // ${e.value}\n`;break;case f:r+=`case ${t}: if (sys.__stack.pop()) { sys.nextIndex = ${e.no};} break; // ${e.value}\n`;break;case l:r+=`case ${t}: if (!sys.__stack.pop()) { sys.nextIndex = ${e.no}} break; // ${e.value}\n`;break;case d:r+=`case ${t}: sys.__return(sys); break;\n`;break;case h:r+=`case ${t}: sys.__call(${e.no}, sys); break; // ${e.value}\n`;break;case p:r+=`case ${t}: sys.__callObj('${e.value}', ${t}, sys); break; // ${e.value}\n`;break;case _:r+=`case ${t}: sys.tryIndex = ${e.no}; break; // TRY \n`;break;case y:{const n=e.value.replace(/\s+$/,"");r+=`case ${t}: {\n${n}\n};break;\n`;break}default:throw new Error("invalid code type")}})),r=`\n //-------------------------\n // main_code\n this.__labels = ${JSON.stringify(this.labels)};\n this.nextAsync = (sys) => {\n if (sys.index >= sys.codeSize || sys.index < 0) {return}\n const __v0 = sys.__v0\n try {\n sys.inLoop = true\n while (sys.index < sys.codeSize && sys.index >= 0) {\n // console.log('@@[run]', sys.index)\n switch (sys.index) {\n // --- CODE.BEGIN ---\n ${r}\n // --- CODE.END ---\n default:\n sys.inLoop = false\n console.log(sys.index, sys.__stack)\n throw new Error('Invalid sys.index:' + sys.index)\n break\n }\n // check next\n if (sys.nextIndex >= 0) {\n sys.index = sys.nextIndex\n sys.nextIndex = -1\n } else {\n sys.index++\n }\n if (sys.async) {\n sys.__saveSysenv(sys)\n sys.async = false\n break\n }\n } // end of while\n sys.inLoop = false\n } catch (e) {\n sys.__errorAsync(e, sys)\n }\n }\n this.__errorAsync = (e, sys) => { // エラーが起きた時呼び出す\n sys.__v0["エラーメッセージ"] = e.message;\n if (e.message == '__終わる__') {\n sys.__stopAsync(sys)\n return\n }\n if (sys.tryIndex >= 0) {\n sys.index = sys.tryIndex;\n setTimeout(() => {sys.nextAsync(sys)}, 1)\n } else {\n throw e\n }\n }\n this.__call = (no, sys) => {\n const info = {lastVars:sys.__vars, backNo: this.index + 1}\n sys.__callstack.push(info);\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.nextIndex = no;\n }\n this.__return = sys => {\n if (sys.__callstack.length === 0) {\n sys.__destroySysenv(sys, sys.curSysenv.envid)\n sys.index = -2\n sys.nextIndex = -1\n return\n }\n const sore = sys.__vars['それ'];\n sys.__varslist.pop();\n const info = sys.__callstack.pop();\n sys.nextIndex = info.backNo;\n sys.__vars = info.lastVars;\n sys.__vars['それ'] = sore\n sys.__stack.push(sore);\n }\n this.__resetAsync = sys => {\n sys.index = 0\n sys.codeSize = ${s.length};\n sys.async = false\n sys.nextIndex = -1\n sys.tryIndex = -1\n }\n this.__stopAsync = sys => {\n sys.__resetAsync(sys)\n sys.index = -1 // force stop!!\n }\n this.__callNakoCode = (no, backNo, sys) => {\n this.__call(backNo, sys)\n sys.nextIndex = no\n const sysenv = sys.setAsync(sys)\n setTimeout(() => {\n // console.log('//__callNakoCode, back=', backNo, 'no=', no)\n sys.compAsync(sys, sysenv)\n } ,1)\n }\n this.__callNakoCodeEntry = (no, sys) => {\n sys.__saveSysenv(sys)\n sys.curSysenv = sys.__generateSysenv(sys)\n sys.__restoreSysenv(sys)\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.index = no;\n sys.nextAsync(sys)\n }\n this.__callObj = (vname, curNo, sys) => {\n if (sys.__vars[vname]) {\n const fname = sys.__vars[vname]\n // console.log(sys.__labels)\n if (fname && sys.__labels[fname]) {\n const no = sys.__labels[fname]\n sys.__call(no, sys)\n return\n } else {\n console.log('vname=', vname, 'label=', fname)\n }\n }\n throw new Error('async error in __callObj::', vname)\n }\n this.__generateSysenv = sys => {\n sys.envid = ( sys.envid == null ? 0 : sys.envid ) + 1\n const sysenv = {\n callstack: [],\n varstack: [],\n varslist: [sys.__varslist[0], sys.__varslist[1], sys.__varslist[2]],\n index: -1,\n nextIndex: -1,\n tryIndex: -1,\n envid: sys.envid\n }\n sysenv.vars = sysenv.varslist[2]\n if (sys.sysenvs == null) { sys.sysenvs={} }\n sys.sysenvs[sys.envid] = sysenv\n // console.log('generete envid '+sys.envid)\n return sysenv\n }\n this.__destroySysenv = (sys, envid) => {\n delete sys.sysenvs[envid]\n // console.log('destroy envid '+envid)\n }\n this.__saveSysenv = sys => {\n const sysenv = sys.curSysenv\n sysenv.callstack = sys.__callstack\n sysenv.varstack = sys.__stack\n sysenv.varslist = sys.__varslist\n sysenv.vars = sys.__vars\n sysenv.index = sys.index\n sysenv.nextIndex = sys.nextIndex\n sysenv.tryIndex = sys.tryIndex\n }\n this.__restoreSysenv = sys => {\n const sysenv = sys.curSysenv\n sys.__callstack = sysenv.callstack\n sys.__stack = sysenv.varstack\n sys.__varslist = sysenv.varslist\n sys.__vars = sysenv.vars\n ___vars = sys.__vars\n sys.index = sysenv.index\n sys.nextIndex = sysenv.nextIndex\n sys.tryIndex = sysenv.tryIndex\n }\n this.setAsync = sys => {\n sys.async = true\n return sys.curSysenv\n }\n this.compAsync = (sys,sysenv) => {\n if (sys.async && sys.curSysenv != null && sysenv != null && sys.curSysenv.envid === sysenv.envid) {\n sys.async = false\n } else {\n if (sys.curSysenv == null || sysenv == null || sys.curSysenv.envid !== sysenv.envid) {\n sys.__saveSysenv(sys)\n const envid = sys.curSysenv.envid\n sys.curSysenv = sysenv\n sys.__restoreSysenv(sys)\n // console.log('switch envid '+envid+' to '+sys.curSysenv.envid)\n }\n sys.nextAsync(sys)\n }\n }\n\n this.__resetAsync(this)\n this.curSysenv = this.__generateSysenv(this)\n this.nextAsync(this)\n //-------------------------\n `,t?"":r}_convGen(e,t){let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"comment":e.value||(e.value=""),this.addCode(new m(i,e.value));break;case"eol":this.addCode(new m(c,this.convLineno(e,!0)));break;case"number":this.addCodeStr(`sys.__stack.push(${e.value});//number`);break;case"string":this.convString(e);break;case"word":case"variable":this.convGetVar(e);break;case"op":case"calc":this.convOp(e);break;case"renbun":this.convRenbun(e);break;case"not":this._convGen(e.value,!0),this.addCodeStr("if (sys.__stack.length==0) throw new Error('NOTでスタックに値がありません');sys.__stack[sys.__stack.length-1] = (sys.__stack[sys.__stack.length-1]) ? 0:1");break;case"配列参照":this.convRefArray(e);break;case"json_array":this.convJsonArray(e);break;case"json_obj":this.convJsonObj(e);break;case"bool":{const t=e.value?"true":"false";this.addCodeStr(`sys.__stack.push(${t})`);break}case"null":this.addCodeStr("sys.__stack.push(null)");break;case"func":case"func_pointer":case"calc_func":this.convFunc(e,t);break;case"let":this.convLet(e);break;case"let_array":this.convLetArray(e);break;case"block":for(let t=0;t<e.block.length;t++){const n=e.block[t];this._convGen(n,!1)}break;case"if":this.convIf(e);break;case"repeat_times":this.convRepeatTimes(e);break;case"break":this.addCodeStr(this.convCheckLoop(e,"break"));break;case"continue":this.addCodeStr(this.convCheckLoop(e,"continue"));break;case"for":this.convFor(e);break;case"foreach":this.convForeach(e);break;case"while":this.convWhile(e);break;case"switch":this.convSwitch(e);break;case"return":this.convReturn(e);break;case"end":n+=this.addCodeStr("__varslist[0]['終']();");break;case"def_local_var":this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.addCodeStr(this.convDefLocalVarlist(e));break;case"tikuji":throw s.ih.fromNode("「逐次実行」構文は「!非同期モード」では使えません。",e);case"speed_mode":throw s.ih.fromNode("「速度有線」構文は「!非同期モード」では使えません。",e);case"performance_monitor":this.convPerformanceMonitor(e,t);break;case"func_obj":this.convFuncObj(e);break;case"def_test":this.convDefTest(e);break;case"def_func":n+=this.addCodeStr(this.convDefFunc(e));break;case"try_except":n+=this.convTryExcept(e);break;case"require":this.addCodeStr(o.J.convRequire(e));break;default:throw new Error("System Error: unknown_type="+e.type)}return n}addCodeStr(e){if(""===e)return"";const t=e.split("\n").map((e=>" "+e.replace(/\s+$/,""))),n=new m(y,t.join("\n"));return this.addCode(n)}addCode(e){return this.codeArray[this.codeId]=e,this.codeId++,""}makeLabel(e){const t=e+"_"+this.loopId++;return this.makeLabelDirectly(t)}makeLabelDirectly(e){const t=new m(u,e);return this.labels[e]=-1,t}makeJump(e){return new m(a,e.value)}makeJumpIfTrue(e){return new m(f,e.value)}makeJumpIfFalse(e){return new m(l,e.value)}convIf(e){const t=this.makeLabel("もし:ここから"),n=this.makeLabel("もし:ここまで"),s=this.makeLabel("もし:違えば");return this.addCode(t),this._convGen(e.expr,!0),this.addCode(this.makeJumpIfFalse(s)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(s),e.false_block&&this._convGen(e.false_block,!1),this.addCode(n),""}convRepeatTimes(e){this.flagLoop=!0,this.varsSet.names.add("回数"),this.varsSet.readonly.add("回数");const t=`sys.__tmp_i${this.loopId}`;this.loopId++;const n=`sys.__tmp_count${this.loopId}`;this.loopId++,this._convGen(e.value,!0),this.addCodeStr(`${n} = sys.__stack.pop(); ${t} = 0;`);const s=this.makeLabel("回:条件チェック");this.addCode(s);const r=this.makeLabel("回:ここまで");this.labelBreak=r,this.labelContinue=s;const o=`sys.__vars["回数"] = ++${t}\nsys.__stack.push(${t} > ${n})\n`;return this.addCodeStr(o),this.addCode(this.makeJumpIfTrue(r)),this.convGenLoop(e.block),this.addCode(this.makeJump(s)),this.addCode(r),this.flagLoop=!1,""}findVar(e){if(this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:`sys.__vars[${JSON.stringify(e)}]`};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`sys.__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n)return"引数"===e||"それ"===e||"対象"===e||"対象キー"===e||"回数"===e||this.__self.logger.warn(`変数『${e}』は定義されていません。`,t),this.varsSet.names.add(e),this.varname(e);if(0===n.i){const o=this.__self.funclist[e];if(!o)return`${n.js}/*err:${r}*/`;if("const"===o.type||"var"===o.type)return n.js;if("func"===o.type){if(0===o.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;let n=`sys.__vars[${JSON.stringify(t)}]`;const s=this.findVar(t);null!=s&&(n=s.js),this.addCodeStr(`sys.__stack.push(${n});`)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);return e.value&&(this._convGen(e.value,!0),this.addCodeStr('sys.__vars["それ"] = sys.__stack.pop()')),this.addCode(new m(d,"")),""}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return"continue"===t?this.labelContinue&&this.addCode(this.makeJump(this.labelContinue)):this.labelBreak&&this.addCode(this.makeJump(this.labelBreak)),""}convDefFuncCommon(e,t){const n=""===t;let s=t;n&&(s="無名関数:"+this.loopId++);const r=this.makeLabel(`関数「${s}」:ここまで`);this.addCode(this.makeJump(r));const o=this.makeLabelDirectly(s);o.tag=15,this.addCode(o);const i=new Set;this.varsSet={isFunction:!0,names:i,readonly:new Set},this.varsSet.names.add("それ"),this.varslistSet.push(this.varsSet);const u=n?e.meta:e.name.meta;let c="",a="";c+=`//関数『${s}』の初期化処理\n`,c+="// 引数をローカル変数として登録\n";for(let e=u.varnames.length-1;e>=0;e--){const t=u.varnames[e];c+=` ${this.varname(t)} = sys.__stack.pop();\n`,this.varsSet.names.add(t),a+=""}return c+="// ここまで:引数をローカル変数として登録\n",this.addCodeStr(c),this.used_func.add(s),this.varslistSet[1].names.add(s),this.nako_func[s]={josi:u.josi,fn:`(function(){\n const sys = (arguments.length > 0) ? arguments[arguments.length-1] : {}; \n if (sys.newenv) { \n sys.newenv = false\n sys.__callNakoCodeEntry(sys.__labels['${s}'], sys);\n } else {\n `+a+"\n"+` sys.__callNakoCode(sys.__labels['${s}'], sys.nextIndex, sys);\n if (!sys.inLoop) { sys.nextAsync(sys) }\n } })`,type:"func"},this._convGen(e.block,!1),this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],this.__self.__varslist[1][s]=function(){},this.addCode(new m(d,"")),this.addCode(r),t||this.addCodeStr(`sys.__stack.push('${s}')`),""}convDefTest(e){throw s.ih.fromNode("テスト構文は!非同期モードでは使えません。",e)}convDefFunc(e){const t=o.J.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){const t=e.value,n="sys.__tmp_obj"+this.loopId++;return this.addCodeStr(n+"={}; // convJsonObj::ここから"),t.forEach((e=>{this._convGen(e.value,!0),this._convGen(e.key,!0),this.addCodeStr(`${n}[sys.__stack.pop()]=sys.__stack.pop()`)})),this.addCodeStr(`this.__stack.push(${n}); delete $objName; // convJsonObj::ここまで`),""}convJsonArray(e){const t=e.value;this.addCode(this.makeLabel("convJsonArray::ここから")),t.forEach((e=>this._convGen(e,!0)));const n=t.length;return this.addCodeStr(`sys.__stack.push(sys.__stack.splice(sys.__stack.length-${n},${n}))`),""}convRefArray(e){this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++)this._convGen(t[e],!0),this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);");return""}convLetArray(e){this._convGen(e.value,!0),this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++){if(this._convGen(t[e],!0),e===t.length-1){this.addCodeStr("const idx = this.__stack.pop();const obj = this.__stack.pop();const val = this.__stack.pop();obj[idx]=val;");break}this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);")}return""}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(this.flagLoop=!0,null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.varname("それ"),s=this.loopId++,r=`sys.__tmp__i${s}`,o=`sys.__tmp__to${s}`;this._convGen(e.from,!0),this._convGen(e.to,!0),this.addCodeStr(`${o}=sys.__stack.pop();${r}=sys.__stack.pop();`),this.addCodeStr(`${n} = ${t} = ${r}`);const i=this.makeLabel("繰返:条件確認"),u=this.makeLabel("繰返:加算");this.addCode(i);const c=this.makeLabel("繰返:ここまで");return this.addCodeStr(`sys.__stack.push(${t} <= ${o})`),this.addCode(this.makeJumpIfFalse(c)),this.labelContinue=u,this.labelBreak=c,this.convGenLoop(e.block),this.addCode(u),this.addCodeStr(`${n} = ++${t};`),this.addCode(this.makeJump(i)),this.addCode(c),this.addCodeStr(`delete ${r};delete ${o};//繰返:掃除`),this.flagLoop=!1,""}convForeach(e){this.flagLoop=!0;let t='__v0["対象"]';e.name&&(t=this.varname(e.name.value),this.varsSet.names.add(e.name.value));if(null===e.target)throw s.ih.fromNode("『反復』の対象がありません。",e);const n=this.varname("それ"),r="sys.__tmp__target"+this.loopId++,o="sys.__tmp__keys"+this.loopId++,i="sys.__tmp__i"+this.loopId++,u="sys.__tmp__count"+this.loopId++;this._convGen(e.target,!0);const c=`// 反復: 初期化\n${r} = sys.__stack.pop();\n${i} = 0;\nif (typeof(${r}) == 'string' || typeof(${r}) == 'number') { ${r} = [${r}]; }\nif (${r} instanceof Array) { ${u} = ${r}.length; }\nelse { // キーの一覧を得る\n ${o} = Object.keys(${r}); \n // hasOwnPropertyがfalseならばkeyを消す処理\n ${o} = ${o}.filter((key)=>{ return ${r}.hasOwnProperty(key) })\n ${u} = ${o}.length;\n}\n`;this.addCodeStr(c);const a=this.makeLabel("反復:条件確認"),f=this.makeLabel("反復:加算"),l=this.makeLabel("反復:ここまで");this.labelBreak=l,this.labelContinue=f,this.addCode(a);const h=`if (${r} instanceof Array) {\n ${t} = ${n} = ${r}[${i}]; __v0["対象キー"] = ${i};\n} else {\n __v0["対象キー"] = ${o}[${i}]; ${t} = ${n} = ${r}[__v0["対象キー"]];\n}\n`;return this.addCodeStr(`${h}\nsys.__stack.push(${i} < ${u});`),this.addCode(this.makeJumpIfFalse(l)),this.convGenLoop(e.block),this.addCode(f),this.addCodeStr(`${i}++`),this.addCode(this.makeJump(a)),this.addCode(l),this.flagLoop=!1,""}convWhile(e){this.flagLoop=!0;const t=this.makeLabel("間:ここから"),n=this.makeLabel("間:ここまで");return this.labelContinue=t,this.labelBreak=n,this.addCode(t),this._convGen(e.cond,!0),this.addCode(this.makeJumpIfFalse(n)),this.convGenLoop(e.block),this.addCode(this.makeJump(t)),this.addCode(n),this.flagLoop=!1,""}convSpeedMode(e,t){return""}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++,this._convGen(e.block,t),this.performanceMonitor=n}convSwitch(e){this._convGen(e.value,!0);const t="sys.__tmp__i"+this.loopId++;this.addCodeStr(`${t} = sys.__stack.pop()`);const n=this.makeLabel("条件分岐:ここまで"),s=e.cases;for(let e=0;e<s.length;e++){const r=s[e][0];if("違えば"===r.type)this.convGenLoop(s[e][1]);else{const o=this.makeLabel("条件分岐:次");this._convGen(r,!0),this.addCodeStr(`sys.__stack.push(sys.__stack.pop() == ${t})`),this.addCode(this.makeJumpIfFalse(o)),this.convGenLoop(s[e][1]),this.addCode(this.makeJump(n)),this.addCode(o)}}return this.addCode(n),this.addCodeStr(`delete ${t}//条件分岐:掃除`),""}convFuncGetArgsCalcType(e,t,n){const s={};for(let e=0;e<n.args.length;e++){const t=n.args[e];0===e&&null===t?(this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"),s.sore=!0):this._convGen(t,!0)}return s}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convFunc(e,t){let n=!1,r=!1;const i=o.J.getFuncName(e.name),u=this.findVar(i);if(null===u)throw s.ih.fromNode(`関数『${i}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let c;if(0===u.i){if(c=this.__self.funclist[i],"func"!==c.type)throw s.ih.fromNode(`『${i}』は関数ではありません。`,e);n=!0}else c=this.nako_func[i],void 0===c&&(r=!0,c={return_none:!1});if("func_pointer"===e.type)return u.js;const a=this.convFuncGetArgsCalcType(i,c,e);this.used_func.add(i);let f="",l="";e.setter&&(f+=";__self.isSetter = true;\n",l+=";__self.isSetter = false;\n"),a.sore&&(f+="/*[sore]*/");const d=e.args.length;let _="";n?(_+=f,_+=`const args = sys.__stack.splice(sys.__stack.length - ${d}, ${d});\n`,_+="args.push(sys);\n",_+=`const ret = ${u.js}.apply(sys, args);\n`,c.return_none||(_+="sys.__vars['それ'] = ret;\n",t&&(_+="sys.__stack.push(ret);\n")),_+=l,this.addCodeStr(_)):(r?this.addCode(new m(p,i)):this.addCode(new m(h,i)),t||this.addCodeStr("sys.__stack.pop();// 戻り値を利用しない関数呼出"))}convRenbun(e){this._convGen(e.left,!1),this._convGen(e.right,!0)}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"},n=e.operator;this._convGen(e.left,!0),this._convGen(e.right,!0);let s="const rv = sys.__stack.pop();\nconst lv = sys.__stack.pop();\n";if("^"===n)s+="const v = (Math.pow(lv, rv))\n";else{s+=`const v = ((lv) ${t[n]||n} (rv));\n`}s+=`sys.__stack.push(v); //op:${n}\n`,this.addCodeStr(s)}convLet(e){let t="";null===e.value?this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"):this._convGen(e.value,!0);const n=e.name.value,r=this.findVar(n);if(null===r)this.varsSet.names.add(n),t=`${this.varname(n)}=sys.__stack.pop();`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);t=`${r.js}=sys.__stack.pop();`}this.addCodeStr(t+"//let")}convDefLocalVar(e){null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const t=e.name.value,n=e.vartype;if(this.varsSet.names.has(t))throw s.ih.fromNode(`${n}『${t}』の二重定義はできません。`,e);return this.varsSet.names.add(t),"定数"===n&&this.varsSet.readonly.add(t),this.addCodeStr(`${this.varname(t)}=sys.__stack.pop()`),""}convDefLocalVarlist(e){const t=e.vartype;null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const n=`sys.__tmp_i${this.loopId}`;this.loopId++,this.addCodeStr(`${n}=sys.__stack.pop();if (!(${n} instanceof Array)) { ${n}=[${n}] }`);for(const r of e.names){const o=r.value;if(this.varsSet.names.has(o))throw s.ih.fromNode(`${t}『${o}』の二重定義はできません。`,e);this.varsSet.names.add(o),"定数"===t&&this.varsSet.readonly.add(o);const i=this.varname(o);this.addCodeStr(`${i}=${n}.pop()`)}return this.addCodeStr(`delete ${n}//複数代入:掃除`),""}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n)throw new Error("[システムエラー] ジェネレーターでの文字列の展開はサポートしていません");return this.addCodeStr(`sys.__stack.push("${t}")//string`),'"'+t+'"'}convTryExcept(e){const t=this.makeLabel("エラー監視:ならば"),n=this.makeLabel("エラー監視:ここまで");this.addCode(new m(_,t.value)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(t),this._convGen(e.errBlock,!1),this.addCode(n)}}if("object"==typeof navigator&&"object"==typeof navigator.nako3){const e=navigator.nako3;e.addCodeGenerator&&e.addCodeGenerator("非同期モード",NakoGenAsync)}},4159:function(e,t,n){"use strict";n.r(t),n.d(t,{josiList:function(){return s},josiRE:function(){return c},removeJosiList:function(){return o},removeJosiMap:function(){return u},tararebaJosiList:function(){return r},tararebaMap:function(){return i}});const s=["について","くらい","なのか","までを","までの","による","とは","から","まで","だけ","より","ほど","など","いて","えて","きて","けて","して","って","にて","みて","めて","ねて","では","には","は~","んで","ずつ","は","を","に","へ","で","と","が","の"],r=["でなければ","なければ","ならば","なら","たら","れば"],o=["こと","である","です","します","でした"],i={};r.forEach((e=>{s.push(e),i[e]=!0}));const u={};o.forEach((e=>{s.push(e),u[e]=!0})),s.sort(((e,t)=>t.length-e.length));const c=new RegExp("^[\\t ]*("+s.join("|")+")")},8497:function(e,t,n){"use strict";n.r(t),t.default={"回":"回","回繰返":"回","間":"間","間繰返":"間","繰返":"繰返","増繰返":"増繰返","減繰返":"減繰返","後判定":"後判定","反復":"反復","抜":"抜ける","続":"続ける","戻":"戻る","先":"先に","次":"次に","代入":"代入","実行速度優先":"実行速度優先","パフォーマンスモニタ適用":"パフォーマンスモニタ適用","定":"定める","逐次実行":"逐次実行","条件分岐":"条件分岐","増":"増","減":"減","変数":"変数","定数":"定数","エラー監視":"エラー監視","エラー":"エラー","それ":"word","そう":"word","関数":"def_func","インデント構文":"インデント構文","非同期モード":"非同期モード","DNCLモード":"DNCLモード","モード設定":"モード設定","取込":"取込"}},4908:function(e,t){"use strict";t.Z={version:"3.3.2",major:3,minor:3,patch:2}},9218:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){"use strict";var _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(1701),_nako_version_mjs__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4908);__webpack_exports__.Z={meta:{type:"const",value:{pluginName:"plugin_system",pluginVersion:"3.2.24",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.2.24"}},"初期化":{type:"func",josi:[],pure:!1,fn:function(e){e.__v0["ナデシコバージョン"]=void 0===_nako_version_mjs__WEBPACK_IMPORTED_MODULE_1__.Z?"?":_nako_version_mjs__WEBPACK_IMPORTED_MODULE_1__.Z.version,e.__findVar=function(t,n){if("function"==typeof t)return t;if(e.__locals[t])return e.__locals[t];for(let n=2;n>=0;n--){const s=e.__varslist[n];if(s[t])return s[t]}return n},e.__findFunc=function(t,n){const s=e.__findVar(t);if("function"==typeof s)return s;throw new Error(`『${n}』に実行できない関数が指定されました。`)},e.__exec=function(t,n){const s=e.__v0[t];if(s)return s.apply(this,n);const r=e.__findVar(t);if(!r)throw new Error("システム関数でエイリアスの指定ミス:"+t);return r.apply(this,n)},e.__timeout=[],e.__interval=[];const t=e.__zero2=e=>(e="00"+e).substring(e.length-2);e.__zero=(e,t)=>{let n="";for(let e=0;e<t;e++)n+="0";return(e=n+e).substring(e.length-t)},e.__formatDate=e=>e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),e.__formatTime=e=>t(e.getHours())+":"+t(e.getSeconds())+":"+t(e.getMinutes()),e.__formatDateTime=(e,n)=>{const s=e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),r=t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds());return n.match(/^\d+\/\d+\/\d+\s+\d+:\d+:\d+$/)?s+" "+r:n.match(/^\d+\/\d+\/\d+$/)?s:n.match(/^\d+:\d+:\d+$/)?r:s+" "+r},e.__str2date=e=>{if((e=(""+e).replace(/(^\s+|\s+$)/,"")).match(/^(\d+|\d+\.\d+)$/))return new Date(1e3*parseFloat(e));if(e.match(/^\d+\:\d+(\:\d+)?$/)){const t=new Date,n=(e+":0").split(":");return new Date(t.getFullYear(),t.getMonth(),t.getDate(),n[0],n[1],n[2])}e=e.replace(/[\-\s\:]/g,"/");const t=(e+="/0/0/0").split("/");return new Date(t[0],t[1]-1,t[2],t[3],t[4],t[5])},e.__printPool=""}},"!クリア":{type:"func",josi:[],pure:!1,fn:function(e){e.__exec("全タイマー停止",[e]),"非同期モード"===e.__genMode&&e.__stopAsync(e)}},"ナデシコバージョン":{type:"const",value:"?"},"ナデシコエンジン":{type:"const",value:"nadesi.com/v3"},"ナデシコ種類":{type:"const",value:"wnako3/cnako3"},"はい":{type:"const",value:1},"いいえ":{type:"const",value:0},"真":{type:"const",value:1},"偽":{type:"const",value:0},"永遠":{type:"const",value:1},"オン":{type:"const",value:1},"オフ":{type:"const",value:0},"改行":{type:"const",value:"\n"},"タブ":{type:"const",value:"\t"},"カッコ":{type:"const",value:"「"},"カッコ閉":{type:"const",value:"」"},"波カッコ":{type:"const",value:"{"},"波カッコ閉":{type:"const",value:"}"},OK:{type:"const",value:!0},NG:{type:"const",value:!1},"キャンセル":{type:"const",value:0},PI:{type:"const",value:Math.PI},"空":{type:"const",value:""},NULL:{type:"const",value:null},undefined:{type:"const",value:void 0},"未定義":{type:"const",value:void 0},"エラーメッセージ":{type:"const",value:""},"対象":{type:"const",value:""},"対象キー":{type:"const",value:""},"回数":{type:"const",value:""},CR:{type:"const",value:"\r"},LF:{type:"const",value:"\n"},"非数":{type:"const",value:NaN},"無限大":{type:"const",value:1/0},"空配列":{type:"func",josi:[],pure:!0,fn:function(e){return[]}},"空辞書":{type:"func",josi:[],pure:!0,fn:function(e){return{}}},"空ハッシュ":{type:"func",josi:[],pure:!0,fn:function(e){return{}}},"空オブジェクト":{type:"func",josi:[],pure:!1,fn:function(e){return e.__exec("空ハッシュ",[e])}},"表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){e=t.__printPool+e,t.__printPool="",t.__varslist[0]["表示ログ"]+=e+"\n",t.logger.send("stdout",e+"")},return_none:!0},"継続表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__printPool+=e},return_none:!0},"連続表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("表示",[n,t])},return_none:!0},"連続無改行表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("継続表示",[n,t])},return_none:!0},"表示ログ":{type:"const",value:""},"表示ログクリア":{type:"func",josi:[],pure:!0,fn:function(e){e.__varslist[0]["表示ログ"]=""},return_none:!0},"言":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.logger.send("stdout",e+"")},return_none:!0},"コンソール表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){console.log(e)},return_none:!0},"足":{type:"func",josi:[["に","と"],["を"]],isVariableJosi:!1,pure:!0,fn:function(e,t){return e+t}},"引":{type:"func",josi:[["から"],["を"]],pure:!0,fn:function(e,t){return e-t}},"掛":{type:"func",josi:[["に","と"],["を"]],pure:!0,fn:function(e,t){return e*t}},"倍":{type:"func",josi:[["の"],[""]],pure:!0,fn:function(e,t){return e*t}},"割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e/t}},"割余":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e%t}},"偶数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return e%2==0}},"奇数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return e%2==1}},"二乗":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e*e}},"べき乗":{type:"func",josi:[["の"],["の"]],pure:!0,fn:function(e,t){return Math.pow(e,t)}},"以上":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>=t}},"以下":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<=t}},"未満":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<t}},"超":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>t}},"等":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e===t}},"等無":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e!==t}},"一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)===JSON.stringify(t)}return e===t}},"不一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)!==JSON.stringify(t)}return e!==t}},"範囲内":{type:"func",josi:[["が"],["から"],["の"]],pure:!0,fn:function(e,t,n){return t<=e&&e<=n}},"連続加算":{type:"func",josi:[["を"],["に","と"]],isVariableJosi:!0,pure:!0,fn:function(e,...t){return t.pop(),t.push(e),t.reduce(((e,t)=>e+t))}},"ください":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"お願":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"です":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"拝啓":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu=0},return_none:!0},"敬具":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu+=100},return_none:!0},"礼節レベル取得":{type:"func",josi:[],pure:!0,fn:function(e){return e.__reisetu||(e.__reisetu=0),e.__reisetu}},"JS実行":{type:"func",josi:[["を","で"]],pure:!0,fn:function(src,sys){return eval(src)}},"JSオブジェクト取得":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__findVar(e,null)}},"JS関数実行":{type:"func",josi:[["を"],["で"]],fn:function(name,args,sys){if("string"==typeof name&&(name=eval(name)),"function"!=typeof name)throw new Error("JS関数取得で実行できません。");return args instanceof Array||(args=[args]),name.apply(null,args)}},"JSメソッド実行":{type:"func",josi:[["の"],["を"],["で"]],fn:function(obj,m,args,sys){if("string"==typeof obj&&(obj=eval(obj)),"object"!=typeof obj)throw new Error("JSオブジェクトを取得できませんでした。");return"function"!=typeof m&&(m=obj[m]),args instanceof Array||(args=[args]),m.apply(obj,args)}},"ナデシコ":{type:"func",josi:[["を","で"]],pure:!1,fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ」は利用できません。");t.__varslist[0]["表示ログ"]="",t.__self.runEx(e,"immediate-code.nako3",{resetEnv:!1,resetLog:!0});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.send("stdout",n),n}},"ナデシコ続":{type:"func",josi:[["を","で"]],fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ続」は利用できません。");t.__self.runEx(e,"immediate-code.nako3",{resetEnv:!1,resetLog:!1});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.send("stdout",n),n}},"実行":{type:"func",josi:[["を","に","で"]],pure:!1,fn:function(e,t){if("function"==typeof e)return e(t);if("string"==typeof e){const n=t.__findFunc(e,"実行");if("function"==typeof n)return n(t)}return e}},"実行時間計測":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){if("string"==typeof e&&(e=t.__findFunc(e,"実行時間計測")),performance&&performance.now){const n=performance.now();e(t);return performance.now()-n}{const n=Date.now();e(t);return Date.now()-n}}},"変数型確認":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},TYPEOF:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},"文字列変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},TOSTR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},"整数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},TOINT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},"実数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},TOFLOAT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},INT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e)}},FLOAT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseFloat(e)}},"NAN判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return isNaN(e)}},"非数判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Number.isNaN(e)}},HEX:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e).toString(16)}},"進数変換":{type:"func",josi:[["を","の"],[""]],pure:!0,fn:function(e,t){return parseInt(e).toString(t)}},"二進":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return parseInt(e).toString(2)}},"二進表示":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n=parseInt(e).toString(2);t.__exec("表示",[n,t])}},RGB:{type:"func",josi:[["と"],["の"],["で"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+parseInt(e).toString(16);return t.substr(t.length-2,2)};return"#"+s(e)+s(t)+s(n)}},"論理OR":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e||t}},"論理AND":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&&t}},"論理NOT":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e?0:1}},OR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e|t}},AND:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&t}},XOR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e^t}},NOT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return~e}},SHIFT_L:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e<<t}},SHIFT_R:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>t}},SHIFT_UR:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>>t}},"文字数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Array.from?Array.from(e).length:String(e).length}},"何文字目":{type:"func",josi:[["で","の"],["が"]],pure:!0,fn:function(e,t){return String(e).indexOf(t)+1}},CHR:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.fromCodePoint?String.fromCodePoint(e):String.fromCharCode(e)}},ASC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.prototype.codePointAt?String(e).codePointAt(0):String(e).charCodeAt(0)}},"文字挿入":{type:"func",josi:[["で","の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){t<=0&&(t=1);const s=String(e);return s.substr(0,t-1)+n+s.substr(t-1)}},"文字検索":{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){let s=String(e);s=s.substr(t);const r=s.indexOf(n);return-1===r?0:r+1+t}},"追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return String(e)+String(t)}},"一行追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return String(e)+String(t)+"\n"}},"文字列分解":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return Array.from?Array.from(e):String(e).split("")}},"リフレイン":{type:"func",josi:[["を","の"],["で"]],pure:!0,fn:function(e,t){let n="";for(let s=0;s<t;s++)n+=String(e);return n}},"出現回数":{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return(e=""+e).split(t=""+t).length-1}},MID:{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){return n=n||void 0,String(e).substr(t-1,n)}},"文字抜出":{type:"func",josi:[["で","の"],["から"],["を",""]],pure:!0,fn:function(e,t,n){return n=n||void 0,String(e).substr(t-1,n)}},LEFT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return String(e).substr(0,t)}},"文字左部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return String(e).substr(0,t)}},RIGHT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return(e=""+e).substr(e.length-t,t)}},"文字右部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return(e=""+e).substr(e.length-t,t)}},"区切":{type:"func",josi:[["の","を"],["で"]],pure:!0,fn:function(e,t){return(""+e).split(""+t)}},"文字列分割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=(e=""+e).indexOf(t=""+t);return n<0?[e]:[e.substr(0,n),e.substr(n+t.length)]}},"切取":{type:"func",josi:[["から","の"],["まで","を"]],pure:!0,fn:function(e,t,n){const s=(e=String(e)).indexOf(t);return s<0?(n.__v0["対象"]="",e):(n.__v0["対象"]=e.substr(s+t.length),e.substr(0,s))}},"文字削除":{type:"func",josi:[["の"],["から"],["だけ","を",""]],pure:!0,fn:function(e,t,n){return(e=""+e).substr(0,t-1)+e.substr(t-1+n)}},"置換":{type:"func",josi:[["の","で"],["を","から"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).split(t).join(n)}},"単置換":{type:"func",josi:[["の","で"],["を"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).replace(t,n)}},"トリム":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"空白除去":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"大文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toUpperCase()}},"小文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toLowerCase()}},"平仮名変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\u30a1-\u30f6]/g,(function(e){const t=e.charCodeAt(0)-96;return String.fromCharCode(t)}))}},"カタカナ変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\u3041-\u3096]/g,(function(e){const t=e.charCodeAt(0)+96;return String.fromCharCode(t)}))}},"英数全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"英数記号全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\x20-\x7F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数記号半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\uFF00-\uFF5F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"カタカナ全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],o=t.__v0["半角カナ濁音一覧"];let i="",u=0;for(;u<e.length;){const t=e.substr(u,2),c=o.indexOf(t);if(c>=0){i+=r.charAt(c/2),u+=2;continue}const a=e.charAt(u),f=s.indexOf(a);f>=0?(i+=n.charAt(f),u++):(i+=a,u++)}return i}},"カタカナ半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],o=t.__v0["半角カナ濁音一覧"];return e.split("").map((e=>{const t=n.indexOf(e);if(t>=0)return s.charAt(t);const i=r.indexOf(e);return i>=0?o.substr(2*i,2):e})).join("")}},"全角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ全角変換",[n,t]),n=t.__exec("英数記号全角変換",[n,t]),n}},"半角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ半角変換",[n,t]),n=t.__exec("英数記号半角変換",[n,t]),n}},"全角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」"},"全角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"半角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」゙゚"},"半角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"JSONエンコード":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e)}},"JSONエンコード整形":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e,null,2)}},"JSONデコード":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return JSON.parse(e)}},"正規表現マッチ":{type:"func",josi:[["を","が"],["で","に"]],pure:!0,fn:function(e,t,n){let s;const r=t.match(/^\/(.+)\/([a-zA-Z]*)$/);s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]);const o=n.__varslist[0]["抽出文字列"]=[],i=String(e).match(s);let u=i;if(s.global);else if(i&&i.length>0){u=i[0];for(let e=1;e<i.length;e++)o[e-1]=i[e]}return u}},"抽出文字列":{type:"const",value:[]},"正規表現置換":{type:"func",josi:[["の"],["を","から"],["で","に","へ"]],pure:!0,fn:function(e,t,n){let s;const r=t.match(/^\/(.+)\/([a-zA-Z]*)/);return s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]),String(e).replace(s,n)}},"正規表現区切":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){let n;const s=t.match(/^\/(.+)\/([a-zA-Z]*)/);return n=null===s?new RegExp(t,"g"):new RegExp(s[1],s[2]),String(e).split(n)}},"通貨形式":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return String(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},"ゼロ埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n="0";for(let e=0;e<t;e++)n+="0";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substr(s.length-t,t)}},"空白埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n=" ";for(let e=0;e<t;e++)n+=" ";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substr(s.length-t,t)}},"かなか判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12353&&t<=12447}},"カタカナ判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12449&&t<=12538}},"数字判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){const t=String(e).charAt(0);return t>="0"&&t<="9"||t>="0"&&t<="9"}},"数列判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){return null!==String(e).match(/^[0-9.]+$/)}},"配列結合":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.join(""+t);return String(e).split("\n").join(""+t)}},"配列検索":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.indexOf(t):-1}},"配列要素数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e instanceof Array?e.length:e instanceof Object?Object.keys(e).length:1}},"要素数":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("配列要素数",[e])}},"配列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,0,n);throw new Error("『配列挿入』で配列以外の要素への挿入。")}},"配列一括挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array&&n instanceof Array){for(let s=0;s<n.length;s++)e.splice(t+s,0,n[s]);return e}throw new Error("『配列一括挿入』で配列以外の要素への挿入。")}},"配列ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列数値ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort(((e,t)=>parseFloat(e)-parseFloat(t)));throw new Error("『配列数値ソート』で配列以外が指定されました。")}},"配列カスタムソート":{type:"func",josi:[["で"],["の","を"]],pure:!1,fn:function(e,t,n){let s=e;if("string"==typeof e&&(s=n.__findFunc(e,"配列カスタムソート")),t instanceof Array)return t.sort(s);throw new Error("『配列カスタムソート』で配列以外が指定されました。")}},"配列逆順":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.reverse();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列シャッフル":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[n],e[n]=s}return e}throw new Error("『配列シャッフル』で配列以外が指定されました。")}},"配列削除":{type:"func",josi:[["の","から"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("配列切取",[e,t,n])}},"配列切取":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array){const n=e.splice(t,1);return n instanceof Array?n[0]:null}if(!(e instanceof Object&&"string"==typeof t))throw new Error("『配列切取』で配列以外を指定。");if(e[t]){const n=e[t];return delete e[t],n}}},"配列取出":{type:"func",josi:[["の"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,n);throw new Error("『配列取出』で配列以外を指定。")}},"配列ポップ":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){if(e instanceof Array)return e.pop();throw new Error("『配列ポップ』で配列以外の処理。")}},"配列追加":{type:"func",josi:[["に","へ"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.push(t),e;throw new Error("『配列追加』で配列以外の処理。")}},"配列複製":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return JSON.parse(JSON.stringify(e))}},"配列足":{type:"func",josi:[["に","へ","と"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.concat(t):JSON.parse(JSON.stringify(e))}},"配列最大値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.max(e,t)))}},"配列最小値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.min(e,t)))}},"配列合計":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(e instanceof Array){let t=0;return e.forEach((e=>{const n=parseFloat(e);isNaN(n)||(t+=n)})),t}throw new Error("『配列合計』で配列変数以外の値が指定されました。")}},"表ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>{const s=e[t],r=n[t];return s===r?0:s<r?-1:1})),e}},"表数値ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表数値ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>e[t]-n[t])),e}},"表ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表ピックアップ』には配列を指定する必要があります。");return e.filter((e=>String(e[t]).indexOf(n)>=0))}},"表完全一致ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表完全ピックアップ』には配列を指定する必要があります。");return e.filter((e=>e[t]===n))}},"表検索":{type:"func",josi:[["の"],["で","に"],["から"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表検索』には配列を指定する必要があります。");for(let r=n;r<e.length;r++)if(e[r][t]===s)return r;return-1}},"表列数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表列数』には配列を指定する必要があります。");let t=1;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);return t}},"表行数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表行数』には配列を指定する必要があります。");return e.length}},"表行列交換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表行列交換』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=void 0!==e[r][t]?e[r][t]:""}return r}},"表右回転":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表右回転』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=e[s-r-1][t]}return r}},"表重複削除":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表重複削除』には配列を指定する必要があります。");const s=[],r={};for(let n=0;n<e.length;n++){const o=e[n][t];void 0===r[o]&&(r[o]=!0,s.push(e[n]))}return s}},"表列取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表列取得』には配列を指定する必要があります。");return e.map((e=>e[t]))}},"表列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表列挿入』には配列を指定する必要があります。");const s=[];return e.forEach(((e,r)=>{let o=[];t>0&&(o=o.concat(e.slice(0,t))),o.push(n[r]),o=o.concat(e.slice(t)),s.push(o)})),s}},"表列削除":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列削除』には配列を指定する必要があります。");const n=[];return e.forEach(((e,s)=>{const r=e.slice(0);r.splice(t,1),n.push(r)})),n}},"表列合計":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列合計』には配列を指定する必要があります。");let n=0;return e.forEach((e=>{n+=e[t]})),n}},"表曖昧検索":{type:"func",josi:[["の"],["から"],["で"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表曖昧検索』には配列を指定する必要があります。");const r=new RegExp(s);for(let t=0;t<e.length;t++){const s=e[t];if(r.test(s[n]))return t}return-1}},"表正規表現ピックアップ":{type:"func",josi:[["の","で"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表正規表現ピックアップ』には配列を指定する必要があります。");const s=new RegExp(n),r=[];for(let n=0;n<e.length;n++){const o=e[n];s.test(o[t])&&r.push(o.slice(0))}return r}},"辞書キー列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(n);return t}if(e instanceof Array){for(let n=0;n<e.length;n++)t.push(n);return t}throw new Error("『辞書キー列挙』でハッシュ以外が与えられました。")}},"辞書キー削除":{type:"func",josi:[["から","の"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Object)return e[t]&&delete e[t],e;throw new Error("『辞書キー削除』でハッシュ以外が与えられました。")}},"辞書キー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"ハッシュキー列挙":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("辞書キー列挙",[e,t])}},"ハッシュ内容列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(e[n]);return t}throw new Error("『ハッシュ内容列挙』でハッシュ以外が与えられました。")}},"ハッシュキー削除":{type:"func",josi:[["から","の"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("辞書キー削除",[e,t,n])}},"ハッシュキー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"秒待":{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:function(e,t){return new Promise(((t,n)=>{setTimeout((()=>{t()}),1e3*e)}))},return_none:!0},"秒待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode){if(void 0===t.resolve)throw new Error("『秒待機』命令は『!非同期モード』で使ってください。");t.__exec("秒逐次待機",[e,t])}else{const n=t.setAsync(t);setTimeout((()=>{t.compAsync(t,n)}),1e3*e)}},return_none:!0},"秒逐次待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if(void 0===t.resolve)throw new Error("『秒逐次待機』命令は『逐次実行』構文と一緒に使ってください。");const n=t.resolve;t.resolveCount++;const s=setTimeout((function(){const e=t.__timeout.indexOf(s);e>=0&&t.__timeout.splice(e,1),n()}),1e3*e);t.__timeout.unshift(s)},return_none:!0},"秒後":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒後"));const s=setTimeout((()=>{const t=n.__timeout.indexOf(s);t>=0&&n.__timeout.splice(t,1),"非同期モード"===n.__genMode&&(n.newenv=!0);try{e(s,n)}catch(e){let t=e;e instanceof _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as||(t=new _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as(e,n.__varslist[0].line)),n.logger.error(t)}}),1e3*parseFloat(t));return n.__timeout.unshift(s),n.__v0["対象"]=s,s}},"秒毎":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒毎"));const s=setInterval((()=>{"非同期モード"===n.__genMode&&(n.newenv=!0),e(s,n)}),1e3*parseFloat(t));return n.__interval.unshift(s),n.__v0["対象"]=s,s}},"秒タイマー開始時":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){return n.__exec("秒毎",[e,t,n])}},"タイマー停止":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e,t){const n=t.__interval.indexOf(e);if(n>=0)return t.__interval.splice(n,1),clearInterval(e),!0;const s=t.__timeout.indexOf(e);return s>=0&&(t.__timeout.splice(s,1),clearTimeout(e),!0)},return_none:!1},"全タイマー停止":{type:"func",josi:[],pure:!0,fn:function(e){for(let t=0;t<e.__interval.length;t++){const n=e.__interval[t];clearInterval(n)}e.__interval=[];for(let t=0;t<e.__timeout.length;t++){const n=e.__timeout[t];clearTimeout(n)}e.__timeout=[]},return_none:!0},"元号データ":{type:"const",value:[{"元号":"令和","改元日":"2019/05/01"},{"元号":"平成","改元日":"1989/01/08"},{"元号":"昭和","改元日":"1926/12/25"},{"元号":"大正","改元日":"1912/07/30"},{"元号":"明治","改元日":"1868/10/23"}]},"今":{type:"func",josi:[],pure:!0,fn:function(){const e=e=>(e="00"+e).substr(e.length-2,2),t=new Date;return e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())}},"システム時間":{type:"func",josi:[],pure:!0,fn:function(){const e=new Date;return Math.floor(e.getTime()/1e3)}},"システム時間ミリ秒":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getTime()}},"今日":{type:"func",josi:[],pure:!0,fn:function(e){return e.__formatDate(new Date)}},"明日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()+864e5;return e.__formatDate(new Date(t))}},"昨日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()-864e5;return e.__formatDate(new Date(t))}},"今年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()}},"来年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()+1}},"去年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()-1}},"今月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+1}},"来月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+2}},"先月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()}},"曜日":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){const n=t.__str2date(e);return"日月火水木金土".charAt(n.getDay()%7)}},"曜日番号取得":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e.split("/");return new Date(t[0],t[1]-1,t[2]).getDay()}},"UNIXTIME変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"UNIX時間変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"日時変換":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e,t){const n=1e3*e;return t.__formatDateTime(new Date(n),"2022/01/01 00:00:00")}},"日時書式変換":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return t=t.replace(/(YYYY|ccc|WWW|MMM|YY|MM|DD|HH|mm|ss|[MDHmsW])/g,(e=>{switch(e){case"YYYY":return s.getFullYear();case"YY":return(""+s.getFullYear()).substring(2);case"MM":return n.__zero2(s.getMonth()+1);case"DD":return n.__zero2(s.getDate());case"M":return s.getMonth()+1;case"D":return s.getDate();case"HH":return n.__zero2(s.getHours());case"mm":return n.__zero2(s.getMinutes());case"ss":return n.__zero2(s.getSeconds());case"ccc":return n.__zero(s.getMilliseconds(),3);case"H":return s.getHours();case"m":return s.getMinutes();case"s":return s.getSeconds();case"W":return"日月火水木金土".charAt(s.getDay()%7);case"WWW":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][s.getDay()%7];case"MMM":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][s.getMonth()]}return e}))}},"和暦変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){const n=t.__str2date(e),s=n.getTime();for(const e of t.__v0["元号データ"]){const r=e["元号"],o=t.__str2date(e["改元日"]);if(o.getTime()<=s){let e=n.getFullYear()-o.getFullYear()+1;return 1==e&&(e="元"),r+e+"年"+t.__zero2(n.getMonth()+1)+"月"+t.__zero2(n.getDate())+"日"}}throw new Error("『和暦変換』は明示以前の日付には対応していません。")}},"年数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return n.__str2date(t).getFullYear()-s.getFullYear()}},"月数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e),r=n.__str2date(t);return 12*r.getFullYear()+r.getMonth()-(12*s.getFullYear()+s.getMonth())}},"日数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/86400)}},"時間差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/3600)}},"分差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/60)}},"秒差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil(r-s)}},"日時差":{type:"func",josi:[["と","から"],["の","までの"],["による"]],pure:!0,fn:function(e,t,n,s){switch(n){case"年":return s.__exec("年数差",[e,t,s]);case"月":return s.__exec("月数差",[e,t,s]);case"日":return s.__exec("日数差",[e,t,s]);case"時間":return s.__exec("時間差",[e,t,s]);case"分":return s.__exec("分差",[e,t,s]);case"秒":return s.__exec("秒差",[e,t,s])}throw new Error("『日時差』で不明な単位です。")}},"時間加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){let s=t.charAt(0);"-"!==s&&"+"!==s||(t=t.substring(1));const r=n.__str2date(e),o=(t+":0:0").split(":");let i=60*parseInt(o[0])*60+60*parseInt(o[1])+parseInt(o[2]);"-"===s&&(i*=-1);const u=new Date(r.getTime()+1e3*i);return n.__formatDateTime(u,e)}},"日付加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){let s=1,r=t.charAt(0);"-"!==r&&"+"!==r||(t=t.substring(1),"-"===r&&(s*=-1));const o=n.__str2date(e),i=(t+"/0/0").split("/"),u=parseInt(i[0])*s,c=parseInt(i[1])*s,a=parseInt(i[2])*s;return o.setFullYear(o.getFullYear()+u),o.setMonth(o.getMonth()+c),o.setDate(o.getDate()+a),n.__formatDateTime(o,e)}},"日時加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=(""+t).match(/([+|-]?)(\d+)(年|ヶ月|日|週間|時間|分|秒)$/);if(!s)throw new Error("『日付加算』は『(+|-)1(年|ヶ月|日|時間|分|秒)』の書式で指定します。");switch(s[3]){case"年":return n.__exec("日付加算",[e,`${s[1]}${s[2]}/0/0`,n]);case"ヶ月":return n.__exec("日付加算",[e,`${s[1]}0/${s[2]}/0`,n]);case"週間":return n.__exec("日付加算",[e,`${s[1]}0/0/${7*s[2]}`,n]);case"日":return n.__exec("日付加算",[e,`${s[1]}0/0/${s[2]}`,n]);case"時間":return n.__exec("時間加算",[e,`${s[1]}${s[2]}:0:0`,n]);case"分":return n.__exec("時間加算",[e,`${s[1]}0:${s[2]}:0`,n]);case"秒":return n.__exec("時間加算",[e,`${s[1]}0:0:${s[2]}`,n])}}},"時間ミリ秒取得":{type:"func",josi:[],pure:!0,fn:function(){if(performance&&performance.now)return performance.now();if(Date.now)return Date.now();return(new Date).getTime()}},"エラー発生":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e){throw new Error(e)}},"システム関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.__v0){"function"==typeof e.__v0[n]&&t.push(n)}return t}},"システム関数存在":{type:"func",josi:[["が","の"]],pure:!0,fn:function(e,t){return void 0!==t.__v0[e]}},"プラグイン一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.pluginfiles)t.push(n);return t}},"モジュール一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.__module)t.push(n);return t}},"助詞一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,4159)).then((t=>{const n=Object.assign({},t);e(n.josiList)})).catch((e=>{t(e)}))}))}},"予約語一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,8497)).then((t=>{const n=Object.assign({},t),s=[];for(const e in n.default)s.push(e);e(s)})).catch((e=>{t(e)}))}))}},"プラグイン名":{type:"const",value:"メイン"},"プラグイン名設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){t.__v0["プラグイン名"]=e},return_none:!0},"URLエンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){return encodeURIComponent(e)}},"URLデコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){return decodeURIComponent(e)}},"URLパラメータ解析":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n={};if("string"!=typeof e)return n;const s=e.split("?");if(s.length<=1)return n;const r=s[1].split("&");for(const e of r){const s=(e+"=").split("=");n[t.__exec("URLデコード",[s[0]])]=t.__exec("URLデコード",[s[1]])}return n}},"BASE64エンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.btoa){const t=String.fromCharCode.apply(null,new TextEncoder("UTF-8").encode(e));return btoa(t)}return Buffer.from(e).toString("base64")}},"BASE64デコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.atob){const t=atob(e),n=new Uint8Array(Array.prototype.map.call(t,(e=>e.charCodeAt())));return new TextDecoder("UTF-8").decode(n)}return Buffer.from(e,"base64").toString()}}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};!function(){"use strict";const e={and:1,or:1,eq:2,noteq:2,"===":2,"!==":2,gt:2,gteq:2,lt:2,lteq:2,"&":3,"+":4,"-":4,shift_l:4,shift_r:4,shift_r0:4,"*":5,"/":5,"÷":5,"÷÷":5,"%":5,"^":6},t=["いて","えて","きて","けて","して","って","にて","みて","めて","ねて","には","んで"];var n=__webpack_require__(1701);const s=[];for(const t in e)s.push(t);class r extends class{constructor(e){this.logger=e,this.stackList=[],this.init(),this.tokens=[],this.stack=[],this.index=0,this.y=[],this.genMode="sync",this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1,this.recentlyCalledFunc=[]}init(){this.funclist={},this.reset()}reset(){this.tokens=[],this.index=0,this.stack=[],this.y=[],this.genMode="sync"}setFuncList(e){this.funclist=e}popStack(e){if(!e)return this.stack.pop();for(let t=0;t<this.stack.length;t++){const n=this.stack[t];if(0===e.length||e.indexOf(n.josi)>=0)return this.stack.splice(t,1),this.logger.trace("POP :"+JSON.stringify(n)),n}return null}saveStack(){this.stackList.push(this.stack),this.stack=[]}loadStack(){this.stack=this.stackList.pop()}pushStack(e){this.logger.debug("PUSH:"+JSON.stringify(e)),this.stack.push(e)}isEOF(){return this.index>=this.tokens.length}check(e){return this.tokens[this.index].type===e}check2(e){for(let t=0;t<e.length;t++){const n=t+this.index;if(this.tokens.length<=n)return!1;if("*"===e[t])continue;const s=this.tokens[n];if(e[t]instanceof Array){if(e[t].indexOf(s.type)<0)return!1}else if(s.type!==e[t])return!1}return!0}checkTypes(e){const t=this.tokens[this.index].type;return e.indexOf(t)>=0}accept(e){const t=[],n=this.index,s=()=>(this.index=n,!1);for(let n=0;n<e.length;n++){if(this.isEOF())return s();const r=e[n];if("string"!=typeof r)if("function"!=typeof r){if(!(r instanceof Array))throw new Error("System Error : accept broken : "+typeof r);if(!this.checkTypes(r))return s();t[n]=this.get()}else{const e=r.bind(this)(t);if(null===e)return s();t[n]=e}else{const e=this.get();if(e.type!==r)return s();t[n]=e}}return this.y=t,!0}get(){return this.isEOF()?null:this.tokens[this.index++]}unget(){this.index>0&&this.index--}peek(e=0){return this.isEOF()?null:this.tokens[this.index+e]}peekSourceMap(){const e=this.peek();return null===e?{startOffset:null,endOffset:null,file:void 0,line:0,column:0}:{startOffset:e.startOffset,endOffset:e.endOffset,file:e.file,line:e.line,column:e.column}}nodeToStr(e,t,n){const s=t.depth-1,r=e=>void 0!==t.typeName?t.typeName:e,o=n?" debug: "+JSON.stringify(e,null,2):"";if(!e)return"(NULL)";switch(e.type){case"not":return s>=0?`${r("")}『${this.nodeToStr(e.value,{depth:s},n)}に演算子『not』を適用した式${o}』`:`${r("演算子")}『not』`;case"op":{let t=e.operator;const i={eq:"=",not:"!",gt:">",lt:"<",and:"かつ",or:"または"};if(t in i&&(t=i[t]),s>=0){const i=this.nodeToStr(e.left,{depth:s},n),u=this.nodeToStr(e.right,{depth:s},n);return"eq"===e.operator?`${r("")}『${i}と${u}が等しいかどうかの比較${o}』`:`${r("")}『${i}と${u}に演算子『${t}』を適用した式${o}』`}return`${r("演算子")}『${t}${o}』`}case"number":return`${r("数値")}${e.value}`;case"string":return`${r("文字列")}『${e.value}${o}』`;case"word":return`${r("単語")}『${e.value}${o}』`;case"func":return`${r("関数")}『${e.name||e.value}${o}』`;case"eol":return"行の末尾";case"eof":return"ファイルの末尾";default:{let t=e.name;return t||(t=e.value),"string"!=typeof t&&(t=e.type),`${r("")}『${t}${o}』`}}}}{parse(e){return this.reset(),this.tokens=e,this.startParser()}startParser(){const e=this.ySentenceList(),t=this.get();if(t&&"eof"!==t.type)throw this.logger.debug(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!0)}の使い方が間違っています。`,t),n.ih.fromNode(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!1)}の使い方が間違っています。`,t);return e}ySentenceList(){const e=[];let t=-1;const s=this.peekSourceMap();for(;!this.isEOF();){const n=this.ySentence();if(!n)break;e.push(n),t<0&&(t=n.line)}if(0===e.length){const e=this.peek()||this.tokens[0];throw this.logger.debug("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!0),e),n.ih.fromNode("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!1),e)}return{type:"block",block:e,...s,end:this.peekSourceMap(),genMode:this.genMode}}yEOL(){const e=this.get();if(this.stack.length>0){const t=[];this.stack.forEach((e=>{let n=this.nodeToStr(e,{depth:1},!1);e.josi&&(n+=e.josi),t.push(n)}));const s=t.join(",");let r="",o="A".charCodeAt(0);for(let e of this.recentlyCalledFunc){r+=" - ";let t=0;for(let n of e.josi){r+=String.fromCharCode(o+t),1==n.length?r+=n[0]:r+=`(${n.join("|")})`,t++}r+=e.name+"\n"}throw n.ih.fromNode(`未解決の単語があります: [${s}]\n次の命令の可能性があります:\n${r}`,e)}return this.recentlyCalledFunc=[],e}ySentence(){const e=this.peekSourceMap();if(this.check("eol"))return this.yEOL();if(this.check("もし"))return this.yIF();if(this.check("後判定"))return this.yAtohantei();if(this.check("エラー監視"))return this.yTryExcept();if(this.check("逐次実行"))return this.yTikuji();if(this.accept(["抜ける"]))return{type:"break",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["続ける"]))return{type:"continue",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["require","string","取込"]))return{type:"require",value:this.y[1].value,josi:"",...e,end:this.peekSourceMap()};if(this.accept(["not","非同期モード"]))return this.yASyncMode();if(this.accept(["not","DNCLモード"]))return this.yDNCLMode();if(this.accept(["not","string","モード設定"]))return this.ySetGenMode(this.y[1].value);if(this.check2(["func","←"]))return this.yCallOp();if(this.check2(["func","eq"])){const e=this.get()||{value:"?"};throw n.ih.fromNode(`関数『${e.value}』に代入できません。『←』を使ってください。`,e)}if(this.accept([this.ySpeedMode]))return this.y[0];if(this.accept([this.yPerformanceMonitor]))return this.y[0];if(this.accept([this.yLet]))return this.y[0];if(this.accept([this.yDefTest]))return this.y[0];if(this.accept([this.yDefFunc]))return this.y[0];if(this.accept([this.yCall])){const t=this.y[0];if("して"===t.josi){const n=this.ySentence();if(null!==n)return{type:"block",block:[t,n],josi:n.josi,...e,end:this.peekSourceMap()}}return t}return null}yASyncMode(){const e=this.peekSourceMap();return this.genMode="非同期モード",{type:"eol",...e,end:this.peekSourceMap()}}yDNCLMode(){const e=this.peekSourceMap();return this.arrayIndexFrom=1,this.flagReverseArrayIndex=!0,this.flagCheckArrayInit=!0,{type:"eol",...e,end:this.peekSourceMap()}}ySetGenMode(e){const t=this.peekSourceMap();return this.genMode=e,{type:"eol",...t,end:this.peekSourceMap()}}yBlock(){const e=this.peekSourceMap(),t=[];for(this.check("ここから")&&this.get();!this.isEOF()&&!this.checkTypes(["違えば","ここまで","エラー"])&&this.accept([this.ySentence]);)t.push(this.y[0]);return{type:"block",block:t,...e,end:this.peekSourceMap()}}yDefFuncReadArgs(){if(!this.check("("))return null;const e=[];for(this.get();!this.isEOF();){if(this.check(")")){this.get();break}e.push(this.get()),this.check("comma")&&this.get()}return e}yDefTest(){return this.yDef("def_test")}yDefFunc(){return this.yDef("def_func")}yDef(e){if(!this.check(e))return null;const t=this.peekSourceMap(),s=this.get();let r=[];this.check("(")&&(r=this.yDefFuncReadArgs());const o=this.get();if("func"!==o.type)throw this.logger.debug(this.nodeToStr(o,{depth:0,typeName:"関数"},!0)+"の宣言でエラー。",o),n.ih.fromNode(this.nodeToStr(o,{depth:0,typeName:"関数"},!1)+"の宣言でエラー。",o);if(this.check("(")){if(r.length>0)throw this.logger.debug(this.nodeToStr(o,{depth:0,typeName:"関数"},!0)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",o),n.ih.fromNode(this.nodeToStr(o,{depth:0,typeName:"関数"},!1)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",o);r=this.yDefFuncReadArgs()}this.check("とは")&&this.get();let i=null,u=!1;this.check("ここから")&&(u=!0),this.check("eol")&&(u=!0);try{if(u){if(this.saveStack(),i=this.yBlock(),!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。関数定義の末尾に必要です。",s);this.get(),this.loadStack()}else this.saveStack(),i=this.ySentence(),this.loadStack()}catch(e){throw this.logger.debug(this.nodeToStr(o,{depth:0,typeName:"関数"},!0)+"の定義で以下のエラーがありました。\n"+e.message,s),n.ih.fromNode(this.nodeToStr(o,{depth:0,typeName:"関数"},!1)+"の定義で以下のエラーがありました。\n"+e.message,s)}return{type:e,name:o,args:r,block:i,josi:"",...t,end:this.peekSourceMap()}}yIFCond(){const e=this.peekSourceMap();let t=this.yGetArg();if(!t)return null;if("が"===t.josi){const n=this.index,s=this.yGetArg(),r=this.get();if(s&&"func"!==s.type&&r&&"ならば"===r.type)return{type:"op",operator:"でなければ"===r.value?"noteq":"eq",left:t,right:s,josi:"",...e,end:this.peekSourceMap()};this.index=n}if(""!==t.josi&&(this.stack.push(t),t=this.yCall()),!this.check("ならば"))throw this.logger.debug("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",t),n.ih.fromNode("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",t);return"でなければ"===this.get().value&&(t={type:"not",value:t,josi:"",...e,end:this.peekSourceMap()}),t}yIF(){const e=this.peekSourceMap();if(!this.check("もし"))return null;const t=this.get();for(;this.check("comma");)this.get();let s=null;try{s=this.yIFCond()}catch(e){throw n.ih.fromNode("『もし』文の条件で次のエラーがあります。\n"+e.message,t)}if(null===s)throw n.ih.fromNode("『もし』文で条件の指定が空です。",t);let r=null,o=null,i=!1;for(this.check("eol")?r=this.yBlock():(r=this.ySentence(),i=!0);this.check("eol");)this.get();if(this.check("違えば")){for(this.get();this.check("comma");)this.get();this.check("eol")?o=this.yBlock():(o=this.ySentence(),i=!0)}if(!1===i){if(!this.check("ここまで"))throw n.ih.fromNode("『もし』文で『ここまで』がありません。",t);this.get()}return{type:"if",expr:s,block:r,false_block:o,josi:"",...e,end:this.peekSourceMap()}}ySpeedMode(){const e=this.peekSourceMap();if(!this.check2(["string","実行速度優先"]))return null;const t=this.get();this.get();const n={"行番号無し":!1,"暗黙の型変換無し":!1,"強制ピュア":!1,"それ無効":!1};for(const e of t.value.split("/")){if("全て"===e){for(const e of Object.keys(n))n[e]=!0;break}Object.keys(n).includes(e)?n[e]=!0:this.logger.warn(`実行速度優先文のオプション『${e}』は存在しません。`,t)}let s=!1;this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0);let r=null;return s?(r=this.yBlock(),this.check("ここまで")&&this.get()):r=this.ySentence(),{type:"speed_mode",options:n,block:r,line:t.line,josi:"",...e}}yPerformanceMonitor(){const e=this.peekSourceMap();if(!this.check2(["string","パフォーマンスモニタ適用"]))return null;const t=this.get();this.get();const n={"ユーザ関数":!1,"システム関数本体":!1,"システム関数":!1};for(const e of t.value.split("/")){if("全て"===e){for(const e of Object.keys(n))n[e]=!0;break}Object.keys(n).includes(e)?n[e]=!0:this.logger.warn(`パフォーマンスモニタ適用文のオプション『${e}』は存在しません。`,t)}let s=!1;this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0);let r=null;return s?(r=this.yBlock(),this.check("ここまで")&&this.get()):r=this.ySentence(),{type:"performance_monitor",options:n,block:r,line:t.line,josi:"",...e}}yTikuji(){const e=this.peekSourceMap();if(!this.check("逐次実行"))return null;const t=this.get(),s=[];let r=null;if(!this.check("eol"))throw n.ih.fromNode("『逐次実行』の直後は改行が必要です",t);for(;!this.check("ここまで");){if(this.check("eol")){this.get();continue}if(this.check2(["エラー","ならば"])){this.get(),this.get(),r=this.yBlock();break}let e=null;if(this.check("先に")||this.check("次に")){const t=this.get();if(this.check("comma")&&this.get(),this.check("eol")){if(e=this.yBlock(),!this.check("ここまで")){let e="次に";throw null!=t&&(e=t.type),n.ih.fromNode(`『${e}』...『ここまで』を対応させてください。`,t)}this.get()}else e=this.ySentence()}else e=this.ySentence();null!=e&&s.push(e)}if(!this.check("ここまで"))throw console.log(s,this.peek()),n.ih.fromNode("『逐次実行』...『ここまで』を対応させてください。",t);return this.get(),{type:"tikuji",blocks:s,errorBlock:r,josi:"",...e,end:this.peekSourceMap()}}yGetArgOperator(t){const s=[t];for(;!this.isEOF();){const r=this.peek();if(!r||!e[r.type])break;{s.push(this.get());const e=this.yValue();if(null===e)throw n.ih.fromNode(`計算式で演算子『${r.value}』後に値がありません`,t);s.push(e)}}return 0===s.length?null:1===s.length?s[0]:this.infixToAST(s)}yGetArg(){const e=this.yValue();return null===e?null:this.yGetArgOperator(e)}infixToPolish(t){const n=t=>e[t.type]?e[t.type]:10,s=[],r=[];for(;t.length>0;){const e=t.shift();for(;s.length>0;){const t=s[s.length-1];if(n(e)>n(t))break;r.push(s.pop())}s.push(e)}for(;s.length>0;)r.push(s.pop());return r}infixToAST(t){if(0===t.length)return null;const s=t[t.length-1].josi,r=t[t.length-1],o=this.infixToPolish(t),i=[];for(const t of o){if(!e[t.type]){i.push(t);continue}const u=i.pop(),c=i.pop();if(void 0===c||void 0===u)throw this.logger.debug("--- 計算式(逆ポーランド) ---\n"+JSON.stringify(o)),n.ih.fromNode("計算式でエラー",r);const a={type:"op",operator:t.type,left:c,right:u,josi:s,startOffset:c.startOffset,endOffset:c.endOffset,line:c.line,column:c.column,file:c.file};i.push(a)}return i.pop()}yGetArgParen(e){let t=!1;const s=this.stack.length;for(;!this.isEOF();){if(this.check(")")){t=!0;break}const e=this.yGetArg();if(!e)break;this.pushStack(e),this.check("comma")&&this.get()}if(!t)throw n.ih.fromNode(`C風関数『${e[0].value}』でカッコが閉じていません`,e[0]);const r=[];for(;s<this.stack.length;){const e=this.popStack();r.unshift(e)}return r}yRepeatTime(){const e=this.peekSourceMap();if(!this.check("回"))return null;this.get(),this.check("comma")&&this.get(),this.check("繰返")&&this.get();let t=this.popStack([]),s=!1,r=null;if(null===t&&(t={type:"word",value:"それ",josi:"",...e,end:this.peekSourceMap()}),this.check("comma")&&this.get(),this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0),s){if(r=this.yBlock(),!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『回』...『ここまで』を対応させてください。",e);this.get()}else r=this.ySentence();return{type:"repeat_times",value:t,block:r,josi:"",...e,end:this.peekSourceMap()}}yWhile(){const e=this.peekSourceMap();if(!this.check("間"))return null;for(this.get();this.check("comma");)this.get();this.check("繰返")&&this.get();const t=this.popStack([]);if(null===t)throw n.ih.fromNode("『間』で条件がありません。",t);if(this.check("comma")&&this.get(),!this.checkTypes(["ここから","eol"]))throw n.ih.fromNode("『間』の直後は改行が必要です",t);const s=this.yBlock();return this.check("ここまで")&&this.get(),{type:"while",cond:t,block:s,josi:"",...e,end:this.peekSourceMap()}}yAtohantei(){const e=this.peekSourceMap();this.check("後判定")&&this.get(),this.check("繰返")&&this.get(),this.check("ここから")&&this.get();const t=this.yBlock();this.check("ここまで")&&this.get(),this.check("comma")&&this.get();let n=this.yGetArg(),s=!1;const r=this.peek();return!r||"なる"!==r.value||"まで"!==r.josi&&"までの"!==r.josi||(this.get(),s=!0),this.check("間")&&this.get(),s&&(n={type:"not",value:n,josi:"",...e,end:this.peekSourceMap()}),{type:"atohantei",cond:n,block:t,josi:"",...e,end:this.peekSourceMap()}}yFor(){const e=this.peekSourceMap();if(!(this.check("繰返")||this.check("増繰返")||this.check("減繰返")))return null;const t=this.get(),s=this.stack.pop();"word"!=s.type||"増"!==s.value&&"減"!==s.value?this.stack.push(s):t.type=s.value+t.type;let r=null;"増繰返"!==t.type&&"減繰返"!==t.type||(r=this.popStack(["ずつ"]));const o=this.popStack(["まで"]),i=this.popStack(["から"]),u=this.popStack(["を","で"]);if(null===i||null===o)throw n.ih.fromNode("『繰り返す』文でAからBまでの指定がありません。",t);this.check("comma")&&this.get();let c=!1;(this.check("ここから")||this.check("eol"))&&(c=!0,this.get());let a=null;if(c){if(a=this.yBlock(),!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『繰り返す』...『ここまで』を対応させてください。",e);this.get()}else a=this.ySentence();return{type:"for",from:i,to:o,inc:r,word:u,block:a,josi:"",...e,end:this.peekSourceMap()}}yReturn(){const e=this.peekSourceMap();if(!this.check("戻る"))return null;const t=this.get(),s=this.popStack(["で","を"]);if(this.stack.length>0)throw n.ih.fromNode("『戻』文の直前に未解決の引数があります。『(式)を戻す』のように式をカッコで括ってください。",t);return{type:"return",value:s,josi:"",...e,end:this.peekSourceMap()}}yForEach(){const e=this.peekSourceMap();if(!this.check("反復"))return null;for(this.get();this.check("comma");)this.get();const t=this.popStack(["を"]),n=this.popStack(["で"]);let s=null,r=!1;return this.check("ここから")?(r=!0,this.get()):this.check("eol")&&(r=!0),r?(s=this.yBlock(),this.check("ここまで")&&this.get()):s=this.ySentence(),{type:"foreach",name:n,target:t,block:s,josi:"",...e,end:this.peekSourceMap()}}ySwitch(){const e=this.peekSourceMap();if(!this.check("条件分岐"))return null;const t=this.get(),s=this.get(),r=this.popStack(["で"]);if(!r)throw n.ih.fromNode("『(値)で条件分岐』のように記述してください。",t);if("eol"!==s.type)throw n.ih.fromNode("『条件分岐』の直後は改行してください。",t);let o=!1,i=!1;const u=[];for(;!this.isEOF();){if(this.check("ここまで")){if(i)throw n.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);this.get();break}if(this.check("eol")){this.get();continue}if(o)throw n.ih.fromNode("『条件分岐』で『違えば〜ここまで』の後に処理を続けることは出来ません。",t);let e=this.peek();if("違えば"===e.type)i=!1,o=!0,this.get(),this.check("comma")&&this.get();else{if(i)throw n.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);e=this.yValue();if("ならば"!==this.get().type)throw n.ih.fromNode("『条件分岐』で条件は**ならばと記述してください。",t);this.check("comma")&&this.get()}const s=this.yBlock();if("ここまで"===this.peek().type)this.get();else{if(o)throw n.ih.fromNode("『条件分岐』は『違えば〜ここまで』と記述してください。",t);i=!0}u.push([e,s])}return{type:"switch",value:r,cases:u,josi:"",...e,end:this.peekSourceMap()}}yMumeiFunc(){const e=this.peekSourceMap();if(!this.check("def_func"))return null;const t=this.get();let s=[];this.check("comma")&&this.get(),this.check("(")&&(s=this.yDefFuncReadArgs()),this.check("comma")&&this.get(),this.saveStack();const r=this.yBlock();if(!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『には』構文か無名関数の末尾に『ここまで』が必要です。",e);return this.get(),this.loadStack(),{type:"func_obj",args:s,block:r,meta:t.meta,josi:"",...e,end:this.peekSourceMap()}}yDainyu(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const s=this.popStack(["を"]),r=this.popStack(["へ","に"]);if(!r||"word"!==r.type&&"func"!==r.type&&"配列参照"!==r.type)throw n.ih.fromNode("代入文で代入先の変数が見当たりません。『(変数名)に(値)を代入』のように使います。",t);return"配列参照"===r.type?{type:"let_array",name:r.name,index:r.index,value:s,josi:"",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}:{type:"let",name:r,value:s,josi:"",...e,end:this.peekSourceMap()}}ySadameru(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const s=this.popStack(["を"]),r=this.popStack(["へ","に"]);if(console.log(s),!s||"word"!==s.type&&"func"!==s.type&&"配列参照"!==s.type)throw n.ih.fromNode("『定める』文で定数が見当たりません。『(定数名)を(値)に定める』のように使います。",t);return{type:"def_local_var",name:s,vartype:"定数",value:r,josi:"",...e,end:this.peekSourceMap()}}yIncDec(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;if(this.check("繰返"))return this.pushStack({type:"word",value:t.value,josi:t.josi,...e,end:this.peekSourceMap}),this.yFor();let s=this.popStack(["だけ",""]);const r=this.popStack(["を"]);if(!r||"word"!==r.type&&"配列参照"!==r.type)throw n.ih.fromNode(`『${t.type}』文で定数が見当たりません。『(変数名)を(値)だけ${t.type}』のように使います。`,t);return"減"===t.value&&(s={type:"op",operator:"*",left:s,right:{type:"number",value:-1,line:t.line},josi:"",...e}),{type:"inc",name:r,value:s,josi:t.josi,...e,end:this.peekSourceMap()}}yCall(){if(this.isEOF())return null;for(;!this.isEOF();){if(this.check("ここから")&&this.get(),this.check("代入"))return this.yDainyu();if(this.check("定める"))return this.ySadameru();if(this.check("回"))return this.yRepeatTime();if(this.check("間"))return this.yWhile();if(this.check("繰返")||this.check("増繰返")||this.check("減繰返"))return this.yFor();if(this.check("反復"))return this.yForEach();if(this.check("条件分岐"))return this.ySwitch();if(this.check("戻る"))return this.yReturn();if(this.check("増")||this.check("減"))return this.yIncDec();if(this.check2([["func","word"],"("])&&""===this.peek().josi){const e=this.yValue();if("func"===e.type&&(""===e.josi||t.indexOf(e.josi)>=0))return e.josi="",e;this.pushStack(e),this.check("comma")&&this.get();continue}if(this.check("func")){const e=this.yCallFunc();if(null===e)continue;if(this.check("間")){this.pushStack(e);continue}if(!this.checkTypes(s))return e;this.pushStack(this.yGetArgOperator(e));continue}const e=this.yGetArg();if(!e)break;this.pushStack(e)}if(this.stack.length>0){this.logger.debug("--- stack dump ---\n"+JSON.stringify(this.stack,null,2)+"\npeek: "+JSON.stringify(this.peek(),null,2));let e=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!0))).join("、")}が解決していません。`,t=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!1))).join("、")}が解決していません。`;for(const n of this.stack){const s=this.nodeToStr(n,{depth:0},!1),r=this.nodeToStr(n,{depth:1},!1);s!==r&&(e+=`${this.nodeToStr(n,{depth:0},!0)}は${this.nodeToStr(n,{depth:1},!0)}として使われています。`,t+=`${s}は${r}として使われています。`)}const s=this.stack[0],r=this.stack[this.stack.length-1];throw this.logger.debug(e,s),n.ih.fromNode(t,s,r)}return this.popStack([])}yCallFunc(){const e=this.peekSourceMap(),s=this.get(),r=s.meta;let o=null;if("には"===s.josi){try{o=this.yMumeiFunc()}catch(e){throw n.ih.fromNode(`『${s.value}には...』で無名関数の定義で以下の間違いがあります。\n${e.message}`,s)}if(null===o)throw n.ih.fromNode("『Fには』構文がありましたが、関数定義が見当たりません。",s)}if(!r||void 0===r.josi)throw n.ih.fromNode("関数の定義でエラー。",s);this.recentlyCalledFunc.push({name:s.value,...r});const i=[];let u=0,c=0;for(let e=0;e<r.josi.length;e++)for(;;){let t=this.popStack(r.josi[e]);if(null!==t)c++;else{if(!(e<r.josi.length-1)&&r.isVariableJosi)break;u++,t=o}if(null!==t&&void 0!==r.funcPointers&&null!==r.funcPointers[e]){if("func"!==t.type)throw n.ih.fromNode(`関数『${s.value}』の引数『${r.varnames[e]}』には関数オブジェクトが必要です。`,s);t.type="func_pointer"}if(i.push(t),e<r.josi.length-1||!r.isVariableJosi)break}if(u>=2&&(c>0||""===s.josi||t.indexOf(s.josi)>=0))throw n.ih.fromNode(`関数『${s.value}』の引数が不足しています。`,s);const a={type:"func",name:s.value,args:i,josi:s.josi,...e,end:this.peekSourceMap()};return""===s.josi?a:t.indexOf(s.josi)>=0?(a.josi="して",a):(a.meta=r,this.pushStack(a),null)}yCallOp(){if(!this.check2(["func","←"]))return null;const e=this.peekSourceMap(),t=this.get();if(null==t)throw new Error("関数が取得できません。");try{if(null==this.get())throw new Error("関数呼び出し演算子が取得できません。");const s=t.value,r=t.meta.josi.length;if(0===r)throw n.ih.fromNode(`引数がない関数『${s}』を関数呼び出し演算子で呼び出すことはできません。`,t);const o=this.stack.length;for(;!this.isEOF();){const e=this.yGetArg();if(!e)break;if(this.pushStack(e),this.stack.length-o===r)break}const i=this.stack.length-o;if(i!==r)throw n.ih.fromNode(`関数『${s}』呼び出しで引数の数(${i})が定義(${r})と違います。`,t);const u=this.stack.splice(o,r);let c=u;if(r>=2){c=[];t.meta.josi.forEach(((e,t)=>{for(let n=0;n<u.length;n++){const s=u[n];if(e.indexOf(s.josi)>=0)return void(c[t]=s)}const n=e.join(",");throw new Error(`助詞『${n}』が見当たりません。`)}))}return{type:"func",name:s,args:c,setter:!0,josi:"",...e,end:this.peekSourceMap()}}catch(e){throw this.logger.debug(`${this.nodeToStr(t,{depth:0},!0)}の関数呼び出しで引数(『←』以降)が読み取れません。`,t),n.ih.fromNode(`${this.nodeToStr(t,{depth:0},!1)}の関数呼び出しでエラーがあります。\n${e.message}`,t)}}yLet(){const e=this.peekSourceMap();if(this.check2(["word","eq"])){const t=this.peek();let s=!1;try{if(this.accept(["word","eq",this.yCalc])||this.accept(["word","eq",this.ySentence])){if("eol"===this.y[2].type)throw new Error("値が空です。");return this.check("comma")&&this.get(),{type:"let",name:this.y[0],value:this.y[2],...e,end:this.peekSourceMap()}}throw s=!0,this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に書き間違いがあります。`,t),n.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に書き間違いがあります。`,t)}catch(e){if(s)throw e;throw this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に以下の書き間違いがあります。\n${e.message}`,t),n.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に以下の書き間違いがあります。\n${e.message}`,t)}}if(this.check2(["word","@"])){const t=this.yLetArrayAt(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.check2(["word","["])){const t=this.yLetArrayBracket(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.accept(["word","とは"])){const t=this.y[0];if(!this.checkTypes(["変数","定数"]))throw n.ih.fromNode("ローカル変数『"+t.value+"』の定義エラー",t);const s=this.get();let r=null;return this.check("eq")&&(this.get(),r=this.yCalc()),this.check("comma")&&this.get(),{type:"def_local_var",name:t,vartype:s.type,value:r,...e,end:this.peekSourceMap()}}if(this.accept(["変数","word","eq",this.yCalc]))return{type:"def_local_var",name:this.y[1],vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()};if(this.accept(["定数","word","eq",this.yCalc]))return{type:"def_local_var",name:this.y[1],vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()};if(this.accept(["定数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw n.ih.fromNode("複数定数の代入文でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw n.ih.fromNode(`複数定数の代入文${e+1}番目でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return{type:"def_local_varlist",names:t.value,vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["変数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw n.ih.fromNode("複数変数の代入文でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw n.ih.fromNode(`複数変数の代入文${e+1}番目でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return{type:"def_local_varlist",names:t.value,vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.check2(["word","comma","word"])){if(this.accept(["word","comma","word","eq",this.yCalc]))return{type:"def_local_varlist",names:[this.y[0],this.y[2]],vartype:"変数",value:this.y[4],...e,end:this.peekSourceMap()};if(this.accept(["word","comma","word","comma","word","eq",this.yCalc]))return{type:"def_local_varlist",names:[this.y[0],this.y[2],this.y[4]],vartype:"変数",value:this.y[6],...e,end:this.peekSourceMap()};if(this.accept(["word","comma","word","comma","word","comma","word","eq",this.yCalc]))return{type:"def_local_varlist",names:[this.y[0],this.y[2],this.y[4],this.y[6]],vartype:"変数",value:this.y[8],...e,end:this.peekSourceMap()};if(this.accept(["word","comma","word","comma","word","comma","word","comma","word","eq",this.yCalc]))return{type:"def_local_varlist",names:[this.y[0],this.y[2],this.y[4],this.y[6],this.y[8]],vartype:"変数",value:this.y[10],...e,end:this.peekSourceMap()}}return null}checkArrayIndex(e){return 0==this.arrayIndexFrom?e:{...e,type:"op",operator:"-",left:e,right:{...e,type:"number",value:this.arrayIndexFrom}}}checkArrayReverse(e){return this.flagReverseArrayIndex?e.length<=1?e:e.reverse():e}yLetArrayAt(e){return this.accept(["word","@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:[this.checkArrayIndex(this.y[2])],value:this.y[4],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:null}yLetArrayBracket(e){return this.accept(["word","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:[this.checkArrayIndex(this.y[2])],value:this.y[5],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]),value:this.y[8],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[7],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5]),this.checkArrayIndex(this.y[8])]),value:this.y[11],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[9],...e,end:this.peekSourceMap()}:null}yCalc(){const e=this.peekSourceMap();if(this.check("eol"))return null;const t=this.yGetArg();if(!t)return null;if(""===t.josi)return t;this.pushStack(t);const n=this.yCall();if("して"!==n.josi)return n;const s=this.yCalc();return s?{type:"renbun",left:n,right:s,josi:s.josi,...e,end:this.peekSourceMap()}:n}yValueKakko(){if(!this.check("("))return null;const e=this.get();this.saveStack();const t=this.yCalc()||this.ySentence();if(null===t){const t=this.get();throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),n.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e)}if(!this.check(")"))throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),n.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e);const s=this.get();return this.loadStack(),t.josi=s.josi,t}yValue(){const e=this.peekSourceMap();if(this.check("comma")&&this.get(),this.checkTypes(["number","string"]))return this.get();if(this.check("("))return this.yValueKakko();if(this.check2(["-","number"])||this.check2(["-","word"])||this.check2(["-","func"])){const t=this.get(),n=this.yValue(),s=n&&n.josi?n.josi:"";return{type:"op",operator:"*",left:{type:"number",value:-1,line:t.line},right:n,josi:s,...e,end:this.peekSourceMap()}}if(this.check("not")){this.get();const t=this.yValue();return{type:"not",value:t,josi:t&&t.josi?t.josi:"",...e,end:this.peekSourceMap()}}const t=this.yJSONArray();if(t)return t;const r=this.yJSONObject();if(r)return r;const o=s.concat(["eol",")","]","ならば","回","間","反復","条件分岐"]);if(this.check2(["func",o])){const t=this.get();return{type:"func",name:t.value,args:[],josi:t.josi,...e,end:this.peekSourceMap()}}if(this.check2([["func","word"],"("])&&""===this.peek().josi){const t=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"]))return{type:"func",name:this.y[0].value,args:this.y[2],josi:this.y[3].josi,...e,end:this.peekSourceMap()};throw n.ih.fromNode("C風関数呼び出しのエラー",t)}if(this.check2(["func","←"]))return this.yCallOp();if(this.check("def_func"))return this.yMumeiFunc();const i=this.yValueWord();return i||null}yValueWordGetIndex(e){if(this.check("@")){if(this.accept(["@",this.yValue,"comma",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index.push(this.checkArrayIndex(this.y[5])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[5].josi,!0;if(this.accept(["@",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[3].josi,!0;if(this.accept(["@",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[1].josi,!0;throw n.ih.fromNode("変数の後ろの『@要素』の指定が不正です。",e.name)}if(this.check("[")&&this.accept(["[",this.yCalc,"]"]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[2].josi,!0;if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3])];return e.index=this.checkArrayReverse(t),e.josi=this.y[4].josi,!0}if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3]),this.checkArrayIndex(this.y[5])];return e.index=this.checkArrayReverse(t),e.josi=this.y[6].josi,!0}return!1}yValueWord(){const e=this.peekSourceMap();if(this.check("word")){const t=this.get();if(this.skipRefArray)return t;if(""===t.josi&&this.checkTypes(["[","@"])){const s={type:"配列参照",name:t,index:[],josi:"",...e,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(s););if(0===s.index.length)throw n.ih.fromNode(`配列『${t.value}』アクセスで指定ミス`,t);return s}return t}return null}yJSONObjectValue(){const e=[],t=this.peek();for(;!this.isEOF();){for(;this.check("eol");)this.get();if(this.check("}"))break;if(this.accept(["word",":",this.yCalc]))this.y[0].type="string",e.push({key:this.y[0],value:this.y[2]});else if(this.accept(["string",":",this.yCalc]))e.push({key:this.y[0],value:this.y[2]});else if(this.check("word")){const t=this.get();t.type="string",e.push({key:t,value:t})}else{if(!this.checkTypes(["string","number"]))throw n.ih.fromNode("辞書オブジェクトの宣言で末尾の『}』がありません。",t);{const t=this.get();e.push({key:t,value:t})}}this.check("comma")&&this.get()}return e}yJSONObject(){const e=this.peekSourceMap();if(this.accept(["{","}"]))return{type:"json_obj",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue,"}"]))return{type:"json_obj",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue]))throw n.ih.fromNode("辞書型変数の初期化が『}』で閉じられていません。",this.y[1]);return null}yJSONArrayValue(){this.check("eol")&&this.get();const e=this.yCalc();if(null===e)return null;this.check("comma")&&this.get();const t=[e];for(;!this.isEOF()&&(this.check("eol")&&this.get(),!this.check("]"));){const e=this.yCalc();if(null===e)break;this.check("comma")&&this.get(),t.push(e)}return t}yJSONArray(){const e=this.peekSourceMap();if(this.accept(["[","]"]))return{type:"json_array",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue,"]"]))return{type:"json_array",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue]))throw n.ih.fromNode("配列変数の初期化が『]』で閉じられていません。",this.y[1]);return null}yTryExcept(){const e=this.peekSourceMap();if(!this.check("エラー監視"))return null;const t=this.get(),s=this.yBlock();if(!this.check2(["エラー","ならば"]))throw n.ih.fromNode("エラー構文で『エラーならば』がありません。『エラー監視..エラーならば..ここまで』を対で記述します。",t);this.get(),this.get();const r=this.yBlock();if(!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『エラー監視』...『エラーならば』...『ここまで』を対応させてください。",e);return this.get(),{type:"try_except",block:s,errBlock:r,josi:"",...e,end:this.peekSourceMap()}}}var o=__webpack_require__(8497),i=__webpack_require__(4159);const u=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,c=/^[ぁ-ん]/,a=/^[ぁ-ん]+$/,f=/^.+(以上|以下|超|未満)$/,l=e=>function(){throw new Error("突然の『"+e+"』があります。")},h=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|px|dot|pt|em|b|mb|kb|gb)/,p=[{name:"ここまで",pattern:/^;;;/},{name:"eol",pattern:/^\n/},{name:"eol",pattern:/^;/},{name:"space",pattern:/^(\x20|\x09|・)+/},{name:"comma",pattern:/^,/},{name:"line_comment",pattern:/^#[^\n]*/},{name:"line_comment",pattern:/^\/\/[^\n]*/},{name:"range_comment",pattern:/^\/\*/,cbParser:function(e){let t="";let n=0;const s=(e=e.substr(2)).indexOf("*/");s<0?(t=e,e=""):(t=e.substr(0,s),e=e.substr(s+2));for(let e=0;e<t.length;e++)"\n"===t.charAt(e)&&n++;return t=t.replace(/(^\s+|\s+$)/,""),{src:e,res:t,josi:"",numEOL:n}}},{name:"def_test",pattern:/^●テスト:/},{name:"def_func",pattern:/^●/},{name:"number",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/,readJosi:!0,cb:_},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:_},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:_},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:_},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:_},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:_},{name:"ここから",pattern:/^(ここから),?/},{name:"ここまで",pattern:/^(ここまで|💧)/},{name:"もし",pattern:/^もしも?/},{name:"違えば",pattern:/^違(えば)?/},{name:"shift_r0",pattern:/^>>>/},{name:"shift_r",pattern:/^>>/},{name:"shift_l",pattern:/^<</},{name:"===",pattern:/^===/},{name:"!==",pattern:/^!==/},{name:"gteq",pattern:/^(≧|>=|=>)/},{name:"lteq",pattern:/^(≦|<=|=<)/},{name:"noteq",pattern:/^(≠|<>|!=)/},{name:"←",pattern:/^(←|<--)/},{name:"eq",pattern:/^(=|🟰)/},{name:"line_comment",pattern:/^(!|💡)(インデント構文|ここまでだるい)[^\n]*/},{name:"not",pattern:/^(!|💡)/},{name:"gt",pattern:/^>/},{name:"lt",pattern:/^</},{name:"and",pattern:/^(かつ|&&)/},{name:"or",pattern:/^(または|或いは|あるいは|\|\|)/},{name:"@",pattern:/^@/},{name:"+",pattern:/^\+/},{name:"-",pattern:/^-/},{name:"*",pattern:/^(×|\*)/},{name:"÷÷",pattern:/^÷÷/},{name:"÷",pattern:/^(÷|\/)/},{name:"%",pattern:/^%/},{name:"^",pattern:/^\^/},{name:"&",pattern:/^&/},{name:"[",pattern:/^\[/},{name:"]",pattern:/^]/,readJosi:!0},{name:"(",pattern:/^\(/},{name:")",pattern:/^\)/,readJosi:!0},{name:"|",pattern:/^\|/},{name:"string",pattern:/^🌿/,cbParser:e=>d("🌿","🌿",e)},{name:"string_ex",pattern:/^🌴/,cbParser:e=>d("🌴","🌴",e)},{name:"string_ex",pattern:/^「/,cbParser:e=>d("「","」",e)},{name:"string",pattern:/^『/,cbParser:e=>d("『","』",e)},{name:"string_ex",pattern:/^“/,cbParser:e=>d("“","”",e)},{name:"string_ex",pattern:/^"/,cbParser:e=>d('"','"',e)},{name:"string",pattern:/^'/,cbParser:e=>d("'","'",e)},{name:"」",pattern:/^」/,cbParser:l("」")},{name:"』",pattern:/^』/,cbParser:l("』")},{name:"func",pattern:/^\{関数\},?/},{name:"{",pattern:/^\{/},{name:"}",pattern:/^\}/,readJosi:!0},{name:":",pattern:/^:/},{name:"_eol",pattern:/^_\s*\n/},{name:"dec_lineno",pattern:/^‰/},{name:"word",pattern:/^[\uD800-\uDBFF][\uDC00-\uDFFF][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^[\u1F60-\u1F6F][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^《.+?》/,readJosi:!0},{name:"word",pattern:/^[_a-zA-Z\u3005\u4E00-\u9FCFぁ-んァ-ヶ\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]/,cbParser:function(e,t=!0){let n="",s="";for(;""!==e;){if(n.length>0){const t=i.josiRE.exec(e);if(t){s=t[0].replace(/^\s+/,""),","===(e=e.substr(t[0].length)).charAt(0)&&(e=e.substr(1));break}}const t=u.exec(e);if(t){n+=t[0],e=e.substr(t[0].length);continue}if(!c.test(e))break;n+=e.charAt(0),e=e.substr(1)}/[ぁ-ん]間$/.test(n)&&(e=n.charAt(n.length-1)+e,n=n.slice(0,-1));const r=f.exec(n);r&&(e=r[1]+s+e,s="",n=n.substr(0,n.length-r[1].length));i.removeJosiMap[s]&&(s="");t&&(n=function(e){if(!c.test(e))return e.replace(/[ぁ-ん]+/g,"");if(a.test(e))return e;return e.replace(/[ぁ-ん]+$/g,"")}(n));""===n&&""!==s&&(n=s,s="");return{src:e,res:n,josi:s,numEOL:0}}}];function d(e,t,n){let s="",r="",o=0;const u=(n=n.substr(e.length)).indexOf(t);if(u<0)s=n,n="";else if(s=n.substr(0,u),n=n.substr(u+t.length),s.indexOf(e)>=0)throw"『"===e?new Error("「『」で始めた文字列の中に「『」を含めることはできません。"):new Error(`『${e}』で始めた文字列の中に『${e}』を含めることはできません。`);const c=i.josiRE.exec(n);c&&(r=c[0].replace(/^\s+/,""),","===(n=n.substr(c[0].length)).charAt(0)&&(n=n.substr(1))),i.removeJosiMap[r]&&(r="");for(let e=0;e<s.length;e++)"\n"===s.charAt(e)&&o++;return{src:n,res:s,josi:r,numEOL:o}}function _(e){return Number(e.replace(/_/g,""))}class y{constructor(e){this.logger=e,this.funclist={},this.result=[]}setFuncList(e){this.funclist=e}setInput(e,t,n){return this.tokenize(e,t,n)}setInput2(e,t){if(this.result=e,y.preDefineFunc(e,this.logger,this.funclist),this.replaceWord(this.result),t)if(this.result.length>0){const e=this.result[this.result.length-1];this.result.push({type:"eol",line:e.line,column:0,file:e.file,josi:"",value:"---",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""}),this.result.push({type:"eof",line:e.line,column:0,file:e.file,josi:"",value:"",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""})}else this.result.push({type:"eol",line:0,column:0,file:"",josi:"",value:"---",startOffset:0,endOffset:0,rawJosi:""}),this.result.push({type:"eof",line:0,column:0,file:"",josi:"",value:"",startOffset:0,endOffset:0,rawJosi:""});return this.result}static preDefineFunc(e,t,n){let s=0,r=!1;const i=()=>{const t=[],n={};if("("!==e[s].type)return[];for(s++;e[s];){const o=e[s];if(s++,")"===o.type)break;"func"===o.type?r=!0:"|"!==o.type&&"comma"!==o.type&&(r&&(o.funcPointer=!0,r=!1),t.push(o),n[o.value]||(n[o.value]=[]),n[o.value].push(o.josi))}const o=[],i=[],u=[],c={};for(const e of t)if(!c[e.value]){const t=n[e.value];u.push(t),o.push(e.value),e.funcPointer?i.push(e.value):i.push(null),c[e.value]=!0}return[u,o,i]};for(;s<e.length;){const r=e[s];if("word"===r.type&&"には"===r.josi||"word"===r.type&&"は~"===r.josi){r.josi="には",e.splice(s+1,0,{type:"def_func",value:"関数",line:r.line,column:r.column,file:r.file,josi:"",startOffset:r.endOffset,endOffset:r.endOffset,rawJosi:"",tag:"無名関数"}),s++;continue}if("word"===r.type&&""===r.josi&&r.value.length>=2&&r.value.match(/回$/)&&(r.value=r.value.substr(0,r.value.length-1),e.splice(s+1,0,{type:"回",value:"回",line:r.line,column:r.column,file:r.file,josi:"",startOffset:r.endOffset-1,endOffset:r.endOffset,rawJosi:""}),r.endOffset--,s++),"word"===r.type&&o.default[r.value]&&(r.type=o.default[r.value],"そう"===r.value&&(r.value="それ")),"def_test"!==r.type&&"def_func"!==r.type){s++;continue}let u=!0,c={type:"eol"};s>=1&&(c=e[s-1]),"eol"===c.type&&(u=!1);const a=r;s++;let f=[],l=[],h=[],p="";e[s]&&"("===e[s].type&&([f,l,h]=i()),!u&&e[s]&&"word"===e[s].type&&(p=e[s++].value),0===f.length&&e[s]&&"("===e[s].type&&([f,l,h]=i()),""!==p&&(p in n&&t.warn(`関数『${p}』は既に定義されています。`,a),n[p]={type:"func",josi:f,fn:null,asyncFn:!1,varnames:l,funcPointers:h}),a.meta={josi:f,varnames:l,funcPointers:h}}}splitStringEx(e){const t=[],n=e.split(/[{{]/);t.push(n[0]);for(const e of n.slice(1)){const n=e.replace("}","}").indexOf("}");if(-1===n)return null;t.push(e.slice(0,n),e.slice(n+1))}return t}replaceWord(t){let n=[],s=0;for(;s<t.length;){const r=t[s];if("word"===r.type&&"それ"!==r.value){const e=this.funclist[r.value];if(e&&"func"===e.type){r.type="func",r.meta=e;continue}}if("-"===r.type&&t[s+1]&&"number"===t[s+1].type){const n=s<=0?"eol":t[s-1].type;("eol"===n||e[n]||""!==t[s-1].josi)&&(t.splice(s,1),t[s].value*=-1)}if(void 0===r.josi&&(r.josi=""),"は"!==r.josi)if("とは"!==r.josi)if(i.tararebaMap[r.josi]){const e="でなければ"===r.josi||"なければ"===r.josi?"でなければ":"ならば",n=null===r.endOffset?null:r.endOffset-r.rawJosi.length;t.splice(s+1,0,{type:"ならば",value:e,line:r.line,column:r.column,file:r.file,startOffset:n,endOffset:r.endOffset,josi:"",rawJosi:""}),r.josi=r.rawJosi="",r.endOffset=n,s+=2}else"_eol"!==r.type?"line_comment"!==r.type&&"range_comment"!==r.type?("eol"===r.type&&(r.value=n.join("/"),n=[]),s++):(n.push(r.value),t.splice(s,1)):t.splice(s,1);else{const e=null===r.endOffset?null:r.endOffset-r.rawJosi.length;t.splice(s+1,0,{type:r.josi,line:r.line,column:r.column,file:r.file,startOffset:e,endOffset:r.endOffset,josi:"",rawJosi:"",value:void 0}),r.josi=r.rawJosi="",r.endOffset=e,s+=2}else{const e=null===r.endOffset?null:r.endOffset-r.rawJosi.length;t.splice(s+1,0,{type:"eq",line:r.line,column:r.column,file:r.file,startOffset:e,endOffset:r.endOffset,josi:"",rawJosi:"",value:void 0}),s+=2,r.josi=r.rawJosi="",r.endOffset=e}}}tokenize(e,t,s){const r=e.length,o=[];let u,c,a=1,f=!1;for(;""!==e;){let l=!1;for(const d of p){const p=d.pattern.exec(e);if(!p)continue;if(l=!0,"space"===d.name){a+=p[0].length,e=e.substr(p[0].length);continue}if(d.cbParser){let i;if(f&&"word"===d.name)i=d.cbParser(e,!1);else try{i=d.cbParser(e)}catch(o){throw new n.tO(o.message,r-e.length,r-e.length+1,t,s)}if("string_ex"===d.name){const u=this.splitStringEx(i.res);if(null===u)throw new n.cg("展開あり文字列で値の埋め込み{...}が対応していません。",r-e.length,r-i.src.length,t,s);let c=0;for(let n=0;n<u.length;n++){const f=n===u.length-1?i.josi:"";n%2==0?(o.push({type:"string",value:u[n],file:s,josi:f,line:t,column:a,preprocessedCodeOffset:r-e.length+c,preprocessedCodeLength:u[n].length+2+f.length}),c+=u[n].length+2):(o.push({type:"&",value:"&",josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c,preprocessedCodeLength:0}),o.push({type:"(",value:"(",josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c,preprocessedCodeLength:0}),o.push({type:"code",value:u[n],josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c,preprocessedCodeLength:u[n].length}),o.push({type:")",value:")",josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c+u[n].length,preprocessedCodeLength:0}),o.push({type:"&",value:"&",josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c+u[n].length,preprocessedCodeLength:0}),c+=u[n].length)}t+=i.numEOL,a+=e.length-i.src.length,e=i.src,i.numEOL>0&&(a=1);break}u=a,a+=e.length-i.src.length,o.push({type:d.name,value:i.res,josi:i.josi,line:t,column:u,file:s,preprocessedCodeOffset:r-e.length,preprocessedCodeLength:e.length-i.src.length}),e=i.src,t+=i.numEOL,i.numEOL>0&&(a=1);break}const _=r-e.length;let y=p[0];if(d.cb&&(y=d.cb(y)),u=a,c=t,a+=p[0].length,e=e.substring(p[0].length),("eol"===d.name&&"\n"===y||"_eol"===d.name)&&(y=t++,a=1),"number"===d.name){const t=h.exec(e);t&&(e=e.substring(t[0].length),a+=p[0].length)}let m="";if(d.readJosi){const t=i.josiRE.exec(e);t&&(m=t[0].replace(/^\s+/,""),a+=t[0].length,","===(e=e.substring(t[0].length)).charAt(0)&&(e=e.substring(1)),i.removeJosiMap[m]&&(m=""))}switch(d.name){case"def_test":f=!0;break;case"eol":f=!1}if("dec_lineno"!==d.name){o.push({type:d.name,value:y,line:c,column:u,file:s,josi:m,preprocessedCodeOffset:_,preprocessedCodeLength:r-e.length-_});break}t--}if(!l)throw new n.cg("未知の語句: "+e.substr(0,3)+"...",r-e.length,r-r+3,t)}return o}}class m{constructor(e){this.history=[],this.code=e}getText(){return this.code}replaceAll(e,t){for(;;){const n=this.getText().indexOf(e);if(-1===n)break;e.length!==t.length&&this.history.unshift({index:n,from:e.length,to:t.length}),this.code=this.code.replace(e,t)}}getSourcePosition(e){for(const t of this.history)e>=t.index+t.to?e+=t.from-t.to:t.index<=e&&e<t.index+t.to&&(e=t.to>=2&&e===t.index+t.to-1?t.index+t.from-1:t.index);return e}}class g{constructor(e){this.logger=e,this.HYPHENS={45:!0,8208:!0,8209:!0,8211:!0,8212:!0,8213:!0,8722:!0},this.TILDES={126:!0,732:!0,759:!0,8275:!0,8764:!0,12316:!0,65374:!0},this.SPACES={32:!0,8192:!0,8194:!0,8195:!0,8196:!0,8197:!0,8198:!0,8199:!0,8201:!0,8202:!0,8203:!0,8239:!0,8287:!0,12288:!0,12644:!0},this.convertTable={9:" ",8251:"#",12290:";",12304:"[",12305:"]",12289:",",65292:",",10006:"*",10133:"+",10134:"-",10135:"÷"}}convert1ch(e){if(!e)return"";const t=e.codePointAt(0);if(this.convertTable[t])return this.convertTable[t];if(t<127)return e;if(t>=65281&&t<=65374){const e=t-65248;return String.fromCodePoint(e)}return this.HYPHENS[t]?"-":this.TILDES[t]?"~":this.SPACES[t]?" ":e}convert(e){if(!e)return[];const t=new m(e);t.replaceAll("\r\n","\n"),t.replaceAll("\r","\n");let n=!1,s=!1,r="";const o=[];let i=0,u="",c=0;for(;c<t.getText().length;){const e=t.getText().charAt(c),a=t.getText().substr(c,2);if(n){if(e===r){n=!1,o.push({text:u+r,sourcePosition:t.getSourcePosition(i)}),c++,i=c;continue}u+=e,c++;continue}if(s){if(a===r){s=!1,o.push({text:u+r,sourcePosition:t.getSourcePosition(i)}),c+=2,i=c;continue}u+=e,c++;continue}if("「"===e){o.push({text:e,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r="」",u="";continue}if("『"===e){o.push({text:e,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r="』",u="";continue}if("“"===e){o.push({text:e,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r="”",u="";continue}if("🌴"===a||"🌿"===a){o.push({text:a,sourcePosition:t.getSourcePosition(i)}),c+=2,i=c,s=!0,r=a,u="";continue}const f=this.convert1ch(e);'"'!==f&&"'"!==f?"#"!==f?"//"!==a&&"//"!==a?"/*"!==a?(o.push({text:f,sourcePosition:t.getSourcePosition(i)}),c++,i=c):(o.push({text:a,sourcePosition:t.getSourcePosition(i)}),c+=2,i=c,s=!0,r="*/",u=""):(o.push({text:"//",sourcePosition:t.getSourcePosition(i)}),c+=2,i=c,n=!0,r="\n",u=""):(o.push({text:f,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r="\n",u=""):(o.push({text:f,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r=e,u="")}return(n||s)&&o.push({text:u+r,sourcePosition:t.getSourcePosition(i)}),o}}var v=__webpack_require__(5430),b=__webpack_require__(2015);const k="🌟🌟改行🌟🌟s4j#WjcSb😀/FcX3🌟🌟";function w(e){const t=["!インデント構文","!ここまでだるい"],n=e.split("\n",30);for(const e of n){const n=e.replace(/^(!|💡)/,"!").substring(0,8);if(t.indexOf(n)>=0)return!0}return!1}function j(e){const t=new g,n=e.length;let s="",r="",o=0,i=!1;for(;o<n;){const n=e.charAt(o),u=e.substr(o,2),c=t.convert1ch(n),a=u.split("").map((e=>t.convert1ch(e))).join("");if(""===r){switch(c){case'"':case"'":r=n,s+=n,o++;continue;case"「":r="」",s+=n,o++;continue;case"『":r="』",s+=n,o++;continue;case"“":r="”",s+=n,o++;continue;case"{":r="}",s+=n,o++;continue;case"[":r="]",s+=n,o++;continue}switch(u){case"🌴":r="🌴",s+=u,o+=2;continue;case"🌿":r="🌿",s+=u,o+=2;continue}"#"!==c?"//"!==a?"/*"!==a?(s+=n,o++):(r="*/",i=!0,o+=2):(r="\n",i=!0,o+=2):(r="\n",i=!0,o++)}else r===(1===r.length?c:a)?(i||(s+=e.substr(o,r.length)),o+=r.length,i=!1,r=""):(i||(s+=n),o++)}return s}function S(e){let t="";for(let n=0;n<e;n++)t+=" ";return t}function x(e){return/^([  ・\t]*)/.exec(j(e))[1]}function $(e){let t=0;for(let n=0;n<e.length;n++){const s=e.charAt(n);if(" "!==s)if(" "!==s)if("・"!==s){if("\t"!==s)break;t+=4}else t+=2;else t+=2;else t++}return t}function O(e){const t=new g,n=e.length;let s="",r="",o=0;for(;o<n;){const n=e.charAt(o),i=e.substr(o,2),u=t.convert1ch(n),c=i.split("").map((e=>t.convert1ch(e))).join("");if(""===r){switch(u){case'"':case"'":r=n,s+=n,o++;continue;case"「":r="」",s+=n,o++;continue;case"『":r="』",s+=n,o++;continue;case"“":r="”",s+=n,o++;continue;case"{":r="}",s+=n,o++;continue;case"[":r="]",s+=n,o++;continue}switch(i){case"🌴":r="🌴",s+=i,o+=2;continue;case"🌿":r="🌿",s+=i,o+=2;continue}"#"!==u?"//"!==c?"/*"!==c?(s+=n,o++):(r="*/",s+=i,o+=2):(r="\n",s+=i,o+=2):(r="\n",s+=n,o++)}else r===(1===r.length?u:c)?(s+=e.substr(o,r.length),o+=r.length,r=""):(s+="\n"===n?k:n,o++)}return s}var A={convert:function(e,t){return w(e)?function(e,t){const s=[],r=[],o="ここまで‰",i=O(e).split("\n"),u=[],c=[];let a=0,f=-1;i.forEach((e=>{if(f+=e.split(k).length,/^[  ・\t]*$/.test(e))return void r.push({lineNumber:u.length,len:e.length});const i=j(e).replace(/^[  ・\t]+/,"").replace(/\s+$/,"");if(""===i)return void u.push(e);if("ここまで"===i)throw new n.t5("インデント構文が有効化されているときに『ここまで』を使うことはできません。",f,t);const l=$(e);if(a!==l){if(a<l)return c.push(a),a=l,void u.push(e);if(a>l)for(a=l;c.length>0;){const t=c.pop();if(t===l)return"違えば"!==i.substr(0,3)&&(s.push(u.length),u.push(S(t)+o)),void u.push(e);l<t&&(s.push(u.length),u.push(S(t)+o))}}else u.push(e)}));for(;c.length>0;){const e=c.pop();s.push(u.length),u.push(S(e)+o)}const l=[];for(let e=0;e<u.length;e++)if(u[e].includes(k)){const t=u[e].split(k);for(let e=0;e<s.length;e++)l.length<s[e]&&(s[e]+=t.length-1);for(let e=0;e<r.length;e++)l.length<r[e].lineNumber&&(r[e].lineNumber+=t.length-1);l.push(...t)}else l.push(u[e]);return{code:l.join("\n"),insertedLines:s,deletedLines:r}}(e,t):{code:e,insertedLines:[],deletedLines:[]}},getBlockStructure:function(e){const t={lines:[],pairs:[],parents:[],spaces:[]},n=O(e).split("\n"),s=[];let r=0,o=$(n[0]);for(const e of n){const n=e.split(k).length,i=j(e),u=""===i.replace(/^[  ・\t]+/,"")?o:$(i);if(t.lines.push(...Array(n).fill(u)),t.spaces.push(...Array(n).fill(x(i))),o<u)s.push(r-1);else if(o>u){const e=s.pop();void 0!==e&&t.pairs.push([e,r])}const c=void 0!==s[s.length-1]?s[s.length-1]:null;t.parents.push(...Array(n).fill(c)),o=u,r+=n}for(const e of s)t.pairs.push([e,r]);return t},getIndent:x,countIndent:$,isIndentSyntaxEnabled:w};const M=["!DNCLモード"];function C(e,t){if(!function(e){const t=M,n=e.split("\n",30);for(const e of n){const n=e.replace(/(!|💡)/,"!");if(t.indexOf(n)>=0)return!0}return!1}(e=e.replace(/(\r\n|\r)/g,"\n")))return e;return L(e,t)}function E(e){let t="";for(let n=0;n<e;n++)t+=" ";return t}function L(e,t){e=function(e){const t=new g;let n="",s=!1,r="";for(let o=0;o<e.length;o++){let i=e.charAt(o),u=t.convert1ch(i);if(s){if(u===r){s=!1,r="",n+=u;continue}n+=i}else"「"!==u?'"'!==u?("{"===u&&(u="["),"}"===u&&(u="]"),"←"===u&&(u="="),"÷"===u&&(u="÷÷"),n+=u):(s=!0,r='"',n+=u):(s=!0,r="」",n+=u)}return n}(e);const n=e.split("\n");for(let e=0;e<n.length;e++){let s=n[e];n[e]=s.replace(/^(\s*[|\s]+)(.*$)/,((e,t,n)=>E(t.length)+n)),s=n[e];const r=s.replace(/^\s+/,"").replace(/\s+$/,"");"繰り返し,"!==r&&"繰り返し"!==r||(n[e]="後判定で繰り返し");const o=s.match(/^\s*を,?(.+)になるまで(繰り返す|実行する)/);if(o){n[e]=`ここまで、(${o[1]})になるまでの間`;continue}const i=s.match(/^もし(.+)を実行する(。|.)*/);if(i){const s=L(i[1],t);n[e]=`もし、${s};`;continue}const u=s.match(/^(.+?)のすべての(要素|値)(を|に)(.+?)(にする|を代入)/);if(u){const t=u[1],s=u[4];n[e]=`${t} = [${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s}]`}else;}e=n.join("\n");const s={"を実行する":"ここまで","を実行し,そうでなくもし":"違えば、もし","を実行し,そうでなくもし":"違えば、もし","を実行し、そうでなくもし":"違えば、もし","を実行し,そうでなければ":"違えば","を実行し,そうでなければ":"違えば","を実行し、そうでなければ":"違えば","を繰り返す":"ここまで","改行なしで表示":"連続無改行表示","ずつ増やしながら":"ずつ増やし繰り返す","ずつ減らしながら":"ずつ減らし繰り返す","二進で表示":"二進表示","でないならば":"でなければ"};let r=()=>{let t=e.charAt(0);return e=e.substring(1),t},o=!1,i="",u="",c="";for(;""!=e;){const t=e.charAt(0);if(o){if(t===u){c+=i+u,i="",o=!1,r();continue}i+=r();continue}if('"'==t){o=!0,u='"',i=r();continue}if("「"==t){o=!0,u="」",i=r();continue}if("『"==t){o=!0,u="』",i=r();continue}if(" "===t||" "===t||"\t"==t){c+=r();continue}const n=e.substring(0,3);if("を表示"!==n)if("を 表示"!==e.substring(0,4))if("乱数"!==e.substring(0,2)||"乱数範囲"===e.substring(0,4)){"増やす"!==n&&"減らす"!==n||("だけ"!==c.substring(c.length-2)&&(c+="だけ"),c+=n,e=e.substring(3));{let t=!1;for(let n in s){if(e.substring(0,n.length)===n){c+=s[n],e=e.substring(n.length),t=!0;break}}if(t)continue}c+=r()}else c+="乱数範囲",e=e.substring(2);else c+="を連続表示",e=e.substring(4);else c+="を連続表示",e=e.substring(3)}return c}var T=__webpack_require__(9218),F={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){}},SIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sin(e)}},COS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.cos(e)}},TAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.tan(e)}},ARCSIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.asin(e)}},ARCCOS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.acos(e)}},ARCTAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.atan(e)}},ATAN2:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.atan2(e,t)}},"座標角度計算":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 180*Math.atan2(e[1],e[0])/Math.PI}},RAD2DEG:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},DEG2RAD:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},"度変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},"ラジアン変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},SIGN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 0===parseFloat(e)?0:e>0?1:-1}},"符号":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("SIGN",[e])}},ABS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},"絶対値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},EXP:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.exp(e)}},HYPOT:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},"斜辺":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},LN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOG:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOGN:{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return 2===e?Math.LOG2E*Math.log(t):10===e?Math.LOG10E*Math.log(t):Math.log(t)/Math.log(e)}},FRAC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"小数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"整数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.trunc(e)}},"乱数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.floor(Math.random()*e)}},"乱数範囲":{type:"func",josi:[["から"],["までの","の"]],pure:!0,fn:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},SQRT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},"平方根":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},ROUND:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.round(e)}},"四捨五入":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return Math.round(e)}},"小数点切上":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.ceil(e*n)/n}},"小数点切下":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.floor(e*n)/n}},"小数点四捨五入":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}},CEIL:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},"切上":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},FLOOR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}},"切捨":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}}},N={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){null==e.__promise&&(e.__promise={setLastPromise:function(t){return e.__v0["そ"]=t,t}})}},"そ":{type:"const",value:""},"動時":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){return t.__promise.setLastPromise(new Promise(((t,n)=>e(t,n))))},return_none:!1},"成功時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"処理時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(!0,t,n))),(t=>(n.__v0["対象"]=t,e(!1,t,n)))))},return_none:!1},"失敗時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.catch((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"終了時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.finally((()=>e())))},return_none:!1},"束":{type:"func",josi:[["と","を"]],pure:!0,fn:function(...e){return e.pop().__promise.setLastPromise(Promise.all(e))},return_none:!1}},P={"ASSERT等":{type:"func",josi:[["と"],["が"]],pure:!0,fn:function(e,t,n){if(e!==t)throw new Error(`不一致 [実際]${e} [期待]${t}`);return!0}},"テスト実行":{type:"func",josi:[["と"],["で"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}},"テスト等":{type:"func",josi:[["と"],["が"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}}};class I{constructor(e,t){this.sourceCodeLength=e,this.preprocessed=t;let n=0;this.cumulativeSum=[];for(const e of t)this.cumulativeSum.push(n),n+=e.text.length;this.lastIndex=0,this.lastPreprocessedCodePosition=0}map(e){const t=this.findIndex(e);return Math.min(this.preprocessed[t].sourcePosition+(e-this.cumulativeSum[t]),t===this.preprocessed.length-1?this.sourceCodeLength:this.preprocessed[t+1].sourcePosition-1)}findIndex(e){e<this.lastPreprocessedCodePosition&&(this.lastIndex=0),this.lastPreprocessedCodePosition=e;for(let t=this.lastIndex;t<this.preprocessed.length-1;t++)if(e<this.cumulativeSum[t+1])return this.lastIndex=t,t;return this.lastIndex=this.preprocessed.length-1,this.preprocessed.length-1}}class D{constructor(e,t,n){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=n;let s=0;for(const t of e.split("\n"))this.lines.push({offset:s,len:t.length}),s+=t.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){if(null===e)return{startOffset:e,endOffset:t};const n=this.getLineNumber(e);for(const s of this.linesInsertedByIndentationSyntax){if(n===s){e=null,t=null;break}n>s&&(e-=this.lines[s].len+1,null!==t&&(t-=this.lines[s].len+1))}for(const s of this.linesDeletedByIndentationSyntax)n>=s.lineNumber&&(null!==e&&(e+=s.len+1),null!==t&&(t+=s.len+1));return{startOffset:e,endOffset:t}}getLineNumber(e){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let t=this.lastLineNumber;t<this.lines.length-1;t++)if(e<this.lines[t+1].offset)return this.lastLineNumber=t,t;return this.lastLineNumber=this.lines.length-1,this.lines.length-1}}class J{constructor(e){this.lineOffsets=[];let t=0;for(const n of e.split("\n"))this.lineOffsets.push(t),t+=n.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let n=this.lastLineNumber;n<this.lineOffsets.length-1;n++)if(e<this.lineOffsets[n+1])return this.lastLineNumber=n,{line:n+(t?1:0),column:e-this.lineOffsets[n]};return this.lastLineNumber=this.lineOffsets.length-1,{line:this.lineOffsets.length-1+(t?1:0),column:e-this.lineOffsets[this.lineOffsets.length-1]}}}function R(e,t){if("number"==typeof e.startOffset&&(e.startOffset-=t.length),"number"==typeof e.endOffset&&(e.endOffset-=t.length),""!==t){const n=t.split("\n");"number"==typeof e.line&&(e.line-=n.length-1),0===e.line&&"number"==typeof e.column&&(e.column-=n[n.length-1].length)}return e}const G=["black","red","green","yellow","blue","magenta","cyan","white"],q=e=>{const t=e.replace(/\x1b\[\d+m/g,""),n=[];let s="inherit",r="inherit";const o=e===t?t:e.replace(/\x1b\[(\d+)m/g,((e,t)=>{const o=+t;return 0===o&&(s="inherit",r="inherit"),1===o&&(r="bold"),o>=30&&o<=37&&(s=G[o-30]),n.push(`color: ${s}; font-weight: ${r};`),"%c"}));let i="inherit",u="inherit";var c;return{noColor:t,nodeConsole:e===t?t:e+"",html:e===t?t:"<span>"+(c=e,c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")).replace(/\x1b\[(\d+)m/g,((e,t)=>{const n=+t;return 0===n&&(i="inherit",u="inherit"),1===n&&(u="bold"),n>=30&&n<=37&&(i=G[n-30]),`</span><span style="color: ${i}; font-weight: ${u};">`}))+"</span>",browserConsole:[o,...n]}},V={reset:"",bold:"",black:"",red:"",green:"",yellow:"",blue:"",magenta:"",cyan:"",white:""},B=e=>e?`${e.file||""}${void 0===e.line?"":`(${e.line+1}行目): `}`:"",H=["trace","debug","info","warn","error","stdout"];class U{constructor(){this.listeners=[]}addListener(e,t,n=!0){this.listeners.push({level:e,callback:t,includeHigherLevels:n})}removeListener(e){this.listeners=this.listeners.filter((t=>t.callback!==e))}trace(e,t=null){this.send("trace",`${V.bold}[デバッグ情報(詳細)]${V.reset}${B(t)}${e}`,t)}debug(e,t=null){this.send("debug",`${V.bold}[デバッグ情報]${V.reset}${B(t)}${e}`,t)}info(e,t=null){this.send("info",`${V.bold}${V.blue}[情報]${V.reset}${B(t)}${e}`,t)}warn(e,t=null){this.send("warn",`${V.bold}${V.green}[警告]${V.reset}${B(t)}${e}`,t)}error(e,t=null){e instanceof n.k?this.send("error",`${V.red}${e.tag}${V.reset}${e.positionJa}${e.msg}`,t||e):(e instanceof Error&&(e=e.message),this.send("error",`${V.bold}${V.red}[エラー]${V.reset}${B(t)}${e}`,t||e))}send(e,t,n,s,r){const o=q(t);let i="";t.includes("\n")&&(i+="border-top: 1px solid #8080806b; border-bottom: 1px solid #8080806b;");const u={noColor:o.noColor,nodeConsole:o.nodeConsole,browserConsole:r||o.browserConsole,html:`<div style="${i}">`+(s||o.html)+"</div>",level:e,position:n||{}};for(const t of this.listeners)t.includeHigherLevels?H.indexOf(t.level)<=H.indexOf(e)&&t.callback(u):t.level===e&&t.callback(u)}}class W{constructor(e,t){this.__locals={},this.__varslist=[{...e.__varslist[0]},{...e.__varslist[1]},{...e.__varslist[2]}],this.index=0,this.nextIndex=-1,this.__code=[],this.__callstack=[],this.__stack=[],this.__labels=[],this.__genMode=t.genMode,this.NakoRuntimeError=n.as,this.__module={...e.__module},this.pluginfiles={...e.pluginfiles},this.gen=t,this.logger=e.logger,this.compiler=e}clearLog(){this.__varslist[0]["表示ログ"]=""}get log(){let e=this.__varslist[0]["表示ログ"];return e=e.replace(/\s+$/,""),e}runEx(e,t,n,s=""){return this.compiler._runEx(e,t,n,s,this)}_runTests(e){let t=`${V.bold}テストの実行結果${V.reset}\n`,n=0,s=0;for(const r of e)try{r.f(),t+=`${V.green}✔${V.reset} ${r.name}\n`,n++}catch(e){t+=`${V.red}☓${V.reset} ${r.name}: ${e.message}\n`,s++}t+=s>0?`${V.green}成功 ${n}件 ${V.red}失敗 ${s}件`:`${V.green}成功 ${n}件`,this.numFailures=s,this.logger.send("stdout",t)}clearPlugins(){for(const e in this.pluginfiles){const t=this.__module[e];t["!クリア"]&&t["!クリア"].fn&&t["!クリア"].fn(this)}}reset(){this.clearPlugins()}destroy(){this.reset()}}const z=e=>JSON.parse(JSON.stringify(e));class X{constructor(e){void 0===e&&(e={useBasicPlugin:!0}),this.silent=!0,this.filename="inline",this.options=e,this.__varslist=[{},{},{}],this.__locals={},this.__self=this,this.__vars=this.__varslist[2],this.__globals=[],this.__module={},this.pluginFunclist={},this.funclist={},this.pluginfiles={},this.isSetter=!1,this.commandlist=new Set,this.nako_func={},this.logger=new U,this.prepare=new g(this.logger),this.parser=new r(this.logger),this.lexer=new y(this.logger),this.dependencies={},this.usedFuncs=new Set,this.setFunc=this.addFunc,this.numFailures=0,e.useBasicPlugin&&this.addBasicPlugins()}addBasicPlugins(){this.addPluginObject("PluginSystem",T.Z),this.addPluginObject("PluginMath",F),this.addPluginObject("PluginPromise",N),this.addPluginObject("PluginAssert",P)}replaceLogger(){return this.prepare.logger=this.lexer.logger=this.parser.logger=this.logger=new U}static listRequireStatements(e){const t=[];for(let n=0;n+2<e.length;n++)"not"!==e[n].type||"string"!==e[n+1].type&&"string_ex"!==e[n+1].type||"取込"!==e[n+2].value||(t.push({start:n,end:n+3,value:e[n+1].value+"",firstToken:e[n],lastToken:e[n+2]}),n+=2);return t}_loadDependencies(e,t,s,r){const o={},i=new X({useBasicPlugin:!0}),u=(e,t,s)=>{const c=[];for(const a of X.listRequireStatements(i.rawtokenize(e,0,t,s)).map((e=>({...e,...r.resolvePath(e.value,e.firstToken)}))))if(o.hasOwnProperty(a.filePath))o[a.filePath].alias.add(a.value);else if(o[a.filePath]={tokens:[],alias:new Set([a.value]),addPluginFile:()=>{},funclist:{}},"js"===a.type||"mjs"===a.type){const e=r.readJs(a.filePath,a.firstToken);e.sync?o[a.filePath].addPluginFile=()=>{this.addPluginFile(a.value,a.filePath,o[a.filePath].funclist=e.value(),!1)}:c.push(e.value.then((e=>{o[a.filePath].addPluginFile=()=>{this.addPluginFile(a.value,a.filePath,o[a.filePath].funclist=e(),!1)}})))}else{if("nako3"!==a.type)throw new n.l0(`ファイル ${a.value} を読み込めません。未対応の拡張子です。`,a.firstToken.line,a.firstToken.file);{const e=r.readNako3(a.filePath,a.firstToken),t=e=>{e=`「${a.filePath}」にプラグイン名設定;`+e+";『メイン』にプラグイン名設定;";const t=this.rawtokenize(e,0,a.filePath);o[a.filePath].tokens=t;const n={};return y.preDefineFunc(z(t),this.logger,n),o[a.filePath].funclist=n,u(e,a.filePath,"")};e.sync?t(e.value):c.push(e.value.then((e=>t(e))))}}if(c.length>0)return Promise.all(c)};try{const n=u(e,t,s);return void 0!==n&&n.catch((e=>{throw this.logger.error(e),e})),this.dependencies=o,n}catch(e){throw this.logger.error(e),e}}rawtokenize(e,t,s,r=""){if(!e.startsWith(r))throw new Error("codeの先頭にはpreCodeを含める必要があります。");const{code:o,insertedLines:i,deletedLines:u}=A.convert(e,s),c=C(o,s),a=this.prepare.convert(c),f=new I(o.length,a),l=new D(o,i,u),h=new J(e);let p;try{p=this.lexer.setInput(a.map((e=>e.text)).join(""),t,s)}catch(e){if(!(e instanceof n.cg))throw e;const t=l.map(f.map(e.preprocessedCodeStartOffset),f.map(e.preprocessedCodeEndOffset)),o=null===t.startOffset?e.line:h.map(t.startOffset,!1).line,i=R({...t,line:o},r);throw new n.tO(e.msg,i.startOffset,i.endOffset,i.line,s)}return p.map(((e,t)=>{const n=l.map(f.map(e.preprocessedCodeOffset),f.map(e.preprocessedCodeOffset+e.preprocessedCodeLength));let s=e.line,o=0;if("eol"===e.type&&null!==n.endOffset){const e=h.map(n.endOffset,!1);s=e.line,o=e.column}else if(null!==n.startOffset){const e=h.map(n.startOffset,!1);s=e.line,o=e.column}return{...e,...R({line:s,column:o,startOffset:n.startOffset,endOffset:n.endOffset},r),rawJosi:e.josi}}))}converttoken(e,t){return this.lexer.setInput2(e,t)}reset(){this.__varslist=[this.__varslist[0],{},{}],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.__vars=this.__varslist[2],this.__locals={},this.funclist={};for(const e of Object.keys(this.__v0)){const t=this.pluginFunclist[e];t&&(this.funclist[e]=JSON.parse(JSON.stringify(t)))}this.lexer.setFuncList(this.funclist)}lexCodeToken(e,t,n,s){let r=this.rawtokenize(e,t,n,"");if(null===s)for(const e of r)e.startOffset=null,e.endOffset=null;else for(const e of r)null!==e.startOffset&&(e.startOffset+=s),null!==e.endOffset&&(e.endOffset+=s);const o=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));return r=this.converttoken(r,!1),{tokens:r,commentTokens:o}}replaceRequireStatements(e,t=new Set){const n=[];for(const s of X.listRequireStatements(e).reverse()){if(t.has(s.value)){n.push(...e.splice(s.start,s.end-s.start));continue}const r=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(s.value)));this.dependencies[r].addPluginFile();const o=z(this.dependencies[r].tokens);t.add(s.value),n.push(...this.replaceRequireStatements(o,t)),n.push(...e.splice(s.start,s.end-s.start,...o))}return n}removeRequireStatements(e){const t=[];for(const n of X.listRequireStatements(e).reverse()){const s=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(n.value)));void 0!==s&&this.dependencies[s].addPluginFile(),t.push(...e.splice(n.start,n.end-n.start))}return t}lex(e,t,n="",s=!1){let r=this.rawtokenize(e,0,t,n);const o=s?this.removeRequireStatements(r):this.replaceRequireStatements(r,void 0);for(const e of o)"word"!==e.type&&"not"!==e.type||(e.type="require");const i=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));r=this.converttoken(r,!0);for(let e=0;e<r.length;e++)if("code"===r[e].type){const n=this.lexCodeToken(r[e].value,r[e].line,t,r[e].startOffset);i.push(...n.commentTokens),r.splice(e,1,...n.tokens),e--}return this.logger.trace("--- lex ---\n"+JSON.stringify(r,null,2)),{commentTokens:i,tokens:r,requireTokens:o}}parse(e,t,s=""){this.lexer.setFuncList(this.funclist),this.parser.setFuncList(this.funclist);const r=this.lex(e,t,s);let o;try{this.parser.genMode="sync",o=this.parser.parse(r.tokens)}catch(e){if("number"!=typeof e.startOffset)throw n.ih.fromNode(e.message,r.tokens[this.parser.index]);throw e}return this.usedFuncs=this.getUsedFuncs(o),this.logger.trace("--- ast ---\n"+JSON.stringify(o,null,2)),o}getUsedFuncs(e){const t=[e];for(this.usedFuncs=new Set;t.length>0;){const e=t.pop();null!=e&&null!==e.block&&void 0!==e.block&&this.getUsedAndDefFuncs(t,JSON.parse(JSON.stringify(e.block)))}return this.deleteUnNakoFuncs()}getUsedAndDefFuncs(e,t){for(;t.length>0;){const n=t.pop();null!=n&&this.getUsedAndDefFunc(n,e,t)}}getUsedAndDefFunc(e,t,n){["func","func_pointer"].includes(e.type)&&null!==e.name&&void 0!==e.name&&this.usedFuncs.add(e.name),t.push.apply(t,[e,e.block]),n.push.apply(n,[e.value].concat(e.args))}deleteUnNakoFuncs(){for(const e of this.usedFuncs)this.commandlist.has(e)||this.usedFuncs.delete(e);return this.usedFuncs}compile(e,t,n,s=""){const r=this.parse(e,t,s);return this.generateCode(r,n,s).runtimeEnv}generateCode(e,t,n=""){switch(e.genMode){case"sync":return(0,v.I)(this,e,t);case"非同期モード":return b.g.generate(this,e,t);default:throw new Error(`コードジェネレータの「${e.genMode}」はサポートされていません。`)}}_run(e,t,n,s,r=""){const o={resetLog:n,testOnly:s};return this._runEx(e,t,o,r)}clearPlugins(){this.__globals.forEach((e=>{e.reset()}))}_runEx(e,t,s,r="",o){let i;try{const n=Object.assign({resetEnv:!0,testOnly:!1,resetAll:!0},s);n.resetEnv&&this.reset(),n.resetAll&&this.clearPlugins();const o=this.parse(e,t,r);i=this.generateCode(o,n.testOnly)}catch(e){throw this.logger.error(e),e}o=o||new W(this,i.gen),this.__globals.indexOf(o)<0&&this.__globals.push(o);try{return new Function(i.runtimeEnv).apply(o),o}catch(e){let t=e;throw e instanceof n.as||(t=new n.as(e,o.__varslist[0].line)),this.logger.error(t),t}}runEx(e,t,n,s=""){return this._runEx(e,t,n,s)}test(e,t,n="",s){return this._runEx(e,t,{testOnly:s||!0},n)}run(e,t,n=""){return this._runEx(e,t,{resetAll:!1},n)}runReset(e,t,n=""){return this._runEx(e,t,{resetAll:!0},n)}compileStandalone(e,t,n,s=""){const r=this.parse(e,t,s);return this.generateCode(r,n).standalone}addPlugin(e,t=!0){const n=this.__varslist[0];void 0===n.meta&&(n.meta={});for(const s in e){const r=e[s];if(this.funclist[s]=r,t&&(this.pluginFunclist[s]=JSON.parse(JSON.stringify(r))),"func"===r.type)n[s]=r.fn;else{if("const"!==r.type&&"var"!==r.type)throw console.error("[プラグイン追加エラー]",r),new Error("プラグインの追加でエラー。");n[s]=r.value,n.meta[s]={readonly:"const"===r.type}}"初期化"!==s&&"!"!==s.substring(0,1)&&this.commandlist.add(s)}}addPluginObject(e,t,n=!0){if(this.__module[e]=t,this.pluginfiles[e]="*","object"==typeof t["初期化"]){const n=t["初期化"];delete t["初期化"];t[`!${e}:初期化`]=n}if(t.meta&&t.meta.value&&"object"==typeof t.meta){const n=t.meta;delete t.meta;t[`__${n.value.pluginName||e}`.replace("-","__")]=n}this.addPlugin(t,n)}addPluginFile(e,t,n,s=!0){this.addPluginObject(e,n,s),void 0===this.pluginfiles[e]&&(this.pluginfiles[e]=t)}addFunc(e,t,n,s=!0,r=!1){this.funclist[e]={josi:t,fn:n,type:"func",return_none:s,asyncFn:r},this.pluginFunclist[e]=z(this.funclist[e]),this.__varslist[0][e]=n}getFunc(e){return this.funclist[e]}}const Y=A.getBlockStructure,K=A.getIndent,Z=A.countIndent,Q=A.isIndentSyntaxEnabled;function ee(e,t,n,s,r){const o=function(e){switch(e.type){case"line_comment":return"comment.line";case"range_comment":return"comment.block";case"def_test":case"def_func":case"とは":case"ならば":case"でなければ":case"ここから":case"ここまで":case"もし":case"違えば":case"require":case"回":case"間":case"繰り返す":case"反復":case"抜ける":case"続ける":case"戻る":case"先に":case"次に":case"代入":case"逐次実行":case"条件分岐":case"取込":case"エラー監視":case"エラー":case"変数":case"実行速度優先":return"keyword.control";case"func":return"entity.name.function";case"number":return"constant.numeric";case"定める":case"定数":return"support.constant";case"shift_r0":case"shift_r":case"shift_l":case"gteq":case"lteq":case"noteq":case"eq":case"not":case"gt":case"lt":case"and":case"or":case"@":case"+":case"-":case"*":case"/":case"%":case"^":case"&":return"keyword.operator";case"string":case"string_ex":return"string.other";case"word":return["そう","それ","回数","対象キー","対象"].includes(e.value)?"variable.language":"variable.other";default:return"markup.other"}}(e),i=function(e,t){const n=e=>`<span class="tooltip-plugin-name">${se(e)}</span>`;if("func"===e.type){const s=te(e.value+"",t)||(e.meta&&e.meta.file?e.meta.file:null),r=e.meta&&e.meta.josi?ne(e.meta.josi):"";return s?se(r+e.value)+n(s):se(r+e.value)}if("word"===e.type){const s=te(e.value+"",t)||(e.meta&&e.meta.file?e.meta.file:null);if(s)return se(e.value+"")+n(s)}return null}(e,t);return e.rawJosi&&n.length>=e.rawJosi.length&&s&&r?[{type:o,docHTML:i,value:n.slice(0,-e.rawJosi.length)},{type:o+".markup.underline",docHTML:i,value:n.slice(-e.josi.length)}]:[{type:o,docHTML:i,value:n}]}function te(e,t){for(const n of Object.keys(t.__module))if(Object.keys(t.__module[n]).includes(e))return n;return null}function ne(e){const t=e.map(((e,t)=>e.map((e=>`${function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");return e.toString(26).split("").map((e=>t[parseInt(e,26)])).join("")}(t)}${e}`)).join("|"))).join("、");return""!==t?`(${t})`:""}function se(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const re=(e,t)=>[{type:"markup.other",value:t.getLine(e),docHTML:null}],oe=(e,t)=>{const n=e.logger;try{return e.replaceLogger(),t()}finally{e.logger=n}};function ie(e,t,n){const s=e.join("\n");t.reset();const r=oe(t,(()=>t.lex(s,"main.nako3",void 0,!0)));r.commentTokens=r.commentTokens.filter((e=>"main.nako3"===e.file)),r.requireTokens=r.requireTokens.filter((e=>"main.nako3"===e.file)),r.tokens=r.tokens.filter((e=>"main.nako3"===e.file));for(const[e,{funclist:n}]of Object.entries(t.dependencies))for(const t of r.tokens)"word"===t.type&&"それ"!==t.value&&n[t.value]&&(t.type="func",t.meta={...n[t.value+""],file:e});const o=[...r.tokens,...r.commentTokens,...r.requireTokens].filter((e=>"eol"!==e.type&&"eof"!==e.type&&"number"==typeof e.startOffset&&"number"==typeof e.endOffset&&e.startOffset<e.endOffset));o.sort(((e,t)=>(e.startOffset||0)-(t.startOffset||0)));let i=0,u=0;const c=[];for(let r=0;r<e.length;r++){c.push([]);const a=i+e[r].length;let f=i;for(;u<o.length&&o[u].endOffset<=i;)u++;if(u<o.length&&o[u].startOffset<=i&&o[u].endOffset>=a)c[r].push(...ee(o[u],t,e[r],o[u].endOffset<=a,n));else{for(u<o.length&&o[u].startOffset<=i&&(c[r].push(...ee(o[u],t,s.slice(f,o[u].endOffset),!0,n)),f=o[u].endOffset,u++);u<o.length&&o[u].endOffset<a;)f<o[u].startOffset&&(c[r].push({type:"markup.other",docHTML:null,value:s.slice(f,o[u].startOffset)}),f=o[u].startOffset),c[r].push(...ee(o[u],t,s.slice(f,o[u].endOffset),!0,n)),f=o[u].endOffset,u++;u<o.length&&o[u].startOffset<a?(f<o[u].startOffset&&(c[r].push({type:"markup.other",docHTML:null,value:s.slice(f,o[u].startOffset)}),f=o[u].startOffset),c[r].push(...ee(o[u],t,s.slice(o[u].startOffset,a),o[u].endOffset<=a,n))):c[r].push({type:"markup.other",docHTML:null,value:s.slice(f,a)})}i+=e[r].length+1}return{editorTokens:c,lexerOutput:r}}class ue{constructor(e,t,n,s){this.session=e,this.doc=t,this.AceRange=n,this.markers=[],this.hasAnnotations=!1,this.disable=s}static fromNullable(e,t,n,s,r){return null===t&&(t=0),null===n&&(n=e),null===s&&(s=r(n).length),e===n&&t===s&&s++,[e,t,n,s]}static fromOffset(e,t,n){const s=new J(e),r=s.map(t,!1),o=s.map(n,!1);return[r.line,r.column,o.line,o.column]}static fromError(e,t,n){return"number"==typeof t.startOffset&&"number"==typeof t.endOffset?this.fromOffset(e,t.startOffset,t.endOffset):"number"==typeof t.line?this.fromNullable(t.line,null,null,null,n):this.fromNullable(0,null,null,null,n)}add(e,t,n,s,r,o){if(this.disable)return;const i=new this.AceRange(...ue.fromNullable(e,t,n,s,(e=>this.doc.getLine(e))));this.markers.push(this.session.addMarker(i,"marker-"+("warn"===o?"yellow":"red"),"text",!1)),this.session.setAnnotations([{row:e,column:t,text:r,type:"warn"===o?"warning":"error"}]),this.hasAnnotations=!0}addByError(e,t,n){this.add(...ue.fromError(e,t,(e=>this.doc.getLine(e))),t.message,n)}clear(){for(const e of this.markers)this.session.removeMarker(e);this.markers.length=0,this.hasAnnotations&&(this.session.clearAnnotations(),this.hasAnnotations=!1)}}class ce{constructor(e,t,n,s,r){this.onUpdate=n,this.doc=e,this.dirty=!0,this.nako3=t,this.onCompileError=s,this.underlineJosi=r,this.lastLexerOutput=null,this.lines=this.doc.getAllLines().map((e=>[{type:"markup.other",value:e,docHTML:null}])),this.cache=null,this.deleted=!1,this.enabled=!0;const o=()=>{if(!this.deleted)if(this.dirty&&this.enabled){const e=Date.now();this.dirty=!1;const r=this.doc.getAllLines().join("\n");try{const e=Date.now(),s=ie(this.doc.getAllLines(),t,this.underlineJosi);this.lastLexerOutput=s.lexerOutput,this.lines=s.editorTokens,this.cache={code:r,lines:JSON.stringify(this.lines)},n(0,this.doc.getLength()-1,Date.now()-e)}catch(e){s(r,e)}setTimeout(o,Math.max(100,Math.min(5e3,5*(Date.now()-e))))}else setTimeout(o,100)};setTimeout((()=>{o()}),0)}dispose(){this.deleted=!0}$updateOnChange(e){this.dirty=!0;const t=e.start.row,n=e.end.row;if(t===n)if("insert"===e.action&&this.lines[t]){const n=e.start.column,s=this.lines[t].filter((e=>"composition_placeholder"!==e.type)),r=[];let o=0,i=0;for(;o<s.length&&i+s[o].value.length<=n;)r.push(s[o]),i+=s[o].value.length,o++;for(o<s.length&&i<n?(r.push({type:s[o].type,value:s[o].value.slice(0,n-i),docHTML:null}),r.push({type:"markup.other",value:e.lines[0],docHTML:null}),r.push({type:s[o].type,value:s[o].value.slice(n-i),docHTML:null}),o++):r.push({type:"markup.other",value:e.lines[0],docHTML:null});o<s.length;)r.push(s[o]),o++;this.lines[t]=r}else this.lines[t]=re(t,this.doc);else"remove"===e.action?this.lines.splice(t,n-t+1,re(t,this.doc)):this.lines.splice(t,1,...Array(n-t+1).fill(null).map(((e,n)=>re(n+t,this.doc))))}getTokens(e){if(!this.lines[e]){let t=!1;if(this.enabled){const e=this.doc.getAllLines().join("\n");if(null!==this.cache&&this.cache.code===e)t=!0;else try{const n=ie(this.doc.getAllLines(),this.nako3,this.underlineJosi);this.cache={code:e,lines:JSON.stringify(n.editorTokens)},t=!0}catch(e){e instanceof n.k||console.error(e)}}t&&null!==this.cache?this.lines[e]=JSON.parse(this.cache.lines)[e]:this.lines[e]=re(e,this.doc)}return this.lines[e]}start(e){}fireUpdateEvent(e,t){}setDocument(e){}scheduleStart(){}setTokenizer(e){}stop(){}getState(e){return"start"}}class ae{constructor(e,t){this.AceRange=e,this.nako3=t}static toggleCommentLines(e,{doc:t},n,s){const r=new g(new U),o=e=>{const t=K(e);if(t===e)return{type:"blank"};const n=(e=e.substr(t.length)).substr(0,2).split("").map((e=>r.convert1ch(e))).join("");return"#"===n.substr(0,1)?{type:"comment",start:t.length,len:1+(" "===e.charAt(1)?1:0)}:"//"===n?{type:"comment",start:t.length,len:2+(" "===e.charAt(2)?1:0)}:{type:"code"}},i=[];for(let e=n;e<=s;e++)i.push(e);if(!i.every((e=>"blank"===o(t.getLine(e)).type))&&i.every((e=>"code"!==o(t.getLine(e)).type)))for(const e of i){const n=o(t.getLine(e));"comment"===n.type&&t.removeInLine(e,n.start,n.start+n.len)}else{const e=Math.min(...i.map((e=>Z(t.getLine(e)))));for(const n of i){const s=t.getLine(n);let r=s.length;for(let t=0;t<s.length;t++)if(Z(s.slice(0,t))>=e){r=t;break}t.insertInLine({row:n,column:r},"// ")}}}static checkOutdent(e,t,n){return/^[  ・\t]*ここまで$/.test(t+n)}autoOutdent(e,{doc:t},n){if(0===n)return;const s=t.getLine(n-1);let r;if(ae.isBlockStart(s))r=K(s);else{const e=this.getBlockStructure(t.getAllLines().join("\n")),s=e.parents[n];r=null!==s?e.spaces[s]:""}const o=K(t.getLine(n));t.replace(new this.AceRange(n,0,n,o.length),r)}static getNextLineIndent(e,t,n){return this.isBlockStart(t)?K(t)+n:K(t)}static isBlockStart(e){return/^[  ・\t]*●|(ならば|なければ|ここから|条件分岐|違えば|回|繰り返(す|し)|の間|反復|とは|には|エラー監視|エラーならば|実行速度優先)、?\s*$/.test(e)}static getCompletionItems(e,t,n,s){const r=new Map,o=new Set,i=(e,n,s)=>{const i=r.get(e);if(i)i.meta.add(s);else{const i=t.split("").filter((e=>n.includes(e))).length;r.set(e,{value:n,meta:new Set([s]),score:i}),o.add(n)}};for(const e of Object.keys(n.__varslist[0])){if(e.startsWith("!"))continue;const t=n.funclist[e];if("object"!=typeof t||null===t)continue;const s=te(e,n)||"プラグイン";"func"===t.type?i(ne(t.josi)+e,e,s):i(e,e,s)}for(const[e,{funclist:t}]of Object.entries(n.dependencies))for(const[n,s]of Object.entries(t)){i((s&&"func"===s.type?ne(s.josi):"")+n,n,e)}if(null!==s.lastLexerOutput)for(const t of s.lastLexerOutput.tokens){const s=t.value+"";if(t.line!==e&&!o.has(s))if("word"===t.type)i(s,s,"変数");else if("func"===t.type){const e=n.funclist[s];i((e&&"func"===e.type?ne(e.josi):"")+s,s,"関数")}}return Array.from(r.entries()).map((([e,t])=>({caption:e,...t,meta:Array.from(t.meta).join(", ")})))}static getSnippets(e){const t=Q(e),n=(e,n,s)=>t?{caption:e,meta:`⇥ ${n}`,score:1,snippet:s.replace(/\t*ここまで(\n|$)/g,"").replace(/\t/g," ")}:{caption:e,meta:`⇥ ${n}`,score:1,snippet:s.replace(/\t/g," ")};return[n("if","もし〜ならば","もし${1:1=1}ならば\n\t${2:1を表示}\n違えば\n\t${3:2を表示}\nここまで\n"),n("times","〜回","${1:3}回\n\t${2:1を表示}\nここまで\n"),n("for","繰り返す","${1:N}で${2:1}から${3:3}まで繰り返す\n\t${4:Nを表示}\nここまで\n"),n("while","〜の間","${1:N<2の間}\n\tN=N+1\nここまで\n"),n("foreach","〜を反復","${1:[1,2,3]}を反復\n\t${2:対象を表示}\nここまで\n"),n("switch","〜で条件分岐","${1:N}で条件分岐\n\t${2:1}ならば\n\t\t${3:1を表示}\n\tここまで\n\t${4:2}ならば\n\t\t${5:2を表示}\n\tここまで\n\t違えば\n\t\t${6:3を表示}\n\tここまで\nここまで\n"),n("function","●〜とは","●(${1:AとBを})${2:足す}とは\n\t${3:A+Bを戻す}\nここまで\n"),n("test","●テスト:〜とは","●テスト:${2:足す}とは\n\t1と2を足す\n\tそれと3がASSERT等しい\nここまで\n"),n("try","エラー監視","エラー監視\n\t${1:1のエラー発生}\nエラーならば\n\t${2:2を表示}\nここまで\n")]}static getCompletionPrefix(e,t){let s=null;if(0===e.length||!/[ぁ-んa-zA-Zァ-ヶー\u3005\u4E00-\u9FCF]/.test(e[e.length-1]))return"";try{t.reset(),s=oe(t,(()=>t.lex(e,"completion.nako3",void 0,!0))).tokens.filter((e=>"eol"!==e.type&&"eof"!==e.type))}catch(e){e instanceof n.k||console.error(e)}if(null===s||0===s.length||!s[s.length-1].value)return"";const r=s[s.length-1].value+"";return/[ぁ-ん]/.test(r[r.length-1])&&!/[ぁ-ん]/.test(r[0])?"":r}getFoldWidget({doc:e},t,n){return ae.isBlockStart(e.getLine(n))?"start":""}getFoldWidgetRange({doc:e},t,n){const s=this.getBlockStructure(e.getAllLines().join("\n")).pairs.find((e=>e[0]===n));return void 0!==s?new this.AceRange(s[0],e.getLine(s[0]).length,s[1]-1,e.getLine(s[1]-1).length):null}static getCodeLens(e){const t=[];for(const[n,s]of Array.from(e.getAllLines().entries())){const e=/^[  ・\t]*●テスト:(.+?)(?:とは|$)/.exec(s);null!==e&&t.push({start:{row:n},command:{title:"テストを実行",id:"runTest",arguments:[e[1]]}})}return t}getBlockStructure(e){return this.blockStructure&&this.blockStructure.code===e||(this.blockStructure={code:e,data:Y(e)}),this.blockStructure.data}}class fe{constructor(e,t,n){this.editor=e,this.AceRange=t,this.UndoManager=n}newTab(e){return{content:e,cursor:{range:new this.AceRange(0,0,0,0),reversed:!1},scroll:{left:0,top:0},undoManger:new this.UndoManager}}getTab(){return{content:this.editor.getValue(),cursor:{range:this.editor.session.selection.getRange(),reversed:this.editor.session.selection.isBackwards()},scroll:{left:this.editor.session.getScrollLeft(),top:this.editor.session.getScrollTop()},undoManger:this.editor.session.getUndoManager()}}setTab(e){this.editor.setValue(e.content),this.editor.session.selection.setRange(e.cursor.range,e.cursor.reversed),this.editor.session.setScrollLeft(e.scroll.left),this.editor.session.setScrollTop(e.scroll.top),this.editor.session.setUndoManager(e.undoManger)}}class le{static save(e){try{const t={};for(const n of["syntaxHighlighting","keyboardHandler","theme","fontSize","wrap","useSoftTabs","tabSize","showInvisibles","enableLiveAutocompletion","indentedSoftWrap","underlineJosi"])t[n]=e.getOption(n);localStorage.setItem("nako3EditorOptions",JSON.stringify(t))}catch(e){return console.error(e),null}}static load(e){try{if(!window.localStorage)return null;const t=window.localStorage.getItem("nako3EditorOptions");if(null===t)return null;const n=JSON.parse(t);["ace/keyboard/vscode","ace/keyboard/emacs","ace/keyboard/sublime","ace/keyboard/vim"].includes(n.keyboardHandler)&&e.setOption("keyboardHandler",n.keyboardHandler),["ace/theme/xcode","ace/theme/monokai"].includes(n.theme)&&e.setOption("theme",n.theme),"number"==typeof n.fontSize&&e.setOption("fontSize",Math.min(48,Math.max(6,n.fontSize)));for(const t of["syntaxHighlighting","wrap","useSoftTabs","showInvisibles","enableLiveAutocompletion","indentedSoftWrap","underlineJosi"])"boolean"==typeof n[t]&&e.setOption(t,n[t]);"number"==typeof n.tabSize&&e.setOption("tabSize",Math.min(16,Math.max(0,n.tabSize)))}catch(e){return console.error(e),null}}static initPanel(e,t){const n=new e(t);if(this.done)return;this.done=!0;let s=!0;n.renderOptionGroup=e=>{if(s){for(const t of Object.keys(e))delete e[t];e["シンタックスハイライト"]={path:"syntaxHighlighting"},e["キーバインド"]={path:"keyboardHandler",type:"select",items:[{caption:"VSCode",value:"ace/keyboard/vscode"},{caption:"Emacs",value:"ace/keyboard/emacs"},{caption:"Sublime",value:"ace/keyboard/sublime"},{caption:"Vim",value:"ace/keyboard/vim"}]},e["カラーテーマ"]={path:"theme",type:"select",items:[{caption:"ライト",value:"ace/theme/xcode"},{caption:"ダーク",value:"ace/theme/monokai"}]},e["文字サイズ"]={path:"fontSize",type:"number",defaultValue:16},e["行の折り返し"]={path:"wrap",type:"select",items:[{caption:"なし",value:"off"},{caption:"あり",value:"free"}]},e["ソフトタブ"]=[{path:"useSoftTabs"},{ariaLabel:"Tab Size",path:"tabSize",type:"number",values:[2,3,4,8,16]}],e["空白文字を表示"]={path:"showInvisibles"},e["常に自動補完"]={path:"enableLiveAutocompletion"},e["折り返した行をインデント"]={path:"indentedSoftWrap"},e["助詞に下線を引く"]={path:"underlineJosi"},s=!1}else for(const t of Object.keys(e))delete e[t]},n.render();const r=e.prototype.render,o=this;e.prototype.render=function(...e){r.apply(this,...e),this.on("setOption",(()=>{console.log("設定を保存しました。"),o.save(this.editor)}))}}}const he=[];let pe=0;function de(e,t,n){const s=n.edit(e),r="string"==typeof e?document.getElementById(e):e;if(null===r)throw new Error(`idが ${e} のHTML要素は存在しません。`);const o=n.require("ace/range").Range,i=new ue(s.session,s.session.bgTokenizer.doc,o,!!r.dataset.nako3DisableMarker);if(r.classList.contains("nako3_ace_mounted"))throw new Error("なでしこ言語のエディタの初期化処理を同一のHTML要素に対して複数回適用しました。");r.setAttribute("lang","en"),r.classList.add("nako3_ace_mounted"),r.classList.add("nako3_editor");const u=r.dataset.nako3Readonly;u&&(r.classList.add("readonly"),s.setReadOnly(!0)),s.setFontSize(16);const c=e=>{const t=e.doc,n=t.getAllLines(),s=e.selection.getRange();t.removeFullLines(0,t.getLength()),t.insert({row:0,column:0},n.join("\n")),e.selection.setRange(s,!1)};n.require("ace/config").defineOptions(s.constructor.prototype,"editor",{syntaxHighlighting:{set:function(e){this.session.bgTokenizer.enabled=e,c(this.session)},initialValue:!0},underlineJosi:{set:function(e){this.session.bgTokenizer.underlineJosi=e,c(this.session)},initialValue:!0}}),s.setOptions({wrap:"free",indentedSoftWrap:!1,showPrintMargin:!1}),n.require("ace/keybindings/vscode"),s.setKeyboardHandler("ace/keyboard/vscode");const a=new(0,n.require("ace/tooltip").Tooltip)(s.container);n.require("ace/lib/event").addListener(s.renderer.content,"mouseout",(()=>{a.hide()})),s.on("mousemove",(e=>{const t=e.getDocumentPosition();if(t.column>=e.editor.session.getLine(t.row).length)return void a.hide();const n=e.editor.session.getTokenAt(t.row,t.column+1);null!==n&&n.docHTML?(a.setHtml(n.docHTML),a.show(null,e.clientX,e.clientY)):a.hide()})),s.session.on("change",(()=>{a.hide(),i.clear()}));const f=!!r.dataset.nako3ForceSyntaxHighlighting;let l=!0;const h=s.session.bgTokenizer,p=new ce(s.session.bgTokenizer.doc,t,((e,t,n)=>{h._signal("update",{data:{first:e,last:t}}),n>220&&s.getOption("syntaxHighlighting")&&!u&&!f&&l&&(l=!1,k.classList.add("visible"),s.setOption("syntaxHighlighting",!1),setTimeout((()=>{k.classList.remove("visible")}),13e3))}),((e,t)=>{i.addByError(e,t,"error")}),s.getOption("underlineJosi"));s.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0});const d=pe++;s.wnako3EditorId=d,he.push({getCompletions(e,n,s,r,o){if(e.wnako3EditorId!==d)o(null,[]);else{const e=ae.getCompletionItems(s.row,r,t,p);if(e.some((e=>e.value===r)))return void o(null,[]);o(null,e)}}},{getCompletions(e,t,n,s,r){r(null,e.wnako3EditorId!==d?[]:ae.getSnippets(e.session.doc.getAllLines().join("\n")))}}),n.require("ace/ext/language_tools").setCompleters(he),n.require("ace/autocomplete/util").getCompletionPrefix=e=>{const n=e.getCursorPosition();return ae.getCompletionPrefix(e.session.doc.getLine(n.row).slice(0,n.column),t)};const _=new ae(o,t),y=n.require("ace/lib/oop"),m=n.require("ace/mode/text").Mode,g=function(){this.HighlightRules=(new m).HighlightRules,this.foldingRules={getFoldWidget:_.getFoldWidget.bind(_),getFoldWidgetRange:_.getFoldWidgetRange.bind(_)}};y.inherits(g,m),g.prototype.toggleCommentLines=ae.toggleCommentLines.bind(ae),g.prototype.getNextLineIndent=ae.getNextLineIndent.bind(ae),g.prototype.checkOutdent=ae.checkOutdent.bind(ae),g.prototype.autoOutdent=_.autoOutdent.bind(_),s.session.setMode(new g),s.session.bgTokenizer.stop(),s.session.bgTokenizer=p,s.setTheme("ace/theme/xcode"),le.load(s);const v=n.require("ace/ext/options").OptionPanel;le.initPanel(v,s);const b=document.createElement("div");b.classList.add("button-container"),s.container.appendChild(b);const k=document.createElement("span");k.classList.add("slow-speed-message"),k.innerHTML="<span>エディタの|応答速度が|低下したため|シンタックス|ハイライトを|無効化|しました。</span>".replace(/\|/g,"</span><span>"),b.appendChild(k);const w=[];try{const e=n.require("ace/ext/code_lens");s.setOption("enableCodeLens",!0),s.commands.addCommand({name:"runTest",exec:(e,t)=>{w.filter((e=>"test"===e.name)).forEach((e=>e.callback(t[0])))}}),e.registerCodeLensProvider(s,{provideCodeLenses:(e,t)=>{t(null,w.some((e=>"test"===e.name))?ae.getCodeLens(e.doc):[])}})}catch(e){console.error(e)}const j=()=>{s.container.classList.remove("fullscreen"),s.renderer.setScrollMargin(0,0,0,0)},S=document.createElement("span");S.classList.add("editor-button"),S.innerText="全画面表示",S.addEventListener("click",(e=>{s.container.classList.contains("fullscreen")?j():(s.container.classList.add("fullscreen"),s.renderer.setScrollMargin(20,20,0,0)),e.preventDefault()})),b.appendChild(S);const x=document.createElement("span");x.classList.add("editor-button"),x.innerText="設定を開く",x.addEventListener("click",(e=>{j(),s.execCommand("showSettingsMenu"),e.preventDefault()})),b.appendChild(x);const $=n.require("ace/undomanager").UndoManager,O=new fe(s,o,$);r.dataset.nako3Resizable&&(new MutationObserver((()=>{s.resize()})).observe(s.container,{attributes:!0}),s.renderer.setScrollMargin(4,0,4,0),s.container.classList.add("resizable"));const A=()=>{p.dirty=!0};return{editor:s,editorMarkers:i,editorTabs:O,retokenize:A,run:e=>{const n=s.getValue(),r=e.preCode||"",o=t.replaceLogger();if(e.outputContainer){const t=e.outputContainer;o.addListener("info",(({html:e})=>{t||console.log(e),t.style.display="block",t.innerHTML+=e})),e.outputContainer.classList.add("nako3-output-container")}const u=e.file||"main.nako3";o.addListener("info",(({position:e,noColor:t,level:s})=>{e.file!==u||"warn"!==s&&"error"!==s||i.addByError(n,{...e,message:t},s)}));return{promise:t.loadDependencies(r+n,u,r,e.localFiles||{}).then((()=>"test"===e.method?t.test(r+n,u,r,e.testName):"compile"===e.method?t.compile(r+n,u,!1,r):t.runReset(r+n,u,r))).catch((e=>{})).then((async e=>{for(A();p.dirty;)await new Promise((e=>setTimeout(e,0)));return e})).catch((e=>{console.error(e)})),logger:o,code:n}},codeLensListeners:w}}var _e={"水色":{type:"const",value:"aqua"},"紫色":{type:"const",value:"fuchsia"},"緑色":{type:"const",value:"lime"},"青色":{type:"const",value:"blue"},"赤色":{type:"const",value:"red"},"黄色":{type:"const",value:"yellow"},"黒色":{type:"const",value:"black"},"白色":{type:"const",value:"white"},"茶色":{type:"const",value:"maroon"},"灰色":{type:"const",value:"gray"},"金色":{type:"const",value:"gold"},"黄金色":{type:"const",value:"gold"},"銀色":{type:"const",value:"silver"},"白金色":{type:"const",value:"silver"},"オリーブ色":{type:"const",value:"olive"},"ベージュ色":{type:"const",value:"beige"},"アリスブルー色":{type:"const",value:"aliceblue"},RGB:{type:"func",josi:[["と"],["と"],["で","の"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};return"#"+s(e)+s(t)+s(n)},return_none:!1},"色混":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};if(!e)throw new Error("『色混ぜる』の引数には配列を指定します");if(e.length<3)throw new Error("『色混ぜる』の引数には[RR,GG,BB]形式の配列を指定します");return"#"+t(e[0])+t(e[1])+t(e[2])},return_none:!1}},ye={"終":{type:"func",josi:[],pure:!0,fn:function(){throw new Error("__終わる__")},return_none:!0},"OS取得":{type:"func",josi:[],pure:!0,fn:function(){const e=window.navigator.userAgent.toLowerCase();return-1!==e.indexOf("windows")?"windows":-1!==e.indexOf("android")?"android":-1!==e.indexOf("iphone")?"iphone":-1!==e.indexOf("ipad")?"ipad":-1!==e.indexOf("mac os x")||-1!==e.indexOf("macintosh")?"darwin":-1!==e.indexOf("cros")?"chromeos":-1!==e.indexOf("ubuntu")?"ubuntu":-1!==e.indexOf("linux")?"linux":"unknown"}}},me={"言":{type:"func",josi:[["と","を"]],pure:!0,fn:function(e){window.alert(e)},return_none:!0},"尋":{type:"func",josi:[["と","を"]],pure:!0,fn:function(e,t){const n=window.prompt(e);return n?/^[-+]?[0-9]+(\.[0-9]+)?$/.test(n)?parseFloat(n):/^[-+-+]?[0-90-9]+([..][0-90-9]+)?$/.test(n)?parseFloat(n.replace(/[-+0-9.]/g,(e=>String.fromCharCode(e.charCodeAt(0)-65248)))):n:t.__v0["空"]}},"文字尋":{type:"func",josi:[["と","を"]],pure:!0,fn:function(e,t){const n=window.prompt(e);return n||t.__v0["空"]}},"二択":{type:"func",josi:[["で","の","と","を"]],pure:!0,fn:function(e){return window.confirm(e)}}},ge={"ブラウザ移動":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){window.location.href=e}},"ブラウザ戻":{type:"func",josi:[],pure:!0,fn:function(){window.history.back(-1)}},"ブラウザURL":{type:"const",value:""}},ve={"AJAX送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!0,fn:function(e,t,n){let s=n.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(t,s).then((e=>e.text())).then((t=>{n.__v0["対象"]=t,"非同期モード"===n.__genMode&&(n.newenv=!0),e(t,n)})).catch((e=>{console.log("[fetch.error]",e),n.__v0["AJAX:ONERROR"](e)}))},return_none:!0},"AJAX受信":{type:"func",josi:[["から","を"]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode)throw new Error("『AJAX受信』を使うには、プログラムの冒頭で「!非同期モード」と宣言してください。");const n=t.setAsync(t);let s=t.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(e,s).then((e=>{if(e.ok)return e.text();throw new Error("status="+e.status)})).then((e=>{t.__v0["対象"]=e,t.compAsync(t,n)})).catch((e=>{console.error("[AJAX受信のエラー]",e),t.__errorAsync(e,t)}))},return_none:!0},"AJAX受信時":{type:"func",josi:[["で"],["から","を"]],pure:!0,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"GET送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!1,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"POSTデータ生成":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=[];for(const t in e){const s=e[t],r=encodeURIComponent(t)+"="+encodeURIComponent(s);n.push(r)}return n.join("&")}},"POST送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n,s){const r=s.__exec("POSTデータ生成",[n,s]);fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"POSTフォーム送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n,s){const r=new FormData;for(const e in n)r.set(e,n[e]);fetch(t,{method:"POST",body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"AJAX失敗時":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){t.__v0["AJAX:ONERROR"]=e}},"AJAXオプション":{type:"const",value:""},"AJAXオプション設定":{type:"func",josi:[["に","へ","と"]],pure:!0,fn:function(e,t){t.__v0["AJAXオプション"]=e},return_none:!0},"AJAXオプションPOST設定":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){const n={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.__exec("POSTデータ生成",[e,t])};t.__v0["AJAXオプション"]=n},return_none:!0},"AJAX送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX送信』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"AJAX逐次送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX逐次送信』は『逐次実行』構文内で利用する必要があります。");t.resolveCount++;const n=t.resolve,s=t.reject;let r=t.__v0["AJAXオプション"];""===r&&(r={method:"GET"}),fetch(e,r).then((e=>e.text())).then((e=>{t.__v0["対象"]=e,n()})).catch((e=>{s(e.message)}))},return_none:!0},"AJAX保障送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){let n=t.__v0["AJAXオプション"];return""===n&&(n={method:"GET"}),fetch(e,n)},return_none:!1},"HTTP取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"HTTP逐次取得":{type:"func",josi:[["の","から","を"]],pure:!1,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP逐次取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"HTTP保障取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){return t.__exec("AJAX保障送信",[e,t])},return_none:!1},"POST逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,o=n.__exec("POSTデータ生成",[t,n]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POST送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.__exec("POST逐次送信",[e,t,n])},return_none:!0},"POST保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=n.__exec("POSTデータ生成",[t,n]);return fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})},return_none:!1},"POSTフォーム逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム逐次送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,o=new FormData;for(const e in t)o.set(e,t[e]);fetch(e,{method:"POST",body:o}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POSTフォーム送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム送信』は『逐次実行』構文内で利用する必要があります。");n.__exec("POSTフォーム逐次送信",[e,t,n])},return_none:!0},"POSTフォーム保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=new FormData;for(const e in t)s.set(e,t[e]);return fetch(e,{method:"POST",body:s})},return_none:!1},"AJAX内容取得":{type:"func",josi:[["から"],["で"]],pure:!0,fn:function(e,t,n){return"TEXT"===(t=t.toString().toUpperCase())||"テキスト"===t?e.text():"JSON"===t?e.json():"BLOB"===t?e.blob():"ARRAY"===t||"配列"===t?e.arrayBuffer():"BODY"===t||"本体"===t?e.body:e.body()},return_none:!1},"AJAXテキスト取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.text()},return_none:!1},"AJAX_JSON取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.json()},return_none:!1}},be={DOCUMENT:{type:"const",value:""},WINDOW:{type:"const",value:""},NAVIGATOR:{type:"const",value:""},"DOM要素ID取得":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return document.getElementById(e)}},"DOM要素取得":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return document.querySelector(e)}},"DOM要素全取得":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return Array.from(document.querySelectorAll(e))}},"タグ一覧取得":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return document.getElementsByTagName(e)}},"DOM子要素取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if("string"==typeof e&&(e=document.querySelector(e)),!e.querySelector)throw new Error("『DOM子要素取得』で親要素がDOMではありません。");return e.querySelector(t)}},"DOM子要素全取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if("string"==typeof e&&(e=document.querySelector(e)),!e.querySelectorAll)throw new Error("『DOM子要素取得』で親要素がDOMではありません。");return e.querySelectorAll(t)}},"DOMイベント設定":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!1,fn:function(e,t,n,s){"string"==typeof e&&(e=document.querySelector(e)),e[t]=s.__findVar(n,null)},return_none:!0},"DOMテキスト設定":{type:"func",josi:[["に","の","へ"],["を"]],pure:!0,fn:function(e,t){"string"==typeof e&&(e=document.querySelector(e));const n=e.tagName.toUpperCase();if("INPUT"===n||"TEXTAREA"===n)e.value=t;else if("SELECT"===n)for(let n=0;n<e.options.length;n++){const s=e.options[n].value;if(String(s)===t){e.selectedIndex=n;break}}else e.innerHTML=t},return_none:!0},"DOMテキスト取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){if("string"==typeof e&&(e=document.querySelector(e)),!e.tagName)return console.log("[DOMテキスト取得]でタグ名が取得できません。",e),"";const t=e.tagName.toUpperCase();if("INPUT"===t||"TEXTAREA"===t)return e.value;if("SELECT"===t){const t=e.selectedIndex;return t<0?null:e.options[t].value}return e.innerHTML}},"DOM_HTML設定":{type:"func",josi:[["に","の","へ"],["を"]],pure:!0,fn:function(e,t){"string"==typeof e&&(e=document.querySelector(e)),e.innerHTML=t},return_none:!0},"DOM_HTML取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){return"string"==typeof e&&(e=document.querySelector(e)),e.innerHTML}},"テキスト設定":{type:"func",josi:[["に","の","へ"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("DOMテキスト設定",[e,t,n])}},"テキスト取得":{type:"func",josi:[["の","から"]],pure:!1,fn:function(e,t){return t.__exec("DOMテキスト取得",[e,t])}},"HTML設定":{type:"func",josi:[["に","の","へ"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("DOM_HTML設定",[e,t,n])}},"HTML取得":{type:"func",josi:[["の","から"]],pure:!1,fn:function(e,t){return t.__exec("DOM_HTML取得",[e,t])}},"DOM属性設定":{type:"func",josi:[["の"],["に","へ"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n,s){"string"==typeof e&&(e=document.querySelector(e));const r=s.__v0["DOM和スタイル"];r[t]&&(t=r[t]),e[t]=n},return_none:!0},"DOM属性取得":{type:"func",josi:[["の","から"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n){"string"==typeof e&&(e=document.querySelector(e));const s=n.__v0["DOM和スタイル"];return s[t]&&(t=s[t]),e[t]}},"DOM和スタイル":{type:"const",value:{"幅":"width","高さ":"height","高":"height","背景色":"background-color","色":"color","マージン":"margin","余白":"padding","文字サイズ":"font-size","行揃え":"text-align","左":"left","右":"right","中央":"center","ボーダー":"border","ボックス表示":"display","なし":"none","ブロック":"block","表示位置":"float","重なり":"z-index"}},"DOMスタイル設定":{type:"func",josi:[["の"],["に","へ"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n,s){"string"==typeof e&&(e=document.querySelector(e));const r=s.__v0["DOM和スタイル"];void 0!==r[t]&&(t=r[t]),void 0!==r[n]&&(n=r[n]),e.style[t]=n},return_none:!0},"DOMスタイル一括設定":{type:"func",josi:[["に","へ"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n){if("string"==typeof e&&(e=document.querySelectorAll(e)),!e)return;e instanceof window.HTMLElement&&(e=[e]);const s=n.__v0["DOM和スタイル"];for(let n=0;n<e.length;n++){const r=e[n];for(const e in t){let n=e,o=t[e];void 0!==s[n]&&(n=s[n]),void 0!==s[o]&&(o=s[o]),r.style[n]=o}}},return_none:!0},"DOMスタイル取得":{type:"func",josi:[["の"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n){if("string"==typeof e&&(e=document.querySelector(e)),!e)return"";const s=n.__v0["DOM和スタイル"];return s[t]&&(t=s[t]),e.style[t]}},"DOMスタイル一括取得":{type:"func",josi:[["の"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n){const s={};if("string"==typeof e&&(e=document.querySelector(e)),!e)return s;t instanceof String&&(t=[t]);const r=n.__v0["DOM和スタイル"];if(t instanceof Array)return t.forEach((t=>{r[t]&&(t=r[t]),s[t]=e.style[t]})),s;if(t instanceof Object){for(let n in t)r[n]&&(n=r[n]),s[n]=e.style[n];return s}return e.style[t]}},"DOM要素作成":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return document.createElement(e)}},"DOM子要素追加":{type:"func",josi:[["に","へ"],["を"]],pure:!0,fn:function(e,t){"string"==typeof t&&(t=document.querySelector(t)),"string"==typeof e&&(e=document.querySelector(e)),e.appendChild(t)}},"DOM子要素削除":{type:"func",josi:[["から"],["を"]],pure:!0,fn:function(e,t){"string"==typeof t&&(t=document.querySelector(t)),"string"==typeof e&&(e=document.querySelector(e)),e.removeChild(t)}},"注目":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){"string"==typeof e&&(e=document.querySelector(e)),e.focus&&e.focus()},return_none:!0}},ke={"対象イベント":{type:"const",value:""},"DOMイベント追加":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!1,fn:function(e,t,n,s){s.__addEvent(e,t,n,null)},return_none:!0},"DOMイベント削除":{type:"func",josi:[["の"],["から"],["を"]],pure:!1,fn:function(e,t,n,s){s.__removeEvent(e,t,n)},return_none:!0},"DOMイベント発火時":{type:"func",josi:[["で"],["の"],["が"]],pure:!0,fn:function(e,t,n,s){s.__addEvent(t,n,e,null)},return_none:!0},"DOMイベント処理停止":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e,t){e.preventDefault()},return_none:!0},"クリック時":{type:"func",josi:[["で"],["を"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"click",e,null)},return_none:!0},"読込時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"load",e,null)},return_none:!0},"フォーム送信時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"submit",e,null)},return_none:!0},"押キー":{type:"const",value:""},"キー押時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"keydown",e,n.__keyHandler)},return_none:!0},"キー離時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"keyup",e,n.__keyHandler)},return_none:!0},"キータイピング時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"keypress",e,n.__keyHandler)},return_none:!0},"マウスX":{type:"const",value:0},"マウスY":{type:"const",value:0},"マウス押時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"mousedown",e,n.__mouseHandler)},return_none:!0},"マウス移動時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"mousemove",e,n.__mouseHandler)},return_none:!0},"マウス離時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"mouseup",e,n.__mouseHandler)},return_none:!0},"タッチX":{type:"const",value:0},"タッチY":{type:"const",value:0},"タッチ配列":{type:"const",value:[]},"タッチイベント計算":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){return t.__touchHandler(e,t)}},"タッチ開始時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"touchstart",e,n.__touchHandler)},return_none:!0},"タッチ時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"touchmove",e,n.__touchHandler)},return_none:!0},"タッチ終了時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"touchend",e,n.__touchHandler)},return_none:!0},"タッチキャンセル時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"touchcancel",e,n.__touchHandler)},return_none:!0},"画面更新時実行":{type:"func",josi:[["を"]],pure:!1,fn:function(e,t){if(!(e=t.__findVar(e,null)))throw new Error("『画面更新時実行』で関数の取得に失敗しました。");return t.__requestAnimationFrameLastId=window.requestAnimationFrame(e),t.__requestAnimationFrameLastId}},"画面更新処理取消":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){window.cancelAnimationFrame(e),t.__requestAnimationFrameLastId===e&&(t.__requestAnimationFrameLastId=0)},return_none:!0}},we={"DOM親要素":{type:"const",value:""},"DOM部品個数":{type:"const",value:0},"DOM部品オプション":{type:"const",value:{"自動改行":!1,"テーブル背景色":["#AA4040","#ffffff","#fff0f0"]}},"DOM親要素設定":{type:"func",josi:[["に","へ"]],pure:!1,fn:function(e,t){return"string"==typeof e&&(e=document.querySelector(e)||document.getElementById(e)),t.__v0["DOM親要素"]=e,e}},"DOM親部品設定":{type:"func",josi:[["に","へ"]],pure:!1,fn:function(e,t){return t.__exec("DOM親要素設定",[e,t])}},"DOMスキン":{type:"const",value:""},"DOMスキン辞書":{type:"const",value:{}},"DOMスキン設定":{type:"func",josi:[["を","に","の"]],pure:!1,fn:function(e,t){t.__v0["DOMスキン"]=e},return_none:!0},"DOM部品作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__v0["DOM親要素"],s="string"==typeof e?document.createElement(e):e;s.id="nadesi-dom-"+t.__v0["DOM部品個数"];const r=t.__v0["DOMスキン辞書"][t.__v0["DOMスキン"]];"function"==typeof r&&r(e,s,t),n.appendChild(s),t.__v0["DOM部品個数"]++;return t.__v0["DOM部品オプション"]["自動改行"]&&n.appendChild(document.createElement("br")),s}},"ボタン作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["button",t]);return n.innerHTML=e,n}},"エディタ作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["input",t]);return n.type="text",n.value=e,n}},"テキストエリア作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["textarea",t]);return n.value=e,n}},"ラベル作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["span",t]);return n.innerHTML=e,n}},"キャンバス作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["canvas",t]);return n.width=e[0],n.height=e[1],n.style.width=e[0],n.style.height=e[1],t.__exec("描画開始",[n,t]),n}},"画像作成":{type:"func",josi:[["の","から"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["img",t]);return n.src=e,n}},"改行作成":{type:"func",josi:[],pure:!1,fn:function(e){return e.__exec("DOM部品作成",["br",e])}},"チェックボックス作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=document.createElement("span"),s=document.createElement("input");s.type="checkbox",s.id="nadesi-dom-"+t.__v0["DOM部品個数"],t.__v0["DOM部品個数"]++;const r=document.createElement("label");return r.innerHTML=e,r.htmlFor=s.id,n.appendChild(s),n.appendChild(r),t.__exec("DOM部品作成",[n,t]),s}},"セレクトボックス作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=document.createElement("select");for(let t=0;t<e.length;t++){const s=document.createElement("option");s.value=e[t],s.appendChild(document.createTextNode(e[t])),n.appendChild(s)}t.__exec("DOM部品作成",[n,t]);return n}},"セレクトボックスアイテム設定":{type:"func",josi:[["を"],["へ","に"]],pure:!1,fn:function(e,t,n){"stirng"==typeof t&&(t=document.querySelector(t)),t.options.length=0;for(let n=0;n<e.length;n++){const s=document.createElement("option");s.value=e[n],s.appendChild(document.createTextNode(e[n])),t.appendChild(s)}},return_none:!0},"色選択ボックス作成":{type:"func",josi:[],pure:!1,fn:function(e){const t=e.__exec("DOM部品作成",["input",e]);return t.type="color",t}},"日付選択ボックス作成":{type:"func",josi:[],pure:!1,fn:function(e){const t=e.__exec("DOM部品作成",["input",e]);return t.type="date",t}},"パスワード入力エディタ作成":{type:"func",josi:[["の","で"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["input",t]);return n.type="password",n.value=e,n}},"値指定バー作成":{type:"func",josi:[["の","で"]],pure:!1,fn:function(e,t){e instanceof Array&&!(e.length<2)||(e=[0,100,50]),e.length<=2&&e.push(Math.floor((e[1]-e[0])/2));const n=t.__exec("DOM部品作成",["input",t]);return n.type="range",n.min=e[0],n.max=e[1],n.value=e[2],n}},"送信ボタン作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["input",t]);return n.type="submit",n.value=e,n}},"フォーム作成":{type:"func",josi:[["で","の"],["を"]],pure:!1,fn:function(e,t,n){const s=n.__exec("DOM部品作成",["form",n]);if(e instanceof Object)for(let t in e)s[t]&&(s[t]=e[t]);const r=t.split("\n"),o=document.createElement("table");for(let e in r){let t=""+r[e];if(""===t)continue;t.indexOf("=")<0&&(t+="=");const s=t.split("="),i=s[0],u=s[1],c=document.createElement("th");c.innerHTML=n.__tohtmlQ(i);const a=document.createElement("td");if("?("===u.substring(0,2)){const e=(u.substring(2)+")").split(")"),t=e[0],n=e[1],s=t.split("|"),r=document.createElement("select");r.name=i;for(let e of s){const t=document.createElement("option");t.value=e,t.text=e,r.appendChild(t)}const o=s.indexOf(n);o>=0&&(r.selectedIndex=o),a.appendChild(r)}else{const e=document.createElement("input");a.appendChild(e),e.id="nako3form_"+i,"?送信"===u||"?submit"===u?(e.type="submit",e.value=u.substring(1),""!=i&&(e.name=i)):"?c"===u.substring(0,2)?(e.type="color",e.value=u.substring(2),e.name=i):(e.type="text",e.value=u,e.name=i)}const f=document.createElement("tr");f.appendChild(c),f.appendChild(a),o.appendChild(f)}return s.appendChild(o),s}},"フォーム入力一括取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){"string"==typeof e&&(e=document.querySelector(e));const t={},n=e=>{if(e&&e.childNodes)for(let s=0;s<e.childNodes.length;s++){const r=e.childNodes[s];if(!r.tagName)return;const o=r.tagName.toLowerCase();if("input"!==o)"textarea"===o?t[r.name]=r.value:"select"===o&&(r.selectedIndex>=0?t[r.name]=r.options[r.selectedIndex].value:t[r.name]=""),n(r);else{if("checkbox"===r.type){t[r.name]=r.checked?r.value:"";continue}t[r.name]=r.value}}};return n(e),t}},"テーブル作成":{type:"func",josi:[["の","から"]],pure:!1,fn:function(e,t){if("string"==typeof e){const t=[],n=e.split("\n");for(let e of n)t.push(e.split(","));e=t}const n=JSON.parse(JSON.stringify(t.__v0["DOM部品オプション"]["テーブル背景色"]));for(let e=0;e<3;e++)n.push("");const s=n.shift(),r=t.__exec("DOM部品作成",["table",t]);for(let o in e){const i=e[o],u=document.createElement("tr");for(let e of i){e=""+e;const r=document.createElement(0==o?"th":"td");r.innerHTML=t.__tohtml(e),""!=s&&(r.style.backgroundColor=0==o?s:n[o%2],r.style.color=0==o?"white":"black"),e.match(/^(\+|\-)?\d+(\.\d+)?$/)&&(r.style.textAlign="right"),u.appendChild(r)}r.appendChild(u)}return r}}},je={"HTML変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;")}},"クリップボード設定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){if(navigator.clipboard)navigator.clipboard.writeText(e);else{const t=document.createElement("div"),n=document.createElement("pre");n.style.webkitUserSelect="auto",n.style.userSelect="auto",t.appendChild(n).textContent=e,t.style.position="fixed",t.right="200%",document.body.appendChild(t),document.getSelection().selectAllChildren(t),document.execCommand("copy"),document.body.removeChild(t)}},return_none:!0},"クリップボード取得時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!navigator.clipboard)throw new Error("Clipbard APIが利用できません。");"string"==typeof e&&(e=t.__findFunc(e,"クリップボード取得時"));navigator.clipboard.readText().then((n=>{t.__v0["対象"]=n,e(t)}))}}},Se={"保存":{type:"func",josi:[["を"],["に","へ"]],pure:!1,fn:function(e,t,n){n.__exec("ローカルストレージ保存",[e,t,n])},return_none:!0},"開":{type:"func",josi:[["を","から","の"]],pure:!1,fn:function(e,t){return t.__exec("ローカルストレージ読",[e,t])},return_none:!1},"読":{type:"func",josi:[["を","から","の"]],pure:!1,fn:function(e,t){return t.__exec("ローカルストレージ読",[e,t])},return_none:!1},"存在":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return null!==window.localStorage.getItem(e)},return_none:!1},"ローカルストレージ保存":{type:"func",josi:[["を"],["に","へ"]],pure:!0,fn:function(e,t,n){let s=e;n.__v0["保存オプション"]&&n.__v0["保存オプション"].indexOf("json")>=0&&(s=JSON.stringify(s)),window.localStorage[t]=s},return_none:!0},"ローカルストレージ読":{type:"func",josi:[["を","から","の"]],pure:!0,fn:function(e,t){const n=window.localStorage[e];if(t.__v0["保存オプション"]&&t.__v0["保存オプション"].indexOf("json")>=0)try{return JSON.parse(n)}catch(t){console.log("ローカルストレージ『"+e+"』の読み込みに失敗")}return n},return_none:!1},"ローカルストレージキー列挙":{type:"func",josi:[[]],pure:!0,fn:function(e){const t=[];for(const e in window.localStorage)t.push(e);return t},return_none:!1},"ローカルストレージキー削除":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){window.localStorage.removeItem(e)},return_none:!0},"ローカルストレージ全削除":{type:"func",josi:[],pure:!0,fn:function(){window.localStorage.clear()},return_none:!0},"ローカルストレージ有効確認":{type:"func",josi:[],pure:!0,fn:function(){return void 0!==window.localStorage},return_none:!1},"保存オプション":{type:"const",value:"json"},"保存オプション設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){e=e.toUpperCase(e),t.__v0["保存オプション"]=e},return_none:!0}};const xe="描画を行うためには、HTML内にcanvasを配置し、idを振って『描画開始』命令に指定します。";var $e={"描画開始":{type:"func",josi:[["の","へ","で"]],pure:!0,fn:function(e,t){if("string"==typeof e&&(e=document.querySelector(e)||document.getElementById(e)),!e)throw new Error("『描画開始』でCanvasを取得できませんでした。");t.__canvas=e,t.__ctx=e.getContext("2d"),t.__fillStyle="black",t.__strokeStyle="black",t.__v0["描画中キャンバス"]=e,t.__v0["描画中コンテキスト"]=t.__ctx},return_none:!0},"描画中キャンバス":{type:"const",value:null},"描画中コンテキスト":{type:"const",value:null},"キャンバス状態保存":{type:"func",josi:[],pure:!0,fn:function(e){if(!e.__ctx)throw new Error(xe);e.__ctx.save()},return_none:!0},"キャンバス状態復元":{type:"func",josi:[],pure:!0,fn:function(e){if(!e.__ctx)throw new Error(xe);e.__ctx.restore()},return_none:!0},"線色設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);t.__strokeStyle=e,""!=e&&(t.__ctx.strokeStyle=e)},return_none:!0},"塗色設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);t.__fillStyle=e,""!=e&&(t.__ctx.fillStyle=e)},return_none:!0},"線描画":{type:"func",josi:[["から"],["へ","まで"]],pure:!0,fn:function(e,t,n){if(!n.__ctx)throw new Error(xe);n.__ctx.beginPath(),n.__ctx.moveTo(e[0],e[1]),n.__ctx.lineTo(t[0],t[1]),n.__ctx.stroke()},return_none:!0},"線太設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);t.__ctx.lineWidth=e},return_none:!0},"四角描画":{type:"func",josi:[["の","へ","に"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);""==t.__fillStyle&&""==t.__strokeStyle||(t.__ctx.beginPath(),t.__ctx.rect(e[0],e[1],e[2],e[3]),""!=t.__fillStyle&&t.__ctx.fill(),""!=t.__strokeStyle&&t.__ctx.stroke())},return_none:!0},"全描画クリア":{type:"func",josi:[],pure:!0,fn:function(e){if(!e.__ctx)throw new Error(xe);e.__ctx.clearRect(0,0,e.__canvas.width,e.__canvas.height)},return_none:!0},"描画クリア":{type:"func",josi:[["の","へ","に"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);e instanceof Array||(e=[]),0==e.length?e=[0,0,t.__canvas.width,t.__canvas.height]:e.length<=2&&(e.unshift(0),e.unshift(0)),t.__ctx.clearRect(e[0],e[1],e[2],e[3])},return_none:!0},"円描画":{type:"func",josi:[["へ","に"],["の"]],pure:!0,fn:function(e,t,n){if(!n.__ctx)throw new Error(xe);""==n.__fillStyle&&""==n.__strokeStyle||(n.__ctx.beginPath(),n.__ctx.arc(e[0],e[1],t,0,2*Math.PI,!1),""!=n.__fillStyle&&n.__ctx.fill(),""!=n.__strokeStyle&&n.__ctx.stroke())},return_none:!0},"楕円描画":{type:"func",josi:[["へ","に","の"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);if(!e)throw new Error("楕円描画の引数配列が無効です");if(e.length<4)throw new Error("楕円描画の引数配列が不足しています");e.length<7&&(e[4]||(e[4]=0),e[5]||(e[5]=0),e[6]||(e[6]=2*Math.PI),e[7]||(e[7]=!0)),""==t.__fillStyle&&""==t.__strokeStyle||(t.__ctx.beginPath(),t.__ctx.ellipse.apply(t.__ctx,e),""!=t.__fillStyle&&t.__ctx.fill(),""!=t.__strokeStyle&&t.__ctx.stroke())},return_none:!0},"多角形描画":{type:"func",josi:[["で","の","を"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);if(""==t.__fillStyle&&""==t.__strokeStyle)return;t.__ctx.beginPath();const n=e[0];t.__ctx.moveTo(n[0],n[1]);for(let n=1;n<e.length;n++){const s=e[n];t.__ctx.lineTo(s[0],s[1])}t.__ctx.lineTo(n[0],n[1]),""!=t.__fillStyle&&t.__ctx.fill(),""!=t.__strokeStyle&&t.__ctx.stroke()},return_none:!0},"画像読":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=new window.Image;return n.src=e,n}},"画像逐次読":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){if(void 0===t.resolve)throw new Error("『画像逐次読』は『逐次実行』構文で使ってください。");t.resolveCount++;const n=new window.Image;return n.src=e,n.onload=()=>{t.__v0["対象"]=n,t.resolve()},n.onerror=()=>{t.__v0["対象"]="",t.reject()},n}},"画像読時":{type:"func",josi:[["で"],["の","を"]],pure:!0,fn:function(e,t,n){const s=n.__findVar(e,null),r=new window.Image;r.src=t,r.onload=()=>{n.__v0["対象"]=r,s(n)},r.onerror=()=>{n.__v0["対象"]="",s(n)}},return_none:!0},"画像描画":{type:"func",josi:[["の","を"],["へ","に"]],pure:!0,fn:function(e,t,n){if(!n.__ctx)throw new Error(xe);const s=(e,n)=>{if(2===t.length)n.drawImage(e,t[0],t[1]);else if(4===t.length)n.drawImage(e,t[0],t[1],t[2],t[3]);else{if(8!==t.length)throw new Error("『画像描画』の第二引数の配列要素は2,4,8個のいずれかです。");n.drawImage(e,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7])}};if("string"==typeof e){const t=new window.Image;return t.src=e,t.onload=()=>{s(t,n.__ctx)},t}return s(e,n.__ctx),e},return_none:!1},"画像部分描画":{type:"func",josi:[["の"],["を","から"],["へ","に"]],pure:!0,fn:function(e,t,n,s){const r="『画像部分描画』に使える引数は画像と、描画する座標へ2つか、描画する座標とその位置の4つか、使用する座標と使用する位置と描画する座標と大きさの8つだけです。";if(e&&t&&!Array.isArray(t)&&Array.isArray(e)&&("string"==typeof t||"[object HTMLImageElement]"===String(t.__proto__))){let n=e;e=t,t=n}if(!s.__ctx)throw new Error(xe);const o=(e,s)=>{if(n||(t?t.length>=2&&(n=t,t=void 0):s.drawImage(e)),2===n.length)s.drawImage(e,n[0],n[1]);else{if(4!==n.length)throw new Error(r);if(t){if(4!==t.length)throw new Error(r);s.drawImage(e,t[0],t[1],t[2],t[3],n[0],n[1],n[2],n[3])}else s.drawImage(e,n[0],n[1],n[2],n[3])}};if("string"==typeof e){const t=new window.Image;return t.src=e,t.onload=()=>{o(t,s.__ctx)},t}return o(e,s.__ctx),e},return_none:!1},"描画フォント設定":{type:"func",josi:[["を","の","で","に"]],pure:!0,fn:function(e,t){"number"==typeof e?e+="px sans-serif":/^[0-9]+(px|em)$/.test(e)&&(e+=" sans-serif"),t.__ctx.font=e},return_none:!0},"文字描画":{type:"func",josi:[["へ","に"],["の","を"]],pure:!0,fn:function(e,t,n){if(!n.__ctx)throw new Error(xe);n.__ctx.fillText(t,e[0],e[1])},return_none:!0},"文字描画幅取得":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);return t.__ctx.measureText(e)},return_none:!0},"描画起点設定":{type:"func",josi:[["へ","に"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);t.__ctx.translate(e[0],e[1])},return_none:!0},"描画回転":{type:"func",josi:[["だけ","に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);t.__ctx.rotate(e*Math.PI/180)},return_none:!0},"描画拡大":{type:"func",josi:[["だけ","に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);t.__ctx.scale(e[0],e[1])},return_none:!0},"描画変換マトリクス設定":{type:"func",josi:[["だけ","に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);t.__ctx.setTransform(e[0],e[1],e[2],e[3],e[4],e[5],e[6])},return_none:!0},"描画変換マトリクス追加":{type:"func",josi:[["だけ","に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(xe);t.__ctx.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6])},return_none:!0},"描画データURL変換":{type:"func",josi:[],pure:!1,fn:function(e){return e.__v0["描画中キャンバス"].toDataURL("image/png")}},"描画ダウンロードリンク作成":{type:"func",josi:[["へ","に"]],pure:!1,fn:function(e,t){if("string"==typeof e&&(e=document.querySelector(e)),!e)throw new Error("『描画ダウンロードリンク作成』でDOMが見当たりません。");const n=t.__v0["描画中キャンバス"];if(!n)throw new Error("『描画ダウンロード』で描画中キャンバスが設定されていません。");e.href=n.toDataURL("image/png"),e.download="canvas.png"},return_none:!0},"描画ダウンロード":{type:"func",josi:[],pure:!1,fn:function(e){"string"==typeof dom&&(dom=document.querySelector(dom));const t=e.__v0["描画中キャンバス"];if(!t)throw new Error("『描画ダウンロード』で描画中キャンバスが設定されていません。");const n=document.createElement("a");return n.href=t.toDataURL("image/png"),n.download="canvas.png",n.click(),!0}}},Oe={"位置情報取得時":{type:"func",josi:[["の","に","へ"]],pure:!1,fn:function(e,t){let n=e;if("string"==typeof n&&(n=t.__findVar(n)),!("geolocation"in navigator))throw new Error("関数『位置情報取得時』は使えません。");navigator.geolocation.getCurrentPosition((e=>{t.__v0["対象"]=[e.coords.latitude,e.coords.longitude],n(e)}))},return_none:!0},"位置情報監視時":{type:"func",josi:[["の","に","へ"]],pure:!1,fn:function(e,t){let n=e;if("string"==typeof n&&(n=t.__findVar(n)),!("geolocation"in navigator))throw new Error("関数『位置情報監視時』は使えません。");return navigator.geolocation.watchPosition((e=>{t.__v0["対象"]=[e.coords.latitude,e.coords.longitude],n(e)}))},return_none:!1},"位置情報監視停止":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){navigator.geolocation.clearWatch(e)},return_none:!0}},Ae={"話":{type:"func",josi:[["と","を","の"]],pure:!1,fn:function(e,t){let n=t.__v0["話:話者"];n||(n=t.__exec("話者設定",["ja",t]));const s=new SpeechSynthesisUtterance(e);return s.voice=n,n&&(s.lang=n.lang),s.rate=t.__v0["話者速度"],s.pitch=t.__v0["話者声高"],s.volume=t.__v0["話者音量"],window.speechSynthesis.speak(s),console.log("#話す:",e),e}},"話終時":{type:"func",josi:[["で"],["と","を","の"]],pure:!1,fn:function(e,t,n){let s=n.__v0["話:話者"];s||(s=n.__exec("話者設定",["ja",n]));const r=new SpeechSynthesisUtterance(t);return r.voice=s,s&&(r.lang=s.lang),r.rate=n.__v0["話者速度"],r.pitch=n.__v0["話者声高"],r.volume=n.__v0["話者音量"],r.onend=t=>{console.log("#話終時"),n.__v0["対象イベント"]=t,e(n)},window.speechSynthesis.speak(r),console.log("#話す:",t),t}},"話者一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){if(!("SpeechSynthesisUtterance"in window))throw new Error("音声合成APIに対応していません");return window.speechSynthesis.getVoices()}},"話者設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){if(!("SpeechSynthesisUtterance"in window))throw new Error("音声合成APIに対応していません");if("string"==typeof e){const n=window.speechSynthesis.getVoices();for(const s of n)if(s.lang.indexOf(e)>=0||s.name===e){const e=new SpeechSynthesisUtterance;return e.voice=s,e.lang=s.lang,t.__v0["話:話者"]=s,console.log("#話者:",s.name),s}}if("object"==typeof e)return t.__v0["話:話者"]=e,e}},"話者速度":{type:"const",value:1},"話者声高":{type:"const",value:1},"話者音量":{type:"const",value:1},"話者詳細設定":{type:"func",josi:[["で","に","へ"]],pure:!0,fn:function(e,t){const n=(e,n)=>{"速度"===e&&(t.__v0["話者速度"]=n),"声高"!==e&&"ピッチ"!==e||(t.__v0["話者声高"]=n),"音量"===e&&(t.__v0["話者音量"]=n)};for(const t in e){n(t,e[t])}}}},Me={"WS接続完了時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONOPEN"]=e},return_none:!0},"WS受信時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONMESSAGE"]=e},return_none:!0},"WSエラー発生時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONERROR"]=e},return_none:!0},"WS接続":{type:"func",josi:[["に","へ","の"]],pure:!0,fn:function(e,t){const n=new WebSocket(e);return n.onopen=()=>{const e=t.__v0["WS:ONOPEN"];e&&e(t)},n.onerror=e=>{const n=t.__v0["WS:ONERROR"];n&&n(e,t),console.log("WSエラー",e)},n.onmessage=e=>{t.__v0["対象"]=e.data;const n=t.__v0["WS:ONMESSAGE"];n&&n(t)},t.__v0["WS:SOCKET"]=n,n}},"WS送信":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__v0["WS:SOCKET"].send(e)}},"WS切断":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0["WS:SOCKET"].close()}}},Ce={"オーディオ開":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e,t){const n=new Audio;return n.src=e,n},return_none:!1},"オーディオ再生":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ再生する前に、オーディオ開くで音声ファイルを読み込んでください");e.loop=!1,e.play()},return_none:!0},"オーディオループ再生":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ再生する前に、オーディオ開くで音声ファイルを読み込んでください");e.loop=!0,e.play()},return_none:!0},"オーディオ停止":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ停止する前に、オーディオ開くで音声ファイルを読み込んでください");e.pause(),e.currentTime=0,setTimeout((()=>{e.currentTime=0}),10)},return_none:!0},"オーディオ一時停止":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ一時停止する前に、オーディオ開くで音声ファイルを読み込んでください");e.pause()},return_none:!0},"オーディオ音量取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ長取得する前に、オーディオ開くで音声ファイルを読み込んでください");return e.volume}},"オーディオ音量設定":{type:"func",josi:[["を"],["に","へ"]],pure:!0,fn:function(e,t,n){if(!e)throw new Error("オーディオ長取得する前に、オーディオ開くで音声ファイルを読み込んでください");e.volume=t},return_none:!0},"オーディオ長取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ長取得する前に、オーディオ開くで音声ファイルを読み込んでください");return e.duration}},"オーディオ再生位置取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ再生位置取得する前に、オーディオ開くで音声ファイルを読み込んでください");return e.currentTime}},"オーディオ再生位置設定":{type:"func",josi:[["を"],["に","へ"]],pure:!0,fn:function(e,t,n){if(!e)throw new Error("オーディオ停止する前に、オーディオ開くで音声ファイルを読み込んでください");e.currentTime=t},return_none:!0}},Ee=__webpack_require__(3812);const Le={meta:{type:"const",value:{pluginName:"plugin_browser",pluginVersion:"3.2.24",nakoRuntime:["wnako"],nakoVersion:"^3.2.24"}},"初期化":{type:"func",josi:[],pure:!0,fn:function(e){const t="undefined"==typeof document?{body:{}}:document,n="undefined"==typeof window?{location:{href:""}}:window,s="undefined"==typeof navigator?{}:navigator;e.__v0["AJAX:ONERROR"]=e=>{console.log(e)},e.__v0.DOCUMENT=t,e.__v0.WINDOW=n,e.__v0.NAVIGATOR=s,e.__v0["DOM親要素"]=t.body,e.__v0["ブラウザURL"]=n.location.href,e.__tohtml=e=>(""+e).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;"),e.__tohtmlQ=t=>e.__tohtml(t).replace(/\"/g,"&#34;").replace(/\'/g,"&#39;"),e.__dom_events=[],e.__addEvent=(n,s,r,o)=>{if("string"==typeof n&&!(n=t.querySelector(n)))throw new Error("DOMイベントが追加できません。要素が見当たりません。");if("string"==typeof r&&!(r=e.__findVar(r,null)))throw new Error("DOMイベントが追加できません。関数が見当たりません。");const i=t=>(e.__v0["対象"]=t.target,e.__v0["対象イベント"]=t,o&&o(t,e),"非同期モード"===e.__genMode&&(e.newenv=!0),r(t,e));e.__dom_events.push({dom:n,event:s,func:i,rawFunc:r}),n.addEventListener(s,i)},e.__keyHandler=(e,t)=>{t.__v0["押キー"]=e.key},e.__mouseHandler=(e,t)=>{const n=e.target.getBoundingClientRect();t.__v0["マウスX"]=e.clientX-n.left,t.__v0["マウスY"]=e.clientY-n.top},e.__touchHandler=(e,t)=>{const n=e.target.getBoundingClientRect(),s=e.changedTouches;if(s.length<=0)return;const r=[];for(let e=0;e<s.length;e++){const o=s[e],i=o.clientX-n.left,u=o.clientY-n.top;0===e&&(t.__v0["タッチX"]=i,t.__v0["タッチY"]=u),r.push([i,u])}return t.__v0["タッチ配列"]=r,r},e.__removeEvent=(n,s,r)=>{if("string"==typeof n&&!(n=t.querySelector(n)))throw new Error("DOMイベントが削除できません。要素が見当たりません。");if("string"==typeof r&&!(r=e.__findVar(r,null)))throw new Error("DOMイベントが削除できません。関数が見当たりません。");for(let t=0;t<e.__dom_events.length;t++){const o=e.__dom_events[t];if(o.dom===n&&o.event===s&&o.rawFunc===r){o.dom.removeEventListener(o.event,o.func),e.__dom_events.splice(t,1);break}}},e.__requestAnimationFrameLastId=0,e.__removeAllDomEvent=()=>{e.__dom_events.forEach((e=>{console.log(e.event,e.dom,e),e.dom.removeEventListener(e.event,e.func)})),e.__dom_events=[],e.__requestAnimationFrameLastId>0&&(n.cancelAnimationFrame(e.__requestAnimationFrameLastId),e.__requestAnimationFrameLastId=0)}}},"!クリア":{type:"func",josi:[],pure:!1,fn:function(e){e.__chartjs&&e.__chartjs.destroy(),e.__removeAllDomEvent()}}};[_e,ye,me,ge,ve,be,ke,we,je,Se,$e,Oe,Ae,Me,Ce,{"ホットキー登録":{type:"func",josi:[["に","で"],["を"]],pure:!0,fn:function(e,t,n){Ee(e,(function(e,s){e.preventDefault(),n.__v1[t]()}))}},"ホットキー解除":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){Ee.unbind(e)}}},{"グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!0,fn:function(e,t){if(!window.Chart)throw new Error("『グラフ描画』のエラー。Chart.jsを取り込んでください。");if(!t.__canvas)throw new Error("『グラフ描画』のエラー。『描画開始』命令で描画先のCanvasを指定してください。 ");e["タイプ"]&&(e.type=e["タイプ"]),e["データ"]&&(e.data=e["データ"]),e["オプション"]&&(e.options=e["オプション"]),t.__chartjs&&t.__chartjs.destroy();const n=new Chart(t.__canvas,e);return t.__chartjs=n,n}},"グラフオプション":{type:"const",value:{}},"線グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"line",data:e=t.__exec("二次元グラフデータ変形",["line",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"棒グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{indexAxis:"x"}),s={type:"bar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"横棒グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{indexAxis:"y"}),s={type:"bar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"積上棒グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{indexAxis:"x",scales:{x:{stacked:!0},y:{stacked:!0}}}),s={type:"bar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"積上横棒グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{indexAxis:"y",scales:{x:{stacked:!0},y:{stacked:!0}}}),s={type:"bar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"散布図描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{}),s={type:"scatter",data:e=t.__exec("二次元グラフデータ変形",["scatter",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"円グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"pie",data:e=t.__exec("二次元グラフデータ変形",["pie",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"ドーナツグラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"doughnut",data:e=t.__exec("二次元グラフデータ変形",["pie",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"ポーラーグラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"polarArea",data:e=t.__exec("二次元グラフデータ変形",["pie",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"レーダーグラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"radar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"二次元グラフデータ変形":{type:"func",josi:[["の"],["を"]],pure:!1,fn:function(e,t,n){const s=["rgba(255, 99, 132, 0.2)","rgba(54, 162, 235, 0.2)","rgba(255, 206, 86, 0.2)","rgba(75, 192, 192, 0.2)","rgba(153, 102, 255, 0.2)","rgba(255, 159, 64, 0.2)"],r=["rgba(255, 99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)"],o={},i=[],u=[];if(o.labels=[],t instanceof Array){if(t[0]instanceof Array){if("pie"===e){const e={data:[]};o.datasets=[e];for(let n=0;n<t.length;n++)o.labels.push(t[n][0]),e.data.push(t[n][1]),i.push(s[n%6]),u.push(r[n%6]);return e.backgroundColor=i,e.borderColor=u,o}if("string"==typeof t[1][0]){for(let e=1;e<t.length;e++)o.labels.push(t[e][0]),t[e]=t[e].slice(1);t[0]=t[0].slice(1)}else for(let e=1;e<t.length;e++)o.labels.push(e);o.datasets=[];for(let e=0;e<t[0].length;e++){const n={};o.datasets.push(n),n.label=t[0][e],n.backgroundColor=s[e%6],n.borderColor=r[e%6],n.data=[];for(let s=1;s<t.length;s++)n.data.push(t[s][e])}return o}for(let e=0;e<t.length;e++)o.labels.push(e+1),i.push(s[e%6]),u.push(r[e%6]);const n={};return o.datasets=[n],n.label="データ",n.data=t,n.backgroundColor=i,n.borderColor=u,o}return t instanceof Object?t:n.__exec("二次元グラフデータ変形",[[t],n])}}},{"ハッシュ値計算時":{type:"func",josi:[["へ"],["を"],["で"]],pure:!1,fn:function(e,t,n,s){e=s.__findVar(e,null);const r=new TextEncoder("utf-8").encode(t);crypto.subtle.digest(n,r).then((function(t){const n=[],r=new DataView(t);for(let e=0;e<r.byteLength;e+=4){const t="00"+r.getUint32(e).toString(16);n.push(t.substr(t.length-2,2))}const o=s.__v0["対象"]=n.join("");e(o)}))},return_none:!0}}].forEach((e=>{const t={};Object.assign(t,e),void 0!==t["初期化"]&&delete t["初期化"],Object.assign(Le,t)}));var Te=Le;const Fe=/^(なでしこ|nako|nadesiko)3?$/;class Ne extends X{constructor(){super({useBasicPlugin:!0}),this.__varslist[0]["ナデシコ種類"]="wnako3"}runNakoScript(){let e=0;const t=document.querySelectorAll("script");for(let n=0;n<t.length;n++){const s=t[n];s.type.match(Fe)&&(e++,this.run(s.text,`script${n}.nako3`))}console.log("実行したなでしこの個数=",e)}async loadDependencies(e,t,s="",r={}){return this._loadDependencies(e,t,s,{readJs:(e,t)=>r.hasOwnProperty(e)?{sync:!0,value:()=>(Function(r[e])(),{})}:{sync:!1,value:(async()=>{const s=await fetch(e);if(!s.ok)throw new n.l0(`ファイル ${e} のダウンロードに失敗しました: ${s.status} ${s.statusText}`,t.line,t.file);const r=await s.text();if(!r.includes("navigator.nako3.addPluginObject"))throw new n.l0(`ファイル ${e} の中に文字列 "navigator.nako3.addPluginObject" が存在しません。現在、ブラウザ版のなでしこ言語v3は自動登録するプラグインのみをサポートしています。`,t.line,t.file);return()=>{const s=navigator.nako3;navigator.nako3=this;try{Function(r)()}catch(s){throw new n.l0(`プラグイン ${e} の取り込みに失敗: ${s instanceof Error?s.message:s+""}`,t.line,t.file)}finally{navigator.nako3=s}return{}}})()},readNako3:(e,t)=>r.hasOwnProperty(e)?{sync:!0,value:r[e]}:{sync:!1,value:(async()=>{const s=await fetch(e);if(!s.ok)throw new n.l0(`ファイル ${e} のダウンロードに失敗しました: ${s.status} ${s.statusText}`,t.line,t.file);return await s.text()})()},resolvePath:(e,t)=>{let s=e;if(!r.hasOwnProperty(e))try{s=new URL(e).pathname}catch(r){try{const t=window.location.href.split("/"),n=t.splice(0,t.length-1).join("/");s=new URL(n+"/"+e).pathname}catch(e){throw new n.l0(`取り込み文の引数でパスが解決できません。https:// か http:// で始まるアドレスを指定してください。\n${e}`,t.line,t.file)}}return s.endsWith(".js")||s.endsWith(".js.txt")?{filePath:e,type:"js"}:s.endsWith(".nako3")||s.endsWith(".nako3.txt")?{filePath:e,type:"nako3"}:{filePath:e,type:"invalid"}}})}checkScriptTagParam(){const e=document.querySelectorAll("script");for(let t=0;t<e.length;t++){const n=e[t].src||"";if(n.indexOf("wnako3.js?run")>=0||n.indexOf("wnako3.js&run")>=0)return!0}return!1}setupEditor(e){return de(e,this,window.ace)}}if("object"!=typeof navigator||navigator.exportWNako3)module.exports=Ne;else{const e=navigator.nako3=new Ne;e.addPluginObject("PluginBrowser",Te),window.addEventListener("DOMContentLoaded",(t=>{e.checkScriptTagParam()&&e.runNakoScript()}),!1)}}()})();
2
+ (function(){var __webpack_modules__={7950:function(e){"use strict";var t="undefined"!=typeof navigator&&0<navigator.userAgent.toLowerCase().indexOf("firefox");function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function s(e,t){for(var n=t.slice(0,t.length-1),s=0;s<n.length;s++)n[s]=e[n[s].toLowerCase()];return n}function r(e){for(var t=(e=(e="string"!=typeof e?"":e).replace(/\s/g,"")).split(","),n=t.lastIndexOf("");0<=n;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var o={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":t?173:189,"=":t?61:187,";":t?59:186,"'":222,"[":219,"]":221,"\\":220},i={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},u={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},c={16:!1,18:!1,17:!1,91:!1},a={},f=1;f<20;f++)o["f".concat(f)]=111+f;var l=[],h=!1,p="all",d=[],_=function(e){return o[e.toLowerCase()]||i[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function y(e){p=e||"all"}function m(){return p||"all"}var g=function(e){var t=e.scope,n=e.method,o=e.splitKey,u=void 0===o?"+":o;r(e.key).forEach((function(e){var r,o=(e=e.split(u)).length,c="*"===(c=e[o-1])?"*":_(c);a[c]&&(t=t||m(),r=1<o?s(i,e):[],a[c]=a[c].filter((function(e){return!((!n||e.method===n)&&e.scope===t&&function(e,t){for(var n=e.length<t.length?t:e,s=e.length<t.length?e:t,r=!0,o=0;o<n.length;o++)~s.indexOf(n[o])||(r=!1);return r}(e.mods,r))})))}))};function v(e,t,n,s){var r;if(t.element===s&&(t.scope===n||"all"===t.scope)){for(var o in r=0<t.mods.length,c)Object.prototype.hasOwnProperty.call(c,o)&&(!c[o]&&~t.mods.indexOf(+o)||c[o]&&!~t.mods.indexOf(+o))&&(r=!1);(0!==t.mods.length||c[16]||c[18]||c[17]||c[91])&&!r&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function b(e,t){var n=a["*"],s=e.keyCode||e.which||e.charCode;if(k.filter.call(this,e)){if(~l.indexOf(s=93!==s&&224!==s?s:91)||229===s||l.push(s),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=u[t];e[t]&&!~l.indexOf(n)?l.push(n):!e[t]&&~l.indexOf(n)?l.splice(l.indexOf(n),1):"metaKey"!==t||!e[t]||3!==l.length||e.ctrlKey||e.shiftKey||e.altKey||(l=l.slice(l.indexOf(n)))})),s in c){for(var r in c[s]=!0,i)i[r]===s&&(k[r]=!0);if(!n)return}for(var o in c)Object.prototype.hasOwnProperty.call(c,o)&&(c[o]=e[u[o]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(~l.indexOf(17)||l.push(17),~l.indexOf(18)||l.push(18),c[17]=!0,c[18]=!0);var f=m();if(n)for(var h=0;h<n.length;h++)n[h].scope===f&&("keydown"===e.type&&n[h].keydown||"keyup"===e.type&&n[h].keyup)&&v(e,n[h],f,t);if(s in a)for(var p=0;p<a[s].length;p++)if(("keydown"===e.type&&a[s][p].keydown||"keyup"===e.type&&a[s][p].keyup)&&a[s][p].key){for(var d=a[s][p],y=d.key.split(d.splitKey),g=[],b=0;b<y.length;b++)g.push(_(y[b]));g.sort().join("")===l.sort().join("")&&v(e,d,f,t)}}}function k(e,t,o){l=[];var u=r(e),f=[],p="all",y=document,m=0,g=!1,v=!0,w="+";for(void 0===o&&"function"==typeof t&&(o=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(p=t.scope),t.element&&(y=t.element),t.keyup&&(g=t.keyup),void 0!==t.keydown&&(v=t.keydown),"string"==typeof t.splitKey&&(w=t.splitKey)),"string"==typeof t&&(p=t);m<u.length;m++)f=[],1<(e=u[m].split(w)).length&&(f=s(i,e)),(e="*"===(e=e[e.length-1])?"*":_(e))in a||(a[e]=[]),a[e].push({keyup:g,keydown:v,scope:p,mods:f,shortcut:u[m],method:o,key:u[m],splitKey:w,element:y});void 0!==y&&!function(e){return!!~d.indexOf(e)}(y)&&window&&(d.push(y),n(y,"keydown",(function(e){b(e,y)})),h||(h=!0,n(window,"focus",(function(){l=[]}))),n(y,"keyup",(function(e){b(e,y),function(e){var t=e.keyCode||e.which||e.charCode,n=l.indexOf(t);if(n<0||l.splice(n,1),e.key&&"meta"==e.key.toLowerCase()&&l.splice(0,l.length),(t=93!==t&&224!==t?t:91)in c)for(var s in c[t]=!1,i)i[s]===t&&(k[s]=!1)}(e)})))}var w,j,S={setScope:y,getScope:m,deleteScope:function(e,t){var n,s,r;for(r in e=e||m(),a)if(Object.prototype.hasOwnProperty.call(a,r))for(n=a[r],s=0;s<n.length;)n[s].scope===e?n.splice(s,1):s++;m()===e&&y(t||"all")},getPressedKeyCodes:function(){return l.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=_(e)),!!~l.indexOf(e)},filter:function(e){var t=(e=e.target||e.srcElement).tagName;return!(e.isContentEditable||!("INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t||e.readOnly))},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&g(e)}));else if("object"==typeof e)e.key&&g(e);else if("string"==typeof e){for(var t=arguments.length,n=Array(1<t?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];var r=n[0],o=n[1];"function"==typeof r&&(o=r,r=""),g({key:e,scope:r,method:o,splitKey:"+"})}}else Object.keys(a).forEach((function(e){return delete a[e]}))}};for(w in S)Object.prototype.hasOwnProperty.call(S,w)&&(k[w]=S[w]);"undefined"!=typeof window&&(j=window.hotkeys,k.noConflict=function(e){return e&&window.hotkeys===k&&(window.hotkeys=j),k},window.hotkeys=k),e.exports=k},3812:function(e,t,n){e.exports=n(7950)},1701:function(e,t,n){"use strict";n.d(t,{as:function(){return a},cg:function(){return i},ih:function(){return c},k:function(){return r},l0:function(){return f},t5:function(){return o},tO:function(){return u}});var s=n(4908);class r extends Error{constructor(e,t,n,r){const o=`${n||""}${void 0===r?"":`(${r+1}行目): `}`;super(`[${e}]${o}${t}\n[バージョン] ${s.Z.version}`),this.tag="["+e+"]",this.positionJa=o,this.msg=t}}class o extends r{constructor(e,t,n){super("インデントエラー",e,n,t),this.line=t,this.file=n}}class i extends r{constructor(e,t,n,s,r){super("字句解析エラー(内部エラー)",e,r,s),this.preprocessedCodeStartOffset=t,this.preprocessedCodeEndOffset=n,this.line=s,this.file=r}}class u extends r{constructor(e,t,n,s,r){super("字句解析エラー",e,r,s),this.startOffset=t,this.endOffset=n,this.line=s,this.file=r}}class c extends r{static fromNode(e,t,n){if(!t)return new c(e,void 0,null,null,void 0);const s="number"==typeof t.startOffset?t.startOffset:null,r=n&&"number"==typeof n.endOffset?n.endOffset:"number"==typeof t.endOffset?t.endOffset:null;return new c(e,t.line,s,r,t.file)}constructor(e,t,n,s,r){super("文法エラー",e,r,t),this.file=r,this.line=t,this.startOffset=n,this.endOffset=s}}class a extends r{constructor(e,t){const n=e instanceof Error&&e.constructor!==Error&&e.constructor!==a?e.constructor.name+": ":"",s=e instanceof Error?e.message:e+"";let r,o,i;void 0===t?(r=void 0,o=void 0):(i=/^l(-?\d+):(.*)$/.exec(t))?(r=+i[1],o=i[2]):(i=/^l(-?\d+)$/.exec(t))?(r=+i[1],o=void 0):(r=void 0,o=t),super("実行時エラー",`エラー『${n}${s}』が発生しました。`,o,r),this.error=e,this.lineNo=t,this.line=r,this.file=o}}class f extends r{constructor(e,t,n){super("取り込みエラー",e,t,n),this.file=t,this.line=n}}},5430:function(e,t,n){"use strict";n.d(t,{I:function(){return i},J:function(){return o}});var s=n(1701),r=n(4908);class o{constructor(e){this.nako_func={...e.nako_func},this.nako_test={},this.used_func=new Set,this.loop_id=1,this.numAsyncFn=0,this.usedAsyncFn=!1,this.flagLoop=!1,this.__self=e,this.genMode="sync",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0},this.warnUndefinedVar=!0,this.warnUndefinedReturnUserFunc=1,this.warnUndefinedCallingUserFunc=1,this.warnUndefinedCallingSystemFunc=1,this.warnUndefinedCalledUserFuncArgs=1}static isValidIdentifier(e){return/^(?!(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$)[$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}convLineno(e,t){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return 3===this.varslistSet.length?`__varslist[2][${JSON.stringify(e)}]`:o.isValidIdentifier(e)?e:`__vars[${JSON.stringify(e)}]`}static getFuncName(e){let t=e.replace(/[ぁ-ん]+$/,"");return""===t&&(t=e),t}static convPrint(e){return`__print(${e});`}static convRequire(e){const t=e.value;return this.convLineno(e,!1)+`__module['${t}'] = require('${t}');\n`}getVarsCode(){let e="";for(const t of Array.from(this.used_func.values())){const n=this.__self.__varslist[0][t],s=`this.__varslist[0]["${t}"]`;e+="function"==typeof n?s+"="+n.toString()+";\n":s+"="+JSON.stringify(n)+";\n"}return e}getDefFuncCode(e){let t="";t+="const __self = this.__self = this;\n",t+="const __varslist = this.__varslist;\n",t+="const __module = this.__module;\n",t+="const __v0 = this.__v0 = this.__varslist[0];\n",t+="const __v1 = this.__v1 = this.__varslist[1];\n",t+="const __vars = this.__vars = this.__varslist[2];\n";let n="";for(const e in this.nako_func){const t=this.nako_func[e].fn;n+=`//[DEF_FUNC name='${e}' asyncFn=${this.nako_func[e].asyncFn?"true":"false"}]\n__v1["${e}"]=${t};\n;//[/DEF_FUNC name='${e}']\n`}""!==n&&(t+="__v0.line='関数の定義';\n"+n);let s="";for(const e in this.__self.__module){const t=`!${e}:初期化`;this.varslistSet[0].names.has(t)&&(this.used_func.add(`!${e}:初期化`),s+=`__v0["!${e}:初期化"](__self);\n`)}if(""!==s&&(t+="__v0.line='プラグインの初期化';\n"+s),e){let n="const __tests = [];\n";for(const t in this.nako_test)if(!0===e||"string"==typeof e&&e===t){n+=`${this.nako_test[t].fn};\n;`}""!==n&&(t+="__v0.line='テストの定義';\n",t+=n+"\n")}return t}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}setFunc(e,t){this.__self.setFunc(e,t)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=[],n=e=>{for(let s=0;s<e.block.length;s++){const r=e.block[s];if("def_func"===r.type){const e=r.name.value;this.used_func.add(e),this.__self.__varslist[1][e]=function(){},this.varslistSet[1].names.add(e),this.nako_func[e]={josi:r.name.meta.josi,fn:"",type:"func",asyncFn:!1},t.push({name:e,node:r})}else("speed_mode"===r.type||"performance_monitor"===r.type)&&("block"===r.block.type?n(r.block):n(r))}};n(e);const r=new Set;0===this.speedMode.invalidSore&&r.add("それ"),this.varsSet={isFunction:!1,names:r,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet;const o=this.warnUndefinedVar;this.warnUndefinedVar=!1;for(let e of t)this.convDefFuncCommon(e.node,e.name);this.warnUndefinedVar=o}convGen(e,t){const n=this.convLineno(e,!1)+this._convGen(e,!0);return t?"":n}_convGen(e,t){let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"block":for(let t=0;t<e.block.length;t++){const s=e.block[t];n+=this._convGen(s,!1)}break;case"comment":case"eol":n+=this.convComment(e);break;case"break":n+=this.convCheckLoop(e,"break");break;case"continue":n+=this.convCheckLoop(e,"continue");break;case"end":n+="__varslist[0]['終']();";break;case"number":n+=e.value;break;case"string":n+=this.convString(e);break;case"def_local_var":n+=this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.convDefLocalVarlist(e);break;case"let":n+=this.convLet(e);break;case"inc":n+=this.convInc(e);break;case"word":case"variable":n+=this.convGetVar(e);break;case"op":case"calc":n+=this.convOp(e);break;case"renbun":n+=this.convRenbun(e);break;case"not":n+="(("+this._convGen(e.value,!0)+")?0:1)";break;case"func":case"func_pointer":case"calc_func":n+=this.convCallFunc(e,t);break;case"if":n+=this.convIf(e);break;case"tikuji":n+=this.convTikuji(e);break;case"for":n+=this.convFor(e);break;case"foreach":n+=this.convForeach(e);break;case"repeat_times":n+=this.convRepeatTimes(e);break;case"speed_mode":n+=this.convSpeedMode(e,t);break;case"performance_monitor":n+=this.convPerformanceMonitor(e,t);break;case"while":n+=this.convWhile(e);break;case"atohantei":n+=this.convAtohantei(e);break;case"switch":n+=this.convSwitch(e);break;case"let_array":n+=this.convLetArray(e);break;case"配列参照":n+=this.convRefArray(e);break;case"json_array":n+=this.convJsonArray(e);break;case"json_obj":n+=this.convJsonObj(e);break;case"func_obj":n+=this.convFuncObj(e);break;case"bool":n+=e.value?"true":"false";break;case"null":n+="null";break;case"def_test":n+=this.convDefTest(e);break;case"def_func":n+=this.convDefFunc(e);break;case"return":n+=this.convReturn(e);break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=o.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}findVar(e){if(this.varslistSet.length>3&&this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:this.varname(e)};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n)return"引数"===e||"それ"===e||"対象"===e||"対象キー"===e||this.warnUndefinedVar&&this.__self.logger.warn(`変数『${e}』は定義されていません。`,t),this.varsSet.names.add(e),this.varname(e);if(0===n.i){const o=this.__self.funclist[e];if(!o)return`${n.js}/*err:${r}*/`;if("const"===o.type||"var"===o.type)return n.js;if("func"===o.type){if(0===o.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;return this.genVar(t,e)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);const t=this.convLineno(e,!1);let n;if(e.value)n=this._convGen(e.value,!0);else{if(0!==this.speedMode.invalidSore)return t+"return;";n=this.varname("それ")}return 0===this.warnUndefinedReturnUserFunc?t+`return ${n};`:t+`return (function(a){if(a===undefined){__self.logger.warn('ユーザ関数からundefinedが返されています',{file:'${e.file}',line:${e.line}});};return a;})(${n});`}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return this.convLineno(e.line)+t+";"}convDefFuncCommon(e,t){let n="",s="";if(0!==this.performanceMonitor.userFunction){let e=t;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),n=`const performanceMonitorEnd = (function (key, type) {\nconst uf_start = performance.now() * 1000;\nreturn function () {\nconst el_time = performance.now() * 1000 - uf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=el_time;\nif(__self.__performance_monitor[key].min_usec>el_time){__self.__performance_monitor[key].min_usec=el_time;}\nif(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_monitor[key].max_usec=el_time;}\n}};})('${e}', 'user');try {\n`,s="} finally { performanceMonitorEnd(); }\n"}let r="";const i=new Set;0===this.speedMode.invalidSore&&i.add("それ"),this.varsSet={isFunction:!0,names:i,readonly:new Set},this.varslistSet.push(this.varsSet),r+=" var 引数 = arguments;\n",r+=" var __vars = {};\n";const u=Array.from(this.varsSet.names.values());let c="";const a=t?e.name.meta:e.meta;for(let n=0;n<a.varnames.length;n++){const s=a.varnames[n];0===this.warnUndefinedCalledUserFuncArgs?c+=` ${this.varname(s)} = arguments[${n}];\n`:c+=t?` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('ユーザ関数(${t})の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`:` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('匿名関数の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`,this.varsSet.names.add(s)}t&&(this.used_func.add(t),this.varslistSet[1].names.add(t),void 0===this.nako_func[t]&&(this.nako_func[t]={josi:e.name.meta.josi,fn:"",type:"func",asyncFn:!1}));const f=this.usedAsyncFn;this.usedAsyncFn=!1;c+=this._convGen(e.block,!1).split("\n").map((e=>" "+e)).join("\n")+"\n",0===this.speedMode.invalidSore&&(c+=` return (${this.varname("それ")});\n`),c+=s,t&&this.usedAsyncFn&&(this.nako_func[t].asyncFn=!0);let l=!1;for(const e of Array.from(this.varsSet.names.values()))u.includes(e)||(o.isValidIdentifier(e)?r+=` var ${e};\n`:l=!0);o.isValidIdentifier("それ")||0!==this.speedMode.invalidSore||(l=!0),0===this.speedMode.invalidSore&&(o.isValidIdentifier("それ")?r+=" var それ = '';\n":r+=` ${this.varname("それ")} = '';`);return c=(this.usedAsyncFn?"(async function(){\n":"(function(){\n")+n+r+c+"",c+="})",t&&(this.nako_func[t].fn=c,this.nako_func[t].asyncFn=this.usedAsyncFn,a.asyncFn=this.usedAsyncFn),this.usedAsyncFn=f,this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],t&&(this.__self.__varslist[1][t]=c),c}convDefTest(e){const t=e.name.value;let n=`__tests.push({ name: '${t}', f: () => {\n`;return n+=` ${this._convGen(e.block,!1)}\n}});`,this.nako_test[t]={josi:e.name.meta.josi,fn:n,type:"test_func"},""}convDefFunc(e){const t=o.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){return"{"+e.value.map((e=>`${this._convGen(e.key,!0)}:${this._convGen(e.value,!0)}`)).join(",")+"}"}convJsonArray(e){return"["+e.value.map((e=>this._convGen(e,!0))).join(",")+"]"}convRefArray(e){const t=this._convGen(e.name,!0),n=e.index;let s=t;for(let e=0;e<n.length;e++){s+="["+this._convGen(n[e],!0)+"]"}return s}convLetArray(e){const t=this._convGen(e.name,!0),n=e.index;let s="",r=t,o="";if(e.checkInit){const e="[0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0]";s+=`\n/*配列初期化*/if (!(${t} instanceof Array)) { ${t} = ${e}; console.log('初期化:${t}') };`;for(let r=0;r<n.length-1;r++){o+=`[${this._convGen(n[r],!0)}]`,s+=`\n/*配列初期化${r}*/if (!(${t}${o} instanceof Array)) { ${t}${o} = ${e}; };`}s+="\n"}for(let e=0;e<n.length;e++){r+="["+this._convGen(n[e],!0)+"]"}r+=" = "+this._convGen(e.value,!0)+";\n";return this.convLineno(e,!1)+s+r}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.loop_id++,s=`$nako_i${n}`,r=this._convGen(e.from,!0),o=this._convGen(e.to,!0);let i=this._convGen(e.inc,!0);null!=i&&null!=i&&"null"!=i||(i=1);const u=this.convGenLoop(e.block),c=`$nako_from${n}`,a=`$nako_to${n}`;let f="";0===this.speedMode.invalidSore&&(f=`${this.varname("それ")} = `);const l=`\n//[FOR id=${n}]\nconst ${c} = ${r};\nconst ${a} = ${o};\nif (${c} <= ${a}) { // up\n for (let ${s} = ${c}; ${s} <= ${a}; ${s}+= ${i}) {\n ${f}${t} = ${s};\n ${u}\n };\n} else { // down\n for (let ${s} = ${c}; ${s} >= ${a}; ${s}-= ${i}) {\n ${f}${t} = ${s};\n ${u}\n };\n};\n//[/FOR id=${n}]\n`;return this.convLineno(e,!1)+l}convForeach(e){let t;if(null===e.target){if(0!==this.speedMode.invalidSore)throw s.ih.fromNode("『反復』の対象がありません。",e);t=this.varname("それ")}else t=this._convGen(e.target,!0);let n='__v0["対象"]';e.name&&(n=this.varname(e.name.value),this.varsSet.names.add(e.name.value));const r=this.convGenLoop(e.block),o=this.loop_id++;let i="";0===this.speedMode.invalidSore&&(i=`${this.varname("それ")} = `);const u=`let $nako_foreach_v${o}=${t};\nfor (let $nako_i${o} in $nako_foreach_v${o}){\n if ($nako_foreach_v${o}.hasOwnProperty($nako_i${o})) {\n ${n} = ${i}$nako_foreach_v${o}[$nako_i${o}];\n __v0["対象キー"] = $nako_i${o};\n ${r}\n }\n};\n`;return this.convLineno(e,!1)+u}convRepeatTimes(e){const t=this.loop_id++,n=this._convGen(e.value,!0),s=this.convGenLoop(e.block);let r="";0===this.speedMode.invalidSore&&(r=`${this.varname("それ")} = `);const o=`let $nako_times_v${t} = ${n};\nfor(var $nako_i${t} = 1; $nako_i${t} <= $nako_times_v${t}; $nako_i${t}++){\n ${r}__v0["回数"] = $nako_i${t};\n `+s+"\n}\n";return this.convLineno(e,!1)+o}convSpeedMode(e,t){const n={...this.speedMode};e.options["行番号無し"]&&this.speedMode.lineNumbers++,e.options["暗黙の型変換無し"]&&this.speedMode.implicitTypeCasting++,e.options["強制ピュア"]&&this.speedMode.forcePure++,e.options["それ無効"]&&this.speedMode.invalidSore++;try{return this._convGen(e.block,t)}finally{this.speedMode=n}}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++;try{return this._convGen(e.block,t)}finally{this.performanceMonitor=n}}convWhile(e){const t=`while (${this._convGen(e.cond,!0)}){\n ${this.convGenLoop(e.block)}\n}\n`;return this.convLineno(e,!1)+t}convAtohantei(e){const t=`$nako_i${this.loop_id++}`,n=this._convGen(e.cond,!0),s=`for(;;) {\n ${this.convGenLoop(e.block)}\n let ${t} = ${n};\n if (${t}) { continue } else { break }\n}\n\n`;return this.convLineno(e,!1)+s}convSwitch(e){const t=this._convGen(e.value,!0),n=e.cases;let s="";for(let e=0;e<n.length;e++){const t=n[e][0],r=this.convGenLoop(n[e][1]);if("違えば"===t.type)s+=" default:\n";else{s+=` case ${this._convGen(t,!0)}:\n`}s+=` ${r}\n break\n`}const r=`switch (${t}){\n${s}\n}\n`;return this.convLineno(e,!1)+r}convIf(e){const t=this._convGen(e.expr,!0),n=this._convGen(e.block,!1),s=null===e.false_block?"":"else {"+this._convGen(e.false_block,!1)+"};\n";return this.convLineno(e,!1)+`if (${t}) {\n ${n}\n}`+s+";\n"}convTikuji(e){const t=`__tikuji${this.loop_id++}`;let n=`const ${t} = []\n`;for(let s=0;s<e.blocks.length;s++){const r=this._convGen(e.blocks[s],!1).replace(/\s+$/,"")+"\n";n+=`${t}.push(function(resolve, reject) {\n __self.resolve = resolve;\n __self.reject = reject;\n __self.resolveCount = 0;\n ${this.convLineno(e.blocks[s],!0)}\n ${r} if (__self.resolveCount === 0) resolve();\n}); // end of tikuji__\${pid}[{$i}]\n`}n+=`// end of ${t} \n`;let s=` ${t}.splice(0);\n __v0["エラーメッセージ"]=errMsg;\n`;if(null!=e.errorBlock){s+=this._convGen(e.errorBlock,!1).replace(/\s+$/,"")+"\n"}return n+=`const ${t}__reject = function(errMsg){\n${s}};\n`,n+="__self.resolve = undefined;\n",n+=`const ${t}__resolve = function(){\n`,n+=" setTimeout(function(){\n",n+=` if (${t}.length == 0) {return}\n`,n+=` const f = ${t}.shift()\n`,n+=` f(${t}__resolve, ${t}__reject);\n`,n+=" }, 0);\n",n+="};\n",n+=`${t}__resolve()\n`,this.convLineno(e,!1)+n}convFuncGetArgsCalcType(e,t,n){const s=[],r={};for(let e=0;e<n.args.length;e++){const t=n.args[e];0===e&&null===t&&0===this.speedMode.invalidSore?(s.push(this.varname("それ")),r.sore=!0):s.push(this._convGen(t,!0))}return[s,r]}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convCallFunc(e,t){const n=o.getFuncName(e.name),r=this.findVar(n);if(null===r)throw s.ih.fromNode(`関数『${n}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let i;if(0===r.i){if(i=this.__self.funclist[n],"func"!==i.type)throw s.ih.fromNode(`『${n}』は関数ではありません。`,e)}else i=this.nako_func[n],void 0===i&&(i={return_none:!1});if("func_pointer"===e.type)return r.js;const u=this.convFuncGetArgsCalcType(n,i,e),c=u[0],a=u[1];this.used_func.add(n),c.push("__self");let f="function",l="",h="";if(e.setter&&(l+=";__self.isSetter = true;\n",h+=";__self.isSetter = false;\n"),0===r.i&&this.varslistSet.length>3&&!0!==i.pure&&0===this.speedMode.forcePure){const e=[];for(const t of Array.from(this.varsSet.names.values()))o.isValidIdentifier(t)&&e.push({str:JSON.stringify(t),js:this.varname(t)});l+="__self.__locals = __vars;\n";for(const t of e)l+=`__self.__locals[${t.str}] = ${t.js};\n`;for(const t of e)"それ"!==t.js&&(h+=`${t.js} = __self.__locals[${t.str}];\n`)}a.sore&&(l+="/*[sore]*/");const p=(e,t)=>{let n="";for(const s of e.split("\n"))""!==s&&(n+=" ".repeat(t)+s+"\n");return n};let d;0===this.warnUndefinedCallingUserFunc&&0!==r.i||0===this.warnUndefinedCallingSystemFunc&&0===r.i?d=c.join(","):(d="",c.forEach((t=>{"__self"===t?d+=`,${t}`:0===r.i?d+=`,(function(a){if(a===undefined){__self.logger.warn('命令『${n}』の引数にundefinedを渡しています。',{file:'${e.file}',line:${e.line}});};return a;})(${t})`:d+=`,(function(a){if(a===undefined){__self.logger.warn('ユーザ関数『${n}』の引数にundefinedを渡しています。',{file:'${e.file}',line:${e.line}});};return a;})(${t})`})),d=d.substring(1));let _=`${r.js}(${d})`;if(i.asyncFn&&(f=`async ${f}`,_=`await ${_}`,this.numAsyncFn++,this.usedAsyncFn=!0),0===r.i&&0!==this.performanceMonitor.systemFunctionBody){let e=n;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),_=`(${f} (key, type) {\nconst sbf_start = performance.now() * 1000;\ntry {\nreturn `+_+";\n} finally {\nconst sbl_time = performance.now() * 1000 - sbf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sbl_time;\nif(__self.__performance_monitor[key].min_usec>sbl_time){__self.__performance_monitor[key].min_usec=sbl_time;}\nif(__self.__performance_monitor[key].max_usec<sbl_time){__self.__performance_monitor[key].max_usec=sbl_time;}\n"+`}}})('${n}_body', 'sysbody')\n`}let y="";if(i.return_none)y=""===h?""===l?`${_};\n`:`${l} ${_};\n`:`${l}try {\n${p(_,1)};\n} finally {\n${p(h,1)}}\n`;else{let n="";0===this.speedMode.invalidSore&&(n=`${this.varname("それ")} = `),y=""===l&&""===h?`(${n}${_})`:""===h?`(${f}(){\n${p(`${l};\nreturn ${n} ${_}`,1)}}).call(this)`:`(${f}(){\n${p(`${l}try {\n${p(`return ${n}${_};`,1)}\n} finally {\n${p(h,1)}}`,1)}}).call(this)`,("して"===e.josi||""===e.josi&&!t)&&(y+=";\n")}return 0===r.i&&0!==this.performanceMonitor.systemFunction&&(y="(function (key, type) {\nconst sf_start = performance.now() * 1000;\ntry {\nreturn "+y+";\n} finally {\nconst sl_time = performance.now() * 1000 - sf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sl_time;\nif(__self.__performance_monitor[key].min_usec>sl_time){__self.__performance_monitor[key].min_usec=sl_time;}\nif(__self.__performance_monitor[key].max_usec<sl_time){__self.__performance_monitor[key].max_usec=sl_time;}\n"+`}}})('${n}_sys', 'system')\n`),y}convRenbun(e){const t=this._convGen(e.right,!0);return`(function(){${this._convGen(e.left,!1)}; return ${t}}).call(this)`}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"};let n=e.operator,s=this._convGen(e.right,!0),r=this._convGen(e.left,!0);return"+"===n&&0===this.speedMode.implicitTypeCasting&&("number"!==e.left.type&&(r=`parseFloat(${r})`),"number"!==e.right.type&&(s=`parseFloat(${s})`)),"^"===n?`(Math.pow(${r}, ${s}))`:"÷÷"===n?`(Math.floor(${r} / ${s}))`:(t[n]&&(n=t[n]),`(${r} ${n} ${s})`)}convInc(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("加算する先の変数名がありません。",e);const n=e.name.value;let r=this.findVar(n),o="";null===r&&(this.varsSet.names.add(n),r=this.findVar(n));const i=r.js;return o+=`if (typeof(${i}) === 'undefined') { ${i} = 0; }`,o+=`${i} += ${t}`,";"+this.convLineno(e,!1)+o+"\n"}convLet(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("代入する先の変数名がありません。",e);const n=e.name.value,r=this.findVar(n);let o="";if(null===r)this.varsSet.names.add(n),o=`${this.varname(n)}=${t};`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);o=`${r.js}=${t};`}return";"+this.convLineno(e,!1)+o+"\n"}convDefLocalVar(e){const t=null===e.value?"null":this._convGen(e.value,!0),n=e.name.value,r=e.vartype;if(this.varsSet.names.has(n))throw s.ih.fromNode(`${r}『${n}』の二重定義はできません。`,e);this.varsSet.names.add(n),"定数"===r&&this.varsSet.readonly.add(n);const o=`${this.varname(n)}=${t};\n`;return this.convLineno(e,!1)+o}convDefLocalVarlist(e){let t="";const n=e.vartype,s=null===e.value?"null":this._convGen(e.value,!0);this.loop_id++;const r=`$nako_i${this.loop_id}`;t+=`${r}=${s}\n`,t+=`if (!(${r} instanceof Array)) { ${r}=[${r}] }\n`;for(const s in e.names){const o=e.names[s].value;this.varsSet.names.has(o),this.varsSet.names.add(o),"定数"===n&&this.varsSet.readonly.add(o);t+=`${this.varname(o)}=${r}[${s}];\n`}return this.convLineno(e,!1)+t}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n){const n=(t,n)=>'"+'+this.genVar(n,e)+'+"';t=t.replace(/\{(.+?)\}/g,n),t=t.replace(/{(.+?)}/g,n)}return'"'+t+'"'}convTryExcept(e){const t=this._convGen(e.block,!1),n=this._convGen(e.errBlock,!1);return this.convLineno(e,!1)+`try {\n${t}\n} catch (e) {\n __v0["エラーメッセージ"] = e.message;\n;\n`+`${n}}\n`}}function i(e,t,n){const i=new o(e);i.registerFunction(t);let u=i.convGen(t,!!n);if(u=i.getDefFuncCode(n)+u,u&&n&&(u+="\n__self._runTests(__tests);\n"),i.numAsyncFn>0){!("object"==typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>=0)&&(u=`\n// <nadesiko3::gen::async>\n(async () => { // async::main\n${u}\n}).call(this).catch(err => {\nif (!(err instanceof this.NakoRuntimeError)) {\n err = new this.NakoRuntimeError(err, this.__varslist[0].line);\n}\nthis.logger.error(err);\nthrow err;\n}); // async::main\n// <nadesiko3::gen::async>\n`)}e.logger.trace("--- generate ---\n"+u);return{runtimeEnv:u,standalone:`// <standaloneCode>\nconst path = require('path')\nconst nakoVersion = ${JSON.stringify(r.Z)};\n${s.k.toString()}\n${s.as.toString()}\nfunction __nako3safunc() {\nthis.logger = {\n error: (message) => { console.error(message) },\n send: (level, message) => { console.log(message) },\n};\nthis.__varslist = [{}, {}, {}];\nthis.__vars = this.__varslist[2];\nthis.__module = {};\nthis.__locals = {};\nthis.__genMode = 'sync';\ntry {\n${i.getVarsCode()}\n${u}\n} catch (err) {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, __varslist[0].line);\n }\n this.logger.error(err);\n throw err;\n}\n//\n} // end of __nako3safunc function\n__nako3safunc();\n// </standaloneCode>\n`,gen:i}}},2015:function(e,t,n){"use strict";n.d(t,{g:function(){return g}});var s=n(1701),r=n(4908),o=n(5430);const i="NOP",u="LBL",c="EOL",a="JMP",f="JMP_T",l="JMP_F",h="CALL",p="CALL_OBJ",d="RET",_="TRY",y="CODE";class m{constructor(e,t){this.type=e,this.value=t,this.no=-1,this.tag=0}}class g{static generate(e,t,n){const o=new g(e);o.registerFunction(t);let i=o.convGen(t,!!n);return i=o.getDefFuncCode(n)+i,e.logger.trace("--- generate(非同期モード) ---\n"+i),i&&n&&(i+="\n__self._runTests(__tests);\n"),{runtimeEnv:i,standalone:`const nakoVersion = ${JSON.stringify(r.Z)};\n${s.k.toString()}\n${s.as.toString()}\nthis.logger = {\n error(message) { console.error(message) },\n send(level, message) { console.log(message) },\n};\nthis.__varslist = [{}, {}, {}];\nthis.__vars = this.__varslist[2];\nthis.__module = {};\nthis.__locals = {};\nthis.__labels = {};\nthis.__code = [];\nthis.__callstack = [];\nthis.__stack = [];\nthis.__genMode = '非同期モード';\ntry {\n ${o.getVarsCode()}\n ${i}\n} catch (err) {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, this.__varslist[0].line);\n }\n this.logger.error(err);\n throw err;\n}`,gen:o}}constructor(e){this.nako_func={...e.nako_func},this.nako_test={},this.used_func=new Set,this.loopId=1,this.flagLoop=!1,this.codeId=0,this.codeArray=[],this.labelContinue=null,this.labelBreak=null,this.labels={},this.__self=e,this.genMode="非同期モード",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0}}convLineno(e,t){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return`sys.__vars[${JSON.stringify(e)}]`}getVarsCode(){let e="";for(const t of Array.from(this.used_func.values())){const n=this.__self.__varslist[0][t],s=`this.__varslist[0]["${t}"]`;e+="function"==typeof n?s+"="+n.toString()+";\n":s+"="+JSON.stringify(n)+";\n"}return e}getDefFuncCode(e){let t="";t+="const __self = this.__self = this;\n",t+="const __varslist = this.__varslist;\n",t+="const __module = this.__module;\n",t+="const __v0 = this.__v0 = this.__varslist[0];\n",t+="const __v1 = this.__v1 = this.__varslist[1];\n",t+="const __vars = this.__vars = this.__varslist[2];\n",t+="const __code = this.__code;\n";let n="";for(const e in this.nako_func){n+=`//[DEF_FUNC name='${e}']\n__v1["${e}"]=${this.nako_func[e].fn};\n;//[/DEF_FUNC name='${e}']\n`}""!==n&&(t+="__v0.line='関数の定義';\n"+n);let s="";for(const e in this.__self.__module){const t=`!${e}:初期化`;this.varslistSet[0].names.has(t)&&(this.used_func.add(`!${e}:初期化`),s+=`__v0["!${e}:初期化"](__self);\n`)}if(""!==s&&(t+="__v0.line='プラグインの初期化';\n"+s),e){let n="const __tests = [];\n";for(const t in this.nako_test)if(!0===e||"string"==typeof e&&e===t){n+=`${this.nako_test[t].fn};\n;`}""!==n&&(t+="__v0.line='テストの定義';\n",t+=n+"\n")}return t}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}setFunc(e,t){this.__self.setFunc(e,t)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=e=>{for(let n=0;n<e.block.length;n++){const s=e.block[n];if("def_func"===s.type){const e=s.name.value;this.used_func.add(e),this.__self.__varslist[1][e]=function(){},this.nako_func[e]={josi:s.name.meta.josi,fn:"",type:"func"}}else("speed_mode"===s.type||"performance_monitor"===s.type)&&("block"===s.block.type?t(s.block):t(s))}};t(e);const n=new Set;0===this.speedMode.invalidSore&&n.add("それ"),this.varsSet={isFunction:!1,names:n,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){this._convGen(e,!0);const n=new Set([a,f,l,h,_]);let s=this.codeArray;{s=s.filter((e=>e.type!==i));const e=new Set;s.forEach(((t,s,r)=>{n.has(t.type)&&e.add(t.value)})),s=s.filter(((t,n)=>t.type!==u||(15===t.tag||e.has(t.value))));let t=0;for(;t<s.length-1;)s[t].type!==c||s[t+1].type!==c?t++:s.splice(t+1,1);this.codeArray=s}s.forEach(((e,t)=>{e.type===u&&(this.labels[e.value]=t)})),s.forEach((e=>{n.has(e.type)&&e.no<0&&(e.no=this.labels[e.value])}));let r="";return s.forEach(((e,t)=>{switch(e.type){case i:r+=`case ${t}: break; // [NOP] ${e.value}\n`;break;case u:r+=`case ${t}: break; // [LABEL] ${e.value}\n`;break;case c:r+=`case ${t}: ${e.value}; break; // [EOL]\n`;break;case a:r+=`case ${t}: sys.nextIndex = ${e.no}; break; // ${e.value}\n`;break;case f:r+=`case ${t}: if (sys.__stack.pop()) { sys.nextIndex = ${e.no};} break; // ${e.value}\n`;break;case l:r+=`case ${t}: if (!sys.__stack.pop()) { sys.nextIndex = ${e.no}} break; // ${e.value}\n`;break;case d:r+=`case ${t}: sys.__return(sys); break;\n`;break;case h:r+=`case ${t}: sys.__call(${e.no}, sys); break; // ${e.value}\n`;break;case p:r+=`case ${t}: sys.__callObj('${e.value}', ${t}, sys); break; // ${e.value}\n`;break;case _:r+=`case ${t}: sys.tryIndex = ${e.no}; break; // TRY \n`;break;case y:{const n=e.value.replace(/\s+$/,"");r+=`case ${t}: {\n${n}\n};break;\n`;break}default:throw new Error("invalid code type")}})),r=`\n //-------------------------\n // main_code\n this.__labels = ${JSON.stringify(this.labels)};\n this.nextAsync = (sys) => {\n if (sys.index >= sys.codeSize || sys.index < 0) {return}\n const __v0 = sys.__v0\n try {\n sys.inLoop = true\n while (sys.index < sys.codeSize && sys.index >= 0) {\n // console.log('@@[run]', sys.index)\n switch (sys.index) {\n // --- CODE.BEGIN ---\n ${r}\n // --- CODE.END ---\n default:\n sys.inLoop = false\n console.log(sys.index, sys.__stack)\n throw new Error('Invalid sys.index:' + sys.index)\n break\n }\n // check next\n if (sys.nextIndex >= 0) {\n sys.index = sys.nextIndex\n sys.nextIndex = -1\n } else {\n sys.index++\n }\n if (sys.async) {\n sys.__saveSysenv(sys)\n sys.async = false\n break\n }\n } // end of while\n sys.inLoop = false\n } catch (e) {\n sys.__errorAsync(e, sys)\n }\n }\n this.__errorAsync = (e, sys) => { // エラーが起きた時呼び出す\n sys.__v0["エラーメッセージ"] = e.message;\n if (e.message == '__終わる__') {\n sys.__stopAsync(sys)\n return\n }\n if (sys.tryIndex >= 0) {\n sys.index = sys.tryIndex;\n setTimeout(() => {sys.nextAsync(sys)}, 1)\n } else {\n throw e\n }\n }\n this.__call = (no, sys) => {\n const info = {lastVars:sys.__vars, backNo: this.index + 1}\n sys.__callstack.push(info);\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.nextIndex = no;\n }\n this.__return = sys => {\n if (sys.__callstack.length === 0) {\n sys.__destroySysenv(sys, sys.curSysenv.envid)\n sys.index = -2\n sys.nextIndex = -1\n return\n }\n const sore = sys.__vars['それ'];\n sys.__varslist.pop();\n const info = sys.__callstack.pop();\n sys.nextIndex = info.backNo;\n sys.__vars = info.lastVars;\n sys.__vars['それ'] = sore\n sys.__stack.push(sore);\n }\n this.__resetAsync = sys => {\n sys.index = 0\n sys.codeSize = ${s.length};\n sys.async = false\n sys.nextIndex = -1\n sys.tryIndex = -1\n }\n this.__stopAsync = sys => {\n sys.__resetAsync(sys)\n sys.index = -1 // force stop!!\n }\n this.__callNakoCode = (no, backNo, sys) => {\n this.__call(backNo, sys)\n sys.nextIndex = no\n const sysenv = sys.setAsync(sys)\n setTimeout(() => {\n // console.log('//__callNakoCode, back=', backNo, 'no=', no)\n sys.compAsync(sys, sysenv)\n } ,1)\n }\n this.__callNakoCodeEntry = (no, sys) => {\n sys.__saveSysenv(sys)\n sys.curSysenv = sys.__generateSysenv(sys)\n sys.__restoreSysenv(sys)\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.index = no;\n sys.nextAsync(sys)\n }\n this.__callObj = (vname, curNo, sys) => {\n if (sys.__vars[vname]) {\n const fname = sys.__vars[vname]\n // console.log(sys.__labels)\n if (fname && sys.__labels[fname]) {\n const no = sys.__labels[fname]\n sys.__call(no, sys)\n return\n } else {\n console.log('vname=', vname, 'label=', fname)\n }\n }\n throw new Error('async error in __callObj::', vname)\n }\n this.__generateSysenv = sys => {\n sys.envid = ( sys.envid == null ? 0 : sys.envid ) + 1\n const sysenv = {\n callstack: [],\n varstack: [],\n varslist: [sys.__varslist[0], sys.__varslist[1], sys.__varslist[2]],\n index: -1,\n nextIndex: -1,\n tryIndex: -1,\n envid: sys.envid\n }\n sysenv.vars = sysenv.varslist[2]\n if (sys.sysenvs == null) { sys.sysenvs={} }\n sys.sysenvs[sys.envid] = sysenv\n // console.log('generete envid '+sys.envid)\n return sysenv\n }\n this.__destroySysenv = (sys, envid) => {\n delete sys.sysenvs[envid]\n // console.log('destroy envid '+envid)\n }\n this.__saveSysenv = sys => {\n const sysenv = sys.curSysenv\n sysenv.callstack = sys.__callstack\n sysenv.varstack = sys.__stack\n sysenv.varslist = sys.__varslist\n sysenv.vars = sys.__vars\n sysenv.index = sys.index\n sysenv.nextIndex = sys.nextIndex\n sysenv.tryIndex = sys.tryIndex\n }\n this.__restoreSysenv = sys => {\n const sysenv = sys.curSysenv\n sys.__callstack = sysenv.callstack\n sys.__stack = sysenv.varstack\n sys.__varslist = sysenv.varslist\n sys.__vars = sysenv.vars\n ___vars = sys.__vars\n sys.index = sysenv.index\n sys.nextIndex = sysenv.nextIndex\n sys.tryIndex = sysenv.tryIndex\n }\n this.setAsync = sys => {\n sys.async = true\n return sys.curSysenv\n }\n this.compAsync = (sys,sysenv) => {\n if (sys.async && sys.curSysenv != null && sysenv != null && sys.curSysenv.envid === sysenv.envid) {\n sys.async = false\n } else {\n if (sys.curSysenv == null || sysenv == null || sys.curSysenv.envid !== sysenv.envid) {\n sys.__saveSysenv(sys)\n const envid = sys.curSysenv.envid\n sys.curSysenv = sysenv\n sys.__restoreSysenv(sys)\n // console.log('switch envid '+envid+' to '+sys.curSysenv.envid)\n }\n sys.nextAsync(sys)\n }\n }\n\n this.__resetAsync(this)\n this.curSysenv = this.__generateSysenv(this)\n this.nextAsync(this)\n //-------------------------\n `,t?"":r}_convGen(e,t){let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"comment":e.value||(e.value=""),this.addCode(new m(i,e.value));break;case"eol":this.addCode(new m(c,this.convLineno(e,!0)));break;case"number":this.addCodeStr(`sys.__stack.push(${e.value});//number`);break;case"string":this.convString(e);break;case"word":case"variable":this.convGetVar(e);break;case"op":case"calc":this.convOp(e);break;case"renbun":this.convRenbun(e);break;case"not":this._convGen(e.value,!0),this.addCodeStr("if (sys.__stack.length==0) throw new Error('NOTでスタックに値がありません');sys.__stack[sys.__stack.length-1] = (sys.__stack[sys.__stack.length-1]) ? 0:1");break;case"配列参照":this.convRefArray(e);break;case"json_array":this.convJsonArray(e);break;case"json_obj":this.convJsonObj(e);break;case"bool":{const t=e.value?"true":"false";this.addCodeStr(`sys.__stack.push(${t})`);break}case"null":this.addCodeStr("sys.__stack.push(null)");break;case"func":case"func_pointer":case"calc_func":this.convFunc(e,t);break;case"let":this.convLet(e);break;case"let_array":this.convLetArray(e);break;case"block":for(let t=0;t<e.block.length;t++){const n=e.block[t];this._convGen(n,!1)}break;case"if":this.convIf(e);break;case"repeat_times":this.convRepeatTimes(e);break;case"break":this.addCodeStr(this.convCheckLoop(e,"break"));break;case"continue":this.addCodeStr(this.convCheckLoop(e,"continue"));break;case"for":this.convFor(e);break;case"foreach":this.convForeach(e);break;case"while":this.convWhile(e);break;case"switch":this.convSwitch(e);break;case"return":this.convReturn(e);break;case"end":n+=this.addCodeStr("__varslist[0]['終']();");break;case"def_local_var":this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.addCodeStr(this.convDefLocalVarlist(e));break;case"tikuji":throw s.ih.fromNode("「逐次実行」構文は「!非同期モード」では使えません。",e);case"speed_mode":throw s.ih.fromNode("「速度有線」構文は「!非同期モード」では使えません。",e);case"performance_monitor":this.convPerformanceMonitor(e,t);break;case"func_obj":this.convFuncObj(e);break;case"def_test":this.convDefTest(e);break;case"def_func":n+=this.addCodeStr(this.convDefFunc(e));break;case"try_except":n+=this.convTryExcept(e);break;case"require":this.addCodeStr(o.J.convRequire(e));break;default:throw new Error("System Error: unknown_type="+e.type)}return n}addCodeStr(e){if(""===e)return"";const t=e.split("\n").map((e=>" "+e.replace(/\s+$/,""))),n=new m(y,t.join("\n"));return this.addCode(n)}addCode(e){return this.codeArray[this.codeId]=e,this.codeId++,""}makeLabel(e){const t=e+"_"+this.loopId++;return this.makeLabelDirectly(t)}makeLabelDirectly(e){const t=new m(u,e);return this.labels[e]=-1,t}makeJump(e){return new m(a,e.value)}makeJumpIfTrue(e){return new m(f,e.value)}makeJumpIfFalse(e){return new m(l,e.value)}convIf(e){const t=this.makeLabel("もし:ここから"),n=this.makeLabel("もし:ここまで"),s=this.makeLabel("もし:違えば");return this.addCode(t),this._convGen(e.expr,!0),this.addCode(this.makeJumpIfFalse(s)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(s),e.false_block&&this._convGen(e.false_block,!1),this.addCode(n),""}convRepeatTimes(e){this.flagLoop=!0,this.varsSet.names.add("回数"),this.varsSet.readonly.add("回数");const t=`sys.__tmp_i${this.loopId}`;this.loopId++;const n=`sys.__tmp_count${this.loopId}`;this.loopId++,this._convGen(e.value,!0),this.addCodeStr(`${n} = sys.__stack.pop(); ${t} = 0;`);const s=this.makeLabel("回:条件チェック");this.addCode(s);const r=this.makeLabel("回:ここまで");this.labelBreak=r,this.labelContinue=s;const o=`sys.__vars["回数"] = ++${t}\nsys.__stack.push(${t} > ${n})\n`;return this.addCodeStr(o),this.addCode(this.makeJumpIfTrue(r)),this.convGenLoop(e.block),this.addCode(this.makeJump(s)),this.addCode(r),this.flagLoop=!1,""}findVar(e){if(this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:`sys.__vars[${JSON.stringify(e)}]`};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`sys.__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n)return"引数"===e||"それ"===e||"対象"===e||"対象キー"===e||"回数"===e||this.__self.logger.warn(`変数『${e}』は定義されていません。`,t),this.varsSet.names.add(e),this.varname(e);if(0===n.i){const o=this.__self.funclist[e];if(!o)return`${n.js}/*err:${r}*/`;if("const"===o.type||"var"===o.type)return n.js;if("func"===o.type){if(0===o.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;let n=`sys.__vars[${JSON.stringify(t)}]`;const s=this.findVar(t);null!=s&&(n=s.js),this.addCodeStr(`sys.__stack.push(${n});`)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);return e.value&&(this._convGen(e.value,!0),this.addCodeStr('sys.__vars["それ"] = sys.__stack.pop()')),this.addCode(new m(d,"")),""}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return"continue"===t?this.labelContinue&&this.addCode(this.makeJump(this.labelContinue)):this.labelBreak&&this.addCode(this.makeJump(this.labelBreak)),""}convDefFuncCommon(e,t){const n=""===t;let s=t;n&&(s="無名関数:"+this.loopId++);const r=this.makeLabel(`関数「${s}」:ここまで`);this.addCode(this.makeJump(r));const o=this.makeLabelDirectly(s);o.tag=15,this.addCode(o);const i=new Set;this.varsSet={isFunction:!0,names:i,readonly:new Set},this.varsSet.names.add("それ"),this.varslistSet.push(this.varsSet);const u=n?e.meta:e.name.meta;let c="",a="";c+=`//関数『${s}』の初期化処理\n`,c+="// 引数をローカル変数として登録\n";for(let e=u.varnames.length-1;e>=0;e--){const t=u.varnames[e];c+=` ${this.varname(t)} = sys.__stack.pop();\n`,this.varsSet.names.add(t),a+=""}return c+="// ここまで:引数をローカル変数として登録\n",this.addCodeStr(c),this.used_func.add(s),this.varslistSet[1].names.add(s),this.nako_func[s]={josi:u.josi,fn:`(function(){\n const sys = (arguments.length > 0) ? arguments[arguments.length-1] : {}; \n if (sys.newenv) { \n sys.newenv = false\n sys.__callNakoCodeEntry(sys.__labels['${s}'], sys);\n } else {\n `+a+"\n"+` sys.__callNakoCode(sys.__labels['${s}'], sys.nextIndex, sys);\n if (!sys.inLoop) { sys.nextAsync(sys) }\n } })`,type:"func"},this._convGen(e.block,!1),this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],this.__self.__varslist[1][s]=function(){},this.addCode(new m(d,"")),this.addCode(r),t||this.addCodeStr(`sys.__stack.push('${s}')`),""}convDefTest(e){throw s.ih.fromNode("テスト構文は!非同期モードでは使えません。",e)}convDefFunc(e){const t=o.J.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){const t=e.value,n="sys.__tmp_obj"+this.loopId++;return this.addCodeStr(n+"={}; // convJsonObj::ここから"),t.forEach((e=>{this._convGen(e.value,!0),this._convGen(e.key,!0),this.addCodeStr(`${n}[sys.__stack.pop()]=sys.__stack.pop()`)})),this.addCodeStr(`this.__stack.push(${n}); delete $objName; // convJsonObj::ここまで`),""}convJsonArray(e){const t=e.value;this.addCode(this.makeLabel("convJsonArray::ここから")),t.forEach((e=>this._convGen(e,!0)));const n=t.length;return this.addCodeStr(`sys.__stack.push(sys.__stack.splice(sys.__stack.length-${n},${n}))`),""}convRefArray(e){this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++)this._convGen(t[e],!0),this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);");return""}convLetArray(e){this._convGen(e.value,!0),this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++){if(this._convGen(t[e],!0),e===t.length-1){this.addCodeStr("const idx = this.__stack.pop();const obj = this.__stack.pop();const val = this.__stack.pop();obj[idx]=val;");break}this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);")}return""}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(this.flagLoop=!0,null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.varname("それ"),s=this.loopId++,r=`sys.__tmp__i${s}`,o=`sys.__tmp__to${s}`;this._convGen(e.from,!0),this._convGen(e.to,!0),this.addCodeStr(`${o}=sys.__stack.pop();${r}=sys.__stack.pop();`),this.addCodeStr(`${n} = ${t} = ${r}`);const i=this.makeLabel("繰返:条件確認"),u=this.makeLabel("繰返:加算");this.addCode(i);const c=this.makeLabel("繰返:ここまで");return this.addCodeStr(`sys.__stack.push(${t} <= ${o})`),this.addCode(this.makeJumpIfFalse(c)),this.labelContinue=u,this.labelBreak=c,this.convGenLoop(e.block),this.addCode(u),this.addCodeStr(`${n} = ++${t};`),this.addCode(this.makeJump(i)),this.addCode(c),this.addCodeStr(`delete ${r};delete ${o};//繰返:掃除`),this.flagLoop=!1,""}convForeach(e){this.flagLoop=!0;let t='__v0["対象"]';e.name&&(t=this.varname(e.name.value),this.varsSet.names.add(e.name.value));if(null===e.target)throw s.ih.fromNode("『反復』の対象がありません。",e);const n=this.varname("それ"),r="sys.__tmp__target"+this.loopId++,o="sys.__tmp__keys"+this.loopId++,i="sys.__tmp__i"+this.loopId++,u="sys.__tmp__count"+this.loopId++;this._convGen(e.target,!0);const c=`// 反復: 初期化\n${r} = sys.__stack.pop();\n${i} = 0;\nif (typeof(${r}) == 'string' || typeof(${r}) == 'number') { ${r} = [${r}]; }\nif (${r} instanceof Array) { ${u} = ${r}.length; }\nelse { // キーの一覧を得る\n ${o} = Object.keys(${r}); \n // hasOwnPropertyがfalseならばkeyを消す処理\n ${o} = ${o}.filter((key)=>{ return ${r}.hasOwnProperty(key) })\n ${u} = ${o}.length;\n}\n`;this.addCodeStr(c);const a=this.makeLabel("反復:条件確認"),f=this.makeLabel("反復:加算"),l=this.makeLabel("反復:ここまで");this.labelBreak=l,this.labelContinue=f,this.addCode(a);const h=`if (${r} instanceof Array) {\n ${t} = ${n} = ${r}[${i}]; __v0["対象キー"] = ${i};\n} else {\n __v0["対象キー"] = ${o}[${i}]; ${t} = ${n} = ${r}[__v0["対象キー"]];\n}\n`;return this.addCodeStr(`${h}\nsys.__stack.push(${i} < ${u});`),this.addCode(this.makeJumpIfFalse(l)),this.convGenLoop(e.block),this.addCode(f),this.addCodeStr(`${i}++`),this.addCode(this.makeJump(a)),this.addCode(l),this.flagLoop=!1,""}convWhile(e){this.flagLoop=!0;const t=this.makeLabel("間:ここから"),n=this.makeLabel("間:ここまで");return this.labelContinue=t,this.labelBreak=n,this.addCode(t),this._convGen(e.cond,!0),this.addCode(this.makeJumpIfFalse(n)),this.convGenLoop(e.block),this.addCode(this.makeJump(t)),this.addCode(n),this.flagLoop=!1,""}convSpeedMode(e,t){return""}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++,this._convGen(e.block,t),this.performanceMonitor=n}convSwitch(e){this._convGen(e.value,!0);const t="sys.__tmp__i"+this.loopId++;this.addCodeStr(`${t} = sys.__stack.pop()`);const n=this.makeLabel("条件分岐:ここまで"),s=e.cases;for(let e=0;e<s.length;e++){const r=s[e][0];if("違えば"===r.type)this.convGenLoop(s[e][1]);else{const o=this.makeLabel("条件分岐:次");this._convGen(r,!0),this.addCodeStr(`sys.__stack.push(sys.__stack.pop() == ${t})`),this.addCode(this.makeJumpIfFalse(o)),this.convGenLoop(s[e][1]),this.addCode(this.makeJump(n)),this.addCode(o)}}return this.addCode(n),this.addCodeStr(`delete ${t}//条件分岐:掃除`),""}convFuncGetArgsCalcType(e,t,n){const s={};for(let e=0;e<n.args.length;e++){const t=n.args[e];0===e&&null===t?(this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"),s.sore=!0):this._convGen(t,!0)}return s}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convFunc(e,t){let n=!1,r=!1;const i=o.J.getFuncName(e.name),u=this.findVar(i);if(null===u)throw s.ih.fromNode(`関数『${i}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let c;if(0===u.i){if(c=this.__self.funclist[i],"func"!==c.type)throw s.ih.fromNode(`『${i}』は関数ではありません。`,e);n=!0}else c=this.nako_func[i],void 0===c&&(r=!0,c={return_none:!1});if("func_pointer"===e.type)return u.js;const a=this.convFuncGetArgsCalcType(i,c,e);this.used_func.add(i);let f="",l="";e.setter&&(f+=";__self.isSetter = true;\n",l+=";__self.isSetter = false;\n"),a.sore&&(f+="/*[sore]*/");const d=e.args.length;let _="";n?(_+=f,_+=`const args = sys.__stack.splice(sys.__stack.length - ${d}, ${d});\n`,_+="args.push(sys);\n",_+=`const ret = ${u.js}.apply(sys, args);\n`,c.return_none||(_+="sys.__vars['それ'] = ret;\n",t&&(_+="sys.__stack.push(ret);\n")),_+=l,this.addCodeStr(_)):(r?this.addCode(new m(p,i)):this.addCode(new m(h,i)),t||this.addCodeStr("sys.__stack.pop();// 戻り値を利用しない関数呼出"))}convRenbun(e){this._convGen(e.left,!1),this._convGen(e.right,!0)}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"},n=e.operator;this._convGen(e.left,!0),this._convGen(e.right,!0);let s="const rv = sys.__stack.pop();\nconst lv = sys.__stack.pop();\n";if("^"===n)s+="const v = (Math.pow(lv, rv))\n";else{s+=`const v = ((lv) ${t[n]||n} (rv));\n`}s+=`sys.__stack.push(v); //op:${n}\n`,this.addCodeStr(s)}convLet(e){let t="";null===e.value?this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"):this._convGen(e.value,!0);const n=e.name.value,r=this.findVar(n);if(null===r)this.varsSet.names.add(n),t=`${this.varname(n)}=sys.__stack.pop();`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);t=`${r.js}=sys.__stack.pop();`}this.addCodeStr(t+"//let")}convDefLocalVar(e){null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const t=e.name.value,n=e.vartype;if(this.varsSet.names.has(t))throw s.ih.fromNode(`${n}『${t}』の二重定義はできません。`,e);return this.varsSet.names.add(t),"定数"===n&&this.varsSet.readonly.add(t),this.addCodeStr(`${this.varname(t)}=sys.__stack.pop()`),""}convDefLocalVarlist(e){const t=e.vartype;null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const n=`sys.__tmp_i${this.loopId}`;this.loopId++,this.addCodeStr(`${n}=sys.__stack.pop();if (!(${n} instanceof Array)) { ${n}=[${n}] }`);for(const r of e.names){const o=r.value;if(this.varsSet.names.has(o))throw s.ih.fromNode(`${t}『${o}』の二重定義はできません。`,e);this.varsSet.names.add(o),"定数"===t&&this.varsSet.readonly.add(o);const i=this.varname(o);this.addCodeStr(`${i}=${n}.pop()`)}return this.addCodeStr(`delete ${n}//複数代入:掃除`),""}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n)throw new Error("[システムエラー] ジェネレーターでの文字列の展開はサポートしていません");return this.addCodeStr(`sys.__stack.push("${t}")//string`),'"'+t+'"'}convTryExcept(e){const t=this.makeLabel("エラー監視:ならば"),n=this.makeLabel("エラー監視:ここまで");this.addCode(new m(_,t.value)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(t),this._convGen(e.errBlock,!1),this.addCode(n)}}if("object"==typeof navigator&&"object"==typeof navigator.nako3){const e=navigator.nako3;e.addCodeGenerator&&e.addCodeGenerator("非同期モード",NakoGenAsync)}},4159:function(e,t,n){"use strict";n.r(t),n.d(t,{josiList:function(){return s},josiRE:function(){return c},removeJosiList:function(){return o},removeJosiMap:function(){return u},tararebaJosiList:function(){return r},tararebaMap:function(){return i}});const s=["について","くらい","なのか","までを","までの","による","とは","から","まで","だけ","より","ほど","など","いて","えて","きて","けて","して","って","にて","みて","めて","ねて","では","には","は~","んで","ずつ","は","を","に","へ","で","と","が","の"],r=["でなければ","なければ","ならば","なら","たら","れば"],o=["こと","である","です","します","でした"],i={};r.forEach((e=>{s.push(e),i[e]=!0}));const u={};o.forEach((e=>{s.push(e),u[e]=!0})),s.sort(((e,t)=>t.length-e.length));const c=new RegExp("^[\\t ]*("+s.join("|")+")")},8497:function(e,t,n){"use strict";n.r(t),t.default={"回":"回","回繰返":"回","間":"間","間繰返":"間","繰返":"繰返","増繰返":"増繰返","減繰返":"減繰返","後判定":"後判定","反復":"反復","抜":"抜ける","続":"続ける","戻":"戻る","先":"先に","次":"次に","代入":"代入","実行速度優先":"実行速度優先","パフォーマンスモニタ適用":"パフォーマンスモニタ適用","定":"定める","逐次実行":"逐次実行","条件分岐":"条件分岐","増":"増","減":"減","変数":"変数","定数":"定数","エラー監視":"エラー監視","エラー":"エラー","それ":"word","そう":"word","関数":"def_func","インデント構文":"インデント構文","非同期モード":"非同期モード","DNCLモード":"DNCLモード","モード設定":"モード設定","取込":"取込"}},4908:function(e,t){"use strict";t.Z={version:"3.3.3",major:3,minor:3,patch:3}},9218:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){"use strict";var _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(1701),_nako_version_mjs__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4908);__webpack_exports__.Z={meta:{type:"const",value:{pluginName:"plugin_system",pluginVersion:"3.2.24",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.2.24"}},"初期化":{type:"func",josi:[],pure:!1,fn:function(e){e.__v0["ナデシコバージョン"]=void 0===_nako_version_mjs__WEBPACK_IMPORTED_MODULE_1__.Z?"?":_nako_version_mjs__WEBPACK_IMPORTED_MODULE_1__.Z.version,e.__findVar=function(t,n){if("function"==typeof t)return t;if(e.__locals[t])return e.__locals[t];for(let n=2;n>=0;n--){const s=e.__varslist[n];if(s[t])return s[t]}return n},e.__findFunc=function(t,n){const s=e.__findVar(t);if("function"==typeof s)return s;throw new Error(`『${n}』に実行できない関数が指定されました。`)},e.__exec=function(t,n){const s=e.__v0[t];if(s)return s.apply(this,n);const r=e.__findVar(t);if(!r)throw new Error("システム関数でエイリアスの指定ミス:"+t);return r.apply(this,n)},e.__timeout=[],e.__interval=[];const t=e.__zero2=e=>(e="00"+e).substring(e.length-2);e.__zero=(e,t)=>{let n="";for(let e=0;e<t;e++)n+="0";return(e=n+e).substring(e.length-t)},e.__formatDate=e=>e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),e.__formatTime=e=>t(e.getHours())+":"+t(e.getSeconds())+":"+t(e.getMinutes()),e.__formatDateTime=(e,n)=>{const s=e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),r=t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds());return n.match(/^\d+\/\d+\/\d+\s+\d+:\d+:\d+$/)?s+" "+r:n.match(/^\d+\/\d+\/\d+$/)?s:n.match(/^\d+:\d+:\d+$/)?r:s+" "+r},e.__str2date=e=>{if((e=(""+e).replace(/(^\s+|\s+$)/,"")).match(/^(\d+|\d+\.\d+)$/))return new Date(1e3*parseFloat(e));if(e.match(/^\d+\:\d+(\:\d+)?$/)){const t=new Date,n=(e+":0").split(":");return new Date(t.getFullYear(),t.getMonth(),t.getDate(),n[0],n[1],n[2])}e=e.replace(/[\-\s\:]/g,"/");const t=(e+="/0/0/0").split("/");return new Date(t[0],t[1]-1,t[2],t[3],t[4],t[5])},e.__printPool=""}},"!クリア":{type:"func",josi:[],pure:!1,fn:function(e){e.__exec("全タイマー停止",[e]),"非同期モード"===e.__genMode&&e.__stopAsync(e)}},"ナデシコバージョン":{type:"const",value:"?"},"ナデシコエンジン":{type:"const",value:"nadesi.com/v3"},"ナデシコ種類":{type:"const",value:"wnako3/cnako3"},"はい":{type:"const",value:1},"いいえ":{type:"const",value:0},"真":{type:"const",value:1},"偽":{type:"const",value:0},"永遠":{type:"const",value:1},"オン":{type:"const",value:1},"オフ":{type:"const",value:0},"改行":{type:"const",value:"\n"},"タブ":{type:"const",value:"\t"},"カッコ":{type:"const",value:"「"},"カッコ閉":{type:"const",value:"」"},"波カッコ":{type:"const",value:"{"},"波カッコ閉":{type:"const",value:"}"},OK:{type:"const",value:!0},NG:{type:"const",value:!1},"キャンセル":{type:"const",value:0},PI:{type:"const",value:Math.PI},"空":{type:"const",value:""},NULL:{type:"const",value:null},undefined:{type:"const",value:void 0},"未定義":{type:"const",value:void 0},"エラーメッセージ":{type:"const",value:""},"対象":{type:"const",value:""},"対象キー":{type:"const",value:""},"回数":{type:"const",value:""},CR:{type:"const",value:"\r"},LF:{type:"const",value:"\n"},"非数":{type:"const",value:NaN},"無限大":{type:"const",value:1/0},"空配列":{type:"func",josi:[],pure:!0,fn:function(e){return[]}},"空辞書":{type:"func",josi:[],pure:!0,fn:function(e){return{}}},"空ハッシュ":{type:"func",josi:[],pure:!0,fn:function(e){return{}}},"空オブジェクト":{type:"func",josi:[],pure:!1,fn:function(e){return e.__exec("空ハッシュ",[e])}},"表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){e=t.__printPool+e,t.__printPool="",t.__varslist[0]["表示ログ"]+=e+"\n",t.logger.send("stdout",e+"")},return_none:!0},"継続表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__printPool+=e},return_none:!0},"連続表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("表示",[n,t])},return_none:!0},"連続無改行表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("継続表示",[n,t])},return_none:!0},"表示ログ":{type:"const",value:""},"表示ログクリア":{type:"func",josi:[],pure:!0,fn:function(e){e.__varslist[0]["表示ログ"]=""},return_none:!0},"言":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.logger.send("stdout",e+"")},return_none:!0},"コンソール表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){console.log(e)},return_none:!0},"足":{type:"func",josi:[["に","と"],["を"]],isVariableJosi:!1,pure:!0,fn:function(e,t){return e+t}},"引":{type:"func",josi:[["から"],["を"]],pure:!0,fn:function(e,t){return e-t}},"掛":{type:"func",josi:[["に","と"],["を"]],pure:!0,fn:function(e,t){return e*t}},"倍":{type:"func",josi:[["の"],[""]],pure:!0,fn:function(e,t){return e*t}},"割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e/t}},"割余":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e%t}},"偶数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return e%2==0}},"奇数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return e%2==1}},"二乗":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e*e}},"べき乗":{type:"func",josi:[["の"],["の"]],pure:!0,fn:function(e,t){return Math.pow(e,t)}},"以上":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>=t}},"以下":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<=t}},"未満":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<t}},"超":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>t}},"等":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e===t}},"等無":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e!==t}},"一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)===JSON.stringify(t)}return e===t}},"不一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)!==JSON.stringify(t)}return e!==t}},"範囲内":{type:"func",josi:[["が"],["から"],["の"]],pure:!0,fn:function(e,t,n){return t<=e&&e<=n}},"連続加算":{type:"func",josi:[["を"],["に","と"]],isVariableJosi:!0,pure:!0,fn:function(e,...t){return t.pop(),t.push(e),t.reduce(((e,t)=>e+t))}},"ください":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"お願":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"です":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"拝啓":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu=0},return_none:!0},"敬具":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu+=100},return_none:!0},"礼節レベル取得":{type:"func",josi:[],pure:!0,fn:function(e){return e.__reisetu||(e.__reisetu=0),e.__reisetu}},"JS実行":{type:"func",josi:[["を","で"]],pure:!0,fn:function(src,sys){return eval(src)}},"JSオブジェクト取得":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__findVar(e,null)}},"JS関数実行":{type:"func",josi:[["を"],["で"]],fn:function(name,args,sys){if("string"==typeof name&&(name=eval(name)),"function"!=typeof name)throw new Error("JS関数取得で実行できません。");return args instanceof Array||(args=[args]),name.apply(null,args)}},"JSメソッド実行":{type:"func",josi:[["の"],["を"],["で"]],fn:function(obj,m,args,sys){if("string"==typeof obj&&(obj=eval(obj)),"object"!=typeof obj)throw new Error("JSオブジェクトを取得できませんでした。");return"function"!=typeof m&&(m=obj[m]),args instanceof Array||(args=[args]),m.apply(obj,args)}},"ナデシコ":{type:"func",josi:[["を","で"]],pure:!1,fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ」は利用できません。");t.__varslist[0]["表示ログ"]="",t.__self.runEx(e,"immediate-code.nako3",{resetEnv:!1,resetLog:!0});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.send("stdout",n),n}},"ナデシコ続":{type:"func",josi:[["を","で"]],fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ続」は利用できません。");t.__self.runEx(e,"immediate-code.nako3",{resetEnv:!1,resetLog:!1});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.send("stdout",n),n}},"実行":{type:"func",josi:[["を","に","で"]],pure:!1,fn:function(e,t){if("function"==typeof e)return e(t);if("string"==typeof e){const n=t.__findFunc(e,"実行");if("function"==typeof n)return n(t)}return e}},"実行時間計測":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){if("string"==typeof e&&(e=t.__findFunc(e,"実行時間計測")),performance&&performance.now){const n=performance.now();e(t);return performance.now()-n}{const n=Date.now();e(t);return Date.now()-n}}},"変数型確認":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},TYPEOF:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},"文字列変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},TOSTR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},"整数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},TOINT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},"実数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},TOFLOAT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},INT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e)}},FLOAT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseFloat(e)}},"NAN判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return isNaN(e)}},"非数判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Number.isNaN(e)}},HEX:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e).toString(16)}},"進数変換":{type:"func",josi:[["を","の"],[""]],pure:!0,fn:function(e,t){return parseInt(e).toString(t)}},"二進":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return parseInt(e).toString(2)}},"二進表示":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n=parseInt(e).toString(2);t.__exec("表示",[n,t])}},RGB:{type:"func",josi:[["と"],["の"],["で"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+parseInt(e).toString(16);return t.substr(t.length-2,2)};return"#"+s(e)+s(t)+s(n)}},"論理OR":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e||t}},"論理AND":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&&t}},"論理NOT":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e?0:1}},OR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e|t}},AND:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&t}},XOR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e^t}},NOT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return~e}},SHIFT_L:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e<<t}},SHIFT_R:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>t}},SHIFT_UR:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>>t}},"文字数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Array.from?Array.from(e).length:String(e).length}},"何文字目":{type:"func",josi:[["で","の"],["が"]],pure:!0,fn:function(e,t){return String(e).indexOf(t)+1}},CHR:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.fromCodePoint?String.fromCodePoint(e):String.fromCharCode(e)}},ASC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.prototype.codePointAt?String(e).codePointAt(0):String(e).charCodeAt(0)}},"文字挿入":{type:"func",josi:[["で","の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){t<=0&&(t=1);const s=String(e);return s.substr(0,t-1)+n+s.substr(t-1)}},"文字検索":{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){let s=String(e);s=s.substr(t);const r=s.indexOf(n);return-1===r?0:r+1+t}},"追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return String(e)+String(t)}},"一行追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return String(e)+String(t)+"\n"}},"文字列分解":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return Array.from?Array.from(e):String(e).split("")}},"リフレイン":{type:"func",josi:[["を","の"],["で"]],pure:!0,fn:function(e,t){let n="";for(let s=0;s<t;s++)n+=String(e);return n}},"出現回数":{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return(e=""+e).split(t=""+t).length-1}},MID:{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){return n=n||void 0,String(e).substr(t-1,n)}},"文字抜出":{type:"func",josi:[["で","の"],["から"],["を",""]],pure:!0,fn:function(e,t,n){return n=n||void 0,String(e).substr(t-1,n)}},LEFT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return String(e).substr(0,t)}},"文字左部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return String(e).substr(0,t)}},RIGHT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return(e=""+e).substr(e.length-t,t)}},"文字右部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return(e=""+e).substr(e.length-t,t)}},"区切":{type:"func",josi:[["の","を"],["で"]],pure:!0,fn:function(e,t){return(""+e).split(""+t)}},"文字列分割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=(e=""+e).indexOf(t=""+t);return n<0?[e]:[e.substr(0,n),e.substr(n+t.length)]}},"切取":{type:"func",josi:[["から","の"],["まで","を"]],pure:!0,fn:function(e,t,n){const s=(e=String(e)).indexOf(t);return s<0?(n.__v0["対象"]="",e):(n.__v0["対象"]=e.substr(s+t.length),e.substr(0,s))}},"文字削除":{type:"func",josi:[["の"],["から"],["だけ","を",""]],pure:!0,fn:function(e,t,n){return(e=""+e).substr(0,t-1)+e.substr(t-1+n)}},"置換":{type:"func",josi:[["の","で"],["を","から"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).split(t).join(n)}},"単置換":{type:"func",josi:[["の","で"],["を"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).replace(t,n)}},"トリム":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"空白除去":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"大文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toUpperCase()}},"小文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toLowerCase()}},"平仮名変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\u30a1-\u30f6]/g,(function(e){const t=e.charCodeAt(0)-96;return String.fromCharCode(t)}))}},"カタカナ変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\u3041-\u3096]/g,(function(e){const t=e.charCodeAt(0)+96;return String.fromCharCode(t)}))}},"英数全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"英数記号全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\x20-\x7F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数記号半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\uFF00-\uFF5F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"カタカナ全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],o=t.__v0["半角カナ濁音一覧"];let i="",u=0;for(;u<e.length;){const t=e.substr(u,2),c=o.indexOf(t);if(c>=0){i+=r.charAt(c/2),u+=2;continue}const a=e.charAt(u),f=s.indexOf(a);f>=0?(i+=n.charAt(f),u++):(i+=a,u++)}return i}},"カタカナ半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],o=t.__v0["半角カナ濁音一覧"];return e.split("").map((e=>{const t=n.indexOf(e);if(t>=0)return s.charAt(t);const i=r.indexOf(e);return i>=0?o.substr(2*i,2):e})).join("")}},"全角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ全角変換",[n,t]),n=t.__exec("英数記号全角変換",[n,t]),n}},"半角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ半角変換",[n,t]),n=t.__exec("英数記号半角変換",[n,t]),n}},"全角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」"},"全角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"半角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」゙゚"},"半角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"JSONエンコード":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e)}},"JSONエンコード整形":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e,null,2)}},"JSONデコード":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return JSON.parse(e)}},"正規表現マッチ":{type:"func",josi:[["を","が"],["で","に"]],pure:!0,fn:function(e,t,n){let s;const r=t.match(/^\/(.+)\/([a-zA-Z]*)$/);s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]);const o=n.__varslist[0]["抽出文字列"]=[],i=String(e).match(s);let u=i;if(s.global);else if(i&&i.length>0){u=i[0];for(let e=1;e<i.length;e++)o[e-1]=i[e]}return u}},"抽出文字列":{type:"const",value:[]},"正規表現置換":{type:"func",josi:[["の"],["を","から"],["で","に","へ"]],pure:!0,fn:function(e,t,n){let s;const r=t.match(/^\/(.+)\/([a-zA-Z]*)/);return s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]),String(e).replace(s,n)}},"正規表現区切":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){let n;const s=t.match(/^\/(.+)\/([a-zA-Z]*)/);return n=null===s?new RegExp(t,"g"):new RegExp(s[1],s[2]),String(e).split(n)}},"通貨形式":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return String(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},"ゼロ埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n="0";for(let e=0;e<t;e++)n+="0";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substr(s.length-t,t)}},"空白埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n=" ";for(let e=0;e<t;e++)n+=" ";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substr(s.length-t,t)}},"かなか判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12353&&t<=12447}},"カタカナ判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12449&&t<=12538}},"数字判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){const t=String(e).charAt(0);return t>="0"&&t<="9"||t>="0"&&t<="9"}},"数列判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){return null!==String(e).match(/^[0-9.]+$/)}},"配列結合":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.join(""+t);return String(e).split("\n").join(""+t)}},"配列検索":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.indexOf(t):-1}},"配列要素数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e instanceof Array?e.length:e instanceof Object?Object.keys(e).length:1}},"要素数":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("配列要素数",[e])}},"配列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,0,n);throw new Error("『配列挿入』で配列以外の要素への挿入。")}},"配列一括挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array&&n instanceof Array){for(let s=0;s<n.length;s++)e.splice(t+s,0,n[s]);return e}throw new Error("『配列一括挿入』で配列以外の要素への挿入。")}},"配列ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列数値ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort(((e,t)=>parseFloat(e)-parseFloat(t)));throw new Error("『配列数値ソート』で配列以外が指定されました。")}},"配列カスタムソート":{type:"func",josi:[["で"],["の","を"]],pure:!1,fn:function(e,t,n){let s=e;if("string"==typeof e&&(s=n.__findFunc(e,"配列カスタムソート")),t instanceof Array)return t.sort(s);throw new Error("『配列カスタムソート』で配列以外が指定されました。")}},"配列逆順":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.reverse();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列シャッフル":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[n],e[n]=s}return e}throw new Error("『配列シャッフル』で配列以外が指定されました。")}},"配列削除":{type:"func",josi:[["の","から"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("配列切取",[e,t,n])}},"配列切取":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array){const n=e.splice(t,1);return n instanceof Array?n[0]:null}if(!(e instanceof Object&&"string"==typeof t))throw new Error("『配列切取』で配列以外を指定。");if(e[t]){const n=e[t];return delete e[t],n}}},"配列取出":{type:"func",josi:[["の"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,n);throw new Error("『配列取出』で配列以外を指定。")}},"配列ポップ":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){if(e instanceof Array)return e.pop();throw new Error("『配列ポップ』で配列以外の処理。")}},"配列追加":{type:"func",josi:[["に","へ"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.push(t),e;throw new Error("『配列追加』で配列以外の処理。")}},"配列複製":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return JSON.parse(JSON.stringify(e))}},"配列足":{type:"func",josi:[["に","へ","と"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.concat(t):JSON.parse(JSON.stringify(e))}},"配列最大値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.max(e,t)))}},"配列最小値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.min(e,t)))}},"配列合計":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(e instanceof Array){let t=0;return e.forEach((e=>{const n=parseFloat(e);isNaN(n)||(t+=n)})),t}throw new Error("『配列合計』で配列変数以外の値が指定されました。")}},"表ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>{const s=e[t],r=n[t];return s===r?0:s<r?-1:1})),e}},"表数値ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表数値ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>e[t]-n[t])),e}},"表ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表ピックアップ』には配列を指定する必要があります。");return e.filter((e=>String(e[t]).indexOf(n)>=0))}},"表完全一致ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表完全ピックアップ』には配列を指定する必要があります。");return e.filter((e=>e[t]===n))}},"表検索":{type:"func",josi:[["の"],["で","に"],["から"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表検索』には配列を指定する必要があります。");for(let r=n;r<e.length;r++)if(e[r][t]===s)return r;return-1}},"表列数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表列数』には配列を指定する必要があります。");let t=1;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);return t}},"表行数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表行数』には配列を指定する必要があります。");return e.length}},"表行列交換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表行列交換』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=void 0!==e[r][t]?e[r][t]:""}return r}},"表右回転":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表右回転』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=e[s-r-1][t]}return r}},"表重複削除":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表重複削除』には配列を指定する必要があります。");const s=[],r={};for(let n=0;n<e.length;n++){const o=e[n][t];void 0===r[o]&&(r[o]=!0,s.push(e[n]))}return s}},"表列取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表列取得』には配列を指定する必要があります。");return e.map((e=>e[t]))}},"表列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表列挿入』には配列を指定する必要があります。");const s=[];return e.forEach(((e,r)=>{let o=[];t>0&&(o=o.concat(e.slice(0,t))),o.push(n[r]),o=o.concat(e.slice(t)),s.push(o)})),s}},"表列削除":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列削除』には配列を指定する必要があります。");const n=[];return e.forEach(((e,s)=>{const r=e.slice(0);r.splice(t,1),n.push(r)})),n}},"表列合計":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列合計』には配列を指定する必要があります。");let n=0;return e.forEach((e=>{n+=e[t]})),n}},"表曖昧検索":{type:"func",josi:[["の"],["から"],["で"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表曖昧検索』には配列を指定する必要があります。");const r=new RegExp(s);for(let t=0;t<e.length;t++){const s=e[t];if(r.test(s[n]))return t}return-1}},"表正規表現ピックアップ":{type:"func",josi:[["の","で"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表正規表現ピックアップ』には配列を指定する必要があります。");const s=new RegExp(n),r=[];for(let n=0;n<e.length;n++){const o=e[n];s.test(o[t])&&r.push(o.slice(0))}return r}},"辞書キー列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(n);return t}if(e instanceof Array){for(let n=0;n<e.length;n++)t.push(n);return t}throw new Error("『辞書キー列挙』でハッシュ以外が与えられました。")}},"辞書キー削除":{type:"func",josi:[["から","の"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Object)return e[t]&&delete e[t],e;throw new Error("『辞書キー削除』でハッシュ以外が与えられました。")}},"辞書キー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"ハッシュキー列挙":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("辞書キー列挙",[e,t])}},"ハッシュ内容列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(e[n]);return t}throw new Error("『ハッシュ内容列挙』でハッシュ以外が与えられました。")}},"ハッシュキー削除":{type:"func",josi:[["から","の"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("辞書キー削除",[e,t,n])}},"ハッシュキー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"秒待":{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:function(e,t){return new Promise(((t,n)=>{setTimeout((()=>{t()}),1e3*e)}))},return_none:!0},"秒待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode){if(void 0===t.resolve)throw new Error("『秒待機』命令は『!非同期モード』で使ってください。");t.__exec("秒逐次待機",[e,t])}else{const n=t.setAsync(t);setTimeout((()=>{t.compAsync(t,n)}),1e3*e)}},return_none:!0},"秒逐次待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if(void 0===t.resolve)throw new Error("『秒逐次待機』命令は『逐次実行』構文と一緒に使ってください。");const n=t.resolve;t.resolveCount++;const s=setTimeout((function(){const e=t.__timeout.indexOf(s);e>=0&&t.__timeout.splice(e,1),n()}),1e3*e);t.__timeout.unshift(s)},return_none:!0},"秒後":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒後"));const s=setTimeout((()=>{const t=n.__timeout.indexOf(s);t>=0&&n.__timeout.splice(t,1),"非同期モード"===n.__genMode&&(n.newenv=!0);try{e(s,n)}catch(e){let t=e;e instanceof _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as||(t=new _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as(e,n.__varslist[0].line)),n.logger.error(t)}}),1e3*parseFloat(t));return n.__timeout.unshift(s),n.__v0["対象"]=s,s}},"秒毎":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒毎"));const s=setInterval((()=>{"非同期モード"===n.__genMode&&(n.newenv=!0),e(s,n)}),1e3*parseFloat(t));return n.__interval.unshift(s),n.__v0["対象"]=s,s}},"秒タイマー開始時":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){return n.__exec("秒毎",[e,t,n])}},"タイマー停止":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e,t){const n=t.__interval.indexOf(e);if(n>=0)return t.__interval.splice(n,1),clearInterval(e),!0;const s=t.__timeout.indexOf(e);return s>=0&&(t.__timeout.splice(s,1),clearTimeout(e),!0)},return_none:!1},"全タイマー停止":{type:"func",josi:[],pure:!0,fn:function(e){for(let t=0;t<e.__interval.length;t++){const n=e.__interval[t];clearInterval(n)}e.__interval=[];for(let t=0;t<e.__timeout.length;t++){const n=e.__timeout[t];clearTimeout(n)}e.__timeout=[]},return_none:!0},"元号データ":{type:"const",value:[{"元号":"令和","改元日":"2019/05/01"},{"元号":"平成","改元日":"1989/01/08"},{"元号":"昭和","改元日":"1926/12/25"},{"元号":"大正","改元日":"1912/07/30"},{"元号":"明治","改元日":"1868/10/23"}]},"今":{type:"func",josi:[],pure:!0,fn:function(){const e=e=>(e="00"+e).substr(e.length-2,2),t=new Date;return e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())}},"システム時間":{type:"func",josi:[],pure:!0,fn:function(){const e=new Date;return Math.floor(e.getTime()/1e3)}},"システム時間ミリ秒":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getTime()}},"今日":{type:"func",josi:[],pure:!0,fn:function(e){return e.__formatDate(new Date)}},"明日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()+864e5;return e.__formatDate(new Date(t))}},"昨日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()-864e5;return e.__formatDate(new Date(t))}},"今年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()}},"来年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()+1}},"去年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()-1}},"今月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+1}},"来月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+2}},"先月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()}},"曜日":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){const n=t.__str2date(e);return"日月火水木金土".charAt(n.getDay()%7)}},"曜日番号取得":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e.split("/");return new Date(t[0],t[1]-1,t[2]).getDay()}},"UNIXTIME変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"UNIX時間変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"日時変換":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e,t){const n=1e3*e;return t.__formatDateTime(new Date(n),"2022/01/01 00:00:00")}},"日時書式変換":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return t=t.replace(/(YYYY|ccc|WWW|MMM|YY|MM|DD|HH|mm|ss|[MDHmsW])/g,(e=>{switch(e){case"YYYY":return s.getFullYear();case"YY":return(""+s.getFullYear()).substring(2);case"MM":return n.__zero2(s.getMonth()+1);case"DD":return n.__zero2(s.getDate());case"M":return s.getMonth()+1;case"D":return s.getDate();case"HH":return n.__zero2(s.getHours());case"mm":return n.__zero2(s.getMinutes());case"ss":return n.__zero2(s.getSeconds());case"ccc":return n.__zero(s.getMilliseconds(),3);case"H":return s.getHours();case"m":return s.getMinutes();case"s":return s.getSeconds();case"W":return"日月火水木金土".charAt(s.getDay()%7);case"WWW":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][s.getDay()%7];case"MMM":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][s.getMonth()]}return e}))}},"和暦変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){const n=t.__str2date(e),s=n.getTime();for(const e of t.__v0["元号データ"]){const r=e["元号"],o=t.__str2date(e["改元日"]);if(o.getTime()<=s){let e=n.getFullYear()-o.getFullYear()+1;return 1==e&&(e="元"),r+e+"年"+t.__zero2(n.getMonth()+1)+"月"+t.__zero2(n.getDate())+"日"}}throw new Error("『和暦変換』は明示以前の日付には対応していません。")}},"年数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return n.__str2date(t).getFullYear()-s.getFullYear()}},"月数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e),r=n.__str2date(t);return 12*r.getFullYear()+r.getMonth()-(12*s.getFullYear()+s.getMonth())}},"日数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/86400)}},"時間差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/3600)}},"分差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/60)}},"秒差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil(r-s)}},"日時差":{type:"func",josi:[["と","から"],["の","までの"],["による"]],pure:!0,fn:function(e,t,n,s){switch(n){case"年":return s.__exec("年数差",[e,t,s]);case"月":return s.__exec("月数差",[e,t,s]);case"日":return s.__exec("日数差",[e,t,s]);case"時間":return s.__exec("時間差",[e,t,s]);case"分":return s.__exec("分差",[e,t,s]);case"秒":return s.__exec("秒差",[e,t,s])}throw new Error("『日時差』で不明な単位です。")}},"時間加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){let s=t.charAt(0);"-"!==s&&"+"!==s||(t=t.substring(1));const r=n.__str2date(e),o=(t+":0:0").split(":");let i=60*parseInt(o[0])*60+60*parseInt(o[1])+parseInt(o[2]);"-"===s&&(i*=-1);const u=new Date(r.getTime()+1e3*i);return n.__formatDateTime(u,e)}},"日付加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){let s=1,r=t.charAt(0);"-"!==r&&"+"!==r||(t=t.substring(1),"-"===r&&(s*=-1));const o=n.__str2date(e),i=(t+"/0/0").split("/"),u=parseInt(i[0])*s,c=parseInt(i[1])*s,a=parseInt(i[2])*s;return o.setFullYear(o.getFullYear()+u),o.setMonth(o.getMonth()+c),o.setDate(o.getDate()+a),n.__formatDateTime(o,e)}},"日時加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=(""+t).match(/([+|-]?)(\d+)(年|ヶ月|日|週間|時間|分|秒)$/);if(!s)throw new Error("『日付加算』は『(+|-)1(年|ヶ月|日|時間|分|秒)』の書式で指定します。");switch(s[3]){case"年":return n.__exec("日付加算",[e,`${s[1]}${s[2]}/0/0`,n]);case"ヶ月":return n.__exec("日付加算",[e,`${s[1]}0/${s[2]}/0`,n]);case"週間":return n.__exec("日付加算",[e,`${s[1]}0/0/${7*s[2]}`,n]);case"日":return n.__exec("日付加算",[e,`${s[1]}0/0/${s[2]}`,n]);case"時間":return n.__exec("時間加算",[e,`${s[1]}${s[2]}:0:0`,n]);case"分":return n.__exec("時間加算",[e,`${s[1]}0:${s[2]}:0`,n]);case"秒":return n.__exec("時間加算",[e,`${s[1]}0:0:${s[2]}`,n])}}},"時間ミリ秒取得":{type:"func",josi:[],pure:!0,fn:function(){if(performance&&performance.now)return performance.now();if(Date.now)return Date.now();return(new Date).getTime()}},"エラー発生":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e){throw new Error(e)}},"システム関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.__v0){"function"==typeof e.__v0[n]&&t.push(n)}return t}},"システム関数存在":{type:"func",josi:[["が","の"]],pure:!0,fn:function(e,t){return void 0!==t.__v0[e]}},"プラグイン一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.pluginfiles)t.push(n);return t}},"モジュール一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.__module)t.push(n);return t}},"助詞一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,4159)).then((t=>{const n=Object.assign({},t);e(n.josiList)})).catch((e=>{t(e)}))}))}},"予約語一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,8497)).then((t=>{const n=Object.assign({},t),s=[];for(const e in n.default)s.push(e);e(s)})).catch((e=>{t(e)}))}))}},"プラグイン名":{type:"const",value:"メイン"},"プラグイン名設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){t.__v0["プラグイン名"]=e},return_none:!0},"URLエンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){return encodeURIComponent(e)}},"URLデコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){return decodeURIComponent(e)}},"URLパラメータ解析":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n={};if("string"!=typeof e)return n;const s=e.split("?");if(s.length<=1)return n;const r=s[1].split("&");for(const e of r){const s=(e+"=").split("=");n[t.__exec("URLデコード",[s[0]])]=t.__exec("URLデコード",[s[1]])}return n}},"BASE64エンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.btoa){const t=String.fromCharCode.apply(null,new TextEncoder("UTF-8").encode(e));return btoa(t)}return Buffer.from(e).toString("base64")}},"BASE64デコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.atob){const t=atob(e),n=new Uint8Array(Array.prototype.map.call(t,(e=>e.charCodeAt())));return new TextDecoder("UTF-8").decode(n)}return Buffer.from(e,"base64").toString()}}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};!function(){"use strict";const e={and:1,or:1,eq:2,noteq:2,"===":2,"!==":2,gt:2,gteq:2,lt:2,lteq:2,"&":3,"+":4,"-":4,shift_l:4,shift_r:4,shift_r0:4,"*":5,"/":5,"÷":5,"÷÷":5,"%":5,"^":6},t=["いて","えて","きて","けて","して","って","にて","みて","めて","ねて","には","んで"];var n=__webpack_require__(1701);const s=[];for(const t in e)s.push(t);class r extends class{constructor(e){this.logger=e,this.stackList=[],this.init(),this.tokens=[],this.stack=[],this.index=0,this.y=[],this.genMode="sync",this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1,this.recentlyCalledFunc=[]}init(){this.funclist={},this.reset()}reset(){this.tokens=[],this.index=0,this.stack=[],this.y=[],this.genMode="sync"}setFuncList(e){this.funclist=e}popStack(e){if(!e)return this.stack.pop();for(let t=0;t<this.stack.length;t++){const n=this.stack[t];if(0===e.length||e.indexOf(n.josi)>=0)return this.stack.splice(t,1),this.logger.trace("POP :"+JSON.stringify(n)),n}return null}saveStack(){this.stackList.push(this.stack),this.stack=[]}loadStack(){this.stack=this.stackList.pop()}pushStack(e){this.logger.debug("PUSH:"+JSON.stringify(e)),this.stack.push(e)}isEOF(){return this.index>=this.tokens.length}check(e){return this.tokens[this.index].type===e}check2(e){for(let t=0;t<e.length;t++){const n=t+this.index;if(this.tokens.length<=n)return!1;if("*"===e[t])continue;const s=this.tokens[n];if(e[t]instanceof Array){if(e[t].indexOf(s.type)<0)return!1}else if(s.type!==e[t])return!1}return!0}checkTypes(e){const t=this.tokens[this.index].type;return e.indexOf(t)>=0}accept(e){const t=[],n=this.index,s=()=>(this.index=n,!1);for(let n=0;n<e.length;n++){if(this.isEOF())return s();const r=e[n];if("string"!=typeof r)if("function"!=typeof r){if(!(r instanceof Array))throw new Error("System Error : accept broken : "+typeof r);if(!this.checkTypes(r))return s();t[n]=this.get()}else{const e=r.bind(this)(t);if(null===e)return s();t[n]=e}else{const e=this.get();if(e.type!==r)return s();t[n]=e}}return this.y=t,!0}get(){return this.isEOF()?null:this.tokens[this.index++]}unget(){this.index>0&&this.index--}peek(e=0){return this.isEOF()?null:this.tokens[this.index+e]}peekSourceMap(){const e=this.peek();return null===e?{startOffset:null,endOffset:null,file:void 0,line:0,column:0}:{startOffset:e.startOffset,endOffset:e.endOffset,file:e.file,line:e.line,column:e.column}}nodeToStr(e,t,n){const s=t.depth-1,r=e=>void 0!==t.typeName?t.typeName:e,o=n?" debug: "+JSON.stringify(e,null,2):"";if(!e)return"(NULL)";switch(e.type){case"not":return s>=0?`${r("")}『${this.nodeToStr(e.value,{depth:s},n)}に演算子『not』を適用した式${o}』`:`${r("演算子")}『not』`;case"op":{let t=e.operator;const i={eq:"=",not:"!",gt:">",lt:"<",and:"かつ",or:"または"};if(t in i&&(t=i[t]),s>=0){const i=this.nodeToStr(e.left,{depth:s},n),u=this.nodeToStr(e.right,{depth:s},n);return"eq"===e.operator?`${r("")}『${i}と${u}が等しいかどうかの比較${o}』`:`${r("")}『${i}と${u}に演算子『${t}』を適用した式${o}』`}return`${r("演算子")}『${t}${o}』`}case"number":return`${r("数値")}${e.value}`;case"string":return`${r("文字列")}『${e.value}${o}』`;case"word":return`${r("単語")}『${e.value}${o}』`;case"func":return`${r("関数")}『${e.name||e.value}${o}』`;case"eol":return"行の末尾";case"eof":return"ファイルの末尾";default:{let t=e.name;return t||(t=e.value),"string"!=typeof t&&(t=e.type),`${r("")}『${t}${o}』`}}}}{parse(e){return this.reset(),this.tokens=e,this.startParser()}startParser(){const e=this.ySentenceList(),t=this.get();if(t&&"eof"!==t.type)throw this.logger.debug(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!0)}の使い方が間違っています。`,t),n.ih.fromNode(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!1)}の使い方が間違っています。`,t);return e}ySentenceList(){const e=[];let t=-1;const s=this.peekSourceMap();for(;!this.isEOF();){const n=this.ySentence();if(!n)break;e.push(n),t<0&&(t=n.line)}if(0===e.length){const e=this.peek()||this.tokens[0];throw this.logger.debug("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!0),e),n.ih.fromNode("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!1),e)}return{type:"block",block:e,...s,end:this.peekSourceMap(),genMode:this.genMode}}yEOL(){const e=this.get();if(this.stack.length>0){const t=[];this.stack.forEach((e=>{let n=this.nodeToStr(e,{depth:1},!1);e.josi&&(n+=e.josi),t.push(n)}));const s=t.join(",");let r="",o="A".charCodeAt(0);for(let e of this.recentlyCalledFunc){r+=" - ";let t=0;for(let n of e.josi){r+=String.fromCharCode(o+t),1==n.length?r+=n[0]:r+=`(${n.join("|")})`,t++}r+=e.name+"\n"}throw n.ih.fromNode(`未解決の単語があります: [${s}]\n次の命令の可能性があります:\n${r}`,e)}return this.recentlyCalledFunc=[],e}ySentence(){const e=this.peekSourceMap();if(this.check("eol"))return this.yEOL();if(this.check("もし"))return this.yIF();if(this.check("後判定"))return this.yAtohantei();if(this.check("エラー監視"))return this.yTryExcept();if(this.check("逐次実行"))return this.yTikuji();if(this.accept(["抜ける"]))return{type:"break",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["続ける"]))return{type:"continue",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["require","string","取込"]))return{type:"require",value:this.y[1].value,josi:"",...e,end:this.peekSourceMap()};if(this.accept(["not","非同期モード"]))return this.yASyncMode();if(this.accept(["not","DNCLモード"]))return this.yDNCLMode();if(this.accept(["not","string","モード設定"]))return this.ySetGenMode(this.y[1].value);if(this.check2(["func","←"]))return this.yCallOp();if(this.check2(["func","eq"])){const e=this.get()||{value:"?"};throw n.ih.fromNode(`関数『${e.value}』に代入できません。『←』を使ってください。`,e)}if(this.accept([this.ySpeedMode]))return this.y[0];if(this.accept([this.yPerformanceMonitor]))return this.y[0];if(this.accept([this.yLet]))return this.y[0];if(this.accept([this.yDefTest]))return this.y[0];if(this.accept([this.yDefFunc]))return this.y[0];if(this.accept([this.yCall])){const t=this.y[0];if("して"===t.josi){const n=this.ySentence();if(null!==n)return{type:"block",block:[t,n],josi:n.josi,...e,end:this.peekSourceMap()}}return t}return null}yASyncMode(){const e=this.peekSourceMap();return this.genMode="非同期モード",{type:"eol",...e,end:this.peekSourceMap()}}yDNCLMode(){const e=this.peekSourceMap();return this.arrayIndexFrom=1,this.flagReverseArrayIndex=!0,this.flagCheckArrayInit=!0,{type:"eol",...e,end:this.peekSourceMap()}}ySetGenMode(e){const t=this.peekSourceMap();return this.genMode=e,{type:"eol",...t,end:this.peekSourceMap()}}yBlock(){const e=this.peekSourceMap(),t=[];for(this.check("ここから")&&this.get();!this.isEOF()&&!this.checkTypes(["違えば","ここまで","エラー"])&&this.accept([this.ySentence]);)t.push(this.y[0]);return{type:"block",block:t,...e,end:this.peekSourceMap()}}yDefFuncReadArgs(){if(!this.check("("))return null;const e=[];for(this.get();!this.isEOF();){if(this.check(")")){this.get();break}e.push(this.get()),this.check("comma")&&this.get()}return e}yDefTest(){return this.yDef("def_test")}yDefFunc(){return this.yDef("def_func")}yDef(e){if(!this.check(e))return null;const t=this.peekSourceMap(),s=this.get();let r=[];this.check("(")&&(r=this.yDefFuncReadArgs());const o=this.get();if("func"!==o.type)throw this.logger.debug(this.nodeToStr(o,{depth:0,typeName:"関数"},!0)+"の宣言でエラー。",o),n.ih.fromNode(this.nodeToStr(o,{depth:0,typeName:"関数"},!1)+"の宣言でエラー。",o);if(this.check("(")){if(r.length>0)throw this.logger.debug(this.nodeToStr(o,{depth:0,typeName:"関数"},!0)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",o),n.ih.fromNode(this.nodeToStr(o,{depth:0,typeName:"関数"},!1)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",o);r=this.yDefFuncReadArgs()}this.check("とは")&&this.get();let i=null,u=!1;this.check("ここから")&&(u=!0),this.check("eol")&&(u=!0);try{if(u){if(this.saveStack(),i=this.yBlock(),!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。関数定義の末尾に必要です。",s);this.get(),this.loadStack()}else this.saveStack(),i=this.ySentence(),this.loadStack()}catch(e){throw this.logger.debug(this.nodeToStr(o,{depth:0,typeName:"関数"},!0)+"の定義で以下のエラーがありました。\n"+e.message,s),n.ih.fromNode(this.nodeToStr(o,{depth:0,typeName:"関数"},!1)+"の定義で以下のエラーがありました。\n"+e.message,s)}return{type:e,name:o,args:r,block:i,josi:"",...t,end:this.peekSourceMap()}}yIFCond(){const e=this.peekSourceMap();let t=this.yGetArg();if(!t)return null;if("が"===t.josi){const n=this.index,s=this.yGetArg(),r=this.get();if(s&&"func"!==s.type&&r&&"ならば"===r.type)return{type:"op",operator:"でなければ"===r.value?"noteq":"eq",left:t,right:s,josi:"",...e,end:this.peekSourceMap()};this.index=n}if(""!==t.josi&&(this.stack.push(t),t=this.yCall()),!this.check("ならば"))throw this.logger.debug("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",t),n.ih.fromNode("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",t);return"でなければ"===this.get().value&&(t={type:"not",value:t,josi:"",...e,end:this.peekSourceMap()}),t}yIF(){const e=this.peekSourceMap();if(!this.check("もし"))return null;const t=this.get();for(;this.check("comma");)this.get();let s=null;try{s=this.yIFCond()}catch(e){throw n.ih.fromNode("『もし』文の条件で次のエラーがあります。\n"+e.message,t)}if(null===s)throw n.ih.fromNode("『もし』文で条件の指定が空です。",t);let r=null,o=null,i=!1;for(this.check("eol")?r=this.yBlock():(r=this.ySentence(),i=!0);this.check("eol");)this.get();if(this.check("違えば")){for(this.get();this.check("comma");)this.get();this.check("eol")?o=this.yBlock():(o=this.ySentence(),i=!0)}if(!1===i){if(!this.check("ここまで"))throw n.ih.fromNode("『もし』文で『ここまで』がありません。",t);this.get()}return{type:"if",expr:s,block:r,false_block:o,josi:"",...e,end:this.peekSourceMap()}}ySpeedMode(){const e=this.peekSourceMap();if(!this.check2(["string","実行速度優先"]))return null;const t=this.get();this.get();const n={"行番号無し":!1,"暗黙の型変換無し":!1,"強制ピュア":!1,"それ無効":!1};for(const e of t.value.split("/")){if("全て"===e){for(const e of Object.keys(n))n[e]=!0;break}Object.keys(n).includes(e)?n[e]=!0:this.logger.warn(`実行速度優先文のオプション『${e}』は存在しません。`,t)}let s=!1;this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0);let r=null;return s?(r=this.yBlock(),this.check("ここまで")&&this.get()):r=this.ySentence(),{type:"speed_mode",options:n,block:r,line:t.line,josi:"",...e}}yPerformanceMonitor(){const e=this.peekSourceMap();if(!this.check2(["string","パフォーマンスモニタ適用"]))return null;const t=this.get();this.get();const n={"ユーザ関数":!1,"システム関数本体":!1,"システム関数":!1};for(const e of t.value.split("/")){if("全て"===e){for(const e of Object.keys(n))n[e]=!0;break}Object.keys(n).includes(e)?n[e]=!0:this.logger.warn(`パフォーマンスモニタ適用文のオプション『${e}』は存在しません。`,t)}let s=!1;this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0);let r=null;return s?(r=this.yBlock(),this.check("ここまで")&&this.get()):r=this.ySentence(),{type:"performance_monitor",options:n,block:r,line:t.line,josi:"",...e}}yTikuji(){const e=this.peekSourceMap();if(!this.check("逐次実行"))return null;const t=this.get(),s=[];let r=null;if(!this.check("eol"))throw n.ih.fromNode("『逐次実行』の直後は改行が必要です",t);for(;!this.check("ここまで");){if(this.check("eol")){this.get();continue}if(this.check2(["エラー","ならば"])){this.get(),this.get(),r=this.yBlock();break}let e=null;if(this.check("先に")||this.check("次に")){const t=this.get();if(this.check("comma")&&this.get(),this.check("eol")){if(e=this.yBlock(),!this.check("ここまで")){let e="次に";throw null!=t&&(e=t.type),n.ih.fromNode(`『${e}』...『ここまで』を対応させてください。`,t)}this.get()}else e=this.ySentence()}else e=this.ySentence();null!=e&&s.push(e)}if(!this.check("ここまで"))throw console.log(s,this.peek()),n.ih.fromNode("『逐次実行』...『ここまで』を対応させてください。",t);return this.get(),{type:"tikuji",blocks:s,errorBlock:r,josi:"",...e,end:this.peekSourceMap()}}yGetArgOperator(t){const s=[t];for(;!this.isEOF();){const r=this.peek();if(!r||!e[r.type])break;{s.push(this.get());const e=this.yValue();if(null===e)throw n.ih.fromNode(`計算式で演算子『${r.value}』後に値がありません`,t);s.push(e)}}return 0===s.length?null:1===s.length?s[0]:this.infixToAST(s)}yGetArg(){const e=this.yValue();return null===e?null:this.yGetArgOperator(e)}infixToPolish(t){const n=t=>e[t.type]?e[t.type]:10,s=[],r=[];for(;t.length>0;){const e=t.shift();for(;s.length>0;){const t=s[s.length-1];if(n(e)>n(t))break;r.push(s.pop())}s.push(e)}for(;s.length>0;)r.push(s.pop());return r}infixToAST(t){if(0===t.length)return null;const s=t[t.length-1].josi,r=t[t.length-1],o=this.infixToPolish(t),i=[];for(const t of o){if(!e[t.type]){i.push(t);continue}const u=i.pop(),c=i.pop();if(void 0===c||void 0===u)throw this.logger.debug("--- 計算式(逆ポーランド) ---\n"+JSON.stringify(o)),n.ih.fromNode("計算式でエラー",r);const a={type:"op",operator:t.type,left:c,right:u,josi:s,startOffset:c.startOffset,endOffset:c.endOffset,line:c.line,column:c.column,file:c.file};i.push(a)}return i.pop()}yGetArgParen(e){let t=!1;const s=this.stack.length;for(;!this.isEOF();){if(this.check(")")){t=!0;break}const e=this.yGetArg();if(!e)break;this.pushStack(e),this.check("comma")&&this.get()}if(!t)throw n.ih.fromNode(`C風関数『${e[0].value}』でカッコが閉じていません`,e[0]);const r=[];for(;s<this.stack.length;){const e=this.popStack();r.unshift(e)}return r}yRepeatTime(){const e=this.peekSourceMap();if(!this.check("回"))return null;this.get(),this.check("comma")&&this.get(),this.check("繰返")&&this.get();let t=this.popStack([]),s=!1,r=null;if(null===t&&(t={type:"word",value:"それ",josi:"",...e,end:this.peekSourceMap()}),this.check("comma")&&this.get(),this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0),s){if(r=this.yBlock(),!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『回』...『ここまで』を対応させてください。",e);this.get()}else r=this.ySentence();return{type:"repeat_times",value:t,block:r,josi:"",...e,end:this.peekSourceMap()}}yWhile(){const e=this.peekSourceMap();if(!this.check("間"))return null;for(this.get();this.check("comma");)this.get();this.check("繰返")&&this.get();const t=this.popStack([]);if(null===t)throw n.ih.fromNode("『間』で条件がありません。",t);if(this.check("comma")&&this.get(),!this.checkTypes(["ここから","eol"]))throw n.ih.fromNode("『間』の直後は改行が必要です",t);const s=this.yBlock();return this.check("ここまで")&&this.get(),{type:"while",cond:t,block:s,josi:"",...e,end:this.peekSourceMap()}}yAtohantei(){const e=this.peekSourceMap();this.check("後判定")&&this.get(),this.check("繰返")&&this.get(),this.check("ここから")&&this.get();const t=this.yBlock();this.check("ここまで")&&this.get(),this.check("comma")&&this.get();let n=this.yGetArg(),s=!1;const r=this.peek();return!r||"なる"!==r.value||"まで"!==r.josi&&"までの"!==r.josi||(this.get(),s=!0),this.check("間")&&this.get(),s&&(n={type:"not",value:n,josi:"",...e,end:this.peekSourceMap()}),{type:"atohantei",cond:n,block:t,josi:"",...e,end:this.peekSourceMap()}}yFor(){const e=this.peekSourceMap();if(!(this.check("繰返")||this.check("増繰返")||this.check("減繰返")))return null;const t=this.get(),s=this.stack.pop();"word"!=s.type||"増"!==s.value&&"減"!==s.value?this.stack.push(s):t.type=s.value+t.type;let r=null;"増繰返"!==t.type&&"減繰返"!==t.type||(r=this.popStack(["ずつ"]));const o=this.popStack(["まで"]),i=this.popStack(["から"]),u=this.popStack(["を","で"]);if(null===i||null===o)throw n.ih.fromNode("『繰り返す』文でAからBまでの指定がありません。",t);this.check("comma")&&this.get();let c=!1;(this.check("ここから")||this.check("eol"))&&(c=!0,this.get());let a=null;if(c){if(a=this.yBlock(),!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『繰り返す』...『ここまで』を対応させてください。",e);this.get()}else a=this.ySentence();return{type:"for",from:i,to:o,inc:r,word:u,block:a,josi:"",...e,end:this.peekSourceMap()}}yReturn(){const e=this.peekSourceMap();if(!this.check("戻る"))return null;const t=this.get(),s=this.popStack(["で","を"]);if(this.stack.length>0)throw n.ih.fromNode("『戻』文の直前に未解決の引数があります。『(式)を戻す』のように式をカッコで括ってください。",t);return{type:"return",value:s,josi:"",...e,end:this.peekSourceMap()}}yForEach(){const e=this.peekSourceMap();if(!this.check("反復"))return null;for(this.get();this.check("comma");)this.get();const t=this.popStack(["を"]),n=this.popStack(["で"]);let s=null,r=!1;return this.check("ここから")?(r=!0,this.get()):this.check("eol")&&(r=!0),r?(s=this.yBlock(),this.check("ここまで")&&this.get()):s=this.ySentence(),{type:"foreach",name:n,target:t,block:s,josi:"",...e,end:this.peekSourceMap()}}ySwitch(){const e=this.peekSourceMap();if(!this.check("条件分岐"))return null;const t=this.get(),s=this.get(),r=this.popStack(["で"]);if(!r)throw n.ih.fromNode("『(値)で条件分岐』のように記述してください。",t);if("eol"!==s.type)throw n.ih.fromNode("『条件分岐』の直後は改行してください。",t);let o=!1,i=!1;const u=[];for(;!this.isEOF();){if(this.check("ここまで")){if(i)throw n.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);this.get();break}if(this.check("eol")){this.get();continue}if(o)throw n.ih.fromNode("『条件分岐』で『違えば〜ここまで』の後に処理を続けることは出来ません。",t);let e=this.peek();if("違えば"===e.type)i=!1,o=!0,this.get(),this.check("comma")&&this.get();else{if(i)throw n.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);e=this.yValue();if("ならば"!==this.get().type)throw n.ih.fromNode("『条件分岐』で条件は**ならばと記述してください。",t);this.check("comma")&&this.get()}const s=this.yBlock();if("ここまで"===this.peek().type)this.get();else{if(o)throw n.ih.fromNode("『条件分岐』は『違えば〜ここまで』と記述してください。",t);i=!0}u.push([e,s])}return{type:"switch",value:r,cases:u,josi:"",...e,end:this.peekSourceMap()}}yMumeiFunc(){const e=this.peekSourceMap();if(!this.check("def_func"))return null;const t=this.get();let s=[];this.check("comma")&&this.get(),this.check("(")&&(s=this.yDefFuncReadArgs()),this.check("comma")&&this.get(),this.saveStack();const r=this.yBlock();if(!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『には』構文か無名関数の末尾に『ここまで』が必要です。",e);return this.get(),this.loadStack(),{type:"func_obj",args:s,block:r,meta:t.meta,josi:"",...e,end:this.peekSourceMap()}}yDainyu(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const s=this.popStack(["を"]),r=this.popStack(["へ","に"]);if(!r||"word"!==r.type&&"func"!==r.type&&"配列参照"!==r.type)throw n.ih.fromNode("代入文で代入先の変数が見当たりません。『(変数名)に(値)を代入』のように使います。",t);return"配列参照"===r.type?{type:"let_array",name:r.name,index:r.index,value:s,josi:"",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}:{type:"let",name:r,value:s,josi:"",...e,end:this.peekSourceMap()}}ySadameru(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const s=this.popStack(["を"]),r=this.popStack(["へ","に"]);if(console.log(s),!s||"word"!==s.type&&"func"!==s.type&&"配列参照"!==s.type)throw n.ih.fromNode("『定める』文で定数が見当たりません。『(定数名)を(値)に定める』のように使います。",t);return{type:"def_local_var",name:s,vartype:"定数",value:r,josi:"",...e,end:this.peekSourceMap()}}yIncDec(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;if(this.check("繰返"))return this.pushStack({type:"word",value:t.value,josi:t.josi,...e,end:this.peekSourceMap}),this.yFor();let s=this.popStack(["だけ",""]);const r=this.popStack(["を"]);if(!r||"word"!==r.type&&"配列参照"!==r.type)throw n.ih.fromNode(`『${t.type}』文で定数が見当たりません。『(変数名)を(値)だけ${t.type}』のように使います。`,t);return"減"===t.value&&(s={type:"op",operator:"*",left:s,right:{type:"number",value:-1,line:t.line},josi:"",...e}),{type:"inc",name:r,value:s,josi:t.josi,...e,end:this.peekSourceMap()}}yCall(){if(this.isEOF())return null;for(;!this.isEOF();){if(this.check("ここから")&&this.get(),this.check("代入"))return this.yDainyu();if(this.check("定める"))return this.ySadameru();if(this.check("回"))return this.yRepeatTime();if(this.check("間"))return this.yWhile();if(this.check("繰返")||this.check("増繰返")||this.check("減繰返"))return this.yFor();if(this.check("反復"))return this.yForEach();if(this.check("条件分岐"))return this.ySwitch();if(this.check("戻る"))return this.yReturn();if(this.check("増")||this.check("減"))return this.yIncDec();if(this.check2([["func","word"],"("])&&""===this.peek().josi){const e=this.yValue();if("func"===e.type&&(""===e.josi||t.indexOf(e.josi)>=0))return e.josi="",e;this.pushStack(e),this.check("comma")&&this.get();continue}if(this.check("func")){const e=this.yCallFunc();if(null===e)continue;if(this.check("間")){this.pushStack(e);continue}if(!this.checkTypes(s))return e;this.pushStack(this.yGetArgOperator(e));continue}const e=this.yGetArg();if(!e)break;this.pushStack(e)}if(this.stack.length>0){this.logger.debug("--- stack dump ---\n"+JSON.stringify(this.stack,null,2)+"\npeek: "+JSON.stringify(this.peek(),null,2));let e=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!0))).join("、")}が解決していません。`,t=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!1))).join("、")}が解決していません。`;for(const n of this.stack){const s=this.nodeToStr(n,{depth:0},!1),r=this.nodeToStr(n,{depth:1},!1);s!==r&&(e+=`${this.nodeToStr(n,{depth:0},!0)}は${this.nodeToStr(n,{depth:1},!0)}として使われています。`,t+=`${s}は${r}として使われています。`)}const s=this.stack[0],r=this.stack[this.stack.length-1];throw this.logger.debug(e,s),n.ih.fromNode(t,s,r)}return this.popStack([])}yCallFunc(){const e=this.peekSourceMap(),s=this.get(),r=s.meta;let o=null;if("には"===s.josi){try{o=this.yMumeiFunc()}catch(e){throw n.ih.fromNode(`『${s.value}には...』で無名関数の定義で以下の間違いがあります。\n${e.message}`,s)}if(null===o)throw n.ih.fromNode("『Fには』構文がありましたが、関数定義が見当たりません。",s)}if(!r||void 0===r.josi)throw n.ih.fromNode("関数の定義でエラー。",s);this.recentlyCalledFunc.push({name:s.value,...r});const i=[];let u=0,c=0;for(let e=0;e<r.josi.length;e++)for(;;){let t=this.popStack(r.josi[e]);if(null!==t)c++;else{if(!(e<r.josi.length-1)&&r.isVariableJosi)break;u++,t=o}if(null!==t&&void 0!==r.funcPointers&&null!==r.funcPointers[e]){if("func"!==t.type)throw n.ih.fromNode(`関数『${s.value}』の引数『${r.varnames[e]}』には関数オブジェクトが必要です。`,s);t.type="func_pointer"}if(i.push(t),e<r.josi.length-1||!r.isVariableJosi)break}if(u>=2&&(c>0||""===s.josi||t.indexOf(s.josi)>=0))throw n.ih.fromNode(`関数『${s.value}』の引数が不足しています。`,s);const a={type:"func",name:s.value,args:i,josi:s.josi,...e,end:this.peekSourceMap()};return""===s.josi?a:t.indexOf(s.josi)>=0?(a.josi="して",a):(a.meta=r,this.pushStack(a),null)}yCallOp(){if(!this.check2(["func","←"]))return null;const e=this.peekSourceMap(),t=this.get();if(null==t)throw new Error("関数が取得できません。");try{if(null==this.get())throw new Error("関数呼び出し演算子が取得できません。");const s=t.value,r=t.meta.josi.length;if(0===r)throw n.ih.fromNode(`引数がない関数『${s}』を関数呼び出し演算子で呼び出すことはできません。`,t);const o=this.stack.length;for(;!this.isEOF();){const e=this.yGetArg();if(!e)break;if(this.pushStack(e),this.stack.length-o===r)break}const i=this.stack.length-o;if(i!==r)throw n.ih.fromNode(`関数『${s}』呼び出しで引数の数(${i})が定義(${r})と違います。`,t);const u=this.stack.splice(o,r);let c=u;if(r>=2){c=[];t.meta.josi.forEach(((e,t)=>{for(let n=0;n<u.length;n++){const s=u[n];if(e.indexOf(s.josi)>=0)return void(c[t]=s)}const n=e.join(",");throw new Error(`助詞『${n}』が見当たりません。`)}))}return{type:"func",name:s,args:c,setter:!0,josi:"",...e,end:this.peekSourceMap()}}catch(e){throw this.logger.debug(`${this.nodeToStr(t,{depth:0},!0)}の関数呼び出しで引数(『←』以降)が読み取れません。`,t),n.ih.fromNode(`${this.nodeToStr(t,{depth:0},!1)}の関数呼び出しでエラーがあります。\n${e.message}`,t)}}yLet(){const e=this.peekSourceMap();if(this.check2(["word","eq"])){const t=this.peek();let s=!1;try{if(this.accept(["word","eq",this.yCalc])||this.accept(["word","eq",this.ySentence])){if("eol"===this.y[2].type)throw new Error("値が空です。");return this.check("comma")&&this.get(),{type:"let",name:this.y[0],value:this.y[2],...e,end:this.peekSourceMap()}}throw s=!0,this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に書き間違いがあります。`,t),n.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に書き間違いがあります。`,t)}catch(e){if(s)throw e;throw this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に以下の書き間違いがあります。\n${e.message}`,t),n.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に以下の書き間違いがあります。\n${e.message}`,t)}}if(this.check2(["word","@"])){const t=this.yLetArrayAt(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.check2(["word","["])){const t=this.yLetArrayBracket(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.accept(["word","とは"])){const t=this.y[0];if(!this.checkTypes(["変数","定数"]))throw n.ih.fromNode("ローカル変数『"+t.value+"』の定義エラー",t);const s=this.get();let r=null;return this.check("eq")&&(this.get(),r=this.yCalc()),this.check("comma")&&this.get(),{type:"def_local_var",name:t,vartype:s.type,value:r,...e,end:this.peekSourceMap()}}if(this.accept(["変数","word","eq",this.yCalc]))return{type:"def_local_var",name:this.y[1],vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()};if(this.accept(["定数","word","eq",this.yCalc]))return{type:"def_local_var",name:this.y[1],vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()};if(this.accept(["定数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw n.ih.fromNode("複数定数の代入文でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw n.ih.fromNode(`複数定数の代入文${e+1}番目でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return{type:"def_local_varlist",names:t.value,vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["変数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw n.ih.fromNode("複数変数の代入文でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw n.ih.fromNode(`複数変数の代入文${e+1}番目でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return{type:"def_local_varlist",names:t.value,vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.check2(["word","comma","word"])){if(this.accept(["word","comma","word","eq",this.yCalc]))return{type:"def_local_varlist",names:[this.y[0],this.y[2]],vartype:"変数",value:this.y[4],...e,end:this.peekSourceMap()};if(this.accept(["word","comma","word","comma","word","eq",this.yCalc]))return{type:"def_local_varlist",names:[this.y[0],this.y[2],this.y[4]],vartype:"変数",value:this.y[6],...e,end:this.peekSourceMap()};if(this.accept(["word","comma","word","comma","word","comma","word","eq",this.yCalc]))return{type:"def_local_varlist",names:[this.y[0],this.y[2],this.y[4],this.y[6]],vartype:"変数",value:this.y[8],...e,end:this.peekSourceMap()};if(this.accept(["word","comma","word","comma","word","comma","word","comma","word","eq",this.yCalc]))return{type:"def_local_varlist",names:[this.y[0],this.y[2],this.y[4],this.y[6],this.y[8]],vartype:"変数",value:this.y[10],...e,end:this.peekSourceMap()}}return null}checkArrayIndex(e){return 0==this.arrayIndexFrom?e:{...e,type:"op",operator:"-",left:e,right:{...e,type:"number",value:this.arrayIndexFrom}}}checkArrayReverse(e){return this.flagReverseArrayIndex?e.length<=1?e:e.reverse():e}yLetArrayAt(e){return this.accept(["word","@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:[this.checkArrayIndex(this.y[2])],value:this.y[4],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:null}yLetArrayBracket(e){return this.accept(["word","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:[this.checkArrayIndex(this.y[2])],value:this.y[5],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]),value:this.y[8],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[7],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5]),this.checkArrayIndex(this.y[8])]),value:this.y[11],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.y[0],index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[9],...e,end:this.peekSourceMap()}:null}yCalc(){const e=this.peekSourceMap();if(this.check("eol"))return null;const t=this.yGetArg();if(!t)return null;if(""===t.josi)return t;this.pushStack(t);const n=this.yCall();if("して"!==n.josi)return n;const s=this.yCalc();return s?{type:"renbun",left:n,right:s,josi:s.josi,...e,end:this.peekSourceMap()}:n}yValueKakko(){if(!this.check("("))return null;const e=this.get();this.saveStack();const t=this.yCalc()||this.ySentence();if(null===t){const t=this.get();throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),n.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e)}if(!this.check(")"))throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),n.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e);const s=this.get();return this.loadStack(),t.josi=s.josi,t}yValue(){const e=this.peekSourceMap();if(this.check("comma")&&this.get(),this.checkTypes(["number","string"]))return this.get();if(this.check("("))return this.yValueKakko();if(this.check2(["-","number"])||this.check2(["-","word"])||this.check2(["-","func"])){const t=this.get(),n=this.yValue(),s=n&&n.josi?n.josi:"";return{type:"op",operator:"*",left:{type:"number",value:-1,line:t.line},right:n,josi:s,...e,end:this.peekSourceMap()}}if(this.check("not")){this.get();const t=this.yValue();return{type:"not",value:t,josi:t&&t.josi?t.josi:"",...e,end:this.peekSourceMap()}}const t=this.yJSONArray();if(t)return t;const r=this.yJSONObject();if(r)return r;const o=s.concat(["eol",")","]","ならば","回","間","反復","条件分岐"]);if(this.check2(["func",o])){const t=this.get();return{type:"func",name:t.value,args:[],josi:t.josi,...e,end:this.peekSourceMap()}}if(this.check2([["func","word"],"("])&&""===this.peek().josi){const t=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"]))return{type:"func",name:this.y[0].value,args:this.y[2],josi:this.y[3].josi,...e,end:this.peekSourceMap()};throw n.ih.fromNode("C風関数呼び出しのエラー",t)}if(this.check2(["func","←"]))return this.yCallOp();if(this.check("def_func"))return this.yMumeiFunc();const i=this.yValueWord();return i||null}yValueWordGetIndex(e){if(this.check("@")){if(this.accept(["@",this.yValue,"comma",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index.push(this.checkArrayIndex(this.y[5])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[5].josi,!0;if(this.accept(["@",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[3].josi,!0;if(this.accept(["@",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[1].josi,!0;throw n.ih.fromNode("変数の後ろの『@要素』の指定が不正です。",e.name)}if(this.check("[")&&this.accept(["[",this.yCalc,"]"]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[2].josi,!0;if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3])];return e.index=this.checkArrayReverse(t),e.josi=this.y[4].josi,!0}if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3]),this.checkArrayIndex(this.y[5])];return e.index=this.checkArrayReverse(t),e.josi=this.y[6].josi,!0}return!1}yValueWord(){const e=this.peekSourceMap();if(this.check("word")){const t=this.get();if(this.skipRefArray)return t;if(""===t.josi&&this.checkTypes(["[","@"])){const s={type:"配列参照",name:t,index:[],josi:"",...e,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(s););if(0===s.index.length)throw n.ih.fromNode(`配列『${t.value}』アクセスで指定ミス`,t);return s}return t}return null}yJSONObjectValue(){const e=[],t=this.peek();for(;!this.isEOF();){for(;this.check("eol");)this.get();if(this.check("}"))break;if(this.accept(["word",":",this.yCalc]))this.y[0].type="string",e.push({key:this.y[0],value:this.y[2]});else if(this.accept(["string",":",this.yCalc]))e.push({key:this.y[0],value:this.y[2]});else if(this.check("word")){const t=this.get();t.type="string",e.push({key:t,value:t})}else{if(!this.checkTypes(["string","number"]))throw n.ih.fromNode("辞書オブジェクトの宣言で末尾の『}』がありません。",t);{const t=this.get();e.push({key:t,value:t})}}this.check("comma")&&this.get()}return e}yJSONObject(){const e=this.peekSourceMap();if(this.accept(["{","}"]))return{type:"json_obj",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue,"}"]))return{type:"json_obj",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue]))throw n.ih.fromNode("辞書型変数の初期化が『}』で閉じられていません。",this.y[1]);return null}yJSONArrayValue(){this.check("eol")&&this.get();const e=this.yCalc();if(null===e)return null;this.check("comma")&&this.get();const t=[e];for(;!this.isEOF()&&(this.check("eol")&&this.get(),!this.check("]"));){const e=this.yCalc();if(null===e)break;this.check("comma")&&this.get(),t.push(e)}return t}yJSONArray(){const e=this.peekSourceMap();if(this.accept(["[","]"]))return{type:"json_array",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue,"]"]))return{type:"json_array",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue]))throw n.ih.fromNode("配列変数の初期化が『]』で閉じられていません。",this.y[1]);return null}yTryExcept(){const e=this.peekSourceMap();if(!this.check("エラー監視"))return null;const t=this.get(),s=this.yBlock();if(!this.check2(["エラー","ならば"]))throw n.ih.fromNode("エラー構文で『エラーならば』がありません。『エラー監視..エラーならば..ここまで』を対で記述します。",t);this.get(),this.get();const r=this.yBlock();if(!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『エラー監視』...『エラーならば』...『ここまで』を対応させてください。",e);return this.get(),{type:"try_except",block:s,errBlock:r,josi:"",...e,end:this.peekSourceMap()}}}var o=__webpack_require__(8497),i=__webpack_require__(4159);const u=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,c=/^[ぁ-ん]/,a=/^[ぁ-ん]+$/,f=/^.+(以上|以下|超|未満)$/,l=e=>function(){throw new Error("突然の『"+e+"』があります。")},h=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|px|dot|pt|em|b|mb|kb|gb)/,p=[{name:"ここまで",pattern:/^;;;/},{name:"eol",pattern:/^\n/},{name:"eol",pattern:/^;/},{name:"space",pattern:/^(\x20|\x09|・)+/},{name:"comma",pattern:/^,/},{name:"line_comment",pattern:/^#[^\n]*/},{name:"line_comment",pattern:/^\/\/[^\n]*/},{name:"range_comment",pattern:/^\/\*/,cbParser:function(e){let t="";let n=0;const s=(e=e.substr(2)).indexOf("*/");s<0?(t=e,e=""):(t=e.substr(0,s),e=e.substr(s+2));for(let e=0;e<t.length;e++)"\n"===t.charAt(e)&&n++;return t=t.replace(/(^\s+|\s+$)/,""),{src:e,res:t,josi:"",numEOL:n}}},{name:"def_test",pattern:/^●テスト:/},{name:"def_func",pattern:/^●/},{name:"number",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/,readJosi:!0,cb:_},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:_},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:_},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:_},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:_},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:_},{name:"ここから",pattern:/^(ここから),?/},{name:"ここまで",pattern:/^(ここまで|💧)/},{name:"もし",pattern:/^もしも?/},{name:"違えば",pattern:/^違(えば)?/},{name:"shift_r0",pattern:/^>>>/},{name:"shift_r",pattern:/^>>/},{name:"shift_l",pattern:/^<</},{name:"===",pattern:/^===/},{name:"!==",pattern:/^!==/},{name:"gteq",pattern:/^(≧|>=|=>)/},{name:"lteq",pattern:/^(≦|<=|=<)/},{name:"noteq",pattern:/^(≠|<>|!=)/},{name:"←",pattern:/^(←|<--)/},{name:"eq",pattern:/^(=|🟰)/},{name:"line_comment",pattern:/^(!|💡)(インデント構文|ここまでだるい)[^\n]*/},{name:"not",pattern:/^(!|💡)/},{name:"gt",pattern:/^>/},{name:"lt",pattern:/^</},{name:"and",pattern:/^(かつ|&&)/},{name:"or",pattern:/^(または|或いは|あるいは|\|\|)/},{name:"@",pattern:/^@/},{name:"+",pattern:/^\+/},{name:"-",pattern:/^-/},{name:"*",pattern:/^(×|\*)/},{name:"÷÷",pattern:/^÷÷/},{name:"÷",pattern:/^(÷|\/)/},{name:"%",pattern:/^%/},{name:"^",pattern:/^\^/},{name:"&",pattern:/^&/},{name:"[",pattern:/^\[/},{name:"]",pattern:/^]/,readJosi:!0},{name:"(",pattern:/^\(/},{name:")",pattern:/^\)/,readJosi:!0},{name:"|",pattern:/^\|/},{name:"string",pattern:/^🌿/,cbParser:e=>d("🌿","🌿",e)},{name:"string_ex",pattern:/^🌴/,cbParser:e=>d("🌴","🌴",e)},{name:"string_ex",pattern:/^「/,cbParser:e=>d("「","」",e)},{name:"string",pattern:/^『/,cbParser:e=>d("『","』",e)},{name:"string_ex",pattern:/^“/,cbParser:e=>d("“","”",e)},{name:"string_ex",pattern:/^"/,cbParser:e=>d('"','"',e)},{name:"string",pattern:/^'/,cbParser:e=>d("'","'",e)},{name:"」",pattern:/^」/,cbParser:l("」")},{name:"』",pattern:/^』/,cbParser:l("』")},{name:"func",pattern:/^\{関数\},?/},{name:"{",pattern:/^\{/},{name:"}",pattern:/^\}/,readJosi:!0},{name:":",pattern:/^:/},{name:"_eol",pattern:/^_\s*\n/},{name:"dec_lineno",pattern:/^‰/},{name:"word",pattern:/^[\uD800-\uDBFF][\uDC00-\uDFFF][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^[\u1F60-\u1F6F][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^《.+?》/,readJosi:!0},{name:"word",pattern:/^[_a-zA-Z\u3005\u4E00-\u9FCFぁ-んァ-ヶ\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]/,cbParser:function(e,t=!0){let n="",s="";for(;""!==e;){if(n.length>0){const t=i.josiRE.exec(e);if(t){s=t[0].replace(/^\s+/,""),","===(e=e.substr(t[0].length)).charAt(0)&&(e=e.substr(1));break}}const t=u.exec(e);if(t){n+=t[0],e=e.substr(t[0].length);continue}if(!c.test(e))break;n+=e.charAt(0),e=e.substr(1)}/[ぁ-ん]間$/.test(n)&&(e=n.charAt(n.length-1)+e,n=n.slice(0,-1));const r=f.exec(n);r&&(e=r[1]+s+e,s="",n=n.substr(0,n.length-r[1].length));i.removeJosiMap[s]&&(s="");t&&(n=function(e){if(!c.test(e))return e.replace(/[ぁ-ん]+/g,"");if(a.test(e))return e;return e.replace(/[ぁ-ん]+$/g,"")}(n));""===n&&""!==s&&(n=s,s="");return{src:e,res:n,josi:s,numEOL:0}}}];function d(e,t,n){let s="",r="",o=0;const u=(n=n.substr(e.length)).indexOf(t);if(u<0)s=n,n="";else if(s=n.substr(0,u),n=n.substr(u+t.length),s.indexOf(e)>=0)throw"『"===e?new Error("「『」で始めた文字列の中に「『」を含めることはできません。"):new Error(`『${e}』で始めた文字列の中に『${e}』を含めることはできません。`);const c=i.josiRE.exec(n);c&&(r=c[0].replace(/^\s+/,""),","===(n=n.substr(c[0].length)).charAt(0)&&(n=n.substr(1))),i.removeJosiMap[r]&&(r="");for(let e=0;e<s.length;e++)"\n"===s.charAt(e)&&o++;return{src:n,res:s,josi:r,numEOL:o}}function _(e){return Number(e.replace(/_/g,""))}class y{constructor(e){this.logger=e,this.funclist={},this.result=[]}setFuncList(e){this.funclist=e}setInput(e,t,n){return this.tokenize(e,t,n)}setInput2(e,t){if(this.result=e,y.preDefineFunc(e,this.logger,this.funclist),this.replaceWord(this.result),t)if(this.result.length>0){const e=this.result[this.result.length-1];this.result.push({type:"eol",line:e.line,column:0,file:e.file,josi:"",value:"---",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""}),this.result.push({type:"eof",line:e.line,column:0,file:e.file,josi:"",value:"",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""})}else this.result.push({type:"eol",line:0,column:0,file:"",josi:"",value:"---",startOffset:0,endOffset:0,rawJosi:""}),this.result.push({type:"eof",line:0,column:0,file:"",josi:"",value:"",startOffset:0,endOffset:0,rawJosi:""});return this.result}static preDefineFunc(e,t,n){let s=0,r=!1;const i=()=>{const t=[],n={};if("("!==e[s].type)return[];for(s++;e[s];){const o=e[s];if(s++,")"===o.type)break;"func"===o.type?r=!0:"|"!==o.type&&"comma"!==o.type&&(r&&(o.funcPointer=!0,r=!1),t.push(o),n[o.value]||(n[o.value]=[]),n[o.value].push(o.josi))}const o=[],i=[],u=[],c={};for(const e of t)if(!c[e.value]){const t=n[e.value];u.push(t),o.push(e.value),e.funcPointer?i.push(e.value):i.push(null),c[e.value]=!0}return[u,o,i]};for(;s<e.length;){const r=e[s];if("word"===r.type&&"には"===r.josi||"word"===r.type&&"は~"===r.josi){r.josi="には",e.splice(s+1,0,{type:"def_func",value:"関数",line:r.line,column:r.column,file:r.file,josi:"",startOffset:r.endOffset,endOffset:r.endOffset,rawJosi:"",tag:"無名関数"}),s++;continue}if("word"===r.type&&""===r.josi&&r.value.length>=2&&r.value.match(/回$/)&&(r.value=r.value.substr(0,r.value.length-1),e.splice(s+1,0,{type:"回",value:"回",line:r.line,column:r.column,file:r.file,josi:"",startOffset:r.endOffset-1,endOffset:r.endOffset,rawJosi:""}),r.endOffset--,s++),"word"===r.type&&o.default[r.value]&&(r.type=o.default[r.value],"そう"===r.value&&(r.value="それ")),"def_test"!==r.type&&"def_func"!==r.type){s++;continue}let u=!0,c={type:"eol"};s>=1&&(c=e[s-1]),"eol"===c.type&&(u=!1);const a=r;s++;let f=[],l=[],h=[],p="";e[s]&&"("===e[s].type&&([f,l,h]=i()),!u&&e[s]&&"word"===e[s].type&&(p=e[s++].value),0===f.length&&e[s]&&"("===e[s].type&&([f,l,h]=i()),""!==p&&(p in n&&t.warn(`関数『${p}』は既に定義されています。`,a),n[p]={type:"func",josi:f,fn:null,asyncFn:!1,varnames:l,funcPointers:h}),a.meta={josi:f,varnames:l,funcPointers:h}}}splitStringEx(e){const t=[],n=e.split(/[{{]/);t.push(n[0]);for(const e of n.slice(1)){const n=e.replace("}","}").indexOf("}");if(-1===n)return null;t.push(e.slice(0,n),e.slice(n+1))}return t}replaceWord(t){let n=[],s=0;for(;s<t.length;){const r=t[s];if("word"===r.type&&"それ"!==r.value){const e=this.funclist[r.value];if(e&&"func"===e.type){r.type="func",r.meta=e;continue}}if("-"===r.type&&t[s+1]&&"number"===t[s+1].type){const n=s<=0?"eol":t[s-1].type;("eol"===n||e[n]||""!==t[s-1].josi)&&(t.splice(s,1),t[s].value*=-1)}if(void 0===r.josi&&(r.josi=""),"は"!==r.josi)if("とは"!==r.josi)if(i.tararebaMap[r.josi]){const e="でなければ"===r.josi||"なければ"===r.josi?"でなければ":"ならば",n=null===r.endOffset?null:r.endOffset-r.rawJosi.length;t.splice(s+1,0,{type:"ならば",value:e,line:r.line,column:r.column,file:r.file,startOffset:n,endOffset:r.endOffset,josi:"",rawJosi:""}),r.josi=r.rawJosi="",r.endOffset=n,s+=2}else"_eol"!==r.type?"line_comment"!==r.type&&"range_comment"!==r.type?("eol"===r.type&&(r.value=n.join("/"),n=[]),s++):(n.push(r.value),t.splice(s,1)):t.splice(s,1);else{const e=null===r.endOffset?null:r.endOffset-r.rawJosi.length;t.splice(s+1,0,{type:r.josi,line:r.line,column:r.column,file:r.file,startOffset:e,endOffset:r.endOffset,josi:"",rawJosi:"",value:void 0}),r.josi=r.rawJosi="",r.endOffset=e,s+=2}else{const e=null===r.endOffset?null:r.endOffset-r.rawJosi.length;t.splice(s+1,0,{type:"eq",line:r.line,column:r.column,file:r.file,startOffset:e,endOffset:r.endOffset,josi:"",rawJosi:"",value:void 0}),s+=2,r.josi=r.rawJosi="",r.endOffset=e}}}tokenize(e,t,s){const r=e.length,o=[];let u,c,a=1,f=!1;for(;""!==e;){let l=!1;for(const d of p){const p=d.pattern.exec(e);if(!p)continue;if(l=!0,"space"===d.name){a+=p[0].length,e=e.substr(p[0].length);continue}if(d.cbParser){let i;if(f&&"word"===d.name)i=d.cbParser(e,!1);else try{i=d.cbParser(e)}catch(o){throw new n.tO(o.message,r-e.length,r-e.length+1,t,s)}if("string_ex"===d.name){const u=this.splitStringEx(i.res);if(null===u)throw new n.cg("展開あり文字列で値の埋め込み{...}が対応していません。",r-e.length,r-i.src.length,t,s);let c=0;for(let n=0;n<u.length;n++){const f=n===u.length-1?i.josi:"";n%2==0?(o.push({type:"string",value:u[n],file:s,josi:f,line:t,column:a,preprocessedCodeOffset:r-e.length+c,preprocessedCodeLength:u[n].length+2+f.length}),c+=u[n].length+2):(o.push({type:"&",value:"&",josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c,preprocessedCodeLength:0}),o.push({type:"(",value:"(",josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c,preprocessedCodeLength:0}),o.push({type:"code",value:u[n],josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c,preprocessedCodeLength:u[n].length}),o.push({type:")",value:")",josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c+u[n].length,preprocessedCodeLength:0}),o.push({type:"&",value:"&",josi:"",file:s,line:t,column:a,preprocessedCodeOffset:r-e.length+c+u[n].length,preprocessedCodeLength:0}),c+=u[n].length)}t+=i.numEOL,a+=e.length-i.src.length,e=i.src,i.numEOL>0&&(a=1);break}u=a,a+=e.length-i.src.length,o.push({type:d.name,value:i.res,josi:i.josi,line:t,column:u,file:s,preprocessedCodeOffset:r-e.length,preprocessedCodeLength:e.length-i.src.length}),e=i.src,t+=i.numEOL,i.numEOL>0&&(a=1);break}const _=r-e.length;let y=p[0];if(d.cb&&(y=d.cb(y)),u=a,c=t,a+=p[0].length,e=e.substring(p[0].length),("eol"===d.name&&"\n"===y||"_eol"===d.name)&&(y=t++,a=1),"number"===d.name){const t=h.exec(e);t&&(e=e.substring(t[0].length),a+=p[0].length)}let m="";if(d.readJosi){const t=i.josiRE.exec(e);t&&(m=t[0].replace(/^\s+/,""),a+=t[0].length,","===(e=e.substring(t[0].length)).charAt(0)&&(e=e.substring(1)),i.removeJosiMap[m]&&(m=""))}switch(d.name){case"def_test":f=!0;break;case"eol":f=!1}if("dec_lineno"!==d.name){o.push({type:d.name,value:y,line:c,column:u,file:s,josi:m,preprocessedCodeOffset:_,preprocessedCodeLength:r-e.length-_});break}t--}if(!l)throw new n.cg("未知の語句: "+e.substr(0,3)+"...",r-e.length,r-r+3,t)}return o}}class m{constructor(e){this.history=[],this.code=e}getText(){return this.code}replaceAll(e,t){for(;;){const n=this.getText().indexOf(e);if(-1===n)break;e.length!==t.length&&this.history.unshift({index:n,from:e.length,to:t.length}),this.code=this.code.replace(e,t)}}getSourcePosition(e){for(const t of this.history)e>=t.index+t.to?e+=t.from-t.to:t.index<=e&&e<t.index+t.to&&(e=t.to>=2&&e===t.index+t.to-1?t.index+t.from-1:t.index);return e}}let g=null;class v{static getInstance(e){return null===g&&(g=new v(e)),g}constructor(e){null!==e&&(this.logger=e),this.HYPHENS={45:!0,8208:!0,8209:!0,8211:!0,8212:!0,8213:!0,8722:!0},this.TILDES={126:!0,732:!0,759:!0,8275:!0,8764:!0,12316:!0,65374:!0},this.SPACES={32:!0,8192:!0,8194:!0,8195:!0,8196:!0,8197:!0,8198:!0,8199:!0,8201:!0,8202:!0,8203:!0,8239:!0,8287:!0,12288:!0,12644:!0},this.convertTable={9:" ",8251:"#",12290:";",12304:"[",12305:"]",12289:",",65292:",",10006:"*",10133:"+",10134:"-",10135:"÷"}}convert1ch(e){if(!e)return"";const t=e.codePointAt(0);if(this.convertTable[t])return this.convertTable[t];if(t<127)return e;if(t>=65281&&t<=65374){const e=t-65248;return String.fromCodePoint(e)}return this.HYPHENS[t]?"-":this.TILDES[t]?"~":this.SPACES[t]?" ":e}convert(e){if(!e)return[];const t=new m(e);t.replaceAll("\r\n","\n"),t.replaceAll("\r","\n");let n=!1,s=!1,r="";const o=[];let i=0,u="",c=0;for(;c<t.getText().length;){const e=t.getText().charAt(c),a=t.getText().substr(c,2);if(n){if(e===r){n=!1,o.push({text:u+r,sourcePosition:t.getSourcePosition(i)}),c++,i=c;continue}u+=e,c++;continue}if(s){if(a===r){s=!1,o.push({text:u+r,sourcePosition:t.getSourcePosition(i)}),c+=2,i=c;continue}u+=e,c++;continue}if("「"===e){o.push({text:e,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r="」",u="";continue}if("『"===e){o.push({text:e,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r="』",u="";continue}if("“"===e){o.push({text:e,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r="”",u="";continue}if("🌴"===a||"🌿"===a){o.push({text:a,sourcePosition:t.getSourcePosition(i)}),c+=2,i=c,s=!0,r=a,u="";continue}const f=this.convert1ch(e);'"'!==f&&"'"!==f?"#"!==f?"//"!==a&&"//"!==a?"/*"!==a?(o.push({text:f,sourcePosition:t.getSourcePosition(i)}),c++,i=c):(o.push({text:a,sourcePosition:t.getSourcePosition(i)}),c+=2,i=c,s=!0,r="*/",u=""):(o.push({text:"//",sourcePosition:t.getSourcePosition(i)}),c+=2,i=c,n=!0,r="\n",u=""):(o.push({text:f,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r="\n",u=""):(o.push({text:f,sourcePosition:t.getSourcePosition(i)}),c++,i=c,n=!0,r=e,u="")}return(n||s)&&o.push({text:u+r,sourcePosition:t.getSourcePosition(i)}),o}}function b(e,t){const n=(e=(e=(e=e.substring(0,256)).replace(/(!|💡)/,"!")).replace(/\/\*.*?\*\//g,"")).split(/[;。\n]/,30);for(let e of n)if(e=e.replace(/^\s+/,"").replace(/\s+$/,""),t.indexOf(e)>=0)return!0;return!1}var k=__webpack_require__(5430),w=__webpack_require__(2015);const j=["!インデント構文","!ここまでだるい"];const S="🌟🌟改行🌟🌟s4j#WjcSb😀/FcX3🌟🌟";function $(e){const t=v.getInstance(null),n=e.length;let s="",r="",o=0,i=!1;for(;o<n;){const n=e.charAt(o),u=e.substr(o,2),c=t.convert1ch(n),a=u.split("").map((e=>t.convert1ch(e))).join("");if(""===r){switch(c){case'"':case"'":r=n,s+=n,o++;continue;case"「":r="」",s+=n,o++;continue;case"『":r="』",s+=n,o++;continue;case"“":r="”",s+=n,o++;continue;case"{":r="}",s+=n,o++;continue;case"[":r="]",s+=n,o++;continue}switch(u){case"🌴":r="🌴",s+=u,o+=2;continue;case"🌿":r="🌿",s+=u,o+=2;continue}"#"!==c?"//"!==a?"/*"!==a?(s+=n,o++):(r="*/",i=!0,o+=2):(r="\n",i=!0,o+=2):(r="\n",i=!0,o++)}else r===(1===r.length?c:a)?(i||(s+=e.substr(o,r.length)),o+=r.length,i=!1,r=""):(i||(s+=n),o++)}return s}function x(e){let t="";for(let n=0;n<e;n++)t+=" ";return t}function O(e){return/^([  ・\t]*)/.exec($(e))[1]}function A(e){let t=0;for(let n=0;n<e.length;n++){const s=e.charAt(n);if(" "!==s)if(" "!==s)if("・"!==s){if("\t"!==s)break;t+=4}else t+=2;else t+=2;else t++}return t}function M(e){const t=v.getInstance(null),n=e.length;let s="",r="",o=0;for(;o<n;){const n=e.charAt(o),i=e.substr(o,2),u=t.convert1ch(n),c=i.split("").map((e=>t.convert1ch(e))).join("");if(""===r){switch(u){case'"':case"'":r=n,s+=n,o++;continue;case"「":r="」",s+=n,o++;continue;case"『":r="』",s+=n,o++;continue;case"“":r="”",s+=n,o++;continue;case"{":r="}",s+=n,o++;continue;case"[":r="]",s+=n,o++;continue}switch(i){case"🌴":r="🌴",s+=i,o+=2;continue;case"🌿":r="🌿",s+=i,o+=2;continue}"#"!==u?"//"!==c?"/*"!==c?(s+=n,o++):(r="*/",s+=i,o+=2):(r="\n",s+=i,o+=2):(r="\n",s+=n,o++)}else r===(1===r.length?u:c)?(s+=e.substr(o,r.length),o+=r.length,r=""):(s+="\n"===n?S:n,o++)}return s}var C={convert:function(e,t){return b(e,j)?function(e,t){const s=[],r=[],o="ここまで‰",i=M(e).split("\n"),u=[],c=[];let a=0,f=-1;i.forEach((e=>{if(f+=e.split(S).length,/^[  ・\t]*$/.test(e))return void r.push({lineNumber:u.length,len:e.length});const i=$(e).replace(/^[  ・\t]+/,"").replace(/\s+$/,"");if(""===i)return void u.push(e);if("ここまで"===i)throw new n.t5("インデント構文が有効化されているときに『ここまで』を使うことはできません。",f,t);const l=A(e);if(a!==l){if(a<l)return c.push(a),a=l,void u.push(e);if(a>l)for(a=l;c.length>0;){const t=c.pop();if(t===l)return"違えば"!==i.substring(0,3)&&(s.push(u.length),u.push(x(t)+o)),void u.push(e);l<t&&(s.push(u.length),u.push(x(t)+o))}}else u.push(e)}));for(;c.length>0;){const e=c.pop();s.push(u.length),u.push(x(e)+o)}const l=[];for(let e=0;e<u.length;e++)if(u[e].includes(S)){const t=u[e].split(S);for(let e=0;e<s.length;e++)l.length<s[e]&&(s[e]+=t.length-1);for(let e=0;e<r.length;e++)l.length<r[e].lineNumber&&(r[e].lineNumber+=t.length-1);l.push(...t)}else l.push(u[e]);return{code:l.join("\n"),insertedLines:s,deletedLines:r}}(e,t):{code:e,insertedLines:[],deletedLines:[]}},getBlockStructure:function(e){const t={lines:[],pairs:[],parents:[],spaces:[]},n=M(e).split("\n"),s=[];let r=0,o=A(n[0]);for(const e of n){const n=e.split(S).length,i=$(e),u=""===i.replace(/^[  ・\t]+/,"")?o:A(i);if(t.lines.push(...Array(n).fill(u)),t.spaces.push(...Array(n).fill(O(i))),o<u)s.push(r-1);else if(o>u){const e=s.pop();void 0!==e&&t.pairs.push([e,r])}const c=void 0!==s[s.length-1]?s[s.length-1]:null;t.parents.push(...Array(n).fill(c)),o=u,r+=n}for(const e of s)t.pairs.push([e,r]);return t},getIndent:O,countIndent:A,isIndentSyntaxEnabled:function(e){return b(e,j)}};const E=["!DNCLモード"];function L(e,t){if(!b(e=e.replace(/(\r\n|\r)/g,"\n"),E))return e;return F(e,t)}function T(e){let t="";for(let n=0;n<e;n++)t+=" ";return t}function F(e,t){e=function(e){const t=v.getInstance(null);let n="",s=!1,r="";for(let o=0;o<e.length;o++){let i=e.charAt(o),u=t.convert1ch(i);if(s){if(u===r){s=!1,r="",n+=u;continue}n+=i}else"「"!==u?'"'!==u?("{"===u&&(u="["),"}"===u&&(u="]"),"←"===u&&(u="="),"÷"===u&&(u="÷÷"),n+=u):(s=!0,r='"',n+=u):(s=!0,r="」",n+=u)}return n}(e);const n=e.split("\n");for(let e=0;e<n.length;e++){let s=n[e];n[e]=s.replace(/^(\s*[|\s]+)(.*$)/,((e,t,n)=>T(t.length)+n)),s=n[e];const r=s.replace(/^\s+/,"").replace(/\s+$/,"");"繰り返し,"!==r&&"繰り返し"!==r||(n[e]="後判定で繰り返し");const o=s.match(/^\s*を,?(.+)になるまで(繰り返す|実行する)/);if(o){n[e]=`ここまで、(${o[1]})になるまでの間`;continue}const i=s.match(/^もし(.+)を実行する(。|.)*/);if(i){const s=F(i[1],t);n[e]=`もし、${s};`;continue}const u=s.match(/^(.+?)のすべての(要素|値)(を|に)(.+?)(にする|を代入)/);if(u){const t=u[1],s=u[4];n[e]=`${t} = [${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s}]`}else;}e=n.join("\n");const s={"を実行する":"ここまで","を実行し,そうでなくもし":"違えば、もし","を実行し,そうでなくもし":"違えば、もし","を実行し、そうでなくもし":"違えば、もし","を実行し,そうでなければ":"違えば","を実行し,そうでなければ":"違えば","を実行し、そうでなければ":"違えば","を繰り返す":"ここまで","改行なしで表示":"連続無改行表示","ずつ増やしながら":"ずつ増やし繰り返す","ずつ減らしながら":"ずつ減らし繰り返す","二進で表示":"二進表示","でないならば":"でなければ"};let r=()=>{let t=e.charAt(0);return e=e.substring(1),t},o=!1,i="",u="",c="";for(;""!=e;){const t=e.charAt(0);if(o){if(t===u){c+=i+u,i="",o=!1,r();continue}i+=r();continue}if('"'==t){o=!0,u='"',i=r();continue}if("「"==t){o=!0,u="」",i=r();continue}if("『"==t){o=!0,u="』",i=r();continue}if(" "===t||" "===t||"\t"==t){c+=r();continue}const n=e.substring(0,3);if("を表示"!==n)if("を 表示"!==e.substring(0,4))if("乱数"!==e.substring(0,2)||"乱数範囲"===e.substring(0,4)){"増やす"!==n&&"減らす"!==n||("だけ"!==c.substring(c.length-2)&&(c+="だけ"),c+=n,e=e.substring(3));{let t=!1;for(let n in s){if(e.substring(0,n.length)===n){c+=s[n],e=e.substring(n.length),t=!0;break}}if(t)continue}c+=r()}else c+="乱数範囲",e=e.substring(2);else c+="を連続表示",e=e.substring(4);else c+="を連続表示",e=e.substring(3)}return c}var N=__webpack_require__(9218),I={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){}},SIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sin(e)}},COS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.cos(e)}},TAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.tan(e)}},ARCSIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.asin(e)}},ARCCOS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.acos(e)}},ARCTAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.atan(e)}},ATAN2:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.atan2(e,t)}},"座標角度計算":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 180*Math.atan2(e[1],e[0])/Math.PI}},RAD2DEG:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},DEG2RAD:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},"度変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},"ラジアン変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},SIGN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 0===parseFloat(e)?0:e>0?1:-1}},"符号":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("SIGN",[e])}},ABS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},"絶対値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},EXP:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.exp(e)}},HYPOT:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},"斜辺":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},LN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOG:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOGN:{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return 2===e?Math.LOG2E*Math.log(t):10===e?Math.LOG10E*Math.log(t):Math.log(t)/Math.log(e)}},FRAC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"小数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"整数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.trunc(e)}},"乱数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.floor(Math.random()*e)}},"乱数範囲":{type:"func",josi:[["から"],["までの","の"]],pure:!0,fn:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},SQRT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},"平方根":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},ROUND:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.round(e)}},"四捨五入":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return Math.round(e)}},"小数点切上":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.ceil(e*n)/n}},"小数点切下":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.floor(e*n)/n}},"小数点四捨五入":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}},CEIL:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},"切上":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},FLOOR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}},"切捨":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}}},P={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){null==e.__promise&&(e.__promise={setLastPromise:function(t){return e.__v0["そ"]=t,t}})}},"そ":{type:"const",value:""},"動時":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){return t.__promise.setLastPromise(new Promise(((t,n)=>e(t,n))))},return_none:!1},"成功時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"処理時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(!0,t,n))),(t=>(n.__v0["対象"]=t,e(!1,t,n)))))},return_none:!1},"失敗時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.catch((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"終了時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.finally((()=>e())))},return_none:!1},"束":{type:"func",josi:[["と","を"]],pure:!0,fn:function(...e){return e.pop().__promise.setLastPromise(Promise.all(e))},return_none:!1}},D={"ASSERT等":{type:"func",josi:[["と"],["が"]],pure:!0,fn:function(e,t,n){if(e!==t)throw new Error(`不一致 [実際]${e} [期待]${t}`);return!0}},"テスト実行":{type:"func",josi:[["と"],["で"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}},"テスト等":{type:"func",josi:[["と"],["が"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}}};class J{constructor(e,t){this.sourceCodeLength=e,this.preprocessed=t;let n=0;this.cumulativeSum=[];for(const e of t)this.cumulativeSum.push(n),n+=e.text.length;this.lastIndex=0,this.lastPreprocessedCodePosition=0}map(e){const t=this.findIndex(e);return Math.min(this.preprocessed[t].sourcePosition+(e-this.cumulativeSum[t]),t===this.preprocessed.length-1?this.sourceCodeLength:this.preprocessed[t+1].sourcePosition-1)}findIndex(e){e<this.lastPreprocessedCodePosition&&(this.lastIndex=0),this.lastPreprocessedCodePosition=e;for(let t=this.lastIndex;t<this.preprocessed.length-1;t++)if(e<this.cumulativeSum[t+1])return this.lastIndex=t,t;return this.lastIndex=this.preprocessed.length-1,this.preprocessed.length-1}}class R{constructor(e,t,n){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=n;let s=0;for(const t of e.split("\n"))this.lines.push({offset:s,len:t.length}),s+=t.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){if(null===e)return{startOffset:e,endOffset:t};const n=this.getLineNumber(e);for(const s of this.linesInsertedByIndentationSyntax){if(n===s){e=null,t=null;break}n>s&&(e-=this.lines[s].len+1,null!==t&&(t-=this.lines[s].len+1))}for(const s of this.linesDeletedByIndentationSyntax)n>=s.lineNumber&&(null!==e&&(e+=s.len+1),null!==t&&(t+=s.len+1));return{startOffset:e,endOffset:t}}getLineNumber(e){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let t=this.lastLineNumber;t<this.lines.length-1;t++)if(e<this.lines[t+1].offset)return this.lastLineNumber=t,t;return this.lastLineNumber=this.lines.length-1,this.lines.length-1}}class G{constructor(e){this.lineOffsets=[];let t=0;for(const n of e.split("\n"))this.lineOffsets.push(t),t+=n.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let n=this.lastLineNumber;n<this.lineOffsets.length-1;n++)if(e<this.lineOffsets[n+1])return this.lastLineNumber=n,{line:n+(t?1:0),column:e-this.lineOffsets[n]};return this.lastLineNumber=this.lineOffsets.length-1,{line:this.lineOffsets.length-1+(t?1:0),column:e-this.lineOffsets[this.lineOffsets.length-1]}}}function q(e,t){if("number"==typeof e.startOffset&&(e.startOffset-=t.length),"number"==typeof e.endOffset&&(e.endOffset-=t.length),""!==t){const n=t.split("\n");"number"==typeof e.line&&(e.line-=n.length-1),0===e.line&&"number"==typeof e.column&&(e.column-=n[n.length-1].length)}return e}const V=["black","red","green","yellow","blue","magenta","cyan","white"],B=e=>{const t=e.replace(/\x1b\[\d+m/g,""),n=[];let s="inherit",r="inherit";const o=e===t?t:e.replace(/\x1b\[(\d+)m/g,((e,t)=>{const o=+t;return 0===o&&(s="inherit",r="inherit"),1===o&&(r="bold"),o>=30&&o<=37&&(s=V[o-30]),n.push(`color: ${s}; font-weight: ${r};`),"%c"}));let i="inherit",u="inherit";var c;return{noColor:t,nodeConsole:e===t?t:e+"",html:e===t?t:"<span>"+(c=e,c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")).replace(/\x1b\[(\d+)m/g,((e,t)=>{const n=+t;return 0===n&&(i="inherit",u="inherit"),1===n&&(u="bold"),n>=30&&n<=37&&(i=V[n-30]),`</span><span style="color: ${i}; font-weight: ${u};">`}))+"</span>",browserConsole:[o,...n]}},H={reset:"",bold:"",black:"",red:"",green:"",yellow:"",blue:"",magenta:"",cyan:"",white:""},U=e=>e?`${e.file||""}${void 0===e.line?"":`(${e.line+1}行目): `}`:"",W=["trace","debug","info","warn","error","stdout"];class z{constructor(){this.listeners=[]}addListener(e,t,n=!0){this.listeners.push({level:e,callback:t,includeHigherLevels:n})}removeListener(e){this.listeners=this.listeners.filter((t=>t.callback!==e))}trace(e,t=null){this.send("trace",`${H.bold}[デバッグ情報(詳細)]${H.reset}${U(t)}${e}`,t)}debug(e,t=null){this.send("debug",`${H.bold}[デバッグ情報]${H.reset}${U(t)}${e}`,t)}info(e,t=null){this.send("info",`${H.bold}${H.blue}[情報]${H.reset}${U(t)}${e}`,t)}warn(e,t=null){this.send("warn",`${H.bold}${H.green}[警告]${H.reset}${U(t)}${e}`,t)}error(e,t=null){e instanceof n.k?this.send("error",`${H.red}${e.tag}${H.reset}${e.positionJa}${e.msg}`,t||e):(e instanceof Error&&(e=e.message),this.send("error",`${H.bold}${H.red}[エラー]${H.reset}${U(t)}${e}`,t||e))}send(e,t,n,s,r){const o=B(t);let i="";t.includes("\n")&&(i+="border-top: 1px solid #8080806b; border-bottom: 1px solid #8080806b;");const u={noColor:o.noColor,nodeConsole:o.nodeConsole,browserConsole:r||o.browserConsole,html:`<div style="${i}">`+(s||o.html)+"</div>",level:e,position:n||{}};for(const t of this.listeners)t.includeHigherLevels?W.indexOf(t.level)<=W.indexOf(e)&&t.callback(u):t.level===e&&t.callback(u)}}class X{constructor(e,t){this.__locals={},this.__varslist=[{...e.__varslist[0]},{...e.__varslist[1]},{...e.__varslist[2]}],this.index=0,this.nextIndex=-1,this.__code=[],this.__callstack=[],this.__stack=[],this.__labels=[],this.__genMode=t.genMode,this.NakoRuntimeError=n.as,this.__module={...e.__module},this.pluginfiles={...e.pluginfiles},this.gen=t,this.logger=e.logger,this.compiler=e}clearLog(){this.__varslist[0]["表示ログ"]=""}get log(){let e=this.__varslist[0]["表示ログ"];return e=e.replace(/\s+$/,""),e}runEx(e,t,n,s=""){return this.compiler._runEx(e,t,n,s,this)}_runTests(e){let t=`${H.bold}テストの実行結果${H.reset}\n`,n=0,s=0;for(const r of e)try{r.f(),t+=`${H.green}✔${H.reset} ${r.name}\n`,n++}catch(e){t+=`${H.red}☓${H.reset} ${r.name}: ${e.message}\n`,s++}t+=s>0?`${H.green}成功 ${n}件 ${H.red}失敗 ${s}件`:`${H.green}成功 ${n}件`,this.numFailures=s,this.logger.send("stdout",t)}clearPlugins(){for(const e in this.pluginfiles){const t=this.__module[e];t["!クリア"]&&t["!クリア"].fn&&t["!クリア"].fn(this)}}reset(){this.clearPlugins()}destroy(){this.reset()}}const Y=e=>JSON.parse(JSON.stringify(e));class K{constructor(e){void 0===e&&(e={useBasicPlugin:!0}),this.silent=!0,this.filename="inline",this.options=e,this.__varslist=[{},{},{}],this.__locals={},this.__self=this,this.__vars=this.__varslist[2],this.__globals=[],this.__module={},this.pluginFunclist={},this.funclist={},this.pluginfiles={},this.isSetter=!1,this.commandlist=new Set,this.nako_func={},this.logger=new z,this.prepare=v.getInstance(this.logger),this.parser=new r(this.logger),this.lexer=new y(this.logger),this.dependencies={},this.usedFuncs=new Set,this.setFunc=this.addFunc,this.numFailures=0,e.useBasicPlugin&&this.addBasicPlugins()}addBasicPlugins(){this.addPluginObject("PluginSystem",N.Z),this.addPluginObject("PluginMath",I),this.addPluginObject("PluginPromise",P),this.addPluginObject("PluginAssert",D)}replaceLogger(){return this.prepare.logger=this.lexer.logger=this.parser.logger=this.logger=new z}static listRequireStatements(e){const t=[];for(let n=0;n+2<e.length;n++)"not"!==e[n].type||"string"!==e[n+1].type&&"string_ex"!==e[n+1].type||"取込"!==e[n+2].value||(t.push({start:n,end:n+3,value:e[n+1].value+"",firstToken:e[n],lastToken:e[n+2]}),n+=2);return t}_loadDependencies(e,t,s,r){const o={},i=new K({useBasicPlugin:!0}),u=(e,t,s)=>{const c=[],a=K.listRequireStatements(i.rawtokenize(e,0,t,s)).map((e=>({...e,...r.resolvePath(e.value,e.firstToken)})));for(const e of a)if(o.hasOwnProperty(e.filePath))o[e.filePath].alias.add(e.value);else if(o[e.filePath]={tokens:[],alias:new Set([e.value]),addPluginFile:()=>{},funclist:{}},"js"===e.type||"mjs"===e.type){const t=r.readJs(e.filePath,e.firstToken);t.sync?o[e.filePath].addPluginFile=()=>{this.addPluginFile(e.value,e.filePath,o[e.filePath].funclist=t.value(),!1)}:c.push(t.value.then((t=>{o[e.filePath].addPluginFile=()=>{this.addPluginFile(e.value,e.filePath,o[e.filePath].funclist=t(),!1)}})))}else{if("nako3"!==e.type)throw new n.l0(`ファイル『${e.value}』を読み込めません。ファイルが存在しないか未対応の拡張子です。`,e.firstToken.file,e.firstToken.line);{const t=r.readNako3(e.filePath,e.firstToken),n=t=>{t=`『${e.filePath}』にプラグイン名設定;`+t+";『メイン』にプラグイン名設定;";const n=this.rawtokenize(t,0,e.filePath);o[e.filePath].tokens=n;const s={};return y.preDefineFunc(Y(n),this.logger,s),o[e.filePath].funclist=s,u(t,e.filePath,"")};t.sync?n(t.value):c.push(t.value.then((e=>n(e))))}}if(c.length>0)return Promise.all(c)};try{const n=u(e,t,s);return void 0!==n&&n.catch((e=>{this.logger.warn(e.msg)})),this.dependencies=o,n}catch(e){throw this.logger.warn(e.msg),e}}rawtokenize(e,t,s,r=""){if(!e.startsWith(r))throw new Error("codeの先頭にはpreCodeを含める必要があります。");const{code:o,insertedLines:i,deletedLines:u}=C.convert(e,s),c=L(o,s),a=this.prepare.convert(c),f=new J(o.length,a),l=new R(o,i,u),h=new G(e);let p;try{p=this.lexer.setInput(a.map((e=>e.text)).join(""),t,s)}catch(e){if(!(e instanceof n.cg))throw e;const t=l.map(f.map(e.preprocessedCodeStartOffset),f.map(e.preprocessedCodeEndOffset)),o=null===t.startOffset?e.line:h.map(t.startOffset,!1).line,i=q({...t,line:o},r);throw new n.tO(e.msg,i.startOffset,i.endOffset,i.line,s)}return p.map(((e,t)=>{const n=l.map(f.map(e.preprocessedCodeOffset),f.map(e.preprocessedCodeOffset+e.preprocessedCodeLength));let s=e.line,o=0;if("eol"===e.type&&null!==n.endOffset){const e=h.map(n.endOffset,!1);s=e.line,o=e.column}else if(null!==n.startOffset){const e=h.map(n.startOffset,!1);s=e.line,o=e.column}return{...e,...q({line:s,column:o,startOffset:n.startOffset,endOffset:n.endOffset},r),rawJosi:e.josi}}))}converttoken(e,t){return this.lexer.setInput2(e,t)}reset(){this.__varslist=[this.__varslist[0],{},{}],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.__vars=this.__varslist[2],this.__locals={},this.funclist={};for(const e of Object.keys(this.__v0)){const t=this.pluginFunclist[e];t&&(this.funclist[e]=JSON.parse(JSON.stringify(t)))}this.lexer.setFuncList(this.funclist)}lexCodeToken(e,t,n,s){let r=this.rawtokenize(e,t,n,"");if(null===s)for(const e of r)e.startOffset=null,e.endOffset=null;else for(const e of r)null!==e.startOffset&&(e.startOffset+=s),null!==e.endOffset&&(e.endOffset+=s);const o=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));return r=this.converttoken(r,!1),{tokens:r,commentTokens:o}}replaceRequireStatements(e,t=new Set){const s=[];for(const r of K.listRequireStatements(e).reverse()){if(t.has(r.value)){s.push(...e.splice(r.start,r.end-r.start));continue}const o=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(r.value)));if(void 0===o)throw new n.tO(`ファイル ${r.value} が読み込まれていません。`,r.firstToken.startOffset,r.firstToken.endOffset,r.firstToken.line,r.firstToken.file);this.dependencies[o].addPluginFile();const i=Y(this.dependencies[o].tokens);t.add(r.value),s.push(...this.replaceRequireStatements(i,t)),s.push(...e.splice(r.start,r.end-r.start,...i))}return s}removeRequireStatements(e){const t=[];for(const n of K.listRequireStatements(e).reverse()){const s=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(n.value)));void 0!==s&&this.dependencies[s].addPluginFile(),t.push(...e.splice(n.start,n.end-n.start))}return t}lex(e,t,n="",s=!1){let r=this.rawtokenize(e,0,t,n);const o=s?this.removeRequireStatements(r):this.replaceRequireStatements(r,void 0);for(const e of o)"word"!==e.type&&"not"!==e.type||(e.type="require");const i=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));r=this.converttoken(r,!0);for(let e=0;e<r.length;e++)if("code"===r[e].type){const n=this.lexCodeToken(r[e].value,r[e].line,t,r[e].startOffset);i.push(...n.commentTokens),r.splice(e,1,...n.tokens),e--}return this.logger.trace("--- lex ---\n"+JSON.stringify(r,null,2)),{commentTokens:i,tokens:r,requireTokens:o}}parse(e,t,s=""){this.lexer.setFuncList(this.funclist),this.parser.setFuncList(this.funclist);const r=this.lex(e,t,s);let o;try{this.parser.genMode="sync",o=this.parser.parse(r.tokens)}catch(e){if("number"!=typeof e.startOffset)throw n.ih.fromNode(e.message,r.tokens[this.parser.index]);throw e}return this.usedFuncs=this.getUsedFuncs(o),this.logger.trace("--- ast ---\n"+JSON.stringify(o,null,2)),o}getUsedFuncs(e){const t=[e];for(this.usedFuncs=new Set;t.length>0;){const e=t.pop();null!=e&&null!==e.block&&void 0!==e.block&&this.getUsedAndDefFuncs(t,JSON.parse(JSON.stringify(e.block)))}return this.deleteUnNakoFuncs()}getUsedAndDefFuncs(e,t){for(;t.length>0;){const n=t.pop();null!=n&&this.getUsedAndDefFunc(n,e,t)}}getUsedAndDefFunc(e,t,n){["func","func_pointer"].includes(e.type)&&null!==e.name&&void 0!==e.name&&this.usedFuncs.add(e.name),t.push.apply(t,[e,e.block]),n.push.apply(n,[e.value].concat(e.args))}deleteUnNakoFuncs(){for(const e of this.usedFuncs)this.commandlist.has(e)||this.usedFuncs.delete(e);return this.usedFuncs}compile(e,t,n,s=""){const r=this.parse(e,t,s);return this.generateCode(r,n,s).runtimeEnv}generateCode(e,t,n=""){switch(e.genMode){case"sync":return(0,k.I)(this,e,t);case"非同期モード":return w.g.generate(this,e,t);default:throw new Error(`コードジェネレータの「${e.genMode}」はサポートされていません。`)}}_run(e,t,n,s,r=""){const o={resetLog:n,testOnly:s};return this._runEx(e,t,o,r)}clearPlugins(){this.__globals.forEach((e=>{e.reset()}))}_runEx(e,t,s,r="",o){let i;try{const n=Object.assign({resetEnv:!0,testOnly:!1,resetAll:!0},s);n.resetEnv&&this.reset(),n.resetAll&&this.clearPlugins();const o=this.parse(e,t,r);i=this.generateCode(o,n.testOnly)}catch(e){throw this.logger.error(e),e}o=o||new X(this,i.gen),this.__globals.indexOf(o)<0&&this.__globals.push(o);try{return new Function(i.runtimeEnv).apply(o),o}catch(e){let t=e;throw e instanceof n.as||(t=new n.as(e,o.__varslist[0].line)),this.logger.error(t),t}}runEx(e,t,n,s=""){return this._runEx(e,t,n,s)}test(e,t,n="",s){return this._runEx(e,t,{testOnly:s||!0},n)}run(e,t,n=""){return this._runEx(e,t,{resetAll:!1},n)}runReset(e,t,n=""){return this._runEx(e,t,{resetAll:!0},n)}compileStandalone(e,t,n,s=""){const r=this.parse(e,t,s);return this.generateCode(r,n).standalone}addPlugin(e,t=!0){const n=this.__varslist[0];void 0===n.meta&&(n.meta={});for(const s in e){const r=e[s];if(this.funclist[s]=r,t&&(this.pluginFunclist[s]=JSON.parse(JSON.stringify(r))),"func"===r.type)n[s]=r.fn;else{if("const"!==r.type&&"var"!==r.type)throw console.error("[プラグイン追加エラー]",r),new Error("プラグインの追加でエラー。");n[s]=r.value,n.meta[s]={readonly:"const"===r.type}}"初期化"!==s&&"!"!==s.substring(0,1)&&this.commandlist.add(s)}}addPluginObject(e,t,n=!0){if(this.__module[e]=t,this.pluginfiles[e]="*","object"==typeof t["初期化"]){const n=t["初期化"];delete t["初期化"];t[`!${e}:初期化`]=n}if(t.meta&&t.meta.value&&"object"==typeof t.meta){const n=t.meta;delete t.meta;t[`__${n.value.pluginName||e}`.replace("-","__")]=n}this.addPlugin(t,n)}addPluginFile(e,t,n,s=!0){this.addPluginObject(e,n,s),void 0===this.pluginfiles[e]&&(this.pluginfiles[e]=t)}addFunc(e,t,n,s=!0,r=!1){this.funclist[e]={josi:t,fn:n,type:"func",return_none:s,asyncFn:r},this.pluginFunclist[e]=Y(this.funclist[e]),this.__varslist[0][e]=n}getFunc(e){return this.funclist[e]}}const Z=C.getBlockStructure,Q=C.getIndent,ee=C.countIndent,te=C.isIndentSyntaxEnabled;function ne(e,t,n,s,r){const o=function(e){switch(e.type){case"line_comment":return"comment.line";case"range_comment":return"comment.block";case"def_test":case"def_func":case"とは":case"ならば":case"でなければ":case"ここから":case"ここまで":case"もし":case"違えば":case"require":case"回":case"間":case"繰り返す":case"反復":case"抜ける":case"続ける":case"戻る":case"先に":case"次に":case"代入":case"逐次実行":case"条件分岐":case"取込":case"エラー監視":case"エラー":case"変数":case"実行速度優先":return"keyword.control";case"func":return"entity.name.function";case"number":return"constant.numeric";case"定める":case"定数":return"support.constant";case"shift_r0":case"shift_r":case"shift_l":case"gteq":case"lteq":case"noteq":case"eq":case"not":case"gt":case"lt":case"and":case"or":case"@":case"+":case"-":case"*":case"/":case"%":case"^":case"&":return"keyword.operator";case"string":case"string_ex":return"string.other";case"word":return["そう","それ","回数","対象キー","対象"].includes(e.value)?"variable.language":"variable.other";default:return"markup.other"}}(e),i=function(e,t){const n=e=>`<span class="tooltip-plugin-name">${oe(e)}</span>`;if("func"===e.type){const s=se(e.value+"",t)||(e.meta&&e.meta.file?e.meta.file:null),r=e.meta&&e.meta.josi?re(e.meta.josi):"";return s?oe(r+e.value)+n(s):oe(r+e.value)}if("word"===e.type){const s=se(e.value+"",t)||(e.meta&&e.meta.file?e.meta.file:null);if(s)return oe(e.value+"")+n(s)}return null}(e,t);return e.rawJosi&&n.length>=e.rawJosi.length&&s&&r?[{type:o,docHTML:i,value:n.slice(0,-e.rawJosi.length)},{type:o+".markup.underline",docHTML:i,value:n.slice(-e.josi.length)}]:[{type:o,docHTML:i,value:n}]}function se(e,t){for(const n of Object.keys(t.__module))if(Object.keys(t.__module[n]).includes(e))return n;return null}function re(e){const t=e.map(((e,t)=>e.map((e=>`${function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");return e.toString(26).split("").map((e=>t[parseInt(e,26)])).join("")}(t)}${e}`)).join("|"))).join("、");return""!==t?`(${t})`:""}function oe(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const ie=(e,t)=>[{type:"markup.other",value:t.getLine(e),docHTML:null}],ue=(e,t)=>{const n=e.logger;try{return e.replaceLogger(),t()}finally{e.logger=n}};function ce(e,t,n){const s=e.join("\n");t.reset();const r=ue(t,(()=>t.lex(s,"main.nako3",void 0,!0)));r.commentTokens=r.commentTokens.filter((e=>"main.nako3"===e.file)),r.requireTokens=r.requireTokens.filter((e=>"main.nako3"===e.file)),r.tokens=r.tokens.filter((e=>"main.nako3"===e.file));for(const[e,{funclist:n}]of Object.entries(t.dependencies))for(const t of r.tokens)"word"===t.type&&"それ"!==t.value&&n[t.value]&&(t.type="func",t.meta={...n[t.value+""],file:e});const o=[...r.tokens,...r.commentTokens,...r.requireTokens].filter((e=>"eol"!==e.type&&"eof"!==e.type&&"number"==typeof e.startOffset&&"number"==typeof e.endOffset&&e.startOffset<e.endOffset));o.sort(((e,t)=>(e.startOffset||0)-(t.startOffset||0)));let i=0,u=0;const c=[];for(let r=0;r<e.length;r++){c.push([]);const a=i+e[r].length;let f=i;for(;u<o.length&&o[u].endOffset<=i;)u++;if(u<o.length&&o[u].startOffset<=i&&o[u].endOffset>=a)c[r].push(...ne(o[u],t,e[r],o[u].endOffset<=a,n));else{for(u<o.length&&o[u].startOffset<=i&&(c[r].push(...ne(o[u],t,s.slice(f,o[u].endOffset),!0,n)),f=o[u].endOffset,u++);u<o.length&&o[u].endOffset<a;)f<o[u].startOffset&&(c[r].push({type:"markup.other",docHTML:null,value:s.slice(f,o[u].startOffset)}),f=o[u].startOffset),c[r].push(...ne(o[u],t,s.slice(f,o[u].endOffset),!0,n)),f=o[u].endOffset,u++;u<o.length&&o[u].startOffset<a?(f<o[u].startOffset&&(c[r].push({type:"markup.other",docHTML:null,value:s.slice(f,o[u].startOffset)}),f=o[u].startOffset),c[r].push(...ne(o[u],t,s.slice(o[u].startOffset,a),o[u].endOffset<=a,n))):c[r].push({type:"markup.other",docHTML:null,value:s.slice(f,a)})}i+=e[r].length+1}return{editorTokens:c,lexerOutput:r}}class ae{constructor(e,t,n,s){this.session=e,this.doc=t,this.AceRange=n,this.markers=[],this.hasAnnotations=!1,this.disable=s}static fromNullable(e,t,n,s,r){return null===t&&(t=0),null===n&&(n=e),null===s&&(s=r(n).length),e===n&&t===s&&s++,[e,t,n,s]}static fromOffset(e,t,n){const s=new G(e),r=s.map(t,!1),o=s.map(n,!1);return[r.line,r.column,o.line,o.column]}static fromError(e,t,n){return"number"==typeof t.startOffset&&"number"==typeof t.endOffset?this.fromOffset(e,t.startOffset,t.endOffset):"number"==typeof t.line?this.fromNullable(t.line,null,null,null,n):this.fromNullable(0,null,null,null,n)}add(e,t,n,s,r,o){if(this.disable)return;const i=new this.AceRange(...ae.fromNullable(e,t,n,s,(e=>this.doc.getLine(e))));this.markers.push(this.session.addMarker(i,"marker-"+("warn"===o?"yellow":"red"),"text",!1)),this.session.setAnnotations([{row:e,column:t,text:r,type:"warn"===o?"warning":"error"}]),this.hasAnnotations=!0}addByError(e,t,n){this.add(...ae.fromError(e,t,(e=>this.doc.getLine(e))),t.message,n)}clear(){for(const e of this.markers)this.session.removeMarker(e);this.markers.length=0,this.hasAnnotations&&(this.session.clearAnnotations(),this.hasAnnotations=!1)}}class fe{constructor(e,t,n,s,r){this.onUpdate=n,this.doc=e,this.dirty=!0,this.nako3=t,this.onCompileError=s,this.underlineJosi=r,this.lastLexerOutput=null,this.lines=this.doc.getAllLines().map((e=>[{type:"markup.other",value:e,docHTML:null}])),this.cache=null,this.deleted=!1,this.enabled=!0;const o=()=>{if(!this.deleted)if(this.dirty&&this.enabled){const e=Date.now();this.dirty=!1;const r=this.doc.getAllLines().join("\n");try{const e=Date.now(),s=ce(this.doc.getAllLines(),t,this.underlineJosi);this.lastLexerOutput=s.lexerOutput,this.lines=s.editorTokens,this.cache={code:r,lines:JSON.stringify(this.lines)},n(0,this.doc.getLength()-1,Date.now()-e)}catch(e){s(r,e)}setTimeout(o,Math.max(100,Math.min(5e3,5*(Date.now()-e))))}else setTimeout(o,100)};setTimeout((()=>{o()}),0)}dispose(){this.deleted=!0}$updateOnChange(e){this.dirty=!0;const t=e.start.row,n=e.end.row;if(t===n)if("insert"===e.action&&this.lines[t]){const n=e.start.column,s=this.lines[t].filter((e=>"composition_placeholder"!==e.type)),r=[];let o=0,i=0;for(;o<s.length&&i+s[o].value.length<=n;)r.push(s[o]),i+=s[o].value.length,o++;for(o<s.length&&i<n?(r.push({type:s[o].type,value:s[o].value.slice(0,n-i),docHTML:null}),r.push({type:"markup.other",value:e.lines[0],docHTML:null}),r.push({type:s[o].type,value:s[o].value.slice(n-i),docHTML:null}),o++):r.push({type:"markup.other",value:e.lines[0],docHTML:null});o<s.length;)r.push(s[o]),o++;this.lines[t]=r}else this.lines[t]=ie(t,this.doc);else"remove"===e.action?this.lines.splice(t,n-t+1,ie(t,this.doc)):this.lines.splice(t,1,...Array(n-t+1).fill(null).map(((e,n)=>ie(n+t,this.doc))))}getTokens(e){if(!this.lines[e]){let t=!1;if(this.enabled){const e=this.doc.getAllLines().join("\n");if(null!==this.cache&&this.cache.code===e)t=!0;else try{const n=ce(this.doc.getAllLines(),this.nako3,this.underlineJosi);this.cache={code:e,lines:JSON.stringify(n.editorTokens)},t=!0}catch(e){e instanceof n.k||console.error(e)}}t&&null!==this.cache?this.lines[e]=JSON.parse(this.cache.lines)[e]:this.lines[e]=ie(e,this.doc)}return this.lines[e]}start(e){}fireUpdateEvent(e,t){}setDocument(e){}scheduleStart(){}setTokenizer(e){}stop(){}getState(e){return"start"}}class le{constructor(e,t){this.AceRange=e,this.nako3=t}static toggleCommentLines(e,{doc:t},n,s){const r=v.getInstance(new z),o=e=>{const t=Q(e);if(t===e)return{type:"blank"};const n=(e=e.substring(t.length)).substring(0,2).split("").map((e=>r.convert1ch(e))).join("");return"#"===n.substring(0,1)?{type:"comment",start:t.length,len:1+(" "===e.charAt(1)?1:0)}:"//"===n?{type:"comment",start:t.length,len:2+(" "===e.charAt(2)?1:0)}:{type:"code"}},i=[];for(let e=n;e<=s;e++)i.push(e);if(!i.every((e=>"blank"===o(t.getLine(e)).type))&&i.every((e=>"code"!==o(t.getLine(e)).type)))for(const e of i){const n=o(t.getLine(e));"comment"===n.type&&t.removeInLine(e,n.start,n.start+n.len)}else{const e=Math.min(...i.map((e=>ee(t.getLine(e)))));for(const n of i){const s=t.getLine(n);let r=s.length;for(let t=0;t<s.length;t++)if(ee(s.slice(0,t))>=e){r=t;break}t.insertInLine({row:n,column:r},"// ")}}}static checkOutdent(e,t,n){return/^[  ・\t]*ここまで$/.test(t+n)}autoOutdent(e,{doc:t},n){if(0===n)return;const s=t.getLine(n-1);let r;if(le.isBlockStart(s))r=Q(s);else{const e=this.getBlockStructure(t.getAllLines().join("\n")),s=e.parents[n];r=null!==s?e.spaces[s]:""}const o=Q(t.getLine(n));t.replace(new this.AceRange(n,0,n,o.length),r)}static getNextLineIndent(e,t,n){return this.isBlockStart(t)?Q(t)+n:Q(t)}static isBlockStart(e){return/^[  ・\t]*●|(ならば|なければ|ここから|条件分岐|違えば|回|繰り返(す|し)|の間|反復|とは|には|エラー監視|エラーならば|実行速度優先)、?\s*$/.test(e)}static getCompletionItems(e,t,n,s){const r=new Map,o=new Set,i=(e,n,s)=>{const i=r.get(e);if(i)i.meta.add(s);else{const i=t.split("").filter((e=>n.includes(e))).length;r.set(e,{value:n,meta:new Set([s]),score:i}),o.add(n)}};for(const e of Object.keys(n.__varslist[0])){if(e.startsWith("!"))continue;const t=n.funclist[e];if("object"!=typeof t||null===t)continue;const s=se(e,n)||"プラグイン";"func"===t.type?i(re(t.josi)+e,e,s):i(e,e,s)}for(const[e,{funclist:t}]of Object.entries(n.dependencies))for(const[n,s]of Object.entries(t)){i((s&&"func"===s.type?re(s.josi):"")+n,n,e)}if(null!==s.lastLexerOutput)for(const t of s.lastLexerOutput.tokens){const s=t.value+"";if(t.line!==e&&!o.has(s))if("word"===t.type)i(s,s,"変数");else if("func"===t.type){const e=n.funclist[s];i((e&&"func"===e.type?re(e.josi):"")+s,s,"関数")}}return Array.from(r.entries()).map((([e,t])=>({caption:e,...t,meta:Array.from(t.meta).join(", ")})))}static getSnippets(e){const t=te(e),n=(e,n,s)=>t?{caption:e,meta:`⇥ ${n}`,score:1,snippet:s.replace(/\t*ここまで(\n|$)/g,"").replace(/\t/g," ")}:{caption:e,meta:`⇥ ${n}`,score:1,snippet:s.replace(/\t/g," ")};return[n("if","もし〜ならば","もし${1:1=1}ならば\n\t${2:1を表示}\n違えば\n\t${3:2を表示}\nここまで\n"),n("times","〜回","${1:3}回\n\t${2:1を表示}\nここまで\n"),n("for","繰り返す","${1:N}で${2:1}から${3:3}まで繰り返す\n\t${4:Nを表示}\nここまで\n"),n("while","〜の間","${1:N<2の間}\n\tN=N+1\nここまで\n"),n("foreach","〜を反復","${1:[1,2,3]}を反復\n\t${2:対象を表示}\nここまで\n"),n("switch","〜で条件分岐","${1:N}で条件分岐\n\t${2:1}ならば\n\t\t${3:1を表示}\n\tここまで\n\t${4:2}ならば\n\t\t${5:2を表示}\n\tここまで\n\t違えば\n\t\t${6:3を表示}\n\tここまで\nここまで\n"),n("function","●〜とは","●(${1:AとBを})${2:足す}とは\n\t${3:A+Bを戻す}\nここまで\n"),n("test","●テスト:〜とは","●テスト:${2:足す}とは\n\t1と2を足す\n\tそれと3がASSERT等しい\nここまで\n"),n("try","エラー監視","エラー監視\n\t${1:1のエラー発生}\nエラーならば\n\t${2:2を表示}\nここまで\n")]}static getCompletionPrefix(e,t){let s=null;if(0===e.length||!/[ぁ-んa-zA-Zァ-ヶー\u3005\u4E00-\u9FCF]/.test(e[e.length-1]))return"";try{t.reset(),s=ue(t,(()=>t.lex(e,"completion.nako3",void 0,!0))).tokens.filter((e=>"eol"!==e.type&&"eof"!==e.type))}catch(e){e instanceof n.k||console.error(e)}if(null===s||0===s.length||!s[s.length-1].value)return"";const r=s[s.length-1].value+"";return/[ぁ-ん]/.test(r[r.length-1])&&!/[ぁ-ん]/.test(r[0])?"":r}getFoldWidget({doc:e},t,n){return le.isBlockStart(e.getLine(n))?"start":""}getFoldWidgetRange({doc:e},t,n){const s=this.getBlockStructure(e.getAllLines().join("\n")).pairs.find((e=>e[0]===n));return void 0!==s?new this.AceRange(s[0],e.getLine(s[0]).length,s[1]-1,e.getLine(s[1]-1).length):null}static getCodeLens(e){const t=[];for(const[n,s]of Array.from(e.getAllLines().entries())){const e=/^[  ・\t]*●テスト:(.+?)(?:とは|$)/.exec(s);null!==e&&t.push({start:{row:n},command:{title:"テストを実行",id:"runTest",arguments:[e[1]]}})}return t}getBlockStructure(e){return this.blockStructure&&this.blockStructure.code===e||(this.blockStructure={code:e,data:Z(e)}),this.blockStructure.data}}class he{constructor(e,t,n){this.editor=e,this.AceRange=t,this.UndoManager=n}newTab(e){return{content:e,cursor:{range:new this.AceRange(0,0,0,0),reversed:!1},scroll:{left:0,top:0},undoManger:new this.UndoManager}}getTab(){return{content:this.editor.getValue(),cursor:{range:this.editor.session.selection.getRange(),reversed:this.editor.session.selection.isBackwards()},scroll:{left:this.editor.session.getScrollLeft(),top:this.editor.session.getScrollTop()},undoManger:this.editor.session.getUndoManager()}}setTab(e){this.editor.setValue(e.content),this.editor.session.selection.setRange(e.cursor.range,e.cursor.reversed),this.editor.session.setScrollLeft(e.scroll.left),this.editor.session.setScrollTop(e.scroll.top),this.editor.session.setUndoManager(e.undoManger)}}class pe{static save(e){try{const t={};for(const n of["syntaxHighlighting","keyboardHandler","theme","fontSize","wrap","useSoftTabs","tabSize","showInvisibles","enableLiveAutocompletion","indentedSoftWrap","underlineJosi"])t[n]=e.getOption(n);localStorage.setItem("nako3EditorOptions",JSON.stringify(t))}catch(e){return console.error(e),null}}static load(e){try{if(!window.localStorage)return null;const t=window.localStorage.getItem("nako3EditorOptions");if(null===t)return null;const n=JSON.parse(t);["ace/keyboard/vscode","ace/keyboard/emacs","ace/keyboard/sublime","ace/keyboard/vim"].includes(n.keyboardHandler)&&e.setOption("keyboardHandler",n.keyboardHandler),["ace/theme/xcode","ace/theme/monokai"].includes(n.theme)&&e.setOption("theme",n.theme),"number"==typeof n.fontSize&&e.setOption("fontSize",Math.min(48,Math.max(6,n.fontSize)));for(const t of["syntaxHighlighting","wrap","useSoftTabs","showInvisibles","enableLiveAutocompletion","indentedSoftWrap","underlineJosi"])"boolean"==typeof n[t]&&e.setOption(t,n[t]);"number"==typeof n.tabSize&&e.setOption("tabSize",Math.min(16,Math.max(0,n.tabSize)))}catch(e){return console.error(e),null}}static initPanel(e,t){const n=new e(t);if(this.done)return;this.done=!0;let s=!0;n.renderOptionGroup=e=>{if(s){for(const t of Object.keys(e))delete e[t];e["シンタックスハイライト"]={path:"syntaxHighlighting"},e["キーバインド"]={path:"keyboardHandler",type:"select",items:[{caption:"VSCode",value:"ace/keyboard/vscode"},{caption:"Emacs",value:"ace/keyboard/emacs"},{caption:"Sublime",value:"ace/keyboard/sublime"},{caption:"Vim",value:"ace/keyboard/vim"}]},e["カラーテーマ"]={path:"theme",type:"select",items:[{caption:"ライト",value:"ace/theme/xcode"},{caption:"ダーク",value:"ace/theme/monokai"}]},e["文字サイズ"]={path:"fontSize",type:"number",defaultValue:16},e["行の折り返し"]={path:"wrap",type:"select",items:[{caption:"なし",value:"off"},{caption:"あり",value:"free"}]},e["ソフトタブ"]=[{path:"useSoftTabs"},{ariaLabel:"Tab Size",path:"tabSize",type:"number",values:[2,3,4,8,16]}],e["空白文字を表示"]={path:"showInvisibles"},e["常に自動補完"]={path:"enableLiveAutocompletion"},e["折り返した行をインデント"]={path:"indentedSoftWrap"},e["助詞に下線を引く"]={path:"underlineJosi"},s=!1}else for(const t of Object.keys(e))delete e[t]},n.render();const r=e.prototype.render,o=this;e.prototype.render=function(...e){r.apply(this,...e),this.on("setOption",(()=>{console.log("設定を保存しました。"),o.save(this.editor)}))}}}const de=[];let _e=0;function ye(e,t,n){const s=n.edit(e),r="string"==typeof e?document.getElementById(e):e;if(null===r)throw new Error(`idが ${e} のHTML要素は存在しません。`);const o=n.require("ace/range").Range,i=new ae(s.session,s.session.bgTokenizer.doc,o,!!r.dataset.nako3DisableMarker);if(r.classList.contains("nako3_ace_mounted"))throw new Error("なでしこ言語のエディタの初期化処理を同一のHTML要素に対して複数回適用しました。");r.setAttribute("lang","en"),r.classList.add("nako3_ace_mounted"),r.classList.add("nako3_editor");const u=r.dataset.nako3Readonly;u&&(r.classList.add("readonly"),s.setReadOnly(!0)),s.setFontSize(16);const c=e=>{const t=e.doc,n=t.getAllLines(),s=e.selection.getRange();t.removeFullLines(0,t.getLength()),t.insert({row:0,column:0},n.join("\n")),e.selection.setRange(s,!1)};n.require("ace/config").defineOptions(s.constructor.prototype,"editor",{syntaxHighlighting:{set:function(e){this.session.bgTokenizer.enabled=e,c(this.session)},initialValue:!0},underlineJosi:{set:function(e){this.session.bgTokenizer.underlineJosi=e,c(this.session)},initialValue:!0}}),s.setOptions({wrap:"free",indentedSoftWrap:!1,showPrintMargin:!1}),n.require("ace/keybindings/vscode"),s.setKeyboardHandler("ace/keyboard/vscode");const a=new(0,n.require("ace/tooltip").Tooltip)(s.container);n.require("ace/lib/event").addListener(s.renderer.content,"mouseout",(()=>{a.hide()})),s.on("mousemove",(e=>{const t=e.getDocumentPosition();if(t.column>=e.editor.session.getLine(t.row).length)return void a.hide();const n=e.editor.session.getTokenAt(t.row,t.column+1);null!==n&&n.docHTML?(a.setHtml(n.docHTML),a.show(null,e.clientX,e.clientY)):a.hide()})),s.session.on("change",(()=>{a.hide(),i.clear()}));const f=!!r.dataset.nako3ForceSyntaxHighlighting;let l=!0;const h=s.session.bgTokenizer,p=new fe(s.session.bgTokenizer.doc,t,((e,t,n)=>{h._signal("update",{data:{first:e,last:t}}),n>220&&s.getOption("syntaxHighlighting")&&!u&&!f&&l&&(l=!1,k.classList.add("visible"),s.setOption("syntaxHighlighting",!1),setTimeout((()=>{k.classList.remove("visible")}),13e3))}),((e,t)=>{i.addByError(e,t,"error")}),s.getOption("underlineJosi"));s.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0});const d=_e++;s.wnako3EditorId=d,de.push({getCompletions(e,n,s,r,o){if(e.wnako3EditorId!==d)o(null,[]);else{const e=le.getCompletionItems(s.row,r,t,p);if(e.some((e=>e.value===r)))return void o(null,[]);o(null,e)}}},{getCompletions(e,t,n,s,r){r(null,e.wnako3EditorId!==d?[]:le.getSnippets(e.session.doc.getAllLines().join("\n")))}}),n.require("ace/ext/language_tools").setCompleters(de),n.require("ace/autocomplete/util").getCompletionPrefix=e=>{const n=e.getCursorPosition();return le.getCompletionPrefix(e.session.doc.getLine(n.row).slice(0,n.column),t)};const _=new le(o,t),y=n.require("ace/lib/oop"),m=n.require("ace/mode/text").Mode,g=function(){this.HighlightRules=(new m).HighlightRules,this.foldingRules={getFoldWidget:_.getFoldWidget.bind(_),getFoldWidgetRange:_.getFoldWidgetRange.bind(_)}};y.inherits(g,m),g.prototype.toggleCommentLines=le.toggleCommentLines.bind(le),g.prototype.getNextLineIndent=le.getNextLineIndent.bind(le),g.prototype.checkOutdent=le.checkOutdent.bind(le),g.prototype.autoOutdent=_.autoOutdent.bind(_),s.session.setMode(new g),s.session.bgTokenizer.stop(),s.session.bgTokenizer=p,s.setTheme("ace/theme/xcode"),pe.load(s);const v=n.require("ace/ext/options").OptionPanel;pe.initPanel(v,s);const b=document.createElement("div");b.classList.add("button-container"),s.container.appendChild(b);const k=document.createElement("span");k.classList.add("slow-speed-message"),k.innerHTML="<span>エディタの|応答速度が|低下したため|シンタックス|ハイライトを|無効化|しました。</span>".replace(/\|/g,"</span><span>"),b.appendChild(k);const w=[];try{const e=n.require("ace/ext/code_lens");s.setOption("enableCodeLens",!0),s.commands.addCommand({name:"runTest",exec:(e,t)=>{w.filter((e=>"test"===e.name)).forEach((e=>e.callback(t[0])))}}),e.registerCodeLensProvider(s,{provideCodeLenses:(e,t)=>{t(null,w.some((e=>"test"===e.name))?le.getCodeLens(e.doc):[])}})}catch(e){console.error(e)}const j=()=>{s.container.classList.remove("fullscreen"),s.renderer.setScrollMargin(0,0,0,0)},S=document.createElement("span");S.classList.add("editor-button"),S.innerText="全画面表示",S.addEventListener("click",(e=>{s.container.classList.contains("fullscreen")?j():(s.container.classList.add("fullscreen"),s.renderer.setScrollMargin(20,20,0,0)),e.preventDefault()})),b.appendChild(S);const $=document.createElement("span");$.classList.add("editor-button"),$.innerText="設定を開く",$.addEventListener("click",(e=>{j(),s.execCommand("showSettingsMenu"),e.preventDefault()})),b.appendChild($);const x=n.require("ace/undomanager").UndoManager,O=new he(s,o,x);r.dataset.nako3Resizable&&(new MutationObserver((()=>{s.resize()})).observe(s.container,{attributes:!0}),s.renderer.setScrollMargin(4,0,4,0),s.container.classList.add("resizable"));const A=()=>{p.dirty=!0};return{editor:s,editorMarkers:i,editorTabs:O,retokenize:A,run:e=>{const n=s.getValue(),r=e.preCode||"",o=t.replaceLogger();if(e.outputContainer){const t=e.outputContainer;o.addListener("info",(({html:e})=>{t||console.log(e),t.style.display="block",t.innerHTML+=e})),e.outputContainer.classList.add("nako3-output-container")}const u=e.file||"main.nako3";o.addListener("info",(({position:e,noColor:t,level:s})=>{e.file!==u||"warn"!==s&&"error"!==s||i.addByError(n,{...e,message:t},s)}));return{promise:t.loadDependencies(r+n,u,r,e.localFiles||{}).then((()=>"test"===e.method?t.test(r+n,u,r,e.testName):"compile"===e.method?t.compile(r+n,u,!1,r):t.runReset(r+n,u,r))).catch((e=>{})).then((async e=>{for(A();p.dirty;)await new Promise((e=>setTimeout(e,0)));return e})).catch((e=>{console.error(e)})),logger:o,code:n}},codeLensListeners:w}}var me={"水色":{type:"const",value:"aqua"},"紫色":{type:"const",value:"fuchsia"},"緑色":{type:"const",value:"lime"},"青色":{type:"const",value:"blue"},"赤色":{type:"const",value:"red"},"黄色":{type:"const",value:"yellow"},"黒色":{type:"const",value:"black"},"白色":{type:"const",value:"white"},"茶色":{type:"const",value:"maroon"},"灰色":{type:"const",value:"gray"},"金色":{type:"const",value:"gold"},"黄金色":{type:"const",value:"gold"},"銀色":{type:"const",value:"silver"},"白金色":{type:"const",value:"silver"},"オリーブ色":{type:"const",value:"olive"},"ベージュ色":{type:"const",value:"beige"},"アリスブルー色":{type:"const",value:"aliceblue"},RGB:{type:"func",josi:[["と"],["と"],["で","の"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};return"#"+s(e)+s(t)+s(n)},return_none:!1},"色混":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};if(!e)throw new Error("『色混ぜる』の引数には配列を指定します");if(e.length<3)throw new Error("『色混ぜる』の引数には[RR,GG,BB]形式の配列を指定します");return"#"+t(e[0])+t(e[1])+t(e[2])},return_none:!1}},ge={"終":{type:"func",josi:[],pure:!0,fn:function(){throw new Error("__終わる__")},return_none:!0},"OS取得":{type:"func",josi:[],pure:!0,fn:function(){const e=window.navigator.userAgent.toLowerCase();return-1!==e.indexOf("windows")?"windows":-1!==e.indexOf("android")?"android":-1!==e.indexOf("iphone")?"iphone":-1!==e.indexOf("ipad")?"ipad":-1!==e.indexOf("mac os x")||-1!==e.indexOf("macintosh")?"darwin":-1!==e.indexOf("cros")?"chromeos":-1!==e.indexOf("ubuntu")?"ubuntu":-1!==e.indexOf("linux")?"linux":"unknown"}}},ve={"言":{type:"func",josi:[["と","を"]],pure:!0,fn:function(e){window.alert(e)},return_none:!0},"尋":{type:"func",josi:[["と","を"]],pure:!0,fn:function(e,t){const n=window.prompt(e);return n?/^[-+]?[0-9]+(\.[0-9]+)?$/.test(n)?parseFloat(n):/^[-+-+]?[0-90-9]+([..][0-90-9]+)?$/.test(n)?parseFloat(n.replace(/[-+0-9.]/g,(e=>String.fromCharCode(e.charCodeAt(0)-65248)))):n:t.__v0["空"]}},"文字尋":{type:"func",josi:[["と","を"]],pure:!0,fn:function(e,t){const n=window.prompt(e);return n||t.__v0["空"]}},"二択":{type:"func",josi:[["で","の","と","を"]],pure:!0,fn:function(e){return window.confirm(e)}}},be={"ブラウザ移動":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){window.location.href=e}},"ブラウザ戻":{type:"func",josi:[],pure:!0,fn:function(){window.history.back(-1)}},"ブラウザURL":{type:"const",value:""}},ke={"AJAX送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!0,fn:function(e,t,n){let s=n.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(t,s).then((e=>e.text())).then((t=>{n.__v0["対象"]=t,"非同期モード"===n.__genMode&&(n.newenv=!0),e(t,n)})).catch((e=>{console.log("[fetch.error]",e),n.__v0["AJAX:ONERROR"](e)}))},return_none:!0},"AJAX受信":{type:"func",josi:[["から","を"]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode)throw new Error("『AJAX受信』を使うには、プログラムの冒頭で「!非同期モード」と宣言してください。");const n=t.setAsync(t);let s=t.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(e,s).then((e=>{if(e.ok)return e.text();throw new Error("status="+e.status)})).then((e=>{t.__v0["対象"]=e,t.compAsync(t,n)})).catch((e=>{console.error("[AJAX受信のエラー]",e),t.__errorAsync(e,t)}))},return_none:!0},"AJAX受信時":{type:"func",josi:[["で"],["から","を"]],pure:!0,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"GET送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!1,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"POSTデータ生成":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=[];for(const t in e){const s=e[t],r=encodeURIComponent(t)+"="+encodeURIComponent(s);n.push(r)}return n.join("&")}},"POST送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n,s){const r=s.__exec("POSTデータ生成",[n,s]);fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"POSTフォーム送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n,s){const r=new FormData;for(const e in n)r.set(e,n[e]);fetch(t,{method:"POST",body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"AJAX失敗時":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){t.__v0["AJAX:ONERROR"]=e}},"AJAXオプション":{type:"const",value:""},"AJAXオプション設定":{type:"func",josi:[["に","へ","と"]],pure:!0,fn:function(e,t){t.__v0["AJAXオプション"]=e},return_none:!0},"AJAXオプションPOST設定":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){const n={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.__exec("POSTデータ生成",[e,t])};t.__v0["AJAXオプション"]=n},return_none:!0},"AJAX送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX送信』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"AJAX逐次送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX逐次送信』は『逐次実行』構文内で利用する必要があります。");t.resolveCount++;const n=t.resolve,s=t.reject;let r=t.__v0["AJAXオプション"];""===r&&(r={method:"GET"}),fetch(e,r).then((e=>e.text())).then((e=>{t.__v0["対象"]=e,n()})).catch((e=>{s(e.message)}))},return_none:!0},"AJAX保障送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){let n=t.__v0["AJAXオプション"];return""===n&&(n={method:"GET"}),fetch(e,n)},return_none:!1},"HTTP取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"HTTP逐次取得":{type:"func",josi:[["の","から","を"]],pure:!1,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP逐次取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"HTTP保障取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){return t.__exec("AJAX保障送信",[e,t])},return_none:!1},"POST逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,o=n.__exec("POSTデータ生成",[t,n]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POST送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.__exec("POST逐次送信",[e,t,n])},return_none:!0},"POST保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=n.__exec("POSTデータ生成",[t,n]);return fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})},return_none:!1},"POSTフォーム逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム逐次送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,o=new FormData;for(const e in t)o.set(e,t[e]);fetch(e,{method:"POST",body:o}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POSTフォーム送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム送信』は『逐次実行』構文内で利用する必要があります。");n.__exec("POSTフォーム逐次送信",[e,t,n])},return_none:!0},"POSTフォーム保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=new FormData;for(const e in t)s.set(e,t[e]);return fetch(e,{method:"POST",body:s})},return_none:!1},"AJAX内容取得":{type:"func",josi:[["から"],["で"]],pure:!0,fn:function(e,t,n){return"TEXT"===(t=t.toString().toUpperCase())||"テキスト"===t?e.text():"JSON"===t?e.json():"BLOB"===t?e.blob():"ARRAY"===t||"配列"===t?e.arrayBuffer():"BODY"===t||"本体"===t?e.body:e.body()},return_none:!1},"AJAXテキスト取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.text()},return_none:!1},"AJAX_JSON取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.json()},return_none:!1}},we={DOCUMENT:{type:"const",value:""},WINDOW:{type:"const",value:""},NAVIGATOR:{type:"const",value:""},"DOM要素ID取得":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return document.getElementById(e)}},"DOM要素取得":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return document.querySelector(e)}},"DOM要素全取得":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return Array.from(document.querySelectorAll(e))}},"タグ一覧取得":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return document.getElementsByTagName(e)}},"DOM子要素取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if("string"==typeof e&&(e=document.querySelector(e)),!e.querySelector)throw new Error("『DOM子要素取得』で親要素がDOMではありません。");return e.querySelector(t)}},"DOM子要素全取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if("string"==typeof e&&(e=document.querySelector(e)),!e.querySelectorAll)throw new Error("『DOM子要素取得』で親要素がDOMではありません。");return e.querySelectorAll(t)}},"DOMイベント設定":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!1,fn:function(e,t,n,s){"string"==typeof e&&(e=document.querySelector(e)),e[t]=s.__findVar(n,null)},return_none:!0},"DOMテキスト設定":{type:"func",josi:[["に","の","へ"],["を"]],pure:!0,fn:function(e,t){"string"==typeof e&&(e=document.querySelector(e));const n=e.tagName.toUpperCase();if("INPUT"===n||"TEXTAREA"===n)e.value=t;else if("SELECT"===n)for(let n=0;n<e.options.length;n++){const s=e.options[n].value;if(String(s)===t){e.selectedIndex=n;break}}else e.innerHTML=t},return_none:!0},"DOMテキスト取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){if("string"==typeof e&&(e=document.querySelector(e)),!e.tagName)return console.log("[DOMテキスト取得]でタグ名が取得できません。",e),"";const t=e.tagName.toUpperCase();if("INPUT"===t||"TEXTAREA"===t)return e.value;if("SELECT"===t){const t=e.selectedIndex;return t<0?null:e.options[t].value}return e.innerHTML}},"DOM_HTML設定":{type:"func",josi:[["に","の","へ"],["を"]],pure:!0,fn:function(e,t){"string"==typeof e&&(e=document.querySelector(e)),e.innerHTML=t},return_none:!0},"DOM_HTML取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){return"string"==typeof e&&(e=document.querySelector(e)),e.innerHTML}},"テキスト設定":{type:"func",josi:[["に","の","へ"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("DOMテキスト設定",[e,t,n])}},"テキスト取得":{type:"func",josi:[["の","から"]],pure:!1,fn:function(e,t){return t.__exec("DOMテキスト取得",[e,t])}},"HTML設定":{type:"func",josi:[["に","の","へ"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("DOM_HTML設定",[e,t,n])}},"HTML取得":{type:"func",josi:[["の","から"]],pure:!1,fn:function(e,t){return t.__exec("DOM_HTML取得",[e,t])}},"DOM属性設定":{type:"func",josi:[["の"],["に","へ"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n,s){"string"==typeof e&&(e=document.querySelector(e));const r=s.__v0["DOM和スタイル"];r[t]&&(t=r[t]),e[t]=n},return_none:!0},"DOM属性取得":{type:"func",josi:[["の","から"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n){"string"==typeof e&&(e=document.querySelector(e));const s=n.__v0["DOM和スタイル"];return s[t]&&(t=s[t]),e[t]}},"DOM和スタイル":{type:"const",value:{"幅":"width","高さ":"height","高":"height","背景色":"background-color","色":"color","マージン":"margin","余白":"padding","文字サイズ":"font-size","行揃え":"text-align","左":"left","右":"right","中央":"center","ボーダー":"border","ボックス表示":"display","なし":"none","ブロック":"block","表示位置":"float","重なり":"z-index"}},"DOMスタイル設定":{type:"func",josi:[["の"],["に","へ"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n,s){"string"==typeof e&&(e=document.querySelector(e));const r=s.__v0["DOM和スタイル"];void 0!==r[t]&&(t=r[t]),void 0!==r[n]&&(n=r[n]),e.style[t]=n},return_none:!0},"DOMスタイル一括設定":{type:"func",josi:[["に","へ"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n){if("string"==typeof e&&(e=document.querySelectorAll(e)),!e)return;e instanceof window.HTMLElement&&(e=[e]);const s=n.__v0["DOM和スタイル"];for(let n=0;n<e.length;n++){const r=e[n];for(const e in t){let n=e,o=t[e];void 0!==s[n]&&(n=s[n]),void 0!==s[o]&&(o=s[o]),r.style[n]=o}}},return_none:!0},"DOMスタイル取得":{type:"func",josi:[["の"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n){if("string"==typeof e&&(e=document.querySelector(e)),!e)return"";const s=n.__v0["DOM和スタイル"];return s[t]&&(t=s[t]),e.style[t]}},"DOMスタイル一括取得":{type:"func",josi:[["の"],["を"]],uses:["DOM和スタイル"],pure:!0,fn:function(e,t,n){const s={};if("string"==typeof e&&(e=document.querySelector(e)),!e)return s;t instanceof String&&(t=[t]);const r=n.__v0["DOM和スタイル"];if(t instanceof Array)return t.forEach((t=>{r[t]&&(t=r[t]),s[t]=e.style[t]})),s;if(t instanceof Object){for(let n in t)r[n]&&(n=r[n]),s[n]=e.style[n];return s}return e.style[t]}},"DOM要素作成":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return document.createElement(e)}},"DOM子要素追加":{type:"func",josi:[["に","へ"],["を"]],pure:!0,fn:function(e,t){"string"==typeof t&&(t=document.querySelector(t)),"string"==typeof e&&(e=document.querySelector(e)),e.appendChild(t)}},"DOM子要素削除":{type:"func",josi:[["から"],["を"]],pure:!0,fn:function(e,t){"string"==typeof t&&(t=document.querySelector(t)),"string"==typeof e&&(e=document.querySelector(e)),e.removeChild(t)}},"注目":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){"string"==typeof e&&(e=document.querySelector(e)),e.focus&&e.focus()},return_none:!0}},je={"対象イベント":{type:"const",value:""},"DOMイベント追加":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!1,fn:function(e,t,n,s){s.__addEvent(e,t,n,null)},return_none:!0},"DOMイベント削除":{type:"func",josi:[["の"],["から"],["を"]],pure:!1,fn:function(e,t,n,s){s.__removeEvent(e,t,n)},return_none:!0},"DOMイベント発火時":{type:"func",josi:[["で"],["の"],["が"]],pure:!0,fn:function(e,t,n,s){s.__addEvent(t,n,e,null)},return_none:!0},"DOMイベント処理停止":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e,t){e.preventDefault()},return_none:!0},"クリック時":{type:"func",josi:[["で"],["を"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"click",e,null)},return_none:!0},"読込時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"load",e,null)},return_none:!0},"フォーム送信時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"submit",e,null)},return_none:!0},"押キー":{type:"const",value:""},"キー押時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"keydown",e,n.__keyHandler)},return_none:!0},"キー離時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"keyup",e,n.__keyHandler)},return_none:!0},"キータイピング時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"keypress",e,n.__keyHandler)},return_none:!0},"マウスX":{type:"const",value:0},"マウスY":{type:"const",value:0},"マウス押時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"mousedown",e,n.__mouseHandler)},return_none:!0},"マウス移動時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"mousemove",e,n.__mouseHandler)},return_none:!0},"マウス離時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"mouseup",e,n.__mouseHandler)},return_none:!0},"タッチX":{type:"const",value:0},"タッチY":{type:"const",value:0},"タッチ配列":{type:"const",value:[]},"タッチイベント計算":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){return t.__touchHandler(e,t)}},"タッチ開始時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"touchstart",e,n.__touchHandler)},return_none:!0},"タッチ時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"touchmove",e,n.__touchHandler)},return_none:!0},"タッチ終了時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"touchend",e,n.__touchHandler)},return_none:!0},"タッチキャンセル時":{type:"func",josi:[["で"],["を","の"]],pure:!1,fn:function(e,t,n){n.__addEvent(t,"touchcancel",e,n.__touchHandler)},return_none:!0},"画面更新時実行":{type:"func",josi:[["を"]],pure:!1,fn:function(e,t){if(!(e=t.__findVar(e,null)))throw new Error("『画面更新時実行』で関数の取得に失敗しました。");return t.__requestAnimationFrameLastId=window.requestAnimationFrame(e),t.__requestAnimationFrameLastId}},"画面更新処理取消":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){window.cancelAnimationFrame(e),t.__requestAnimationFrameLastId===e&&(t.__requestAnimationFrameLastId=0)},return_none:!0}},Se={"DOM親要素":{type:"const",value:""},"DOM部品個数":{type:"const",value:0},"DOM部品オプション":{type:"const",value:{"自動改行":!1,"テーブル背景色":["#AA4040","#ffffff","#fff0f0"]}},"DOM親要素設定":{type:"func",josi:[["に","へ"]],pure:!1,fn:function(e,t){return"string"==typeof e&&(e=document.querySelector(e)||document.getElementById(e)),t.__v0["DOM親要素"]=e,e}},"DOM親部品設定":{type:"func",josi:[["に","へ"]],pure:!1,fn:function(e,t){return t.__exec("DOM親要素設定",[e,t])}},"DOMスキン":{type:"const",value:""},"DOMスキン辞書":{type:"const",value:{}},"DOMスキン設定":{type:"func",josi:[["を","に","の"]],pure:!1,fn:function(e,t){t.__v0["DOMスキン"]=e},return_none:!0},"DOM部品作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__v0["DOM親要素"],s="string"==typeof e?document.createElement(e):e;s.id="nadesi-dom-"+t.__v0["DOM部品個数"];const r=t.__v0["DOMスキン辞書"][t.__v0["DOMスキン"]];"function"==typeof r&&r(e,s,t),n.appendChild(s),t.__v0["DOM部品個数"]++;return t.__v0["DOM部品オプション"]["自動改行"]&&n.appendChild(document.createElement("br")),s}},"ボタン作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["button",t]);return n.innerHTML=e,n}},"エディタ作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["input",t]);return n.type="text",n.value=e,n}},"テキストエリア作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["textarea",t]);return n.value=e,n}},"ラベル作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["span",t]);return n.innerHTML=e,n}},"キャンバス作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["canvas",t]);return n.width=e[0],n.height=e[1],n.style.width=e[0],n.style.height=e[1],t.__exec("描画開始",[n,t]),n}},"画像作成":{type:"func",josi:[["の","から"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["img",t]);return n.src=e,n}},"改行作成":{type:"func",josi:[],pure:!1,fn:function(e){return e.__exec("DOM部品作成",["br",e])}},"チェックボックス作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=document.createElement("span"),s=document.createElement("input");s.type="checkbox",s.id="nadesi-dom-"+t.__v0["DOM部品個数"],t.__v0["DOM部品個数"]++;const r=document.createElement("label");return r.innerHTML=e,r.htmlFor=s.id,n.appendChild(s),n.appendChild(r),t.__exec("DOM部品作成",[n,t]),s}},"セレクトボックス作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=document.createElement("select");for(let t=0;t<e.length;t++){const s=document.createElement("option");s.value=e[t],s.appendChild(document.createTextNode(e[t])),n.appendChild(s)}t.__exec("DOM部品作成",[n,t]);return n}},"セレクトボックスアイテム設定":{type:"func",josi:[["を"],["へ","に"]],pure:!1,fn:function(e,t,n){"stirng"==typeof t&&(t=document.querySelector(t)),t.options.length=0;for(let n=0;n<e.length;n++){const s=document.createElement("option");s.value=e[n],s.appendChild(document.createTextNode(e[n])),t.appendChild(s)}},return_none:!0},"色選択ボックス作成":{type:"func",josi:[],pure:!1,fn:function(e){const t=e.__exec("DOM部品作成",["input",e]);return t.type="color",t}},"日付選択ボックス作成":{type:"func",josi:[],pure:!1,fn:function(e){const t=e.__exec("DOM部品作成",["input",e]);return t.type="date",t}},"パスワード入力エディタ作成":{type:"func",josi:[["の","で"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["input",t]);return n.type="password",n.value=e,n}},"値指定バー作成":{type:"func",josi:[["の","で"]],pure:!1,fn:function(e,t){e instanceof Array&&!(e.length<2)||(e=[0,100,50]),e.length<=2&&e.push(Math.floor((e[1]-e[0])/2));const n=t.__exec("DOM部品作成",["input",t]);return n.type="range",n.min=e[0],n.max=e[1],n.value=e[2],n}},"送信ボタン作成":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){const n=t.__exec("DOM部品作成",["input",t]);return n.type="submit",n.value=e,n}},"フォーム作成":{type:"func",josi:[["で","の"],["を"]],pure:!1,fn:function(e,t,n){const s=n.__exec("DOM部品作成",["form",n]);if(e instanceof Object)for(let t in e)s[t]&&(s[t]=e[t]);const r=t.split("\n"),o=document.createElement("table");for(let e in r){let t=""+r[e];if(""===t)continue;t.indexOf("=")<0&&(t+="=");const s=t.split("="),i=s[0],u=s[1],c=document.createElement("th");c.innerHTML=n.__tohtmlQ(i);const a=document.createElement("td");if("?("===u.substring(0,2)){const e=(u.substring(2)+")").split(")"),t=e[0],n=e[1],s=t.split("|"),r=document.createElement("select");r.name=i;for(let e of s){const t=document.createElement("option");t.value=e,t.text=e,r.appendChild(t)}const o=s.indexOf(n);o>=0&&(r.selectedIndex=o),a.appendChild(r)}else{const e=document.createElement("input");a.appendChild(e),e.id="nako3form_"+i,"?送信"===u||"?submit"===u?(e.type="submit",e.value=u.substring(1),""!=i&&(e.name=i)):"?c"===u.substring(0,2)?(e.type="color",e.value=u.substring(2),e.name=i):(e.type="text",e.value=u,e.name=i)}const f=document.createElement("tr");f.appendChild(c),f.appendChild(a),o.appendChild(f)}return s.appendChild(o),s}},"フォーム入力一括取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){"string"==typeof e&&(e=document.querySelector(e));const t={},n=e=>{if(e&&e.childNodes)for(let s=0;s<e.childNodes.length;s++){const r=e.childNodes[s];if(!r.tagName)return;const o=r.tagName.toLowerCase();if("input"!==o)"textarea"===o?t[r.name]=r.value:"select"===o&&(r.selectedIndex>=0?t[r.name]=r.options[r.selectedIndex].value:t[r.name]=""),n(r);else{if("checkbox"===r.type){t[r.name]=r.checked?r.value:"";continue}t[r.name]=r.value}}};return n(e),t}},"テーブル作成":{type:"func",josi:[["の","から"]],pure:!1,fn:function(e,t){if("string"==typeof e){const t=[],n=e.split("\n");for(let e of n)t.push(e.split(","));e=t}const n=JSON.parse(JSON.stringify(t.__v0["DOM部品オプション"]["テーブル背景色"]));for(let e=0;e<3;e++)n.push("");const s=n.shift(),r=t.__exec("DOM部品作成",["table",t]);for(let o in e){const i=e[o],u=document.createElement("tr");for(let e of i){e=""+e;const r=document.createElement(0==o?"th":"td");r.innerHTML=t.__tohtml(e),""!=s&&(r.style.backgroundColor=0==o?s:n[o%2],r.style.color=0==o?"white":"black"),e.match(/^(\+|\-)?\d+(\.\d+)?$/)&&(r.style.textAlign="right"),u.appendChild(r)}r.appendChild(u)}return r}}},$e={"HTML変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;")}},"クリップボード設定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){if(navigator.clipboard)navigator.clipboard.writeText(e);else{const t=document.createElement("div"),n=document.createElement("pre");n.style.webkitUserSelect="auto",n.style.userSelect="auto",t.appendChild(n).textContent=e,t.style.position="fixed",t.right="200%",document.body.appendChild(t),document.getSelection().selectAllChildren(t),document.execCommand("copy"),document.body.removeChild(t)}},return_none:!0},"クリップボード取得時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!navigator.clipboard)throw new Error("Clipbard APIが利用できません。");"string"==typeof e&&(e=t.__findFunc(e,"クリップボード取得時"));navigator.clipboard.readText().then((n=>{t.__v0["対象"]=n,e(t)}))}}},xe={"保存":{type:"func",josi:[["を"],["に","へ"]],pure:!1,fn:function(e,t,n){n.__exec("ローカルストレージ保存",[e,t,n])},return_none:!0},"開":{type:"func",josi:[["を","から","の"]],pure:!1,fn:function(e,t){return t.__exec("ローカルストレージ読",[e,t])},return_none:!1},"読":{type:"func",josi:[["を","から","の"]],pure:!1,fn:function(e,t){return t.__exec("ローカルストレージ読",[e,t])},return_none:!1},"存在":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return null!==window.localStorage.getItem(e)},return_none:!1},"ローカルストレージ保存":{type:"func",josi:[["を"],["に","へ"]],pure:!0,fn:function(e,t,n){let s=e;n.__v0["保存オプション"]&&n.__v0["保存オプション"].indexOf("json")>=0&&(s=JSON.stringify(s)),window.localStorage[t]=s},return_none:!0},"ローカルストレージ読":{type:"func",josi:[["を","から","の"]],pure:!0,fn:function(e,t){const n=window.localStorage[e];if(t.__v0["保存オプション"]&&t.__v0["保存オプション"].indexOf("json")>=0)try{return JSON.parse(n)}catch(t){console.log("ローカルストレージ『"+e+"』の読み込みに失敗")}return n},return_none:!1},"ローカルストレージキー列挙":{type:"func",josi:[[]],pure:!0,fn:function(e){const t=[];for(const e in window.localStorage)t.push(e);return t},return_none:!1},"ローカルストレージキー削除":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){window.localStorage.removeItem(e)},return_none:!0},"ローカルストレージ全削除":{type:"func",josi:[],pure:!0,fn:function(){window.localStorage.clear()},return_none:!0},"ローカルストレージ有効確認":{type:"func",josi:[],pure:!0,fn:function(){return void 0!==window.localStorage},return_none:!1},"保存オプション":{type:"const",value:"json"},"保存オプション設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){e=e.toUpperCase(e),t.__v0["保存オプション"]=e},return_none:!0}};const Oe="描画を行うためには、HTML内にcanvasを配置し、idを振って『描画開始』命令に指定します。";var Ae={"描画開始":{type:"func",josi:[["の","へ","で"]],pure:!0,fn:function(e,t){if("string"==typeof e&&(e=document.querySelector(e)||document.getElementById(e)),!e)throw new Error("『描画開始』でCanvasを取得できませんでした。");t.__canvas=e,t.__ctx=e.getContext("2d"),t.__fillStyle="black",t.__strokeStyle="black",t.__v0["描画中キャンバス"]=e,t.__v0["描画中コンテキスト"]=t.__ctx},return_none:!0},"描画中キャンバス":{type:"const",value:null},"描画中コンテキスト":{type:"const",value:null},"キャンバス状態保存":{type:"func",josi:[],pure:!0,fn:function(e){if(!e.__ctx)throw new Error(Oe);e.__ctx.save()},return_none:!0},"キャンバス状態復元":{type:"func",josi:[],pure:!0,fn:function(e){if(!e.__ctx)throw new Error(Oe);e.__ctx.restore()},return_none:!0},"線色設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);t.__strokeStyle=e,""!=e&&(t.__ctx.strokeStyle=e)},return_none:!0},"塗色設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);t.__fillStyle=e,""!=e&&(t.__ctx.fillStyle=e)},return_none:!0},"線描画":{type:"func",josi:[["から"],["へ","まで"]],pure:!0,fn:function(e,t,n){if(!n.__ctx)throw new Error(Oe);n.__ctx.beginPath(),n.__ctx.moveTo(e[0],e[1]),n.__ctx.lineTo(t[0],t[1]),n.__ctx.stroke()},return_none:!0},"線太設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);t.__ctx.lineWidth=e},return_none:!0},"四角描画":{type:"func",josi:[["の","へ","に"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);""==t.__fillStyle&&""==t.__strokeStyle||(t.__ctx.beginPath(),t.__ctx.rect(e[0],e[1],e[2],e[3]),""!=t.__fillStyle&&t.__ctx.fill(),""!=t.__strokeStyle&&t.__ctx.stroke())},return_none:!0},"全描画クリア":{type:"func",josi:[],pure:!0,fn:function(e){if(!e.__ctx)throw new Error(Oe);e.__ctx.clearRect(0,0,e.__canvas.width,e.__canvas.height)},return_none:!0},"描画クリア":{type:"func",josi:[["の","へ","に"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);e instanceof Array||(e=[]),0==e.length?e=[0,0,t.__canvas.width,t.__canvas.height]:e.length<=2&&(e.unshift(0),e.unshift(0)),t.__ctx.clearRect(e[0],e[1],e[2],e[3])},return_none:!0},"円描画":{type:"func",josi:[["へ","に"],["の"]],pure:!0,fn:function(e,t,n){if(!n.__ctx)throw new Error(Oe);""==n.__fillStyle&&""==n.__strokeStyle||(n.__ctx.beginPath(),n.__ctx.arc(e[0],e[1],t,0,2*Math.PI,!1),""!=n.__fillStyle&&n.__ctx.fill(),""!=n.__strokeStyle&&n.__ctx.stroke())},return_none:!0},"楕円描画":{type:"func",josi:[["へ","に","の"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);if(!e)throw new Error("楕円描画の引数配列が無効です");if(e.length<4)throw new Error("楕円描画の引数配列が不足しています");e.length<7&&(e[4]||(e[4]=0),e[5]||(e[5]=0),e[6]||(e[6]=2*Math.PI),e[7]||(e[7]=!0)),""==t.__fillStyle&&""==t.__strokeStyle||(t.__ctx.beginPath(),t.__ctx.ellipse.apply(t.__ctx,e),""!=t.__fillStyle&&t.__ctx.fill(),""!=t.__strokeStyle&&t.__ctx.stroke())},return_none:!0},"多角形描画":{type:"func",josi:[["で","の","を"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);if(""==t.__fillStyle&&""==t.__strokeStyle)return;t.__ctx.beginPath();const n=e[0];t.__ctx.moveTo(n[0],n[1]);for(let n=1;n<e.length;n++){const s=e[n];t.__ctx.lineTo(s[0],s[1])}t.__ctx.lineTo(n[0],n[1]),""!=t.__fillStyle&&t.__ctx.fill(),""!=t.__strokeStyle&&t.__ctx.stroke()},return_none:!0},"画像読":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=new window.Image;return n.src=e,n}},"画像逐次読":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){if(void 0===t.resolve)throw new Error("『画像逐次読』は『逐次実行』構文で使ってください。");t.resolveCount++;const n=new window.Image;return n.src=e,n.onload=()=>{t.__v0["対象"]=n,t.resolve()},n.onerror=()=>{t.__v0["対象"]="",t.reject()},n}},"画像読時":{type:"func",josi:[["で"],["の","を"]],pure:!0,fn:function(e,t,n){const s=n.__findVar(e,null),r=new window.Image;r.src=t,r.onload=()=>{n.__v0["対象"]=r,s(n)},r.onerror=()=>{n.__v0["対象"]="",s(n)}},return_none:!0},"画像描画":{type:"func",josi:[["の","を"],["へ","に"]],pure:!0,fn:function(e,t,n){if(!n.__ctx)throw new Error(Oe);const s=(e,n)=>{if(2===t.length)n.drawImage(e,t[0],t[1]);else if(4===t.length)n.drawImage(e,t[0],t[1],t[2],t[3]);else{if(8!==t.length)throw new Error("『画像描画』の第二引数の配列要素は2,4,8個のいずれかです。");n.drawImage(e,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7])}};if("string"==typeof e){const t=new window.Image;return t.src=e,t.onload=()=>{s(t,n.__ctx)},t}return s(e,n.__ctx),e},return_none:!1},"画像部分描画":{type:"func",josi:[["の"],["を","から"],["へ","に"]],pure:!0,fn:function(e,t,n,s){const r="『画像部分描画』に使える引数は画像と、描画する座標へ2つか、描画する座標とその位置の4つか、使用する座標と使用する位置と描画する座標と大きさの8つだけです。";if(e&&t&&!Array.isArray(t)&&Array.isArray(e)&&("string"==typeof t||"[object HTMLImageElement]"===String(t.__proto__))){let n=e;e=t,t=n}if(!s.__ctx)throw new Error(Oe);const o=(e,s)=>{if(n||(t?t.length>=2&&(n=t,t=void 0):s.drawImage(e)),2===n.length)s.drawImage(e,n[0],n[1]);else{if(4!==n.length)throw new Error(r);if(t){if(4!==t.length)throw new Error(r);s.drawImage(e,t[0],t[1],t[2],t[3],n[0],n[1],n[2],n[3])}else s.drawImage(e,n[0],n[1],n[2],n[3])}};if("string"==typeof e){const t=new window.Image;return t.src=e,t.onload=()=>{o(t,s.__ctx)},t}return o(e,s.__ctx),e},return_none:!1},"描画フォント設定":{type:"func",josi:[["を","の","で","に"]],pure:!0,fn:function(e,t){"number"==typeof e?e+="px sans-serif":/^[0-9]+(px|em)$/.test(e)&&(e+=" sans-serif"),t.__ctx.font=e},return_none:!0},"文字描画":{type:"func",josi:[["へ","に"],["の","を"]],pure:!0,fn:function(e,t,n){if(!n.__ctx)throw new Error(Oe);n.__ctx.fillText(t,e[0],e[1])},return_none:!0},"文字描画幅取得":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);return t.__ctx.measureText(e)},return_none:!0},"描画起点設定":{type:"func",josi:[["へ","に"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);t.__ctx.translate(e[0],e[1])},return_none:!0},"描画回転":{type:"func",josi:[["だけ","に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);t.__ctx.rotate(e*Math.PI/180)},return_none:!0},"描画拡大":{type:"func",josi:[["だけ","に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);t.__ctx.scale(e[0],e[1])},return_none:!0},"描画変換マトリクス設定":{type:"func",josi:[["だけ","に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);t.__ctx.setTransform(e[0],e[1],e[2],e[3],e[4],e[5],e[6])},return_none:!0},"描画変換マトリクス追加":{type:"func",josi:[["だけ","に","へ"]],pure:!0,fn:function(e,t){if(!t.__ctx)throw new Error(Oe);t.__ctx.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6])},return_none:!0},"描画データURL変換":{type:"func",josi:[],pure:!1,fn:function(e){return e.__v0["描画中キャンバス"].toDataURL("image/png")}},"描画ダウンロードリンク作成":{type:"func",josi:[["へ","に"]],pure:!1,fn:function(e,t){if("string"==typeof e&&(e=document.querySelector(e)),!e)throw new Error("『描画ダウンロードリンク作成』でDOMが見当たりません。");const n=t.__v0["描画中キャンバス"];if(!n)throw new Error("『描画ダウンロード』で描画中キャンバスが設定されていません。");e.href=n.toDataURL("image/png"),e.download="canvas.png"},return_none:!0},"描画ダウンロード":{type:"func",josi:[],pure:!1,fn:function(e){"string"==typeof dom&&(dom=document.querySelector(dom));const t=e.__v0["描画中キャンバス"];if(!t)throw new Error("『描画ダウンロード』で描画中キャンバスが設定されていません。");const n=document.createElement("a");return n.href=t.toDataURL("image/png"),n.download="canvas.png",n.click(),!0}}},Me={"位置情報取得時":{type:"func",josi:[["の","に","へ"]],pure:!1,fn:function(e,t){let n=e;if("string"==typeof n&&(n=t.__findVar(n)),!("geolocation"in navigator))throw new Error("関数『位置情報取得時』は使えません。");navigator.geolocation.getCurrentPosition((e=>{t.__v0["対象"]=[e.coords.latitude,e.coords.longitude],n(e)}))},return_none:!0},"位置情報監視時":{type:"func",josi:[["の","に","へ"]],pure:!1,fn:function(e,t){let n=e;if("string"==typeof n&&(n=t.__findVar(n)),!("geolocation"in navigator))throw new Error("関数『位置情報監視時』は使えません。");return navigator.geolocation.watchPosition((e=>{t.__v0["対象"]=[e.coords.latitude,e.coords.longitude],n(e)}))},return_none:!1},"位置情報監視停止":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){navigator.geolocation.clearWatch(e)},return_none:!0}},Ce={"話":{type:"func",josi:[["と","を","の"]],pure:!1,fn:function(e,t){let n=t.__v0["話:話者"];n||(n=t.__exec("話者設定",["ja",t]));const s=new SpeechSynthesisUtterance(e);return s.voice=n,n&&(s.lang=n.lang),s.rate=t.__v0["話者速度"],s.pitch=t.__v0["話者声高"],s.volume=t.__v0["話者音量"],window.speechSynthesis.speak(s),console.log("#話す:",e),e}},"話終時":{type:"func",josi:[["で"],["と","を","の"]],pure:!1,fn:function(e,t,n){let s=n.__v0["話:話者"];s||(s=n.__exec("話者設定",["ja",n]));const r=new SpeechSynthesisUtterance(t);return r.voice=s,s&&(r.lang=s.lang),r.rate=n.__v0["話者速度"],r.pitch=n.__v0["話者声高"],r.volume=n.__v0["話者音量"],r.onend=t=>{console.log("#話終時"),n.__v0["対象イベント"]=t,e(n)},window.speechSynthesis.speak(r),console.log("#話す:",t),t}},"話者一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){if(!("SpeechSynthesisUtterance"in window))throw new Error("音声合成APIに対応していません");return window.speechSynthesis.getVoices()}},"話者設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){if(!("SpeechSynthesisUtterance"in window))throw new Error("音声合成APIに対応していません");if("string"==typeof e){const n=window.speechSynthesis.getVoices();for(const s of n)if(s.lang.indexOf(e)>=0||s.name===e){const e=new SpeechSynthesisUtterance;return e.voice=s,e.lang=s.lang,t.__v0["話:話者"]=s,console.log("#話者:",s.name),s}}if("object"==typeof e)return t.__v0["話:話者"]=e,e}},"話者速度":{type:"const",value:1},"話者声高":{type:"const",value:1},"話者音量":{type:"const",value:1},"話者詳細設定":{type:"func",josi:[["で","に","へ"]],pure:!0,fn:function(e,t){const n=(e,n)=>{"速度"===e&&(t.__v0["話者速度"]=n),"声高"!==e&&"ピッチ"!==e||(t.__v0["話者声高"]=n),"音量"===e&&(t.__v0["話者音量"]=n)};for(const t in e){n(t,e[t])}}}},Ee={"WS接続完了時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONOPEN"]=e},return_none:!0},"WS受信時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONMESSAGE"]=e},return_none:!0},"WSエラー発生時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONERROR"]=e},return_none:!0},"WS接続":{type:"func",josi:[["に","へ","の"]],pure:!0,fn:function(e,t){const n=new WebSocket(e);return n.onopen=()=>{const e=t.__v0["WS:ONOPEN"];e&&e(t)},n.onerror=e=>{const n=t.__v0["WS:ONERROR"];n&&n(e,t),console.log("WSエラー",e)},n.onmessage=e=>{t.__v0["対象"]=e.data;const n=t.__v0["WS:ONMESSAGE"];n&&n(t)},t.__v0["WS:SOCKET"]=n,n}},"WS送信":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__v0["WS:SOCKET"].send(e)}},"WS切断":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0["WS:SOCKET"].close()}}},Le={"オーディオ開":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e,t){const n=new Audio;return n.src=e,n},return_none:!1},"オーディオ再生":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ再生する前に、オーディオ開くで音声ファイルを読み込んでください");e.loop=!1,e.play()},return_none:!0},"オーディオループ再生":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ再生する前に、オーディオ開くで音声ファイルを読み込んでください");e.loop=!0,e.play()},return_none:!0},"オーディオ停止":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ停止する前に、オーディオ開くで音声ファイルを読み込んでください");e.pause(),e.currentTime=0,setTimeout((()=>{e.currentTime=0}),10)},return_none:!0},"オーディオ一時停止":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ一時停止する前に、オーディオ開くで音声ファイルを読み込んでください");e.pause()},return_none:!0},"オーディオ音量取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ長取得する前に、オーディオ開くで音声ファイルを読み込んでください");return e.volume}},"オーディオ音量設定":{type:"func",josi:[["を"],["に","へ"]],pure:!0,fn:function(e,t,n){if(!e)throw new Error("オーディオ長取得する前に、オーディオ開くで音声ファイルを読み込んでください");e.volume=t},return_none:!0},"オーディオ長取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ長取得する前に、オーディオ開くで音声ファイルを読み込んでください");return e.duration}},"オーディオ再生位置取得":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e,t){if(!e)throw new Error("オーディオ再生位置取得する前に、オーディオ開くで音声ファイルを読み込んでください");return e.currentTime}},"オーディオ再生位置設定":{type:"func",josi:[["を"],["に","へ"]],pure:!0,fn:function(e,t,n){if(!e)throw new Error("オーディオ停止する前に、オーディオ開くで音声ファイルを読み込んでください");e.currentTime=t},return_none:!0}},Te=__webpack_require__(3812);const Fe={meta:{type:"const",value:{pluginName:"plugin_browser",pluginVersion:"3.2.24",nakoRuntime:["wnako"],nakoVersion:"^3.2.24"}},"初期化":{type:"func",josi:[],pure:!0,fn:function(e){const t="undefined"==typeof document?{body:{}}:document,n="undefined"==typeof window?{location:{href:""}}:window,s="undefined"==typeof navigator?{}:navigator;e.__v0["AJAX:ONERROR"]=e=>{console.log(e)},e.__v0.DOCUMENT=t,e.__v0.WINDOW=n,e.__v0.NAVIGATOR=s,e.__v0["DOM親要素"]=t.body,e.__v0["ブラウザURL"]=n.location.href,e.__tohtml=e=>(""+e).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;"),e.__tohtmlQ=t=>e.__tohtml(t).replace(/\"/g,"&#34;").replace(/\'/g,"&#39;"),e.__dom_events=[],e.__addEvent=(n,s,r,o)=>{if("string"==typeof n&&!(n=t.querySelector(n)))throw new Error("DOMイベントが追加できません。要素が見当たりません。");if("string"==typeof r&&!(r=e.__findVar(r,null)))throw new Error("DOMイベントが追加できません。関数が見当たりません。");const i=t=>(e.__v0["対象"]=t.target,e.__v0["対象イベント"]=t,o&&o(t,e),"非同期モード"===e.__genMode&&(e.newenv=!0),r(t,e));e.__dom_events.push({dom:n,event:s,func:i,rawFunc:r}),n.addEventListener(s,i)},e.__keyHandler=(e,t)=>{t.__v0["押キー"]=e.key},e.__mouseHandler=(e,t)=>{const n=e.target.getBoundingClientRect();t.__v0["マウスX"]=e.clientX-n.left,t.__v0["マウスY"]=e.clientY-n.top},e.__touchHandler=(e,t)=>{const n=e.target.getBoundingClientRect(),s=e.changedTouches;if(s.length<=0)return;const r=[];for(let e=0;e<s.length;e++){const o=s[e],i=o.clientX-n.left,u=o.clientY-n.top;0===e&&(t.__v0["タッチX"]=i,t.__v0["タッチY"]=u),r.push([i,u])}return t.__v0["タッチ配列"]=r,r},e.__removeEvent=(n,s,r)=>{if("string"==typeof n&&!(n=t.querySelector(n)))throw new Error("DOMイベントが削除できません。要素が見当たりません。");if("string"==typeof r&&!(r=e.__findVar(r,null)))throw new Error("DOMイベントが削除できません。関数が見当たりません。");for(let t=0;t<e.__dom_events.length;t++){const o=e.__dom_events[t];if(o.dom===n&&o.event===s&&o.rawFunc===r){o.dom.removeEventListener(o.event,o.func),e.__dom_events.splice(t,1);break}}},e.__requestAnimationFrameLastId=0,e.__removeAllDomEvent=()=>{e.__dom_events.forEach((e=>{console.log(e.event,e.dom,e),e.dom.removeEventListener(e.event,e.func)})),e.__dom_events=[],e.__requestAnimationFrameLastId>0&&(n.cancelAnimationFrame(e.__requestAnimationFrameLastId),e.__requestAnimationFrameLastId=0)}}},"!クリア":{type:"func",josi:[],pure:!1,fn:function(e){e.__chartjs&&e.__chartjs.destroy(),e.__removeAllDomEvent()}}};[me,ge,ve,be,ke,we,je,Se,$e,xe,Ae,Me,Ce,Ee,Le,{"ホットキー登録":{type:"func",josi:[["に","で"],["を"]],pure:!0,fn:function(e,t,n){Te(e,(function(e,s){e.preventDefault(),n.__v1[t]()}))}},"ホットキー解除":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){Te.unbind(e)}}},{"グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!0,fn:function(e,t){if(!window.Chart)throw new Error("『グラフ描画』のエラー。Chart.jsを取り込んでください。");if(!t.__canvas)throw new Error("『グラフ描画』のエラー。『描画開始』命令で描画先のCanvasを指定してください。 ");e["タイプ"]&&(e.type=e["タイプ"]),e["データ"]&&(e.data=e["データ"]),e["オプション"]&&(e.options=e["オプション"]),t.__chartjs&&t.__chartjs.destroy();const n=new Chart(t.__canvas,e);return t.__chartjs=n,n}},"グラフオプション":{type:"const",value:{}},"線グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"line",data:e=t.__exec("二次元グラフデータ変形",["line",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"棒グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{indexAxis:"x"}),s={type:"bar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"横棒グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{indexAxis:"y"}),s={type:"bar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"積上棒グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{indexAxis:"x",scales:{x:{stacked:!0},y:{stacked:!0}}}),s={type:"bar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"積上横棒グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{indexAxis:"y",scales:{x:{stacked:!0},y:{stacked:!0}}}),s={type:"bar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"散布図描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n=Object.assign({},t.__v0["グラフオプション"],{}),s={type:"scatter",data:e=t.__exec("二次元グラフデータ変形",["scatter",e,t]),options:n};return t.__exec("グラフ描画",[s,t])}},"円グラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"pie",data:e=t.__exec("二次元グラフデータ変形",["pie",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"ドーナツグラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"doughnut",data:e=t.__exec("二次元グラフデータ変形",["pie",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"ポーラーグラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"polarArea",data:e=t.__exec("二次元グラフデータ変形",["pie",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"レーダーグラフ描画":{type:"func",josi:[["を","で","の"]],pure:!1,fn:function(e,t){const n={type:"radar",data:e=t.__exec("二次元グラフデータ変形",["bar",e,t]),options:t.__v0["グラフオプション"]};return t.__exec("グラフ描画",[n,t])}},"二次元グラフデータ変形":{type:"func",josi:[["の"],["を"]],pure:!1,fn:function(e,t,n){const s=["rgba(255, 99, 132, 0.2)","rgba(54, 162, 235, 0.2)","rgba(255, 206, 86, 0.2)","rgba(75, 192, 192, 0.2)","rgba(153, 102, 255, 0.2)","rgba(255, 159, 64, 0.2)"],r=["rgba(255, 99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)"],o={},i=[],u=[];if(o.labels=[],t instanceof Array){if(t[0]instanceof Array){if("pie"===e){const e={data:[]};o.datasets=[e];for(let n=0;n<t.length;n++)o.labels.push(t[n][0]),e.data.push(t[n][1]),i.push(s[n%6]),u.push(r[n%6]);return e.backgroundColor=i,e.borderColor=u,o}if("string"==typeof t[1][0]){for(let e=1;e<t.length;e++)o.labels.push(t[e][0]),t[e]=t[e].slice(1);t[0]=t[0].slice(1)}else for(let e=1;e<t.length;e++)o.labels.push(e);o.datasets=[];for(let e=0;e<t[0].length;e++){const n={};o.datasets.push(n),n.label=t[0][e],n.backgroundColor=s[e%6],n.borderColor=r[e%6],n.data=[];for(let s=1;s<t.length;s++)n.data.push(t[s][e])}return o}for(let e=0;e<t.length;e++)o.labels.push(e+1),i.push(s[e%6]),u.push(r[e%6]);const n={};return o.datasets=[n],n.label="データ",n.data=t,n.backgroundColor=i,n.borderColor=u,o}return t instanceof Object?t:n.__exec("二次元グラフデータ変形",[[t],n])}}},{"ハッシュ値計算時":{type:"func",josi:[["へ"],["を"],["で"]],pure:!1,fn:function(e,t,n,s){e=s.__findVar(e,null);const r=new TextEncoder("utf-8").encode(t);crypto.subtle.digest(n,r).then((function(t){const n=[],r=new DataView(t);for(let e=0;e<r.byteLength;e+=4){const t="00"+r.getUint32(e).toString(16);n.push(t.substr(t.length-2,2))}const o=s.__v0["対象"]=n.join("");e(o)}))},return_none:!0}}].forEach((e=>{const t={};Object.assign(t,e),void 0!==t["初期化"]&&delete t["初期化"],Object.assign(Fe,t)}));var Ne=Fe;const Ie=/^(なでしこ|nako|nadesiko)3?$/;class Pe extends K{constructor(){super({useBasicPlugin:!0}),this.__varslist[0]["ナデシコ種類"]="wnako3"}async runNakoScript(){let e=0;const t=document.querySelectorAll("script");for(let n=0;n<t.length;n++){const s=t[n];if(s.type.match(Ie)){e++;const t=`${"object"==typeof window.location?window.location.href:"url_unknown"}#script${e}.nako3`,n=s.text;await this.loadDependencies(n,t),this.run(s.text,t)}}console.log("実行したなでしこの個数=",e)}async loadDependencies(e,t,s="",r={}){return this._loadDependencies(e,t,s,{readJs:(e,t)=>r.hasOwnProperty(e)?{sync:!0,value:()=>(Function(r[e])(),{})}:{sync:!1,value:(async()=>{const s=await fetch(e);if(!s.ok)throw new n.l0(`ファイル『${e}』のダウンロードに失敗しました: ${s.status} ${s.statusText}`,t.file,t.line);const r=await s.text();if(!r.includes("navigator.nako3.addPluginObject"))throw new n.l0(`ファイル ${e} の中に文字列 "navigator.nako3.addPluginObject" が存在しません。現在、ブラウザ版のなでしこ言語v3は自動登録するプラグインのみをサポートしています。`,t.file,t.line);return()=>{const s=navigator.nako3;navigator.nako3=this;try{Function(r)()}catch(s){throw new n.l0(`プラグイン ${e} の取り込みに失敗: ${s instanceof Error?s.message:s+""}`,t.file,t.line)}finally{navigator.nako3=s}return{}}})()},readNako3:(e,t)=>r.hasOwnProperty(e)?{sync:!0,value:r[e]}:{sync:!1,value:(async()=>{const s=await fetch(e);if(!s.ok)throw new n.l0(`ファイル ${e} のダウンロードに失敗しました: ${s.status} ${s.statusText}`,t.file,t.line);return await s.text()})()},resolvePath:(e,t)=>{let s=e;if(!r.hasOwnProperty(e))try{s=new URL(e).pathname}catch(r){try{const t=window.location.href.split("/"),n=t.splice(0,t.length-1).join("/");s=new URL(n+"/"+e).pathname}catch(e){throw new n.l0(`取り込み文の引数でパスが解決できません。https:// か http:// で始まるアドレスを指定してください。\n${e}`,t.file,t.line)}}if(s.endsWith(".js")||s.endsWith(".js.txt")||s.endsWith(".mjs")||s.endsWith(".mjs.txt"))return{filePath:e,type:"js"};if(s.endsWith(".nako3")||s.endsWith(".nako3.txt"))return{filePath:e,type:"nako3"};throw new n.l0(`ファイル『${e}』は拡張子が(.nako3|.js|.js.txt|.mjs|.mjs.txt)以外なので取り込めません。`,t.file,t.line)}})}checkScriptTagParam(){const e=document.querySelectorAll("script");for(let t=0;t<e.length;t++){const n=e[t].src||"";if(n.indexOf("wnako3.js?run")>=0||n.indexOf("wnako3.js&run")>=0)return!0}return!1}setupEditor(e){return ye(e,this,window.ace)}}if("object"!=typeof navigator||navigator.exportWNako3)module.exports=Pe;else{const e=navigator.nako3=new Pe;e.addPluginObject("PluginBrowser",Ne),window.addEventListener("DOMContentLoaded",(t=>{e.checkScriptTagParam()&&e.runNakoScript()}),!1)}}()})();