diff --git a/boards/default/python_pyodide/main.bundle.js b/boards/default/python_pyodide/main.bundle.js index 07c6d5ad..daad5a2e 100644 --- a/boards/default/python_pyodide/main.bundle.js +++ b/boards/default/python_pyodide/main.bundle.js @@ -28,4 +28,4 @@ var i=n(8287),s=i.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function r(t,e * See the License for the specific language governing permissions and * limitations under the License. */ -class ut{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var n=t.split(","),i=0;i0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ot.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(ot.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.CONTROLS_IF_MSG_ELSE);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_if_elseif");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),n.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],o=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_if_elseif":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),o=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ot.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(ot.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},yt={init:function(){this.setColour(Mt),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.PYTHON_RANGE).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Dt={init:function(){this.setColour(Mt),this.appendValueInput("LIST").setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(ot.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return ot.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Nt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(ot.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new ot.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(ot.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:ot.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:ot.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},bt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.MIXLY_PYTHON_FINALLY);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_except");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),n.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],o=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,o=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_except":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),o=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},vt={init:function(){this.setColour(Mt);var t=new ot.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:ot.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:ot.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},wt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ot.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ot.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ft={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ot.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ot.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Nt.OPERATORS=[[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],vt.OPERATORS=[[ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Pt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Vt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(ot.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Yt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},xt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Ut={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Bt={init:function(){this.jsonInit({message0:ot.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Mt,tooltip:ot.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:ot.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Xt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_STAT),this.setOutput(!0)}},Gt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Ht={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Wt={init:function(){this.appendDummyInput().appendField(ot.Msg.CONTROLS_REPEAT_TITLE_REPEAT+ot.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(ot.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new ot.FieldDropdown([[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Mt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},qt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},$t={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET+ot.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_GET_UNIQUE_IDEN)}},zt={init:function(){this.setColour(Mt),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(ot.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Qt=230;ot.FieldTextInput.math_number_validator=function(t){return String(t)},ot.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Jt={init:function(){this.setColour(Qt),this.appendDummyInput().appendField(new ot.FieldTextInput("0",ot.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MATH_NUMBER_TOOLTIP)}},Zt={init:function(){this.setColour(Qt);this.appendDummyInput("").appendField(ot.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ot.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},te={init:function(){this.setColour(Qt);this.appendDummyInput("").appendField(ot.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ot.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},ee={init:function(){this.setColour(Qt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ot.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ot.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ot.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ne={init:function(){this.setColour(Qt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ot.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ot.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ot.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ie={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new ot.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},se={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:ot.Msg.MATH_TRIG_TOOLTIP_SIN,COS:ot.Msg.MATH_TRIG_TOOLTIP_COS,TAN:ot.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:ot.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:ot.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:ot.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:ot.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},oe={init:function(){var t=[[ot.Msg.MATH_BIN,"bin"],[ot.Msg.MATH_OCT,"oct"],[ot.Msg.MATH_HEX,"hex"]];this.setColour(Qt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:ot.Msg.MATH_DEC_TOOLTIP_BIN,oct:ot.Msg.MATH_DEC_TOOLTIP_OCT,hex:ot.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},re={init:function(){var t=[[ot.Msg.LANG_MATH_TO_ROUND,"round"],[ot.Msg.LANG_MATH_TO_CEIL,"ceil"],[ot.Msg.LANG_MATH_TO_FLOOR,"floor"],[ot.Msg.MATH_ABS,"fabs"],[ot.Msg.MATH_SQRT,"sqrt"]];this.setColour(Qt),this.appendValueInput("A").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:ot.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:ot.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:ot.Msg.MATH_SINGLE_TOOLTIP_SQ,round:ot.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:ot.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:ot.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},ae={init:function(){var t=[[ot.Msg.MIXLY_MAX,"max"],[ot.Msg.MIXLY_MIN,"min"]];this.setColour(Qt),this.appendValueInput("A").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:ot.Msg.MIXLY_TOOLTIP_MATH_MAX,min:ot.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},le={init:function(){var t=[[ot.Msg.MATH_TWO,"two"],[ot.Msg.MATH_EIGHT,"eight"],[ot.Msg.MATH_TEN,"ten"],[ot.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Qt),this.appendDummyInput("").appendField(ot.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new ot.FieldDropdown(t),"OP").appendField(ot.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(ot.Msg.MATH_ZHW).appendField(new ot.FieldDropdown(t),"OP2").appendField(ot.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),n={two:ot.Msg.MATH_Before_two,eight:ot.Msg.MATH_Before_eight,ten:ot.Msg.MATH_Before_ten,sixteen:ot.Msg.MATH_Before_sixteen},i=e.getFieldValue("OP2"),s={two:ot.Msg.MATH_Behind_two,eight:ot.Msg.MATH_Behind_eight,ten:ot.Msg.MATH_Behind_ten,sixteen:ot.Msg.MATH_Behind_sixteen};return n[t]+s[i]}))}},ue={init:function(){var t=[[ot.Msg.LANG_MATH_INT,"int"],[ot.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Qt),this.setOutput(!0,Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_RANDOM).appendField(new ot.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),n={int:ot.Msg.LANG_MATH_INT,float:ot.Msg.LANG_MATH_FLOAT_RANDOM};return ot.Msg.MATH_RANDOM_INT_TOOLTIP+n[t]}))}},pe={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(ot.Msg.MATH_CONSTRAIN_TOOLTIP)}},_e={init:function(){this.setColour(Qt),this.appendValueInput("NUM",Number).appendField(ot.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(ot.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(ot.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_MATH_MAP)}},de={init:function(){this.setColour(Qt),this.appendDummyInput().appendField(new ot.FieldTextInput("0",ot.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(ot.Msg.MATH_NUMBER_TOOLTIP)}},he={init:function(){this.setColour(Qt),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},ce={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MATH_ROUND).appendField(ot.Msg.TEXT_KEEP),this.appendDummyInput().appendField(ot.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(ot.Msg.MATH_ROUND_NEW_TOOLTIP)}},Te={init:function(){var t=[[ot.Msg.MIXLY_TO_INT,"int"],[ot.Msg.MIXLY_TO_FLOAT,"float"],[ot.Msg.MIXLY_TO_BITES,"b"],[ot.Msg.LANG_MATH_BYTE+ot.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Qt),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ot.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:ot.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:ot.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Ie={init:function(){var t=[[ot.Msg.MIXLY_TO_INT,"int"],[ot.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Qt),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ot.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:ot.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},me=_e,Ee={init:function(){this.setColour(Qt),this.appendValueInput("VAR").appendField(ot.Msg.LANG_MATH_BYTE+ot.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},fe={init:function(){this.setColour(Qt),this.itemCount_=1,this.setMutator(new ot.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(ot.Msg.MIXLY_PRODUCT+ot.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(ot.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(ot.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(ot.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Re={init:function(){this.setColour(ge),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ot.FieldTextInput("",ot.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(ot.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new ot.FieldImage(e,7,12,'"')}},Ae={init:function(){this.setColour(ge),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(ot.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Se={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ce={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Le={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ye={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},De={init:function(){this.WHERE_OPTIONS=[[ot.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ot.Msg.TEXT_GET_INDEX_RANDOM+1+ot.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.LISTS_GET_INDEX_GET,"MODE"),ot.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(ot.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=t.getFieldValue("WHERE"),i="";switch(e+" "+n){case"GET FROM_START":case"GET FROM_END":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+ot.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",ot.Msg.ONE_BASED_INDEXING?"#1":"#0")),i}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),n={FROM_START:ot.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:ot.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:ot.Msg.TEXT_GET_INDEX_RANDOM};return ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+n[t]+"n"+ot.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==ot.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),ot.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(ot.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new ot.FieldDropdown(this.WHERE_OPTIONS,(function(e){var n="FROM_START"==e||"FROM_END"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),ot.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Ne={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.LISTS_GET_INDEX_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+ot.Msg.LISTS_GET_INDEX_FROM_START+"n"+ot.Msg.TEXT_CHARAT2)}},be={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(ot.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(ot.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},ve={init:function(){this.WHERE_OPTIONS_1=[[ot.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[ot.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(ot.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==ot.INPUT_VALUE;t.setAttribute("at1",e);var n=this.getInput("AT2").type==ot.INPUT_VALUE;return t.setAttribute("at2",n),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),n="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,n)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),ot.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(ot.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var n=new ot.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=e){var s=this.sourceBlock_;return s.updateAt_(t,i),s.setFieldValue(n,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(n,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},we={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(ot.Msg.LISTS_GET_INDEX_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ot.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(ot.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Fe={init:function(){var t=[[ot.Msg.MIXLY_EQUALS,"==="],[ot.Msg.MIXLY_STARTSWITH,"startswith"],[ot.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ge),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new ot.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Pe={init:function(){this.setColour(ge),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(ot.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_COMPARETO_HELP)}},ke={init:function(){var t=[[ot.Msg.TEXT_UPPER,"upper"],[ot.Msg.TEXT_TITLE,"title"],[ot.Msg.TEXT_CAPITALIZE,"capitalize"],[ot.Msg.TEXT_SWAPCASE,"swapcase"],[ot.Msg.TEXT_LOWER,"lower"]];this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ot.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:ot.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:ot.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:ot.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:ot.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:ot.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Ve={init:function(){var t=[[ot.Msg.TEXT_LJUST,"ljust"],[ot.Msg.TEXT_CENTER,"center"],[ot.Msg.TEXT_RJUST,"rjust"]];this.setColour(ge),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(ot.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(ot.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ye={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(ot.Msg.MIXLY_MID+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(ot.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},xe={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ue={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(ot.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(ot.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Be={init:function(){this.setColour(ge),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(ot.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(ot.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Xe={init:function(){var t=[[ot.Msg.TEXT_TRIM_BOTH,"strip"],[ot.Msg.TEXT_TRIM_LEFT,"lstrip"],[ot.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ge),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ot.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(ot.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:ot.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:ot.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:ot.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Ge={init:function(){this.setColour(ge),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new ot.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ot.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},xn={init:function(){this.setColour(Vn),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Un={init:function(){this.setColour(Vn),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Bn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_KEYS),this.setTooltip(ot.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Xn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(ot.Msg.DICTS_GET_TOOLTIP)}},Gn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(ot.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Hn={init:function(){this.setColour(Vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(ot.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Wn={init:function(){this.setColour(Vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_DELETE_TOOLTIP)}},Kn={init:function(){this.setColour(Vn),this.appendValueInput("DICT2").setCheck("Dict").appendField(ot.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(ot.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MID),this.setTooltip(ot.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_CLEAR),this.setTooltip(ot.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_ITEMS),this.setTooltip(ot.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},$n={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_VALUES),this.setTooltip(ot.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},zn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_LENGTH),this.setTooltip(ot.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Qn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_DELDICT),this.setTooltip(ot.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jn={init:function(){this.MODE=[[ot.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[ot.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(ot.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=ot.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=ot.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==ot.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new ot.FieldDropdown(this.MODE,(function(e){var n="INSERT"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Zn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setTooltip(ot.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},ti={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_SETDEFAULT_TOOLTIP)}},ei={init:function(){this.setColour(Vn),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new ot.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ni={init:function(){this.setColour(Vn),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ii={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TO_JSON),this.setTooltip(ot.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},si={init:function(){this.setColour(Vn),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(ot.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},oi={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},ri=210,ai={init:function(){var t=ot.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:ot.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:ot.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:ot.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:ot.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:ot.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:ot.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},li={init:function(){var t=ot.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=ot.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new ot.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},ui={init:function(){var t=[[ot.Msg.LOGIC_OPERATION_AND,"AND"],[ot.Msg.LOGIC_OPERATION_OR,"OR"],[ot.Msg.LOGIC_OPERATION_NOR,"NOR"],[ot.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:ot.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:ot.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:ot.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:ot.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},pi={init:function(){this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(ot.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(ot.Msg.LOGIC_NEGATE_TOOLTIP)}},_i={init:function(){var t=[[ot.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[ot.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new ot.FieldDropdown(t),"BOOL"),this.setTooltip(ot.Msg.LOGIC_BOOLEAN_TOOLTIP)}},di={init:function(){this.setColour(ri),this.setOutput(!0),this.appendDummyInput().appendField(ot.Msg.LOGIC_NULL),this.setTooltip(ot.Msg.LOGIC_NULL_TOOLTIP)}},hi={init:function(){this.setColour(ri),this.appendValueInput("A"),this.appendValueInput("B").appendField(ot.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(ot.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},ci={init:function(){var t=[[ot.Msg.TEXT_APPEND_TO,"in"],[ot.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(ri),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new ot.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(ot.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ot.Msg.IN)}},Ti={init:function(){var t=[[ot.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[ot.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(ri),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Ii={init:function(){this.setColour(ri),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},mi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(ot.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Ei={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},fi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG,r=ot.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s+r}))}},gi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.MIXPY_TEXT_ENCODE).appendField(new ot.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG,r=ot.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s+r}))}},Oi={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Mi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Ri={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+i}))}},Ai={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ot.Msg.MICROBIT_PYTHON_TYPE)}},Si={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.HTML_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Ci={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Li={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},yi={init:function(){this.setColour(0),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Di={init:function(){this.setColour(0),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Ni={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},bi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},vi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+i}))}},wi={init:function(){this.setColour(0),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Fi={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+ot.Msg.MIXLY_ESP32_SET+{mkdir:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Pi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(ot.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},ki={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Vi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.HTML_FILE,"isfile"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Yi={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SETUP+ot.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(ot.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},xi={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(ot.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Ui={};Ui.NAME_TYPE=ot.PROCEDURE_CATEGORY_NAME,Ui.allProcedures=function(t){for(var e=t.getAllBlocks(!1),n=[],i=[],s=0;s"),this.appendValueInput("style").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ps={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ks={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_FORM_CONTENT).appendField(new ot.FieldDropdown([[ot.Msg.HTML_TEXT,"text"],[ot.Msg.HTML_EMAIL,"email"],[ot.Msg.HTML_NUMBER,"number"],[ot.Msg.HTML_PASSWORD,"password"],[ot.Msg.HTML_CHECKBOX,"checkbox"],[ot.Msg.HTML_RADIOBUTTON,"radiobutton"],[ot.Msg.HTML_BUTTON,"button"],[ot.Msg.HTML_COLOUR,"colour"],[ot.Msg.HTML_DATE,"date"],[ot.Msg.HTML_LOCALTIME,"local time"],[ot.Msg.HTML_FILE,"file"],[ot.Msg.HTML_HIDDEN,"hidden"],[ot.Msg.HTML_IMAGE,"image"],[ot.Msg.HTML_MONTH,"month"],[ot.Msg.HTML_RANGE,"range"],[ot.Msg.HTML_RESET,"reset"],[ot.Msg.HTML_SEARCH,"search"],[ot.Msg.HTML_SUBMIT,"submit"],[ot.Msg.HTML_TELEPHONENUMBER,"telephone number"],[ot.Msg.HTML_TIME,"time"],[ot.Msg.HTML_URL,"url"],[ot.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(ot.Msg.HTML_NAME).appendField(new ot.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(ot.Msg.HTML_VALUE).appendField(new ot.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vs={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(new ot.FieldTextInput("property"),"KEY").appendField(":").appendField(new ot.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ys={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(new ot.FieldTextInput("property"),"KEY").appendField(":").appendField(new ot.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xs={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_TEXT).appendField(new ot.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us=160,Bs={init:function(){this.setColour(Us),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new ot.FieldTable(""),"TEXT")}},Xs={init:function(){this.setColour(Us),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new ot.FieldMultilineInput(""),"TEXT")}},Gs={init:function(){this.setColour(Us),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new ot.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Hs={init:function(){this.setColour(Us),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ws={init:function(){this.setColour(Us),this.appendDummyInput().appendTitle("Comment:").appendTitle(new ot.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ks={init:function(){this.setColour(Us),this.appendValueInput("VALUE").appendField(ot.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},js={init:function(){this.setColour(Us),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(ot.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=ot.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,n){return"("+t+" <= "+e+") and "+l()+"("+t+", "+e+", "+n+") or "+u()+"("+t+", "+e+", "+n+")"},ot.isNumber(i)&&ot.isNumber(s)&&ot.isNumber(o))i=parseFloat(i),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==i%1&&0==s%1&&0==o%1?(i<=s?(s++,t=0==i&&1==o?s:i+", "+s,1!=o&&(t+=", "+o)):t=i+", "+--s+", -"+o,t="range("+t+")"):(t=i",GTE:">="};const Va=function(t,e){var n=this.getFieldValue("OP"),i="&&"==n?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",i)||"False",o=e.valueToCode(this,"B",i)||"False";if("AND"==n)var r=s+" and "+o;else if("OR"==n)r=s+" or "+o;else if("NOR"==n)r="not("+s+"^"+o+")";else r=s+"^"+o;return[r,i]},Ya=function(t,e){var n=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",n)||"False"),n]},xa=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Ua=function(t,e){return["None",e.ORDER_ATOMIC]},Ba=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+n+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Xa=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Ga=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Ha=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Wa=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},Ka=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},ja=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},qa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},$a=function(t,e){var n=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+n+")\n"},za=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},Qa=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ja=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Za=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},tl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},el=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},nl=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},il=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},sl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ol=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},rl=function(t,e){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+i+")\n"},al=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ll=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},ul=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},pl=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},_l=function(t,e){e.definitions_.import_os="import os";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",e.ORDER_ATOMIC]},dl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},hl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},cl=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("NAME"),ot.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(i=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],r=0;r\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ql=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"\n"+n+"\n"},$l=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var s="<"+i+'>\n\t\n'+n+"\n";else s="<"+i+">\n"+n+"\n";return s},zl=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"\n"},Ql=function(t,e){var n=e.statementToCode(this,"DO"),i=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+i+" >\n"+n+"\n"},Jl=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Zl=function(t,e){return'"},tu=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},eu=function(){return this.getFieldValue("TEXT")+"\n"},nu=function(t){return t.getFieldValue("TEXT")+"\n"},iu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},su=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},ou=function(){return""},ru=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},au=function(t,e){for(var n=t.getFieldValue("NAME"),i=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+r.join("\n"):e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+r.join("\n")},uu.scrubNakedValue=function(t){return t+"\n"},uu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},uu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},uu.scrub_=function(t,e,n){var i="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=ot.utils.string.wrap(o,uu.COMMENT_WRAP-3),i+=uu.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+a+" + "+s+")":s<0?"int("+a+" - "+-s+")":"int("+a+")",i&&(a="-"+a)),a};const pu=205,_u={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(ot.Msg.MIXLY_CHOOSE_AND_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[ot.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[ot.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},du={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SETUP).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[ot.Msg.MIXLY_AipSpeech,"AipSpeech"],[ot.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[ot.Msg.MIXLY_AipFace,"AipFace"],[ot.Msg.MIXLY_AipOcr,"AipOcr"],[ot.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipSpeech_synthesis).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.OLED_STRING).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},cu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipSpeech_asr).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_AipSpeech_File).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Tu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipImageClassify).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(ot.Msg.MIXLY_AipImageClassify_Image).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Iu={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[ot.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[ot.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[ot.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[ot.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[ot.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},mu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipFace_match).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AipImageClassify_Image+"1"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(ot.Msg.MIXLY_AipImageClassify_Image+"2"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Eu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipOcr).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(ot.Msg.MIXLY_AipImageClassify_Image).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},fu={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[ot.Msg.MIXLY_AipOcr_webImage,"webImage"],[ot.Msg.MIXLY_AipOcr_idcard,"idcard"],[ot.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[ot.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[ot.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[ot.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[ot.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[ot.Msg.MIXLY_AipOcr_receipt,"receipt"],[ot.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[ot.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[ot.Msg.MIXLY_AipOcr_form,"tableRecognition"],[ot.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[ot.Msg.MIXLY_AipOcr_passport,"passport"],[ot.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},gu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.OLED_STRING).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Ou={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_Sim).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(ot.Msg.OLED_STRING+"1").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(ot.Msg.OLED_STRING+"2").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Mu={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipNlp_lexer,"lexer"],[ot.Msg.MIXLY_AipNlp_depParser,"depParser"],[ot.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[ot.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[ot.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[ot.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[ot.Msg.MIXLY_AipNlp_keyword,"keyword"],[ot.Msg.MIXLY_AipNlp_topic,"topic"],[ot.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[ot.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},Ru={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[ot.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},Au={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_topic).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(ot.Msg.MIXLY_AipNlp_Topic_Title).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(ot.Msg.MIXLY_AipNlp_Topic_Content).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Su={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_summary).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.MIXLY_AipNlp_Topic_Content).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(ot.Msg.MIXLY_LIST_LEN).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Cu={init:function(){this.setColour(pu),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(ot.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},Lu={init:function(){this.setColour(pu),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(ot.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},yu={init:function(){this.setColour(pu),this.appendValueInput("AI").appendField(ot.Msg.MIXPY_AI_RESULT).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify,"Image"],[ot.Msg.MIXLY_AipSpeech_asr,"Speech"],[ot.Msg.MIXLY_AipFace_match,"Face"],[ot.Msg.MIXLY_AipOcr,"Ocr"],[ot.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[ot.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(ot.Msg.LOGIC_NEGATE_TOOLTIP)}},Du="#526FC3",Nu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},bu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},vu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},wu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},Fu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Pu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ku={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Vu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Yu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},xu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Uu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Bu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},Xu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Gu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Hu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ku={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},ju={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},qu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$u={init:function(){this.appendDummyInput().appendField("准备").appendField(new ot.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},zu={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Qu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ju={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Zu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},tp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},ep={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},np={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ip={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},sp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},op={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},rp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ap={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},lp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},up={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},pp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new ot.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},_p={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},cp={init:function(){this.setColour(Du),this.appendDummyInput().appendField("n"+ot.Msg.MIXLY_VALUE2).appendField(new ot.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Tp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ip={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},mp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Ep={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},fp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},gp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Op={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Mp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Rp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Ap={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Sp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("计算").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Cp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Lp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},yp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Dp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Np={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},bp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new ot.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},vp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("使士兵").appendField(new ot.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},wp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("剩余").appendField(new ot.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Fp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Pp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},kp={init:function(){this.appendDummyInput().appendField("准备").appendField(new ot.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},Vp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Yp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},xp={init:function(){this.setColour(Du),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Up="#3288dd",Bp={init:function(){this.setColour(Up),this.appendValueInput("DOMAIN").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_REQUESTS_GET).appendField(new ot.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Xp={init:function(){this.setColour(Up),this.appendValueInput("URL").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(ot.Msg.blockpy_REQUESTS).appendField(ot.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Gp={init:function(){this.setColour(Up),this.appendValueInput("URL").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(ot.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(ot.Msg.blockpy_REQUESTS+ot.Msg.OLED_STRING),this.appendDummyInput("").appendField(ot.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Hp={init:function(){this.appendValueInput("VAL");var t=[[ot.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[ot.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(Up),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ot.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Wp={init:function(){this.appendValueInput("VAR").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Up),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(ot.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:ot.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ot.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},Kp="f0a559",jp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},qp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},$p={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},zp={init:function(){this.setColour(Kp),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(ot.Msg.MIXLY_MILLIS+ot.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},Qp={init:function(){this.setColour(Kp),this.appendDummyInput().appendField(ot.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Jp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE);var t=[[ot.Msg.MIXLY_CV_RECT,"rectangle"],[ot.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},Zp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new ot.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},t_={init:function(){this.setColour(Kp),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},e_={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(ot.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},n_={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(ot.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(ot.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(ot.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},i_=170,s_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_series_create).appendField(new ot.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},o_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_series_create).appendField(new ot.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(ot.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},r_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},a_={init:function(){this.setColour(i_);var t=[[ot.Msg.DATAFRAME_RAW,"index"],[ot.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(ot.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},l_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(ot.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(ot.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},u_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(new ot.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new ot.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},p_={init:function(){this.setColour(i_);var t=[[ot.Msg.SERIES_INDEX,"index"],[ot.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(ot.Msg.SERIES_INDEX_VALUE).appendField(new ot.FieldDropdown(t),"INDEX_VALUE"),this.setOutput(!0,"List");var e=this;this.setTooltip((function(){var t=e.getFieldValue("INDEX_VALUE");return{index:ot.Msg.SERIES_INDEX_TOOLTIP,value:ot.Msg.HTML_VALUE_TOOLTIP}[t]}))}},__={init:function(){this.setColour(i_),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(ot.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(ot.Msg.TUPLE_GET_INDEX_TOOLTIP)}},d_={init:function(){this.setColour(i_),this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},h_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},c_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},T_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},I_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},m_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},E_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SET_LABEL).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(ot.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},f_={init:function(){this.setColour(i_),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_SPLITBYDOU).appendField(ot.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},g_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[ot.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:ot.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},O_={init:function(){this.setColour(i_);var t=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],e=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_SCATTER).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(ot.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},M_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_XY).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},R_={init:function(){this.setColour(i_);var t=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_BAR).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(ot.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new ot.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},A_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[ot.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PIE).appendField(ot.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(ot.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new ot.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new ot.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},S_={init:function(){this.setColour(i_),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_HIST).appendField(ot.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(ot.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},C_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_SETTING).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_TICKS).appendField(ot.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},L_={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[ot.Msg.LANG_MATH_TO_ROUND,"round"],[ot.Msg.LANG_MATH_TO_CEIL,"ceil"],[ot.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(i_),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(ot.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP"),this.setTooltip(ot.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},y_={init:function(){this.setColour(i_),this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT).appendField(ot.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},D_={init:function(){this.setColour(i_),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[ot.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},N_={init:function(){this.setColour(i_),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(ot.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new ot.FieldDropdown([[ot.Msg.DATAFRAME_COLUMN,"column"],[ot.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(ot.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},b_={init:function(){this.setColour(i_),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},v_={init:function(){this.setColour(i_);var t=[[ot.Msg.TEXT_TRIM_LEFT,"right"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[ot.Msg.mixpy_PL_TEXT_TOP,"bottom"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.MIXLY_SETTING).appendField(ot.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_HOR).appendField(new ot.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_VER).appendField(new ot.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PL_TEXT_TOOLTIP)}},w_={init:function(){this.setColour(i_),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},F_={init:function(){this.setColour(i_),this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},P_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},k_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},V_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Y_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},x_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},U_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SET_LABEL).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(ot.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},B_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[ot.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:ot.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},X_={init:function(){this.setColour(i_);var t=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],e=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_SCATTER).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(ot.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},G_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_XY).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},H_={init:function(){this.setColour(i_);var t=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_BAR).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(ot.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new ot.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},W_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[ot.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PIE).appendField(ot.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(ot.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new ot.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new ot.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},K_={init:function(){this.setColour(i_),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_HIST).appendField(ot.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(ot.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},j_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_SETTING).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_TICKS).appendField(ot.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},q_={init:function(){this.setColour(i_),this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT).appendField(ot.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},$_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},z_={init:function(){this.setColour(i_);var t=[[ot.Msg.TEXT_TRIM_LEFT,"right"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[ot.Msg.mixpy_PL_TEXT_TOP,"bottom"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.MIXLY_SETTING).appendField(ot.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_HOR).appendField(new ot.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_VER).appendField(new ot.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PL_TEXT_TOOLTIP)}},Q_={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},J_={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},Z_={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new ot.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},td={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("创建二维图"),this.appendDummyInput().appendField("颜色").appendField(new ot.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},ed={init:function(){this.setColour(i_),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},nd={init:function(){this.setColour(i_),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},id={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},sd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},od={init:function(){this.setColour(i_),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},rd={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列").setCheck(String),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("从数据框中删除指定的列。用逗号分隔多个列名。")}},ad={init:function(){this.setColour(i_),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},ld={init:function(){this.setColour(i_),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},ud={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},pd={init:function(){this.setColour(i_),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},_d={init:function(){this.setColour(i_),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},dd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},hd={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},cd={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new ot.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},Td={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},Id={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},md={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},Ed={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},fd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},gd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},Od={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},Md={init:function(){this.setColour(i_),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},Rd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},Ad={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("排序方式").appendField(new ot.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Sd={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("获取").appendField(new ot.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(ot.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Cd={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ld={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},yd={init:function(){this.setColour(i_),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Dd={init:function(){this.setColour(i_),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nd=80,bd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new ot.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new ot.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("ds_create_linkedlist_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:"name"),"KEY"+e).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},vd={init:function(){this.setColour(Nd),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},wd={init:function(){this.setColour(Nd),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},Fd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_NODE_USE).appendField(new ot.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_CREATE_NODE_TOOLTIP)}},Pd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(ot.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_AIP_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},kd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(ot.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_AIP_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},Vd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[ot.Msg.DS_ADD_NODE_BEFORE,"before"],[ot.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_ADD_NODE_TOOLTIP)}},Yd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[ot.Msg.DS_ADD_NODE_BEFORE,"before"],[ot.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AS),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_ADD_NODE_TOOLTIP)}},xd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Ud={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(ot.Msg.DS_DEL_NODE_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AS),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Bd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Xd="#777777",Gd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField("from ").appendField(new ot.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new ot.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField("import ").appendField(new ot.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("items",this.itemCount_);for(var e=0;ee?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ah={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Sh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ch={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Lh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(ot.Msg.MIXLY_WIFI_USERNAME).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(ot.Msg.MIXLY_IOT_PASSWORD).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(ot.Msg.MIXLY_EMQX_PROJECT).setAlign(ot.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(ot.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Dh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MIXLY_EMQX_SUBSCRIBE+ot.Msg.MIXLY_MICROBIT_MSG).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(ot.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Nh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MSG.stop+ot.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},bh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ot.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Ph={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},kh={init:function(){this.setColour(Eh),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},Vh={init:function(){this.setColour(Eh),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Yh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},xh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO").appendField(ot.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(ot.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Uh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+ot.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xh={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Eh),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new ot.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new ot.FieldImage(e,12,12,'"')}},Gh={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Eh),this.appendDummyInput("").appendField(new ot.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},Hh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO").appendField(ot.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Wh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("HTTP"+ot.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ot.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(ot.Msg.MIXLY_REQUESTS_GET).appendField(ot.Msg.MIXLY_GET_CURRENT_TIME).appendField(ot.Msg.MIXLY_OPEN_DEBUG).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Kh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("HTTP"+ot.Msg.MIXLY_Client).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ot.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ot.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},jh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MQTT"+ot.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ot.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(ot.Msg.MIXLY_INIT_SUBSCRIBE).appendField(ot.MQTT_Topic).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(ot.Msg.MIXLY_OPEN_DEBUG).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MQTT"+ot.Msg.MIXLY_Client).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ot.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ot.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},$h=fh,zh=gh,Qh=Oh,Jh=Rh,Zh=230,tc={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},ec={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},nc={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},ic={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},sc={init:function(){this.setColour(40),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.MIXPY_SERIAL_OPEN)).appendField(new ot.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(ot.Msg.MIXLY_SERIAL_BEGIN).appendField(new ot.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},oc={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},rc={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},ac={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendDummyInput().appendField(ot.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},lc=80,uc={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},pc={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},_c={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},dc={init:function(){var t=[[ot.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[ot.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[ot.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[ot.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[ot.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[ot.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+ot.Msg.LOAD).appendField(new ot.FieldDropdown(t),"type").appendField(new ot.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("name"))&&this.setTitleValue(e,"name")}},hc={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+ot.Msg.DATA_SET),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.EIGENVALUES,"data"],[ot.Msg.LABEL_VALUE,"target"],[ot.Msg.FEATURE,"feature_names"],[ot.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},cc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Tc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Ic={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},mc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Ec={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},fc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},gc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_KNN_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Oc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Mc={init:function(){this.appendDummyInput().appendField("sklearn 初始化 PCA 算法"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_components").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_PCA_N_COMPONENTS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Rc={init:function(){this.appendDummyInput().appendField("sklearn PCA 降维"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Ac={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Sc={init:function(){this.appendDummyInput().appendField("sklearn K-均值聚类"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Cc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Lc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},yc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Dc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Nc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},bc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(ot.inputs.Align.RIGHT).setCheck(null).appendField(ot.Msg.MODEL_NAME),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_COEF,"coef_"],[ot.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},vc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[ot.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[ot.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},wc={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField("sklearn").appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_SAVE_MODEL,"dump"],[ot.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+ot.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Fc=120,Pc={init:function(){this.setColour(Fc),this.appendValueInput("DELAY_TIME",Number).appendField(ot.Msg.MIXLY_DELAY+"("+ot.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},kc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField(ot.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},Vc={init:function(){this.setColour(Fc),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},Yc={init:function(){this.setColour(Fc),this.appendValueInput("STATUS_CODE",Number).appendField(ot.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},xc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},Uc={init:function(){this.setColour(Fc),this.appendValueInput("TIME").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField("MsTimer2").appendField(ot.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField("MsTimer2").appendField(ot.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField("MsTimer2").appendField(ot.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gc={init:function(){this.setColour(Fc),this.appendValueInput("DELAY_TIME",Number).appendField(ot.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Hc=180,Wc={init:function(){this.setColour(Hc),this.appendDummyInput("").appendField(ot.Msg.blockpy_turtle_create).appendField(new ot.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Kc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qc={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_forward,"forward"],[ot.Msg.blockpy_backward,"backward"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:ot.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ot.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},$c={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_left,"left"],[ot.Msg.blockpy_right,"right"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_rotate).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{left:ot.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:ot.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[t]}))}},zc={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_setheading),this.appendDummyInput().appendField(ot.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qc={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(ot.Msg.MIXLY_MILLIS),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jc={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(ot.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zc={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},tT={init:function(){this.setColour(Hc);var t=[[ot.Msg.TURTLE_POS,"pos"],[ot.Msg.TURTLE_SHAPE,"shape"],[ot.Msg.TURTLE_HEADING,"heading"],[ot.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[ot.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[ot.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.TURTLE_POS_SHAPE).appendField(new ot.FieldDropdown(t),"DIR");var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{pos:ot.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:ot.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:ot.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:ot.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:ot.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:ot.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[t]})),this.setOutput(!0),this.setInputsInline(!0)}},eT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[ot.Msg.blockpy_turtle_reset,"reset"],[ot.Msg.blockpy_turtle_home,"home"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:ot.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:ot.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:ot.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},nT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_penup,"penup"],[ot.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{penup:ot.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:ot.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[t]}))}},iT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_beginfill,"begin"],[ot.Msg.blockpy_turtle_endfill,"end"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{begin:ot.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:ot.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[t]}))}},sT={init:function(){this.appendDummyInput("").appendField(new ot.FieldTextInput("tina"),"TUR");var t=[[ot.Msg.blockpy_turtle_size,"pensize"],[ot.Msg.MIXLY_SPEED,"speed"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_set).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{pensize:ot.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:ot.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[t]}))}},oT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_set_size),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_set_speed),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},aT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_circle,"circle"],[ot.Msg.blockpy_turtle_dot,"dot"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_draw).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{circle:ot.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:ot.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[t]}))}},lT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(ot.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},uT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_hide,"hideturtle"],[ot.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{hideturtle:ot.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:ot.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[t]}))}},pT={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_bgcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_T={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_pencolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_fillcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.TURTLE_CLONE),this.setTooltip(ot.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},cT={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},TT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_pencolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_fillcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ET={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR1").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fT={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},OT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},MT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_shape_arrow,"arrow"],[ot.Msg.blockpy_turtle_shape_turtle,"turtle"],[ot.Msg.blockpy_turtle_shape_circle,"circle"],[ot.Msg.blockpy_turtle_shape_square,"square"],[ot.Msg.blockpy_turtle_shape_triangle,"triangle"],[ot.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(Hc),this.appendDummyInput("").appendField(ot.Msg.blockpy_turtle_shape).appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_SHAPE_TOOLTIP)}},RT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},AT={init:function(){this.appendDummyInput("").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(Hc),this.appendValueInput("TITLE").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(ot.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(ot.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ot.Msg.TURTLE_NUMINPUT_TOOLTIP)}},ST={init:function(){this.appendDummyInput("").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(Hc),this.appendValueInput("TITLE").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},CT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},LT={init:function(){var t=[[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new ot.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new ot.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new ot.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},yT={init:function(){var t=[[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new ot.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new ot.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new ot.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},DT={init:function(){this.setColour(Hc),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},NT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new ot.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},vT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},wT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(ot.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},FT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendDummyInput().appendField(ot.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},PT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},kT=function(t,e){var n=this.getFieldValue("TYPE");return e.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",e.ORDER_ATOMIC]},VT=function(t,e){var n=this.getFieldValue("CTYPE");return e.definitions_.import_aip="import aip",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = aip."+n+"("+e.valueToCode(this,"API_KEY",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"SECRET_KEY",e.ORDER_ATOMIC)+")\n"},YT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".synthesis("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},xT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".asr("+(e.valueToCode(this,"FILE",e.ORDER_ATOMIC)||'""')+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},UT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},BT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".match("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"VAR2",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},XT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},GT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"STR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},HT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"STR1",e.ORDER_ATOMIC),s=e.valueToCode(this,"STR2",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+","+s+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},WT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".topic("+e.valueToCode(this,"STR1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"STR2",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},KT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".newsSummary("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"LEN",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},jT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},qT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},$T=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},zT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},QT=function(t,e){return e.definitions_.import_audio="import audio","audio.audio_record("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"TIME",e.ORDER_ATOMIC)||"0")+")\n"},JT=function(t,e){return e.definitions_.import_audio="import cam","cam.photo_capture("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"BUT",e.ORDER_ATOMIC)||'""')+")\n"},ZT=function(t,e){var n=e.valueToCode(this,"AI",e.ORDER_ASSIGNMENT)||"0",i=this.getFieldValue("CTYPE");if("Image"==i)var s=n+'["result"][0]["keyword"]';if("Speech"==i)s=n+'["result"][0]';if("Face"==i||"OcrSimilarity"==i)s=n+'["score"]';if("Ocr"==i)s=n+'["words_result"]';return[s,e.ORDER_ATOMIC]},tI=function(t,e){e.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[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], [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], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},eI=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},nI=function(t,e){e.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},iI=function(t,e){return["flag == 1",e.ORDER_ATOMIC]},sI=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},oI=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},rI=function(t,e){e.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},aI=function(){var t="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return t="house[f].hide()\ndrive(path[len(path) - 1])\n"+t},lI=function(t,e){return["len(path) == 7",e.ORDER_ATOMIC]},uI=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},pI=function(t,e){e.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[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], [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], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},_I=function(t,e){return["f == 1",e.ORDER_ATOMIC]},dI=function(){return"print('没有符合条件的路线')\n"},hI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},cI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},TI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},II=function(t,e){return["name[now] != '小科家'",e.ORDER_ATOMIC]},mI=function(t,e){return["name[now] != '学校'",e.ORDER_ATOMIC]},EI=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},fI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高!不得高于6层!')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},gI=function(t,e){var n=e.valueToCode(this,"FROM_NUM",e.ORDER_ATOMIC)||"0",i=e.valueToCode(this,"TO_NUM",e.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},OI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},MI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},RI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},AI=function(t,e){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",e.ORDER_ATOMIC]},SI=function(t,e){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",e.ORDER_ATOMIC]},CI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},LI=function(t,e){return["len(list)>=2",e.ORDER_ATOMIC]},yI=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},DI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},NI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},bI=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},vI=function(t,e){var n=this.getFieldValue("NUM");return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},wI=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},FI=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},PI=function(t,e){e.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},kI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},VI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},YI=function(t,e){return["_rabbit < _head",e.ORDER_ATOMIC]},xI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},UI=function(t,e){return["_rabbit*4 + _chick*2 == _foot",e.ORDER_ATOMIC]},BI=function(t,e){e.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},XI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},GI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},HI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var s="";return s+=`_S${n}.show()\ntime.sleep(1)\n`,s+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},WI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,e.ORDER_ATOMIC]},KI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},jI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},qI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},$I=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},zI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},QI=function(t,e){return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,e.ORDER_ATOMIC]},JI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},ZI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},tm=function(t,e){e.definitions_.import_turtle="import turtle",e.definitions_.import_time="import time",e.definitions_.import_math="import math";var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),i=this.getFieldValue("NUM");return e.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",e.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",e.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,e.ORDER_ATOMIC]},wE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.groupby(by=${e.valueToCode(t,"KEY",e.ORDER_ATOMIC)||"'tag'"})`,e.ORDER_ATOMIC]},FE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.${t.getFieldValue("TYPE")}()`,e.ORDER_ATOMIC]},PE=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},kE=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=e.variableDB_.getName(this.getFieldValue("TYPE"),ot.Variables.NAME_TYPE),s="class "+i+":\n";s+=" def __init__(self):\n";for(var o=new Array(this.itemCount_),r=0;r{document.removeEventListener("DOMContentLoaded",t),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",t)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:e}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,211));this._kernel=new e(t);break;case"python3-old":case"python3.8":const{KernelPython3Old:i}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,5195));this._kernel=new i(t);break;case"js":case"javascript":const{KernelJavaScript:s}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new s(t);break;case"sql":const{KernelSQL:o}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,592));this._kernel=new o(t);break;case"ocaml":const{KernelOCaml:r}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,38));this._kernel=new r(t);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const t=await this.kernelAvailable();return await t.loaded(),t}get kernel(){return this._kernel}get kernelSafe(){var t;return(null===(t=this.kernel)||void 0===t?void 0:t.ready)?this.kernel:null}async showLoader(t,e=!1,n=!0){this.kernelAvailable().then((()=>{var t;return null===(t=this.kernel)||void 0===t?void 0:t.init()})),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const i="basthon-loader-"+(e?"full":"foot"),s=document.createElement("div");s.id=this._loaderId,s.classList.add("darklighted"),s.classList.add("basthon-loader-root"),s.classList.add(i);const o=document.createElement("div");o.classList.add("basthon-loader-container"),o.classList.add(i),s.appendChild(o);const r=document.createElement("div");r.classList.add("basthon-loader-spinner"),r.classList.add(i),r.innerHTML="",o.appendChild(r);const a=document.createElement("div");a.classList.add("basthon-loader-break"),a.classList.add(i),o.appendChild(a);const l=document.createElement("div");l.classList.add("basthon-loader-text"),l.classList.add(i),l.innerHTML=t,o.appendChild(l),this._loaderTextElem=l;const u=document.createElement("div");u.classList.add("basthon-loader-text"),u.classList.add(i),u.style.display="none",o.appendChild(u),this._loaderTextError=u,await this.pageLoad(),document.body.appendChild(s),this._rootLoader=s;try{await this.kernelLoaded()}catch(t){const e=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!
Vérifiez que votre navigateur est à jour.
Version détectée : ${e.name} ${e.version}.`);for(const t of document.body.querySelectorAll(".basthon-loader-foot"))t.classList.remove("basthon-loader-foot"),t.classList.add("basthon-loader-full");return r.classList.remove("basthon-loader-spinner"),r.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(t){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=t)}setErrorText(t){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=t)}hideLoader(){if(this._doNotHideLoader)return;const t=this._rootLoader;null!=t&&(t.classList.add("basthon-loader-hide"),window.setTimeout((()=>{this._rootLoader=void 0,t.remove()}),1100))}browser(){var t,e=navigator.userAgent,n=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(t=/\brv[ :]+(\d+)/g.exec(e)||[])[1]||""}:"Chrome"===n[1]&&null!=(t=e.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:t[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=e.match(/version\/(\d+)/i))&&n.splice(1,1,t[1]),{name:n[0],version:n[1]})}}class dO extends rt.PageBase{static{rt.HTMLTemplate.add("html/statusbar/statusbar-image.html",new rt.HTMLTemplate('\r\n
')),this.init=function(){rt.StatusBarsManager.typesRegistry.register(["images"],dO);const t=rt.Workspace.getMain().getStatusBarsManager();return t.add("images","images",ot.Msg.PYTHON_PYODIDE_IMAGE),t.changeTo("output"),t.get("images")}}constructor(){super();const t=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(t)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(t){const e=this.getContent(),n=function(t){t.style.width="auto",t.style.height="auto",t.style.maxWidth="100%",t.style.maxHeight="100%"};this.clean();let i=t.content,s=null,o=null;switch(t.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver((function(t){t.forEach((t=>t.addedNodes.forEach((t=>{const e=t;null!=e.tagName&&["canvas","video"].includes(e.tagName.toLowerCase())&&n(e)}))))})).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),e.append(i);break;case"matplotlib":s=i.querySelector("canvas"),s&&(i=s),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),e.append(i.outerHTML);break;case"sympy":e.append(t.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let t=document.createElement("script");t.type="text/javascript",t.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(t)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in t.content){let i=t.content[n];"image/png"===n&&(i=''),e.append(i);break}break;case"tutor":if(e.append(uO()(t.content.replace("overflow-y%3A%20hidden%3B",""))),o=this.getContent()[0].getElementsByTagName("iframe")[0],null==o)return;o.style.maxHeight=o.style.minHeight="100%",new IntersectionObserver(((t,e)=>{const n=t[0];n&&!n.isIntersecting||(o.contentWindow?.postMessage({type:"redraw"},"*"),e.disconnect())})).observe(o);break;default:console.error(`Not supported node type '${t.display_type}' in eval.display result processing.`)}}}const hO=layui;var cO;!function(t){t[t.EPERM=1]="EPERM",t[t.ENOENT=2]="ENOENT",t[t.EINTR=4]="EINTR",t[t.EIO=5]="EIO",t[t.ENXIO=6]="ENXIO",t[t.EBADF=9]="EBADF",t[t.EAGAIN=11]="EAGAIN",t[t.ENOMEM=12]="ENOMEM",t[t.EACCES=13]="EACCES",t[t.EFAULT=14]="EFAULT",t[t.ENOTBLK=15]="ENOTBLK",t[t.EBUSY=16]="EBUSY",t[t.EEXIST=17]="EEXIST",t[t.EXDEV=18]="EXDEV",t[t.ENODEV=19]="ENODEV",t[t.ENOTDIR=20]="ENOTDIR",t[t.EISDIR=21]="EISDIR",t[t.EINVAL=22]="EINVAL",t[t.ENFILE=23]="ENFILE",t[t.EMFILE=24]="EMFILE",t[t.ETXTBSY=26]="ETXTBSY",t[t.EFBIG=27]="EFBIG",t[t.ENOSPC=28]="ENOSPC",t[t.ESPIPE=29]="ESPIPE",t[t.EROFS=30]="EROFS",t[t.EMLINK=31]="EMLINK",t[t.EPIPE=32]="EPIPE",t[t.EDOM=33]="EDOM",t[t.ERANGE=34]="ERANGE",t[t.EDEADLK=35]="EDEADLK",t[t.ENAMETOOLONG=36]="ENAMETOOLONG",t[t.ENOLCK=37]="ENOLCK",t[t.ENOSYS=38]="ENOSYS",t[t.ENOTEMPTY=39]="ENOTEMPTY",t[t.ELOOP=40]="ELOOP",t[t.ENOMSG=42]="ENOMSG",t[t.EBADE=52]="EBADE",t[t.EBADR=53]="EBADR",t[t.EXFULL=54]="EXFULL",t[t.ENOANO=55]="ENOANO",t[t.EBADRQC=56]="EBADRQC",t[t.ENOSTR=60]="ENOSTR",t[t.ENODATA=61]="ENODATA",t[t.ETIME=62]="ETIME",t[t.ENOSR=63]="ENOSR",t[t.ENONET=64]="ENONET",t[t.EREMOTE=66]="EREMOTE",t[t.ENOLINK=67]="ENOLINK",t[t.ECOMM=70]="ECOMM",t[t.EPROTO=71]="EPROTO",t[t.EBADMSG=74]="EBADMSG",t[t.EOVERFLOW=75]="EOVERFLOW",t[t.EBADFD=77]="EBADFD",t[t.ESTRPIPE=86]="ESTRPIPE",t[t.ENOTSOCK=88]="ENOTSOCK",t[t.EDESTADDRREQ=89]="EDESTADDRREQ",t[t.EMSGSIZE=90]="EMSGSIZE",t[t.EPROTOTYPE=91]="EPROTOTYPE",t[t.ENOPROTOOPT=92]="ENOPROTOOPT",t[t.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",t[t.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",t[t.ENOTSUP=95]="ENOTSUP",t[t.ENETDOWN=100]="ENETDOWN",t[t.ENETUNREACH=101]="ENETUNREACH",t[t.ENETRESET=102]="ENETRESET",t[t.ETIMEDOUT=110]="ETIMEDOUT",t[t.ECONNREFUSED=111]="ECONNREFUSED",t[t.EHOSTDOWN=112]="EHOSTDOWN",t[t.EHOSTUNREACH=113]="EHOSTUNREACH",t[t.EALREADY=114]="EALREADY",t[t.EINPROGRESS=115]="EINPROGRESS",t[t.ESTALE=116]="ESTALE",t[t.EREMOTEIO=121]="EREMOTEIO",t[t.EDQUOT=122]="EDQUOT"}(cO||(cO={}));const TO={[cO.EPERM]:"Operation not permitted",[cO.ENOENT]:"No such file or directory",[cO.EINTR]:"Interrupted system call",[cO.EIO]:"Input/output error",[cO.ENXIO]:"No such device or address",[cO.EBADF]:"Bad file descriptor",[cO.EAGAIN]:"Resource temporarily unavailable",[cO.ENOMEM]:"Cannot allocate memory",[cO.EACCES]:"Permission denied",[cO.EFAULT]:"Bad address",[cO.ENOTBLK]:"Block device required",[cO.EBUSY]:"Resource busy or locked",[cO.EEXIST]:"File exists",[cO.EXDEV]:"Invalid cross-device link",[cO.ENODEV]:"No such device",[cO.ENOTDIR]:"File is not a directory",[cO.EISDIR]:"File is a directory",[cO.EINVAL]:"Invalid argument",[cO.ENFILE]:"Too many open files in system",[cO.EMFILE]:"Too many open files",[cO.ETXTBSY]:"Text file busy",[cO.EFBIG]:"File is too big",[cO.ENOSPC]:"No space left on disk",[cO.ESPIPE]:"Illegal seek",[cO.EROFS]:"Cannot modify a read-only file system",[cO.EMLINK]:"Too many links",[cO.EPIPE]:"Broken pipe",[cO.EDOM]:"Numerical argument out of domain",[cO.ERANGE]:"Numerical result out of range",[cO.EDEADLK]:"Resource deadlock would occur",[cO.ENAMETOOLONG]:"File name too long",[cO.ENOLCK]:"No locks available",[cO.ENOSYS]:"Function not implemented",[cO.ENOTEMPTY]:"Directory is not empty",[cO.ELOOP]:"Too many levels of symbolic links",[cO.ENOMSG]:"No message of desired type",[cO.EBADE]:"Invalid exchange",[cO.EBADR]:"Invalid request descriptor",[cO.EXFULL]:"Exchange full",[cO.ENOANO]:"No anode",[cO.EBADRQC]:"Invalid request code",[cO.ENOSTR]:"Device not a stream",[cO.ENODATA]:"No data available",[cO.ETIME]:"Timer expired",[cO.ENOSR]:"Out of streams resources",[cO.ENONET]:"Machine is not on the network",[cO.EREMOTE]:"Object is remote",[cO.ENOLINK]:"Link has been severed",[cO.ECOMM]:"Communication error on send",[cO.EPROTO]:"Protocol error",[cO.EBADMSG]:"Bad message",[cO.EOVERFLOW]:"Value too large for defined data type",[cO.EBADFD]:"File descriptor in bad state",[cO.ESTRPIPE]:"Streams pipe error",[cO.ENOTSOCK]:"Socket operation on non-socket",[cO.EDESTADDRREQ]:"Destination address required",[cO.EMSGSIZE]:"Message too long",[cO.EPROTOTYPE]:"Protocol wrong type for socket",[cO.ENOPROTOOPT]:"Protocol not available",[cO.EPROTONOSUPPORT]:"Protocol not supported",[cO.ESOCKTNOSUPPORT]:"Socket type not supported",[cO.ENOTSUP]:"Operation is not supported",[cO.ENETDOWN]:"Network is down",[cO.ENETUNREACH]:"Network is unreachable",[cO.ENETRESET]:"Network dropped connection on reset",[cO.ETIMEDOUT]:"Connection timed out",[cO.ECONNREFUSED]:"Connection refused",[cO.EHOSTDOWN]:"Host is down",[cO.EHOSTUNREACH]:"No route to host",[cO.EALREADY]:"Operation already in progress",[cO.EINPROGRESS]:"Operation now in progress",[cO.ESTALE]:"Stale file handle",[cO.EREMOTEIO]:"Remote I/O error",[cO.EDQUOT]:"Disk quota exceeded"};class IO extends Error{static fromJSON(t){const e=new IO(t.errno,t.message,t.path,t.syscall);return e.code=t.code,e.stack=t.stack,e}static With(t,e,n){return new IO(cO[t],TO[cO[t]],e,n)}constructor(t,e=TO[t],n,i=""){super(e),this.errno=t,this.path=n,this.syscall=i,this.code=cO[t],this.message=this.code+": "+e+(this.path?`, '${this.path}'`:"")}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}}let mO="/";function EO(t,e){let n="",i=0,s=-1,o=0,r="\0";for(let a=0;a<=t.length;++a){if(a2){const t=n.lastIndexOf("/");-1===t?(n="",i=0):(n=n.slice(0,t),i=n.length-1-n.lastIndexOf("/")),s=a,o=0;continue}if(0!==n.length){n="",i=0,s=a,o=0;continue}}e&&(n+=n.length>0?"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),i=a-s-1;s=a,o=0}else"."===r&&-1!==o?++o:o=-1}return n}function fO(...t){let e="";for(const n of[...t.reverse(),mO])if(n.length&&(e=`${n}/${e}`,n.startsWith("/")))break;const n=e.startsWith("/");return e=EO(e,!n),n?`/${e}`:e.length?e:"/"}function gO(...t){if(!t.length)return".";const e=t.join("/");return e?.length?function(t){if(!t.length)return".";const e=t.startsWith("/"),n=t.endsWith("/");return(t=EO(t,!e)).length?(n&&(t+="/"),e?`/${t}`:t):e?"/":n?"./":"."}(e):"."}function OO(t){if(0===t.length)return".";const e="/"===t[0];let n=-1,i=!0;for(let e=t.length-1;e>=1;--e)if("/"===t[e]){if(!i){n=e;break}}else i=!1;return-1===n?e?"/":".":e&&1===n?"//":t.slice(0,n)}function MO(t,e){let n=0,i=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,r=-1;for(let a=t.length-1;a>=0;--a)if("/"===t[a]){if(!s){n=a+1;break}}else-1===r&&(s=!1,r=a+1),o>=0&&(t[a]===e[o]?-1==--o&&(i=a):(o=-1,i=r));return n===i?i=r:-1===i&&(i=t.length),t.slice(n,i)}for(let e=t.length-1;e>=0;--e)if("/"===t[e]){if(!s){n=e+1;break}}else-1===i&&(s=!1,i=e+1);return-1===i?"":t.slice(n,i)}function RO(t){const e=t.startsWith("/"),n={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(0===t.length)return n;const i=e?1:0;let s=-1,o=0,r=-1,a=!0,l=t.length-1,u=0;for(;l>=i;--l)if("/"!==t[l])-1===r&&(a=!1,r=l+1),"."===t[l]?-1===s?s=l:1!==u&&(u=1):-1!==s&&(u=-1);else if(!a){o=l+1;break}if(-1!==r){const i=0===o&&e?1:o;-1===s||0===u||1===u&&s===r-1&&s===o+1?n.base=n.name=t.slice(i,r):(n.name=t.slice(i,s),n.base=t.slice(i,r),n.ext=t.slice(s,r))}return o>0?n.dir=t.slice(0,o-1):e&&(n.dir="/"),n}const AO=new TextEncoder;function SO(t){if("string"!=typeof t)throw new IO(cO.EINVAL,"Can not encode a non-string");return AO.encode(t)}const CO=new TextDecoder;function LO(t){if(!(t instanceof Uint8Array))throw new IO(cO.EINVAL,"Can not decode a non-Uint8Array");return CO.decode(t)}function yO(t){return JSON.parse(LO(t),((t,e)=>""==t?e:BigInt(e)))}function DO(t){return SO(JSON.stringify(t,((t,e)=>""==t?e:e.toString())))}function NO(t,e){if("number"==typeof t)return t;if("string"==typeof t){const e=parseInt(t,8);if(!isNaN(e))return e}if("number"==typeof e)return e;throw new IO(cO.EINVAL,"Invalid mode: "+t?.toString())}function bO(t){if(t instanceof Date)return t;try{return new Date(t)}catch{throw new IO(cO.EINVAL,"Invalid time.")}}function vO(t){if((t=t.toString()).includes("\0"))throw new IO(cO.EINVAL,"Path can not contain null character");if(0==t.length)throw new IO(cO.EINVAL,"Path can not be empty");return fO(t.replaceAll(/[/\\]+/g,"/"))}function wO(t,e="utf8",n,i=0){return"object"!=typeof t||null===t?{encoding:"string"==typeof t?t:e??null,flag:n,mode:i}:{encoding:"string"==typeof t?.encoding?t.encoding:e??null,flag:"string"==typeof t?.flag?t.flag:n,mode:NO("mode"in t?t?.mode:null,i)}}function FO(){return crypto.getRandomValues(new BigUint64Array(1))[0]}const PO={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0,groups:[]};function kO(t){return{suid:t.uid,sgid:t.gid,euid:t.uid,egid:t.gid,groups:[],...t}}const VO=0,YO=4,xO=2,UO=1,BO=1,XO=2,GO=4,HO=0,WO=1,KO=2,jO=64,qO=128,$O=256,zO=512,QO=1024,JO=65536,ZO=262144,tM=131072,eM=1052672,nM=4096,iM=32768,sM=16384,oM=2048,rM=61440,aM=49152,lM=40960,uM=32768,pM=24576,_M=16384,dM=8192,hM=4096,cM=2048,TM=1024,IM=512,mM=448,EM=256,fM=128,gM=64,OM=56,MM=32,RM=16,AM=8,SM=7,CM=4,LM=2,yM=1,DM=0,NM=2**32-1,bM={checkAccess:!0,updateOnRead:!0,syncImmediately:!0,unsafeBufferReplace:!1};Promise.withResolvers??(Promise.withResolvers=function(){let t,e;const n=new Promise(((n,i)=>{t=n,e=i}));return{promise:n,resolve:t,reject:e}}),Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));class vM{_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}constructor({atimeMs:t,mtimeMs:e,ctimeMs:n,birthtimeMs:i,uid:s,gid:o,size:r,mode:a,ino:l}={}){this.dev=this._convert(0),this.ino=this._convert(0),this.rdev=this._convert(0),this.nlink=this._convert(1),this.blksize=this._convert(4096),this.uid=this._convert(0),this.gid=this._convert(0);const u=Date.now();this.atimeMs=this._convert(t??u),this.mtimeMs=this._convert(e??u),this.ctimeMs=this._convert(n??u),this.birthtimeMs=this._convert(i??u),this.uid=this._convert(s??0),this.gid=this._convert(o??0),this.size=this._convert(r??0),this.ino=this._convert(l??0),this.mode=this._convert(a??420&uM),this.mode&rM||(this.mode=this.mode|this._convert(uM))}isFile(){return(this.mode&rM)===uM}isDirectory(){return(this.mode&rM)===_M}isSymbolicLink(){return(this.mode&rM)===lM}isSocket(){return(this.mode&rM)===aM}isBlockDevice(){return(this.mode&rM)===pM}isCharacterDevice(){return(this.mode&rM)===dM}isFIFO(){return(this.mode&rM)===hM}hasAccess(t,e){const n=e?.credentials||PO;if(this.isSymbolicLink()||0===n.euid||0===n.egid)return!0;let i=0;return n.uid===this.uid&&(this.mode&EM&&(i|=YO),this.mode&fM&&(i|=xO),this.mode&gM&&(i|=UO)),(n.gid===this.gid||n.groups.includes(Number(this.gid)))&&(this.mode&MM&&(i|=YO),this.mode&RM&&(i|=xO),this.mode&AM&&(i|=UO)),this.mode&CM&&(i|=YO),this.mode&LM&&(i|=xO),this.mode&yM&&(i|=UO),(i&t)===t}chmod(t){this.mode=this._convert(this.mode&rM|t)}chown(t,e){t=Number(t),e=Number(e),!isNaN(t)&&0<=t&&t<2**32&&(this.uid=this._convert(t)),!isNaN(e)&&0<=e&&e<2**32&&(this.gid=this._convert(e))}get atimeNs(){return 1000n*BigInt(this.atimeMs)}get mtimeNs(){return 1000n*BigInt(this.mtimeMs)}get ctimeNs(){return 1000n*BigInt(this.ctimeMs)}get birthtimeNs(){return 1000n*BigInt(this.birthtimeMs)}}function wM(t,e,n){!isNaN(e)&&0<=e&&e<2**32&&(t.uid=e),!isNaN(n)&&0<=n&&n<2**32&&(t.gid=n)}class FM extends vM{constructor(){super(...arguments),this._isBigint=!1}}class PM extends vM{constructor(){super(...arguments),this._isBigint=!0}}class kM{constructor(){this.type=525687744115,this.bsize=4096,this.blocks=0,this.bfree=0,this.bavail=0,this.files=NM,this.ffree=NM}}class VM{constructor(){this.type=0x7a656e6673n,this.bsize=4096n,this.blocks=0n,this.bfree=0n,this.bavail=0n,this.files=BigInt(NM),this.ffree=BigInt(NM)}}const YM=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function xM(t){if("number"==typeof t)return function(t){switch(t){case HO:return"r";case HO|eM:return"rs";case KO:return"r+";case KO|eM:return"rs+";case zO|jO|WO:return"w";case zO|jO|WO|qO:return"wx";case zO|jO|KO:return"w+";case zO|jO|KO|qO:return"wx+";case QO|jO|WO:return"a";case QO|jO|WO|qO:return"ax";case QO|jO|KO:return"a+";case QO|jO|KO|qO:return"ax+";default:throw new Error("Invalid flag number: "+t)}}(t);if(!YM.includes(t))throw new Error("Invalid flag string: "+t);return t}function UM(t){let e=0;return e<<=1,e+=+BM(t),e<<=1,e+=+XM(t),e<<=1,e}function BM(t){return-1!==t.indexOf("r")||-1!==t.indexOf("+")}function XM(t){return-1!==t.indexOf("w")||-1!==t.indexOf("a")||-1!==t.indexOf("+")}function GM(t){return-1!==t.indexOf("w")}function HM(t){return-1!==t.indexOf("a")}function WM(t){return-1!==t.indexOf("x")}class KM{constructor(t,e){this.fs=t,this.path=e}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}}class jM extends KM{constructor(t,e,n,i,s=new Uint8Array(new ArrayBuffer(0,t.metadata().noResizableBuffers?{}:{maxByteLength:NM}))){if(super(t,e),this.flag=n,this.stats=i,this._buffer=s,this._position=0,this.dirty=!1,this.closed=!1,this.stats.size!=s.byteLength){if(BM(this.flag))throw new Error(`Size mismatch: buffer length ${s.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return HM(this.flag)?this.stats.size:this._position}set position(t){this._position=t}async sync(){if(this.closed)throw IO.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw IO.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw IO.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw IO.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(t){if(this.closed)throw IO.With("EBADF",this.path,"File.dispose");if(this.dirty&&!t)throw IO.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw IO.With("EBADF",this.path,"File.stat");return Promise.resolve(new FM(this.stats))}statSync(){if(this.closed)throw IO.With("EBADF",this.path,"File.stat");return new FM(this.stats)}_truncate(t){if(this.closed)throw IO.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!XM(this.flag))throw new IO(cO.EPERM,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),t>this._buffer.length){const e=new Uint8Array(t-this._buffer.length);this._write(e,0,e.length,this._buffer.length)}else this.stats.size=t,this._buffer=t?this._buffer.slice(0,t):new Uint8Array}async truncate(t){this._truncate(t),bM.syncImmediately&&await this.sync()}truncateSync(t){this._truncate(t),bM.syncImmediately&&this.syncSync()}_write(t,e=0,n=this.stats.size,i=this.position){if(this.closed)throw IO.With("EBADF",this.path,"File.write");if(!XM(this.flag))throw new IO(cO.EPERM,"File not opened with a writeable mode.");this.dirty=!0;const s=i+n,o=t.slice(e,e+n);if(s>this.stats.size&&(this.stats.size=s,s>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=s)this._buffer.buffer.resize(s);else if(bM.unsafeBufferReplace)this._buffer=o;else{const t=new Uint8Array(new ArrayBuffer(s,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:NM}));t.set(this._buffer),this._buffer=t}return this._buffer.set(o,i),this.stats.mtimeMs=Date.now(),this.position=i+o.byteLength,o.byteLength}async write(t,e,n,i){const s=this._write(t,e,n,i);return bM.syncImmediately&&await this.sync(),s}writeSync(t,e=0,n=this.stats.size,i=this.position){const s=this._write(t,e,n,i);return bM.syncImmediately&&this.syncSync(),s}_read(t,e=0,n=this.stats.size,i){if(this.closed)throw IO.With("EBADF",this.path,"File.read");if(!BM(this.flag))throw new IO(cO.EPERM,"File not opened with a readable mode.");bM.updateOnRead&&(this.dirty=!0),this.stats.atimeMs=Date.now(),i??(i=this.position);let s=i+n;s>this.stats.size&&(s=i+Math.max(this.stats.size-i,0)),this._position=s;const o=s-i;return 0==o||new Uint8Array(t.buffer,e,n).set(this._buffer.slice(i,s)),o}async read(t,e,n,i){const s=this._read(t,e,n,i);return bM.syncImmediately&&await this.sync(),{bytesRead:s,buffer:t}}readSync(t,e,n,i){const s=this._read(t,e,n,i);return bM.syncImmediately&&this.syncSync(),s}async chmod(t){if(this.closed)throw IO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>rM?~rM:rM)|t,(bM.syncImmediately||t>rM)&&await this.sync()}chmodSync(t){if(this.closed)throw IO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>rM?~rM:rM)|t,(bM.syncImmediately||t>rM)&&this.syncSync()}async chown(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.chown");this.dirty=!0,wM(this.stats,t,e),bM.syncImmediately&&await this.sync()}chownSync(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.chown");this.dirty=!0,wM(this.stats,t,e),bM.syncImmediately&&this.syncSync()}async utimes(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,bM.syncImmediately&&await this.sync()}utimesSync(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,bM.syncImmediately&&this.syncSync()}}class qM{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:525687744115}}constructor(...t){}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(t){return"ENOENT"!=t.code}}existsSync(t){try{return this.statSync(t),!0}catch(t){return"ENOENT"!=t.code}}}var $M=__webpack_require__(228);Symbol.toStringTag,Symbol.iterator;const zM=Intl.NumberFormat("en",{notation:"compact"});zM.format.bind(zM);function QM(t){return t.at(0).toUpperCase()+t.slice(1)}const JM=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],ZM=[...JM,...JM.map((t=>QM(t))),"char"],tR=/^(u?int|float)(8|16|32|64)$/i;function eR(t){return"char"==t?"uint8":t.toLowerCase()}function nR(t){return tR.test(t.toString())}function iR(t){return"char"==t||tR.test(t.toString().toLowerCase())}Symbol.struct_init||=Symbol("struct_init"),Symbol.struct_metadata||=Symbol("struct_metadata");Symbol.struct_init,Symbol.struct_metadata;function sR(t){const e=Symbol.metadata||Object.getOwnPropertySymbols(t).find((t=>"Symbol.metadata"==t.description));var n;if(n=t,Symbol?.metadata&&(Symbol.metadata in n||Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)})),!e)throw new ReferenceError("Could not get a reference to Symbol.metadata");return e}function oR(t){return"function"==typeof t&&sR(t)in t&&function(t){return null!=t&&"object"==typeof t&&Symbol.struct_metadata in t}(t[sR(t)])}function rR(t){return null!=t&&"object"==typeof t&&oR(t.constructor)}function aR(t){if(!rR(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct instance")}function lR(t){if(!function(t){return rR(t)||oR(t)}(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct")}function uR(t){if("string"==typeof t)return function(t){if(!iR(t))throw new TypeError("Not a valid primitive type: "+t)}(t),+eR(t).match(tR)[2]/8;lR(t);const e=oR(t)?t:t.constructor;return e[sR(e)][Symbol.struct_metadata].size}function pR(t={}){return function(e,n){n.metadata??={},n.metadata[Symbol.struct_init]||=[];let i=0;const s=new Map;for(const e of n.metadata[Symbol.struct_init]){const{name:n,type:a,length:l}=e;if(!iR(a)&&!oR(a))throw new TypeError("Not a valid type: "+a);s.set(n,{offset:i,type:iR(a)?eR(a):a,length:l}),i+=uR(a)*(l||1),o=i,r=t.align||1,i=Math.ceil(o/r)*r}var o,r;return n.metadata[Symbol.struct_metadata]={options:t,members:s,size:i},e}}function _R(t,e){return function(n,i){let s=i.name;if("symbol"==typeof s&&(console.warn("Symbol used for struct member name will be coerced to string: "+s.toString()),s=s.toString()),!s)throw new ReferenceError("Invalid name for struct member");return i.metadata??={},i.metadata[Symbol.struct_init]||=[],i.metadata[Symbol.struct_init].push({name:s,type:t,length:e}),n}}function dR(t){aR(t);const{options:e,members:n}=t.constructor[sR(t.constructor)][Symbol.struct_metadata],i=new Uint8Array(uR(t)),s=new DataView(i.buffer);for(const[o,{type:r,length:a,offset:l}]of n)for(let n=0;n<(a||1);n++){const u=l+uR(r)*n;let p=a>0?t[o][n]:t[o];if("string"==typeof p&&(p=p.charCodeAt(0)),!nR(r)){i.set(p?dR(p):new Uint8Array(uR(r)),u);continue}const _="set"+QM(r);"setInt64"!=_?"setUint64"!=_?s[_](u,Number(p),!e.bigEndian):s.setBigUint64(u,BigInt(p),!e.bigEndian):s.setBigInt64(u,BigInt(p),!e.bigEndian)}return i}function hR(t,e){aR(t);const{options:n,members:i}=t.constructor[sR(t.constructor)][Symbol.struct_metadata],s=e instanceof Uint8Array?e:new Uint8Array("buffer"in e?e.buffer:e),o=new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength));for(const[e,{type:r,offset:a,length:l}]of i)for(let i=0;i<(l||1);i++){let u=l>0?t[e]:t;const p=l>0?i:e,_=a+uR(r)*i;if("string"==typeof t[e]){t[e]=t[e].slice(0,i)+String.fromCharCode(o.getUint8(_))+t[e].slice(i+1);continue}if(!nR(r)){if(null===u[p]||void 0===u[p])continue;hR(u[p],new Uint8Array(s.slice(_,_+uR(r))));continue}l>0&&(u||=[]);const d="get"+QM(r);"getInt64"!=d?u[p]="getUint64"!=d?o[d](_,!n.bigEndian):o.getBigUint64(_,!n.bigEndian):u[p]=o.getBigInt64(_,!n.bigEndian)}}Symbol.metadata??=Symbol.for("Symbol.metadata");const cR=Object.fromEntries(ZM.map((t=>{return[t,(e=t,function(t,n){return"number"==typeof t?_R(e,t):_R(e)(t,n)})];var e})));var TR=function(t,e,n,i,s,o){function r(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=i.kind,u="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?i.static?t:t.prototype:null,_=e||(p?Object.getOwnPropertyDescriptor(p,i.name):{}),d=!1,h=n.length-1;h>=0;h--){var c={};for(var T in i)c[T]="access"===T?{}:i[T];for(var T in i.access)c.access[T]=i.access[T];c.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(r(t||null))};var I=(0,n[h])("accessor"===l?{get:_.get,set:_.set}:_[u],c);if("accessor"===l){if(void 0===I)continue;if(null===I||"object"!=typeof I)throw new TypeError("Object expected");(a=r(I.get))&&(_.get=a),(a=r(I.set))&&(_.set=a),(a=r(I.init))&&s.unshift(a)}else(a=r(I))&&("field"===l?s.unshift(a):_[u]=a)}p&&Object.defineProperty(p,i.name,_),d=!0},IR=function(t,e,n){for(var i=arguments.length>2,s=0;s{var t,e,n,i,s,o,r,a,l,u,p;let _,d,h,c,T,I,m,E,f,g,O,M,R,A=[pR()],S=[],C=[],L=[],y=[],D=[],N=[],b=[],v=[],w=[],F=[],P=[],k=[],V=[],Y=[],x=[],U=[],B=[],X=[],G=[],H=[],W=[],K=[],j=[];var q=d=class{constructor(t){if(this.data=IR(this,C,void 0),this.size=(IR(this,L),IR(this,y,void 0)),this.mode=(IR(this,D),IR(this,N,void 0)),this.nlink=(IR(this,b),IR(this,v,void 0)),this.uid=(IR(this,w),IR(this,F,void 0)),this.gid=(IR(this,P),IR(this,k,void 0)),this.atimeMs=(IR(this,V),IR(this,Y,void 0)),this.birthtimeMs=(IR(this,x),IR(this,U,void 0)),this.mtimeMs=(IR(this,B),IR(this,X,void 0)),this.ctimeMs=(IR(this,G),IR(this,H,void 0)),this.ino=(IR(this,W),IR(this,K,void 0)),IR(this,j),t){const e=uR(q),n=e-uR("uint64");if(t.byteLength{const $="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;h=[(t=cR).uint64.bind(t)],c=[(e=cR).uint32.bind(e)],T=[(n=cR).uint16.bind(n)],I=[(i=cR).uint32.bind(i)],m=[(s=cR).uint32.bind(s)],E=[(o=cR).uint32.bind(o)],f=[(r=cR).float64.bind(r)],g=[(a=cR).float64.bind(a)],O=[(l=cR).float64.bind(l)],M=[(u=cR).float64.bind(u)],R=[(p=cR).uint64.bind(p)],TR(null,null,h,{kind:"field",name:"data",static:!1,private:!1,access:{has:t=>"data"in t,get:t=>t.data,set:(t,e)=>{t.data=e}},metadata:$},C,L),TR(null,null,c,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:$},y,D),TR(null,null,T,{kind:"field",name:"mode",static:!1,private:!1,access:{has:t=>"mode"in t,get:t=>t.mode,set:(t,e)=>{t.mode=e}},metadata:$},N,b),TR(null,null,I,{kind:"field",name:"nlink",static:!1,private:!1,access:{has:t=>"nlink"in t,get:t=>t.nlink,set:(t,e)=>{t.nlink=e}},metadata:$},v,w),TR(null,null,m,{kind:"field",name:"uid",static:!1,private:!1,access:{has:t=>"uid"in t,get:t=>t.uid,set:(t,e)=>{t.uid=e}},metadata:$},F,P),TR(null,null,E,{kind:"field",name:"gid",static:!1,private:!1,access:{has:t=>"gid"in t,get:t=>t.gid,set:(t,e)=>{t.gid=e}},metadata:$},k,V),TR(null,null,f,{kind:"field",name:"atimeMs",static:!1,private:!1,access:{has:t=>"atimeMs"in t,get:t=>t.atimeMs,set:(t,e)=>{t.atimeMs=e}},metadata:$},Y,x),TR(null,null,g,{kind:"field",name:"birthtimeMs",static:!1,private:!1,access:{has:t=>"birthtimeMs"in t,get:t=>t.birthtimeMs,set:(t,e)=>{t.birthtimeMs=e}},metadata:$},U,B),TR(null,null,O,{kind:"field",name:"mtimeMs",static:!1,private:!1,access:{has:t=>"mtimeMs"in t,get:t=>t.mtimeMs,set:(t,e)=>{t.mtimeMs=e}},metadata:$},X,G),TR(null,null,M,{kind:"field",name:"ctimeMs",static:!1,private:!1,access:{has:t=>"ctimeMs"in t,get:t=>t.ctimeMs,set:(t,e)=>{t.ctimeMs=e}},metadata:$},H,W),TR(null,null,R,{kind:"field",name:"ino",static:!1,private:!1,access:{has:t=>"ino"in t,get:t=>t.ino,set:(t,e)=>{t.ino=e}},metadata:$},K,j),TR(null,_={value:d},A,{kind:"class",name:d.name,metadata:$},null,S),q=d=_.value,$&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$}),IR(d,S)})(),q=d})();var fR=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},gR=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class OR extends qM{async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}constructor(t){super(),this.store=t,this._initialized=!1}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!0),s=RO(t),o=RO(e),r=await this.findInode(i,s.dir,"rename"),a=yO(await this.get(i,r.data,s.dir,"rename"));if(!a[s.base])throw IO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0===(o.dir+"/").indexOf(t+"/"))throw new IO(cO.EBUSY,s.dir);const u=o.dir==s.dir,p=u?r:await this.findInode(i,o.dir,"rename"),_=u?a:yO(await this.get(i,p.data,o.dir,"rename"));if(_[o.base]){const t=new ER(await this.get(i,_[o.base],e,"rename"));if(!t.toStats().isFile())throw IO.With("EPERM",e,"rename");await i.remove(t.data),await i.remove(_[o.base])}_[o.base]=l,await i.set(r.data,DO(a)),await i.set(p.data,DO(_)),await i.commit()}catch(t){n.error=t,n.hasError=!0}finally{const t=gR(n);t&&await t}}renameSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!1),s=RO(t),o=RO(e),r=this.findInodeSync(i,s.dir,"rename"),a=yO(this.getSync(i,r.data,s.dir,"rename"));if(!a[s.base])throw IO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0==(o.dir+"/").indexOf(t+"/"))throw new IO(cO.EBUSY,s.dir);const u=o.dir===s.dir,p=u?r:this.findInodeSync(i,o.dir,"rename"),_=u?a:yO(this.getSync(i,p.data,o.dir,"rename"));if(_[o.base]){const t=new ER(this.getSync(i,_[o.base],e,"rename"));if(!t.toStats().isFile())throw IO.With("EPERM",e,"rename");i.removeSync(t.data),i.removeSync(_[o.base])}_[o.base]=l,i.setSync(r.data,DO(a)),i.setSync(p.data,DO(_)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{gR(n)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!0);return(await this.findInode(n,t,"stat")).toStats()}catch(t){e.error=t,e.hasError=!0}finally{const t=gR(e);t&&await t}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!1);return this.findInodeSync(n,t,"stat").toStats()}catch(t){e.error=t,e.hasError=!0}finally{gR(e)}}async createFile(t,e,n){const i=await this.commitNew(t,uM,n,new Uint8Array,"createFile");return new jM(this,t,e,i.toStats(),new Uint8Array)}createFileSync(t,e,n){const i=this.commitNewSync(t,uM,n,new Uint8Array,"createFile");return new jM(this,t,e,i.toStats(),new Uint8Array)}async openFile(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!0),s=await this.findInode(i,t,"openFile"),o=await this.get(i,s.data,t,"openFile");return new jM(this,t,e,s.toStats(),o)}catch(t){n.error=t,n.hasError=!0}finally{const t=gR(n);t&&await t}}openFileSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!1),s=this.findInodeSync(i,t,"openFile"),o=this.getSync(i,s.data,t,"openFile");return new jM(this,t,e,s.toStats(),o)}catch(t){n.error=t,n.hasError=!0}finally{gR(n)}}async unlink(t){return this.remove(t,!1,"unlink")}unlinkSync(t){this.removeSync(t,!1,"unlink")}async rmdir(t){if((await this.readdir(t)).length)throw IO.With("ENOTEMPTY",t,"rmdir");await this.remove(t,!0,"rmdir")}rmdirSync(t){if(this.readdirSync(t).length)throw IO.With("ENOTEMPTY",t,"rmdir");this.removeSync(t,!0,"rmdir")}async mkdir(t,e){await this.commitNew(t,_M,e,SO("{}"),"mkdir")}mkdirSync(t,e){this.commitNewSync(t,_M,e,SO("{}"),"mkdir")}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!0),i=await this.findInode(n,t,"readdir");return Object.keys(yO(await this.get(n,i.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{const t=gR(e);t&&await t}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!1),i=this.findInodeSync(n,t,"readdir");return Object.keys(yO(this.getSync(n,i.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{gR(e)}}async sync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!0),o=await this._findInode(s,t,"sync"),r=new ER(await this.get(s,o,t,"sync")),a=r.update(n);await s.set(r.data,e),a&&await s.set(o,dR(r)),await s.commit()}catch(t){i.error=t,i.hasError=!0}finally{const t=gR(i);t&&await t}}syncSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!1),o=this._findInodeSync(s,t,"sync"),r=new ER(this.getSync(s,o,t,"sync")),a=r.update(n);s.setSync(r.data,e),a&&s.setSync(o,dR(r)),s.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{gR(i)}}async link(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!0),s=OO(e),o=await this.findInode(i,s,"link"),r=yO(await this.get(i,o.data,s,"link")),a=await this._findInode(i,t,"link"),l=new ER(await this.get(i,a,t,"link"));l.nlink++,r[MO(e)]=a,i.setSync(a,dR(l)),i.setSync(o.data,DO(r)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{const t=gR(n);t&&await t}}linkSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!1),s=OO(e),o=this.findInodeSync(i,s,"link"),r=yO(this.getSync(i,o.data,s,"link")),a=this._findInodeSync(i,t,"link"),l=new ER(this.getSync(i,a,t,"link"));l.nlink++,r[MO(e)]=a,i.setSync(a,dR(l)),i.setSync(o.data,DO(r)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{gR(n)}}async checkRoot(){const t={stack:[],error:void 0,hasError:!1};try{const e=fR(t,this.store.transaction(),!0);if(await e.get(0n))return;const n=new ER;n.ino=0n,n.mode=511|_M,await e.set(n.data,SO("{}")),await e.set(0n,dR(n)),await e.commit()}catch(e){t.error=e,t.hasError=!0}finally{const e=gR(t);e&&await e}}checkRootSync(){const t={stack:[],error:void 0,hasError:!1};try{const e=fR(t,this.store.transaction(),!1);if(e.getSync(0n))return;const n=new ER;n.ino=0n,n.mode=511|_M,e.setSync(n.data,SO("{}")),e.setSync(0n,dR(n)),e.commitSync()}catch(e){t.error=e,t.hasError=!0}finally{gR(t)}}async _findInode(t,e,n,i=new Set){if(i.has(e))throw new IO(cO.EIO,"Infinite loop detected while finding inode",e);if(i.add(e),"/"==e)return 0n;const{dir:s,base:o}=RO(e),r="/"==s?new ER(await this.get(t,0n,s,n)):await this.findInode(t,s,n,i),a=yO(await this.get(t,r.data,s,n));if(!(o in a))throw IO.With("ENOENT",fO(s,o),n);return a[o]}_findInodeSync(t,e,n,i=new Set){if(i.has(e))throw new IO(cO.EIO,"Infinite loop detected while finding inode",e);if(i.add(e),"/"==e)return 0n;const{dir:s,base:o}=RO(e),r="/"==s?new ER(this.getSync(t,0n,s,n)):this.findInodeSync(t,s,n,i),a=yO(this.getSync(t,r.data,s,n));if(!(o in a))throw IO.With("ENOENT",fO(s,o),n);return a[o]}async findInode(t,e,n,i=new Set){const s=await this._findInode(t,e,n,i);return new ER(await this.get(t,s,e,n))}findInodeSync(t,e,n,i=new Set){const s=this._findInodeSync(t,e,n,i);return new ER(this.getSync(t,s,e,n))}async get(t,e,n,i){const s=await t.get(e);if(!s)throw IO.With("ENOENT",n,i);return s}getSync(t,e,n,i){const s=t.getSync(e);if(!s)throw IO.With("ENOENT",n,i);return s}async allocNew(t,e,n){for(let e=0;e<5;e++){const e=FO();if(!await t.get(e))return e}throw new IO(cO.ENOSPC,"No IDs available",e,n)}allocNewSync(t,e,n){for(let e=0;e<5;e++){const e=FO();if(!t.getSync(e))return e}throw new IO(cO.ENOSPC,"No IDs available",e,n)}async commitNew(t,e,n,i,s){const o={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw IO.With("EEXIST",t,s);const r=fR(o,this.store.transaction(),!0),{dir:a,base:l}=RO(t),u=await this.findInode(r,a,s),p=yO(await this.get(r,u.data,a,s));if(p[l])throw IO.With("EEXIST",t,s);const _=new ER;return _.ino=await this.allocNew(r,t,s),_.data=await this.allocNew(r,t,s),_.mode=n|e,_.uid=u.mode&cM?u.uid:PO.uid,_.gid=u.mode&TM?u.gid:PO.gid,_.size=i.length,await r.set(_.ino,dR(_)),await r.set(_.data,i),p[l]=_.ino,await r.set(u.data,DO(p)),await r.commit(),_}catch(t){o.error=t,o.hasError=!0}finally{const t=gR(o);t&&await t}}commitNewSync(t,e,n,i,s){const o={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw IO.With("EEXIST",t,s);const r=fR(o,this.store.transaction(),!1),{dir:a,base:l}=RO(t),u=this.findInodeSync(r,a,s),p=yO(this.getSync(r,u.data,a,s));if(p[l])throw IO.With("EEXIST",t,s);const _=new ER;return _.ino=this.allocNewSync(r,t,s),_.data=this.allocNewSync(r,t,s),_.size=i.length,_.mode=n|e,_.uid=u.mode&cM?u.uid:PO.uid,_.gid=u.mode&TM?u.gid:PO.gid,r.setSync(_.ino,dR(_)),r.setSync(_.data,i),p[l]=_.ino,r.setSync(u.data,DO(p)),r.commitSync(),_}catch(t){o.error=t,o.hasError=!0}finally{gR(o)}}async remove(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!0),{dir:o,base:r}=RO(t),a=await this.findInode(s,o,n),l=yO(await this.get(s,a.data,o,n));if(!l[r])throw IO.With("ENOENT",t,"remove");const u=l[r],p=new ER(await this.get(s,u,t,n));if(delete l[r],!e&&p.toStats().isDirectory())throw IO.With("EISDIR",t,"remove");await s.set(a.data,DO(l)),--p.nlink<1&&(await s.remove(p.data),await s.remove(u)),await s.commit()}catch(t){i.error=t,i.hasError=!0}finally{const t=gR(i);t&&await t}}removeSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!1),{dir:o,base:r}=RO(t),a=this.findInodeSync(s,o,n),l=yO(this.getSync(s,a.data,o,n)),u=l[r];if(!u)throw IO.With("ENOENT",t,"remove");const p=new ER(this.getSync(s,u,t,n));if(delete l[r],!e&&p.toStats().isDirectory())throw IO.With("EISDIR",t,"remove");s.setSync(a.data,DO(l)),--p.nlink<1&&(s.removeSync(p.data),s.removeSync(u)),s.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{gR(i)}}}class MR{constructor(t){this.store=t,this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}}class RR extends MR{async keys(){return this.keysSync()}async get(t){return this.getSync(t)}async set(t,e){return this.setSync(t,e)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}}class AR extends RR{constructor(){super(...arguments),this.originalData=new Map,this.modifiedKeys=new Set}keysSync(){return this.store.keys()}getSync(t){const e=this.store.get(t);return this.stashOldValue(t,e),e}setSync(t,e){return this.markModified(t),this.store.set(t,e)}removeSync(t){this.markModified(t),this.store.delete(t)}commitSync(){this.done=!0}abortSync(){if(this.done){for(const t of this.modifiedKeys){const e=this.originalData.get(t);e?this.store.set(t,e):this.store.delete(t)}this.done=!0}}stashOldValue(t,e){this.originalData.has(t)||this.originalData.set(t,e)}markModified(t){this.modifiedKeys.add(t),this.originalData.has(t)||this.originalData.set(t,this.store.get(t))}}class SR extends Map{constructor(t="tmp"){super(),this.name=t}async sync(){}clearSync(){this.clear()}transaction(){return new AR(this)}}const CR={name:"InMemory",isAvailable:()=>!0,options:{name:{type:"string",required:!1}},create({name:t}){const e=new OR(new SR(t));return e.checkRootSync(),e}};"function"==typeof SuppressedError&&SuppressedError;class LR{constructor(){this.isEnabled=!1,this.sync=new Map,this.async=new Map}has(t){return this.isEnabled&&this.sync.has(t)}get(t){if(this.isEnabled)return this.sync.get(t)}set(t,e){this.isEnabled&&(this.sync.set(t,e),this.async.set(t,Promise.resolve(e)))}hasAsync(t){return this.isEnabled&&this.async.has(t)}getAsync(t){if(this.isEnabled)return this.async.get(t)}setAsync(t,e){this.isEnabled&&(this.async.set(t,e),e.then((e=>this.sync.set(t,e))))}clear(){this.isEnabled&&(this.sync.clear(),this.async.clear())}}const yR=new LR,DR=new LR;var NR=__webpack_require__(8287);function bR(t,e){return Object.fromEntries(Object.entries(t).map((([t,n])=>[t,"function"==typeof n?n.bind(e):n])))}const vR=new Map;let wR=100;function FR(t){const e=wR++;return vR.set(e,t),e}function PR(t){if(!vR.has(t))throw new IO(cO.EBADF);return vR.get(t)}const kR=new Map;function VR(t,e){if("/"!==t[0]&&(t="/"+t),t=fO(t),kR.has(t))throw new IO(cO.EINVAL,"Mount point "+t+" is already in use.");kR.set(t,e),DR.clear()}function YR(t){if("/"!==t[0]&&(t="/"+t),t=fO(t),!kR.has(t))throw new IO(cO.EINVAL,"Mount point "+t+" is already unmounted.");kR.delete(t),DR.clear()}function xR(t,e){const n=e?.root||"/";t=vO(gO(n,t));const i=[...kR].sort(((t,e)=>t[0].length>e[0].length?-1:1));for(const[e,s]of i)if(e.length<=t.length&&t.startsWith(e))return""===(t=t.slice(e.length>1?e.length:0))&&(t=n),{fs:s,path:t,mountPoint:e,root:n};throw new IO(cO.EIO,"No file system")}async function UR(){await Promise.all([...kR.values()].map((t=>t.ready())))}function BR(t,e){for(const[n,i]of Object.entries(e))t=t?.replaceAll(n,i);return t}function XR(t,e){"string"==typeof t.stack&&(t.stack=BR(t.stack,e));try{t.message=BR(t.message,e)}catch{}return t.path&&(t.path=BR(t.path,e)),t}function GR(t){"/"in t&&YR("/");for(const[e,n]of Object.entries(t))VR(e,n)}function HR(t,e){const n=t.metadata(),i=n.blockSize||4096;return{type:(e?BigInt:Number)(n.type),bsize:(e?BigInt:Number)(i),ffree:(e?BigInt:Number)(n.freeNodes||NM),files:(e?BigInt:Number)(n.totalNodes||NM),bavail:(e?BigInt:Number)(n.freeSpace/i),bfree:(e?BigInt:Number)(n.freeSpace/i),blocks:(e?BigInt:Number)(n.totalSpace/i)}}function WR(t,e){const n=this?.credentials;if(n?.uid&&n?.gid&&n?.euid&&n?.egid)throw new IO(cO.EPERM,"Can not chroot() as non-root user");return e&&this?(this.root+=t,this):function(t,e=structuredClone(PO)){const n={root:t,credentials:kO(e)},i=bR(st,n),s=bR(it,n);return{...n,...i,promises:s}}(gO(this?.root||"/",t),n)}VR("/",CR.create({name:"root"}));class KR extends $M{off(t,e,n,i){return super.off(t,e,n,i)}removeListener(t,e,n,i){return super.removeListener(t,e,n,i)}constructor(t){super(),this.path=t}setMaxListeners(){throw IO.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw IO.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw IO.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw IO.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw IO.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}}class jR extends KR{constructor(t,e){super(t),this.options=e,function(t,e){const n=vO(t);$R.has(n)||$R.set(n,new Set);$R.get(n).add(e)}(t.toString(),this)}close(){super.emit("close"),function(t,e){const n=vO(t);$R.has(n)&&($R.get(n).delete(e),0===$R.get(n).size&&$R.delete(n))}(this.path.toString(),this)}[Symbol.dispose](){this.close()}}class qR extends KR{constructor(t,e){super(t),this.options=e,this.start()}onInterval(){try{const n=eA(this.path);t=this.previous,e=n,(t.size!=e.size||+t.atime!=+e.atime||+t.mtime!=+e.mtime||+t.ctime!=+e.ctime||t.mode!=e.mode)&&(this.emit("change",n,this.previous),this.previous=n)}catch(t){this.emit("error",t)}var t,e}start(){const t=this.options.interval||5e3;try{this.previous=eA(this.path)}catch(t){return void this.emit("error",t)}this.intervalId=setInterval(this.onInterval.bind(this),t),this.options.persistent||"object"!=typeof this.intervalId||this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}}const $R=new Map;function zR(t,e){if(e=vO(e),$R.has(e))for(const n of $R.get(e))n.emit("change",t,MO(e));let n,i=e;for(;i!==n;)if(n=i,i=OO(i),$R.has(i))for(const n of $R.get(i))n.emit("change",t,e.slice(i.length+("/"==i?0:1)))}var QR=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},JR=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});function ZR(t,e){t=vO(t),e=vO(e);const n=xR(t,this),i=xR(e,this);if(bM.checkAccess&&!eA.call(this,OO(t)).hasAccess(xO,this))throw IO.With("EACCES",t,"rename");try{if(n===i)return n.fs.renameSync(n.path,i.path),zR("rename",t.toString()),void zR("change",e.toString());pA.call(this,e,uA(t)),sA.call(this,t),zR("rename",t.toString())}catch(s){throw XR(s,{[n.path]:t,[i.path]:e})}}function tA(t){t=vO(t);try{const{fs:e,path:n}=xR(FA.call(this,t),this);return e.existsSync(n)}catch(t){if(t.errno==cO.ENOENT)return!1;throw t}}function eA(t,e){t=vO(t);const{fs:n,path:i}=xR(FA.call(this,t),this);try{const t=n.statSync(i);if(bM.checkAccess&&!t.hasAccess(YO,this))throw IO.With("EACCES",i,"stat");return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}function nA(t,e){t=vO(t);const{fs:n,path:i}=xR(t,this);try{const t=n.statSync(i);return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}function iA(t,e=0){const n={stack:[],error:void 0,hasError:!1};try{const i=QR(n,oA.call(this,t,"r+"),!1);if(e||(e=0),e<0)throw new IO(cO.EINVAL);i.truncateSync(e)}catch(t){n.error=t,n.hasError=!0}finally{JR(n)}}function sA(t){t=vO(t);const{fs:e,path:n}=xR(t,this);try{if(bM.checkAccess&&!(yR.get(t)||e.statSync(n)).hasAccess(xO,this))throw IO.With("EACCES",n,"unlink");e.unlinkSync(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}function oA(t,e,n,i=!0){t=vO(t);const s=NO(n,420),o=xM(e);t=i?FA.call(this,t):t;const{fs:r,path:a}=xR(t,this);let l;try{l=r.statSync(a)}catch{}if(!l){if(!XM(o)&&!HM(o)||"r+"==o)throw IO.With("ENOENT",t,"_open");const e=r.statSync(OO(a));if(bM.checkAccess&&!e.hasAccess(xO,this))throw IO.With("EACCES",OO(t),"_open");if(!e.isDirectory())throw IO.With("ENOTDIR",OO(t),"_open");return r.createFileSync(a,o,s)}if(bM.checkAccess&&(!l.hasAccess(s,this)||!l.hasAccess(UM(o),this)))throw IO.With("EACCES",t,"_open");if(WM(o))throw IO.With("EEXIST",t,"_open");const u=r.openFileSync(a,o);return GM(o)&&u.truncateSync(0),u}function rA(t,e,n=VO){return FR(oA.call(this,t,e,n,!0))}function aA(t,e,n){return FR(oA.call(this,t,e,n,!1))}function lA(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=QR(i,oA.call(this,t,e,420,n),!1),o=s.statSync(),r=new Uint8Array(o.size);return s.readSync(r,0,o.size,0),r}catch(t){i.error=t,i.hasError=!0}finally{JR(i)}}function uA(t,e={}){const n=wO(e,null,"r",420);if(!BM(xM(n.flag)))throw new IO(cO.EINVAL,"Flag passed to readFile must allow for reading.");const i=NR.Buffer.from(lA.call(this,"number"==typeof t?PR(t).path:t.toString(),n.flag,!0));return n.encoding?i.toString(n.encoding):i}function pA(t,e,n={}){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","w+",420),o=xM(s.flag);if(!XM(o))throw new IO(cO.EINVAL,"Flag passed to writeFile must allow for writing.");if("string"!=typeof e&&!s.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const r="string"==typeof e?NR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!r)throw new IO(cO.EINVAL,"Data not specified");QR(i,oA.call(this,"number"==typeof t?PR(t).path:t.toString(),o,s.mode,!0),!1).writeSync(r,0,r.byteLength,0),zR("change",t.toString())}catch(t){i.error=t,i.hasError=!0}finally{JR(i)}}function _A(t,e,n={}){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","a+",420),o=xM(s.flag);if(!HM(o))throw new IO(cO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const r="string"==typeof e?NR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);QR(i,oA.call(this,"number"==typeof t?PR(t).path:t.toString(),o,s.mode,!0),!1).writeSync(r,0,r.byteLength)}catch(t){i.error=t,i.hasError=!0}finally{JR(i)}}function dA(t,e){const n=PR(t).statSync();return e?.bigint?new PM(n):n}function hA(t){PR(t).closeSync(),vR.delete(t)}function cA(t,e=0){if(e||(e=0),e<0)throw new IO(cO.EINVAL);PR(t).truncateSync(e)}function TA(t){PR(t).syncSync()}function IA(t){PR(t).datasyncSync()}function mA(t,e,n,i,s){let o,r,a,l;if("string"==typeof e){l="number"==typeof n?n:null;const t="string"==typeof i?i:"utf8";r=0,o=NR.Buffer.from(e,t),a=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=n,a=i,l="number"==typeof s?s:null;const u=PR(t);l??(l=u.position);const p=u.writeSync(o,r,a,l);return zR("change",u.path),p}function EA(t,e,n,i,s){const o=PR(t),r="object"==typeof n?n.offset:n;return"object"==typeof n&&(i=n.length,s=n.position),s=Number(s),isNaN(s)&&(s=o.position),o.readSync(e,r,i,s)}function fA(t,e,n){PR(t).chownSync(e,n)}function gA(t,e){const n=NO(e,-1);if(n<0)throw new IO(cO.EINVAL,"Invalid mode.");PR(t).chmodSync(n)}function OA(t,e,n){PR(t).utimesSync(bO(e),bO(n))}function MA(t){t=vO(t);const{fs:e,path:n}=xR(FA.call(this,t),this);try{const i=yR.get(t)||e.statSync(n);if(!i.isDirectory())throw IO.With("ENOTDIR",n,"rmdir");if(bM.checkAccess&&!i.hasAccess(xO,this))throw IO.With("EACCES",n,"rmdir");e.rmdirSync(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}function RA(t,e){e="object"==typeof e?e:{mode:e};const n=NO(e?.mode,511);t=FA.call(this,t);const{fs:i,path:s,root:o}=xR(t,this),r={[s]:t};try{if(!e?.recursive){if(bM.checkAccess&&!i.statSync(OO(s)).hasAccess(xO,this))throw IO.With("EACCES",OO(s),"mkdir");return i.mkdirSync(s,n)}const a=[];for(let e=s,n=t;!i.existsSync(e);e=OO(e),n=OO(n))a.unshift(e),r[e]=n;for(const t of a){if(bM.checkAccess&&!i.statSync(OO(t)).hasAccess(xO,this))throw IO.With("EACCES",OO(t),"mkdir");i.mkdirSync(t,n),zR("rename",t)}return 1==o.length?a[0]:a[0]?.slice(o.length)}catch(t){throw XR(t,r)}}function AA(t,e){e="object"==typeof e?e:{encoding:e},t=vO(t);const{fs:n,path:i}=xR(FA.call(this,t),this);let s;try{const e=yR.get(t)||n.statSync(i);if(yR.set(t,e),bM.checkAccess&&!e.hasAccess(YO,this))throw IO.With("EACCES",i,"readdir");if(!e.isDirectory())throw IO.With("ENOTDIR",i,"readdir");s=n.readdirSync(i)}catch(e){throw XR(e,{[i]:t})}const o=[];for(const r of s){const s=yR.get(gO(t,r))||n.statSync(gO(i,r));if(yR.set(gO(t,r),s),e?.withFileTypes?o.push(new HA(r,s)):"buffer"==e?.encoding?o.push(NR.Buffer.from(r)):o.push(r),s.isDirectory()&&e?.recursive)for(const n of AA.call(this,gO(t,r),{...e,_isIndirect:!0}))n instanceof HA?(n.path=gO(r,n.path),o.push(n)):NR.Buffer.isBuffer(n)?o.push(NR.Buffer.from(gO(r,LO(n)))):o.push(gO(r,n))}return e?._isIndirect||yR.clear(),o}function SA(t,e){if(t=vO(t),bM.checkAccess&&!eA(OO(t)).hasAccess(YO,this))throw IO.With("EACCES",OO(t),"link");if(e=vO(e),bM.checkAccess&&!eA(OO(e)).hasAccess(xO,this))throw IO.With("EACCES",OO(e),"link");const{fs:n,path:i}=xR(t,this),s=xR(e,this);if(n!=s.fs)throw IO.With("EXDEV",e,"link");try{if(bM.checkAccess&&!n.statSync(i).hasAccess(YO,this))throw IO.With("EACCES",i,"link");return n.linkSync(i,e)}catch(n){throw XR(n,{[i]:t,[s.path]:e})}}function CA(t,e,n="file"){if(!["file","dir","junction"].includes(n))throw new IO(cO.EINVAL,"Invalid type: "+n);if(tA.call(this,e))throw IO.With("EEXIST",e.toString(),"symlink");pA.call(this,e,t.toString());oA.call(this,e,"r+",420,!1).chmodSync(lM)}function LA(t,e){const n=NR.Buffer.from(lA.call(this,t.toString(),"r",!1)),i="object"==typeof e?e?.encoding:e;return"buffer"==i?n:n.toString(i)}function yA(t,e,n){const i=rA.call(this,t,"r+");fA(i,e,n),hA(i)}function DA(t,e,n){const i=aA.call(this,t,"r+");fA(i,e,n),hA(i)}function NA(t,e){const n=rA.call(this,t,"r+");gA(n,e),hA(n)}function bA(t,e){const n=aA.call(this,t,"r+");gA(n,e),hA(n)}function vA(t,e,n){const i=rA.call(this,t,"r+");OA(i,e,n),hA(i)}function wA(t,e,n){const i=aA.call(this,t,"r+");OA(i,e,n),hA(i)}function FA(t,e){t=vO(t);const n=(this?.root||"")+t;if(DR.has(n))return DR.get(n);const{base:i,dir:s}=RO(t),o="/"==s?"/":DR.get((this?.root||"")+s)||FA.call(this,s),r=gO(o,i),{fs:a,path:l}=xR(r,this);try{const i=yR.get(r)||a.statSync(l);if(yR.set(r,i),!i.isSymbolicLink())return DR.set(t,r),r;const s=fO(o,LA.call(this,r,e).toString()),u=DR.get((this?.root||"")+s)||FA.call(this,s);return DR.set(n,u),u}catch(e){if("ENOENT"==e.code)return t;throw XR(e,{[l]:r})}}function PA(t,e=384){if(bM.checkAccess&&!eA.call(this,t).hasAccess(e,this))throw new IO(cO.EACCES)}function kA(t,e){let n;t=vO(t);try{n=yR.get(t)||nA.bind(this)(t)}catch(t){if("ENOENT"!=t.code||!e?.force)throw t}if(n){switch(yR.set(t,n),n.mode&rM){case _M:if(e?.recursive)for(const n of AA.call(this,t,{_isIndirect:!0}))kA.call(this,gO(t,n),{...e,_isIndirect:!0});MA.call(this,t);break;case uM:case lM:case pM:case dM:sA.call(this,t);break;default:throw yR.clear(),new IO(cO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||yR.clear()}}function VA(t,e){const n="object"==typeof e?e?.encoding:e||"utf8",i="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return RA.call(this,i),"buffer"==n?NR.Buffer.from(i):i}function YA(t,e,n){if(t=vO(t),e=vO(e),n&&n&BO&&tA(e))throw new IO(cO.EEXIST,"Destination file already exists.",e,"copyFile");pA.call(this,e,uA(t)),zR("rename",e.toString())}function xA(t,e,n){const i=PR(t);let s=0;for(const t of e)s+=i.readSync(t,0,t.byteLength,n+s);return s}function UA(t,e,n){const i=PR(t);let s=0;for(const t of e)s+=i.writeSync(new Uint8Array(t.buffer),0,t.byteLength,n+s);return s}function BA(t,e){return t=vO(t),new WA(t,this)}function XA(t,e,n){t=vO(t),e=vO(e);const i=nA.call(this,t);if(n?.errorOnExist&&tA.call(this,e))throw new IO(cO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(i.mode&rM){case _M:if(!n?.recursive)throw new IO(cO.EISDIR,t+" is a directory (not copied)",t,"cp");RA.call(this,e,{recursive:!0});for(const i of AA.call(this,t,{withFileTypes:!0}))n.filter&&!n.filter(gO(t,i.name),gO(e,i.name))||XA.call(this,gO(t,i.name),gO(e,i.name),n);break;case uM:case lM:YA.call(this,t,e);break;default:throw new IO(cO.EPERM,"File type not supported",t,"rm")}n?.preserveTimestamps&&vA.call(this,e,i.atime,i.mtime)}function GA(t,e){t=vO(t);const{fs:n}=xR(t,this);return HR(n,e?.bigint)}class HA{get name(){return MO(this.path)}constructor(t,e){this.path=t,this.stats=e}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}}class WA{checkClosed(){if(this.closed)throw new IO(cO.EBADF,"Can not use closed Dir")}constructor(t,e){this.path=t,this.context=e,this.closed=!1}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??(this._entries=await _S.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}read(t){if(!t)return this._read();this._read().then((e=>t(void 0,e)))}readSync(){return this.checkClosed(),this._entries??(this._entries=AA.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}async next(){const t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}}var KA=__webpack_require__(6248);class jA extends KA.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new IO(cO.EIO,e.toString()))}}}class qA extends KA.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new IO(cO.EIO,e.toString()))}}}var $A=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},zA=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class QA{constructor(t,e){this.context=e;const n="number"!=typeof t;this.fd=n?FR(t):t,this.file=n?t:PR(t)}async chown(t,e){await this.file.chown(t,e),zR("change",this.file.path)}async chmod(t){const e=NO(t,-1);if(e<0)throw new IO(cO.EINVAL,"Invalid mode.");await this.file.chmod(e),zR("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(t){if(t||(t=0),t<0)throw new IO(cO.EINVAL);await this.file.truncate(t),zR("change",this.file.path)}async utimes(t,e){await this.file.utimes(bO(t),bO(e)),zR("change",this.file.path)}async appendFile(t,e={}){const n=wO(e,"utf8","a",420);if(!HM(xM(n.flag)))throw new IO(cO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!n.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const i="string"==typeof t?NR.Buffer.from(t,n.encoding):t;await this.file.write(i,0,i.length),zR("change",this.file.path)}read(t,e,n,i){return isNaN(+i)&&(i=this.file.position),this.file.read(t,e,n,i)}async readFile(t){const e=wO(t,null,"r",292);if(!BM(xM(e.flag)))throw new IO(cO.EINVAL,"Flag passed must allow for reading.");const{size:n}=await this.stat(),{buffer:i}=await this.file.read(new Uint8Array(n),0,n,0),s=NR.Buffer.from(i);return e.encoding?s.toString(e.encoding):s}readableWebStream(t={}){const e=globalThis;if(!("ReadableStream"in e))throw new IO(cO.ENOSYS,"ReadableStream is missing on globalThis");return new e.ReadableStream({start:async t=>{try{const e=65536,n=1e7;let i=0,s=0,o=NaN;for(;o>0;){const r=await this.read(new Uint8Array(e),0,e,s);if(!r.bytesRead)return void t.close();if(t.enqueue(r.buffer.slice(0,r.bytesRead)),s+=r.bytesRead,++i>=n)throw new IO(cO.EFBIG,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");o=r.bytesRead}}catch(e){t.error(e)}},type:t.type})}readLines(t){throw IO.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){const e=await this.file.stat();if(bM.checkAccess&&!e.hasAccess(YO,this.context))throw IO.With("EACCES",this.file.path,"stat");return t?.bigint?new PM(e):e}async write(t,e,n,i){let s,o,r;if("string"==typeof t){i="number"==typeof e?e:null;const a="string"==typeof n?n:"utf8";o=0,s=NR.Buffer.from(t,a),r=s.length}else s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=e,r=n,i="number"==typeof i?i:null;i??(i=this.file.position);const a=await this.file.write(s,o,r,i);return zR("change",this.file.path),{buffer:s,bytesWritten:a}}async writeFile(t,e={}){const n=wO(e,"utf8","w",420);if(!XM(xM(n.flag)))throw new IO(cO.EINVAL,"Flag passed must allow for writing.");if("string"!=typeof t&&!n.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const i="string"==typeof t?NR.Buffer.from(t,n.encoding):t;await this.file.write(i,0,i.length,0),zR("change",this.file.path)}async close(){await this.file.close(),vR.delete(this.fd)}async writev(t,e){let n=0;for(const i of t)n+=(await this.write(i,0,i.length,e+n)).bytesWritten;return{bytesWritten:n,buffers:t}}async readv(t,e){let n=0;for(const i of t)n+=(await this.read(i,0,i.byteLength,e+n)).bytesRead;return{bytesRead:n,buffers:t}}createReadStream(t){const e=new jA({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:async t=>{try{const n=await this.read(new Uint8Array(t),0,t,this.file.position);e.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(t){e.destroy(t)}}});return e.path=this.file.path,e}createWriteStream(t){const e=new qA({highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:async(t,e,n)=>{try{const{bytesWritten:i}=await this.write(t,null,e);n(i==t.length?null:new Error("Failed to write full chunk"))}catch(t){n(t)}}});return e.path=this.file.path,e}}async function JA(t,e){t=vO(t),e=vO(e);const n=xR(t,this),i=xR(e,this);if(bM.checkAccess&&!(await tS.call(this,OO(t))).hasAccess(xO,this))throw IO.With("EACCES",t,"rename");try{if(n.mountPoint==i.mountPoint)return await n.fs.rename(n.path,i.path),zR("rename",t.toString()),void zR("change",e.toString());await aS.call(this,e,await rS(t)),await iS.call(this,t),zR("rename",t.toString())}catch(s){throw XR(s,{[n.path]:t,[i.path]:e})}}async function ZA(t){try{const{fs:e,path:n}=xR(await OS.call(this,t),this);return await e.exists(n)}catch(t){if(t instanceof IO&&"ENOENT"==t.code)return!1;throw t}}async function tS(t,e){t=vO(t);const{fs:n,path:i}=xR(await OS.call(this,t),this);try{const t=await n.stat(i);if(bM.checkAccess&&!t.hasAccess(YO,this))throw IO.With("EACCES",i,"stat");return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}async function eS(t,e){t=vO(t);const{fs:n,path:i}=xR(t,this);try{const t=await n.stat(i);return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}async function nS(t,e=0){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await oS.call(this,t,"r+"),!0);await i.truncate(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function iS(t){t=vO(t);const{fs:e,path:n}=xR(t,this);try{if(bM.checkAccess&&!(await(yR.getAsync(t)||e.stat(n))).hasAccess(xO,this))throw IO.With("EACCES",n,"unlink");await e.unlink(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}async function sS(t,e,n=420,i){t=vO(t);const s=NO(n,420),o=xM(e);t=i?await OS.call(this,t):t;const{fs:r,path:a}=xR(t,this),l=await r.stat(a).catch((()=>null));if(!l){if(!XM(o)&&!HM(o)||"r+"==o)throw IO.With("ENOENT",t,"_open");const e=await r.stat(OO(a));if(bM.checkAccess&&!e.hasAccess(xO,this))throw IO.With("EACCES",OO(t),"_open");if(!e.isDirectory())throw IO.With("ENOTDIR",OO(t),"_open");return new QA(await r.createFile(a,o,s),this)}if(bM.checkAccess&&!l.hasAccess(UM(o),this))throw IO.With("EACCES",t,"_open");if(WM(o))throw IO.With("EEXIST",t,"_open");const u=new QA(await r.openFile(a,o),this);return GM(o)&&await u.truncate(0),u}async function oS(t,e="r",n=420){return await sS.call(this,t,e,n,!0)}async function rS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=wO(e,null,"r",420),s=$A(n,"object"==typeof t&&"fd"in t?t:await oS.call(this,t,i.flag,i.mode),!0);return await s.readFile(i)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function aS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","w+",420),o=$A(i,t instanceof QA?t:await oS.call(this,t.toString(),s.flag,s.mode),!0),r=e;if("string"!=typeof r&&!(r instanceof Uint8Array))throw new IO(cO.EINVAL,"Iterables and streams not supported",o.file.path,"writeFile");await o.writeFile(r,s)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function lS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","a",420);if(!HM(xM(s.flag)))throw new IO(cO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const o="string"==typeof e?NR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=$A(i,"object"==typeof t&&"fd"in t?t:await oS.call(this,t,s.flag,s.mode),!0);await r.appendFile(o,s)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function uS(t){t=await OS.call(this,t);const{fs:e,path:n}=xR(t,this);try{const i=await(yR.getAsync(t)||e.stat(n));if(!i)throw IO.With("ENOENT",t,"rmdir");if(!i.isDirectory())throw IO.With("ENOTDIR",n,"rmdir");if(bM.checkAccess&&!i.hasAccess(xO,this))throw IO.With("EACCES",n,"rmdir");await e.rmdir(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}async function pS(t,e){e="object"==typeof e?e:{mode:e};const n=NO(e?.mode,511);t=await OS.call(this,t);const{fs:i,path:s,root:o}=xR(t,this),r={[s]:t};try{if(!e?.recursive){if(bM.checkAccess&&!(await i.stat(OO(s))).hasAccess(xO,this))throw IO.With("EACCES",OO(s),"mkdir");return await i.mkdir(s,n),void zR("rename",t.toString())}const a=[];for(let e=s,n=t;!await i.exists(e);e=OO(e),n=OO(n))a.unshift(e),r[e]=n;for(const t of a){if(bM.checkAccess&&!(await i.stat(OO(t))).hasAccess(xO,this))throw IO.With("EACCES",OO(t),"mkdir");await i.mkdir(t,n),zR("rename",t)}return 1==o.length?a[0]:a[0]?.slice(o.length)}catch(t){throw XR(t,r)}}async function _S(t,e){e="object"==typeof e?e:{encoding:e},t=await OS.call(this,t);const n=e=>{throw XR(e,{[s]:t})},{fs:i,path:s}=xR(t,this),o=yR.getAsync(t)||i.stat(s).catch(n);yR.setAsync(t,o);const r=await o;if(!r)throw IO.With("ENOENT",t,"readdir");if(bM.checkAccess&&!r.hasAccess(YO,this))throw IO.With("EACCES",t,"readdir");if(!r.isDirectory())throw IO.With("ENOTDIR",t,"readdir");const a=await i.readdir(s).catch(n),l=[];return await Promise.all(a.map((async o=>{let r;if(e?.recursive||e?.withFileTypes){const e=yR.getAsync(gO(t,o))||i.stat(gO(s,o)).catch(n);yR.setAsync(gO(t,o),e),r=await e}if(e?.withFileTypes?l.push(new HA(o,r)):"buffer"==e?.encoding?l.push(NR.Buffer.from(o)):l.push(o),e?.recursive&&r?.isDirectory())for(const n of await _S.call(this,gO(t,o),{...e,_isIndirect:!0}))n instanceof HA?(n.path=gO(o,n.path),l.push(n)):NR.Buffer.isBuffer(n)?l.push(NR.Buffer.from(gO(o,LO(n)))):l.push(gO(o,n))}))),e?._isIndirect||yR.clear(),l}async function dS(t,e){t=vO(t),e=vO(e);const{fs:n,path:i}=xR(t,this),s=xR(e,this);if(n!=s.fs)throw IO.With("EXDEV",e,"link");try{if(bM.checkAccess&&!(await n.stat(OO(t))).hasAccess(YO,this))throw IO.With("EACCES",OO(i),"link");if(bM.checkAccess&&!(await tS.call(this,OO(e))).hasAccess(xO,this))throw IO.With("EACCES",OO(e),"link");if(bM.checkAccess&&!(await n.stat(i)).hasAccess(YO,this))throw IO.With("EACCES",i,"link");return await n.link(i,s.path)}catch(n){throw XR(n,{[s.path]:e,[i]:t})}}async function hS(t,e,n="file"){const i={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(n))throw new IO(cO.EINVAL,"Invalid symlink type: "+n);if(await ZA.call(this,e))throw IO.With("EEXIST",e.toString(),"symlink");const s=$A(i,await sS.call(this,e,"w+",420,!1),!0);await s.writeFile(t.toString()),await s.file.chmod(lM)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function cS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await sS.call(this,vO(t),"r",420,!1),!0),s=await i.readFile(),o="object"==typeof e?e?.encoding:e;return"buffer"==o?s:s.toString(o)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function TS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await oS.call(this,t,"r+"),!0);await s.chown(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function IS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await sS.call(this,t,"r+",420,!1),!0);await s.chown(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function mS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await oS.call(this,t,"r+"),!0);await i.chmod(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function ES(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await sS.call(this,t,"r+",420,!1),!0);await i.chmod(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function fS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await oS.call(this,t,"r+"),!0);await s.utimes(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function gS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await sS.call(this,t,"r+",420,!1),!0);await s.utimes(new Date(e),new Date(n))}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function OS(t,e){t=vO(t);const n=(this?.root||"")+t;if(DR.hasAsync(n))return DR.getAsync(n);const{base:i,dir:s}=RO(t),o="/"==s?"/":await(DR.getAsync((this?.root||"")+s)||OS.call(this,s)),r=gO(o,i),{fs:a,path:l}=xR(r,this);try{const e=yR.getAsync(r)||a.stat(l);if(yR.setAsync(r,e),!(await e).isSymbolicLink())return DR.set(t,r),r;const i=fO(o,(await cS.call(this,r)).toString()),s=DR.getAsync((this?.root||"")+i)||OS.call(this,i);return DR.setAsync(n,s),await s}catch(e){if("ENOENT"==e.code)return t;throw XR(e,{[l]:r})}}function MS(t,e={}){return{[Symbol.asyncIterator](){const n=new jR(t.toString(),"string"!=typeof e?e:{encoding:e}),i=[];function s(){n.close();for(const t of i)t({value:null,done:!0});return i.length=0,Promise.resolve({value:null,done:!0})}return n.on("change",((t,e)=>{i.shift()?.({value:{eventType:t,filename:e},done:!1})})),{async next(){const{promise:t,resolve:e}=Promise.withResolvers();return i.push(e),t},return:s,throw:s}}}}async function RS(t,e=VO){if(!bM.checkAccess)return;if(!(await tS.call(this,t)).hasAccess(e,this))throw new IO(cO.EACCES)}async function AS(t,e){t=vO(t);const n=await(yR.getAsync(t)||eS.call(this,t).catch((t=>{if("ENOENT"!=t.code||!e?.force)throw t})));if(n){switch(yR.set(t,n),n.mode&rM){case _M:if(e?.recursive)for(const n of await _S.call(this,t,{_isIndirect:!0}))await AS.call(this,gO(t,n),{...e,_isIndirect:!0});await uS.call(this,t);break;case uM:case lM:case pM:case dM:await iS.call(this,t);break;default:throw yR.clear(),new IO(cO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||yR.clear()}}async function SS(t,e){const n="object"==typeof e?e?.encoding:e||"utf8",i="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await pS.call(this,i),"buffer"==n?NR.Buffer.from(i):i}async function CS(t,e,n){if(t=vO(t),e=vO(e),n&&n&BO&&await ZA.call(this,e))throw new IO(cO.EEXIST,"Destination file already exists.",e,"copyFile");await aS.call(this,e,await rS.call(this,t)),zR("rename",e.toString())}function LS(t,e){return t=vO(t),Promise.resolve(new WA(t,this))}async function yS(t,e,n){t=vO(t),e=vO(e);const i=await eS.call(this,t);if(n?.errorOnExist&&await ZA.call(this,e))throw new IO(cO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(i.mode&rM){case _M:{if(!n?.recursive)throw new IO(cO.EISDIR,t+" is a directory (not copied)",t,"cp");const[i]=await Promise.all([_S.call(this,t,{withFileTypes:!0}),pS.call(this,e,{recursive:!0})]),s=async i=>{n.filter&&!n.filter(gO(t,i.name),gO(e,i.name))||await yS.call(this,gO(t,i.name),gO(e,i.name),n)};await Promise.all(i.map(s));break}case uM:case lM:await CS.call(this,t,e);break;default:throw new IO(cO.EPERM,"File type not supported",t,"rm")}n?.preserveTimestamps&&await fS.call(this,e,i.atime,i.mtime)}async function DS(t,e){t=vO(t);const{fs:n}=xR(t,this);return Promise.resolve(HR(n,e?.bigint))}const NS=()=>{};function bS(t,e,n=NS){JA.call(this,t,e).then((()=>n())).catch(n)}function vS(t,e=NS){ZA.call(this,t).then(e).catch((()=>e(!1)))}function wS(t,e,n=NS){n="function"==typeof e?e:n,tS.call(this,t,"function"!=typeof e?e:{}).then((t=>n(void 0,t))).catch(n)}function FS(t,e,n=NS){n="function"==typeof e?e:n,eS.call(this,t,"function"!=typeof e?e:{}).then((t=>n(void 0,t))).catch(n)}function PS(t,e=0,n=NS){n="function"==typeof e?e:n;const i="number"==typeof e?e:0;nS.call(this,t,i).then((()=>n())).catch(n)}function kS(t,e=NS){iS.call(this,t).then((()=>e())).catch(e)}function VS(t,e,n,i=NS){const s=NO(n,420);i="function"==typeof n?n:i,oS.call(this,t,e,s).then((t=>i(void 0,t.fd))).catch(i)}function YS(t,e,n=NS){n="function"==typeof e?e:n,rS.call(this,t,"function"==typeof e?null:e).then((t=>n(void 0,t))).catch(n)}function xS(t,e,n,i=NS){i="function"==typeof n?n:i,aS.call(this,t,e,"function"!=typeof n?n:null).then((()=>i(void 0))).catch(i)}function US(t,e,n,i=NS){const s="function"!=typeof n?n:void 0;i="function"==typeof n?n:i,lS.call(this,t,e,s).then((()=>i())).catch(i)}function BS(t,e,n=NS){n="function"==typeof e?e:n,PR(t).stat().then((t=>n(void 0,"object"==typeof e&&e?.bigint?new PM(t):t))).catch(n)}function XS(t,e=NS){const n=PR(t).close();vR.delete(t),n.then((()=>e())).catch(e)}function GS(t,e,n=NS){const i="number"==typeof e?e:0;n="function"==typeof e?e:n;const s=PR(t);if(i<0)throw new IO(cO.EINVAL);s.truncate(i).then((()=>n())).catch(n)}function HS(t,e=NS){PR(t).sync().then((()=>e())).catch(e)}function WS(t,e=NS){PR(t).datasync().then((()=>e())).catch(e)}function KS(t,e,n,i,s,o=NS){let r,a,l,u,p;const _=new QA(t,this);if("string"==typeof e){switch(p="utf8",typeof n){case"function":o=n;break;case"number":u=n,p="string"==typeof i?i:"utf8",o="function"==typeof s?s:o;break;default:return void(o="function"==typeof i?i:"function"==typeof s?s:o)(new IO(cO.EINVAL,"Invalid arguments."))}r=NR.Buffer.from(e),a=0,l=r.length;const t=o;_.write(r,a,l,u).then((({bytesWritten:e})=>t(void 0,e,r.toString(p)))).catch(t)}else{r=NR.Buffer.from(e.buffer),a=n,l=i,u="number"==typeof s?s:null;const t="function"==typeof s?s:o;_.write(r,a,l,u).then((({bytesWritten:e})=>t(void 0,e,r))).catch(t)}}function jS(t,e,n,i,s,o=NS){new QA(t,this).read(e,n,i,s).then((({bytesRead:t,buffer:e})=>o(void 0,t,e))).catch(o)}function qS(t,e,n,i=NS){new QA(t,this).chown(e,n).then((()=>i())).catch(i)}function $S(t,e,n){new QA(t,this).chmod(e).then((()=>n())).catch(n)}function zS(t,e,n,i=NS){new QA(t,this).utimes(e,n).then((()=>i())).catch(i)}function QS(t,e=NS){uS.call(this,t).then((()=>e())).catch(e)}function JS(t,e,n=NS){pS.call(this,t,e).then((()=>n())).catch(n)}function ZS(t,e,n=NS){n="function"==typeof e?e:n;const i="function"!=typeof e?e:{};_S.call(this,t,i).then((t=>n(void 0,t))).catch(n)}function tC(t,e,n=NS){dS.call(this,t,e).then((()=>n())).catch(n)}function eC(t,e,n,i=NS){const s="string"==typeof n?n:"file";i="function"==typeof n?n:i,hS.call(this,t,e,s).then((()=>i())).catch(i)}function nC(t,e,n=NS){n="function"==typeof e?e:n,cS.call(this,t).then((t=>n(void 0,t))).catch(n)}function iC(t,e,n,i=NS){TS.call(this,t,e,n).then((()=>i())).catch(i)}function sC(t,e,n,i=NS){IS.call(this,t,e,n).then((()=>i())).catch(i)}function oC(t,e,n=NS){mS.call(this,t,e).then((()=>n())).catch(n)}function rC(t,e,n=NS){ES.call(this,t,e).then((()=>n())).catch(n)}function aC(t,e,n,i=NS){fS.call(this,t,e,n).then((()=>i())).catch(i)}function lC(t,e,n,i=NS){gS.call(this,t,e,n).then((()=>i())).catch(i)}function uC(t,e,n=NS){n="function"==typeof e?e:n,OS.call(this,t,"function"==typeof e?null:e).then((t=>n(void 0,t))).catch(n)}function pC(t,e,n=NS){const i="number"==typeof e?e:YO;n="function"==typeof e?e:n,RS.call(this,t,i).then((()=>n())).catch(n)}const _C=new Map;function dC(t,e,n){const i=vO(t.toString()),s="function"!=typeof e?e:{};if("function"==typeof e&&(n=e),!n)throw new IO(cO.EINVAL,"No listener specified",t.toString(),"watchFile");if(_C.has(i)){const t=_C.get(i);return void(t&&t.listeners.add(n))}const o=new qR(i,s);o.on("change",((t,e)=>{const n=_C.get(i);if(n)for(const i of n.listeners)i(t,e)})),_C.set(i,{watcher:o,listeners:new Set})}function hC(t,e=NS){const n=vO(t.toString()),i=_C.get(n);i&&(e&&e!==NS?i.listeners.delete(e):i.listeners.clear(),0===i.listeners.size&&(i.watcher.stop(),_C.delete(n)))}function cC(t,e,n){const i=new jR(vO(t),"object"==typeof e?e:{});return n="function"==typeof e?e:n,i.on("change",n||NS),i}function TC(t,e){const n=this;let i;const s=new jA({highWaterMark:(e="object"==typeof e?e:{encoding:e}).highWaterMark||65536,encoding:e.encoding||"utf8",async read(o){try{i||(i=await oS.call(n,t,"r",e?.mode));const r=await i.read(new Uint8Array(o),0,o,i.file.position);s.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),i.file.position+=r.bytesRead,r.bytesRead||await i.close()}catch(t){await(i?.close()),s.destroy(t)}},destroy(t,e){i?.close().then((()=>e(t))).catch(NS)}});return s.path=t.toString(),s}function IC(t,e){const n=this;let i;e="object"==typeof e?e:{encoding:e};const s=new qA({highWaterMark:e?.highWaterMark,async write(s,o,r){try{i||(i=await oS.call(n,t,"w",e?.mode||438)),await i.write(s,0,o),r(void 0)}catch(t){await(i?.close()),r(t)}},destroy(t,e){e(t),i?.close().then((()=>e(t))).catch(e)},final(t){i?.close().then((()=>t())).catch(t)}});return s.path=t.toString(),s}function mC(t,e,n=NS){n="function"==typeof e?e:n,AS.call(this,t,"function"==typeof e?void 0:e).then((()=>n(void 0))).catch(n)}function EC(t,e,n=NS){n="function"==typeof e?e:n,SS.call(this,t,"function"!=typeof e?e:null).then((t=>n(void 0,t))).catch(n)}function fC(t,e,n,i=NS){i="function"==typeof n?n:i,CS.call(this,t,e,"function"==typeof n?void 0:n).then((()=>i(void 0))).catch(i)}function gC(t,e,n,i=NS){i="function"==typeof n?n:i,new QA(t,this).readv(e,"function"==typeof n?void 0:n).then((({buffers:t,bytesRead:e})=>i(void 0,e,t))).catch(i)}function OC(t,e,n,i=NS){i="function"==typeof n?n:i,new QA(t,this).writev(e,"function"==typeof n?void 0:n).then((({buffers:t,bytesWritten:e})=>i(void 0,e,t))).catch(i)}function MC(t,e,n=NS){n="function"==typeof e?e:n,LS.call(this,t,"function"==typeof e?void 0:e).then((t=>n(void 0,t))).catch(n)}function RC(t,e,n,i=NS){i="function"==typeof n?n:i,yS.call(this,t,e,"function"==typeof n?void 0:n).then((()=>i(void 0))).catch(i)}function AC(t,e,n=NS){n="function"==typeof e?e:n,DS.call(this,t,"function"==typeof e?void 0:e).then((t=>n(void 0,t))).catch(n)}async function SC(t,e){const n=await oS.call(this,t.toString(),"r"),i=await n.readFile();return await n.close(),new Blob([i],e)}var CC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},LC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});function yC(t){return class extends t{constructor(){super(...arguments),this._queue=[],this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise((t=>{const e=()=>this._queueRunning?setTimeout(e):t();e()}))}async ready(){if(await super.ready(),await this.queueDone(),!this._isInitialized&&!this._disableSync){if(this.checkSync(),await this._sync.ready(),this._sync instanceof OR&&this instanceof OR){const t=this._sync.store.transaction(),e=this.store.transaction(),n=[];for(const i of await e.keys())n.push(e.get(i).then((e=>t.setSync(i,e))));return await Promise.all(n),void(this._isInitialized=!0)}try{await this.crossCopy("/"),this._isInitialized=!0}catch(t){throw this._isInitialized=!1,t}}}checkSync(t,e){if(this._disableSync)throw new IO(cO.ENOTSUP,"Sync caching has been disabled for this async file system",t,e);if(!this._sync)throw new IO(cO.ENOTSUP,"No sync cache is attached to this async file system",t,e)}renameSync(t,e){this.checkSync(t,"rename"),this._sync.renameSync(t,e),this.queue("rename",t,e)}statSync(t){return this.checkSync(t,"stat"),this._sync.statSync(t)}createFileSync(t,e,n){return this.checkSync(t,"createFile"),this._sync.createFileSync(t,e,n),this.queue("createFile",t,e,n),this.openFileSync(t,e)}openFileSync(t,e){this.checkSync(t,"openFile");const n=this._sync.openFileSync(t,e+"+"),i=n.statSync(),s=new Uint8Array(i.size);return n.readSync(s),new jM(this,t,e,i,s)}unlinkSync(t){this.checkSync(t,"unlinkSync"),this._sync.unlinkSync(t),this.queue("unlink",t)}rmdirSync(t){this.checkSync(t,"rmdir"),this._sync.rmdirSync(t),this.queue("rmdir",t)}mkdirSync(t,e){this.checkSync(t,"mkdir"),this._sync.mkdirSync(t,e),this.queue("mkdir",t,e)}readdirSync(t){return this.checkSync(t,"readdir"),this._sync.readdirSync(t)}linkSync(t,e){this.checkSync(t,"link"),this._sync.linkSync(t,e),this.queue("link",t,e)}syncSync(t,e,n){this.checkSync(t,"sync"),this._sync.syncSync(t,e,n),this.queue("sync",t,e,n)}existsSync(t){return this.checkSync(t,"exists"),this._sync.existsSync(t)}async crossCopy(t){this.checkSync(t,"crossCopy");const e=await this.stat(t);if(!e.isDirectory()){const n={stack:[],error:void 0,hasError:!1};try{const i=CC(n,await this.openFile(t,xM("r")),!0),s=CC(n,this._sync.createFileSync(t,xM("w"),e.mode),!1),o=new Uint8Array(e.size);return await i.read(o),void s.writeSync(o,0,e.size)}catch(t){n.error=t,n.hasError=!0}finally{const t=LC(n);t&&await t}}if("/"!==t){const e=await this.stat(t);this._sync.mkdirSync(t,e.mode)}const n=[];for(const e of await this.readdir(t))n.push(this.crossCopy(gO(t,e)));await Promise.all(n)}async _next(){if(!this._queueRunning)return;const[t,...e]=this._queue.shift();await this[t](...e),await this._next()}queue(...t){this._queue.push(t),this._next()}}}new Map;yC(qM);new Map;Map;DC=qM;var DC;var NC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},bC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class vC{get isLocked(){return this._isLocked}constructor(t){this.previous=t,this.current=Promise.withResolvers(),this._isLocked=!0}async done(){await(this.previous?.done()),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}}class wC{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){const t=new vC(this.currentLock);return this.currentLock=t,t}async lock(t,e){const n=this.currentLock,i=this.addLock(),s=(new Error).stack;return setTimeout((()=>{if(i.isLocked){const n=IO.With("EDEADLK",t,e);throw n.stack+=s?.slice(5),n}}),5e3),await(n?.done()),i}lockSync(t,e){if(this.currentLock?.isLocked)throw IO.With("EBUSY",t,e);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"rename"),!1);await this._fs.rename(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}renameSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"rename"),!1);return this._fs.renameSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"stat"),!1);return await this._fs.stat(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"stat"),!1);return this._fs.statSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async openFile(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"openFile"),!1);const i=await this._fs.openFile(t,e);return i.fs=this,i}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}openFileSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"openFile"),!1);const i=this._fs.openFileSync(t,e);return i.fs=this,i}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async createFile(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,await this.lock(t,"createFile"),!1);const s=await this._fs.createFile(t,e,n);return s.fs=this,s}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}createFileSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,this.lockSync(t,"createFile"),!1);const s=this._fs.createFileSync(t,e,n);return s.fs=this,s}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}async unlink(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"unlink"),!1);await this._fs.unlink(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}unlinkSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"unlink"),!1);return this._fs.unlinkSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async rmdir(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"rmdir"),!1);await this._fs.rmdir(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}rmdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"rmdir"),!1);return this._fs.rmdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async mkdir(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"mkdir"),!1);await this._fs.mkdir(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}mkdirSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"mkdir"),!1);return this._fs.mkdirSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"readdir"),!1);return await this._fs.readdir(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"readdir"),!1);return this._fs.readdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async exists(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"exists"),!1);return await this._fs.exists(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}existsSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"exists"),!1);return this._fs.existsSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async link(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"link"),!1);await this._fs.link(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}linkSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"link"),!1);return this._fs.linkSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async sync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,await this.lock(t,"sync"),!1);await this._fs.sync(t,e,n)}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}syncSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,this.lockSync(t,"sync"),!1);return this._fs.syncSync(t,e,n)}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}}var FC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},PC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});const kC="/.deleted";class VC extends qM{async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}constructor({writable:t,readable:e}){if(super(),this._isInitialized=!1,this._deletedFiles=new Set,this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this.writable=t,this.readable=e,this.writable.metadata().readonly)throw new IO(cO.EINVAL,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:YC.name}}async sync(t,e,n){await this.copyForWrite(t),await this.writable.exists(t)||await this.writable.createFile(t,"w",420),await this.writable.sync(t,e,n)}syncSync(t,e,n){this.copyForWriteSync(t),this.writable.syncSync(t,e,n)}async _initialize(){if(!this._isInitialized){try{const t=await this.writable.openFile(kC,xM("r")),{size:e}=await t.stat(),{buffer:n}=await t.read(new Uint8Array(e));this._deleteLog=LO(n)}catch(t){if(t.errno!==cO.ENOENT)throw t}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(t){this._deleteLog=t,this._reparseDeletionLog(),await this.updateLog("")}async rename(t,e){this.checkInitialized(),this.checkPath(t),this.checkPath(e),await this.copyForWrite(t);try{await this.writable.rename(t,e)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"rename")}}renameSync(t,e){this.checkInitialized(),this.checkPath(t),this.checkPath(e),this.copyForWriteSync(t);try{this.writable.renameSync(t,e)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"rename")}}async stat(t){this.checkInitialized();try{return await this.writable.stat(t)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"stat");const e=await this.readable.stat(t);return e.mode|=146,e}}statSync(t){this.checkInitialized();try{return this.writable.statSync(t)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"stat");const e=this.readable.statSync(t);return e.mode|=146,e}}async openFile(t,e){if(await this.writable.exists(t))return this.writable.openFile(t,e);const n=await this.readable.openFile(t,xM("r")),i=await n.stat(),{buffer:s}=await n.read(new Uint8Array(i.size));return new jM(this,t,e,i,s)}openFileSync(t,e){if(this.writable.existsSync(t))return this.writable.openFileSync(t,e);const n=this.readable.openFileSync(t,xM("r")),i=n.statSync(),s=new Uint8Array(i.size);return n.readSync(s),new jM(this,t,e,i,s)}async createFile(t,e,n){return this.checkInitialized(),await this.writable.createFile(t,e,n),this.openFile(t,e)}createFileSync(t,e,n){return this.checkInitialized(),this.writable.createFileSync(t,e,n),this.openFileSync(t,e)}async link(t,e){this.checkInitialized(),await this.copyForWrite(t),await this.writable.link(t,e)}linkSync(t,e){this.checkInitialized(),this.copyForWriteSync(t),this.writable.linkSync(t,e)}async unlink(t){if(this.checkInitialized(),this.checkPath(t),!await this.exists(t))throw IO.With("ENOENT",t,"unlink");await this.writable.exists(t)&&await this.writable.unlink(t),await this.exists(t)&&await this.deletePath(t)}unlinkSync(t){if(this.checkInitialized(),this.checkPath(t),!this.existsSync(t))throw IO.With("ENOENT",t,"unlink");this.writable.existsSync(t)&&this.writable.unlinkSync(t),this.existsSync(t)&&this.deletePath(t)}async rmdir(t){if(this.checkInitialized(),!await this.exists(t))throw IO.With("ENOENT",t,"rmdir");if(await this.writable.exists(t)&&await this.writable.rmdir(t),await this.exists(t)){if((await this.readdir(t)).length)throw IO.With("ENOTEMPTY",t,"rmdir");await this.deletePath(t)}}rmdirSync(t){if(this.checkInitialized(),!this.existsSync(t))throw IO.With("ENOENT",t,"rmdir");if(this.writable.existsSync(t)&&this.writable.rmdirSync(t),this.existsSync(t)){if(this.readdirSync(t).length)throw IO.With("ENOTEMPTY",t,"rmdir");this.deletePath(t)}}async mkdir(t,e){if(this.checkInitialized(),await this.exists(t))throw IO.With("EEXIST",t,"mkdir");await this.createParentDirectories(t),await this.writable.mkdir(t,e)}mkdirSync(t,e){if(this.checkInitialized(),this.existsSync(t))throw IO.With("EEXIST",t,"mkdir");this.createParentDirectoriesSync(t),this.writable.mkdirSync(t,e)}async readdir(t){this.checkInitialized();const e=[];try{e.push(...await this.writable.readdir(t))}catch{}try{e.push(...(await this.readable.readdir(t)).filter((e=>!this._deletedFiles.has(`${t}/${e}`))))}catch{}const n={};return e.filter((t=>{const e=!n[t];return n[t]=!0,e}))}readdirSync(t){this.checkInitialized();let e=[];try{e=e.concat(this.writable.readdirSync(t))}catch{}try{e=e.concat(this.readable.readdirSync(t).filter((e=>!this._deletedFiles.has(`${t}/${e}`))))}catch{}const n={};return e.filter((t=>{const e=!n[t];return n[t]=!0,e}))}async deletePath(t){this._deletedFiles.add(t),await this.updateLog(`d${t}\n`)}async updateLog(t){if(this._deleteLog+=t,this._deleteLogUpdatePending)return void(this._deleteLogUpdateNeeded=!0);this._deleteLogUpdatePending=!0;const e=await this.writable.openFile(kC,xM("w"));try{await e.write(SO(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(t){this._deleteLogError=t}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(const t of this._deleteLog.split("\n"))t.startsWith("d")&&this._deletedFiles.add(t.slice(1))}checkInitialized(){if(!this._isInitialized)throw new IO(cO.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;const t=this._deleteLogError;throw delete this._deleteLogError,t}checkPath(t){if(t==kC)throw IO.With("EPERM",t,"checkPath")}createParentDirectoriesSync(t){let e=OO(t);const n=[];for(;!this.writable.existsSync(e);)n.push(e),e=OO(e);for(const t of n.reverse())this.writable.mkdirSync(t,this.statSync(t).mode)}async createParentDirectories(t){let e=OO(t);const n=[];for(;!await this.writable.exists(e);)n.push(e),e=OO(e);for(const t of n.reverse()){const e=await this.stat(t);await this.writable.mkdir(t,e.mode)}}copyForWriteSync(t){if(!this.existsSync(t))throw IO.With("ENOENT",t,"copyForWrite");this.writable.existsSync(OO(t))||this.createParentDirectoriesSync(t),this.writable.existsSync(t)||this.copyToWritableSync(t)}async copyForWrite(t){if(!await this.exists(t))throw IO.With("ENOENT",t,"copyForWrite");if(await this.writable.exists(OO(t))||await this.createParentDirectories(t),!await this.writable.exists(t))return this.copyToWritable(t)}copyToWritableSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=this.statSync(t);if(n.isDirectory())return void this.writable.mkdirSync(t,n.mode);const i=new Uint8Array(n.size);FC(e,this.readable.openFileSync(t,"r"),!1).readSync(i);FC(e,this.writable.createFileSync(t,"w",146|n.mode),!1).writeSync(i)}catch(t){e.error=t,e.hasError=!0}finally{PC(e)}}async copyToWritable(t){const e={stack:[],error:void 0,hasError:!1};try{const n=await this.stat(t);if(n.isDirectory())return void await this.writable.mkdir(t,n.mode);const i=new Uint8Array(n.size),s=FC(e,await this.readable.openFile(t,"r"),!0);await s.read(i);const o=FC(e,await this.writable.createFile(t,"w",146|n.mode),!0);await o.write(i)}catch(t){e.error=t,e.hasError=!0}finally{const t=PC(e);t&&await t}}}class YC extends(function(t){return class extends wC{constructor(...e){super(),this._fs=new t(...e)}}}(VC)){}function xC(t,e,n){if(t instanceof IO)return t;const i=t instanceof DOMException?cO[function(t){switch(t.name){case"IndexSizeError":case"HierarchyRequestError":case"InvalidCharacterError":case"InvalidStateError":case"SyntaxError":case"NamespaceError":case"TypeMismatchError":case"ConstraintError":case"VersionError":case"URLMismatchError":case"InvalidNodeTypeError":return"EINVAL";case"WrongDocumentError":return"EXDEV";case"NoModificationAllowedError":case"InvalidModificationError":case"InvalidAccessError":case"SecurityError":case"NotAllowedError":return"EACCES";case"NotFoundError":return"ENOENT";case"NotSupportedError":return"ENOTSUP";case"InUseAttributeError":return"EBUSY";case"NetworkError":return"ENETDOWN";case"AbortError":return"EINTR";case"QuotaExceededError":return"ENOSPC";case"TimeoutError":return"ETIMEDOUT";case"ReadOnlyError":return"EROFS";default:return"EIO"}}(t)]:cO.EIO,s=new IO(i,t.message,e,n);return s.stack=t.stack,s.cause=t.cause,s}globalThis.__zenfs__=st;class UC extends(yC(qM)){constructor(t){super(),this._handles=new Map,this._sync=CR.create({name:"accessfs-cache"}),this._handles.set("/",t)}metadata(){return{...super.metadata(),name:"WebAccess",noResizableBuffers:!0}}async sync(t,e){await this.writeFile(t,e)}async rename(t,e){const n=await this.getHandle(t);if(n instanceof FileSystemDirectoryHandle){const n=await this.readdir(t);if(await this.mkdir(e),!n.length)return void await this.unlink(t);for(const i of n)await this.rename(gO(t,i),gO(e,i)),await this.unlink(t);return}if(!(n instanceof FileSystemFileHandle))throw new IO(cO.ENOTSUP,"Not a file or directory handle",t,"rename");const i=await n.getFile().catch((e=>{throw xC(e,t,"rename")})),s=await this.getHandle(OO(e));if(!(s instanceof FileSystemDirectoryHandle))return;const o=await s.getFileHandle(MO(e),{create:!0}).catch((t=>{throw xC(t,e,"rename")})),r=await o.createWritable();await r.write(await i.arrayBuffer()),await r.close(),await this.unlink(t)}async writeFile(t,e){if(e.buffer.resizable)throw new IO(cO.EINVAL,"Resizable buffers can not be written",t,"write");const n=await this.getHandle(OO(t));if(!(n instanceof FileSystemDirectoryHandle))return;const i=await n.getFileHandle(MO(t),{create:!0}),s=await i.createWritable();await s.write(e),await s.close()}async createFile(t,e){return await this.writeFile(t,new Uint8Array),this.openFile(t,e)}async stat(t){const e=await this.getHandle(t);if(!e)throw IO.With("ENOENT",t,"stat");if(e instanceof FileSystemDirectoryHandle)return new FM({mode:511|_M,size:4096});if(e instanceof FileSystemFileHandle){const{lastModified:t,size:n}=await e.getFile();return new FM({mode:511|uM,size:n,mtimeMs:t})}throw new IO(cO.EBADE,"Handle is not a directory or file",t,"stat")}async openFile(t,e){const n=await this.getHandle(t);if(!(n instanceof FileSystemFileHandle))throw IO.With("EISDIR",t,"openFile");const i=await n.getFile().catch((e=>{throw xC(e,t,"openFile")})),s=new Uint8Array(await i.arrayBuffer()),o=new FM({mode:511|uM,size:i.size,mtimeMs:i.lastModified});return new jM(this,t,e,o,s)}async unlink(t){const e=await this.getHandle(OO(t));if(!(e instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",OO(t),"unlink");await e.removeEntry(MO(t),{recursive:!0}).catch((e=>{throw xC(e,t,"unlink")}))}async link(t){}async rmdir(t){return this.unlink(t)}async mkdir(t){if(await this.getHandle(t).catch((t=>{if("ENOENT"!=t.code)throw t})))throw IO.With("EEXIST",t,"mkdir");const e=await this.getHandle(OO(t));if(!(e instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",t,"mkdir");await e.getDirectoryHandle(MO(t),{create:!0})}async readdir(t){const e=await this.getHandle(t);if(!(e instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",t,"readdir");const n=[];for await(const t of e.keys())n.push(t);return n}async getHandle(t){if(this._handles.has(t))return this._handles.get(t);let e="/";for(const n of t.split("/").slice(1)){const t=this._handles.get(e);if(!(t instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",e,"getHandle");e=gO(e,n);const i=await t.getDirectoryHandle(n).catch((i=>{switch(i.name){case"TypeMismatchError":return t.getFileHandle(n).catch((t=>{}));case"TypeError":throw new IO(cO.ENOENT,i.message,e,"getHandle");default:throw xC(i,e,"getHandle")}}));i&&this._handles.set(e,i)}return this._handles.get(t)}}function BC(t){return new Promise(((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)}))}let XC;function GC(){return XC||(XC=function(t,e){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);const i=BC(n);return(t,n)=>i.then((i=>n(i.transaction(e,t).objectStore(e))))}("keyval-store","keyval")),XC}class HC extends UC{constructor(t){super(t)}async readFile(t){const e=await this.getHandle(t);if(e instanceof window.FileSystemFileHandle){const t=await e.getFile();return await t.text()}return""}}class WC extends rt.FS{#t=null;constructor(){super()}async showDirectoryPicker(){const t=await window.showDirectoryPicker({mode:"readwrite"});if("granted"!==await t.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return await this.setFSCache(t),this.#t=new HC(t),t}async loadFS(){let t=await this.getFSCache();if(!t)return null;if("granted"!==await t.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return this.#t=new HC(t),t}async getFSCache(){return function(t,e=GC()){return e("readonly",(e=>BC(e.get(t))))}("mixly-pyodide-fs")}async setFSCache(t){await function(t,e,n=GC()){return n("readwrite",(n=>(n.put(e,t),BC(n.transaction))))}("mixly-pyodide-fs",t)}async createFile(t){return this.#t.createFile(t,"")}async readFile(t){return this.#t.readFile(t)}async writeFile(t,e){return this.#t.writeFile(t,e,"utf8")}async isFile(t){const e=await this.#t.stat(t);return!(!e||33279!==e.mode)}async renameFile(t,e){return await this.#t.rename(t,e)}async moveFile(t,e){return this.renameFile(t,e)}async deleteFile(t){return this.#t.unlink(t)}async createDirectory(t){return this.#t.mkdir(t,511)}async readDirectory(t){return await this.#t.readdir(t)}async isDirectory(t){const e=await this.#t.stat(t);return!(!e||16895!==e.mode)}async isDirectoryEmpty(t){const e=await this.readDirectory(t);return!e?.length}async renameDirectory(t,e){return this.#t.rename(t,e)}async moveDirectory(t,e){return this.#t.rename(t,e)}async deleteDirectory(t){return this.#t.rmdir(t)}}class KC extends rt.FileTree{constructor(){super(new WC)}async readFolder(t){let e=[];try{const n=this.getFS();if(!await n.isDirectory(t))return e;const i=await n.readDirectory(t);for(let s of i){const i=aO.join(t,s);if(await n.isDirectory(i)){const t=await n.isDirectoryEmpty(i);e.push({type:"folder",id:i,children:!t,title:`/${this.getRootFolderName()}${i}`})}else e.push({type:"file",id:i,children:!1,title:`/${this.getRootFolderName()}${i}`})}}catch(t){rt.Debug.error(t)}return e}}class jC extends rt.PageBase{static{rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem.html",new rt.HTMLTemplate('\r\n
\r\n
\r\n
\r\n
')),rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem-open-fs.html",new rt.HTMLTemplate('\r\n
\r\n \r\n
')),rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem-editor-empty.html",new rt.HTMLTemplate('\r\n
\r\n
\r\n
')),this.init=function(){rt.StatusBarsManager.typesRegistry.register(["file-system"],jC);const t=rt.Workspace.getMain().getStatusBarsManager();return t.add("file-system","file-system",ot.Msg.PYTHON_PYODIDE_FILE_SYSTEM),t.changeTo("output"),t.get("file-system")}}#e=null;#n=null;#i=null;#s=null;#o=null;#r=null;#a=null;#l=null;#u=!1;#p=!1;#_=!1;#d=null;constructor(){super();const t=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem.html").render());this.setContent(t),this.#a=new KC,this.#n=t.children(".file-tree"),this.#s=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem-open-fs.html").render({msg:{loadFS:ot.Msg.PYTHON_PYODIDE_LOAD_FILE_SYSTEM}})),this.#n.append(this.#s),this.#r=new rt.StatusBar,this.#i=t.children(".editor"),this.#o=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem-editor-empty.html").render()),this.#i.append(this.#o)}#h(){this.#l=new rt.DragV(this.getContent()[0],{min:"150px",startSize:"15%",full:[!1,!1]}),this.#l.bind("sizeChanged",(()=>{this.resize()})),this.#s.children("button").click((()=>{this.selectFS().catch(rt.Debug.error)})),this.#a.bind("beforeSelectLeaf",(t=>{const e=t[0].id,n=this.#r.getFileMode(aO.extname(e));return n?(this.#r.setMode(n),!0):(hO.layer.msg(rt.Msg.Lang["statusbar.ampy.cannotEdit"],{time:1e3}),!1)})),this.#a.bind("afterSelectLeaf",(async t=>{const e=t[0].id;this.#a.showProgress();const n=this.#a.getFS();try{const t=await n.readFile(e);this.showEditor(),this.#r.setValue(t),this.#r.scrollToTop(),this.#r.focus(),this.setStatus(!1)}catch(t){rt.Debug.error(t),this.hideEditor(),this.#a.deselectAll()}this.#a.hideProgress()})),this.#a.bind("afterCreateNode",(t=>{this.#a.refreshFolder(t)})),this.#a.bind("afterDeleteNode",(t=>{this.#a.refreshFolder(t)})),this.#a.bind("afterRenameNode",(t=>{this.#a.refreshFolder(t)})),this.#a.bind("afterRefreshNode",(()=>{this.#a.getSelectedNodeId()||this.hideEditor()}));const t=this.#a.getContextMenu().getItem("menu");t.add({weight:7,type:"copy_path",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["fileTree.copyPath"],""),callback:(t,{$trigger:e})=>{let n=null;n="root"===e.attr("type")?this.#a.getRootFolderTitle():e.attr("title"),navigator.clipboard.writeText(n).catch(rt.Debug.error)}}}),t.add({weight:14,type:"sep5",preconditionFn:t=>{const e=this.#a.getSelectedNodeId();let n=t.attr("type"),i=t.attr("id");return"file"!==n||e===i},data:"---------"}),t.add({weight:15,type:"refresh",preconditionFn:t=>{const e=this.#a.getSelectedNodeId();let n=t.attr("type"),i=t.attr("id");return"file"!==n||e===i},data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["statusbar.ampy.refresh"],""),callback:(t,{$trigger:e})=>{let n=e.attr("type");if("root"===n)this.#a.openRootFolder(),this.#a.refreshFolder("/");else if("folder"===n){let t=e.attr("id");this.#a.openNode(t),this.#a.refreshFolder(t)}else{const t=this.#a.getSelectedNodes();this.#a.runEvent("afterSelectLeaf",t)}}}}),t.add({weight:16,type:"sep6",preconditionFn:t=>{let e=t.attr("type");return["root"].includes(e)},data:"---------"}),t.add({weight:17,type:"exit",preconditionFn:t=>{let e=t.attr("type");return["root"].includes(e)},data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["statusbar.ampy.exit"],""),callback:()=>{this.closeFS()}}}),t.remove("copy"),t.remove("cut"),t.remove("paste"),t.remove("sep2");const e=this.#r.getContextMenu().getItem("code");e.empty(),e.add({weight:0,type:"cut",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.cut"],"Ctrl+X"),callback:()=>this.#r.cut()}}),e.add({weight:1,type:"copy",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.copy"],"Ctrl+C"),callback:()=>this.#r.copy()}}),e.add({weight:2,type:"paste",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.paste"],"Ctrl+V"),callback:()=>this.#r.paste()}}),e.add({weight:3,type:"sep1",data:"---------"}),e.add({weight:4,type:"togglecomment",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.togglecomment"],"Ctrl+/"),callback:()=>this.#r.commentLine()}}),e.add({weight:6,type:"sep2",preconditionFn:()=>this.#_,data:"---------"}),e.add({weight:7,type:"save",preconditionFn:()=>this.#_,data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["file.save"],"Ctrl+S"),callback:async()=>{await this.put()}}});const{commands:n}=this.#r.getEditor();n.addCommand({name:"save",bindKey:"Ctrl-S",exec:async()=>{this.#_&&await this.put()}})}async put(){this.#a.showProgress();const t=this.#a.getSelectedNodeId(),e=this.#a.getFS(),[n]=await e.writeFile(t,this.#r.getValue());this.#a.hideProgress(),n||this.setStatus(!1)}showFileTree(){this.#u||(this.#s.detach(),this.#n.empty(),this.#n.append(this.#a.getContent()),this.#u=!0)}hideFileTree(){this.#u&&(this.#a.getContent().detach(),this.#n.empty(),this.#n.append(this.#s),this.#u=!1)}showEditor(){this.#p||(this.#o.detach(),this.#i.empty(),this.#i.append(this.#r.getContent()),this.#p=!0)}hideEditor(){this.#p&&(this.#r.getContent().detach(),this.#i.empty(),this.#i.append(this.#o),this.#p=!1,this.setStatus(!1))}getDrag(){return this.#l}init(){super.init(),this.hideCloseBtn(),this.#r.init(),this.#h();const t=this.#r.getEditor();t.setReadOnly(!1),t.renderer.setShowGutter(!0),t.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,newLineMode:"unix"}),t.on("change",(()=>{this.setStatus(!0)})),this.loadFS().catch(rt.Debug.error)}async loadFS(){const t=this.#a.getFS(),e=await t.loadFS();await this.openFS(e)}async selectFS(){const t=this.#a.getFS(),e=await t.showDirectoryPicker();await this.openFS(e)}async openFS(t){if(!t?.name)return;const e="/"+t.name;this.#a.setFolderPath("/"),this.#a.setRootFolderTitle(e),this.#a.setRootFolderName(t.name),this.#a.openRootFolder(),this.showFileTree(),this.#d=await window.pyodide.mountNativeFS(e,t)}closeFS(){const t=this.#a.getRootFolderTitle();if(Object.keys(window.pyodide.FS.root.contents).includes(aO.basename(t))){const e=window.pyodide.FS.lookupPath(t,{follow_mount:!1});window.pyodide.FS.isMountpoint(e.node)&&window.pyodide.FS.unmount(t)}this.#a.getFS().setFSCache(null),this.#a.deselectAll(),this.hideFileTree(),this.hideEditor(),this.setStatus(!1)}onMounted(){super.onMounted(),this.#r.onMounted(),this.#a.onMounted()}onUnmounted(){super.onUnmounted(),this.#r.onUnmounted(),this.#a.onUnmounted()}resize(){super.resize(),this.#r.resize(),this.#a.resize()}setStatus(t){this.#_!==t&&(this.#_=t)}getNativeFS(){return this.#d}dispose(){this.#r.dispose(),this.#r=null,this.#a.dispose(),this.#a=null,super.dispose()}}class qC{static{rt.HTMLTemplate.add("html/statusbar/loader.html",new rt.HTMLTemplate('\r\n
\r\n
\r\n

{{d.msg.loading}}

\r\n
')),this.pythonShell=null,this.kernelLoaded=!1,this.$loader=uO()(rt.HTMLTemplate.get("html/statusbar/loader.html").render({msg:{loading:ot.Msg.PYTHON_PYODIDE_LOADING}})),this.statusBarImage=null,this.statusBarFileSystem=null,this.init=async function(){rt.app.getFooterBar().getContent().after(this.$loader);const t=aO.relative(rt.Env.indexDirPath,rt.Env.boardDirPath),e=new _O({rootPath:aO.join(t,"deps"),language:"python3"}),n=await e.kernelAvailable();n&&(await n.init(),await n.loaded(),this.loader=e,this.kernel=n,this.statusBarImage=dO.init(),this.statusBarFileSystem=jC.init(),this.pythonShell=new qC,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer),this.kernelLoaded=!0,this.$loader.remove(),this.$loader=null)},this.run=async function(){if(!this.kernelLoaded)return;const t=rt.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(t)},this.stop=async function(){if(this.kernelLoaded)return this.pythonShell.stop()}}#c=null;#T=null;#I=null;#m={row:0,column:0};#E="";#f=null;#g=null;#O=!1;#M=!1;#R=null;#A=()=>this.#S();#C=[{name:"REPL-Enter",bindKey:"Enter",exec:t=>{if(t.getSession().selection.getCursor().row===this.#m.row){const t=this.#c.getEndPos();let e=this.#c.getValueRange(this.#m,t);e=e.replace(this.#E,""),this.#f?.(e),this.#f=null,this.#g=null,this.#c.addValue("\n"),this.#L()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:t=>{const e=t.getSession().selection.getCursor();return e.row{this.#M=!1,this.#c.addValue(`\n==${rt.Msg.Lang["shell.finish"]}==`),this.syncfs(!1).catch(rt.Debug.error)})),this.#R.addEventListener("eval.output",(t=>{this.#c.addValue(t.content)})),this.#R.addEventListener("eval.error",(()=>{this.#M=!1,this.#c.addValue(`\n==${rt.Msg.Lang["shell.finish"]}==`)})),this.#R.addEventListener("eval.input",(t=>{const e=String(t?.content?.prompt);this.#c.addValue(e),this.#E=e,this.#f=t.resolve,this.#g=t.reject,this.#y()})),this.#R.addEventListener("eval.display",(t=>{this.#I.changeTo("images"),this.#T.display(t)}))}#S(){const t=this.#c.getEditor(),e=t.getSession().selection.getCursor();t.setReadOnly(e.row{window.pyodide.FS.syncfs(t,e)}))}sleep(t){return new Promise((e=>setTimeout(e,t)))}}const $C={init:async function(){const t=rt.app.getNav();t.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:ot.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{qC.run().catch(rt.Debug.error)},scopeType:rt.Nav.Scope.LEFT,weight:4}),t.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:ot.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{qC.stop().catch(rt.Debug.error)},scopeType:rt.Nav.Scope.LEFT,weight:5}),await qC.init()}};$C.init(),Object.assign(ot.Variables,lt),Object.assign(ot.Procedures,Bi),ot.Python=uu,ot.generator=uu,rt.Profile.default={},Object.assign(ot.Blocks,t,e,n,i,s,o,r,a,l,u,p,_,d,C,L,y,D,N,b,v,w,F,P,k,V,Y,x,U),Object.assign(ot.Python.forBlock,h,c,T,I,m,E,f,g,O,M,R,A,S,B,X,G,um,H,W,K,j,q,z,Q,J,Z,tt,et)})()})(); \ No newline at end of file +class ut{constructor(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(var n=t.split(","),i=0;i0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ot.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+s).appendField(ot.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.CONTROLS_IF_MSG_ELSE);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_if_elseif");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_if_else");o.initSvg(),n.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],o=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,o=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_if_elseif":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_if_else":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),o=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ot.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(ot.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},yt={init:function(){this.setColour(Mt),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.PYTHON_RANGE).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Dt={init:function(){this.setColour(Mt),this.appendValueInput("LIST").setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(ot.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip((function(){return ot.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Nt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(ot.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new ot.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(ot.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return{WHILE:ot.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:ot.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]}))}},bt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=document.createElement("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){var e=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var s=this.elseifCount_;s>0;s--)e.getInputTargetBlock("IF"+s)&&e.getInputTargetBlock("IF"+s).previousConnection?n[s]=e.getInputTargetBlock("IF"+s).previousConnection:n[s]=null,this.removeInput("IF"+s),e.getInputTargetBlock("DO"+s)&&e.getInputTargetBlock("DO"+s).previousConnection?i[s]=e.getInputTargetBlock("DO"+s).previousConnection:i[s]=null,this.removeInput("DO"+s);this.elseifCount_=parseInt(t.getAttribute("elseif"),10),this.elseCount_=parseInt(t.getAttribute("else"),10);for(s=1;s<=this.elseifCount_;s++)this.appendValueInput("IF"+s).setCheck([Boolean,Number]).appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+s).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.MIXLY_PYTHON_FINALLY);for(s=n.length-2;s>0;s--)n[s]&&n[s].reconnect(this,"IF"+s);for(s=i.length-2;s>0;s--)i[s]&&i[s].reconnect(this,"DO"+s)},decompose:function(t){var e=t.newBlock("controls_try");e.initSvg();for(var n=e.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var s=t.newBlock("controls_except");s.initSvg(),n.connect(s.previousConnection),n=s.nextConnection}if(this.elseCount_){var o=t.newBlock("controls_finally");o.initSvg(),n.connect(o.previousConnection)}return e},compose:function(t){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var e=this.elseifCount_;e>0;e--)this.removeInput("IF"+e),this.removeInput("DO"+e);this.elseifCount_=0;for(var n=t.getInputTargetBlock("STACK"),i=[null],s=[null],o=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),s.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,o=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,s,o)},saveConnections:function(t){for(var e=t.getInputTargetBlock("STACK"),n=1;e;){switch(e.type){case"controls_except":var i=this.getInput("IF"+n),s=this.getInput("DO"+n);e.valueConnection_=i&&i.connection.targetConnection,e.statementConnection_=s&&s.connection.targetConnection,n++;break;case"controls_finally":s=this.getInput("ELSE");e.statementConnection_=s&&s.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var s=this.getInput("IF"+i),o=this.getInput("DO"+i);console.log(s.connection.targetConnection),t.push(s.connection.targetConnection),e.push(o.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);)this.removeInput("IF"+t),this.removeInput("DO"+t),t++;for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck([Number,Boolean]).appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+t).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(ot.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(t,e,n){for(var i=1;i<=this.elseifCount_;i++)t[i]&&t[i].reconnect(this,"IF"+i),e[i]&&e[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},vt={init:function(){this.setColour(Mt);var t=new ot.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(t,"FLOW").appendField(ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var e=this;this.setTooltip((function(){var t=e.getFieldValue("FLOW");return{BREAK:ot.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:ot.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[t]}))},onchange:function(){if(this.workspace){var t=!1,e=this;do{if("controls_repeat"==e.type||"controls_for"==e.type||"controls_forEach"==e.type||"controls_repeat_ext"==e.type||"controls_whileUntil"==e.type||"do_while"==e.type){t=!0;break}e=e.getSurroundParent()}while(e);t?this.setWarningText(null):this.setWarningText(ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},wt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ot.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ot.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ft={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new ot.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){return ot.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",t.getFieldValue("VAR"))}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}};Nt.OPERATORS=[[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],vt.OPERATORS=[[ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[ot.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const Pt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Vt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(ot.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Yt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},xt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},Ut={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(ot.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Bt={init:function(){this.jsonInit({message0:ot.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:Mt,tooltip:ot.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:ot.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},Xt={init:function(){this.setColour(Mt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_STAT),this.setOutput(!0)}},Gt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},Ht={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},Wt={init:function(){this.appendDummyInput().appendField(ot.Msg.CONTROLS_REPEAT_TITLE_REPEAT+ot.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(ot.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new ot.FieldDropdown([[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[ot.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Mt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Kt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},qt={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},$t={init:function(){this.setColour(Mt),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET+ot.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_GET_UNIQUE_IDEN)}},zt={init:function(){this.setColour(Mt),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(ot.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Qt=230;ot.FieldTextInput.math_number_validator=function(t){return String(t)},ot.FieldTextInput.math_number_validator_include_blank=function(t){if(""===t)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(t)?String(t):null};const Jt={init:function(){this.setColour(Qt),this.appendDummyInput().appendField(new ot.FieldTextInput("0",ot.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MATH_NUMBER_TOOLTIP)}},Zt={init:function(){this.setColour(Qt);this.appendDummyInput("").appendField(ot.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ot.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[e]}))}},te={init:function(){this.setColour(Qt);this.appendDummyInput("").appendField(ot.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new ot.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var t=this;this.setTooltip((function(){var e=t.getFieldValue("CONSTANT");return{pi:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:ot.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[e]}))}},ee={init:function(){this.setColour(Qt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ot.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ot.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ot.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ne={init:function(){this.setColour(Qt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{ADD:ot.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:ot.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:ot.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:ot.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:ot.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]}))}},ie={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new ot.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},se={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var t=this;this.setTooltip((function(){var e=t.getFieldValue("OP");return{SIN:ot.Msg.MATH_TRIG_TOOLTIP_SIN,COS:ot.Msg.MATH_TRIG_TOOLTIP_COS,TAN:ot.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:ot.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:ot.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:ot.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:ot.Msg.MATH_SINGLE_TOOLTIP_LN}[e]}))}},oe={init:function(){var t=[[ot.Msg.MATH_BIN,"bin"],[ot.Msg.MATH_OCT,"oct"],[ot.Msg.MATH_HEX,"hex"]];this.setColour(Qt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP");var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{bin:ot.Msg.MATH_DEC_TOOLTIP_BIN,oct:ot.Msg.MATH_DEC_TOOLTIP_OCT,hex:ot.Msg.MATH_DEC_TOOLTIP_HEX}[t]}))}},re={init:function(){var t=[[ot.Msg.LANG_MATH_TO_ROUND,"round"],[ot.Msg.LANG_MATH_TO_CEIL,"ceil"],[ot.Msg.LANG_MATH_TO_FLOOR,"floor"],[ot.Msg.MATH_ABS,"fabs"],[ot.Msg.MATH_SQRT,"sqrt"]];this.setColour(Qt),this.appendValueInput("A").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{sqrt:ot.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:ot.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:ot.Msg.MATH_SINGLE_TOOLTIP_SQ,round:ot.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:ot.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:ot.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[t]}))}},ae={init:function(){var t=[[ot.Msg.MIXLY_MAX,"max"],[ot.Msg.MIXLY_MIN,"min"]];this.setColour(Qt),this.appendValueInput("A").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldDropdown(t),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{max:ot.Msg.MIXLY_TOOLTIP_MATH_MAX,min:ot.Msg.MIXLY_TOOLTIP_MATH_MIN}[t]}))}},le={init:function(){var t=[[ot.Msg.MATH_TWO,"two"],[ot.Msg.MATH_EIGHT,"eight"],[ot.Msg.MATH_TEN,"ten"],[ot.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Qt),this.appendDummyInput("").appendField(ot.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new ot.FieldDropdown(t),"OP").appendField(ot.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(ot.Msg.MATH_ZHW).appendField(new ot.FieldDropdown(t),"OP2").appendField(ot.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP"),n={two:ot.Msg.MATH_Before_two,eight:ot.Msg.MATH_Before_eight,ten:ot.Msg.MATH_Before_ten,sixteen:ot.Msg.MATH_Before_sixteen},i=e.getFieldValue("OP2"),s={two:ot.Msg.MATH_Behind_two,eight:ot.Msg.MATH_Behind_eight,ten:ot.Msg.MATH_Behind_ten,sixteen:ot.Msg.MATH_Behind_sixteen};return n[t]+s[i]}))}},ue={init:function(){var t=[[ot.Msg.LANG_MATH_INT,"int"],[ot.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Qt),this.setOutput(!0,Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_RANDOM).appendField(new ot.FieldDropdown(t),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(ot.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TYPE"),n={int:ot.Msg.LANG_MATH_INT,float:ot.Msg.LANG_MATH_FLOAT_RANDOM};return ot.Msg.MATH_RANDOM_INT_TOOLTIP+n[t]}))}},pe={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(ot.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(ot.Msg.MATH_CONSTRAIN_TOOLTIP)}},_e={init:function(){this.setColour(Qt),this.appendValueInput("NUM",Number).appendField(ot.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(ot.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(ot.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_MATH_MAP)}},de={init:function(){this.setColour(Qt),this.appendDummyInput().appendField(new ot.FieldTextInput("0",ot.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(ot.Msg.MATH_NUMBER_TOOLTIP)}},he={init:function(){this.setColour(Qt),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},ce={init:function(){this.setColour(Qt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MATH_ROUND).appendField(ot.Msg.TEXT_KEEP),this.appendDummyInput().appendField(ot.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(ot.Msg.MATH_ROUND_NEW_TOOLTIP)}},Te={init:function(){var t=[[ot.Msg.MIXLY_TO_INT,"int"],[ot.Msg.MIXLY_TO_FLOAT,"float"],[ot.Msg.MIXLY_TO_BITES,"b"],[ot.Msg.LANG_MATH_BYTE+ot.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Qt),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ot.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:ot.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:ot.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[t]}))}},Ie={init:function(){var t=[[ot.Msg.MIXLY_TO_INT,"int"],[ot.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Qt),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.setOutput(!0,Number);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{int:ot.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:ot.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[t]}))}},me=_e,Ee={init:function(){this.setColour(Qt),this.appendValueInput("VAR").appendField(ot.Msg.LANG_MATH_BYTE+ot.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},fe={init:function(){this.setColour(Qt),this.itemCount_=1,this.setMutator(new ot.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(ot.Msg.MIXLY_PRODUCT+ot.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(ot.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(ot.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(ot.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i1&&"\\"===t.charAt(0)){var e=t.charAt(1);if("0"===e||"b"===e||"f"===e||"n"===e||"r"===e||"t"===e||"\\"===e||"'"===e)return String(t).substring(0,2);if("x"===e&&"0"===t.charAt(2)&&"B"===t.charAt(3))return String(t).substring(0,4)}return String(t).substring(0,1)};const Re={init:function(){this.setColour(ge),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new ot.FieldTextInput("",ot.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(ot.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(t){if(1==t)var e="../../media/quote2.png";else e="../../media/quote3.png";return new ot.FieldImage(e,7,12,'"')}},Ae={init:function(){this.setColour(ge),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(ot.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},Se={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},Ce={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},Le={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},ye={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},De={init:function(){this.WHERE_OPTIONS=[[ot.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ot.Msg.TEXT_GET_INDEX_RANDOM+1+ot.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.LISTS_GET_INDEX_GET,"MODE"),ot.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(ot.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=t.getFieldValue("WHERE"),i="";switch(e+" "+n){case"GET FROM_START":case"GET FROM_END":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=ot.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+ot.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",ot.Msg.ONE_BASED_INDEXING?"#1":"#0")),i}));var e=this;this.setTooltip((function(){var t=e.getFieldValue("WHERE"),n={FROM_START:ot.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:ot.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:ot.Msg.TEXT_GET_INDEX_RANDOM};return ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+n[t]+"n"+ot.Msg.TEXT_CHARAT2}))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("statement",!this.outputConnection);var e=this.getInput("AT").type==ot.INPUT_VALUE;return t.setAttribute("at",e),t},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(t){this.removeInput("AT"),this.removeInput("ORDINAL",!0),t?(this.appendValueInput("AT").setCheck(Number),ot.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(ot.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var e=new ot.FieldDropdown(this.WHERE_OPTIONS,(function(e){var n="FROM_START"==e||"FROM_END"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT").appendField(e,"WHERE"),ot.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Ne={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.LISTS_GET_INDEX_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(ot.Msg.PROCEDURES_DEFRETURN_RETURN+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+ot.Msg.LISTS_GET_INDEX_FROM_START+"n"+ot.Msg.TEXT_CHARAT2)}},be={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(ot.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(ot.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},ve={init:function(){this.WHERE_OPTIONS_1=[[ot.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[ot.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[ot.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[ot.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(ot.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT1").type==ot.INPUT_VALUE;t.setAttribute("at1",e);var n=this.getInput("AT2").type==ot.INPUT_VALUE;return t.setAttribute("at2",n),t},domToMutation:function(t){var e="true"==t.getAttribute("at1"),n="true"==t.getAttribute("at2");this.updateAt_(1,e),this.updateAt_(2,n)},updateAt_:function(t,e){this.removeInput("AT"+t),this.removeInput("ORDINAL"+t,!0),e?(this.appendValueInput("AT"+t).setCheck(Number),ot.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+t).appendField(ot.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+t);var n=new ot.FieldDropdown(this["WHERE_OPTIONS_"+t],(function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=e){var s=this.sourceBlock_;return s.updateAt_(t,i),s.setFieldValue(n,"WHERE"+t),null}}));this.getInput("AT"+t).appendField(n,"WHERE"+t),1==t&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},we={init:function(){this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(ot.Msg.LISTS_GET_INDEX_GET+" "+ot.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(ot.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(ot.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(ot.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Fe={init:function(){var t=[[ot.Msg.MIXLY_EQUALS,"==="],[ot.Msg.MIXLY_STARTSWITH,"startswith"],[ot.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(ge),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new ot.FieldDropdown(t),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},Pe={init:function(){this.setColour(ge),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(ot.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_COMPARETO_HELP)}},ke={init:function(){var t=[[ot.Msg.TEXT_UPPER,"upper"],[ot.Msg.TEXT_TITLE,"title"],[ot.Msg.TEXT_CAPITALIZE,"capitalize"],[ot.Msg.TEXT_SWAPCASE,"swapcase"],[ot.Msg.TEXT_LOWER,"lower"]];this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new ot.FieldDropdown(t),"CAPITAL").setCheck(String),this.setOutput(!0,String);var e=this;this.setTooltip((function(){var t=e.getFieldValue("CAPITAL");return{upper:ot.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:ot.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:ot.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:ot.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:ot.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[t]}))}},Ve={init:function(){var t=[[ot.Msg.TEXT_LJUST,"ljust"],[ot.Msg.TEXT_CENTER,"center"],[ot.Msg.TEXT_RJUST,"rjust"]];this.setColour(ge),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(ot.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(ot.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},Ye={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(ot.Msg.MIXLY_MID+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(ot.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},xe={init:function(){this.setColour(ge),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Ue={init:function(){this.setColour(ge),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(ot.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(ot.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Be={init:function(){this.setColour(ge),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(ot.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(ot.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},Xe={init:function(){var t=[[ot.Msg.TEXT_TRIM_BOTH,"strip"],[ot.Msg.TEXT_TRIM_LEFT,"lstrip"],[ot.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(ge),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ot.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"TOWHAT"),this.appendDummyInput("").appendField(ot.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("TOWHAT");return{strip:ot.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:ot.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:ot.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[t]}))}},Ge={init:function(){this.setColour(ge),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new ot.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new ot.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},xn={init:function(){this.setColour(Vn),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Un={init:function(){this.setColour(Vn),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Bn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_KEYS),this.setTooltip(ot.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Xn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(ot.Msg.DICTS_GET_TOOLTIP)}},Gn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(ot.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},Hn={init:function(){this.setColour(Vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(ot.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Wn={init:function(){this.setColour(Vn),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(ot.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_DELETE_TOOLTIP)}},Kn={init:function(){this.setColour(Vn),this.appendValueInput("DICT2").setCheck("Dict").appendField(ot.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(ot.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MID),this.setTooltip(ot.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_CLEAR),this.setTooltip(ot.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_ITEMS),this.setTooltip(ot.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},$n={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_VALUES),this.setTooltip(ot.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},zn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_LENGTH),this.setTooltip(ot.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Qn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.DICT_DELDICT),this.setTooltip(ot.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jn={init:function(){this.MODE=[[ot.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[ot.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(ot.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(ot.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e="";switch(t.getFieldValue("WHERE")){case"INSERT":e=ot.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":e=ot.Msg.DICTS_DELETE_TOOLTIP}return e}))},mutationToDom:function(){var t=document.createElement("mutation"),e=this.getInput("AT2").type==ot.INPUT_VALUE;return t.setAttribute("at2",e),t},domToMutation:function(t){var e="true"==t.getAttribute("at2");this.updateAt_(e)},updateAt_:function(t){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),t?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var e=new ot.FieldDropdown(this.MODE,(function(e){var n="INSERT"==e;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(e,"WHERE"),null}}));this.getInput("AT2").appendField(e,"WHERE")}},Zn={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setTooltip(ot.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},ti={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_SETDEFAULT_TOOLTIP)}},ei={init:function(){this.setColour(Vn),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new ot.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("dicts_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:0==e?'"key"':'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},ni={init:function(){this.setColour(Vn),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},ii={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TO_JSON),this.setTooltip(ot.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},si={init:function(){this.setColour(Vn),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(ot.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},oi={init:function(){this.setColour(Vn),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},ri=210,ai={init:function(){var t=ot.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{EQ:ot.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:ot.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:ot.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:ot.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:ot.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:ot.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[t]})),this.prevBlocks_=[null,null]}},li={init:function(){var t=ot.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],e=ot.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"OP1"),this.appendValueInput("C").appendField(new ot.FieldDropdown(e),"OP2"),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},ui={init:function(){var t=[[ot.Msg.LOGIC_OPERATION_AND,"AND"],[ot.Msg.LOGIC_OPERATION_OR,"OR"],[ot.Msg.LOGIC_OPERATION_NOR,"NOR"],[ot.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new ot.FieldDropdown(t),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("OP");return{AND:ot.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:ot.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:ot.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:ot.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[t]}))}},pi={init:function(){this.setColour(ri),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(ot.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(ot.Msg.LOGIC_NEGATE_TOOLTIP)}},_i={init:function(){var t=[[ot.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[ot.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(ri),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new ot.FieldDropdown(t),"BOOL"),this.setTooltip(ot.Msg.LOGIC_BOOLEAN_TOOLTIP)}},di={init:function(){this.setColour(ri),this.setOutput(!0),this.appendDummyInput().appendField(ot.Msg.LOGIC_NULL),this.setTooltip(ot.Msg.LOGIC_NULL_TOOLTIP)}},hi={init:function(){this.setColour(ri),this.appendValueInput("A"),this.appendValueInput("B").appendField(ot.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(ot.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},ci={init:function(){var t=[[ot.Msg.TEXT_APPEND_TO,"in"],[ot.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(ri),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new ot.FieldDropdown(t),"BOOL"),this.appendDummyInput("").appendField(ot.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ot.Msg.IN)}},Ti={init:function(){var t=[[ot.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[ot.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(ri),this.appendValueInput("A"),this.appendValueInput("B").appendField(new ot.FieldDropdown(t),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},Ii={init:function(){this.setColour(ri),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},mi={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(ot.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Ei={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s}))},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},fi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG,r=ot.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s+r}))}},gi={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.MIXPY_TEXT_ENCODE).appendField(new ot.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_USE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,o=ot.Msg.MIXLY_BELONG,r=ot.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[e]+o+i+s+r}))}},Oi={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+ot.Msg.MIXLY_MICROBIT_TYPE_STRING+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},Mi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},Ri={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[e]+"x"+i}))}},Ai={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ot.Msg.MICROBIT_PYTHON_TYPE)}},Si={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.HTML_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},Ci={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},Li={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},yi={init:function(){this.setColour(0),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const Di={init:function(){this.setColour(0),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},Ni={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},bi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},vi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE"),n=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,s=ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[e]+s+"x"+i}))}},wi={init:function(){this.setColour(0),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},Fi={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ot.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+ot.Msg.MIXLY_ESP32_SET+{mkdir:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Pi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(ot.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},ki={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Vi={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.HTML_FILE,"isfile"],[ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let t=this;this.setTooltip((function(){var e=t.getFieldValue("MODE");return ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:ot.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[e]}))}},Yi={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SETUP+ot.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(ot.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},xi={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(ot.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Ui={};Ui.NAME_TYPE=ot.PROCEDURE_CATEGORY_NAME,Ui.allProcedures=function(t){for(var e=t.getAllBlocks(!1),n=[],i=[],s=0;s"),this.appendValueInput("style").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ps={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ks={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_FORM_CONTENT).appendField(new ot.FieldDropdown([[ot.Msg.HTML_TEXT,"text"],[ot.Msg.HTML_EMAIL,"email"],[ot.Msg.HTML_NUMBER,"number"],[ot.Msg.HTML_PASSWORD,"password"],[ot.Msg.HTML_CHECKBOX,"checkbox"],[ot.Msg.HTML_RADIOBUTTON,"radiobutton"],[ot.Msg.HTML_BUTTON,"button"],[ot.Msg.HTML_COLOUR,"colour"],[ot.Msg.HTML_DATE,"date"],[ot.Msg.HTML_LOCALTIME,"local time"],[ot.Msg.HTML_FILE,"file"],[ot.Msg.HTML_HIDDEN,"hidden"],[ot.Msg.HTML_IMAGE,"image"],[ot.Msg.HTML_MONTH,"month"],[ot.Msg.HTML_RANGE,"range"],[ot.Msg.HTML_RESET,"reset"],[ot.Msg.HTML_SEARCH,"search"],[ot.Msg.HTML_SUBMIT,"submit"],[ot.Msg.HTML_TELEPHONENUMBER,"telephone number"],[ot.Msg.HTML_TIME,"time"],[ot.Msg.HTML_URL,"url"],[ot.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(ot.Msg.HTML_NAME).appendField(new ot.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(ot.Msg.HTML_VALUE).appendField(new ot.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vs={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(new ot.FieldTextInput("property"),"KEY").appendField(":").appendField(new ot.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ys={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(new ot.FieldTextInput("property"),"KEY").appendField(":").appendField(new ot.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xs={init:function(){this.setColour(Ds),this.appendDummyInput().appendField(ot.Msg.HTML_TEXT).appendField(new ot.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Us=160,Bs={init:function(){this.setColour(Us),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new ot.FieldTable(""),"TEXT")}},Xs={init:function(){this.setColour(Us),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new ot.FieldMultilineInput(""),"TEXT")}},Gs={init:function(){this.setColour(Us),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new ot.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Hs={init:function(){this.setColour(Us),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ws={init:function(){this.setColour(Us),this.appendDummyInput().appendTitle("Comment:").appendTitle(new ot.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ks={init:function(){this.setColour(Us),this.appendValueInput("VALUE").appendField(ot.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},js={init:function(){this.setColour(Us),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(ot.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=ot.Block.obtain(t,"text_print_multiple_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;i= stop:"," yield start"," start -= abs(step)"])};if(t=function(t,e,n){return"("+t+" <= "+e+") and "+l()+"("+t+", "+e+", "+n+") or "+u()+"("+t+", "+e+", "+n+")"},ot.isNumber(i)&&ot.isNumber(s)&&ot.isNumber(o))i=parseFloat(i),s=parseFloat(s),o=Math.abs(parseFloat(o)),0==i%1&&0==s%1&&0==o%1?(i<=s?(s++,t=0==i&&1==o?s:i+", "+s,1!=o&&(t+=", "+o)):t=i+", "+--s+", -"+o,t="range("+t+")"):(t=i",GTE:">="};const Va=function(t,e){var n=this.getFieldValue("OP"),i="&&"==n?e.ORDER_LOGICAL_AND:e.ORDER_LOGICAL_OR,s=e.valueToCode(this,"A",i)||"False",o=e.valueToCode(this,"B",i)||"False";if("AND"==n)var r=s+" and "+o;else if("OR"==n)r=s+" or "+o;else if("NOR"==n)r="not("+s+"^"+o+")";else r=s+"^"+o;return[r,i]},Ya=function(t,e){var n=e.ORDER_UNARY_PREFIX;return["not "+(e.valueToCode(this,"BOOL",n)||"False"),n]},xa=function(t,e){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",e.ORDER_ATOMIC]},Ua=function(t,e){return["None",e.ORDER_ATOMIC]},Ba=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"False";return["("+(e.valueToCode(this,"B",e.ORDER_ATOMIC)||"False")+" if "+n+" else "+(e.valueToCode(this,"C",e.ORDER_ATOMIC)||"False")+")",e.ORDER_ATOMIC]},Xa=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Ga=function(t,e){var n=e.valueToCode(this,"A",e.ORDER_ATOMIC)||"''",i=e.valueToCode(this,"B",e.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,e.ORDER_ATOMIC]},Ha=function(t,e){return["bool("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||"0")+")",e.ORDER_ATOMIC]},Wa=function(t,e){return e.definitions_.import_os="import os","os.startfile("+e.valueToCode(this,"fn",e.ORDER_ATOMIC)+")\n"},Ka=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+" = open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},ja=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",e.ORDER_ATOMIC]},qa=function(t,e){return["open("+e.valueToCode(this,"FILENAME",e.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',e.ORDER_ATOMIC]},$a=function(t,e){var n=e.valueToCode(this,"data",e.ORDER_ATOMIC);return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".write("+n+")\n"},za=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"()",e.ORDER_ATOMIC]},Qa=function(t,e){var n=this.getFieldValue("MODE");return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+"."+n+"("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Ja=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".readline("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},Za=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".writable()",e.ORDER_ATOMIC]},tl=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".name()",e.ORDER_ATOMIC]},el=function(t,e){return e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".close()\n"},nl=function(t,e){e.definitions_.import_os="import os";return["os.listdir()",e.ORDER_ATOMIC]},il=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},sl=function(t,e){return e.definitions_.import_os="import os",["os.path.getsize("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},ol=function(t,e){return[e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".tell()",e.ORDER_ATOMIC]},rl=function(t,e){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+".seek("+e.valueToCode(this,"SIZE",e.ORDER_ATOMIC)+","+i+")\n"},al=function(t,e){return e.definitions_.import_os="import os","os.chdir("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+")\n"},ll=function(t,e){e.definitions_.import_os="import os";return["os.getcwd()",e.ORDER_ATOMIC]},ul=function(t,e){return e.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+e.valueToCode(this,"PATH",e.ORDER_ATOMIC)+")\n"},pl=function(t,e){return e.definitions_.import_os="import os","os.rename("+e.valueToCode(this,"FILE",e.ORDER_ATOMIC)+","+e.valueToCode(this,"NEWFILE",e.ORDER_ATOMIC)+")\n"},_l=function(t,e){e.definitions_.import_os="import os";var n=e.valueToCode(this,"FILE",e.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",e.ORDER_ATOMIC]},dl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = sdcard.SDCard("+e.valueToCode(this,"SPISUB",e.ORDER_ATOMIC)+","+e.valueToCode(this,"PINSUB",e.ORDER_ATOMIC)+")\n"},hl=function(t,e){return e.definitions_.import_os="import os",e.definitions_.import_sdcard="import sdcard","os.mount("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"DIR",e.ORDER_ATOMIC)+")\n"},cl=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("NAME"),ot.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&e.statementToCode(this,"STACK"))??" pass\n";e.INFINITE_LOOP_TRAP&&(i=e.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var s=e.valueToCode(this,"RETURN",e.ORDER_NONE)||"";s&&(s=" return "+s+"\n");for(var o=[],r=0;r\n\n\n\t\n"+e.statementToCode(this,"HEAD")+"\n\n"+e.statementToCode(this,"BODY")+"\n\n'''",e.ORDER_ATOMIC]},ql=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"\n"+n+"\n"},$l=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var s="<"+i+'>\n\t\n'+n+"\n";else s="<"+i+">\n"+n+"\n";return s},zl=function(t,e){var n=e.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"\n"},Ql=function(t,e){var n=e.statementToCode(this,"DO"),i=e.valueToCode(this,"style"),s=this.getFieldValue("LEVEL");return"<"+s+" "+i+" >\n"+n+"\n"},Jl=function(t,e){return['style="'+e.statementToCode(this,"STYLE")+'"',e.ORDER_ATOMIC]},Zl=function(t,e){return'"},tu=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},eu=function(){return this.getFieldValue("TEXT")+"\n"},nu=function(t){return t.getFieldValue("TEXT")+"\n"},iu=function(t,e){return[t.getFieldValue("TEXT"),e.ORDER_ATOMIC]},su=function(t,e){return(e.valueToCode(t,"VALUE",e.ORDER_ATOMIC)||"")+"\n"},ou=function(){return""},ru=function(t,e){return["type("+(e.valueToCode(t,"VALUE",e.ORDER_MEMBER)||"___")+")",e.ORDER_ATOMIC]},au=function(t,e){for(var n=t.getFieldValue("NAME"),i=t.hasReturn_,s=new Array(t.itemCount_),o=0;o0?e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+"while True:\n"+o.join("")+r.join("\n"):e.join("\n")+"\n"+i.join("\n")+"\n"+s.join("")+"\n"+t+r.join("\n")},uu.scrubNakedValue=function(t){return t+"\n"},uu.quote_=function(t){var e="'";return-1!==(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n")).indexOf("'")&&(-1===t.indexOf('"')?e='"':t=t.replace(/'/g,"\\'")),e+t+e},uu.multiline_quote_=function(t){return"'''"+(t=t.replace(/'''/g,"\\'\\'\\'"))+"'''"},uu.scrub_=function(t,e,n){var i="";if(!t.outputConnection||!t.outputConnection.targetConnection){(o=t.getCommentText())&&(o=ot.utils.string.wrap(o,uu.COMMENT_WRAP-3),i+=uu.prefixLines(o+"\n","# "));for(var s=0;s0?"int("+a+" + "+s+")":s<0?"int("+a+" - "+-s+")":"int("+a+")",i&&(a="-"+a)),a};const pu=205,_u={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(ot.Msg.MIXLY_CHOOSE_AND_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[ot.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[ot.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},du={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SETUP).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[ot.Msg.MIXLY_AipSpeech,"AipSpeech"],[ot.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[ot.Msg.MIXLY_AipFace,"AipFace"],[ot.Msg.MIXLY_AipOcr,"AipOcr"],[ot.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipSpeech_synthesis).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.OLED_STRING).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},cu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipSpeech_asr).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_AipSpeech_File).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Tu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipImageClassify).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(ot.Msg.MIXLY_AipImageClassify_Image).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Iu={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[ot.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[ot.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[ot.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[ot.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[ot.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},mu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipFace_match).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AipImageClassify_Image+"1"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(ot.Msg.MIXLY_AipImageClassify_Image+"2"+ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Eu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipOcr).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(ot.Msg.MIXLY_AipImageClassify_Image).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},fu={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[ot.Msg.MIXLY_AipOcr_webImage,"webImage"],[ot.Msg.MIXLY_AipOcr_idcard,"idcard"],[ot.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[ot.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[ot.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[ot.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[ot.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[ot.Msg.MIXLY_AipOcr_receipt,"receipt"],[ot.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[ot.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[ot.Msg.MIXLY_AipOcr_form,"tableRecognition"],[ot.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[ot.Msg.MIXLY_AipOcr_passport,"passport"],[ot.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},gu={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.OLED_STRING).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Ou={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_Sim).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(ot.Msg.MIXLY_AIP_FUNC).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(ot.Msg.OLED_STRING+"1").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(ot.Msg.OLED_STRING+"2").setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Mu={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipNlp_lexer,"lexer"],[ot.Msg.MIXLY_AipNlp_depParser,"depParser"],[ot.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[ot.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[ot.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[ot.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[ot.Msg.MIXLY_AipNlp_keyword,"keyword"],[ot.Msg.MIXLY_AipNlp_topic,"topic"],[ot.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[ot.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},Ru={init:function(){this.setColour(pu),this.appendDummyInput("").appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[ot.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},Au={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_topic).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(ot.Msg.MIXLY_AipNlp_Topic_Title).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(ot.Msg.MIXLY_AipNlp_Topic_Content).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Su={init:function(){this.setColour(pu),this.appendValueInput("SUB").appendField(ot.Msg.MIXLY_AipNlp_summary).appendField(ot.Msg.MIXLY_Client).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(ot.Msg.MIXLY_AipNlp_Topic_Content).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(ot.Msg.MIXLY_LIST_LEN).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(ot.Msg.MIXLY_AIP_ATTR).setAlign(ot.inputs.Align.RIGHT),this.setTooltip(ot.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Cu={init:function(){this.setColour(pu),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(ot.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},Lu={init:function(){this.setColour(pu),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(ot.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},yu={init:function(){this.setColour(pu),this.appendValueInput("AI").appendField(ot.Msg.MIXPY_AI_RESULT).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_AipImageClassify,"Image"],[ot.Msg.MIXLY_AipSpeech_asr,"Speech"],[ot.Msg.MIXLY_AipFace_match,"Face"],[ot.Msg.MIXLY_AipOcr,"Ocr"],[ot.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[ot.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(ot.Msg.LOGIC_NEGATE_TOOLTIP)}},Du="#526FC3",Nu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},bu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},vu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},wu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},Fu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Pu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ku={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Vu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Yu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},xu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Uu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Bu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},Xu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Gu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Hu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ku={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},ju={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},qu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$u={init:function(){this.appendDummyInput().appendField("准备").appendField(new ot.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},zu={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Qu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ju={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Zu={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},tp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},ep={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},np={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ip={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},sp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},op={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},rp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ap={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},lp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},up={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},pp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new ot.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},_p={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},cp={init:function(){this.setColour(Du),this.appendDummyInput().appendField("n"+ot.Msg.MIXLY_VALUE2).appendField(new ot.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Tp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ip={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},mp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头,"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Ep={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},fp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},gp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Op={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Mp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Rp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Ap={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Sp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("计算").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Cp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Lp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},yp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("设置").appendField(new ot.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Dp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Np={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若3人一排列队,多1人;"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若5人一排列队,多2人;"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("若7人一排列队,多2人;"),this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},bp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new ot.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},vp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("使士兵").appendField(new ot.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},wp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("剩余").appendField(new ot.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Fp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},Pp={init:function(){this.appendDummyInput().setAlign(ot.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setTooltip(""),this.setHelpUrl("")}},kp={init:function(){this.appendDummyInput().appendField("准备").appendField(new ot.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Du),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},Vp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Yp={init:function(){this.setColour(Du),this.appendDummyInput().appendField(ot.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},xp={init:function(){this.setColour(Du),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Up="#3288dd",Bp={init:function(){this.setColour(Up),this.appendValueInput("DOMAIN").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_REQUESTS_GET).appendField(new ot.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Xp={init:function(){this.setColour(Up),this.appendValueInput("URL").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(ot.Msg.blockpy_REQUESTS).appendField(ot.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Gp={init:function(){this.setColour(Up),this.appendValueInput("URL").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(ot.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(ot.Msg.blockpy_REQUESTS+ot.Msg.OLED_STRING),this.appendDummyInput("").appendField(ot.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Hp={init:function(){this.appendValueInput("VAL");var t=[[ot.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[ot.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[ot.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(Up),this.appendDummyInput("").appendField(ot.Msg.MIXLY_MICROBIT_JS_GET).appendField(new ot.FieldDropdown(t),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Wp={init:function(){this.appendValueInput("VAR").appendField(ot.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Up),this.appendDummyInput("").appendField(ot.Msg.blockpy_CONDUCT).appendField(new ot.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(ot.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip((function(){var e=t.getFieldValue("DIR");return{forward:ot.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ot.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]}))}},Kp="f0a559",jp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},qp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},$p={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(ot.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},zp={init:function(){this.setColour(Kp),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(ot.Msg.MIXLY_MILLIS+ot.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},Qp={init:function(){this.setColour(Kp),this.appendDummyInput().appendField(ot.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Jp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE);var t=[[ot.Msg.MIXLY_CV_RECT,"rectangle"],[ot.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},Zp={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(ot.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new ot.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+ot.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(ot.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},t_={init:function(){this.setColour(Kp),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},e_={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(ot.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},n_={init:function(){this.setColour(Kp),this.appendValueInput("FILE").appendField(ot.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(ot.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(ot.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(ot.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(ot.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},i_=170,s_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_series_create).appendField(new ot.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},o_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_series_create).appendField(new ot.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(ot.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},r_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},a_={init:function(){this.setColour(i_);var t=[[ot.Msg.DATAFRAME_RAW,"index"],[ot.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(ot.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},l_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.blockpy_dataframe_create).appendField(new ot.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(ot.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(ot.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(ot.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},u_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(new ot.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new ot.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},p_={init:function(){this.setColour(i_);var t=[[ot.Msg.SERIES_INDEX,"index"],[ot.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(ot.Msg.SERIES_INDEX_VALUE).appendField(new ot.FieldDropdown(t),"INDEX_VALUE"),this.setOutput(!0,"List");var e=this;this.setTooltip((function(){var t=e.getFieldValue("INDEX_VALUE");return{index:ot.Msg.SERIES_INDEX_TOOLTIP,value:ot.Msg.HTML_VALUE_TOOLTIP}[t]}))}},__={init:function(){this.setColour(i_),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(ot.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(ot.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(ot.Msg.TUPLE_GET_INDEX_TOOLTIP)}},d_={init:function(){this.setColour(i_),this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},h_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},c_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},T_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},I_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},m_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},E_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SET_LABEL).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(ot.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},f_={init:function(){this.setColour(i_),this.appendValueInput("FROM").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_SPLITBYDOU).appendField(ot.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},g_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[ot.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:ot.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},O_={init:function(){this.setColour(i_);var t=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],e=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_SCATTER).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(ot.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},M_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_XY).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},R_={init:function(){this.setColour(i_);var t=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_BAR).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(ot.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new ot.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},A_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[ot.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PIE).appendField(ot.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(ot.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new ot.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new ot.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},S_={init:function(){this.setColour(i_),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_HIST).appendField(ot.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(ot.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},C_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_SETTING).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_TICKS).appendField(ot.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},L_={init:function(){var t=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[ot.Msg.LANG_MATH_TO_ROUND,"round"],[ot.Msg.LANG_MATH_TO_CEIL,"ceil"],[ot.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(i_),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(ot.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new ot.FieldDropdown(t),"OP"),this.setTooltip(ot.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},y_={init:function(){this.setColour(i_),this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT).appendField(ot.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},D_={init:function(){this.setColour(i_),this.appendValueInput("FILENAME").appendField(ot.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[ot.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(ot.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},N_={init:function(){this.setColour(i_),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(ot.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(ot.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new ot.FieldDropdown([[ot.Msg.DATAFRAME_COLUMN,"column"],[ot.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(ot.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},b_={init:function(){this.setColour(i_),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},v_={init:function(){this.setColour(i_);var t=[[ot.Msg.TEXT_TRIM_LEFT,"right"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[ot.Msg.mixpy_PL_TEXT_TOP,"bottom"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.MIXLY_SETTING).appendField(ot.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_HOR).appendField(new ot.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_VER).appendField(new ot.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PL_TEXT_TOOLTIP)}},w_={init:function(){this.setColour(i_),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(ot.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},F_={init:function(){this.setColour(i_),this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},P_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(ot.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},k_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},V_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Y_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},x_={init:function(){this.setColour(i_),this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},U_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.blockpy_PYLAB_SET_LABEL).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("LABEL").appendField(ot.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},B_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[ot.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_DISPLAY_DRAW).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{plot:ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:ot.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[t]}))}},X_={init:function(){this.setColour(i_);var t=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],e=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_SCATTER).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(ot.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(e),"DOT"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},G_={init:function(){this.setColour(i_);var t=[[ot.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[ot.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[ot.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[ot.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],e=[[ot.Msg.COLOUR_RGB_BLUE,"b"],[ot.Msg.COLOUR_RGB_GREEN,"g"],[ot.Msg.COLOUR_RGB_RED,"r"],[ot.Msg.COLOUR_CYAN,"c"],[ot.Msg.COLOUR_MAGENTA,"m"],[ot.Msg.COLOUR_YELLOW,"y"],[ot.Msg.COLOUR_BLACK,"k"],[ot.Msg.COLOUR_WHITE,"w"]],n=[[ot.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[ot.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[ot.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PLOT_XY).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new ot.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(ot.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new ot.FieldDropdown(t),"LINE"),this.appendDummyInput("").appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},H_={init:function(){this.setColour(i_);var t=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_BAR).appendField(ot.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(ot.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new ot.FieldDropdown(t),"ALIGN"),this.appendDummyInput().appendField(ot.Msg.HTML_COLOUR).appendField(new ot.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},W_={init:function(){this.setColour(i_);var t=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[ot.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],e=[[ot.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[ot.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_PIE).appendField(ot.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(ot.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new ot.FieldDropdown(e),"autopct"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new ot.FieldDropdown(t),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},K_={init:function(){this.setColour(i_),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_HIST).appendField(ot.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(ot.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},j_={init:function(){this.setColour(i_);var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(ot.Msg.MIXLY_SETTING).appendField(new ot.FieldDropdown(t),"DIR"),this.appendValueInput("A").appendField(ot.Msg.mixpy_PYLAB_TICKS).appendField(ot.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(ot.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},q_={init:function(){this.setColour(i_),this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT).appendField(ot.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},$_={init:function(){this.setColour(i_),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},z_={init:function(){this.setColour(i_);var t=[[ot.Msg.TEXT_TRIM_LEFT,"right"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.TEXT_TRIM_RIGHT,"left"]],e=[[ot.Msg.mixpy_PL_TEXT_TOP,"bottom"],[ot.Msg.mixpy_PL_TEXT_CENTER,"center"],[ot.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(ot.Msg.MIXLY_SETTING).appendField(ot.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(ot.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_HOR).appendField(new ot.FieldDropdown(t),"HALIGN"),this.appendDummyInput("").appendField(ot.Msg.mixpy_PL_TEXT_VER).appendField(new ot.FieldDropdown(e),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.mixpy_PL_TEXT_TOOLTIP)}},Q_={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},J_={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},Z_={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new ot.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},td={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("创建二维图"),this.appendDummyInput().appendField("颜色").appendField(new ot.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},ed={init:function(){this.setColour(i_),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},nd={init:function(){this.setColour(i_),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},id={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},sd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},od={init:function(){this.setColour(i_),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},rd={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列").setCheck(String),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("从数据框中删除指定的列。用逗号分隔多个列名。")}},ad={init:function(){this.setColour(i_),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},ld={init:function(){this.setColour(i_),this.appendValueInput("ARRAY1").appendField("列拼接:数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},ud={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},pd={init:function(){this.setColour(i_),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},_d={init:function(){this.setColour(i_),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},dd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},hd={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},cd={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new ot.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},Td={init:function(){this.setColour(i_),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},Id={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},md={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new ot.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},Ed={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},fd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},gd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},Od={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},Md={init:function(){this.setColour(i_),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},Rd={init:function(){this.setColour(i_),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},Ad={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("排序方式").appendField(new ot.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Sd={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("获取").appendField(new ot.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(ot.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Cd={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ld={init:function(){this.setColour(i_),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(ot.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},yd={init:function(){this.setColour(i_),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(ot.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Dd={init:function(){this.setColour(i_),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nd=80,bd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new ot.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new ot.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var t=document.createElement("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("ds_create_linkedlist_container");e.initSvg();for(var n=e.getInput("STACK").connection,i=0;ie?t[e]:"name"),"KEY"+e).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},vd={init:function(){this.setColour(Nd),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},wd={init:function(){this.setColour(Nd),this.appendDummyInput().appendField(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},Fd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_NODE_USE).appendField(new ot.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_CREATE_NODE_TOOLTIP)}},Pd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(ot.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_AIP_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(ot.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},kd={init:function(){this.setColour(Nd),this.appendDummyInput("").appendField(ot.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_AIP_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},Vd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[ot.Msg.DS_ADD_NODE_BEFORE,"before"],[ot.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_ADD_NODE_TOOLTIP)}},Yd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE);var t=[[ot.Msg.DS_ADD_NODE_BEFORE,"before"],[ot.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(ot.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AS),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_ADD_NODE_TOOLTIP)}},xd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Ud={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(ot.Msg.DS_DEL_NODE_ATTR).appendField(new ot.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_AS),this.appendDummyInput("").appendField(ot.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Bd={init:function(){this.setColour(Nd),this.appendValueInput("NODE").appendField(ot.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(ot.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(ot.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.DS_DEL_NODE_TOOLTIP)}},Xd="#777777",Gd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField("from ").appendField(new ot.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new ot.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField("import ").appendField(new ot.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wd={init:function(){this.setColour(Xd),this.appendDummyInput("").appendField(new ot.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new ot.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var t=document.createElement("mutation");t.setAttribute("items",this.itemCount_);for(var e=0;ee?t[e]:'"key'+(e+1)+'"'),"KEY"+e).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Ah={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Sh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ch={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Lh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(ot.Msg.MIXLY_WIFI_USERNAME).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(ot.Msg.MIXLY_IOT_PASSWORD).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(ot.Msg.MIXLY_EMQX_PROJECT).setAlign(ot.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},yh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(ot.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Dh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MIXLY_EMQX_SUBSCRIBE+ot.Msg.MIXLY_MICROBIT_MSG).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(ot.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Nh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(ot.Msg.MSG.stop+ot.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},bh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ot.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Ph={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(ot.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},kh={init:function(){this.setColour(Eh),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},Vh={init:function(){this.setColour(Eh),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Yh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(ot.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(ot.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},xh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO").appendField(ot.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(ot.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Uh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+ot.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField(ot.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(ot.Msg.MIXLY_EMQX_SERVER).setAlign(ot.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(ot.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(ot.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xh={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Eh),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new ot.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(t){if(t==this.RTL)var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new ot.FieldImage(e,12,12,'"')}},Gh={init:function(){this.VISITOR_ID=rt.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(Eh),this.appendDummyInput("").appendField(new ot.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const t=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==t&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},Hh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MixIO").appendField(ot.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Wh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("HTTP"+ot.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ot.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(ot.Msg.MIXLY_REQUESTS_GET).appendField(ot.Msg.MIXLY_GET_CURRENT_TIME).appendField(ot.Msg.MIXLY_OPEN_DEBUG).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Kh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("HTTP"+ot.Msg.MIXLY_Client).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ot.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ot.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},jh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MQTT"+ot.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(ot.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(ot.Msg.MIXLY_INIT_SUBSCRIBE).appendField(ot.MQTT_Topic).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(ot.Msg.MIXLY_OPEN_DEBUG).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qh={init:function(){this.setColour(Eh),this.appendDummyInput().appendField("MQTT"+ot.Msg.MIXLY_Client).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_REQUESTS_LEN,"client_len"],[ot.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[ot.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},$h=fh,zh=gh,Qh=Oh,Jh=Rh,Zh=230,tc={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},ec={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},nc={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},ic={init:function(){this.setColour(Zh),this.appendDummyInput("").appendField(new ot.FieldDropdown(rt.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},sc={init:function(){this.setColour(40),this.appendDummyInput("").appendField(new ot.FieldLabel(ot.Msg.MIXPY_SERIAL_OPEN)).appendField(new ot.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(ot.Msg.MIXLY_SERIAL_BEGIN).appendField(new ot.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},oc={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(ot.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},rc={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(ot.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},ac={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendDummyInput().appendField(ot.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(ot.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},lc=80,uc={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},pc={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},_c={init:function(){this.appendDummyInput().appendField(ot.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},dc={init:function(){var t=[[ot.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[ot.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[ot.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[ot.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[ot.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[ot.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+ot.Msg.LOAD).appendField(new ot.FieldDropdown(t),"type").appendField(new ot.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("name"))&&this.setTitleValue(e,"name")}},hc={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+ot.Msg.DATA_SET),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.EIGENVALUES,"data"],[ot.Msg.LABEL_VALUE,"target"],[ot.Msg.FEATURE,"feature_names"],[ot.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},cc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Tc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Ic={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},mc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Ec={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},fc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},gc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_KNN_INIT).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[ot.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Oc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Mc={init:function(){this.appendDummyInput().appendField("sklearn 初始化 PCA 算法"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_components").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_PCA_N_COMPONENTS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Rc={init:function(){this.appendDummyInput().appendField("sklearn PCA 降维"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Ac={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Sc={init:function(){this.appendDummyInput().appendField("sklearn K-均值聚类"),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Cc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Lc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},yc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Dc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Nc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},bc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(ot.inputs.Align.RIGHT).setCheck(null).appendField(ot.Msg.MODEL_NAME),this.appendDummyInput().setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_COEF,"coef_"],[ot.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},vc={init:function(){this.appendDummyInput().appendField("sklearn "+ot.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MODEL_NAME),this.appendDummyInput().appendField(ot.Msg.MIXLY_GET).appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[ot.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[ot.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},wc={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField("sklearn").appendField(new ot.FieldDropdown([[ot.Msg.SKLEARN_SAVE_MODEL,"dump"],[ot.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+ot.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(ot.inputs.Align.RIGHT).appendField(ot.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lc),this.setTooltip(""),this.setHelpUrl("")}},Fc=120,Pc={init:function(){this.setColour(Fc),this.appendValueInput("DELAY_TIME",Number).appendField(ot.Msg.MIXLY_DELAY+"("+ot.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},kc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField(ot.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},Vc={init:function(){this.setColour(Fc),this.appendDummyInput("").appendField(ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new ot.FieldDropdown([[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[ot.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},Yc={init:function(){this.setColour(Fc),this.appendValueInput("STATUS_CODE",Number).appendField(ot.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},xc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField(ot.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},Uc={init:function(){this.setColour(Fc),this.appendValueInput("TIME").setCheck(Number).setAlign(ot.inputs.Align.RIGHT).appendField("MsTimer2").appendField(ot.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(ot.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField("MsTimer2").appendField(ot.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xc={init:function(){this.setColour(Fc),this.appendDummyInput().appendField("MsTimer2").appendField(ot.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gc={init:function(){this.setColour(Fc),this.appendValueInput("DELAY_TIME",Number).appendField(ot.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(ot.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Hc=180,Wc={init:function(){this.setColour(Hc),this.appendDummyInput("").appendField(ot.Msg.blockpy_turtle_create).appendField(new ot.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},Kc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jc={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},qc={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_forward,"forward"],[ot.Msg.blockpy_backward,"backward"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{forward:ot.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:ot.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]}))}},$c={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_left,"left"],[ot.Msg.blockpy_right,"right"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_rotate).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{left:ot.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:ot.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[t]}))}},zc={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_setheading),this.appendDummyInput().appendField(ot.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qc={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(ot.Msg.MIXLY_MILLIS),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jc={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(ot.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zc={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.PYLAB_LABEL_X,"x"],[ot.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},tT={init:function(){this.setColour(Hc);var t=[[ot.Msg.TURTLE_POS,"pos"],[ot.Msg.TURTLE_SHAPE,"shape"],[ot.Msg.TURTLE_HEADING,"heading"],[ot.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[ot.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[ot.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.TURTLE_POS_SHAPE).appendField(new ot.FieldDropdown(t),"DIR");var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{pos:ot.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:ot.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:ot.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:ot.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:ot.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:ot.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[t]})),this.setOutput(!0),this.setInputsInline(!0)}},eT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[ot.Msg.blockpy_turtle_reset,"reset"],[ot.Msg.blockpy_turtle_home,"home"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{clear:ot.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:ot.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:ot.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[t]}))}},nT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_penup,"penup"],[ot.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{penup:ot.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:ot.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[t]}))}},iT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_beginfill,"begin"],[ot.Msg.blockpy_turtle_endfill,"end"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{begin:ot.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:ot.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[t]}))}},sT={init:function(){this.appendDummyInput("").appendField(new ot.FieldTextInput("tina"),"TUR");var t=[[ot.Msg.blockpy_turtle_size,"pensize"],[ot.Msg.MIXLY_SPEED,"speed"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_set).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{pensize:ot.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:ot.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[t]}))}},oT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_set_size),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},rT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_set_speed),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},aT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_circle,"circle"],[ot.Msg.blockpy_turtle_dot,"dot"]];this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.blockpy_turtle_draw).appendField(new ot.FieldDropdown(t),"DIR").appendField(ot.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{circle:ot.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:ot.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[t]}))}},lT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(ot.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(ot.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},uT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_hide,"hideturtle"],[ot.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(Hc),this.appendDummyInput("").appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip((function(){var t=e.getFieldValue("DIR");return{hideturtle:ot.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:ot.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[t]}))}},pT={init:function(){this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_bgcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_T={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_pencolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_fillcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.TURTLE_CLONE),this.setTooltip(ot.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},cT={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},TT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},IT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_pencolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(ot.Msg.blockpy_turtle_fillcolor).appendField(new ot.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ET={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR1").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fT={init:function(){this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},OT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},MT={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var t=[[ot.Msg.blockpy_turtle_shape_arrow,"arrow"],[ot.Msg.blockpy_turtle_shape_turtle,"turtle"],[ot.Msg.blockpy_turtle_shape_circle,"circle"],[ot.Msg.blockpy_turtle_shape_square,"square"],[ot.Msg.blockpy_turtle_shape_triangle,"triangle"],[ot.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(Hc),this.appendDummyInput("").appendField(ot.Msg.blockpy_turtle_shape).appendField(new ot.FieldDropdown(t),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_SHAPE_TOOLTIP)}},RT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(ot.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},AT={init:function(){this.appendDummyInput("").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(Hc),this.appendValueInput("TITLE").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(ot.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(ot.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(ot.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(ot.Msg.TURTLE_NUMINPUT_TOOLTIP)}},ST={init:function(){this.appendDummyInput("").appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(Hc),this.appendValueInput("TITLE").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(ot.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(ot.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},CT={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},LT={init:function(){var t=[[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new ot.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new ot.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new ot.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},yT={init:function(){var t=[[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[ot.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],e=[[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[ot.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Hc),this.appendValueInput("VAR").setCheck(String).appendField(ot.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new ot.FieldDropdown(t),"MOVE"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new ot.FieldDropdown(e),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new ot.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.TURTLE_WRITE_TOOLTIP)}},DT={init:function(){this.setColour(Hc),this.appendDummyInput("").setAlign(ot.inputs.Align.RIGHT).appendField(new ot.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},NT={init:function(){this.setColour(Hc),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new ot.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(t,e){ot.Names.equals(t,this.getFieldValue("VAR"))&&this.setTitleValue(e,"VAR")}},bT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},vT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},wT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(ot.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(ot.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(ot.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(ot.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},FT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendDummyInput().appendField(ot.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},PT={init:function(){this.setColour(Hc),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(ot.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(ot.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},kT=function(t,e){var n=this.getFieldValue("TYPE");return e.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",e.ORDER_ATOMIC]},VT=function(t,e){var n=this.getFieldValue("CTYPE");return e.definitions_.import_aip="import aip",e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+" = aip."+n+"("+e.valueToCode(this,"API_KEY",e.ORDER_ATOMIC)+", "+e.valueToCode(this,"SECRET_KEY",e.ORDER_ATOMIC)+")\n"},YT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".synthesis("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},xT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".asr("+(e.valueToCode(this,"FILE",e.ORDER_ATOMIC)||'""')+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},UT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},BT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".match("+e.valueToCode(this,"VAR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"VAR2",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},XT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"ADDR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},GT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"STR",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},HT=function(t,e){e.definitions_.import_aip="import aip";var n=e.valueToCode(this,"SUB",e.ORDER_ATOMIC),i=e.valueToCode(this,"STR1",e.ORDER_ATOMIC),s=e.valueToCode(this,"STR2",e.ORDER_ATOMIC);return[n+"."+e.valueToCode(this,"FUNC",e.ORDER_ATOMIC)+"("+i+","+s+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},WT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".topic("+e.valueToCode(this,"STR1",e.ORDER_ATOMIC)+","+e.valueToCode(this,"STR2",e.ORDER_ATOMIC)+")",e.ORDER_ATOMIC]},KT=function(t,e){return e.definitions_.import_aip="import aip",[e.valueToCode(this,"SUB",e.ORDER_ATOMIC)+".newsSummary("+e.valueToCode(this,"STR",e.ORDER_ATOMIC)+","+e.valueToCode(this,"LEN",e.ORDER_ATOMIC)+", options="+(e.valueToCode(this,"ATTR",e.ORDER_ATOMIC)||"{}")+")",e.ORDER_ATOMIC]},jT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},qT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},$T=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},zT=function(t,e){return[this.getFieldValue("TYPE"),e.ORDER_ATOMIC]},QT=function(t,e){return e.definitions_.import_audio="import audio","audio.audio_record("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"TIME",e.ORDER_ATOMIC)||"0")+")\n"},JT=function(t,e){return e.definitions_.import_audio="import cam","cam.photo_capture("+(e.valueToCode(this,"VAR",e.ORDER_ATOMIC)||'""')+","+(e.valueToCode(this,"BUT",e.ORDER_ATOMIC)||'""')+")\n"},ZT=function(t,e){var n=e.valueToCode(this,"AI",e.ORDER_ASSIGNMENT)||"0",i=this.getFieldValue("CTYPE");if("Image"==i)var s=n+'["result"][0]["keyword"]';if("Speech"==i)s=n+'["result"][0]';if("Face"==i||"OcrSimilarity"==i)s=n+'["score"]';if("Ocr"==i)s=n+'["words_result"]';return[s,e.ORDER_ATOMIC]},tI=function(t,e){e.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[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], [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], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nfor i in house:\n i.hide()\n"},eI=function(){return"path = [1]\ncar = sprite.Sprite('car', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},nI=function(t,e){e.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},iI=function(t,e){return["flag == 1",e.ORDER_ATOMIC]},sI=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},oI=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},rI=function(t,e){e.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},aI=function(){var t="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return t="house[f].hide()\ndrive(path[len(path) - 1])\n"+t},lI=function(t,e){return["len(path) == 7",e.ORDER_ATOMIC]},uI=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},pI=function(t,e){e.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[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], [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], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('map_xuexiao')\n\nhouse = [ sprite.Sprite('mark', 150, 380),\n sprite.Sprite('School', 115, 195),\n sprite.Sprite('House25', 264, 67),\n sprite.Sprite('House36', 320, 200),\n sprite.Sprite('House47', 290, 371),\n sprite.Sprite('House25', 479, 233),\n sprite.Sprite('House36', 674, 96),\n sprite.Sprite('House47', 642, 318)\n]\nbarricade = sprite.Sprite('barricade', 570, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.hide()\n"},_I=function(t,e){return["f == 1",e.ORDER_ATOMIC]},dI=function(){return"print('没有符合条件的路线')\n"},hI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},cI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},TI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]6:\n print("路线错乱!程序有误!")\n exit()\n'},II=function(t,e){return["name[now] != '小科家'",e.ORDER_ATOMIC]},mI=function(t,e){return["name[now] != '学校'",e.ORDER_ATOMIC]},EI=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},fI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高!不得高于6层!')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数:0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},gI=function(t,e){var n=e.valueToCode(this,"FROM_NUM",e.ORDER_ATOMIC)||"0",i=e.valueToCode(this,"TO_NUM",e.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},OI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},MI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},RI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},AI=function(t,e){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",e.ORDER_ATOMIC]},SI=function(t,e){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",e.ORDER_ATOMIC]},CI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},LI=function(t,e){return["len(list)>=2",e.ORDER_ATOMIC]},yI=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},DI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},NI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},bI=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},vI=function(t,e){var n=this.getFieldValue("NUM");return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},wI=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器:0', 30, 200)\n"},FI=function(t,e){e.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},PI=function(t,e){e.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},kI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},VI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},YI=function(t,e){return["_rabbit < _head",e.ORDER_ATOMIC]},xI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},UI=function(t,e){return["_rabbit*4 + _chick*2 == _foot",e.ORDER_ATOMIC]},BI=function(t,e){e.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量:'+str(_rabbit)+'只。')\n"},XI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},GI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1:',0,0,'text')\n_text_2 = sprite.Text('S2:',0,30,'text2')\n_text_3 = sprite.Text('S3:',0,60,'text3')\n_text_4 = sprite.Text('S4:',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},HI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var s="";return s+=`_S${n}.show()\ntime.sleep(1)\n`,s+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}:'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4:'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},WI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,e.ORDER_ATOMIC]},KI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},jI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},qI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量:0',0,0,'num')\n_last = sprite.Text('剩余:0',500,0,'last')\n_line = 3\n"},$I=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},zI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},QI=function(t,e){return e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,e.ORDER_ATOMIC]},JI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},ZI=function(t,e){e.definitions_.import_time="import time",e.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},tm=function(t,e){e.definitions_.import_turtle="import turtle",e.definitions_.import_time="import time",e.definitions_.import_math="import math";var n=e.valueToCode(this,"VAR",e.ORDER_ATOMIC),i=this.getFieldValue("NUM");return e.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",e.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",e.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a 1"}]`,e.ORDER_ATOMIC]},wE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.groupby(by=${e.valueToCode(t,"KEY",e.ORDER_ATOMIC)||"'tag'"})`,e.ORDER_ATOMIC]},FE=function(t,e){return[`${e.valueToCode(t,"DICT",e.ORDER_ATOMIC)||"df"}.${t.getFieldValue("TYPE")}()`,e.ORDER_ATOMIC]},PE=function(t,e){e.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},kE=function(t,e){var n=e.variableDB_.getName(this.getFieldValue("VAR"),ot.Variables.NAME_TYPE),i=e.variableDB_.getName(this.getFieldValue("TYPE"),ot.Variables.NAME_TYPE),s="class "+i+":\n";s+=" def __init__(self):\n";for(var o=new Array(this.itemCount_),r=0;r{document.removeEventListener("DOMContentLoaded",t),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",t)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:e}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,211));this._kernel=new e(t);break;case"python3-old":case"python3.8":const{KernelPython3Old:i}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,5195));this._kernel=new i(t);break;case"js":case"javascript":const{KernelJavaScript:s}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new s(t);break;case"sql":const{KernelSQL:o}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,592));this._kernel=new o(t);break;case"ocaml":const{KernelOCaml:r}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,38));this._kernel=new r(t);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const t=await this.kernelAvailable();return await t.loaded(),t}get kernel(){return this._kernel}get kernelSafe(){var t;return(null===(t=this.kernel)||void 0===t?void 0:t.ready)?this.kernel:null}async showLoader(t,e=!1,n=!0){this.kernelAvailable().then((()=>{var t;return null===(t=this.kernel)||void 0===t?void 0:t.init()})),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const i="basthon-loader-"+(e?"full":"foot"),s=document.createElement("div");s.id=this._loaderId,s.classList.add("darklighted"),s.classList.add("basthon-loader-root"),s.classList.add(i);const o=document.createElement("div");o.classList.add("basthon-loader-container"),o.classList.add(i),s.appendChild(o);const r=document.createElement("div");r.classList.add("basthon-loader-spinner"),r.classList.add(i),r.innerHTML="",o.appendChild(r);const a=document.createElement("div");a.classList.add("basthon-loader-break"),a.classList.add(i),o.appendChild(a);const l=document.createElement("div");l.classList.add("basthon-loader-text"),l.classList.add(i),l.innerHTML=t,o.appendChild(l),this._loaderTextElem=l;const u=document.createElement("div");u.classList.add("basthon-loader-text"),u.classList.add(i),u.style.display="none",o.appendChild(u),this._loaderTextError=u,await this.pageLoad(),document.body.appendChild(s),this._rootLoader=s;try{await this.kernelLoaded()}catch(t){const e=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!
Vérifiez que votre navigateur est à jour.
Version détectée : ${e.name} ${e.version}.`);for(const t of document.body.querySelectorAll(".basthon-loader-foot"))t.classList.remove("basthon-loader-foot"),t.classList.add("basthon-loader-full");return r.classList.remove("basthon-loader-spinner"),r.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(t){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=t)}setErrorText(t){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=t)}hideLoader(){if(this._doNotHideLoader)return;const t=this._rootLoader;null!=t&&(t.classList.add("basthon-loader-hide"),window.setTimeout((()=>{this._rootLoader=void 0,t.remove()}),1100))}browser(){var t,e=navigator.userAgent,n=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(t=/\brv[ :]+(\d+)/g.exec(e)||[])[1]||""}:"Chrome"===n[1]&&null!=(t=e.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:t[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=e.match(/version\/(\d+)/i))&&n.splice(1,1,t[1]),{name:n[0],version:n[1]})}}class dO extends rt.PageBase{static{rt.HTMLTemplate.add("html/statusbar/statusbar-image.html",new rt.HTMLTemplate('\r\n
')),this.init=function(){rt.StatusBarsManager.typesRegistry.register(["images"],dO);const t=rt.Workspace.getMain().getStatusBarsManager();return t.add("images","images",ot.Msg.PYTHON_PYODIDE_IMAGE),t.changeTo("output"),t.get("images")}}constructor(){super();const t=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(t)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(t){const e=this.getContent(),n=function(t){t.style.width="auto",t.style.height="auto",t.style.maxWidth="100%",t.style.maxHeight="100%"};this.clean();let i=t.content,s=null,o=null;switch(t.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver((function(t){t.forEach((t=>t.addedNodes.forEach((t=>{const e=t;null!=e.tagName&&["canvas","video"].includes(e.tagName.toLowerCase())&&n(e)}))))})).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),e.append(i);break;case"matplotlib":s=i.querySelector("canvas"),s&&(i=s),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",e.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),e.append(i.outerHTML);break;case"sympy":e.append(t.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let t=document.createElement("script");t.type="text/javascript",t.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(t)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in t.content){let i=t.content[n];"image/png"===n&&(i=''),e.append(i);break}break;case"tutor":if(e.append(uO()(t.content.replace("overflow-y%3A%20hidden%3B",""))),o=this.getContent()[0].getElementsByTagName("iframe")[0],null==o)return;o.style.maxHeight=o.style.minHeight="100%",new IntersectionObserver(((t,e)=>{const n=t[0];n&&!n.isIntersecting||(o.contentWindow?.postMessage({type:"redraw"},"*"),e.disconnect())})).observe(o);break;default:console.error(`Not supported node type '${t.display_type}' in eval.display result processing.`)}}}const hO=layui;var cO;!function(t){t[t.EPERM=1]="EPERM",t[t.ENOENT=2]="ENOENT",t[t.EINTR=4]="EINTR",t[t.EIO=5]="EIO",t[t.ENXIO=6]="ENXIO",t[t.EBADF=9]="EBADF",t[t.EAGAIN=11]="EAGAIN",t[t.ENOMEM=12]="ENOMEM",t[t.EACCES=13]="EACCES",t[t.EFAULT=14]="EFAULT",t[t.ENOTBLK=15]="ENOTBLK",t[t.EBUSY=16]="EBUSY",t[t.EEXIST=17]="EEXIST",t[t.EXDEV=18]="EXDEV",t[t.ENODEV=19]="ENODEV",t[t.ENOTDIR=20]="ENOTDIR",t[t.EISDIR=21]="EISDIR",t[t.EINVAL=22]="EINVAL",t[t.ENFILE=23]="ENFILE",t[t.EMFILE=24]="EMFILE",t[t.ETXTBSY=26]="ETXTBSY",t[t.EFBIG=27]="EFBIG",t[t.ENOSPC=28]="ENOSPC",t[t.ESPIPE=29]="ESPIPE",t[t.EROFS=30]="EROFS",t[t.EMLINK=31]="EMLINK",t[t.EPIPE=32]="EPIPE",t[t.EDOM=33]="EDOM",t[t.ERANGE=34]="ERANGE",t[t.EDEADLK=35]="EDEADLK",t[t.ENAMETOOLONG=36]="ENAMETOOLONG",t[t.ENOLCK=37]="ENOLCK",t[t.ENOSYS=38]="ENOSYS",t[t.ENOTEMPTY=39]="ENOTEMPTY",t[t.ELOOP=40]="ELOOP",t[t.ENOMSG=42]="ENOMSG",t[t.EBADE=52]="EBADE",t[t.EBADR=53]="EBADR",t[t.EXFULL=54]="EXFULL",t[t.ENOANO=55]="ENOANO",t[t.EBADRQC=56]="EBADRQC",t[t.ENOSTR=60]="ENOSTR",t[t.ENODATA=61]="ENODATA",t[t.ETIME=62]="ETIME",t[t.ENOSR=63]="ENOSR",t[t.ENONET=64]="ENONET",t[t.EREMOTE=66]="EREMOTE",t[t.ENOLINK=67]="ENOLINK",t[t.ECOMM=70]="ECOMM",t[t.EPROTO=71]="EPROTO",t[t.EBADMSG=74]="EBADMSG",t[t.EOVERFLOW=75]="EOVERFLOW",t[t.EBADFD=77]="EBADFD",t[t.ESTRPIPE=86]="ESTRPIPE",t[t.ENOTSOCK=88]="ENOTSOCK",t[t.EDESTADDRREQ=89]="EDESTADDRREQ",t[t.EMSGSIZE=90]="EMSGSIZE",t[t.EPROTOTYPE=91]="EPROTOTYPE",t[t.ENOPROTOOPT=92]="ENOPROTOOPT",t[t.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",t[t.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",t[t.ENOTSUP=95]="ENOTSUP",t[t.ENETDOWN=100]="ENETDOWN",t[t.ENETUNREACH=101]="ENETUNREACH",t[t.ENETRESET=102]="ENETRESET",t[t.ETIMEDOUT=110]="ETIMEDOUT",t[t.ECONNREFUSED=111]="ECONNREFUSED",t[t.EHOSTDOWN=112]="EHOSTDOWN",t[t.EHOSTUNREACH=113]="EHOSTUNREACH",t[t.EALREADY=114]="EALREADY",t[t.EINPROGRESS=115]="EINPROGRESS",t[t.ESTALE=116]="ESTALE",t[t.EREMOTEIO=121]="EREMOTEIO",t[t.EDQUOT=122]="EDQUOT"}(cO||(cO={}));const TO={[cO.EPERM]:"Operation not permitted",[cO.ENOENT]:"No such file or directory",[cO.EINTR]:"Interrupted system call",[cO.EIO]:"Input/output error",[cO.ENXIO]:"No such device or address",[cO.EBADF]:"Bad file descriptor",[cO.EAGAIN]:"Resource temporarily unavailable",[cO.ENOMEM]:"Cannot allocate memory",[cO.EACCES]:"Permission denied",[cO.EFAULT]:"Bad address",[cO.ENOTBLK]:"Block device required",[cO.EBUSY]:"Resource busy or locked",[cO.EEXIST]:"File exists",[cO.EXDEV]:"Invalid cross-device link",[cO.ENODEV]:"No such device",[cO.ENOTDIR]:"File is not a directory",[cO.EISDIR]:"File is a directory",[cO.EINVAL]:"Invalid argument",[cO.ENFILE]:"Too many open files in system",[cO.EMFILE]:"Too many open files",[cO.ETXTBSY]:"Text file busy",[cO.EFBIG]:"File is too big",[cO.ENOSPC]:"No space left on disk",[cO.ESPIPE]:"Illegal seek",[cO.EROFS]:"Cannot modify a read-only file system",[cO.EMLINK]:"Too many links",[cO.EPIPE]:"Broken pipe",[cO.EDOM]:"Numerical argument out of domain",[cO.ERANGE]:"Numerical result out of range",[cO.EDEADLK]:"Resource deadlock would occur",[cO.ENAMETOOLONG]:"File name too long",[cO.ENOLCK]:"No locks available",[cO.ENOSYS]:"Function not implemented",[cO.ENOTEMPTY]:"Directory is not empty",[cO.ELOOP]:"Too many levels of symbolic links",[cO.ENOMSG]:"No message of desired type",[cO.EBADE]:"Invalid exchange",[cO.EBADR]:"Invalid request descriptor",[cO.EXFULL]:"Exchange full",[cO.ENOANO]:"No anode",[cO.EBADRQC]:"Invalid request code",[cO.ENOSTR]:"Device not a stream",[cO.ENODATA]:"No data available",[cO.ETIME]:"Timer expired",[cO.ENOSR]:"Out of streams resources",[cO.ENONET]:"Machine is not on the network",[cO.EREMOTE]:"Object is remote",[cO.ENOLINK]:"Link has been severed",[cO.ECOMM]:"Communication error on send",[cO.EPROTO]:"Protocol error",[cO.EBADMSG]:"Bad message",[cO.EOVERFLOW]:"Value too large for defined data type",[cO.EBADFD]:"File descriptor in bad state",[cO.ESTRPIPE]:"Streams pipe error",[cO.ENOTSOCK]:"Socket operation on non-socket",[cO.EDESTADDRREQ]:"Destination address required",[cO.EMSGSIZE]:"Message too long",[cO.EPROTOTYPE]:"Protocol wrong type for socket",[cO.ENOPROTOOPT]:"Protocol not available",[cO.EPROTONOSUPPORT]:"Protocol not supported",[cO.ESOCKTNOSUPPORT]:"Socket type not supported",[cO.ENOTSUP]:"Operation is not supported",[cO.ENETDOWN]:"Network is down",[cO.ENETUNREACH]:"Network is unreachable",[cO.ENETRESET]:"Network dropped connection on reset",[cO.ETIMEDOUT]:"Connection timed out",[cO.ECONNREFUSED]:"Connection refused",[cO.EHOSTDOWN]:"Host is down",[cO.EHOSTUNREACH]:"No route to host",[cO.EALREADY]:"Operation already in progress",[cO.EINPROGRESS]:"Operation now in progress",[cO.ESTALE]:"Stale file handle",[cO.EREMOTEIO]:"Remote I/O error",[cO.EDQUOT]:"Disk quota exceeded"};class IO extends Error{static fromJSON(t){const e=new IO(t.errno,t.message,t.path,t.syscall);return e.code=t.code,e.stack=t.stack,e}static With(t,e,n){return new IO(cO[t],TO[cO[t]],e,n)}constructor(t,e=TO[t],n,i=""){super(e),this.errno=t,this.path=n,this.syscall=i,this.code=cO[t],this.message=this.code+": "+e+(this.path?`, '${this.path}'`:"")}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}}let mO="/";function EO(t,e){let n="",i=0,s=-1,o=0,r="\0";for(let a=0;a<=t.length;++a){if(a2){const t=n.lastIndexOf("/");-1===t?(n="",i=0):(n=n.slice(0,t),i=n.length-1-n.lastIndexOf("/")),s=a,o=0;continue}if(0!==n.length){n="",i=0,s=a,o=0;continue}}e&&(n+=n.length>0?"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),i=a-s-1;s=a,o=0}else"."===r&&-1!==o?++o:o=-1}return n}function fO(...t){let e="";for(const n of[...t.reverse(),mO])if(n.length&&(e=`${n}/${e}`,n.startsWith("/")))break;const n=e.startsWith("/");return e=EO(e,!n),n?`/${e}`:e.length?e:"/"}function gO(...t){if(!t.length)return".";const e=t.join("/");return e?.length?function(t){if(!t.length)return".";const e=t.startsWith("/"),n=t.endsWith("/");return(t=EO(t,!e)).length?(n&&(t+="/"),e?`/${t}`:t):e?"/":n?"./":"."}(e):"."}function OO(t){if(0===t.length)return".";const e="/"===t[0];let n=-1,i=!0;for(let e=t.length-1;e>=1;--e)if("/"===t[e]){if(!i){n=e;break}}else i=!1;return-1===n?e?"/":".":e&&1===n?"//":t.slice(0,n)}function MO(t,e){let n=0,i=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,r=-1;for(let a=t.length-1;a>=0;--a)if("/"===t[a]){if(!s){n=a+1;break}}else-1===r&&(s=!1,r=a+1),o>=0&&(t[a]===e[o]?-1==--o&&(i=a):(o=-1,i=r));return n===i?i=r:-1===i&&(i=t.length),t.slice(n,i)}for(let e=t.length-1;e>=0;--e)if("/"===t[e]){if(!s){n=e+1;break}}else-1===i&&(s=!1,i=e+1);return-1===i?"":t.slice(n,i)}function RO(t){const e=t.startsWith("/"),n={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(0===t.length)return n;const i=e?1:0;let s=-1,o=0,r=-1,a=!0,l=t.length-1,u=0;for(;l>=i;--l)if("/"!==t[l])-1===r&&(a=!1,r=l+1),"."===t[l]?-1===s?s=l:1!==u&&(u=1):-1!==s&&(u=-1);else if(!a){o=l+1;break}if(-1!==r){const i=0===o&&e?1:o;-1===s||0===u||1===u&&s===r-1&&s===o+1?n.base=n.name=t.slice(i,r):(n.name=t.slice(i,s),n.base=t.slice(i,r),n.ext=t.slice(s,r))}return o>0?n.dir=t.slice(0,o-1):e&&(n.dir="/"),n}const AO=new TextEncoder;function SO(t){if("string"!=typeof t)throw new IO(cO.EINVAL,"Can not encode a non-string");return AO.encode(t)}const CO=new TextDecoder;function LO(t){if(!(t instanceof Uint8Array))throw new IO(cO.EINVAL,"Can not decode a non-Uint8Array");return CO.decode(t)}function yO(t){return JSON.parse(LO(t),((t,e)=>""==t?e:BigInt(e)))}function DO(t){return SO(JSON.stringify(t,((t,e)=>""==t?e:e.toString())))}function NO(t,e){if("number"==typeof t)return t;if("string"==typeof t){const e=parseInt(t,8);if(!isNaN(e))return e}if("number"==typeof e)return e;throw new IO(cO.EINVAL,"Invalid mode: "+t?.toString())}function bO(t){if(t instanceof Date)return t;try{return new Date(t)}catch{throw new IO(cO.EINVAL,"Invalid time.")}}function vO(t){if((t=t.toString()).includes("\0"))throw new IO(cO.EINVAL,"Path can not contain null character");if(0==t.length)throw new IO(cO.EINVAL,"Path can not be empty");return fO(t.replaceAll(/[/\\]+/g,"/"))}function wO(t,e="utf8",n,i=0){return"object"!=typeof t||null===t?{encoding:"string"==typeof t?t:e??null,flag:n,mode:i}:{encoding:"string"==typeof t?.encoding?t.encoding:e??null,flag:"string"==typeof t?.flag?t.flag:n,mode:NO("mode"in t?t?.mode:null,i)}}function FO(){return crypto.getRandomValues(new BigUint64Array(1))[0]}const PO={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0,groups:[]};function kO(t){return{suid:t.uid,sgid:t.gid,euid:t.uid,egid:t.gid,groups:[],...t}}const VO=0,YO=4,xO=2,UO=1,BO=1,XO=2,GO=4,HO=0,WO=1,KO=2,jO=64,qO=128,$O=256,zO=512,QO=1024,JO=65536,ZO=262144,tM=131072,eM=1052672,nM=4096,iM=32768,sM=16384,oM=2048,rM=61440,aM=49152,lM=40960,uM=32768,pM=24576,_M=16384,dM=8192,hM=4096,cM=2048,TM=1024,IM=512,mM=448,EM=256,fM=128,gM=64,OM=56,MM=32,RM=16,AM=8,SM=7,CM=4,LM=2,yM=1,DM=0,NM=2**32-1,bM={checkAccess:!0,updateOnRead:!0,syncImmediately:!0,unsafeBufferReplace:!1};Promise.withResolvers??(Promise.withResolvers=function(){let t,e;const n=new Promise(((n,i)=>{t=n,e=i}));return{promise:n,resolve:t,reject:e}}),Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));class vM{_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}constructor({atimeMs:t,mtimeMs:e,ctimeMs:n,birthtimeMs:i,uid:s,gid:o,size:r,mode:a,ino:l}={}){this.dev=this._convert(0),this.ino=this._convert(0),this.rdev=this._convert(0),this.nlink=this._convert(1),this.blksize=this._convert(4096),this.uid=this._convert(0),this.gid=this._convert(0);const u=Date.now();this.atimeMs=this._convert(t??u),this.mtimeMs=this._convert(e??u),this.ctimeMs=this._convert(n??u),this.birthtimeMs=this._convert(i??u),this.uid=this._convert(s??0),this.gid=this._convert(o??0),this.size=this._convert(r??0),this.ino=this._convert(l??0),this.mode=this._convert(a??420&uM),this.mode&rM||(this.mode=this.mode|this._convert(uM))}isFile(){return(this.mode&rM)===uM}isDirectory(){return(this.mode&rM)===_M}isSymbolicLink(){return(this.mode&rM)===lM}isSocket(){return(this.mode&rM)===aM}isBlockDevice(){return(this.mode&rM)===pM}isCharacterDevice(){return(this.mode&rM)===dM}isFIFO(){return(this.mode&rM)===hM}hasAccess(t,e){const n=e?.credentials||PO;if(this.isSymbolicLink()||0===n.euid||0===n.egid)return!0;let i=0;return n.uid===this.uid&&(this.mode&EM&&(i|=YO),this.mode&fM&&(i|=xO),this.mode&gM&&(i|=UO)),(n.gid===this.gid||n.groups.includes(Number(this.gid)))&&(this.mode&MM&&(i|=YO),this.mode&RM&&(i|=xO),this.mode&AM&&(i|=UO)),this.mode&CM&&(i|=YO),this.mode&LM&&(i|=xO),this.mode&yM&&(i|=UO),(i&t)===t}chmod(t){this.mode=this._convert(this.mode&rM|t)}chown(t,e){t=Number(t),e=Number(e),!isNaN(t)&&0<=t&&t<2**32&&(this.uid=this._convert(t)),!isNaN(e)&&0<=e&&e<2**32&&(this.gid=this._convert(e))}get atimeNs(){return 1000n*BigInt(this.atimeMs)}get mtimeNs(){return 1000n*BigInt(this.mtimeMs)}get ctimeNs(){return 1000n*BigInt(this.ctimeMs)}get birthtimeNs(){return 1000n*BigInt(this.birthtimeMs)}}function wM(t,e,n){!isNaN(e)&&0<=e&&e<2**32&&(t.uid=e),!isNaN(n)&&0<=n&&n<2**32&&(t.gid=n)}class FM extends vM{constructor(){super(...arguments),this._isBigint=!1}}class PM extends vM{constructor(){super(...arguments),this._isBigint=!0}}class kM{constructor(){this.type=525687744115,this.bsize=4096,this.blocks=0,this.bfree=0,this.bavail=0,this.files=NM,this.ffree=NM}}class VM{constructor(){this.type=0x7a656e6673n,this.bsize=4096n,this.blocks=0n,this.bfree=0n,this.bavail=0n,this.files=BigInt(NM),this.ffree=BigInt(NM)}}const YM=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function xM(t){if("number"==typeof t)return function(t){switch(t){case HO:return"r";case HO|eM:return"rs";case KO:return"r+";case KO|eM:return"rs+";case zO|jO|WO:return"w";case zO|jO|WO|qO:return"wx";case zO|jO|KO:return"w+";case zO|jO|KO|qO:return"wx+";case QO|jO|WO:return"a";case QO|jO|WO|qO:return"ax";case QO|jO|KO:return"a+";case QO|jO|KO|qO:return"ax+";default:throw new Error("Invalid flag number: "+t)}}(t);if(!YM.includes(t))throw new Error("Invalid flag string: "+t);return t}function UM(t){let e=0;return e<<=1,e+=+BM(t),e<<=1,e+=+XM(t),e<<=1,e}function BM(t){return-1!==t.indexOf("r")||-1!==t.indexOf("+")}function XM(t){return-1!==t.indexOf("w")||-1!==t.indexOf("a")||-1!==t.indexOf("+")}function GM(t){return-1!==t.indexOf("w")}function HM(t){return-1!==t.indexOf("a")}function WM(t){return-1!==t.indexOf("x")}class KM{constructor(t,e){this.fs=t,this.path=e}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}}class jM extends KM{constructor(t,e,n,i,s=new Uint8Array(new ArrayBuffer(0,t.metadata().noResizableBuffers?{}:{maxByteLength:NM}))){if(super(t,e),this.flag=n,this.stats=i,this._buffer=s,this._position=0,this.dirty=!1,this.closed=!1,this.stats.size!=s.byteLength){if(BM(this.flag))throw new Error(`Size mismatch: buffer length ${s.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return HM(this.flag)?this.stats.size:this._position}set position(t){this._position=t}async sync(){if(this.closed)throw IO.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw IO.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw IO.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw IO.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(t){if(this.closed)throw IO.With("EBADF",this.path,"File.dispose");if(this.dirty&&!t)throw IO.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw IO.With("EBADF",this.path,"File.stat");return Promise.resolve(new FM(this.stats))}statSync(){if(this.closed)throw IO.With("EBADF",this.path,"File.stat");return new FM(this.stats)}_truncate(t){if(this.closed)throw IO.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!XM(this.flag))throw new IO(cO.EPERM,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),t>this._buffer.length){const e=new Uint8Array(t-this._buffer.length);this._write(e,0,e.length,this._buffer.length)}else this.stats.size=t,this._buffer=t?this._buffer.slice(0,t):new Uint8Array}async truncate(t){this._truncate(t),bM.syncImmediately&&await this.sync()}truncateSync(t){this._truncate(t),bM.syncImmediately&&this.syncSync()}_write(t,e=0,n=this.stats.size,i=this.position){if(this.closed)throw IO.With("EBADF",this.path,"File.write");if(!XM(this.flag))throw new IO(cO.EPERM,"File not opened with a writeable mode.");this.dirty=!0;const s=i+n,o=t.slice(e,e+n);if(s>this.stats.size&&(this.stats.size=s,s>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=s)this._buffer.buffer.resize(s);else if(bM.unsafeBufferReplace)this._buffer=o;else{const t=new Uint8Array(new ArrayBuffer(s,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:NM}));t.set(this._buffer),this._buffer=t}return this._buffer.set(o,i),this.stats.mtimeMs=Date.now(),this.position=i+o.byteLength,o.byteLength}async write(t,e,n,i){const s=this._write(t,e,n,i);return bM.syncImmediately&&await this.sync(),s}writeSync(t,e=0,n=this.stats.size,i=this.position){const s=this._write(t,e,n,i);return bM.syncImmediately&&this.syncSync(),s}_read(t,e=0,n=this.stats.size,i){if(this.closed)throw IO.With("EBADF",this.path,"File.read");if(!BM(this.flag))throw new IO(cO.EPERM,"File not opened with a readable mode.");bM.updateOnRead&&(this.dirty=!0),this.stats.atimeMs=Date.now(),i??(i=this.position);let s=i+n;s>this.stats.size&&(s=i+Math.max(this.stats.size-i,0)),this._position=s;const o=s-i;return 0==o||new Uint8Array(t.buffer,e,n).set(this._buffer.slice(i,s)),o}async read(t,e,n,i){const s=this._read(t,e,n,i);return bM.syncImmediately&&await this.sync(),{bytesRead:s,buffer:t}}readSync(t,e,n,i){const s=this._read(t,e,n,i);return bM.syncImmediately&&this.syncSync(),s}async chmod(t){if(this.closed)throw IO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>rM?~rM:rM)|t,(bM.syncImmediately||t>rM)&&await this.sync()}chmodSync(t){if(this.closed)throw IO.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(t>rM?~rM:rM)|t,(bM.syncImmediately||t>rM)&&this.syncSync()}async chown(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.chown");this.dirty=!0,wM(this.stats,t,e),bM.syncImmediately&&await this.sync()}chownSync(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.chown");this.dirty=!0,wM(this.stats,t,e),bM.syncImmediately&&this.syncSync()}async utimes(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,bM.syncImmediately&&await this.sync()}utimesSync(t,e){if(this.closed)throw IO.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=t,this.stats.mtime=e,bM.syncImmediately&&this.syncSync()}}class qM{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:525687744115}}constructor(...t){}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(t){return"ENOENT"!=t.code}}existsSync(t){try{return this.statSync(t),!0}catch(t){return"ENOENT"!=t.code}}}var $M=__webpack_require__(228);Symbol.toStringTag,Symbol.iterator;const zM=Intl.NumberFormat("en",{notation:"compact"});zM.format.bind(zM);function QM(t){return t.at(0).toUpperCase()+t.slice(1)}const JM=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],ZM=[...JM,...JM.map((t=>QM(t))),"char"],tR=/^(u?int|float)(8|16|32|64)$/i;function eR(t){return"char"==t?"uint8":t.toLowerCase()}function nR(t){return tR.test(t.toString())}function iR(t){return"char"==t||tR.test(t.toString().toLowerCase())}Symbol.struct_init||=Symbol("struct_init"),Symbol.struct_metadata||=Symbol("struct_metadata");Symbol.struct_init,Symbol.struct_metadata;function sR(t){const e=Symbol.metadata||Object.getOwnPropertySymbols(t).find((t=>"Symbol.metadata"==t.description));var n;if(n=t,Symbol?.metadata&&(Symbol.metadata in n||Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)})),!e)throw new ReferenceError("Could not get a reference to Symbol.metadata");return e}function oR(t){return"function"==typeof t&&sR(t)in t&&function(t){return null!=t&&"object"==typeof t&&Symbol.struct_metadata in t}(t[sR(t)])}function rR(t){return null!=t&&"object"==typeof t&&oR(t.constructor)}function aR(t){if(!rR(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct instance")}function lR(t){if(!function(t){return rR(t)||oR(t)}(t))throw new TypeError(("function"==typeof t?t.name:"object"==typeof t&&t?t.constructor.name:t)+" is not a struct")}function uR(t){if("string"==typeof t)return function(t){if(!iR(t))throw new TypeError("Not a valid primitive type: "+t)}(t),+eR(t).match(tR)[2]/8;lR(t);const e=oR(t)?t:t.constructor;return e[sR(e)][Symbol.struct_metadata].size}function pR(t={}){return function(e,n){n.metadata??={},n.metadata[Symbol.struct_init]||=[];let i=0;const s=new Map;for(const e of n.metadata[Symbol.struct_init]){const{name:n,type:a,length:l}=e;if(!iR(a)&&!oR(a))throw new TypeError("Not a valid type: "+a);s.set(n,{offset:i,type:iR(a)?eR(a):a,length:l}),i+=uR(a)*(l||1),o=i,r=t.align||1,i=Math.ceil(o/r)*r}var o,r;return n.metadata[Symbol.struct_metadata]={options:t,members:s,size:i},e}}function _R(t,e){return function(n,i){let s=i.name;if("symbol"==typeof s&&(console.warn("Symbol used for struct member name will be coerced to string: "+s.toString()),s=s.toString()),!s)throw new ReferenceError("Invalid name for struct member");return i.metadata??={},i.metadata[Symbol.struct_init]||=[],i.metadata[Symbol.struct_init].push({name:s,type:t,length:e}),n}}function dR(t){aR(t);const{options:e,members:n}=t.constructor[sR(t.constructor)][Symbol.struct_metadata],i=new Uint8Array(uR(t)),s=new DataView(i.buffer);for(const[o,{type:r,length:a,offset:l}]of n)for(let n=0;n<(a||1);n++){const u=l+uR(r)*n;let p=a>0?t[o][n]:t[o];if("string"==typeof p&&(p=p.charCodeAt(0)),!nR(r)){i.set(p?dR(p):new Uint8Array(uR(r)),u);continue}const _="set"+QM(r);"setInt64"!=_?"setUint64"!=_?s[_](u,Number(p),!e.bigEndian):s.setBigUint64(u,BigInt(p),!e.bigEndian):s.setBigInt64(u,BigInt(p),!e.bigEndian)}return i}function hR(t,e){aR(t);const{options:n,members:i}=t.constructor[sR(t.constructor)][Symbol.struct_metadata],s=e instanceof Uint8Array?e:new Uint8Array("buffer"in e?e.buffer:e),o=new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength));for(const[e,{type:r,offset:a,length:l}]of i)for(let i=0;i<(l||1);i++){let u=l>0?t[e]:t;const p=l>0?i:e,_=a+uR(r)*i;if("string"==typeof t[e]){t[e]=t[e].slice(0,i)+String.fromCharCode(o.getUint8(_))+t[e].slice(i+1);continue}if(!nR(r)){if(null===u[p]||void 0===u[p])continue;hR(u[p],new Uint8Array(s.slice(_,_+uR(r))));continue}l>0&&(u||=[]);const d="get"+QM(r);"getInt64"!=d?u[p]="getUint64"!=d?o[d](_,!n.bigEndian):o.getBigUint64(_,!n.bigEndian):u[p]=o.getBigInt64(_,!n.bigEndian)}}Symbol.metadata??=Symbol.for("Symbol.metadata");const cR=Object.fromEntries(ZM.map((t=>{return[t,(e=t,function(t,n){return"number"==typeof t?_R(e,t):_R(e)(t,n)})];var e})));var TR=function(t,e,n,i,s,o){function r(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=i.kind,u="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?i.static?t:t.prototype:null,_=e||(p?Object.getOwnPropertyDescriptor(p,i.name):{}),d=!1,h=n.length-1;h>=0;h--){var c={};for(var T in i)c[T]="access"===T?{}:i[T];for(var T in i.access)c.access[T]=i.access[T];c.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(r(t||null))};var I=(0,n[h])("accessor"===l?{get:_.get,set:_.set}:_[u],c);if("accessor"===l){if(void 0===I)continue;if(null===I||"object"!=typeof I)throw new TypeError("Object expected");(a=r(I.get))&&(_.get=a),(a=r(I.set))&&(_.set=a),(a=r(I.init))&&s.unshift(a)}else(a=r(I))&&("field"===l?s.unshift(a):_[u]=a)}p&&Object.defineProperty(p,i.name,_),d=!0},IR=function(t,e,n){for(var i=arguments.length>2,s=0;s{var t,e,n,i,s,o,r,a,l,u,p;let _,d,h,c,T,I,m,E,f,g,O,M,R,A=[pR()],S=[],C=[],L=[],y=[],D=[],N=[],b=[],v=[],w=[],F=[],P=[],k=[],V=[],Y=[],x=[],U=[],B=[],X=[],G=[],H=[],W=[],K=[],j=[];var q=d=class{constructor(t){if(this.data=IR(this,C,void 0),this.size=(IR(this,L),IR(this,y,void 0)),this.mode=(IR(this,D),IR(this,N,void 0)),this.nlink=(IR(this,b),IR(this,v,void 0)),this.uid=(IR(this,w),IR(this,F,void 0)),this.gid=(IR(this,P),IR(this,k,void 0)),this.atimeMs=(IR(this,V),IR(this,Y,void 0)),this.birthtimeMs=(IR(this,x),IR(this,U,void 0)),this.mtimeMs=(IR(this,B),IR(this,X,void 0)),this.ctimeMs=(IR(this,G),IR(this,H,void 0)),this.ino=(IR(this,W),IR(this,K,void 0)),IR(this,j),t){const e=uR(q),n=e-uR("uint64");if(t.byteLength{const $="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;h=[(t=cR).uint64.bind(t)],c=[(e=cR).uint32.bind(e)],T=[(n=cR).uint16.bind(n)],I=[(i=cR).uint32.bind(i)],m=[(s=cR).uint32.bind(s)],E=[(o=cR).uint32.bind(o)],f=[(r=cR).float64.bind(r)],g=[(a=cR).float64.bind(a)],O=[(l=cR).float64.bind(l)],M=[(u=cR).float64.bind(u)],R=[(p=cR).uint64.bind(p)],TR(null,null,h,{kind:"field",name:"data",static:!1,private:!1,access:{has:t=>"data"in t,get:t=>t.data,set:(t,e)=>{t.data=e}},metadata:$},C,L),TR(null,null,c,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:$},y,D),TR(null,null,T,{kind:"field",name:"mode",static:!1,private:!1,access:{has:t=>"mode"in t,get:t=>t.mode,set:(t,e)=>{t.mode=e}},metadata:$},N,b),TR(null,null,I,{kind:"field",name:"nlink",static:!1,private:!1,access:{has:t=>"nlink"in t,get:t=>t.nlink,set:(t,e)=>{t.nlink=e}},metadata:$},v,w),TR(null,null,m,{kind:"field",name:"uid",static:!1,private:!1,access:{has:t=>"uid"in t,get:t=>t.uid,set:(t,e)=>{t.uid=e}},metadata:$},F,P),TR(null,null,E,{kind:"field",name:"gid",static:!1,private:!1,access:{has:t=>"gid"in t,get:t=>t.gid,set:(t,e)=>{t.gid=e}},metadata:$},k,V),TR(null,null,f,{kind:"field",name:"atimeMs",static:!1,private:!1,access:{has:t=>"atimeMs"in t,get:t=>t.atimeMs,set:(t,e)=>{t.atimeMs=e}},metadata:$},Y,x),TR(null,null,g,{kind:"field",name:"birthtimeMs",static:!1,private:!1,access:{has:t=>"birthtimeMs"in t,get:t=>t.birthtimeMs,set:(t,e)=>{t.birthtimeMs=e}},metadata:$},U,B),TR(null,null,O,{kind:"field",name:"mtimeMs",static:!1,private:!1,access:{has:t=>"mtimeMs"in t,get:t=>t.mtimeMs,set:(t,e)=>{t.mtimeMs=e}},metadata:$},X,G),TR(null,null,M,{kind:"field",name:"ctimeMs",static:!1,private:!1,access:{has:t=>"ctimeMs"in t,get:t=>t.ctimeMs,set:(t,e)=>{t.ctimeMs=e}},metadata:$},H,W),TR(null,null,R,{kind:"field",name:"ino",static:!1,private:!1,access:{has:t=>"ino"in t,get:t=>t.ino,set:(t,e)=>{t.ino=e}},metadata:$},K,j),TR(null,_={value:d},A,{kind:"class",name:d.name,metadata:$},null,S),q=d=_.value,$&&Object.defineProperty(d,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$}),IR(d,S)})(),q=d})();var fR=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},gR=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class OR extends qM{async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}constructor(t){super(),this.store=t,this._initialized=!1}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!0),s=RO(t),o=RO(e),r=await this.findInode(i,s.dir,"rename"),a=yO(await this.get(i,r.data,s.dir,"rename"));if(!a[s.base])throw IO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0===(o.dir+"/").indexOf(t+"/"))throw new IO(cO.EBUSY,s.dir);const u=o.dir==s.dir,p=u?r:await this.findInode(i,o.dir,"rename"),_=u?a:yO(await this.get(i,p.data,o.dir,"rename"));if(_[o.base]){const t=new ER(await this.get(i,_[o.base],e,"rename"));if(!t.toStats().isFile())throw IO.With("EPERM",e,"rename");await i.remove(t.data),await i.remove(_[o.base])}_[o.base]=l,await i.set(r.data,DO(a)),await i.set(p.data,DO(_)),await i.commit()}catch(t){n.error=t,n.hasError=!0}finally{const t=gR(n);t&&await t}}renameSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!1),s=RO(t),o=RO(e),r=this.findInodeSync(i,s.dir,"rename"),a=yO(this.getSync(i,r.data,s.dir,"rename"));if(!a[s.base])throw IO.With("ENOENT",t,"rename");const l=a[s.base];if(delete a[s.base],0==(o.dir+"/").indexOf(t+"/"))throw new IO(cO.EBUSY,s.dir);const u=o.dir===s.dir,p=u?r:this.findInodeSync(i,o.dir,"rename"),_=u?a:yO(this.getSync(i,p.data,o.dir,"rename"));if(_[o.base]){const t=new ER(this.getSync(i,_[o.base],e,"rename"));if(!t.toStats().isFile())throw IO.With("EPERM",e,"rename");i.removeSync(t.data),i.removeSync(_[o.base])}_[o.base]=l,i.setSync(r.data,DO(a)),i.setSync(p.data,DO(_)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{gR(n)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!0);return(await this.findInode(n,t,"stat")).toStats()}catch(t){e.error=t,e.hasError=!0}finally{const t=gR(e);t&&await t}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!1);return this.findInodeSync(n,t,"stat").toStats()}catch(t){e.error=t,e.hasError=!0}finally{gR(e)}}async createFile(t,e,n){const i=await this.commitNew(t,uM,n,new Uint8Array,"createFile");return new jM(this,t,e,i.toStats(),new Uint8Array)}createFileSync(t,e,n){const i=this.commitNewSync(t,uM,n,new Uint8Array,"createFile");return new jM(this,t,e,i.toStats(),new Uint8Array)}async openFile(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!0),s=await this.findInode(i,t,"openFile"),o=await this.get(i,s.data,t,"openFile");return new jM(this,t,e,s.toStats(),o)}catch(t){n.error=t,n.hasError=!0}finally{const t=gR(n);t&&await t}}openFileSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!1),s=this.findInodeSync(i,t,"openFile"),o=this.getSync(i,s.data,t,"openFile");return new jM(this,t,e,s.toStats(),o)}catch(t){n.error=t,n.hasError=!0}finally{gR(n)}}async unlink(t){return this.remove(t,!1,"unlink")}unlinkSync(t){this.removeSync(t,!1,"unlink")}async rmdir(t){if((await this.readdir(t)).length)throw IO.With("ENOTEMPTY",t,"rmdir");await this.remove(t,!0,"rmdir")}rmdirSync(t){if(this.readdirSync(t).length)throw IO.With("ENOTEMPTY",t,"rmdir");this.removeSync(t,!0,"rmdir")}async mkdir(t,e){await this.commitNew(t,_M,e,SO("{}"),"mkdir")}mkdirSync(t,e){this.commitNewSync(t,_M,e,SO("{}"),"mkdir")}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!0),i=await this.findInode(n,t,"readdir");return Object.keys(yO(await this.get(n,i.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{const t=gR(e);t&&await t}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=fR(e,this.store.transaction(),!1),i=this.findInodeSync(n,t,"readdir");return Object.keys(yO(this.getSync(n,i.data,t,"readdir")))}catch(t){e.error=t,e.hasError=!0}finally{gR(e)}}async sync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!0),o=await this._findInode(s,t,"sync"),r=new ER(await this.get(s,o,t,"sync")),a=r.update(n);await s.set(r.data,e),a&&await s.set(o,dR(r)),await s.commit()}catch(t){i.error=t,i.hasError=!0}finally{const t=gR(i);t&&await t}}syncSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!1),o=this._findInodeSync(s,t,"sync"),r=new ER(this.getSync(s,o,t,"sync")),a=r.update(n);s.setSync(r.data,e),a&&s.setSync(o,dR(r)),s.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{gR(i)}}async link(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!0),s=OO(e),o=await this.findInode(i,s,"link"),r=yO(await this.get(i,o.data,s,"link")),a=await this._findInode(i,t,"link"),l=new ER(await this.get(i,a,t,"link"));l.nlink++,r[MO(e)]=a,i.setSync(a,dR(l)),i.setSync(o.data,DO(r)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{const t=gR(n);t&&await t}}linkSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=fR(n,this.store.transaction(),!1),s=OO(e),o=this.findInodeSync(i,s,"link"),r=yO(this.getSync(i,o.data,s,"link")),a=this._findInodeSync(i,t,"link"),l=new ER(this.getSync(i,a,t,"link"));l.nlink++,r[MO(e)]=a,i.setSync(a,dR(l)),i.setSync(o.data,DO(r)),i.commitSync()}catch(t){n.error=t,n.hasError=!0}finally{gR(n)}}async checkRoot(){const t={stack:[],error:void 0,hasError:!1};try{const e=fR(t,this.store.transaction(),!0);if(await e.get(0n))return;const n=new ER;n.ino=0n,n.mode=511|_M,await e.set(n.data,SO("{}")),await e.set(0n,dR(n)),await e.commit()}catch(e){t.error=e,t.hasError=!0}finally{const e=gR(t);e&&await e}}checkRootSync(){const t={stack:[],error:void 0,hasError:!1};try{const e=fR(t,this.store.transaction(),!1);if(e.getSync(0n))return;const n=new ER;n.ino=0n,n.mode=511|_M,e.setSync(n.data,SO("{}")),e.setSync(0n,dR(n)),e.commitSync()}catch(e){t.error=e,t.hasError=!0}finally{gR(t)}}async _findInode(t,e,n,i=new Set){if(i.has(e))throw new IO(cO.EIO,"Infinite loop detected while finding inode",e);if(i.add(e),"/"==e)return 0n;const{dir:s,base:o}=RO(e),r="/"==s?new ER(await this.get(t,0n,s,n)):await this.findInode(t,s,n,i),a=yO(await this.get(t,r.data,s,n));if(!(o in a))throw IO.With("ENOENT",fO(s,o),n);return a[o]}_findInodeSync(t,e,n,i=new Set){if(i.has(e))throw new IO(cO.EIO,"Infinite loop detected while finding inode",e);if(i.add(e),"/"==e)return 0n;const{dir:s,base:o}=RO(e),r="/"==s?new ER(this.getSync(t,0n,s,n)):this.findInodeSync(t,s,n,i),a=yO(this.getSync(t,r.data,s,n));if(!(o in a))throw IO.With("ENOENT",fO(s,o),n);return a[o]}async findInode(t,e,n,i=new Set){const s=await this._findInode(t,e,n,i);return new ER(await this.get(t,s,e,n))}findInodeSync(t,e,n,i=new Set){const s=this._findInodeSync(t,e,n,i);return new ER(this.getSync(t,s,e,n))}async get(t,e,n,i){const s=await t.get(e);if(!s)throw IO.With("ENOENT",n,i);return s}getSync(t,e,n,i){const s=t.getSync(e);if(!s)throw IO.With("ENOENT",n,i);return s}async allocNew(t,e,n){for(let e=0;e<5;e++){const e=FO();if(!await t.get(e))return e}throw new IO(cO.ENOSPC,"No IDs available",e,n)}allocNewSync(t,e,n){for(let e=0;e<5;e++){const e=FO();if(!t.getSync(e))return e}throw new IO(cO.ENOSPC,"No IDs available",e,n)}async commitNew(t,e,n,i,s){const o={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw IO.With("EEXIST",t,s);const r=fR(o,this.store.transaction(),!0),{dir:a,base:l}=RO(t),u=await this.findInode(r,a,s),p=yO(await this.get(r,u.data,a,s));if(p[l])throw IO.With("EEXIST",t,s);const _=new ER;return _.ino=await this.allocNew(r,t,s),_.data=await this.allocNew(r,t,s),_.mode=n|e,_.uid=u.mode&cM?u.uid:PO.uid,_.gid=u.mode&TM?u.gid:PO.gid,_.size=i.length,await r.set(_.ino,dR(_)),await r.set(_.data,i),p[l]=_.ino,await r.set(u.data,DO(p)),await r.commit(),_}catch(t){o.error=t,o.hasError=!0}finally{const t=gR(o);t&&await t}}commitNewSync(t,e,n,i,s){const o={stack:[],error:void 0,hasError:!1};try{if("/"==t)throw IO.With("EEXIST",t,s);const r=fR(o,this.store.transaction(),!1),{dir:a,base:l}=RO(t),u=this.findInodeSync(r,a,s),p=yO(this.getSync(r,u.data,a,s));if(p[l])throw IO.With("EEXIST",t,s);const _=new ER;return _.ino=this.allocNewSync(r,t,s),_.data=this.allocNewSync(r,t,s),_.size=i.length,_.mode=n|e,_.uid=u.mode&cM?u.uid:PO.uid,_.gid=u.mode&TM?u.gid:PO.gid,r.setSync(_.ino,dR(_)),r.setSync(_.data,i),p[l]=_.ino,r.setSync(u.data,DO(p)),r.commitSync(),_}catch(t){o.error=t,o.hasError=!0}finally{gR(o)}}async remove(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!0),{dir:o,base:r}=RO(t),a=await this.findInode(s,o,n),l=yO(await this.get(s,a.data,o,n));if(!l[r])throw IO.With("ENOENT",t,"remove");const u=l[r],p=new ER(await this.get(s,u,t,n));if(delete l[r],!e&&p.toStats().isDirectory())throw IO.With("EISDIR",t,"remove");await s.set(a.data,DO(l)),--p.nlink<1&&(await s.remove(p.data),await s.remove(u)),await s.commit()}catch(t){i.error=t,i.hasError=!0}finally{const t=gR(i);t&&await t}}removeSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=fR(i,this.store.transaction(),!1),{dir:o,base:r}=RO(t),a=this.findInodeSync(s,o,n),l=yO(this.getSync(s,a.data,o,n)),u=l[r];if(!u)throw IO.With("ENOENT",t,"remove");const p=new ER(this.getSync(s,u,t,n));if(delete l[r],!e&&p.toStats().isDirectory())throw IO.With("EISDIR",t,"remove");s.setSync(a.data,DO(l)),--p.nlink<1&&(s.removeSync(p.data),s.removeSync(u)),s.commitSync()}catch(t){i.error=t,i.hasError=!0}finally{gR(i)}}}class MR{constructor(t){this.store=t,this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}}class RR extends MR{async keys(){return this.keysSync()}async get(t){return this.getSync(t)}async set(t,e){return this.setSync(t,e)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}}class AR extends RR{constructor(){super(...arguments),this.originalData=new Map,this.modifiedKeys=new Set}keysSync(){return this.store.keys()}getSync(t){const e=this.store.get(t);return this.stashOldValue(t,e),e}setSync(t,e){return this.markModified(t),this.store.set(t,e)}removeSync(t){this.markModified(t),this.store.delete(t)}commitSync(){this.done=!0}abortSync(){if(this.done){for(const t of this.modifiedKeys){const e=this.originalData.get(t);e?this.store.set(t,e):this.store.delete(t)}this.done=!0}}stashOldValue(t,e){this.originalData.has(t)||this.originalData.set(t,e)}markModified(t){this.modifiedKeys.add(t),this.originalData.has(t)||this.originalData.set(t,this.store.get(t))}}class SR extends Map{constructor(t="tmp"){super(),this.name=t}async sync(){}clearSync(){this.clear()}transaction(){return new AR(this)}}const CR={name:"InMemory",isAvailable:()=>!0,options:{name:{type:"string",required:!1}},create({name:t}){const e=new OR(new SR(t));return e.checkRootSync(),e}};"function"==typeof SuppressedError&&SuppressedError;class LR{constructor(){this.isEnabled=!1,this.sync=new Map,this.async=new Map}has(t){return this.isEnabled&&this.sync.has(t)}get(t){if(this.isEnabled)return this.sync.get(t)}set(t,e){this.isEnabled&&(this.sync.set(t,e),this.async.set(t,Promise.resolve(e)))}hasAsync(t){return this.isEnabled&&this.async.has(t)}getAsync(t){if(this.isEnabled)return this.async.get(t)}setAsync(t,e){this.isEnabled&&(this.async.set(t,e),e.then((e=>this.sync.set(t,e))))}clear(){this.isEnabled&&(this.sync.clear(),this.async.clear())}}const yR=new LR,DR=new LR;var NR=__webpack_require__(8287);function bR(t,e){return Object.fromEntries(Object.entries(t).map((([t,n])=>[t,"function"==typeof n?n.bind(e):n])))}const vR=new Map;let wR=100;function FR(t){const e=wR++;return vR.set(e,t),e}function PR(t){if(!vR.has(t))throw new IO(cO.EBADF);return vR.get(t)}const kR=new Map;function VR(t,e){if("/"!==t[0]&&(t="/"+t),t=fO(t),kR.has(t))throw new IO(cO.EINVAL,"Mount point "+t+" is already in use.");kR.set(t,e),DR.clear()}function YR(t){if("/"!==t[0]&&(t="/"+t),t=fO(t),!kR.has(t))throw new IO(cO.EINVAL,"Mount point "+t+" is already unmounted.");kR.delete(t),DR.clear()}function xR(t,e){const n=e?.root||"/";t=vO(gO(n,t));const i=[...kR].sort(((t,e)=>t[0].length>e[0].length?-1:1));for(const[e,s]of i)if(e.length<=t.length&&t.startsWith(e))return""===(t=t.slice(e.length>1?e.length:0))&&(t=n),{fs:s,path:t,mountPoint:e,root:n};throw new IO(cO.EIO,"No file system")}async function UR(){await Promise.all([...kR.values()].map((t=>t.ready())))}function BR(t,e){for(const[n,i]of Object.entries(e))t=t?.replaceAll(n,i);return t}function XR(t,e){"string"==typeof t.stack&&(t.stack=BR(t.stack,e));try{t.message=BR(t.message,e)}catch{}return t.path&&(t.path=BR(t.path,e)),t}function GR(t){"/"in t&&YR("/");for(const[e,n]of Object.entries(t))VR(e,n)}function HR(t,e){const n=t.metadata(),i=n.blockSize||4096;return{type:(e?BigInt:Number)(n.type),bsize:(e?BigInt:Number)(i),ffree:(e?BigInt:Number)(n.freeNodes||NM),files:(e?BigInt:Number)(n.totalNodes||NM),bavail:(e?BigInt:Number)(n.freeSpace/i),bfree:(e?BigInt:Number)(n.freeSpace/i),blocks:(e?BigInt:Number)(n.totalSpace/i)}}function WR(t,e){const n=this?.credentials;if(n?.uid&&n?.gid&&n?.euid&&n?.egid)throw new IO(cO.EPERM,"Can not chroot() as non-root user");return e&&this?(this.root+=t,this):function(t,e=structuredClone(PO)){const n={root:t,credentials:kO(e)},i=bR(st,n),s=bR(it,n);return{...n,...i,promises:s}}(gO(this?.root||"/",t),n)}VR("/",CR.create({name:"root"}));class KR extends $M{off(t,e,n,i){return super.off(t,e,n,i)}removeListener(t,e,n,i){return super.removeListener(t,e,n,i)}constructor(t){super(),this.path=t}setMaxListeners(){throw IO.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw IO.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw IO.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw IO.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw IO.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}}class jR extends KR{constructor(t,e){super(t),this.options=e,function(t,e){const n=vO(t);$R.has(n)||$R.set(n,new Set);$R.get(n).add(e)}(t.toString(),this)}close(){super.emit("close"),function(t,e){const n=vO(t);$R.has(n)&&($R.get(n).delete(e),0===$R.get(n).size&&$R.delete(n))}(this.path.toString(),this)}[Symbol.dispose](){this.close()}}class qR extends KR{constructor(t,e){super(t),this.options=e,this.start()}onInterval(){try{const n=eA(this.path);t=this.previous,e=n,(t.size!=e.size||+t.atime!=+e.atime||+t.mtime!=+e.mtime||+t.ctime!=+e.ctime||t.mode!=e.mode)&&(this.emit("change",n,this.previous),this.previous=n)}catch(t){this.emit("error",t)}var t,e}start(){const t=this.options.interval||5e3;try{this.previous=eA(this.path)}catch(t){return void this.emit("error",t)}this.intervalId=setInterval(this.onInterval.bind(this),t),this.options.persistent||"object"!=typeof this.intervalId||this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}}const $R=new Map;function zR(t,e){if(e=vO(e),$R.has(e))for(const n of $R.get(e))n.emit("change",t,MO(e));let n,i=e;for(;i!==n;)if(n=i,i=OO(i),$R.has(i))for(const n of $R.get(i))n.emit("change",t,e.slice(i.length+("/"==i?0:1)))}var QR=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},JR=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});function ZR(t,e){t=vO(t),e=vO(e);const n=xR(t,this),i=xR(e,this);if(bM.checkAccess&&!eA.call(this,OO(t)).hasAccess(xO,this))throw IO.With("EACCES",t,"rename");try{if(n===i)return n.fs.renameSync(n.path,i.path),zR("rename",t.toString()),void zR("change",e.toString());pA.call(this,e,uA(t)),sA.call(this,t),zR("rename",t.toString())}catch(s){throw XR(s,{[n.path]:t,[i.path]:e})}}function tA(t){t=vO(t);try{const{fs:e,path:n}=xR(FA.call(this,t),this);return e.existsSync(n)}catch(t){if(t.errno==cO.ENOENT)return!1;throw t}}function eA(t,e){t=vO(t);const{fs:n,path:i}=xR(FA.call(this,t),this);try{const t=n.statSync(i);if(bM.checkAccess&&!t.hasAccess(YO,this))throw IO.With("EACCES",i,"stat");return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}function nA(t,e){t=vO(t);const{fs:n,path:i}=xR(t,this);try{const t=n.statSync(i);return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}function iA(t,e=0){const n={stack:[],error:void 0,hasError:!1};try{const i=QR(n,oA.call(this,t,"r+"),!1);if(e||(e=0),e<0)throw new IO(cO.EINVAL);i.truncateSync(e)}catch(t){n.error=t,n.hasError=!0}finally{JR(n)}}function sA(t){t=vO(t);const{fs:e,path:n}=xR(t,this);try{if(bM.checkAccess&&!(yR.get(t)||e.statSync(n)).hasAccess(xO,this))throw IO.With("EACCES",n,"unlink");e.unlinkSync(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}function oA(t,e,n,i=!0){t=vO(t);const s=NO(n,420),o=xM(e);t=i?FA.call(this,t):t;const{fs:r,path:a}=xR(t,this);let l;try{l=r.statSync(a)}catch{}if(!l){if(!XM(o)&&!HM(o)||"r+"==o)throw IO.With("ENOENT",t,"_open");const e=r.statSync(OO(a));if(bM.checkAccess&&!e.hasAccess(xO,this))throw IO.With("EACCES",OO(t),"_open");if(!e.isDirectory())throw IO.With("ENOTDIR",OO(t),"_open");return r.createFileSync(a,o,s)}if(bM.checkAccess&&(!l.hasAccess(s,this)||!l.hasAccess(UM(o),this)))throw IO.With("EACCES",t,"_open");if(WM(o))throw IO.With("EEXIST",t,"_open");const u=r.openFileSync(a,o);return GM(o)&&u.truncateSync(0),u}function rA(t,e,n=VO){return FR(oA.call(this,t,e,n,!0))}function aA(t,e,n){return FR(oA.call(this,t,e,n,!1))}function lA(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=QR(i,oA.call(this,t,e,420,n),!1),o=s.statSync(),r=new Uint8Array(o.size);return s.readSync(r,0,o.size,0),r}catch(t){i.error=t,i.hasError=!0}finally{JR(i)}}function uA(t,e={}){const n=wO(e,null,"r",420);if(!BM(xM(n.flag)))throw new IO(cO.EINVAL,"Flag passed to readFile must allow for reading.");const i=NR.Buffer.from(lA.call(this,"number"==typeof t?PR(t).path:t.toString(),n.flag,!0));return n.encoding?i.toString(n.encoding):i}function pA(t,e,n={}){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","w+",420),o=xM(s.flag);if(!XM(o))throw new IO(cO.EINVAL,"Flag passed to writeFile must allow for writing.");if("string"!=typeof e&&!s.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const r="string"==typeof e?NR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(!r)throw new IO(cO.EINVAL,"Data not specified");QR(i,oA.call(this,"number"==typeof t?PR(t).path:t.toString(),o,s.mode,!0),!1).writeSync(r,0,r.byteLength,0),zR("change",t.toString())}catch(t){i.error=t,i.hasError=!0}finally{JR(i)}}function _A(t,e,n={}){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","a+",420),o=xM(s.flag);if(!HM(o))throw new IO(cO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const r="string"==typeof e?NR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);QR(i,oA.call(this,"number"==typeof t?PR(t).path:t.toString(),o,s.mode,!0),!1).writeSync(r,0,r.byteLength)}catch(t){i.error=t,i.hasError=!0}finally{JR(i)}}function dA(t,e){const n=PR(t).statSync();return e?.bigint?new PM(n):n}function hA(t){PR(t).closeSync(),vR.delete(t)}function cA(t,e=0){if(e||(e=0),e<0)throw new IO(cO.EINVAL);PR(t).truncateSync(e)}function TA(t){PR(t).syncSync()}function IA(t){PR(t).datasyncSync()}function mA(t,e,n,i,s){let o,r,a,l;if("string"==typeof e){l="number"==typeof n?n:null;const t="string"==typeof i?i:"utf8";r=0,o=NR.Buffer.from(e,t),a=o.byteLength}else o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=n,a=i,l="number"==typeof s?s:null;const u=PR(t);l??(l=u.position);const p=u.writeSync(o,r,a,l);return zR("change",u.path),p}function EA(t,e,n,i,s){const o=PR(t),r="object"==typeof n?n.offset:n;return"object"==typeof n&&(i=n.length,s=n.position),s=Number(s),isNaN(s)&&(s=o.position),o.readSync(e,r,i,s)}function fA(t,e,n){PR(t).chownSync(e,n)}function gA(t,e){const n=NO(e,-1);if(n<0)throw new IO(cO.EINVAL,"Invalid mode.");PR(t).chmodSync(n)}function OA(t,e,n){PR(t).utimesSync(bO(e),bO(n))}function MA(t){t=vO(t);const{fs:e,path:n}=xR(FA.call(this,t),this);try{const i=yR.get(t)||e.statSync(n);if(!i.isDirectory())throw IO.With("ENOTDIR",n,"rmdir");if(bM.checkAccess&&!i.hasAccess(xO,this))throw IO.With("EACCES",n,"rmdir");e.rmdirSync(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}function RA(t,e){e="object"==typeof e?e:{mode:e};const n=NO(e?.mode,511);t=FA.call(this,t);const{fs:i,path:s,root:o}=xR(t,this),r={[s]:t};try{if(!e?.recursive){if(bM.checkAccess&&!i.statSync(OO(s)).hasAccess(xO,this))throw IO.With("EACCES",OO(s),"mkdir");return i.mkdirSync(s,n)}const a=[];for(let e=s,n=t;!i.existsSync(e);e=OO(e),n=OO(n))a.unshift(e),r[e]=n;for(const t of a){if(bM.checkAccess&&!i.statSync(OO(t)).hasAccess(xO,this))throw IO.With("EACCES",OO(t),"mkdir");i.mkdirSync(t,n),zR("rename",t)}return 1==o.length?a[0]:a[0]?.slice(o.length)}catch(t){throw XR(t,r)}}function AA(t,e){e="object"==typeof e?e:{encoding:e},t=vO(t);const{fs:n,path:i}=xR(FA.call(this,t),this);let s;try{const e=yR.get(t)||n.statSync(i);if(yR.set(t,e),bM.checkAccess&&!e.hasAccess(YO,this))throw IO.With("EACCES",i,"readdir");if(!e.isDirectory())throw IO.With("ENOTDIR",i,"readdir");s=n.readdirSync(i)}catch(e){throw XR(e,{[i]:t})}const o=[];for(const r of s){const s=yR.get(gO(t,r))||n.statSync(gO(i,r));if(yR.set(gO(t,r),s),e?.withFileTypes?o.push(new HA(r,s)):"buffer"==e?.encoding?o.push(NR.Buffer.from(r)):o.push(r),s.isDirectory()&&e?.recursive)for(const n of AA.call(this,gO(t,r),{...e,_isIndirect:!0}))n instanceof HA?(n.path=gO(r,n.path),o.push(n)):NR.Buffer.isBuffer(n)?o.push(NR.Buffer.from(gO(r,LO(n)))):o.push(gO(r,n))}return e?._isIndirect||yR.clear(),o}function SA(t,e){if(t=vO(t),bM.checkAccess&&!eA(OO(t)).hasAccess(YO,this))throw IO.With("EACCES",OO(t),"link");if(e=vO(e),bM.checkAccess&&!eA(OO(e)).hasAccess(xO,this))throw IO.With("EACCES",OO(e),"link");const{fs:n,path:i}=xR(t,this),s=xR(e,this);if(n!=s.fs)throw IO.With("EXDEV",e,"link");try{if(bM.checkAccess&&!n.statSync(i).hasAccess(YO,this))throw IO.With("EACCES",i,"link");return n.linkSync(i,e)}catch(n){throw XR(n,{[i]:t,[s.path]:e})}}function CA(t,e,n="file"){if(!["file","dir","junction"].includes(n))throw new IO(cO.EINVAL,"Invalid type: "+n);if(tA.call(this,e))throw IO.With("EEXIST",e.toString(),"symlink");pA.call(this,e,t.toString());oA.call(this,e,"r+",420,!1).chmodSync(lM)}function LA(t,e){const n=NR.Buffer.from(lA.call(this,t.toString(),"r",!1)),i="object"==typeof e?e?.encoding:e;return"buffer"==i?n:n.toString(i)}function yA(t,e,n){const i=rA.call(this,t,"r+");fA(i,e,n),hA(i)}function DA(t,e,n){const i=aA.call(this,t,"r+");fA(i,e,n),hA(i)}function NA(t,e){const n=rA.call(this,t,"r+");gA(n,e),hA(n)}function bA(t,e){const n=aA.call(this,t,"r+");gA(n,e),hA(n)}function vA(t,e,n){const i=rA.call(this,t,"r+");OA(i,e,n),hA(i)}function wA(t,e,n){const i=aA.call(this,t,"r+");OA(i,e,n),hA(i)}function FA(t,e){t=vO(t);const n=(this?.root||"")+t;if(DR.has(n))return DR.get(n);const{base:i,dir:s}=RO(t),o="/"==s?"/":DR.get((this?.root||"")+s)||FA.call(this,s),r=gO(o,i),{fs:a,path:l}=xR(r,this);try{const i=yR.get(r)||a.statSync(l);if(yR.set(r,i),!i.isSymbolicLink())return DR.set(t,r),r;const s=fO(o,LA.call(this,r,e).toString()),u=DR.get((this?.root||"")+s)||FA.call(this,s);return DR.set(n,u),u}catch(e){if("ENOENT"==e.code)return t;throw XR(e,{[l]:r})}}function PA(t,e=384){if(bM.checkAccess&&!eA.call(this,t).hasAccess(e,this))throw new IO(cO.EACCES)}function kA(t,e){let n;t=vO(t);try{n=yR.get(t)||nA.bind(this)(t)}catch(t){if("ENOENT"!=t.code||!e?.force)throw t}if(n){switch(yR.set(t,n),n.mode&rM){case _M:if(e?.recursive)for(const n of AA.call(this,t,{_isIndirect:!0}))kA.call(this,gO(t,n),{...e,_isIndirect:!0});MA.call(this,t);break;case uM:case lM:case pM:case dM:sA.call(this,t);break;default:throw yR.clear(),new IO(cO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||yR.clear()}}function VA(t,e){const n="object"==typeof e?e?.encoding:e||"utf8",i="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return RA.call(this,i),"buffer"==n?NR.Buffer.from(i):i}function YA(t,e,n){if(t=vO(t),e=vO(e),n&&n&BO&&tA(e))throw new IO(cO.EEXIST,"Destination file already exists.",e,"copyFile");pA.call(this,e,uA(t)),zR("rename",e.toString())}function xA(t,e,n){const i=PR(t);let s=0;for(const t of e)s+=i.readSync(t,0,t.byteLength,n+s);return s}function UA(t,e,n){const i=PR(t);let s=0;for(const t of e)s+=i.writeSync(new Uint8Array(t.buffer),0,t.byteLength,n+s);return s}function BA(t,e){return t=vO(t),new WA(t,this)}function XA(t,e,n){t=vO(t),e=vO(e);const i=nA.call(this,t);if(n?.errorOnExist&&tA.call(this,e))throw new IO(cO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(i.mode&rM){case _M:if(!n?.recursive)throw new IO(cO.EISDIR,t+" is a directory (not copied)",t,"cp");RA.call(this,e,{recursive:!0});for(const i of AA.call(this,t,{withFileTypes:!0}))n.filter&&!n.filter(gO(t,i.name),gO(e,i.name))||XA.call(this,gO(t,i.name),gO(e,i.name),n);break;case uM:case lM:YA.call(this,t,e);break;default:throw new IO(cO.EPERM,"File type not supported",t,"rm")}n?.preserveTimestamps&&vA.call(this,e,i.atime,i.mtime)}function GA(t,e){t=vO(t);const{fs:n}=xR(t,this);return HR(n,e?.bigint)}class HA{get name(){return MO(this.path)}constructor(t,e){this.path=t,this.stats=e}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}}class WA{checkClosed(){if(this.closed)throw new IO(cO.EBADF,"Can not use closed Dir")}constructor(t,e){this.path=t,this.context=e,this.closed=!1}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??(this._entries=await _S.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}read(t){if(!t)return this._read();this._read().then((e=>t(void 0,e)))}readSync(){return this.checkClosed(),this._entries??(this._entries=AA.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}async next(){const t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}}var KA=__webpack_require__(6248);class jA extends KA.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new IO(cO.EIO,e.toString()))}}}class qA extends KA.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(e){t(new IO(cO.EIO,e.toString()))}}}var $A=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},zA=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class QA{constructor(t,e){this.context=e;const n="number"!=typeof t;this.fd=n?FR(t):t,this.file=n?t:PR(t)}async chown(t,e){await this.file.chown(t,e),zR("change",this.file.path)}async chmod(t){const e=NO(t,-1);if(e<0)throw new IO(cO.EINVAL,"Invalid mode.");await this.file.chmod(e),zR("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(t){if(t||(t=0),t<0)throw new IO(cO.EINVAL);await this.file.truncate(t),zR("change",this.file.path)}async utimes(t,e){await this.file.utimes(bO(t),bO(e)),zR("change",this.file.path)}async appendFile(t,e={}){const n=wO(e,"utf8","a",420);if(!HM(xM(n.flag)))throw new IO(cO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!n.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const i="string"==typeof t?NR.Buffer.from(t,n.encoding):t;await this.file.write(i,0,i.length),zR("change",this.file.path)}read(t,e,n,i){return isNaN(+i)&&(i=this.file.position),this.file.read(t,e,n,i)}async readFile(t){const e=wO(t,null,"r",292);if(!BM(xM(e.flag)))throw new IO(cO.EINVAL,"Flag passed must allow for reading.");const{size:n}=await this.stat(),{buffer:i}=await this.file.read(new Uint8Array(n),0,n,0),s=NR.Buffer.from(i);return e.encoding?s.toString(e.encoding):s}readableWebStream(t={}){const e=globalThis;if(!("ReadableStream"in e))throw new IO(cO.ENOSYS,"ReadableStream is missing on globalThis");return new e.ReadableStream({start:async t=>{try{const e=65536,n=1e7;let i=0,s=0,o=NaN;for(;o>0;){const r=await this.read(new Uint8Array(e),0,e,s);if(!r.bytesRead)return void t.close();if(t.enqueue(r.buffer.slice(0,r.bytesRead)),s+=r.bytesRead,++i>=n)throw new IO(cO.EFBIG,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");o=r.bytesRead}}catch(e){t.error(e)}},type:t.type})}readLines(t){throw IO.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){const e=await this.file.stat();if(bM.checkAccess&&!e.hasAccess(YO,this.context))throw IO.With("EACCES",this.file.path,"stat");return t?.bigint?new PM(e):e}async write(t,e,n,i){let s,o,r;if("string"==typeof t){i="number"==typeof e?e:null;const a="string"==typeof n?n:"utf8";o=0,s=NR.Buffer.from(t,a),r=s.length}else s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=e,r=n,i="number"==typeof i?i:null;i??(i=this.file.position);const a=await this.file.write(s,o,r,i);return zR("change",this.file.path),{buffer:s,bytesWritten:a}}async writeFile(t,e={}){const n=wO(e,"utf8","w",420);if(!XM(xM(n.flag)))throw new IO(cO.EINVAL,"Flag passed must allow for writing.");if("string"!=typeof t&&!n.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const i="string"==typeof t?NR.Buffer.from(t,n.encoding):t;await this.file.write(i,0,i.length,0),zR("change",this.file.path)}async close(){await this.file.close(),vR.delete(this.fd)}async writev(t,e){let n=0;for(const i of t)n+=(await this.write(i,0,i.length,e+n)).bytesWritten;return{bytesWritten:n,buffers:t}}async readv(t,e){let n=0;for(const i of t)n+=(await this.read(i,0,i.byteLength,e+n)).bytesRead;return{bytesRead:n,buffers:t}}createReadStream(t){const e=new jA({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:async t=>{try{const n=await this.read(new Uint8Array(t),0,t,this.file.position);e.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(t){e.destroy(t)}}});return e.path=this.file.path,e}createWriteStream(t){const e=new qA({highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:async(t,e,n)=>{try{const{bytesWritten:i}=await this.write(t,null,e);n(i==t.length?null:new Error("Failed to write full chunk"))}catch(t){n(t)}}});return e.path=this.file.path,e}}async function JA(t,e){t=vO(t),e=vO(e);const n=xR(t,this),i=xR(e,this);if(bM.checkAccess&&!(await tS.call(this,OO(t))).hasAccess(xO,this))throw IO.With("EACCES",t,"rename");try{if(n.mountPoint==i.mountPoint)return await n.fs.rename(n.path,i.path),zR("rename",t.toString()),void zR("change",e.toString());await aS.call(this,e,await rS(t)),await iS.call(this,t),zR("rename",t.toString())}catch(s){throw XR(s,{[n.path]:t,[i.path]:e})}}async function ZA(t){try{const{fs:e,path:n}=xR(await OS.call(this,t),this);return await e.exists(n)}catch(t){if(t instanceof IO&&"ENOENT"==t.code)return!1;throw t}}async function tS(t,e){t=vO(t);const{fs:n,path:i}=xR(await OS.call(this,t),this);try{const t=await n.stat(i);if(bM.checkAccess&&!t.hasAccess(YO,this))throw IO.With("EACCES",i,"stat");return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}async function eS(t,e){t=vO(t);const{fs:n,path:i}=xR(t,this);try{const t=await n.stat(i);return e?.bigint?new PM(t):t}catch(e){throw XR(e,{[i]:t})}}async function nS(t,e=0){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await oS.call(this,t,"r+"),!0);await i.truncate(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function iS(t){t=vO(t);const{fs:e,path:n}=xR(t,this);try{if(bM.checkAccess&&!(await(yR.getAsync(t)||e.stat(n))).hasAccess(xO,this))throw IO.With("EACCES",n,"unlink");await e.unlink(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}async function sS(t,e,n=420,i){t=vO(t);const s=NO(n,420),o=xM(e);t=i?await OS.call(this,t):t;const{fs:r,path:a}=xR(t,this),l=await r.stat(a).catch((()=>null));if(!l){if(!XM(o)&&!HM(o)||"r+"==o)throw IO.With("ENOENT",t,"_open");const e=await r.stat(OO(a));if(bM.checkAccess&&!e.hasAccess(xO,this))throw IO.With("EACCES",OO(t),"_open");if(!e.isDirectory())throw IO.With("ENOTDIR",OO(t),"_open");return new QA(await r.createFile(a,o,s),this)}if(bM.checkAccess&&!l.hasAccess(UM(o),this))throw IO.With("EACCES",t,"_open");if(WM(o))throw IO.With("EEXIST",t,"_open");const u=new QA(await r.openFile(a,o),this);return GM(o)&&await u.truncate(0),u}async function oS(t,e="r",n=420){return await sS.call(this,t,e,n,!0)}async function rS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=wO(e,null,"r",420),s=$A(n,"object"==typeof t&&"fd"in t?t:await oS.call(this,t,i.flag,i.mode),!0);return await s.readFile(i)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function aS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","w+",420),o=$A(i,t instanceof QA?t:await oS.call(this,t.toString(),s.flag,s.mode),!0),r=e;if("string"!=typeof r&&!(r instanceof Uint8Array))throw new IO(cO.EINVAL,"Iterables and streams not supported",o.file.path,"writeFile");await o.writeFile(r,s)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function lS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=wO(n,"utf8","a",420);if(!HM(xM(s.flag)))throw new IO(cO.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!s.encoding)throw new IO(cO.EINVAL,"Encoding not specified");const o="string"==typeof e?NR.Buffer.from(e,s.encoding):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=$A(i,"object"==typeof t&&"fd"in t?t:await oS.call(this,t,s.flag,s.mode),!0);await r.appendFile(o,s)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function uS(t){t=await OS.call(this,t);const{fs:e,path:n}=xR(t,this);try{const i=await(yR.getAsync(t)||e.stat(n));if(!i)throw IO.With("ENOENT",t,"rmdir");if(!i.isDirectory())throw IO.With("ENOTDIR",n,"rmdir");if(bM.checkAccess&&!i.hasAccess(xO,this))throw IO.With("EACCES",n,"rmdir");await e.rmdir(n),zR("rename",t.toString())}catch(e){throw XR(e,{[n]:t})}}async function pS(t,e){e="object"==typeof e?e:{mode:e};const n=NO(e?.mode,511);t=await OS.call(this,t);const{fs:i,path:s,root:o}=xR(t,this),r={[s]:t};try{if(!e?.recursive){if(bM.checkAccess&&!(await i.stat(OO(s))).hasAccess(xO,this))throw IO.With("EACCES",OO(s),"mkdir");return await i.mkdir(s,n),void zR("rename",t.toString())}const a=[];for(let e=s,n=t;!await i.exists(e);e=OO(e),n=OO(n))a.unshift(e),r[e]=n;for(const t of a){if(bM.checkAccess&&!(await i.stat(OO(t))).hasAccess(xO,this))throw IO.With("EACCES",OO(t),"mkdir");await i.mkdir(t,n),zR("rename",t)}return 1==o.length?a[0]:a[0]?.slice(o.length)}catch(t){throw XR(t,r)}}async function _S(t,e){e="object"==typeof e?e:{encoding:e},t=await OS.call(this,t);const n=e=>{throw XR(e,{[s]:t})},{fs:i,path:s}=xR(t,this),o=yR.getAsync(t)||i.stat(s).catch(n);yR.setAsync(t,o);const r=await o;if(!r)throw IO.With("ENOENT",t,"readdir");if(bM.checkAccess&&!r.hasAccess(YO,this))throw IO.With("EACCES",t,"readdir");if(!r.isDirectory())throw IO.With("ENOTDIR",t,"readdir");const a=await i.readdir(s).catch(n),l=[];return await Promise.all(a.map((async o=>{let r;if(e?.recursive||e?.withFileTypes){const e=yR.getAsync(gO(t,o))||i.stat(gO(s,o)).catch(n);yR.setAsync(gO(t,o),e),r=await e}if(e?.withFileTypes?l.push(new HA(o,r)):"buffer"==e?.encoding?l.push(NR.Buffer.from(o)):l.push(o),e?.recursive&&r?.isDirectory())for(const n of await _S.call(this,gO(t,o),{...e,_isIndirect:!0}))n instanceof HA?(n.path=gO(o,n.path),l.push(n)):NR.Buffer.isBuffer(n)?l.push(NR.Buffer.from(gO(o,LO(n)))):l.push(gO(o,n))}))),e?._isIndirect||yR.clear(),l}async function dS(t,e){t=vO(t),e=vO(e);const{fs:n,path:i}=xR(t,this),s=xR(e,this);if(n!=s.fs)throw IO.With("EXDEV",e,"link");try{if(bM.checkAccess&&!(await n.stat(OO(t))).hasAccess(YO,this))throw IO.With("EACCES",OO(i),"link");if(bM.checkAccess&&!(await tS.call(this,OO(e))).hasAccess(xO,this))throw IO.With("EACCES",OO(e),"link");if(bM.checkAccess&&!(await n.stat(i)).hasAccess(YO,this))throw IO.With("EACCES",i,"link");return await n.link(i,s.path)}catch(n){throw XR(n,{[s.path]:e,[i]:t})}}async function hS(t,e,n="file"){const i={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(n))throw new IO(cO.EINVAL,"Invalid symlink type: "+n);if(await ZA.call(this,e))throw IO.With("EEXIST",e.toString(),"symlink");const s=$A(i,await sS.call(this,e,"w+",420,!1),!0);await s.writeFile(t.toString()),await s.file.chmod(lM)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function cS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await sS.call(this,vO(t),"r",420,!1),!0),s=await i.readFile(),o="object"==typeof e?e?.encoding:e;return"buffer"==o?s:s.toString(o)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function TS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await oS.call(this,t,"r+"),!0);await s.chown(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function IS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await sS.call(this,t,"r+",420,!1),!0);await s.chown(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function mS(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await oS.call(this,t,"r+"),!0);await i.chmod(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function ES(t,e){const n={stack:[],error:void 0,hasError:!1};try{const i=$A(n,await sS.call(this,t,"r+",420,!1),!0);await i.chmod(e)}catch(t){n.error=t,n.hasError=!0}finally{const t=zA(n);t&&await t}}async function fS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await oS.call(this,t,"r+"),!0);await s.utimes(e,n)}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function gS(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{const s=$A(i,await sS.call(this,t,"r+",420,!1),!0);await s.utimes(new Date(e),new Date(n))}catch(t){i.error=t,i.hasError=!0}finally{const t=zA(i);t&&await t}}async function OS(t,e){t=vO(t);const n=(this?.root||"")+t;if(DR.hasAsync(n))return DR.getAsync(n);const{base:i,dir:s}=RO(t),o="/"==s?"/":await(DR.getAsync((this?.root||"")+s)||OS.call(this,s)),r=gO(o,i),{fs:a,path:l}=xR(r,this);try{const e=yR.getAsync(r)||a.stat(l);if(yR.setAsync(r,e),!(await e).isSymbolicLink())return DR.set(t,r),r;const i=fO(o,(await cS.call(this,r)).toString()),s=DR.getAsync((this?.root||"")+i)||OS.call(this,i);return DR.setAsync(n,s),await s}catch(e){if("ENOENT"==e.code)return t;throw XR(e,{[l]:r})}}function MS(t,e={}){return{[Symbol.asyncIterator](){const n=new jR(t.toString(),"string"!=typeof e?e:{encoding:e}),i=[];function s(){n.close();for(const t of i)t({value:null,done:!0});return i.length=0,Promise.resolve({value:null,done:!0})}return n.on("change",((t,e)=>{i.shift()?.({value:{eventType:t,filename:e},done:!1})})),{async next(){const{promise:t,resolve:e}=Promise.withResolvers();return i.push(e),t},return:s,throw:s}}}}async function RS(t,e=VO){if(!bM.checkAccess)return;if(!(await tS.call(this,t)).hasAccess(e,this))throw new IO(cO.EACCES)}async function AS(t,e){t=vO(t);const n=await(yR.getAsync(t)||eS.call(this,t).catch((t=>{if("ENOENT"!=t.code||!e?.force)throw t})));if(n){switch(yR.set(t,n),n.mode&rM){case _M:if(e?.recursive)for(const n of await _S.call(this,t,{_isIndirect:!0}))await AS.call(this,gO(t,n),{...e,_isIndirect:!0});await uS.call(this,t);break;case uM:case lM:case pM:case dM:await iS.call(this,t);break;default:throw yR.clear(),new IO(cO.EPERM,"File type not supported",t,"rm")}e?._isIndirect||yR.clear()}}async function SS(t,e){const n="object"==typeof e?e?.encoding:e||"utf8",i="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await pS.call(this,i),"buffer"==n?NR.Buffer.from(i):i}async function CS(t,e,n){if(t=vO(t),e=vO(e),n&&n&BO&&await ZA.call(this,e))throw new IO(cO.EEXIST,"Destination file already exists.",e,"copyFile");await aS.call(this,e,await rS.call(this,t)),zR("rename",e.toString())}function LS(t,e){return t=vO(t),Promise.resolve(new WA(t,this))}async function yS(t,e,n){t=vO(t),e=vO(e);const i=await eS.call(this,t);if(n?.errorOnExist&&await ZA.call(this,e))throw new IO(cO.EEXIST,"Destination file or directory already exists.",e,"cp");switch(i.mode&rM){case _M:{if(!n?.recursive)throw new IO(cO.EISDIR,t+" is a directory (not copied)",t,"cp");const[i]=await Promise.all([_S.call(this,t,{withFileTypes:!0}),pS.call(this,e,{recursive:!0})]),s=async i=>{n.filter&&!n.filter(gO(t,i.name),gO(e,i.name))||await yS.call(this,gO(t,i.name),gO(e,i.name),n)};await Promise.all(i.map(s));break}case uM:case lM:await CS.call(this,t,e);break;default:throw new IO(cO.EPERM,"File type not supported",t,"rm")}n?.preserveTimestamps&&await fS.call(this,e,i.atime,i.mtime)}async function DS(t,e){t=vO(t);const{fs:n}=xR(t,this);return Promise.resolve(HR(n,e?.bigint))}const NS=()=>{};function bS(t,e,n=NS){JA.call(this,t,e).then((()=>n())).catch(n)}function vS(t,e=NS){ZA.call(this,t).then(e).catch((()=>e(!1)))}function wS(t,e,n=NS){n="function"==typeof e?e:n,tS.call(this,t,"function"!=typeof e?e:{}).then((t=>n(void 0,t))).catch(n)}function FS(t,e,n=NS){n="function"==typeof e?e:n,eS.call(this,t,"function"!=typeof e?e:{}).then((t=>n(void 0,t))).catch(n)}function PS(t,e=0,n=NS){n="function"==typeof e?e:n;const i="number"==typeof e?e:0;nS.call(this,t,i).then((()=>n())).catch(n)}function kS(t,e=NS){iS.call(this,t).then((()=>e())).catch(e)}function VS(t,e,n,i=NS){const s=NO(n,420);i="function"==typeof n?n:i,oS.call(this,t,e,s).then((t=>i(void 0,t.fd))).catch(i)}function YS(t,e,n=NS){n="function"==typeof e?e:n,rS.call(this,t,"function"==typeof e?null:e).then((t=>n(void 0,t))).catch(n)}function xS(t,e,n,i=NS){i="function"==typeof n?n:i,aS.call(this,t,e,"function"!=typeof n?n:null).then((()=>i(void 0))).catch(i)}function US(t,e,n,i=NS){const s="function"!=typeof n?n:void 0;i="function"==typeof n?n:i,lS.call(this,t,e,s).then((()=>i())).catch(i)}function BS(t,e,n=NS){n="function"==typeof e?e:n,PR(t).stat().then((t=>n(void 0,"object"==typeof e&&e?.bigint?new PM(t):t))).catch(n)}function XS(t,e=NS){const n=PR(t).close();vR.delete(t),n.then((()=>e())).catch(e)}function GS(t,e,n=NS){const i="number"==typeof e?e:0;n="function"==typeof e?e:n;const s=PR(t);if(i<0)throw new IO(cO.EINVAL);s.truncate(i).then((()=>n())).catch(n)}function HS(t,e=NS){PR(t).sync().then((()=>e())).catch(e)}function WS(t,e=NS){PR(t).datasync().then((()=>e())).catch(e)}function KS(t,e,n,i,s,o=NS){let r,a,l,u,p;const _=new QA(t,this);if("string"==typeof e){switch(p="utf8",typeof n){case"function":o=n;break;case"number":u=n,p="string"==typeof i?i:"utf8",o="function"==typeof s?s:o;break;default:return void(o="function"==typeof i?i:"function"==typeof s?s:o)(new IO(cO.EINVAL,"Invalid arguments."))}r=NR.Buffer.from(e),a=0,l=r.length;const t=o;_.write(r,a,l,u).then((({bytesWritten:e})=>t(void 0,e,r.toString(p)))).catch(t)}else{r=NR.Buffer.from(e.buffer),a=n,l=i,u="number"==typeof s?s:null;const t="function"==typeof s?s:o;_.write(r,a,l,u).then((({bytesWritten:e})=>t(void 0,e,r))).catch(t)}}function jS(t,e,n,i,s,o=NS){new QA(t,this).read(e,n,i,s).then((({bytesRead:t,buffer:e})=>o(void 0,t,e))).catch(o)}function qS(t,e,n,i=NS){new QA(t,this).chown(e,n).then((()=>i())).catch(i)}function $S(t,e,n){new QA(t,this).chmod(e).then((()=>n())).catch(n)}function zS(t,e,n,i=NS){new QA(t,this).utimes(e,n).then((()=>i())).catch(i)}function QS(t,e=NS){uS.call(this,t).then((()=>e())).catch(e)}function JS(t,e,n=NS){pS.call(this,t,e).then((()=>n())).catch(n)}function ZS(t,e,n=NS){n="function"==typeof e?e:n;const i="function"!=typeof e?e:{};_S.call(this,t,i).then((t=>n(void 0,t))).catch(n)}function tC(t,e,n=NS){dS.call(this,t,e).then((()=>n())).catch(n)}function eC(t,e,n,i=NS){const s="string"==typeof n?n:"file";i="function"==typeof n?n:i,hS.call(this,t,e,s).then((()=>i())).catch(i)}function nC(t,e,n=NS){n="function"==typeof e?e:n,cS.call(this,t).then((t=>n(void 0,t))).catch(n)}function iC(t,e,n,i=NS){TS.call(this,t,e,n).then((()=>i())).catch(i)}function sC(t,e,n,i=NS){IS.call(this,t,e,n).then((()=>i())).catch(i)}function oC(t,e,n=NS){mS.call(this,t,e).then((()=>n())).catch(n)}function rC(t,e,n=NS){ES.call(this,t,e).then((()=>n())).catch(n)}function aC(t,e,n,i=NS){fS.call(this,t,e,n).then((()=>i())).catch(i)}function lC(t,e,n,i=NS){gS.call(this,t,e,n).then((()=>i())).catch(i)}function uC(t,e,n=NS){n="function"==typeof e?e:n,OS.call(this,t,"function"==typeof e?null:e).then((t=>n(void 0,t))).catch(n)}function pC(t,e,n=NS){const i="number"==typeof e?e:YO;n="function"==typeof e?e:n,RS.call(this,t,i).then((()=>n())).catch(n)}const _C=new Map;function dC(t,e,n){const i=vO(t.toString()),s="function"!=typeof e?e:{};if("function"==typeof e&&(n=e),!n)throw new IO(cO.EINVAL,"No listener specified",t.toString(),"watchFile");if(_C.has(i)){const t=_C.get(i);return void(t&&t.listeners.add(n))}const o=new qR(i,s);o.on("change",((t,e)=>{const n=_C.get(i);if(n)for(const i of n.listeners)i(t,e)})),_C.set(i,{watcher:o,listeners:new Set})}function hC(t,e=NS){const n=vO(t.toString()),i=_C.get(n);i&&(e&&e!==NS?i.listeners.delete(e):i.listeners.clear(),0===i.listeners.size&&(i.watcher.stop(),_C.delete(n)))}function cC(t,e,n){const i=new jR(vO(t),"object"==typeof e?e:{});return n="function"==typeof e?e:n,i.on("change",n||NS),i}function TC(t,e){const n=this;let i;const s=new jA({highWaterMark:(e="object"==typeof e?e:{encoding:e}).highWaterMark||65536,encoding:e.encoding||"utf8",async read(o){try{i||(i=await oS.call(n,t,"r",e?.mode));const r=await i.read(new Uint8Array(o),0,o,i.file.position);s.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),i.file.position+=r.bytesRead,r.bytesRead||await i.close()}catch(t){await(i?.close()),s.destroy(t)}},destroy(t,e){i?.close().then((()=>e(t))).catch(NS)}});return s.path=t.toString(),s}function IC(t,e){const n=this;let i;e="object"==typeof e?e:{encoding:e};const s=new qA({highWaterMark:e?.highWaterMark,async write(s,o,r){try{i||(i=await oS.call(n,t,"w",e?.mode||438)),await i.write(s,0,o),r(void 0)}catch(t){await(i?.close()),r(t)}},destroy(t,e){e(t),i?.close().then((()=>e(t))).catch(e)},final(t){i?.close().then((()=>t())).catch(t)}});return s.path=t.toString(),s}function mC(t,e,n=NS){n="function"==typeof e?e:n,AS.call(this,t,"function"==typeof e?void 0:e).then((()=>n(void 0))).catch(n)}function EC(t,e,n=NS){n="function"==typeof e?e:n,SS.call(this,t,"function"!=typeof e?e:null).then((t=>n(void 0,t))).catch(n)}function fC(t,e,n,i=NS){i="function"==typeof n?n:i,CS.call(this,t,e,"function"==typeof n?void 0:n).then((()=>i(void 0))).catch(i)}function gC(t,e,n,i=NS){i="function"==typeof n?n:i,new QA(t,this).readv(e,"function"==typeof n?void 0:n).then((({buffers:t,bytesRead:e})=>i(void 0,e,t))).catch(i)}function OC(t,e,n,i=NS){i="function"==typeof n?n:i,new QA(t,this).writev(e,"function"==typeof n?void 0:n).then((({buffers:t,bytesWritten:e})=>i(void 0,e,t))).catch(i)}function MC(t,e,n=NS){n="function"==typeof e?e:n,LS.call(this,t,"function"==typeof e?void 0:e).then((t=>n(void 0,t))).catch(n)}function RC(t,e,n,i=NS){i="function"==typeof n?n:i,yS.call(this,t,e,"function"==typeof n?void 0:n).then((()=>i(void 0))).catch(i)}function AC(t,e,n=NS){n="function"==typeof e?e:n,DS.call(this,t,"function"==typeof e?void 0:e).then((t=>n(void 0,t))).catch(n)}async function SC(t,e){const n=await oS.call(this,t.toString(),"r"),i=await n.readFile();return await n.close(),new Blob([i],e)}var CC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},LC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});function yC(t){return class extends t{constructor(){super(...arguments),this._queue=[],this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise((t=>{const e=()=>this._queueRunning?setTimeout(e):t();e()}))}async ready(){if(await super.ready(),await this.queueDone(),!this._isInitialized&&!this._disableSync){if(this.checkSync(),await this._sync.ready(),this._sync instanceof OR&&this instanceof OR){const t=this._sync.store.transaction(),e=this.store.transaction(),n=[];for(const i of await e.keys())n.push(e.get(i).then((e=>t.setSync(i,e))));return await Promise.all(n),void(this._isInitialized=!0)}try{await this.crossCopy("/"),this._isInitialized=!0}catch(t){throw this._isInitialized=!1,t}}}checkSync(t,e){if(this._disableSync)throw new IO(cO.ENOTSUP,"Sync caching has been disabled for this async file system",t,e);if(!this._sync)throw new IO(cO.ENOTSUP,"No sync cache is attached to this async file system",t,e)}renameSync(t,e){this.checkSync(t,"rename"),this._sync.renameSync(t,e),this.queue("rename",t,e)}statSync(t){return this.checkSync(t,"stat"),this._sync.statSync(t)}createFileSync(t,e,n){return this.checkSync(t,"createFile"),this._sync.createFileSync(t,e,n),this.queue("createFile",t,e,n),this.openFileSync(t,e)}openFileSync(t,e){this.checkSync(t,"openFile");const n=this._sync.openFileSync(t,e+"+"),i=n.statSync(),s=new Uint8Array(i.size);return n.readSync(s),new jM(this,t,e,i,s)}unlinkSync(t){this.checkSync(t,"unlinkSync"),this._sync.unlinkSync(t),this.queue("unlink",t)}rmdirSync(t){this.checkSync(t,"rmdir"),this._sync.rmdirSync(t),this.queue("rmdir",t)}mkdirSync(t,e){this.checkSync(t,"mkdir"),this._sync.mkdirSync(t,e),this.queue("mkdir",t,e)}readdirSync(t){return this.checkSync(t,"readdir"),this._sync.readdirSync(t)}linkSync(t,e){this.checkSync(t,"link"),this._sync.linkSync(t,e),this.queue("link",t,e)}syncSync(t,e,n){this.checkSync(t,"sync"),this._sync.syncSync(t,e,n),this.queue("sync",t,e,n)}existsSync(t){return this.checkSync(t,"exists"),this._sync.existsSync(t)}async crossCopy(t){this.checkSync(t,"crossCopy");const e=await this.stat(t);if(!e.isDirectory()){const n={stack:[],error:void 0,hasError:!1};try{const i=CC(n,await this.openFile(t,xM("r")),!0),s=CC(n,this._sync.createFileSync(t,xM("w"),e.mode),!1),o=new Uint8Array(e.size);return await i.read(o),void s.writeSync(o,0,e.size)}catch(t){n.error=t,n.hasError=!0}finally{const t=LC(n);t&&await t}}if("/"!==t){const e=await this.stat(t);this._sync.mkdirSync(t,e.mode)}const n=[];for(const e of await this.readdir(t))n.push(this.crossCopy(gO(t,e)));await Promise.all(n)}async _next(){if(!this._queueRunning)return;const[t,...e]=this._queue.shift();await this[t](...e),await this._next()}queue(...t){this._queue.push(t),this._next()}}}new Map;yC(qM);new Map;Map;DC=qM;var DC;var NC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},bC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});class vC{get isLocked(){return this._isLocked}constructor(t){this.previous=t,this.current=Promise.withResolvers(),this._isLocked=!0}async done(){await(this.previous?.done()),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}}class wC{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){const t=new vC(this.currentLock);return this.currentLock=t,t}async lock(t,e){const n=this.currentLock,i=this.addLock(),s=(new Error).stack;return setTimeout((()=>{if(i.isLocked){const n=IO.With("EDEADLK",t,e);throw n.stack+=s?.slice(5),n}}),5e3),await(n?.done()),i}lockSync(t,e){if(this.currentLock?.isLocked)throw IO.With("EBUSY",t,e);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"rename"),!1);await this._fs.rename(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}renameSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"rename"),!1);return this._fs.renameSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async stat(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"stat"),!1);return await this._fs.stat(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}statSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"stat"),!1);return this._fs.statSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async openFile(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"openFile"),!1);const i=await this._fs.openFile(t,e);return i.fs=this,i}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}openFileSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"openFile"),!1);const i=this._fs.openFileSync(t,e);return i.fs=this,i}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async createFile(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,await this.lock(t,"createFile"),!1);const s=await this._fs.createFile(t,e,n);return s.fs=this,s}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}createFileSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,this.lockSync(t,"createFile"),!1);const s=this._fs.createFileSync(t,e,n);return s.fs=this,s}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}async unlink(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"unlink"),!1);await this._fs.unlink(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}unlinkSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"unlink"),!1);return this._fs.unlinkSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async rmdir(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"rmdir"),!1);await this._fs.rmdir(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}rmdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"rmdir"),!1);return this._fs.rmdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async mkdir(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"mkdir"),!1);await this._fs.mkdir(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}mkdirSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"mkdir"),!1);return this._fs.mkdirSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async readdir(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"readdir"),!1);return await this._fs.readdir(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}readdirSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"readdir"),!1);return this._fs.readdirSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async exists(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,await this.lock(t,"exists"),!1);return await this._fs.exists(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}existsSync(t){const e={stack:[],error:void 0,hasError:!1};try{NC(e,this.lockSync(t,"exists"),!1);return this._fs.existsSync(t)}catch(t){e.error=t,e.hasError=!0}finally{bC(e)}}async link(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,await this.lock(t,"link"),!1);await this._fs.link(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}linkSync(t,e){const n={stack:[],error:void 0,hasError:!1};try{NC(n,this.lockSync(t,"link"),!1);return this._fs.linkSync(t,e)}catch(t){n.error=t,n.hasError=!0}finally{bC(n)}}async sync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,await this.lock(t,"sync"),!1);await this._fs.sync(t,e,n)}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}syncSync(t,e,n){const i={stack:[],error:void 0,hasError:!1};try{NC(i,this.lockSync(t,"sync"),!1);return this._fs.syncSync(t,e,n)}catch(t){i.error=t,i.hasError=!0}finally{bC(i)}}}var FC=function(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(s=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e},PC=function(t){return function(e){function n(n){e.error=e.hasError?new t(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(t,(function(e){return n(e),t()}))}catch(t){n(t)}}if(e.hasError)throw e.error}()}}("function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i});const kC="/.deleted";class VC extends qM{async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}constructor({writable:t,readable:e}){if(super(),this._isInitialized=!1,this._deletedFiles=new Set,this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this.writable=t,this.readable=e,this.writable.metadata().readonly)throw new IO(cO.EINVAL,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:YC.name}}async sync(t,e,n){await this.copyForWrite(t),await this.writable.exists(t)||await this.writable.createFile(t,"w",420),await this.writable.sync(t,e,n)}syncSync(t,e,n){this.copyForWriteSync(t),this.writable.syncSync(t,e,n)}async _initialize(){if(!this._isInitialized){try{const t=await this.writable.openFile(kC,xM("r")),{size:e}=await t.stat(),{buffer:n}=await t.read(new Uint8Array(e));this._deleteLog=LO(n)}catch(t){if(t.errno!==cO.ENOENT)throw t}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(t){this._deleteLog=t,this._reparseDeletionLog(),await this.updateLog("")}async rename(t,e){this.checkInitialized(),this.checkPath(t),this.checkPath(e),await this.copyForWrite(t);try{await this.writable.rename(t,e)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"rename")}}renameSync(t,e){this.checkInitialized(),this.checkPath(t),this.checkPath(e),this.copyForWriteSync(t);try{this.writable.renameSync(t,e)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"rename")}}async stat(t){this.checkInitialized();try{return await this.writable.stat(t)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"stat");const e=await this.readable.stat(t);return e.mode|=146,e}}statSync(t){this.checkInitialized();try{return this.writable.statSync(t)}catch{if(this._deletedFiles.has(t))throw IO.With("ENOENT",t,"stat");const e=this.readable.statSync(t);return e.mode|=146,e}}async openFile(t,e){if(await this.writable.exists(t))return this.writable.openFile(t,e);const n=await this.readable.openFile(t,xM("r")),i=await n.stat(),{buffer:s}=await n.read(new Uint8Array(i.size));return new jM(this,t,e,i,s)}openFileSync(t,e){if(this.writable.existsSync(t))return this.writable.openFileSync(t,e);const n=this.readable.openFileSync(t,xM("r")),i=n.statSync(),s=new Uint8Array(i.size);return n.readSync(s),new jM(this,t,e,i,s)}async createFile(t,e,n){return this.checkInitialized(),await this.writable.createFile(t,e,n),this.openFile(t,e)}createFileSync(t,e,n){return this.checkInitialized(),this.writable.createFileSync(t,e,n),this.openFileSync(t,e)}async link(t,e){this.checkInitialized(),await this.copyForWrite(t),await this.writable.link(t,e)}linkSync(t,e){this.checkInitialized(),this.copyForWriteSync(t),this.writable.linkSync(t,e)}async unlink(t){if(this.checkInitialized(),this.checkPath(t),!await this.exists(t))throw IO.With("ENOENT",t,"unlink");await this.writable.exists(t)&&await this.writable.unlink(t),await this.exists(t)&&await this.deletePath(t)}unlinkSync(t){if(this.checkInitialized(),this.checkPath(t),!this.existsSync(t))throw IO.With("ENOENT",t,"unlink");this.writable.existsSync(t)&&this.writable.unlinkSync(t),this.existsSync(t)&&this.deletePath(t)}async rmdir(t){if(this.checkInitialized(),!await this.exists(t))throw IO.With("ENOENT",t,"rmdir");if(await this.writable.exists(t)&&await this.writable.rmdir(t),await this.exists(t)){if((await this.readdir(t)).length)throw IO.With("ENOTEMPTY",t,"rmdir");await this.deletePath(t)}}rmdirSync(t){if(this.checkInitialized(),!this.existsSync(t))throw IO.With("ENOENT",t,"rmdir");if(this.writable.existsSync(t)&&this.writable.rmdirSync(t),this.existsSync(t)){if(this.readdirSync(t).length)throw IO.With("ENOTEMPTY",t,"rmdir");this.deletePath(t)}}async mkdir(t,e){if(this.checkInitialized(),await this.exists(t))throw IO.With("EEXIST",t,"mkdir");await this.createParentDirectories(t),await this.writable.mkdir(t,e)}mkdirSync(t,e){if(this.checkInitialized(),this.existsSync(t))throw IO.With("EEXIST",t,"mkdir");this.createParentDirectoriesSync(t),this.writable.mkdirSync(t,e)}async readdir(t){this.checkInitialized();const e=[];try{e.push(...await this.writable.readdir(t))}catch{}try{e.push(...(await this.readable.readdir(t)).filter((e=>!this._deletedFiles.has(`${t}/${e}`))))}catch{}const n={};return e.filter((t=>{const e=!n[t];return n[t]=!0,e}))}readdirSync(t){this.checkInitialized();let e=[];try{e=e.concat(this.writable.readdirSync(t))}catch{}try{e=e.concat(this.readable.readdirSync(t).filter((e=>!this._deletedFiles.has(`${t}/${e}`))))}catch{}const n={};return e.filter((t=>{const e=!n[t];return n[t]=!0,e}))}async deletePath(t){this._deletedFiles.add(t),await this.updateLog(`d${t}\n`)}async updateLog(t){if(this._deleteLog+=t,this._deleteLogUpdatePending)return void(this._deleteLogUpdateNeeded=!0);this._deleteLogUpdatePending=!0;const e=await this.writable.openFile(kC,xM("w"));try{await e.write(SO(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(t){this._deleteLogError=t}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(const t of this._deleteLog.split("\n"))t.startsWith("d")&&this._deletedFiles.add(t.slice(1))}checkInitialized(){if(!this._isInitialized)throw new IO(cO.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;const t=this._deleteLogError;throw delete this._deleteLogError,t}checkPath(t){if(t==kC)throw IO.With("EPERM",t,"checkPath")}createParentDirectoriesSync(t){let e=OO(t);const n=[];for(;!this.writable.existsSync(e);)n.push(e),e=OO(e);for(const t of n.reverse())this.writable.mkdirSync(t,this.statSync(t).mode)}async createParentDirectories(t){let e=OO(t);const n=[];for(;!await this.writable.exists(e);)n.push(e),e=OO(e);for(const t of n.reverse()){const e=await this.stat(t);await this.writable.mkdir(t,e.mode)}}copyForWriteSync(t){if(!this.existsSync(t))throw IO.With("ENOENT",t,"copyForWrite");this.writable.existsSync(OO(t))||this.createParentDirectoriesSync(t),this.writable.existsSync(t)||this.copyToWritableSync(t)}async copyForWrite(t){if(!await this.exists(t))throw IO.With("ENOENT",t,"copyForWrite");if(await this.writable.exists(OO(t))||await this.createParentDirectories(t),!await this.writable.exists(t))return this.copyToWritable(t)}copyToWritableSync(t){const e={stack:[],error:void 0,hasError:!1};try{const n=this.statSync(t);if(n.isDirectory())return void this.writable.mkdirSync(t,n.mode);const i=new Uint8Array(n.size);FC(e,this.readable.openFileSync(t,"r"),!1).readSync(i);FC(e,this.writable.createFileSync(t,"w",146|n.mode),!1).writeSync(i)}catch(t){e.error=t,e.hasError=!0}finally{PC(e)}}async copyToWritable(t){const e={stack:[],error:void 0,hasError:!1};try{const n=await this.stat(t);if(n.isDirectory())return void await this.writable.mkdir(t,n.mode);const i=new Uint8Array(n.size),s=FC(e,await this.readable.openFile(t,"r"),!0);await s.read(i);const o=FC(e,await this.writable.createFile(t,"w",146|n.mode),!0);await o.write(i)}catch(t){e.error=t,e.hasError=!0}finally{const t=PC(e);t&&await t}}}class YC extends(function(t){return class extends wC{constructor(...e){super(),this._fs=new t(...e)}}}(VC)){}function xC(t,e,n){if(t instanceof IO)return t;const i=t instanceof DOMException?cO[function(t){switch(t.name){case"IndexSizeError":case"HierarchyRequestError":case"InvalidCharacterError":case"InvalidStateError":case"SyntaxError":case"NamespaceError":case"TypeMismatchError":case"ConstraintError":case"VersionError":case"URLMismatchError":case"InvalidNodeTypeError":return"EINVAL";case"WrongDocumentError":return"EXDEV";case"NoModificationAllowedError":case"InvalidModificationError":case"InvalidAccessError":case"SecurityError":case"NotAllowedError":return"EACCES";case"NotFoundError":return"ENOENT";case"NotSupportedError":return"ENOTSUP";case"InUseAttributeError":return"EBUSY";case"NetworkError":return"ENETDOWN";case"AbortError":return"EINTR";case"QuotaExceededError":return"ENOSPC";case"TimeoutError":return"ETIMEDOUT";case"ReadOnlyError":return"EROFS";default:return"EIO"}}(t)]:cO.EIO,s=new IO(i,t.message,e,n);return s.stack=t.stack,s.cause=t.cause,s}globalThis.__zenfs__=st;class UC extends(yC(qM)){constructor(t){super(),this._handles=new Map,this._sync=CR.create({name:"accessfs-cache"}),this._handles.set("/",t)}metadata(){return{...super.metadata(),name:"WebAccess",noResizableBuffers:!0}}async sync(t,e){await this.writeFile(t,e)}async rename(t,e){const n=await this.getHandle(t);if(n instanceof FileSystemDirectoryHandle){const n=await this.readdir(t);if(await this.mkdir(e),!n.length)return void await this.unlink(t);for(const i of n)await this.rename(gO(t,i),gO(e,i)),await this.unlink(t);return}if(!(n instanceof FileSystemFileHandle))throw new IO(cO.ENOTSUP,"Not a file or directory handle",t,"rename");const i=await n.getFile().catch((e=>{throw xC(e,t,"rename")})),s=await this.getHandle(OO(e));if(!(s instanceof FileSystemDirectoryHandle))return;const o=await s.getFileHandle(MO(e),{create:!0}).catch((t=>{throw xC(t,e,"rename")})),r=await o.createWritable();await r.write(await i.arrayBuffer()),await r.close(),await this.unlink(t)}async writeFile(t,e){if(e.buffer.resizable)throw new IO(cO.EINVAL,"Resizable buffers can not be written",t,"write");const n=await this.getHandle(OO(t));if(!(n instanceof FileSystemDirectoryHandle))return;const i=await n.getFileHandle(MO(t),{create:!0}),s=await i.createWritable();await s.write(e),await s.close()}async createFile(t,e){return await this.writeFile(t,new Uint8Array),this.openFile(t,e)}async stat(t){const e=await this.getHandle(t);if(!e)throw IO.With("ENOENT",t,"stat");if(e instanceof FileSystemDirectoryHandle)return new FM({mode:511|_M,size:4096});if(e instanceof FileSystemFileHandle){const{lastModified:t,size:n}=await e.getFile();return new FM({mode:511|uM,size:n,mtimeMs:t})}throw new IO(cO.EBADE,"Handle is not a directory or file",t,"stat")}async openFile(t,e){const n=await this.getHandle(t);if(!(n instanceof FileSystemFileHandle))throw IO.With("EISDIR",t,"openFile");const i=await n.getFile().catch((e=>{throw xC(e,t,"openFile")})),s=new Uint8Array(await i.arrayBuffer()),o=new FM({mode:511|uM,size:i.size,mtimeMs:i.lastModified});return new jM(this,t,e,o,s)}async unlink(t){const e=await this.getHandle(OO(t));if(!(e instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",OO(t),"unlink");await e.removeEntry(MO(t),{recursive:!0}).catch((e=>{throw xC(e,t,"unlink")}))}async link(t){}async rmdir(t){return this.unlink(t)}async mkdir(t){if(await this.getHandle(t).catch((t=>{if("ENOENT"!=t.code)throw t})))throw IO.With("EEXIST",t,"mkdir");const e=await this.getHandle(OO(t));if(!(e instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",t,"mkdir");await e.getDirectoryHandle(MO(t),{create:!0})}async readdir(t){const e=await this.getHandle(t);if(!(e instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",t,"readdir");const n=[];for await(const t of e.keys())n.push(t);return n}async getHandle(t){if(this._handles.has(t))return this._handles.get(t);let e="/";for(const n of t.split("/").slice(1)){const t=this._handles.get(e);if(!(t instanceof FileSystemDirectoryHandle))throw IO.With("ENOTDIR",e,"getHandle");e=gO(e,n);const i=await t.getDirectoryHandle(n).catch((i=>{switch(i.name){case"TypeMismatchError":return t.getFileHandle(n).catch((t=>{}));case"TypeError":throw new IO(cO.ENOENT,i.message,e,"getHandle");default:throw xC(i,e,"getHandle")}}));i&&this._handles.set(e,i)}return this._handles.get(t)}}function BC(t){return new Promise(((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)}))}let XC;function GC(){return XC||(XC=function(t,e){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);const i=BC(n);return(t,n)=>i.then((i=>n(i.transaction(e,t).objectStore(e))))}("keyval-store","keyval")),XC}class HC extends UC{constructor(t){super(t)}async readFile(t){const e=await this.getHandle(t);if(e instanceof window.FileSystemFileHandle){const t=await e.getFile();return await t.text()}return""}}class WC extends rt.FS{#t=null;#e=new TextEncoder;constructor(){super()}async showDirectoryPicker(){const t=await window.showDirectoryPicker({mode:"readwrite"});if("granted"!==await t.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return await this.setFSCache(t),this.#t=new HC(t),t}async loadFS(){let t=await this.getFSCache();if(!t)return null;if("granted"!==await t.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return this.#t=new HC(t),t}async getFSCache(){return function(t,e=GC()){return e("readonly",(e=>BC(e.get(t))))}("mixly-pyodide-fs")}async setFSCache(t){await function(t,e,n=GC()){return n("readwrite",(n=>(n.put(e,t),BC(n.transaction))))}("mixly-pyodide-fs",t)}async createFile(t){return this.#t.createFile(t,"")}async readFile(t){return this.#t.readFile(t)}async writeFile(t,e){const n=this.#e.encode(e);return this.#t.writeFile(t,n)}async isFile(t){const e=await this.#t.stat(t);return!(!e||33279!==e.mode)}async renameFile(t,e){return await this.#t.rename(t,e)}async moveFile(t,e){return this.renameFile(t,e)}async deleteFile(t){return this.#t.unlink(t)}async createDirectory(t){return this.#t.mkdir(t,511)}async readDirectory(t){return await this.#t.readdir(t)}async isDirectory(t){const e=await this.#t.stat(t);return!(!e||16895!==e.mode)}async isDirectoryEmpty(t){const e=await this.readDirectory(t);return!e?.length}async renameDirectory(t,e){return this.#t.rename(t,e)}async moveDirectory(t,e){return this.#t.rename(t,e)}async deleteDirectory(t){return this.#t.rmdir(t)}}class KC extends rt.FileTree{constructor(){super(new WC)}async readFolder(t){let e=[];try{const n=this.getFS();if(!await n.isDirectory(t))return e;const i=await n.readDirectory(t);for(let s of i){const i=aO.join(t,s);if(await n.isDirectory(i)){const t=await n.isDirectoryEmpty(i);e.push({type:"folder",id:i,children:!t,title:`/${this.getRootFolderName()}${i}`})}else e.push({type:"file",id:i,children:!1,title:`/${this.getRootFolderName()}${i}`})}}catch(t){rt.Debug.error(t)}return e}}class jC extends rt.PageBase{static{rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem.html",new rt.HTMLTemplate('\r\n
\r\n
\r\n
\r\n
')),rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem-open-fs.html",new rt.HTMLTemplate('\r\n
\r\n \r\n
')),rt.HTMLTemplate.add("html/statusbar/statusbar-filesystem-editor-empty.html",new rt.HTMLTemplate('\r\n
\r\n
\r\n
')),this.init=function(){rt.StatusBarsManager.typesRegistry.register(["file-system"],jC);const t=rt.Workspace.getMain().getStatusBarsManager();return t.add("file-system","file-system",ot.Msg.PYTHON_PYODIDE_FILE_SYSTEM),t.changeTo("output"),t.get("file-system")}}#n=null;#i=null;#s=null;#o=null;#r=null;#a=null;#l=null;#u=null;#p=!1;#_=!1;#d=!1;#h=null;constructor(){super();const t=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem.html").render());this.setContent(t),this.#l=new KC,this.#i=t.children(".file-tree"),this.#o=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem-open-fs.html").render({msg:{loadFS:ot.Msg.PYTHON_PYODIDE_LOAD_FILE_SYSTEM}})),this.#i.append(this.#o),this.#a=new rt.StatusBar,this.#s=t.children(".editor"),this.#r=uO()(rt.HTMLTemplate.get("html/statusbar/statusbar-filesystem-editor-empty.html").render()),this.#s.append(this.#r)}#c(){this.#u=new rt.DragV(this.getContent()[0],{min:"150px",startSize:"15%",full:[!1,!1]}),this.#u.bind("sizeChanged",(()=>{this.resize()})),this.#o.children("button").click((()=>{this.selectFS().catch(rt.Debug.error)})),this.#l.bind("beforeSelectLeaf",(t=>{const e=t[0].id,n=this.#a.getFileMode(aO.extname(e));return n?(this.#a.setMode(n),!0):(hO.layer.msg(rt.Msg.Lang["statusbar.ampy.cannotEdit"],{time:1e3}),!1)})),this.#l.bind("afterSelectLeaf",(async t=>{const e=t[0].id;this.#l.showProgress();const n=this.#l.getFS();try{const t=await n.readFile(e);this.showEditor(),this.#a.setValue(t),this.#a.scrollToTop(),this.#a.focus(),this.setStatus(!1)}catch(t){rt.Debug.error(t),this.hideEditor(),this.#l.deselectAll()}this.#l.hideProgress()})),this.#l.bind("afterCreateNode",(t=>{this.#l.refreshFolder(t)})),this.#l.bind("afterDeleteNode",(t=>{this.#l.refreshFolder(t)})),this.#l.bind("afterRenameNode",(t=>{this.#l.refreshFolder(t)})),this.#l.bind("afterRefreshNode",(()=>{this.#l.getSelectedNodeId()||this.hideEditor()}));const t=this.#l.getContextMenu().getItem("menu");t.add({weight:7,type:"copy_path",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["fileTree.copyPath"],""),callback:(t,{$trigger:e})=>{let n=null;n="root"===e.attr("type")?this.#l.getRootFolderTitle():e.attr("title"),navigator.clipboard.writeText(n).catch(rt.Debug.error)}}}),t.add({weight:14,type:"sep5",preconditionFn:t=>{const e=this.#l.getSelectedNodeId();let n=t.attr("type"),i=t.attr("id");return"file"!==n||e===i},data:"---------"}),t.add({weight:15,type:"refresh",preconditionFn:t=>{const e=this.#l.getSelectedNodeId();let n=t.attr("type"),i=t.attr("id");return"file"!==n||e===i},data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["statusbar.ampy.refresh"],""),callback:(t,{$trigger:e})=>{let n=e.attr("type");if("root"===n)this.#l.openRootFolder(),this.#l.refreshFolder("/");else if("folder"===n){let t=e.attr("id");this.#l.openNode(t),this.#l.refreshFolder(t)}else{const t=this.#l.getSelectedNodes();this.#l.runEvent("afterSelectLeaf",t)}}}}),t.add({weight:16,type:"sep6",preconditionFn:t=>{let e=t.attr("type");return["root"].includes(e)},data:"---------"}),t.add({weight:17,type:"exit",preconditionFn:t=>{let e=t.attr("type");return["root"].includes(e)},data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["statusbar.ampy.exit"],""),callback:()=>{this.closeFS()}}}),t.remove("copy"),t.remove("cut"),t.remove("paste"),t.remove("sep2");const e=this.#a.getContextMenu().getItem("code");e.empty(),e.add({weight:0,type:"cut",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.cut"],"Ctrl+X"),callback:()=>this.#a.cut()}}),e.add({weight:1,type:"copy",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.copy"],"Ctrl+C"),callback:()=>this.#a.copy()}}),e.add({weight:2,type:"paste",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.paste"],"Ctrl+V"),callback:()=>this.#a.paste()}}),e.add({weight:3,type:"sep1",data:"---------"}),e.add({weight:4,type:"togglecomment",data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["editor.contextMenu.togglecomment"],"Ctrl+/"),callback:()=>this.#a.commentLine()}}),e.add({weight:6,type:"sep2",preconditionFn:()=>this.#d,data:"---------"}),e.add({weight:7,type:"save",preconditionFn:()=>this.#d,data:{isHtmlName:!0,name:rt.ContextMenu.getItem(rt.Msg.Lang["file.save"],"Ctrl+S"),callback:async()=>{await this.put()}}});const{commands:n}=this.#a.getEditor();n.addCommand({name:"save",bindKey:"Ctrl-S",exec:async()=>{this.#d&&await this.put()}})}async put(){this.#l.showProgress();const t=this.#l.getSelectedNodeId(),e=this.#l.getFS();try{await e.writeFile(t,this.#a.getValue()),this.setStatus(!1)}catch(t){rt.Debug.error(t)}finally{this.#l.hideProgress()}}showFileTree(){this.#p||(this.#o.detach(),this.#i.empty(),this.#i.append(this.#l.getContent()),this.#p=!0)}hideFileTree(){this.#p&&(this.#l.getContent().detach(),this.#i.empty(),this.#i.append(this.#o),this.#p=!1)}showEditor(){this.#_||(this.#r.detach(),this.#s.empty(),this.#s.append(this.#a.getContent()),this.#_=!0)}hideEditor(){this.#_&&(this.#a.getContent().detach(),this.#s.empty(),this.#s.append(this.#r),this.#_=!1,this.setStatus(!1))}getDrag(){return this.#u}init(){super.init(),this.hideCloseBtn(),this.#a.init(),this.#c();const t=this.#a.getEditor();t.setReadOnly(!1),t.renderer.setShowGutter(!0),t.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,newLineMode:"unix"}),t.on("change",(()=>{this.setStatus(!0)})),this.loadFS().catch(rt.Debug.error)}async loadFS(){const t=this.#l.getFS(),e=await t.loadFS();await this.openFS(e)}async selectFS(){const t=this.#l.getFS(),e=await t.showDirectoryPicker();await this.openFS(e)}async openFS(t){if(!t?.name)return;const e="/"+t.name;this.#l.setFolderPath("/"),this.#l.setRootFolderTitle(e),this.#l.setRootFolderName(t.name),this.#l.openRootFolder(),this.showFileTree(),this.#h=await window.pyodide.mountNativeFS(e,t)}closeFS(){const t=this.#l.getRootFolderTitle();if(Object.keys(window.pyodide.FS.root.contents).includes(aO.basename(t))){const e=window.pyodide.FS.lookupPath(t,{follow_mount:!1});window.pyodide.FS.isMountpoint(e.node)&&window.pyodide.FS.unmount(t)}this.#l.getFS().setFSCache(null),this.#l.deselectAll(),this.hideFileTree(),this.hideEditor(),this.setStatus(!1)}onMounted(){super.onMounted(),this.#a.onMounted(),this.#l.onMounted()}onUnmounted(){super.onUnmounted(),this.#a.onUnmounted(),this.#l.onUnmounted()}resize(){super.resize(),this.#a.resize(),this.#l.resize()}setStatus(t){this.#d!==t&&(this.#d=t)}getNativeFS(){return this.#h}dispose(){this.#a.dispose(),this.#a=null,this.#l.dispose(),this.#l=null,super.dispose()}}class qC{static{rt.HTMLTemplate.add("html/statusbar/loader.html",new rt.HTMLTemplate('\r\n
\r\n
\r\n

{{d.msg.loading}}

\r\n
')),this.pythonShell=null,this.kernelLoaded=!1,this.$loader=uO()(rt.HTMLTemplate.get("html/statusbar/loader.html").render({msg:{loading:ot.Msg.PYTHON_PYODIDE_LOADING}})),this.statusBarImage=null,this.statusBarFileSystem=null,this.init=async function(){rt.app.getFooterBar().getContent().after(this.$loader);const t=aO.relative(rt.Env.indexDirPath,rt.Env.boardDirPath),e=new _O({rootPath:aO.join(t,"deps"),language:"python3"}),n=await e.kernelAvailable();n&&(await n.init(),await n.loaded(),this.loader=e,this.kernel=n,this.statusBarImage=dO.init(),this.statusBarFileSystem=jC.init(),this.pythonShell=new qC,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer),this.kernelLoaded=!0,this.$loader.remove(),this.$loader=null)},this.run=async function(){if(!this.kernelLoaded)return;const t=rt.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(t)},this.stop=async function(){if(this.kernelLoaded)return this.pythonShell.stop()}}#T=null;#I=null;#m=null;#E={row:0,column:0};#f="";#g=null;#O=null;#M=!1;#R=!1;#A=null;#S=()=>this.#C();#L=[{name:"REPL-Enter",bindKey:"Enter",exec:t=>{if(t.getSession().selection.getCursor().row===this.#E.row){const t=this.#T.getEndPos();let e=this.#T.getValueRange(this.#E,t);e=e.replace(this.#f,""),this.#g?.(e),this.#g=null,this.#O=null,this.#T.addValue("\n"),this.#y()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:t=>{const e=t.getSession().selection.getCursor();return e.row{this.#R=!1,this.#T.addValue(`\n==${rt.Msg.Lang["shell.finish"]}==`),this.syncfs(!1).catch(rt.Debug.error)})),this.#A.addEventListener("eval.output",(t=>{this.#T.addValue(t.content)})),this.#A.addEventListener("eval.error",(()=>{this.#R=!1,this.#T.addValue(`\n==${rt.Msg.Lang["shell.finish"]}==`)})),this.#A.addEventListener("eval.input",(t=>{const e=String(t?.content?.prompt);this.#T.addValue(e),this.#f=e,this.#g=t.resolve,this.#O=t.reject,this.#D()})),this.#A.addEventListener("eval.display",(t=>{this.#m.changeTo("images"),this.#I.display(t)}))}#C(){const t=this.#T.getEditor(),e=t.getSession().selection.getCursor();t.setReadOnly(e.row{window.pyodide.FS.syncfs(t,e)}))}sleep(t){return new Promise((e=>setTimeout(e,t)))}}const $C={init:async function(){const t=rt.app.getNav();t.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:ot.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{qC.run().catch(rt.Debug.error)},scopeType:rt.Nav.Scope.LEFT,weight:4}),t.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:ot.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{qC.stop().catch(rt.Debug.error)},scopeType:rt.Nav.Scope.LEFT,weight:5}),await qC.init()}};$C.init(),Object.assign(ot.Variables,lt),Object.assign(ot.Procedures,Bi),ot.Python=uu,ot.generator=uu,rt.Profile.default={},Object.assign(ot.Blocks,t,e,n,i,s,o,r,a,l,u,p,_,d,C,L,y,D,N,b,v,w,F,P,k,V,Y,x,U),Object.assign(ot.Python.forBlock,h,c,T,I,m,E,f,g,O,M,R,A,S,B,X,G,um,H,W,K,j,q,z,Q,J,Z,tt,et)})()})(); \ No newline at end of file diff --git a/boards/default_src/python_pyodide/others/filesystem-fs.js b/boards/default_src/python_pyodide/others/filesystem-fs.js index 283fe452..4e974afa 100644 --- a/boards/default_src/python_pyodide/others/filesystem-fs.js +++ b/boards/default_src/python_pyodide/others/filesystem-fs.js @@ -22,6 +22,7 @@ class WebAccessFSExt extends WebAccessFS { export default class FileSystemFS extends FS { #fs_ = null; + #encoder_ = new TextEncoder(); constructor() { super(); @@ -68,7 +69,8 @@ export default class FileSystemFS extends FS { } async writeFile(path, data) { - return this.#fs_.writeFile(path, data, 'utf8'); + const encodedArray = this.#encoder_.encode(data); + return this.#fs_.writeFile(path, encodedArray); } async isFile(path) { diff --git a/boards/default_src/python_pyodide/others/statusbar-filesystem.js b/boards/default_src/python_pyodide/others/statusbar-filesystem.js index e6577716..a47c5ce4 100644 --- a/boards/default_src/python_pyodide/others/statusbar-filesystem.js +++ b/boards/default_src/python_pyodide/others/statusbar-filesystem.js @@ -330,10 +330,13 @@ export default class StatusBarFileSystem extends PageBase { this.#fileTree_.showProgress(); const id = this.#fileTree_.getSelectedNodeId(); const fs = this.#fileTree_.getFS(); - const [error,] = await fs.writeFile(id, this.#editor_.getValue()); - this.#fileTree_.hideProgress(); - if (!error) { + try { + await fs.writeFile(id, this.#editor_.getValue()); this.setStatus(false); + } catch (error) { + Debug.error(error); + } finally { + this.#fileTree_.hideProgress(); } }