2022-01-03 14:02:41 +00:00
// Do not edit this file; automatically generated.
2021-01-16 14:07:51 +00:00
/* eslint-disable */
; ( function ( root , factory ) {
if ( typeof define === 'function' && define . amd ) { // AMD
2022-01-03 14:02:41 +00:00
define ( [ "./blockly_compressed.js" ] , factory ) ;
2021-01-16 14:07:51 +00:00
} else if ( typeof exports === 'object' ) { // Node.js
2022-01-03 14:02:41 +00:00
module . exports = factory ( require ( "./blockly_compressed.js" ) ) ;
2021-01-16 14:07:51 +00:00
} else { // Browser
2022-06-07 11:14:29 +00:00
var factoryExports = factory ( root . Blockly ) ;
root . Blockly . libraryBlocks = factoryExports ;
2021-01-16 14:07:51 +00:00
}
2022-06-07 11:14:29 +00:00
} ( this , function ( _ _parent _ _ ) {
var $ = _ _parent _ _ . _ _namespace _ _ ;
2022-11-16 13:57:00 +00:00
var module$exports$Blockly$libraryBlocks$variablesDynamic = { } , module$contents$Blockly$libraryBlocks$variablesDynamic _ContextMenu = $ . module$build$src$core$contextmenu , module$contents$Blockly$libraryBlocks$variablesDynamic _Extensions = $ . module$build$src$core$extensions , module$contents$Blockly$libraryBlocks$variablesDynamic _Variables = $ . module$build$src$core$variables , module$contents$Blockly$libraryBlocks$variablesDynamic _xml = $ . module$build$src$core$utils$xml , module$contents$Blockly$libraryBlocks$variablesDynamic _BlockDefinition =
Object , module$contents$Blockly$libraryBlocks$variablesDynamic _Msg = $ . module$build$src$core$msg . Msg , module$contents$Blockly$libraryBlocks$variablesDynamic _createBlockDefinitionsFromJsonArray = $ . module$build$src$core$common . createBlockDefinitionsFromJsonArray , module$contents$Blockly$libraryBlocks$variablesDynamic _defineBlocks = $ . module$build$src$core$common . defineBlocks ;
module$exports$Blockly$libraryBlocks$variablesDynamic . blocks = module$contents$Blockly$libraryBlocks$variablesDynamic _createBlockDefinitionsFromJsonArray ( [ { type : "variables_get_dynamic" , message0 : "%1" , args0 : [ { type : "field_variable" , name : "VAR" , variable : "%{BKY_VARIABLES_DEFAULT_NAME}" } ] , output : null , style : "variable_dynamic_blocks" , helpUrl : "%{BKY_VARIABLES_GET_HELPURL}" , tooltip : "%{BKY_VARIABLES_GET_TOOLTIP}" , extensions : [ "contextMenu_variableDynamicSetterGetter" ] } , { type : "variables_set_dynamic" , message0 : "%{BKY_VARIABLES_SET}" ,
2022-06-07 11:14:29 +00:00
args0 : [ { type : "field_variable" , name : "VAR" , variable : "%{BKY_VARIABLES_DEFAULT_NAME}" } , { type : "input_value" , name : "VALUE" } ] , previousStatement : null , nextStatement : null , style : "variable_dynamic_blocks" , tooltip : "%{BKY_VARIABLES_SET_TOOLTIP}" , helpUrl : "%{BKY_VARIABLES_SET_HELPURL}" , extensions : [ "contextMenu_variableDynamicSetterGetter" ] } ] ) ;
2022-11-16 13:57:00 +00:00
var module$contents$Blockly$libraryBlocks$variablesDynamic _CUSTOM _CONTEXT _MENU _VARIABLE _GETTER _SETTER _MIXIN = { customContextMenu : function ( a ) { if ( ! this . isInFlyout ) { var b = this . getFieldValue ( "VAR" ) ; var c = this . workspace . getVariableById ( b ) . type ; if ( "variables_get_dynamic" === this . type ) { b = "variables_set_dynamic" ; var d = module$contents$Blockly$libraryBlocks$variablesDynamic _Msg . VARIABLES _GET _CREATE _SET } else b = "variables_get_dynamic" , d = module$contents$Blockly$libraryBlocks$variablesDynamic _Msg . VARIABLES _SET _CREATE _GET ;
var e = { enabled : 0 < this . workspace . remainingCapacity ( ) } ; const f = this . getField ( "VAR" ) . getText ( ) ; e . text = d . replace ( "%1" , f ) ; d = $ . module$build$src$core$utils$xml . createElement ( "field" ) ; d . setAttribute ( "name" , "VAR" ) ; d . setAttribute ( "variabletype" , c ) ; d . appendChild ( $ . module$build$src$core$utils$xml . createTextNode ( f ) ) ; c = $ . module$build$src$core$utils$xml . createElement ( "block" ) ; c . setAttribute ( "type" , b ) ; c . appendChild ( d ) ; e . callback = $ . module$build$src$core$contextmenu . callbackFactory ( this , c ) ; a . push ( e ) } else if ( "variables_get_dynamic" ===
this . type || "variables_get_reporter_dynamic" === this . type ) b = { text : module$contents$Blockly$libraryBlocks$variablesDynamic _Msg . RENAME _VARIABLE , enabled : ! 0 , callback : module$contents$Blockly$libraryBlocks$variablesDynamic _renameOptionCallbackFactory ( this ) } , e = this . getField ( "VAR" ) . getText ( ) , e = { text : module$contents$Blockly$libraryBlocks$variablesDynamic _Msg . DELETE _VARIABLE . replace ( "%1" , e ) , enabled : ! 0 , callback : module$contents$Blockly$libraryBlocks$variablesDynamic _deleteOptionCallbackFactory ( this ) } , a . unshift ( b ) ,
a . unshift ( e ) } , onchange : function ( a ) { a = this . getFieldValue ( "VAR" ) ; a = $ . module$build$src$core$variables . getVariable ( this . workspace , a ) ; "variables_get_dynamic" === this . type ? this . outputConnection . setCheck ( a . type ) : this . getInput ( "VALUE" ) . connection . setCheck ( a . type ) } } , module$contents$Blockly$libraryBlocks$variablesDynamic _renameOptionCallbackFactory = function ( a ) { return function ( ) { const b = a . workspace , c = a . getField ( "VAR" ) . getVariable ( ) ; $ . module$build$src$core$variables . renameVariable ( b , c ) } } , module$contents$Blockly$libraryBlocks$variablesDynamic _deleteOptionCallbackFactory =
function ( a ) { return function ( ) { const b = a . workspace , c = a . getField ( "VAR" ) . getVariable ( ) ; b . deleteVariableById ( c . getId ( ) ) ; b . refreshToolboxSelection ( ) } } ; $ . module$build$src$core$extensions . registerMixin ( "contextMenu_variableDynamicSetterGetter" , module$contents$Blockly$libraryBlocks$variablesDynamic _CUSTOM _CONTEXT _MENU _VARIABLE _GETTER _SETTER _MIXIN ) ; module$contents$Blockly$libraryBlocks$variablesDynamic _defineBlocks ( module$exports$Blockly$libraryBlocks$variablesDynamic . blocks ) ; var module$exports$Blockly$libraryBlocks$variables = { } , module$contents$Blockly$libraryBlocks$variables _ContextMenu = $ . module$build$src$core$contextmenu , module$contents$Blockly$libraryBlocks$variables _Extensions = $ . module$build$src$core$extensions , module$contents$Blockly$libraryBlocks$variables _Variables = $ . module$build$src$core$variables , module$contents$Blockly$libraryBlocks$variables _xmlUtils = $ . module$build$src$core$utils$xml , module$contents$Blockly$libraryBlocks$variables _BlockDefinition = Object , module$contents$Blockly$libraryBlocks$variables _Msg =
$ . module$build$src$core$msg . Msg , module$contents$Blockly$libraryBlocks$variables _createBlockDefinitionsFromJsonArray = $ . module$build$src$core$common . createBlockDefinitionsFromJsonArray , module$contents$Blockly$libraryBlocks$variables _defineBlocks = $ . module$build$src$core$common . defineBlocks ;
module$exports$Blockly$libraryBlocks$variables . blocks = module$contents$Blockly$libraryBlocks$variables _createBlockDefinitionsFromJsonArray ( [ { type : "variables_get" , message0 : "%1" , args0 : [ { type : "field_variable" , name : "VAR" , variable : "%{BKY_VARIABLES_DEFAULT_NAME}" } ] , output : null , style : "variable_blocks" , helpUrl : "%{BKY_VARIABLES_GET_HELPURL}" , tooltip : "%{BKY_VARIABLES_GET_TOOLTIP}" , extensions : [ "contextMenu_variableSetterGetter" ] } , { type : "variables_set" , message0 : "%{BKY_VARIABLES_SET}" , args0 : [ { type : "field_variable" ,
name : "VAR" , variable : "%{BKY_VARIABLES_DEFAULT_NAME}" } , { type : "input_value" , name : "VALUE" } ] , previousStatement : null , nextStatement : null , style : "variable_blocks" , tooltip : "%{BKY_VARIABLES_SET_TOOLTIP}" , helpUrl : "%{BKY_VARIABLES_SET_HELPURL}" , extensions : [ "contextMenu_variableSetterGetter" ] } ] ) ;
var module$contents$Blockly$libraryBlocks$variables _CUSTOM _CONTEXT _MENU _VARIABLE _GETTER _SETTER _MIXIN = { customContextMenu : function ( a ) { if ( ! this . isInFlyout ) { if ( "variables_get" === this . type ) { var b = "variables_set" ; var c = module$contents$Blockly$libraryBlocks$variables _Msg . VARIABLES _GET _CREATE _SET } else b = "variables_get" , c = module$contents$Blockly$libraryBlocks$variables _Msg . VARIABLES _SET _CREATE _GET ; var d = { enabled : 0 < this . workspace . remainingCapacity ( ) } , e = this . getField ( "VAR" ) . getText ( ) ; d . text = c . replace ( "%1" , e ) ;
c = $ . module$build$src$core$utils$xml . createElement ( "field" ) ; c . setAttribute ( "name" , "VAR" ) ; c . appendChild ( $ . module$build$src$core$utils$xml . createTextNode ( e ) ) ; e = $ . module$build$src$core$utils$xml . createElement ( "block" ) ; e . setAttribute ( "type" , b ) ; e . appendChild ( c ) ; d . callback = $ . module$build$src$core$contextmenu . callbackFactory ( this , e ) ; a . push ( d ) } else if ( "variables_get" === this . type || "variables_get_reporter" === this . type ) b = { text : module$contents$Blockly$libraryBlocks$variables _Msg . RENAME _VARIABLE , enabled : ! 0 , callback : module$contents$Blockly$libraryBlocks$variables _renameOptionCallbackFactory ( this ) } ,
d = this . getField ( "VAR" ) . getText ( ) , d = { text : module$contents$Blockly$libraryBlocks$variables _Msg . DELETE _VARIABLE . replace ( "%1" , d ) , enabled : ! 0 , callback : module$contents$Blockly$libraryBlocks$variables _deleteOptionCallbackFactory ( this ) } , a . unshift ( b ) , a . unshift ( d ) } } , module$contents$Blockly$libraryBlocks$variables _renameOptionCallbackFactory = function ( a ) { return function ( ) { const b = a . workspace , c = a . getField ( "VAR" ) . getVariable ( ) ; $ . module$build$src$core$variables . renameVariable ( b , c ) } } , module$contents$Blockly$libraryBlocks$variables _deleteOptionCallbackFactory =
function ( a ) { return function ( ) { const b = a . workspace , c = a . getField ( "VAR" ) . getVariable ( ) ; b . deleteVariableById ( c . getId ( ) ) ; b . refreshToolboxSelection ( ) } } ; $ . module$build$src$core$extensions . registerMixin ( "contextMenu_variableSetterGetter" , module$contents$Blockly$libraryBlocks$variables _CUSTOM _CONTEXT _MENU _VARIABLE _GETTER _SETTER _MIXIN ) ; module$contents$Blockly$libraryBlocks$variables _defineBlocks ( module$exports$Blockly$libraryBlocks$variables . blocks ) ; var module$exports$Blockly$libraryBlocks$texts = { } , module$contents$Blockly$libraryBlocks$texts _Extensions = $ . module$build$src$core$extensions , module$contents$Blockly$libraryBlocks$texts _Msg = $ . module$build$src$core$msg . Msg , module$contents$Blockly$libraryBlocks$texts _xmlUtils = $ . module$build$src$core$utils$xml , module$contents$Blockly$libraryBlocks$texts _Align = $ . Align$$module$build$src$core$input , module$contents$Blockly$libraryBlocks$texts _BlockDefinition = Object , module$contents$Blockly$libraryBlocks$texts _ConnectionType =
$ . module$build$src$core$connection _type . ConnectionType , module$contents$Blockly$libraryBlocks$texts _FieldDropdown = $ . module$build$src$core$field _dropdown . FieldDropdown , module$contents$Blockly$libraryBlocks$texts _FieldImage = $ . FieldImage$$module$build$src$core$field _image , module$contents$Blockly$libraryBlocks$texts _FieldTextInput = $ . FieldTextInput$$module$build$src$core$field _textinput , module$contents$Blockly$libraryBlocks$texts _Mutator = $ . Mutator$$module$build$src$core$mutator , module$contents$Blockly$libraryBlocks$texts _createBlockDefinitionsFromJsonArray =
$ . module$build$src$core$common . createBlockDefinitionsFromJsonArray , module$contents$Blockly$libraryBlocks$texts _defineBlocks = $ . module$build$src$core$common . defineBlocks ;
module$exports$Blockly$libraryBlocks$texts . blocks = module$contents$Blockly$libraryBlocks$texts _createBlockDefinitionsFromJsonArray ( [ { type : "text" , message0 : "%1" , args0 : [ { type : "field_input" , name : "TEXT" , text : "" } ] , output : "String" , style : "text_blocks" , helpUrl : "%{BKY_TEXT_TEXT_HELPURL}" , tooltip : "%{BKY_TEXT_TEXT_TOOLTIP}" , extensions : [ "text_quotes" , "parent_tooltip_when_inline" ] } , { type : "text_multiline" , message0 : "%1 %2" , args0 : [ { type : "field_image" , src : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=" ,
width : 12 , height : 17 , alt : "\u00b6" } , { type : "field_multilinetext" , name : "TEXT" , text : "" } ] , output : "String" , style : "text_blocks" , helpUrl : "%{BKY_TEXT_TEXT_HELPURL}" , tooltip : "%{BKY_TEXT_TEXT_TOOLTIP}" , extensions : [ "parent_tooltip_when_inline" ] } , { type : "text_join" , message0 : "" , output : "String" , style : "text_blocks" , helpUrl : "%{BKY_TEXT_JOIN_HELPURL}" , tooltip : "%{BKY_TEXT_JOIN_TOOLTIP}" , mutator : "text_join_mutator" } , { type : "text_create_join_container" , message0 : "%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2" , args0 : [ { type : "input_dummy" } ,
2021-01-16 14:07:51 +00:00
{ type : "input_statement" , name : "STACK" } ] , style : "text_blocks" , tooltip : "%{BKY_TEXT_CREATE_JOIN_TOOLTIP}" , enableContextMenu : ! 1 } , { type : "text_create_join_item" , message0 : "%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}" , previousStatement : null , nextStatement : null , style : "text_blocks" , tooltip : "%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}" , enableContextMenu : ! 1 } , { type : "text_append" , message0 : "%{BKY_TEXT_APPEND_TITLE}" , args0 : [ { type : "field_variable" , name : "VAR" , variable : "%{BKY_TEXT_APPEND_VARIABLE}" } , { type : "input_value" , name : "TEXT" } ] ,
previousStatement : null , nextStatement : null , style : "text_blocks" , extensions : [ "text_append_tooltip" ] } , { type : "text_length" , message0 : "%{BKY_TEXT_LENGTH_TITLE}" , args0 : [ { type : "input_value" , name : "VALUE" , check : [ "String" , "Array" ] } ] , output : "Number" , style : "text_blocks" , tooltip : "%{BKY_TEXT_LENGTH_TOOLTIP}" , helpUrl : "%{BKY_TEXT_LENGTH_HELPURL}" } , { type : "text_isEmpty" , message0 : "%{BKY_TEXT_ISEMPTY_TITLE}" , args0 : [ { type : "input_value" , name : "VALUE" , check : [ "String" , "Array" ] } ] , output : "Boolean" , style : "text_blocks" , tooltip : "%{BKY_TEXT_ISEMPTY_TOOLTIP}" ,
helpUrl : "%{BKY_TEXT_ISEMPTY_HELPURL}" } , { type : "text_indexOf" , message0 : "%{BKY_TEXT_INDEXOF_TITLE}" , args0 : [ { type : "input_value" , name : "VALUE" , check : "String" } , { type : "field_dropdown" , name : "END" , options : [ [ "%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}" , "FIRST" ] , [ "%{BKY_TEXT_INDEXOF_OPERATOR_LAST}" , "LAST" ] ] } , { type : "input_value" , name : "FIND" , check : "String" } ] , output : "Number" , style : "text_blocks" , helpUrl : "%{BKY_TEXT_INDEXOF_HELPURL}" , inputsInline : ! 0 , extensions : [ "text_indexOf_tooltip" ] } , { type : "text_charAt" , message0 : "%{BKY_TEXT_CHARAT_TITLE}" ,
args0 : [ { type : "input_value" , name : "VALUE" , check : "String" } , { type : "field_dropdown" , name : "WHERE" , options : [ [ "%{BKY_TEXT_CHARAT_FROM_START}" , "FROM_START" ] , [ "%{BKY_TEXT_CHARAT_FROM_END}" , "FROM_END" ] , [ "%{BKY_TEXT_CHARAT_FIRST}" , "FIRST" ] , [ "%{BKY_TEXT_CHARAT_LAST}" , "LAST" ] , [ "%{BKY_TEXT_CHARAT_RANDOM}" , "RANDOM" ] ] } ] , output : "String" , style : "text_blocks" , helpUrl : "%{BKY_TEXT_CHARAT_HELPURL}" , inputsInline : ! 0 , mutator : "text_charAt_mutator" } ] ) ;
2022-11-16 13:57:00 +00:00
module$exports$Blockly$libraryBlocks$texts . blocks . text _getSubstring = { init : function ( ) { this . WHERE _OPTIONS _1 = [ [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _START _FROM _START , "FROM_START" ] , [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _START _FROM _END , "FROM_END" ] , [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _START _FIRST , "FIRST" ] ] ; this . WHERE _OPTIONS _2 = [ [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _END _FROM _START , "FROM_START" ] ,
[ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _END _FROM _END , "FROM_END" ] , [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _END _LAST , "LAST" ] ] ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _HELPURL ) ; this . setStyle ( "text_blocks" ) ; this . appendValueInput ( "STRING" ) . setCheck ( "String" ) . appendField ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _INPUT _IN _TEXT ) ; this . appendDummyInput ( "AT1" ) ; this . appendDummyInput ( "AT2" ) ;
module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _TAIL && this . appendDummyInput ( "TAIL" ) . appendField ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _TAIL ) ; this . setInputsInline ( ! 0 ) ; this . setOutput ( ! 0 , "String" ) ; this . updateAt _ ( 1 , ! 0 ) ; this . updateAt _ ( 2 , ! 0 ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _TOOLTIP ) } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; var b = this . getInput ( "AT1" ) . type ===
$ . module$build$src$core$connection _type . ConnectionType . INPUT _VALUE ; a . setAttribute ( "at1" , b ) ; b = this . getInput ( "AT2" ) . type === $ . module$build$src$core$connection _type . ConnectionType . INPUT _VALUE ; a . setAttribute ( "at2" , b ) ; return a } , domToMutation : function ( a ) { const b = "true" === a . getAttribute ( "at1" ) ; a = "true" === a . getAttribute ( "at2" ) ; this . updateAt _ ( 1 , b ) ; this . updateAt _ ( 2 , a ) } , updateAt _ : function ( a , b ) { this . removeInput ( "AT" + a ) ; this . removeInput ( "ORDINAL" + a , ! 0 ) ; b ? ( this . appendValueInput ( "AT" + a ) . setCheck ( "Number" ) , module$contents$Blockly$libraryBlocks$texts _Msg . ORDINAL _NUMBER _SUFFIX &&
this . appendDummyInput ( "ORDINAL" + a ) . appendField ( module$contents$Blockly$libraryBlocks$texts _Msg . ORDINAL _NUMBER _SUFFIX ) ) : this . appendDummyInput ( "AT" + a ) ; 2 === a && module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _TAIL && ( this . removeInput ( "TAIL" , ! 0 ) , this . appendDummyInput ( "TAIL" ) . appendField ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _GET _SUBSTRING _TAIL ) ) ; const c = new module$contents$Blockly$libraryBlocks$texts _FieldDropdown ( this [ "WHERE_OPTIONS_" + a ] , function ( d ) { const e = "FROM_START" ===
d || "FROM_END" === d ; if ( e !== b ) { const f = this . getSourceBlock ( ) ; f . updateAt _ ( a , e ) ; f . setFieldValue ( d , "WHERE" + a ) ; return null } } ) ; this . getInput ( "AT" + a ) . appendField ( c , "WHERE" + a ) ; 1 === a && ( this . moveInputBefore ( "AT1" , "AT2" ) , this . getInput ( "ORDINAL1" ) && this . moveInputBefore ( "ORDINAL1" , "AT2" ) ) } } ;
module$exports$Blockly$libraryBlocks$texts . blocks . text _changeCase = { init : function ( ) { const a = [ [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _CHANGECASE _OPERATOR _UPPERCASE , "UPPERCASE" ] , [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _CHANGECASE _OPERATOR _LOWERCASE , "LOWERCASE" ] , [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _CHANGECASE _OPERATOR _TITLECASE , "TITLECASE" ] ] ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _CHANGECASE _HELPURL ) ; this . setStyle ( "text_blocks" ) ;
this . appendValueInput ( "TEXT" ) . setCheck ( "String" ) . appendField ( new module$contents$Blockly$libraryBlocks$texts _FieldDropdown ( a ) , "CASE" ) ; this . setOutput ( ! 0 , "String" ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _CHANGECASE _TOOLTIP ) } } ;
module$exports$Blockly$libraryBlocks$texts . blocks . text _trim = { init : function ( ) { const a = [ [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _TRIM _OPERATOR _BOTH , "BOTH" ] , [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _TRIM _OPERATOR _LEFT , "LEFT" ] , [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _TRIM _OPERATOR _RIGHT , "RIGHT" ] ] ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _TRIM _HELPURL ) ; this . setStyle ( "text_blocks" ) ; this . appendValueInput ( "TEXT" ) . setCheck ( "String" ) . appendField ( new module$contents$Blockly$libraryBlocks$texts _FieldDropdown ( a ) ,
"MODE" ) ; this . setOutput ( ! 0 , "String" ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _TRIM _TOOLTIP ) } } ; module$exports$Blockly$libraryBlocks$texts . blocks . text _print = { init : function ( ) { this . jsonInit ( { message0 : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PRINT _TITLE , args0 : [ { type : "input_value" , name : "TEXT" } ] , previousStatement : null , nextStatement : null , style : "text_blocks" , tooltip : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PRINT _TOOLTIP , helpUrl : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PRINT _HELPURL } ) } } ;
var module$contents$Blockly$libraryBlocks$texts _TEXT _PROMPT _COMMON = { updateType _ : function ( a ) { this . outputConnection . setCheck ( "NUMBER" === a ? "Number" : "String" ) } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; a . setAttribute ( "type" , this . getFieldValue ( "TYPE" ) ) ; return a } , domToMutation : function ( a ) { this . updateType _ ( a . getAttribute ( "type" ) ) } } ;
module$exports$Blockly$libraryBlocks$texts . blocks . text _prompt _ext = Object . assign ( { } , module$contents$Blockly$libraryBlocks$texts _TEXT _PROMPT _COMMON , { init : function ( ) { var a = [ [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _TYPE _TEXT , "TEXT" ] , [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _TYPE _NUMBER , "NUMBER" ] ] ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _HELPURL ) ; this . setStyle ( "text_blocks" ) ; const b = this ; a = new module$contents$Blockly$libraryBlocks$texts _FieldDropdown ( a ,
function ( c ) { b . updateType _ ( c ) } ) ; this . appendValueInput ( "TEXT" ) . appendField ( a , "TYPE" ) ; this . setOutput ( ! 0 , "String" ) ; this . setTooltip ( function ( ) { return "TEXT" === b . getFieldValue ( "TYPE" ) ? module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _TOOLTIP _TEXT : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _TOOLTIP _NUMBER } ) } } ) ;
module$exports$Blockly$libraryBlocks$texts . blocks . text _prompt = Object . assign ( { } , module$contents$Blockly$libraryBlocks$texts _TEXT _PROMPT _COMMON , { init : function ( ) { this . mixin ( module$contents$Blockly$libraryBlocks$texts _QUOTE _IMAGE _MIXIN ) ; var a = [ [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _TYPE _TEXT , "TEXT" ] , [ module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _TYPE _NUMBER , "NUMBER" ] ] ; const b = this ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _HELPURL ) ;
this . setStyle ( "text_blocks" ) ; a = new module$contents$Blockly$libraryBlocks$texts _FieldDropdown ( a , function ( c ) { b . updateType _ ( c ) } ) ; this . appendDummyInput ( ) . appendField ( a , "TYPE" ) . appendField ( this . newQuote _ ( ! 0 ) ) . appendField ( new $ . FieldTextInput$$module$build$src$core$field _textinput ( "" ) , "TEXT" ) . appendField ( this . newQuote _ ( ! 1 ) ) ; this . setOutput ( ! 0 , "String" ) ; this . setTooltip ( function ( ) { return "TEXT" === b . getFieldValue ( "TYPE" ) ? module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _TOOLTIP _TEXT : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _PROMPT _TOOLTIP _NUMBER } ) } } ) ;
module$exports$Blockly$libraryBlocks$texts . blocks . text _count = { init : function ( ) { this . jsonInit ( { message0 : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _COUNT _MESSAGE0 , args0 : [ { type : "input_value" , name : "SUB" , check : "String" } , { type : "input_value" , name : "TEXT" , check : "String" } ] , output : "Number" , inputsInline : ! 0 , style : "text_blocks" , tooltip : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _COUNT _TOOLTIP , helpUrl : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _COUNT _HELPURL } ) } } ;
module$exports$Blockly$libraryBlocks$texts . blocks . text _replace = { init : function ( ) { this . jsonInit ( { message0 : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _REPLACE _MESSAGE0 , args0 : [ { type : "input_value" , name : "FROM" , check : "String" } , { type : "input_value" , name : "TO" , check : "String" } , { type : "input_value" , name : "TEXT" , check : "String" } ] , output : "String" , inputsInline : ! 0 , style : "text_blocks" , tooltip : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _REPLACE _TOOLTIP , helpUrl : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _REPLACE _HELPURL } ) } } ;
module$exports$Blockly$libraryBlocks$texts . blocks . text _reverse = { init : function ( ) { this . jsonInit ( { message0 : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _REVERSE _MESSAGE0 , args0 : [ { type : "input_value" , name : "TEXT" , check : "String" } ] , output : "String" , inputsInline : ! 0 , style : "text_blocks" , tooltip : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _REVERSE _TOOLTIP , helpUrl : module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _REVERSE _HELPURL } ) } } ;
2022-06-07 11:14:29 +00:00
var module$contents$Blockly$libraryBlocks$texts _QUOTE _IMAGE _MIXIN = { QUOTE _IMAGE _LEFT _DATAURI : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC" , QUOTE _IMAGE _RIGHT _DATAURI : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==" ,
2022-11-16 13:57:00 +00:00
QUOTE _IMAGE _WIDTH : 12 , QUOTE _IMAGE _HEIGHT : 12 , quoteField _ : function ( a ) { for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( let d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) if ( a === e . name ) { c . insertFieldAt ( d , this . newQuote _ ( ! 0 ) ) ; c . insertFieldAt ( d + 2 , this . newQuote _ ( ! 1 ) ) ; return } console . warn ( 'field named "' + a + '" not found in ' + this . toDevString ( ) ) } , newQuote _ : function ( a ) { a = this . RTL ? ! a : a ; return new $ . FieldImage$$module$build$src$core$field _image ( a ? this . QUOTE _IMAGE _LEFT _DATAURI : this . QUOTE _IMAGE _RIGHT _DATAURI , this . QUOTE _IMAGE _WIDTH , this . QUOTE _IMAGE _HEIGHT ,
a ? "\u201c" : "\u201d" ) } } , module$contents$Blockly$libraryBlocks$texts _TEXT _QUOTES _EXTENSION = function ( ) { this . mixin ( module$contents$Blockly$libraryBlocks$texts _QUOTE _IMAGE _MIXIN ) ; this . quoteField _ ( "TEXT" ) } , module$contents$Blockly$libraryBlocks$texts _TEXT _JOIN _MUTATOR _MIXIN = { mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; a . setAttribute ( "items" , this . itemCount _ ) ; return a } , domToMutation : function ( a ) { this . itemCount _ = parseInt ( a . getAttribute ( "items" ) , 10 ) ; this . updateShape _ ( ) } ,
saveExtraState : function ( ) { return { itemCount : this . itemCount _ } } , loadExtraState : function ( a ) { this . itemCount _ = a . itemCount ; this . updateShape _ ( ) } , decompose : function ( a ) { const b = a . newBlock ( "text_create_join_container" ) ; b . initSvg ( ) ; let c = b . getInput ( "STACK" ) . connection ; for ( let d = 0 ; d < this . itemCount _ ; d ++ ) { const e = a . newBlock ( "text_create_join_item" ) ; e . initSvg ( ) ; c . connect ( e . previousConnection ) ; c = e . nextConnection } return b } , compose : function ( a ) { var b = a . getInputTargetBlock ( "STACK" ) ; for ( a = [ ] ; b ; ) b . isInsertionMarker ( ) ||
a . push ( b . valueConnection _ ) , b = b . getNextBlock ( ) ; for ( b = 0 ; b < this . itemCount _ ; b ++ ) { const c = this . getInput ( "ADD" + b ) . connection . targetConnection ; c && - 1 === a . indexOf ( c ) && c . disconnect ( ) } this . itemCount _ = a . length ; this . updateShape _ ( ) ; for ( b = 0 ; b < this . itemCount _ ; b ++ ) $ . Mutator$$module$build$src$core$mutator . reconnect ( a [ b ] , this , "ADD" + b ) } , saveConnections : function ( a ) { a = a . getInputTargetBlock ( "STACK" ) ; let b = 0 ; for ( ; a ; ) { if ( a . isInsertionMarker ( ) ) { a = a . getNextBlock ( ) ; continue } const c = this . getInput ( "ADD" + b ) ; a . valueConnection _ =
c && c . connection . targetConnection ; a = a . getNextBlock ( ) ; b ++ } } , updateShape _ : function ( ) { this . itemCount _ && this . getInput ( "EMPTY" ) ? this . removeInput ( "EMPTY" ) : this . itemCount _ || this . getInput ( "EMPTY" ) || this . appendDummyInput ( "EMPTY" ) . appendField ( this . newQuote _ ( ! 0 ) ) . appendField ( this . newQuote _ ( ! 1 ) ) ; for ( var a = 0 ; a < this . itemCount _ ; a ++ ) if ( ! this . getInput ( "ADD" + a ) ) { const b = this . appendValueInput ( "ADD" + a ) . setAlign ( $ . Align$$module$build$src$core$input . RIGHT ) ; 0 === a && b . appendField ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _JOIN _TITLE _CREATEWITH ) } for ( a =
this . itemCount _ ; this . getInput ( "ADD" + a ) ; a ++ ) this . removeInput ( "ADD" + a ) } } , module$contents$Blockly$libraryBlocks$texts _TEXT _JOIN _EXTENSION = function ( ) { this . mixin ( module$contents$Blockly$libraryBlocks$texts _QUOTE _IMAGE _MIXIN ) ; this . itemCount _ = 2 ; this . updateShape _ ( ) ; this . setMutator ( new $ . Mutator$$module$build$src$core$mutator ( [ "text_create_join_item" ] , this ) ) } ;
$ . module$build$src$core$extensions . register ( "text_append_tooltip" , $ . module$build$src$core$extensions . buildTooltipWithFieldText ( "%{BKY_TEXT_APPEND_TOOLTIP}" , "VAR" ) ) ;
var module$contents$Blockly$libraryBlocks$texts _TEXT _INDEXOF _TOOLTIP _EXTENSION = function ( ) { const a = this ; this . setTooltip ( function ( ) { return module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _INDEXOF _TOOLTIP . replace ( "%1" , a . workspace . options . oneBasedIndex ? "0" : "-1" ) } ) } , module$contents$Blockly$libraryBlocks$texts _TEXT _CHARAT _MUTATOR _MIXIN = { mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; a . setAttribute ( "at" , ! ! this . isAt _ ) ; return a } , domToMutation : function ( a ) { a =
"false" !== a . getAttribute ( "at" ) ; this . updateAt _ ( a ) } , updateAt _ : function ( a ) { this . removeInput ( "AT" , ! 0 ) ; this . removeInput ( "ORDINAL" , ! 0 ) ; a && ( this . appendValueInput ( "AT" ) . setCheck ( "Number" ) , module$contents$Blockly$libraryBlocks$texts _Msg . ORDINAL _NUMBER _SUFFIX && this . appendDummyInput ( "ORDINAL" ) . appendField ( module$contents$Blockly$libraryBlocks$texts _Msg . ORDINAL _NUMBER _SUFFIX ) ) ; module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _CHARAT _TAIL && ( this . removeInput ( "TAIL" , ! 0 ) , this . appendDummyInput ( "TAIL" ) . appendField ( module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _CHARAT _TAIL ) ) ;
this . isAt _ = a } } , module$contents$Blockly$libraryBlocks$texts _TEXT _CHARAT _EXTENSION = function ( ) { this . getField ( "WHERE" ) . setValidator ( function ( b ) { b = "FROM_START" === b || "FROM_END" === b ; b !== this . isAt _ && this . getSourceBlock ( ) . updateAt _ ( b ) } ) ; this . updateAt _ ( ! 0 ) ; const a = this ; this . setTooltip ( function ( ) { var b = a . getFieldValue ( "WHERE" ) ; let c = module$contents$Blockly$libraryBlocks$texts _Msg . TEXT _CHARAT _TOOLTIP ; ( "FROM_START" === b || "FROM_END" === b ) && ( b = "FROM_START" === b ? module$contents$Blockly$libraryBlocks$texts _Msg . LISTS _INDEX _FROM _START _TOOLTIP :
module$contents$Blockly$libraryBlocks$texts _Msg . LISTS _INDEX _FROM _END _TOOLTIP ) && ( c += " " + b . replace ( "%1" , a . workspace . options . oneBasedIndex ? "#1" : "#0" ) ) ; return c } ) } ; $ . module$build$src$core$extensions . register ( "text_indexOf_tooltip" , module$contents$Blockly$libraryBlocks$texts _TEXT _INDEXOF _TOOLTIP _EXTENSION ) ; $ . module$build$src$core$extensions . register ( "text_quotes" , module$contents$Blockly$libraryBlocks$texts _TEXT _QUOTES _EXTENSION ) ;
$ . module$build$src$core$extensions . registerMutator ( "text_join_mutator" , module$contents$Blockly$libraryBlocks$texts _TEXT _JOIN _MUTATOR _MIXIN , module$contents$Blockly$libraryBlocks$texts _TEXT _JOIN _EXTENSION ) ; $ . module$build$src$core$extensions . registerMutator ( "text_charAt_mutator" , module$contents$Blockly$libraryBlocks$texts _TEXT _CHARAT _MUTATOR _MIXIN , module$contents$Blockly$libraryBlocks$texts _TEXT _CHARAT _EXTENSION ) ; module$contents$Blockly$libraryBlocks$texts _defineBlocks ( module$exports$Blockly$libraryBlocks$texts . blocks ) ; var module$exports$Blockly$libraryBlocks$procedures = { } , module$contents$Blockly$libraryBlocks$procedures _ContextMenu = $ . module$build$src$core$contextmenu , module$contents$Blockly$libraryBlocks$procedures _Events = $ . module$build$src$core$events$events , module$contents$Blockly$libraryBlocks$procedures _Procedures = $ . module$build$src$core$procedures , module$contents$Blockly$libraryBlocks$procedures _Variables = $ . module$build$src$core$variables , module$contents$Blockly$libraryBlocks$procedures _Xml = $ . module$build$src$core$xml ,
module$contents$Blockly$libraryBlocks$procedures _xmlUtils = $ . module$build$src$core$utils$xml , module$contents$Blockly$libraryBlocks$procedures _Align = $ . Align$$module$build$src$core$input , module$contents$Blockly$libraryBlocks$procedures _BlockDefinition = Object , module$contents$Blockly$libraryBlocks$procedures _config = $ . config$$module$build$src$core$config , module$contents$Blockly$libraryBlocks$procedures _FieldCheckbox = $ . FieldCheckbox$$module$build$src$core$field _checkbox , module$contents$Blockly$libraryBlocks$procedures _FieldLabel =
$ . FieldLabel$$module$build$src$core$field _label , module$contents$Blockly$libraryBlocks$procedures _FieldTextInput = $ . FieldTextInput$$module$build$src$core$field _textinput , module$contents$Blockly$libraryBlocks$procedures _Msg = $ . module$build$src$core$msg . Msg , module$contents$Blockly$libraryBlocks$procedures _Mutator = $ . Mutator$$module$build$src$core$mutator , module$contents$Blockly$libraryBlocks$procedures _Names = $ . module$build$src$core$names . Names , module$contents$Blockly$libraryBlocks$procedures _defineBlocks =
$ . module$build$src$core$common . defineBlocks ; module$exports$Blockly$libraryBlocks$procedures . blocks = { } ;
var module$contents$Blockly$libraryBlocks$procedures _PROCEDURE _DEF _COMMON = { setStatements _ : function ( a ) { this . hasStatements _ !== a && ( a ? ( this . appendStatementInput ( "STACK" ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFNORETURN _DO ) , this . getInput ( "RETURN" ) && this . moveInputBefore ( "STACK" , "RETURN" ) ) : this . removeInput ( "STACK" , ! 0 ) , this . hasStatements _ = a ) } , updateParams _ : function ( ) { let a = "" ; this . arguments _ . length && ( a = module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _BEFORE _PARAMS +
" " + this . arguments _ . join ( ", " ) ) ; $ . module$build$src$core$events$events . disable ( ) ; try { this . setFieldValue ( a , "PARAMS" ) } finally { $ . module$build$src$core$events$events . enable ( ) } } , mutationToDom : function ( a ) { const b = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; a && b . setAttribute ( "name" , this . getFieldValue ( "NAME" ) ) ; for ( let c = 0 ; c < this . argumentVarModels _ . length ; c ++ ) { const d = $ . module$build$src$core$utils$xml . createElement ( "arg" ) , e = this . argumentVarModels _ [ c ] ; d . setAttribute ( "name" , e . name ) ; d . setAttribute ( "varid" ,
e . getId ( ) ) ; a && this . paramIds _ && d . setAttribute ( "paramId" , this . paramIds _ [ c ] ) ; b . appendChild ( d ) } this . hasStatements _ || b . setAttribute ( "statements" , "false" ) ; return b } , domToMutation : function ( a ) { this . arguments _ = [ ] ; this . argumentVarModels _ = [ ] ; for ( let c = 0 , d ; d = a . childNodes [ c ] ; c ++ ) if ( "arg" === d . nodeName . toLowerCase ( ) ) { const e = d . getAttribute ( "name" ) ; var b = d . getAttribute ( "varid" ) || d . getAttribute ( "varId" ) ; this . arguments _ . push ( e ) ; b = $ . module$build$src$core$variables . getOrCreateVariablePackage ( this . workspace , b , e , "" ) ; null !==
b ? this . argumentVarModels _ . push ( b ) : console . log ( "Failed to create a variable with name " + e + ", ignoring." ) } this . updateParams _ ( ) ; $ . module$build$src$core$procedures . mutateCallers ( this ) ; this . setStatements _ ( "false" !== a . getAttribute ( "statements" ) ) } , saveExtraState : function ( ) { if ( ! this . argumentVarModels _ . length && this . hasStatements _ ) return null ; const a = Object . create ( null ) ; if ( this . argumentVarModels _ . length ) { a . params = [ ] ; for ( let b = 0 ; b < this . argumentVarModels _ . length ; b ++ ) a . params . push ( { name : this . argumentVarModels _ [ b ] . name ,
id : this . argumentVarModels _ [ b ] . getId ( ) } ) } this . hasStatements _ || ( a . hasStatements = ! 1 ) ; return a } , loadExtraState : function ( a ) { this . arguments _ = [ ] ; this . argumentVarModels _ = [ ] ; if ( a . params ) for ( let c = 0 ; c < a . params . length ; c ++ ) { var b = a . params [ c ] ; b = $ . module$build$src$core$variables . getOrCreateVariablePackage ( this . workspace , b . id , b . name , "" ) ; this . arguments _ . push ( b . name ) ; this . argumentVarModels _ . push ( b ) } this . updateParams _ ( ) ; $ . module$build$src$core$procedures . mutateCallers ( this ) ; this . setStatements _ ( ! 1 === a . hasStatements ?
! 1 : ! 0 ) } , decompose : function ( a ) { const b = $ . module$build$src$core$utils$xml . createElement ( "block" ) ; b . setAttribute ( "type" , "procedures_mutatorcontainer" ) ; var c = $ . module$build$src$core$utils$xml . createElement ( "statement" ) ; c . setAttribute ( "name" , "STACK" ) ; b . appendChild ( c ) ; for ( let e = 0 ; e < this . arguments _ . length ; e ++ ) { const f = $ . module$build$src$core$utils$xml . createElement ( "block" ) ; f . setAttribute ( "type" , "procedures_mutatorarg" ) ; var d = $ . module$build$src$core$utils$xml . createElement ( "field" ) ; d . setAttribute ( "name" ,
"NAME" ) ; const g = $ . module$build$src$core$utils$xml . createTextNode ( this . arguments _ [ e ] ) ; d . appendChild ( g ) ; f . appendChild ( d ) ; d = $ . module$build$src$core$utils$xml . createElement ( "next" ) ; f . appendChild ( d ) ; c . appendChild ( f ) ; c = d } a = $ . module$build$src$core$xml . domToBlock ( b , a ) ; "procedures_defreturn" === this . type ? a . setFieldValue ( this . hasStatements _ , "STATEMENTS" ) : a . removeInput ( "STATEMENT_INPUT" ) ; $ . module$build$src$core$procedures . mutateCallers ( this ) ; return a } , compose : function ( a ) { this . arguments _ = [ ] ; this . paramIds _ = [ ] ;
this . argumentVarModels _ = [ ] ; let b = a . getInputTargetBlock ( "STACK" ) ; for ( ; b && ! b . isInsertionMarker ( ) ; ) { var c = b . getFieldValue ( "NAME" ) ; this . arguments _ . push ( c ) ; c = this . workspace . getVariable ( c , "" ) ; this . argumentVarModels _ . push ( c ) ; this . paramIds _ . push ( b . id ) ; b = b . nextConnection && b . nextConnection . targetBlock ( ) } this . updateParams _ ( ) ; $ . module$build$src$core$procedures . mutateCallers ( this ) ; a = a . getFieldValue ( "STATEMENTS" ) ; if ( null !== a && ( a = "TRUE" === a , this . hasStatements _ !== a ) ) if ( a ) this . setStatements _ ( ! 0 ) , $ . Mutator$$module$build$src$core$mutator . reconnect ( this . statementConnection _ ,
this , "STACK" ) , this . statementConnection _ = null ; else { a = this . getInput ( "STACK" ) . connection ; if ( this . statementConnection _ = a . targetConnection ) a = a . targetBlock ( ) , a . unplug ( ) , a . bumpNeighbours ( ) ; this . setStatements _ ( ! 1 ) } } , getVars : function ( ) { return this . arguments _ } , getVarModels : function ( ) { return this . argumentVarModels _ } , renameVarById : function ( a , b ) { var c = this . workspace . getVariableById ( a ) ; if ( "" === c . type ) { c = c . name ; b = this . workspace . getVariableById ( b ) ; var d = ! 1 ; for ( let e = 0 ; e < this . argumentVarModels _ . length ; e ++ ) this . argumentVarModels _ [ e ] . getId ( ) ===
a && ( this . arguments _ [ e ] = b . name , this . argumentVarModels _ [ e ] = b , d = ! 0 ) ; d && ( this . displayRenamedVar _ ( c , b . name ) , $ . module$build$src$core$procedures . mutateCallers ( this ) ) } } , updateVarName : function ( a ) { const b = a . name ; let c = ! 1 , d ; for ( let e = 0 ; e < this . argumentVarModels _ . length ; e ++ ) this . argumentVarModels _ [ e ] . getId ( ) === a . getId ( ) && ( d = this . arguments _ [ e ] , this . arguments _ [ e ] = b , c = ! 0 ) ; c && ( this . displayRenamedVar _ ( d , b ) , $ . module$build$src$core$procedures . mutateCallers ( this ) ) } , displayRenamedVar _ : function ( a , b ) { this . updateParams _ ( ) ;
if ( this . mutator && this . mutator . isVisible ( ) ) { const c = this . mutator . workspace _ . getAllBlocks ( ! 1 ) ; for ( let d = 0 , e ; e = c [ d ] ; d ++ ) "procedures_mutatorarg" === e . type && $ . module$build$src$core$names . Names . equals ( a , e . getFieldValue ( "NAME" ) ) && e . setFieldValue ( b , "NAME" ) } } , customContextMenu : function ( a ) { if ( ! this . isInFlyout ) { var b = { enabled : ! 0 } , c = this . getFieldValue ( "NAME" ) ; b . text = module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _CREATE _DO . replace ( "%1" , c ) ; var d = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ;
d . setAttribute ( "name" , c ) ; for ( c = 0 ; c < this . arguments _ . length ; c ++ ) { var e = $ . module$build$src$core$utils$xml . createElement ( "arg" ) ; e . setAttribute ( "name" , this . arguments _ [ c ] ) ; d . appendChild ( e ) } c = $ . module$build$src$core$utils$xml . createElement ( "block" ) ; c . setAttribute ( "type" , this . callType _ ) ; c . appendChild ( d ) ; b . callback = $ . module$build$src$core$contextmenu . callbackFactory ( this , c ) ; a . push ( b ) ; if ( ! this . isCollapsed ( ) ) for ( b = 0 ; b < this . argumentVarModels _ . length ; b ++ ) d = { enabled : ! 0 } , c = this . argumentVarModels _ [ b ] , d . text = module$contents$Blockly$libraryBlocks$procedures _Msg . VARIABLES _SET _CREATE _GET . replace ( "%1" ,
c . name ) , c = $ . module$build$src$core$variables . generateVariableFieldDom ( c ) , e = $ . module$build$src$core$utils$xml . createElement ( "block" ) , e . setAttribute ( "type" , "variables_get" ) , e . appendChild ( c ) , d . callback = $ . module$build$src$core$contextmenu . callbackFactory ( this , e ) , a . push ( d ) } } } ;
module$exports$Blockly$libraryBlocks$procedures . blocks . procedures _defnoreturn = Object . assign ( { } , module$contents$Blockly$libraryBlocks$procedures _PROCEDURE _DEF _COMMON , { init : function ( ) { var a = $ . module$build$src$core$procedures . findLegalName ( "" , this ) ; a = new $ . FieldTextInput$$module$build$src$core$field _textinput ( a , $ . module$build$src$core$procedures . rename ) ; a . setSpellcheck ( ! 1 ) ; this . appendDummyInput ( ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFNORETURN _TITLE ) . appendField ( a ,
"NAME" ) . appendField ( "" , "PARAMS" ) ; this . setMutator ( new $ . Mutator$$module$build$src$core$mutator ( [ "procedures_mutatorarg" ] , this ) ) ; ( this . workspace . options . comments || this . workspace . options . parentWorkspace && this . workspace . options . parentWorkspace . options . comments ) && module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFNORETURN _COMMENT && this . setCommentText ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFNORETURN _COMMENT ) ; this . setStyle ( "procedure_blocks" ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFNORETURN _TOOLTIP ) ;
this . setHelpUrl ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFNORETURN _HELPURL ) ; this . arguments _ = [ ] ; this . argumentVarModels _ = [ ] ; this . setStatements _ ( ! 0 ) ; this . statementConnection _ = null } , getProcedureDef : function ( ) { return [ this . getFieldValue ( "NAME" ) , this . arguments _ , ! 1 ] } , callType _ : "procedures_callnoreturn" } ) ;
module$exports$Blockly$libraryBlocks$procedures . blocks . procedures _defreturn = Object . assign ( { } , module$contents$Blockly$libraryBlocks$procedures _PROCEDURE _DEF _COMMON , { init : function ( ) { var a = $ . module$build$src$core$procedures . findLegalName ( "" , this ) ; a = new $ . FieldTextInput$$module$build$src$core$field _textinput ( a , $ . module$build$src$core$procedures . rename ) ; a . setSpellcheck ( ! 1 ) ; this . appendDummyInput ( ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _TITLE ) . appendField ( a ,
"NAME" ) . appendField ( "" , "PARAMS" ) ; this . appendValueInput ( "RETURN" ) . setAlign ( $ . Align$$module$build$src$core$input . RIGHT ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _RETURN ) ; this . setMutator ( new $ . Mutator$$module$build$src$core$mutator ( [ "procedures_mutatorarg" ] , this ) ) ; ( this . workspace . options . comments || this . workspace . options . parentWorkspace && this . workspace . options . parentWorkspace . options . comments ) && module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _COMMENT &&
this . setCommentText ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _COMMENT ) ; this . setStyle ( "procedure_blocks" ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _TOOLTIP ) ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _HELPURL ) ; this . arguments _ = [ ] ; this . argumentVarModels _ = [ ] ; this . setStatements _ ( ! 0 ) ; this . statementConnection _ = null } , getProcedureDef : function ( ) { return [ this . getFieldValue ( "NAME" ) , this . arguments _ ,
! 0 ] } , callType _ : "procedures_callreturn" } ) ;
module$exports$Blockly$libraryBlocks$procedures . blocks . procedures _mutatorcontainer = { init : function ( ) { this . appendDummyInput ( ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _MUTATORCONTAINER _TITLE ) ; this . appendStatementInput ( "STACK" ) ; this . appendDummyInput ( "STATEMENT_INPUT" ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _ALLOW _STATEMENTS ) . appendField ( new $ . FieldCheckbox$$module$build$src$core$field _checkbox ( "TRUE" ) , "STATEMENTS" ) ; this . setStyle ( "procedure_blocks" ) ;
this . setTooltip ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _MUTATORCONTAINER _TOOLTIP ) ; this . contextMenu = ! 1 } } ;
module$exports$Blockly$libraryBlocks$procedures . blocks . procedures _mutatorarg = { init : function ( ) { const a = new $ . FieldTextInput$$module$build$src$core$field _textinput ( $ . module$build$src$core$procedures . DEFAULT _ARG , this . validator _ ) ; a . oldShowEditorFn _ = a . showEditor _ ; a . showEditor _ = function ( ) { this . createdVariables _ = [ ] ; this . oldShowEditorFn _ ( ) } ; this . appendDummyInput ( ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _MUTATORARG _TITLE ) . appendField ( a , "NAME" ) ; this . setPreviousStatement ( ! 0 ) ;
this . setNextStatement ( ! 0 ) ; this . setStyle ( "procedure_blocks" ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _MUTATORARG _TOOLTIP ) ; this . contextMenu = ! 1 ; a . onFinishEditing _ = this . deleteIntermediateVars _ ; a . createdVariables _ = [ ] ; a . onFinishEditing _ ( "x" ) } , validator _ : function ( a ) { var b = this . getSourceBlock ( ) ; const c = $ . Mutator$$module$build$src$core$mutator . findParentWs ( b . workspace ) ; a = a . replace ( /[\s\xa0]+/g , " " ) . replace ( /^ | $/g , "" ) ; if ( ! a ) return null ; const d = ( b . workspace . targetWorkspace ||
b . workspace ) . getAllBlocks ( ! 1 ) , e = a . toLowerCase ( ) ; for ( let f = 0 ; f < d . length ; f ++ ) { if ( d [ f ] . id === this . getSourceBlock ( ) . id ) continue ; const g = d [ f ] . getFieldValue ( "NAME" ) ; if ( g && g . toLowerCase ( ) === e ) return null } if ( b . isInFlyout ) return a ; ( b = c . getVariable ( a , "" ) ) && b . name !== a && c . renameVariableById ( b . getId ( ) , a ) ; b || ( b = c . createVariable ( a , "" ) ) && this . createdVariables _ && this . createdVariables _ . push ( b ) ; return a } , deleteIntermediateVars _ : function ( a ) { const b = $ . Mutator$$module$build$src$core$mutator . findParentWs ( this . getSourceBlock ( ) . workspace ) ;
if ( b ) for ( let c = 0 ; c < this . createdVariables _ . length ; c ++ ) { const d = this . createdVariables _ [ c ] ; d . name !== a && b . deleteVariableById ( d . getId ( ) ) } } } ;
var module$contents$Blockly$libraryBlocks$procedures _PROCEDURE _CALL _COMMON = { getProcedureCall : function ( ) { return this . getFieldValue ( "NAME" ) } , renameProcedure : function ( a , b ) { $ . module$build$src$core$names . Names . equals ( a , this . getProcedureCall ( ) ) && ( this . setFieldValue ( b , "NAME" ) , this . setTooltip ( ( this . outputConnection ? module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _CALLRETURN _TOOLTIP : module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _CALLNORETURN _TOOLTIP ) . replace ( "%1" , b ) ) ) } , setProcedureParameters _ : function ( a ,
b ) { var c = $ . module$build$src$core$procedures . getDefinition ( this . getProcedureCall ( ) , this . workspace ) , d = c && c . mutator && c . mutator . isVisible ( ) ; d ? this . setCollapsed ( ! 1 ) : ( this . quarkConnections _ = { } , this . quarkIds _ = null ) ; if ( a . join ( "\n" ) === this . arguments _ . join ( "\n" ) ) this . quarkIds _ = b ; else { if ( b . length !== a . length ) throw RangeError ( "paramNames and paramIds must be the same length." ) ; this . quarkIds _ || ( this . quarkConnections _ = { } , this . quarkIds _ = [ ] ) ; c = this . rendered ; this . rendered = ! 1 ; for ( let f = 0 ; f < this . arguments _ . length ; f ++ ) { var e =
this . getInput ( "ARG" + f ) ; e && ( e = e . connection . targetConnection , this . quarkConnections _ [ this . quarkIds _ [ f ] ] = e , d && e && - 1 === b . indexOf ( this . quarkIds _ [ f ] ) && ( e . disconnect ( ) , e . getSourceBlock ( ) . bumpNeighbours ( ) ) ) } this . arguments _ = [ ] . concat ( a ) ; this . argumentVarModels _ = [ ] ; for ( a = 0 ; a < this . arguments _ . length ; a ++ ) d = $ . module$build$src$core$variables . getOrCreateVariablePackage ( this . workspace , null , this . arguments _ [ a ] , "" ) , this . argumentVarModels _ . push ( d ) ; this . updateShape _ ( ) ; if ( this . quarkIds _ = b ) for ( b = 0 ; b < this . arguments _ . length ; b ++ ) a =
this . quarkIds _ [ b ] , a in this . quarkConnections _ && ( $ . Mutator$$module$build$src$core$mutator . reconnect ( this . quarkConnections _ [ a ] , this , "ARG" + b ) || delete this . quarkConnections _ [ a ] ) ; ( this . rendered = c ) && this . render ( ) } } , updateShape _ : function ( ) { for ( var a = 0 ; a < this . arguments _ . length ; a ++ ) { var b = this . getField ( "ARGNAME" + a ) ; if ( b ) { $ . module$build$src$core$events$events . disable ( ) ; try { b . setValue ( this . arguments _ [ a ] ) } finally { $ . module$build$src$core$events$events . enable ( ) } } else b = new $ . FieldLabel$$module$build$src$core$field _label ( this . arguments _ [ a ] ) ,
this . appendValueInput ( "ARG" + a ) . setAlign ( $ . Align$$module$build$src$core$input . RIGHT ) . appendField ( b , "ARGNAME" + a ) . init ( ) } for ( a = this . arguments _ . length ; this . getInput ( "ARG" + a ) ; a ++ ) this . removeInput ( "ARG" + a ) ; if ( a = this . getInput ( "TOPROW" ) ) this . arguments _ . length ? this . getField ( "WITH" ) || ( a . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _CALL _BEFORE _PARAMS , "WITH" ) , a . init ( ) ) : this . getField ( "WITH" ) && a . removeField ( "WITH" ) } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ;
a . setAttribute ( "name" , this . getProcedureCall ( ) ) ; for ( let b = 0 ; b < this . arguments _ . length ; b ++ ) { const c = $ . module$build$src$core$utils$xml . createElement ( "arg" ) ; c . setAttribute ( "name" , this . arguments _ [ b ] ) ; a . appendChild ( c ) } return a } , domToMutation : function ( a ) { var b = a . getAttribute ( "name" ) ; this . renameProcedure ( this . getProcedureCall ( ) , b ) ; b = [ ] ; const c = [ ] ; for ( let d = 0 , e ; e = a . childNodes [ d ] ; d ++ ) "arg" === e . nodeName . toLowerCase ( ) && ( b . push ( e . getAttribute ( "name" ) ) , c . push ( e . getAttribute ( "paramId" ) ) ) ; this . setProcedureParameters _ ( b ,
c ) } , saveExtraState : function ( ) { const a = Object . create ( null ) ; a . name = this . getProcedureCall ( ) ; this . arguments _ . length && ( a . params = this . arguments _ ) ; return a } , loadExtraState : function ( a ) { this . renameProcedure ( this . getProcedureCall ( ) , a . name ) ; if ( a = a . params ) { const b = [ ] ; b . length = a . length ; b . fill ( null ) ; this . setProcedureParameters _ ( a , b ) } } , getVars : function ( ) { return this . arguments _ } , getVarModels : function ( ) { return this . argumentVarModels _ } , onchange : function ( a ) { if ( this . workspace && ! this . workspace . isFlyout && a . recordUndo ) if ( a . type ===
$ . module$build$src$core$events$events . BLOCK _CREATE && - 1 !== a . ids . indexOf ( this . id ) ) { var b = this . getProcedureCall ( ) ; b = $ . module$build$src$core$procedures . getDefinition ( b , this . workspace ) ; ! b || b . type === this . defType _ && JSON . stringify ( b . getVars ( ) ) === JSON . stringify ( this . arguments _ ) || ( b = null ) ; if ( ! b ) { $ . module$build$src$core$events$events . setGroup ( a . group ) ; a = $ . module$build$src$core$utils$xml . createElement ( "xml" ) ; b = $ . module$build$src$core$utils$xml . createElement ( "block" ) ; b . setAttribute ( "type" , this . defType _ ) ; var c =
this . getRelativeToSurfaceXY ( ) , d = c . y + 2 * $ . config$$module$build$src$core$config . snapRadius ; b . setAttribute ( "x" , c . x + $ . config$$module$build$src$core$config . snapRadius * ( this . RTL ? - 1 : 1 ) ) ; b . setAttribute ( "y" , d ) ; c = this . mutationToDom ( ) ; b . appendChild ( c ) ; c = $ . module$build$src$core$utils$xml . createElement ( "field" ) ; c . setAttribute ( "name" , "NAME" ) ; d = this . getProcedureCall ( ) ; const e = $ . module$build$src$core$procedures . findLegalName ( d , this ) ; d !== e && this . renameProcedure ( d , e ) ; c . appendChild ( $ . module$build$src$core$utils$xml . createTextNode ( d ) ) ;
b . appendChild ( c ) ; a . appendChild ( b ) ; $ . module$build$src$core$xml . domToWorkspace ( a , this . workspace ) ; $ . module$build$src$core$events$events . setGroup ( ! 1 ) } } else a . type === $ . module$build$src$core$events$events . BLOCK _DELETE && a . blockId != this . id ? ( b = this . getProcedureCall ( ) , $ . module$build$src$core$procedures . getDefinition ( b , this . workspace ) || ( $ . module$build$src$core$events$events . setGroup ( a . group ) , this . dispose ( ! 0 ) , $ . module$build$src$core$events$events . setGroup ( ! 1 ) ) ) : a . type === $ . module$build$src$core$events$events . CHANGE &&
"disabled" === a . element && ( b = this . getProcedureCall ( ) , ( b = $ . module$build$src$core$procedures . getDefinition ( b , this . workspace ) ) && b . id === a . blockId && ( ( b = $ . module$build$src$core$events$events . getGroup ( ) ) && console . log ( "Saw an existing group while responding to a definition change" ) , $ . module$build$src$core$events$events . setGroup ( a . group ) , a . newValue ? ( this . previousEnabledState _ = this . isEnabled ( ) , this . setEnabled ( ! 1 ) ) : this . setEnabled ( this . previousEnabledState _ ) , $ . module$build$src$core$events$events . setGroup ( b ) ) ) } ,
customContextMenu : function ( a ) { if ( this . workspace . isMovable ( ) ) { var b = { enabled : ! 0 } ; b . text = module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _HIGHLIGHT _DEF ; var c = this . getProcedureCall ( ) , d = this . workspace ; b . callback = function ( ) { const e = $ . module$build$src$core$procedures . getDefinition ( c , d ) ; e && ( d . centerOnBlock ( e . id ) , e . select ( ) ) } ; a . push ( b ) } } } ;
module$exports$Blockly$libraryBlocks$procedures . blocks . procedures _callnoreturn = Object . assign ( { } , module$contents$Blockly$libraryBlocks$procedures _PROCEDURE _CALL _COMMON , { init : function ( ) { this . appendDummyInput ( "TOPROW" ) . appendField ( "" , "NAME" ) ; this . setPreviousStatement ( ! 0 ) ; this . setNextStatement ( ! 0 ) ; this . setStyle ( "procedure_blocks" ) ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _CALLNORETURN _HELPURL ) ; this . arguments _ = [ ] ; this . argumentVarModels _ = [ ] ; this . quarkConnections _ = { } ;
this . quarkIds _ = null ; this . previousEnabledState _ = ! 0 } , defType _ : "procedures_defnoreturn" } ) ;
module$exports$Blockly$libraryBlocks$procedures . blocks . procedures _callreturn = Object . assign ( { } , module$contents$Blockly$libraryBlocks$procedures _PROCEDURE _CALL _COMMON , { init : function ( ) { this . appendDummyInput ( "TOPROW" ) . appendField ( "" , "NAME" ) ; this . setOutput ( ! 0 ) ; this . setStyle ( "procedure_blocks" ) ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _CALLRETURN _HELPURL ) ; this . arguments _ = [ ] ; this . argumentVarModels _ = [ ] ; this . quarkConnections _ = { } ; this . quarkIds _ = null ; this . previousEnabledState _ =
! 0 } , defType _ : "procedures_defreturn" } ) ;
module$exports$Blockly$libraryBlocks$procedures . blocks . procedures _ifreturn = { init : function ( ) { this . appendValueInput ( "CONDITION" ) . setCheck ( "Boolean" ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . CONTROLS _IF _MSG _IF ) ; this . appendValueInput ( "VALUE" ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _RETURN ) ; this . setInputsInline ( ! 0 ) ; this . setPreviousStatement ( ! 0 ) ; this . setNextStatement ( ! 0 ) ; this . setStyle ( "procedure_blocks" ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _IFRETURN _TOOLTIP ) ;
this . setHelpUrl ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _IFRETURN _HELPURL ) ; this . hasReturnValue _ = ! 0 } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; a . setAttribute ( "value" , Number ( this . hasReturnValue _ ) ) ; return a } , domToMutation : function ( a ) { this . hasReturnValue _ = "1" === a . getAttribute ( "value" ) ; this . hasReturnValue _ || ( this . removeInput ( "VALUE" ) , this . appendDummyInput ( "VALUE" ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _RETURN ) ) } ,
onchange : function ( a ) { if ( ! ( this . workspace . isDragging && this . workspace . isDragging ( ) || a . type !== $ . module$build$src$core$events$events . BLOCK _MOVE ) ) { var b = ! 1 , c = this ; do { if ( - 1 !== this . FUNCTION _TYPES . indexOf ( c . type ) ) { b = ! 0 ; break } c = c . getSurroundParent ( ) } while ( c ) ; b ? ( "procedures_defnoreturn" === c . type && this . hasReturnValue _ ? ( this . removeInput ( "VALUE" ) , this . appendDummyInput ( "VALUE" ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _RETURN ) , this . hasReturnValue _ = ! 1 ) : "procedures_defreturn" !==
c . type || this . hasReturnValue _ || ( this . removeInput ( "VALUE" ) , this . appendValueInput ( "VALUE" ) . appendField ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _DEFRETURN _RETURN ) , this . hasReturnValue _ = ! 0 ) , this . setWarningText ( null ) ) : this . setWarningText ( module$contents$Blockly$libraryBlocks$procedures _Msg . PROCEDURES _IFRETURN _WARNING ) ; this . isInFlyout || ( c = $ . module$build$src$core$events$events . getGroup ( ) , $ . module$build$src$core$events$events . setGroup ( a . group ) , this . setEnabled ( b ) , $ . module$build$src$core$events$events . setGroup ( c ) ) } } ,
FUNCTION _TYPES : [ "procedures_defnoreturn" , "procedures_defreturn" ] } ; module$contents$Blockly$libraryBlocks$procedures _defineBlocks ( module$exports$Blockly$libraryBlocks$procedures . blocks ) ; var module$exports$Blockly$libraryBlocks$math = { } , module$contents$Blockly$libraryBlocks$math _Extensions = $ . module$build$src$core$extensions , module$contents$Blockly$libraryBlocks$math _FieldDropdown = $ . module$build$src$core$field _dropdown , module$contents$Blockly$libraryBlocks$math _xmlUtils = $ . module$build$src$core$utils$xml , module$contents$Blockly$libraryBlocks$math _BlockDefinition = Object , module$contents$Blockly$libraryBlocks$math _createBlockDefinitionsFromJsonArray = $ . module$build$src$core$common . createBlockDefinitionsFromJsonArray ,
module$contents$Blockly$libraryBlocks$math _defineBlocks = $ . module$build$src$core$common . defineBlocks ;
module$exports$Blockly$libraryBlocks$math . blocks = module$contents$Blockly$libraryBlocks$math _createBlockDefinitionsFromJsonArray ( [ { type : "math_number" , message0 : "%1" , args0 : [ { type : "field_number" , name : "NUM" , value : 0 } ] , output : "Number" , helpUrl : "%{BKY_MATH_NUMBER_HELPURL}" , style : "math_blocks" , tooltip : "%{BKY_MATH_NUMBER_TOOLTIP}" , extensions : [ "parent_tooltip_when_inline" ] } , { type : "math_arithmetic" , message0 : "%1 %2 %3" , args0 : [ { type : "input_value" , name : "A" , check : "Number" } , { type : "field_dropdown" , name : "OP" , options : [ [ "%{BKY_MATH_ADDITION_SYMBOL}" ,
2022-06-07 11:14:29 +00:00
"ADD" ] , [ "%{BKY_MATH_SUBTRACTION_SYMBOL}" , "MINUS" ] , [ "%{BKY_MATH_MULTIPLICATION_SYMBOL}" , "MULTIPLY" ] , [ "%{BKY_MATH_DIVISION_SYMBOL}" , "DIVIDE" ] , [ "%{BKY_MATH_POWER_SYMBOL}" , "POWER" ] ] } , { type : "input_value" , name : "B" , check : "Number" } ] , inputsInline : ! 0 , output : "Number" , style : "math_blocks" , helpUrl : "%{BKY_MATH_ARITHMETIC_HELPURL}" , extensions : [ "math_op_tooltip" ] } , { type : "math_single" , message0 : "%1 %2" , args0 : [ { type : "field_dropdown" , name : "OP" , options : [ [ "%{BKY_MATH_SINGLE_OP_ROOT}" , "ROOT" ] , [ "%{BKY_MATH_SINGLE_OP_ABSOLUTE}" ,
"ABS" ] , [ "-" , "NEG" ] , [ "ln" , "LN" ] , [ "log10" , "LOG10" ] , [ "e^" , "EXP" ] , [ "10^" , "POW10" ] ] } , { type : "input_value" , name : "NUM" , check : "Number" } ] , output : "Number" , style : "math_blocks" , helpUrl : "%{BKY_MATH_SINGLE_HELPURL}" , extensions : [ "math_op_tooltip" ] } , { type : "math_trig" , message0 : "%1 %2" , args0 : [ { type : "field_dropdown" , name : "OP" , options : [ [ "%{BKY_MATH_TRIG_SIN}" , "SIN" ] , [ "%{BKY_MATH_TRIG_COS}" , "COS" ] , [ "%{BKY_MATH_TRIG_TAN}" , "TAN" ] , [ "%{BKY_MATH_TRIG_ASIN}" , "ASIN" ] , [ "%{BKY_MATH_TRIG_ACOS}" , "ACOS" ] , [ "%{BKY_MATH_TRIG_ATAN}" ,
"ATAN" ] ] } , { type : "input_value" , name : "NUM" , check : "Number" } ] , output : "Number" , style : "math_blocks" , helpUrl : "%{BKY_MATH_TRIG_HELPURL}" , extensions : [ "math_op_tooltip" ] } , { type : "math_constant" , message0 : "%1" , args0 : [ { type : "field_dropdown" , name : "CONSTANT" , options : [ [ "\u03c0" , "PI" ] , [ "e" , "E" ] , [ "\u03c6" , "GOLDEN_RATIO" ] , [ "sqrt(2)" , "SQRT2" ] , [ "sqrt(\u00bd)" , "SQRT1_2" ] , [ "\u221e" , "INFINITY" ] ] } ] , output : "Number" , style : "math_blocks" , tooltip : "%{BKY_MATH_CONSTANT_TOOLTIP}" , helpUrl : "%{BKY_MATH_CONSTANT_HELPURL}" } , { type : "math_number_property" ,
message0 : "%1 %2" , args0 : [ { type : "input_value" , name : "NUMBER_TO_CHECK" , check : "Number" } , { type : "field_dropdown" , name : "PROPERTY" , options : [ [ "%{BKY_MATH_IS_EVEN}" , "EVEN" ] , [ "%{BKY_MATH_IS_ODD}" , "ODD" ] , [ "%{BKY_MATH_IS_PRIME}" , "PRIME" ] , [ "%{BKY_MATH_IS_WHOLE}" , "WHOLE" ] , [ "%{BKY_MATH_IS_POSITIVE}" , "POSITIVE" ] , [ "%{BKY_MATH_IS_NEGATIVE}" , "NEGATIVE" ] , [ "%{BKY_MATH_IS_DIVISIBLE_BY}" , "DIVISIBLE_BY" ] ] } ] , inputsInline : ! 0 , output : "Boolean" , style : "math_blocks" , tooltip : "%{BKY_MATH_IS_TOOLTIP}" , mutator : "math_is_divisibleby_mutator" } ,
{ type : "math_change" , message0 : "%{BKY_MATH_CHANGE_TITLE}" , args0 : [ { type : "field_variable" , name : "VAR" , variable : "%{BKY_MATH_CHANGE_TITLE_ITEM}" } , { type : "input_value" , name : "DELTA" , check : "Number" } ] , previousStatement : null , nextStatement : null , style : "variable_blocks" , helpUrl : "%{BKY_MATH_CHANGE_HELPURL}" , extensions : [ "math_change_tooltip" ] } , { type : "math_round" , message0 : "%1 %2" , args0 : [ { type : "field_dropdown" , name : "OP" , options : [ [ "%{BKY_MATH_ROUND_OPERATOR_ROUND}" , "ROUND" ] , [ "%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}" , "ROUNDUP" ] ,
[ "%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}" , "ROUNDDOWN" ] ] } , { type : "input_value" , name : "NUM" , check : "Number" } ] , output : "Number" , style : "math_blocks" , helpUrl : "%{BKY_MATH_ROUND_HELPURL}" , tooltip : "%{BKY_MATH_ROUND_TOOLTIP}" } , { type : "math_on_list" , message0 : "%1 %2" , args0 : [ { type : "field_dropdown" , name : "OP" , options : [ [ "%{BKY_MATH_ONLIST_OPERATOR_SUM}" , "SUM" ] , [ "%{BKY_MATH_ONLIST_OPERATOR_MIN}" , "MIN" ] , [ "%{BKY_MATH_ONLIST_OPERATOR_MAX}" , "MAX" ] , [ "%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}" , "AVERAGE" ] , [ "%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}" ,
"MEDIAN" ] , [ "%{BKY_MATH_ONLIST_OPERATOR_MODE}" , "MODE" ] , [ "%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}" , "STD_DEV" ] , [ "%{BKY_MATH_ONLIST_OPERATOR_RANDOM}" , "RANDOM" ] ] } , { type : "input_value" , name : "LIST" , check : "Array" } ] , output : "Number" , style : "math_blocks" , helpUrl : "%{BKY_MATH_ONLIST_HELPURL}" , mutator : "math_modes_of_list_mutator" , extensions : [ "math_op_tooltip" ] } , { type : "math_modulo" , message0 : "%{BKY_MATH_MODULO_TITLE}" , args0 : [ { type : "input_value" , name : "DIVIDEND" , check : "Number" } , { type : "input_value" , name : "DIVISOR" , check : "Number" } ] ,
inputsInline : ! 0 , output : "Number" , style : "math_blocks" , tooltip : "%{BKY_MATH_MODULO_TOOLTIP}" , helpUrl : "%{BKY_MATH_MODULO_HELPURL}" } , { type : "math_constrain" , message0 : "%{BKY_MATH_CONSTRAIN_TITLE}" , args0 : [ { type : "input_value" , name : "VALUE" , check : "Number" } , { type : "input_value" , name : "LOW" , check : "Number" } , { type : "input_value" , name : "HIGH" , check : "Number" } ] , inputsInline : ! 0 , output : "Number" , style : "math_blocks" , tooltip : "%{BKY_MATH_CONSTRAIN_TOOLTIP}" , helpUrl : "%{BKY_MATH_CONSTRAIN_HELPURL}" } , { type : "math_random_int" , message0 : "%{BKY_MATH_RANDOM_INT_TITLE}" ,
args0 : [ { type : "input_value" , name : "FROM" , check : "Number" } , { type : "input_value" , name : "TO" , check : "Number" } ] , inputsInline : ! 0 , output : "Number" , style : "math_blocks" , tooltip : "%{BKY_MATH_RANDOM_INT_TOOLTIP}" , helpUrl : "%{BKY_MATH_RANDOM_INT_HELPURL}" } , { type : "math_random_float" , message0 : "%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}" , output : "Number" , style : "math_blocks" , tooltip : "%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}" , helpUrl : "%{BKY_MATH_RANDOM_FLOAT_HELPURL}" } , { type : "math_atan2" , message0 : "%{BKY_MATH_ATAN2_TITLE}" , args0 : [ { type : "input_value" ,
name : "X" , check : "Number" } , { type : "input_value" , name : "Y" , check : "Number" } ] , inputsInline : ! 0 , output : "Number" , style : "math_blocks" , tooltip : "%{BKY_MATH_ATAN2_TOOLTIP}" , helpUrl : "%{BKY_MATH_ATAN2_HELPURL}" } ] ) ;
var module$contents$Blockly$libraryBlocks$math _TOOLTIPS _BY _OP = { ADD : "%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}" , MINUS : "%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}" , MULTIPLY : "%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}" , DIVIDE : "%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}" , POWER : "%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}" , ROOT : "%{BKY_MATH_SINGLE_TOOLTIP_ROOT}" , ABS : "%{BKY_MATH_SINGLE_TOOLTIP_ABS}" , NEG : "%{BKY_MATH_SINGLE_TOOLTIP_NEG}" , LN : "%{BKY_MATH_SINGLE_TOOLTIP_LN}" , LOG10 : "%{BKY_MATH_SINGLE_TOOLTIP_LOG10}" , EXP : "%{BKY_MATH_SINGLE_TOOLTIP_EXP}" ,
2022-01-03 14:02:41 +00:00
POW10 : "%{BKY_MATH_SINGLE_TOOLTIP_POW10}" , SIN : "%{BKY_MATH_TRIG_TOOLTIP_SIN}" , COS : "%{BKY_MATH_TRIG_TOOLTIP_COS}" , TAN : "%{BKY_MATH_TRIG_TOOLTIP_TAN}" , ASIN : "%{BKY_MATH_TRIG_TOOLTIP_ASIN}" , ACOS : "%{BKY_MATH_TRIG_TOOLTIP_ACOS}" , ATAN : "%{BKY_MATH_TRIG_TOOLTIP_ATAN}" , SUM : "%{BKY_MATH_ONLIST_TOOLTIP_SUM}" , MIN : "%{BKY_MATH_ONLIST_TOOLTIP_MIN}" , MAX : "%{BKY_MATH_ONLIST_TOOLTIP_MAX}" , AVERAGE : "%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}" , MEDIAN : "%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}" , MODE : "%{BKY_MATH_ONLIST_TOOLTIP_MODE}" , STD _DEV : "%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}" ,
2022-11-16 13:57:00 +00:00
RANDOM : "%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}" } ; $ . module$build$src$core$extensions . register ( "math_op_tooltip" , $ . module$build$src$core$extensions . buildTooltipForDropdown ( "OP" , module$contents$Blockly$libraryBlocks$math _TOOLTIPS _BY _OP ) ) ;
var module$contents$Blockly$libraryBlocks$math _IS _DIVISIBLEBY _MUTATOR _MIXIN = { mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) , b = "DIVISIBLE_BY" === this . getFieldValue ( "PROPERTY" ) ; a . setAttribute ( "divisor_input" , b ) ; return a } , domToMutation : function ( a ) { a = "true" === a . getAttribute ( "divisor_input" ) ; this . updateShape _ ( a ) } , updateShape _ : function ( a ) { const b = this . getInput ( "DIVISOR" ) ; a ? b || this . appendValueInput ( "DIVISOR" ) . setCheck ( "Number" ) : b && this . removeInput ( "DIVISOR" ) } } ,
module$contents$Blockly$libraryBlocks$math _IS _DIVISIBLE _MUTATOR _EXTENSION = function ( ) { this . getField ( "PROPERTY" ) . setValidator ( function ( a ) { a = "DIVISIBLE_BY" === a ; this . getSourceBlock ( ) . updateShape _ ( a ) } ) } ; $ . module$build$src$core$extensions . registerMutator ( "math_is_divisibleby_mutator" , module$contents$Blockly$libraryBlocks$math _IS _DIVISIBLEBY _MUTATOR _MIXIN , module$contents$Blockly$libraryBlocks$math _IS _DIVISIBLE _MUTATOR _EXTENSION ) ;
$ . module$build$src$core$extensions . register ( "math_change_tooltip" , $ . module$build$src$core$extensions . buildTooltipWithFieldText ( "%{BKY_MATH_CHANGE_TOOLTIP}" , "VAR" ) ) ;
var module$contents$Blockly$libraryBlocks$math _LIST _MODES _MUTATOR _MIXIN = { updateType _ : function ( a ) { "MODE" === a ? this . outputConnection . setCheck ( "Array" ) : this . outputConnection . setCheck ( "Number" ) } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; a . setAttribute ( "op" , this . getFieldValue ( "OP" ) ) ; return a } , domToMutation : function ( a ) { this . updateType _ ( a . getAttribute ( "op" ) ) } } , module$contents$Blockly$libraryBlocks$math _LIST _MODES _MUTATOR _EXTENSION = function ( ) { this . getField ( "OP" ) . setValidator ( function ( a ) { this . updateType _ ( a ) } . bind ( this ) ) } ;
$ . module$build$src$core$extensions . registerMutator ( "math_modes_of_list_mutator" , module$contents$Blockly$libraryBlocks$math _LIST _MODES _MUTATOR _MIXIN , module$contents$Blockly$libraryBlocks$math _LIST _MODES _MUTATOR _EXTENSION ) ; module$contents$Blockly$libraryBlocks$math _defineBlocks ( module$exports$Blockly$libraryBlocks$math . blocks ) ; var module$exports$Blockly$libraryBlocks$loops = { } , module$contents$Blockly$libraryBlocks$loops _ContextMenu = $ . module$build$src$core$contextmenu , module$contents$Blockly$libraryBlocks$loops _Events = $ . module$build$src$core$events$events , module$contents$Blockly$libraryBlocks$loops _Extensions = $ . module$build$src$core$extensions , module$contents$Blockly$libraryBlocks$loops _Variables = $ . module$build$src$core$variables , module$contents$Blockly$libraryBlocks$loops _xmlUtils = $ . module$build$src$core$utils$xml , module$contents$Blockly$libraryBlocks$loops _BlockDefinition =
Object , module$contents$Blockly$libraryBlocks$loops _Msg = $ . module$build$src$core$msg . Msg , module$contents$Blockly$libraryBlocks$loops _createBlockDefinitionsFromJsonArray = $ . module$build$src$core$common . createBlockDefinitionsFromJsonArray , module$contents$Blockly$libraryBlocks$loops _defineBlocks = $ . module$build$src$core$common . defineBlocks ;
module$exports$Blockly$libraryBlocks$loops . blocks = module$contents$Blockly$libraryBlocks$loops _createBlockDefinitionsFromJsonArray ( [ { type : "controls_repeat_ext" , message0 : "%{BKY_CONTROLS_REPEAT_TITLE}" , args0 : [ { type : "input_value" , name : "TIMES" , check : "Number" } ] , message1 : "%{BKY_CONTROLS_REPEAT_INPUT_DO} %1" , args1 : [ { type : "input_statement" , name : "DO" } ] , previousStatement : null , nextStatement : null , style : "loop_blocks" , tooltip : "%{BKY_CONTROLS_REPEAT_TOOLTIP}" , helpUrl : "%{BKY_CONTROLS_REPEAT_HELPURL}" } , { type : "controls_repeat" ,
2022-06-07 11:14:29 +00:00
message0 : "%{BKY_CONTROLS_REPEAT_TITLE}" , args0 : [ { type : "field_number" , name : "TIMES" , value : 10 , min : 0 , precision : 1 } ] , message1 : "%{BKY_CONTROLS_REPEAT_INPUT_DO} %1" , args1 : [ { type : "input_statement" , name : "DO" } ] , previousStatement : null , nextStatement : null , style : "loop_blocks" , tooltip : "%{BKY_CONTROLS_REPEAT_TOOLTIP}" , helpUrl : "%{BKY_CONTROLS_REPEAT_HELPURL}" } , { type : "controls_whileUntil" , message0 : "%1 %2" , args0 : [ { type : "field_dropdown" , name : "MODE" , options : [ [ "%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}" , "WHILE" ] , [ "%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}" ,
"UNTIL" ] ] } , { type : "input_value" , name : "BOOL" , check : "Boolean" } ] , message1 : "%{BKY_CONTROLS_REPEAT_INPUT_DO} %1" , args1 : [ { type : "input_statement" , name : "DO" } ] , previousStatement : null , nextStatement : null , style : "loop_blocks" , helpUrl : "%{BKY_CONTROLS_WHILEUNTIL_HELPURL}" , extensions : [ "controls_whileUntil_tooltip" ] } , { type : "controls_for" , message0 : "%{BKY_CONTROLS_FOR_TITLE}" , args0 : [ { type : "field_variable" , name : "VAR" , variable : null } , { type : "input_value" , name : "FROM" , check : "Number" , align : "RIGHT" } , { type : "input_value" , name : "TO" ,
check : "Number" , align : "RIGHT" } , { type : "input_value" , name : "BY" , check : "Number" , align : "RIGHT" } ] , message1 : "%{BKY_CONTROLS_REPEAT_INPUT_DO} %1" , args1 : [ { type : "input_statement" , name : "DO" } ] , inputsInline : ! 0 , previousStatement : null , nextStatement : null , style : "loop_blocks" , helpUrl : "%{BKY_CONTROLS_FOR_HELPURL}" , extensions : [ "contextMenu_newGetVariableBlock" , "controls_for_tooltip" ] } , { type : "controls_forEach" , message0 : "%{BKY_CONTROLS_FOREACH_TITLE}" , args0 : [ { type : "field_variable" , name : "VAR" , variable : null } , { type : "input_value" ,
name : "LIST" , check : "Array" } ] , message1 : "%{BKY_CONTROLS_REPEAT_INPUT_DO} %1" , args1 : [ { type : "input_statement" , name : "DO" } ] , previousStatement : null , nextStatement : null , style : "loop_blocks" , helpUrl : "%{BKY_CONTROLS_FOREACH_HELPURL}" , extensions : [ "contextMenu_newGetVariableBlock" , "controls_forEach_tooltip" ] } , { type : "controls_flow_statements" , message0 : "%1" , args0 : [ { type : "field_dropdown" , name : "FLOW" , options : [ [ "%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}" , "BREAK" ] , [ "%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}" ,
"CONTINUE" ] ] } ] , previousStatement : null , style : "loop_blocks" , helpUrl : "%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}" , suppressPrefixSuffix : ! 0 , extensions : [ "controls_flow_tooltip" , "controls_flow_in_loop_check" ] } ] ) ; var module$contents$Blockly$libraryBlocks$loops _WHILE _UNTIL _TOOLTIPS = { WHILE : "%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}" , UNTIL : "%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}" } ;
2022-11-16 13:57:00 +00:00
$ . module$build$src$core$extensions . register ( "controls_whileUntil_tooltip" , $ . module$build$src$core$extensions . buildTooltipForDropdown ( "MODE" , module$contents$Blockly$libraryBlocks$loops _WHILE _UNTIL _TOOLTIPS ) ) ; var module$contents$Blockly$libraryBlocks$loops _BREAK _CONTINUE _TOOLTIPS = { BREAK : "%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}" , CONTINUE : "%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}" } ;
$ . module$build$src$core$extensions . register ( "controls_flow_tooltip" , $ . module$build$src$core$extensions . buildTooltipForDropdown ( "FLOW" , module$contents$Blockly$libraryBlocks$loops _BREAK _CONTINUE _TOOLTIPS ) ) ;
var module$contents$Blockly$libraryBlocks$loops _CUSTOM _CONTEXT _MENU _CREATE _VARIABLES _GET _MIXIN = { customContextMenu : function ( a ) { if ( ! this . isInFlyout ) { var b = this . getField ( "VAR" ) . getVariable ( ) , c = b . name ; if ( ! this . isCollapsed ( ) && null !== c ) { const d = { enabled : ! 0 } ; d . text = module$contents$Blockly$libraryBlocks$loops _Msg . VARIABLES _SET _CREATE _GET . replace ( "%1" , c ) ; b = $ . module$build$src$core$variables . generateVariableFieldDom ( b ) ; c = $ . module$build$src$core$utils$xml . createElement ( "block" ) ; c . setAttribute ( "type" , "variables_get" ) ;
c . appendChild ( b ) ; d . callback = $ . module$build$src$core$contextmenu . callbackFactory ( this , c ) ; a . push ( d ) } } } } ; $ . module$build$src$core$extensions . registerMixin ( "contextMenu_newGetVariableBlock" , module$contents$Blockly$libraryBlocks$loops _CUSTOM _CONTEXT _MENU _CREATE _VARIABLES _GET _MIXIN ) ; $ . module$build$src$core$extensions . register ( "controls_for_tooltip" , $ . module$build$src$core$extensions . buildTooltipWithFieldText ( "%{BKY_CONTROLS_FOR_TOOLTIP}" , "VAR" ) ) ;
$ . module$build$src$core$extensions . register ( "controls_forEach_tooltip" , $ . module$build$src$core$extensions . buildTooltipWithFieldText ( "%{BKY_CONTROLS_FOREACH_TOOLTIP}" , "VAR" ) ) ; module$exports$Blockly$libraryBlocks$loops . loopTypes = new Set ( [ "controls_repeat" , "controls_repeat_ext" , "controls_forEach" , "controls_for" , "controls_whileUntil" ] ) ;
var module$contents$Blockly$libraryBlocks$loops _CONTROL _FLOW _IN _LOOP _CHECK _MIXIN = { getSurroundLoop : function ( ) { let a = this ; do { if ( module$exports$Blockly$libraryBlocks$loops . loopTypes . has ( a . type ) ) return a ; a = a . getSurroundParent ( ) } while ( a ) ; return null } , onchange : function ( a ) { if ( this . workspace . isDragging && ! this . workspace . isDragging ( ) && a . type === $ . module$build$src$core$events$events . BLOCK _MOVE ) { var b = this . getSurroundLoop ( this ) ; this . setWarningText ( b ? null : module$contents$Blockly$libraryBlocks$loops _Msg . CONTROLS _FLOW _STATEMENTS _WARNING ) ;
if ( ! this . isInFlyout ) { const c = $ . module$build$src$core$events$events . getGroup ( ) ; $ . module$build$src$core$events$events . setGroup ( a . group ) ; this . setEnabled ( b ) ; $ . module$build$src$core$events$events . setGroup ( c ) } } } } ; $ . module$build$src$core$extensions . registerMixin ( "controls_flow_in_loop_check" , module$contents$Blockly$libraryBlocks$loops _CONTROL _FLOW _IN _LOOP _CHECK _MIXIN ) ; module$contents$Blockly$libraryBlocks$loops _defineBlocks ( module$exports$Blockly$libraryBlocks$loops . blocks ) ; var module$exports$Blockly$libraryBlocks$logic = { } , module$contents$Blockly$libraryBlocks$logic _Events = $ . module$build$src$core$events$events , module$contents$Blockly$libraryBlocks$logic _Extensions = $ . module$build$src$core$extensions , module$contents$Blockly$libraryBlocks$logic _xmlUtils = $ . module$build$src$core$utils$xml , module$contents$Blockly$libraryBlocks$logic _BlockDefinition = Object , module$contents$Blockly$libraryBlocks$logic _Msg = $ . module$build$src$core$msg . Msg , module$contents$Blockly$libraryBlocks$logic _Mutator =
$ . Mutator$$module$build$src$core$mutator , module$contents$Blockly$libraryBlocks$logic _createBlockDefinitionsFromJsonArray = $ . module$build$src$core$common . createBlockDefinitionsFromJsonArray , module$contents$Blockly$libraryBlocks$logic _defineBlocks = $ . module$build$src$core$common . defineBlocks ;
module$exports$Blockly$libraryBlocks$logic . blocks = module$contents$Blockly$libraryBlocks$logic _createBlockDefinitionsFromJsonArray ( [ { type : "logic_boolean" , message0 : "%1" , args0 : [ { type : "field_dropdown" , name : "BOOL" , options : [ [ "%{BKY_LOGIC_BOOLEAN_TRUE}" , "TRUE" ] , [ "%{BKY_LOGIC_BOOLEAN_FALSE}" , "FALSE" ] ] } ] , output : "Boolean" , style : "logic_blocks" , tooltip : "%{BKY_LOGIC_BOOLEAN_TOOLTIP}" , helpUrl : "%{BKY_LOGIC_BOOLEAN_HELPURL}" } , { type : "controls_if" , message0 : "%{BKY_CONTROLS_IF_MSG_IF} %1" , args0 : [ { type : "input_value" ,
name : "IF0" , check : "Boolean" } ] , message1 : "%{BKY_CONTROLS_IF_MSG_THEN} %1" , args1 : [ { type : "input_statement" , name : "DO0" } ] , previousStatement : null , nextStatement : null , style : "logic_blocks" , helpUrl : "%{BKY_CONTROLS_IF_HELPURL}" , suppressPrefixSuffix : ! 0 , mutator : "controls_if_mutator" , extensions : [ "controls_if_tooltip" ] } , { type : "controls_ifelse" , message0 : "%{BKY_CONTROLS_IF_MSG_IF} %1" , args0 : [ { type : "input_value" , name : "IF0" , check : "Boolean" } ] , message1 : "%{BKY_CONTROLS_IF_MSG_THEN} %1" , args1 : [ { type : "input_statement" , name : "DO0" } ] ,
message2 : "%{BKY_CONTROLS_IF_MSG_ELSE} %1" , args2 : [ { type : "input_statement" , name : "ELSE" } ] , previousStatement : null , nextStatement : null , style : "logic_blocks" , tooltip : "%{BKYCONTROLS_IF_TOOLTIP_2}" , helpUrl : "%{BKY_CONTROLS_IF_HELPURL}" , suppressPrefixSuffix : ! 0 , extensions : [ "controls_if_tooltip" ] } , { type : "logic_compare" , message0 : "%1 %2 %3" , args0 : [ { type : "input_value" , name : "A" } , { type : "field_dropdown" , name : "OP" , options : [ [ "=" , "EQ" ] , [ "\u2260" , "NEQ" ] , [ "\u200f<" , "LT" ] , [ "\u200f\u2264" , "LTE" ] , [ "\u200f>" , "GT" ] , [ "\u200f\u2265" ,
"GTE" ] ] } , { type : "input_value" , name : "B" } ] , inputsInline : ! 0 , output : "Boolean" , style : "logic_blocks" , helpUrl : "%{BKY_LOGIC_COMPARE_HELPURL}" , extensions : [ "logic_compare" , "logic_op_tooltip" ] } , { type : "logic_operation" , message0 : "%1 %2 %3" , args0 : [ { type : "input_value" , name : "A" , check : "Boolean" } , { type : "field_dropdown" , name : "OP" , options : [ [ "%{BKY_LOGIC_OPERATION_AND}" , "AND" ] , [ "%{BKY_LOGIC_OPERATION_OR}" , "OR" ] ] } , { type : "input_value" , name : "B" , check : "Boolean" } ] , inputsInline : ! 0 , output : "Boolean" , style : "logic_blocks" , helpUrl : "%{BKY_LOGIC_OPERATION_HELPURL}" ,
extensions : [ "logic_op_tooltip" ] } , { type : "logic_negate" , message0 : "%{BKY_LOGIC_NEGATE_TITLE}" , args0 : [ { type : "input_value" , name : "BOOL" , check : "Boolean" } ] , output : "Boolean" , style : "logic_blocks" , tooltip : "%{BKY_LOGIC_NEGATE_TOOLTIP}" , helpUrl : "%{BKY_LOGIC_NEGATE_HELPURL}" } , { type : "logic_null" , message0 : "%{BKY_LOGIC_NULL}" , output : null , style : "logic_blocks" , tooltip : "%{BKY_LOGIC_NULL_TOOLTIP}" , helpUrl : "%{BKY_LOGIC_NULL_HELPURL}" } , { type : "logic_ternary" , message0 : "%{BKY_LOGIC_TERNARY_CONDITION} %1" , args0 : [ { type : "input_value" ,
name : "IF" , check : "Boolean" } ] , message1 : "%{BKY_LOGIC_TERNARY_IF_TRUE} %1" , args1 : [ { type : "input_value" , name : "THEN" } ] , message2 : "%{BKY_LOGIC_TERNARY_IF_FALSE} %1" , args2 : [ { type : "input_value" , name : "ELSE" } ] , output : null , style : "logic_blocks" , tooltip : "%{BKY_LOGIC_TERNARY_TOOLTIP}" , helpUrl : "%{BKY_LOGIC_TERNARY_HELPURL}" , extensions : [ "logic_ternary" ] } , { type : "controls_if_if" , message0 : "%{BKY_CONTROLS_IF_IF_TITLE_IF}" , nextStatement : null , enableContextMenu : ! 1 , style : "logic_blocks" , tooltip : "%{BKY_CONTROLS_IF_IF_TOOLTIP}" } ,
{ type : "controls_if_elseif" , message0 : "%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}" , previousStatement : null , nextStatement : null , enableContextMenu : ! 1 , style : "logic_blocks" , tooltip : "%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}" } , { type : "controls_if_else" , message0 : "%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}" , previousStatement : null , enableContextMenu : ! 1 , style : "logic_blocks" , tooltip : "%{BKY_CONTROLS_IF_ELSE_TOOLTIP}" } ] ) ;
var module$contents$Blockly$libraryBlocks$logic _TOOLTIPS _BY _OP = { EQ : "%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}" , NEQ : "%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}" , LT : "%{BKY_LOGIC_COMPARE_TOOLTIP_LT}" , LTE : "%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}" , GT : "%{BKY_LOGIC_COMPARE_TOOLTIP_GT}" , GTE : "%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}" , AND : "%{BKY_LOGIC_OPERATION_TOOLTIP_AND}" , OR : "%{BKY_LOGIC_OPERATION_TOOLTIP_OR}" } ; $ . module$build$src$core$extensions . register ( "logic_op_tooltip" , $ . module$build$src$core$extensions . buildTooltipForDropdown ( "OP" , module$contents$Blockly$libraryBlocks$logic _TOOLTIPS _BY _OP ) ) ;
var module$contents$Blockly$libraryBlocks$logic _CONTROLS _IF _MUTATOR _MIXIN = { elseifCount _ : 0 , elseCount _ : 0 , mutationToDom : function ( ) { if ( ! this . elseifCount _ && ! this . elseCount _ ) return null ; const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; this . elseifCount _ && a . setAttribute ( "elseif" , this . elseifCount _ ) ; this . elseCount _ && a . setAttribute ( "else" , 1 ) ; return a } , domToMutation : function ( a ) { this . elseifCount _ = parseInt ( a . getAttribute ( "elseif" ) , 10 ) || 0 ; this . elseCount _ = parseInt ( a . getAttribute ( "else" ) , 10 ) || 0 ;
this . rebuildShape _ ( ) } , saveExtraState : function ( ) { if ( ! this . elseifCount _ && ! this . elseCount _ ) return null ; const a = Object . create ( null ) ; this . elseifCount _ && ( a . elseIfCount = this . elseifCount _ ) ; this . elseCount _ && ( a . hasElse = ! 0 ) ; return a } , loadExtraState : function ( a ) { this . elseifCount _ = a . elseIfCount || 0 ; this . elseCount _ = a . hasElse ? 1 : 0 ; this . updateShape _ ( ) } , decompose : function ( a ) { const b = a . newBlock ( "controls_if_if" ) ; b . initSvg ( ) ; let c = b . nextConnection ; for ( let d = 1 ; d <= this . elseifCount _ ; d ++ ) { const e = a . newBlock ( "controls_if_elseif" ) ;
e . initSvg ( ) ; c . connect ( e . previousConnection ) ; c = e . nextConnection } this . elseCount _ && ( a = a . newBlock ( "controls_if_else" ) , a . initSvg ( ) , c . connect ( a . previousConnection ) ) ; return b } , compose : function ( a ) { a = a . nextConnection . targetBlock ( ) ; this . elseCount _ = this . elseifCount _ = 0 ; const b = [ null ] , c = [ null ] ; let d = null ; for ( ; a ; ) { if ( ! a . isInsertionMarker ( ) ) switch ( a . type ) { case "controls_if_elseif" : this . elseifCount _ ++ ; b . push ( a . valueConnection _ ) ; c . push ( a . statementConnection _ ) ; break ; case "controls_if_else" : this . elseCount _ ++ ; d = a . statementConnection _ ;
break ; default : throw TypeError ( "Unknown block type: " + a . type ) ; } a = a . getNextBlock ( ) } this . updateShape _ ( ) ; this . reconnectChildBlocks _ ( b , c , d ) } , saveConnections : function ( a ) { a = a . nextConnection . targetBlock ( ) ; let b = 1 ; for ( ; a ; ) { if ( ! a . isInsertionMarker ( ) ) switch ( a . type ) { case "controls_if_elseif" : var c = this . getInput ( "IF" + b ) ; const d = this . getInput ( "DO" + b ) ; a . valueConnection _ = c && c . connection . targetConnection ; a . statementConnection _ = d && d . connection . targetConnection ; b ++ ; break ; case "controls_if_else" : c = this . getInput ( "ELSE" ) ;
a . statementConnection _ = c && c . connection . targetConnection ; break ; default : throw TypeError ( "Unknown block type: " + a . type ) ; } a = a . getNextBlock ( ) } } , rebuildShape _ : function ( ) { const a = [ null ] , b = [ null ] ; let c = null ; this . getInput ( "ELSE" ) && ( c = this . getInput ( "ELSE" ) . connection . targetConnection ) ; for ( let d = 1 ; this . getInput ( "IF" + d ) ; d ++ ) { const e = this . getInput ( "IF" + d ) , f = this . getInput ( "DO" + d ) ; a . push ( e . connection . targetConnection ) ; b . push ( f . connection . targetConnection ) } this . updateShape _ ( ) ; this . reconnectChildBlocks _ ( a , b , c ) } , updateShape _ : function ( ) { this . getInput ( "ELSE" ) &&
this . removeInput ( "ELSE" ) ; for ( var a = 1 ; this . getInput ( "IF" + a ) ; a ++ ) this . removeInput ( "IF" + a ) , this . removeInput ( "DO" + a ) ; for ( a = 1 ; a <= this . elseifCount _ ; a ++ ) this . appendValueInput ( "IF" + a ) . setCheck ( "Boolean" ) . appendField ( module$contents$Blockly$libraryBlocks$logic _Msg . CONTROLS _IF _MSG _ELSEIF ) , this . appendStatementInput ( "DO" + a ) . appendField ( module$contents$Blockly$libraryBlocks$logic _Msg . CONTROLS _IF _MSG _THEN ) ; this . elseCount _ && this . appendStatementInput ( "ELSE" ) . appendField ( module$contents$Blockly$libraryBlocks$logic _Msg . CONTROLS _IF _MSG _ELSE ) } ,
reconnectChildBlocks _ : function ( a , b , c ) { for ( let d = 1 ; d <= this . elseifCount _ ; d ++ ) $ . Mutator$$module$build$src$core$mutator . reconnect ( a [ d ] , this , "IF" + d ) , $ . Mutator$$module$build$src$core$mutator . reconnect ( b [ d ] , this , "DO" + d ) ; $ . Mutator$$module$build$src$core$mutator . reconnect ( c , this , "ELSE" ) } } ; $ . module$build$src$core$extensions . registerMutator ( "controls_if_mutator" , module$contents$Blockly$libraryBlocks$logic _CONTROLS _IF _MUTATOR _MIXIN , null , [ "controls_if_elseif" , "controls_if_else" ] ) ;
var module$contents$Blockly$libraryBlocks$logic _CONTROLS _IF _TOOLTIP _EXTENSION = function ( ) { this . setTooltip ( function ( ) { if ( this . elseifCount _ || this . elseCount _ ) { if ( ! this . elseifCount _ && this . elseCount _ ) return module$contents$Blockly$libraryBlocks$logic _Msg . CONTROLS _IF _TOOLTIP _2 ; if ( this . elseifCount _ && ! this . elseCount _ ) return module$contents$Blockly$libraryBlocks$logic _Msg . CONTROLS _IF _TOOLTIP _3 ; if ( this . elseifCount _ && this . elseCount _ ) return module$contents$Blockly$libraryBlocks$logic _Msg . CONTROLS _IF _TOOLTIP _4 } else return module$contents$Blockly$libraryBlocks$logic _Msg . CONTROLS _IF _TOOLTIP _1 ;
return "" } . bind ( this ) ) } ; $ . module$build$src$core$extensions . register ( "controls_if_tooltip" , module$contents$Blockly$libraryBlocks$logic _CONTROLS _IF _TOOLTIP _EXTENSION ) ;
var module$contents$Blockly$libraryBlocks$logic _LOGIC _COMPARE _ONCHANGE _MIXIN = { onchange : function ( a ) { this . prevBlocks _ || ( this . prevBlocks _ = [ null , null ] ) ; var b = this . getInputTargetBlock ( "A" ) ; const c = this . getInputTargetBlock ( "B" ) ; b && c && ! this . workspace . connectionChecker . doTypeChecks ( b . outputConnection , c . outputConnection ) && ( $ . module$build$src$core$events$events . setGroup ( a . group ) , a = this . prevBlocks _ [ 0 ] , a !== b && ( b . unplug ( ) , ! a || a . isDisposed ( ) || a . isShadow ( ) || this . getInput ( "A" ) . connection . connect ( a . outputConnection ) ) ,
b = this . prevBlocks _ [ 1 ] , b !== c && ( c . unplug ( ) , ! b || b . isDisposed ( ) || b . isShadow ( ) || this . getInput ( "B" ) . connection . connect ( b . outputConnection ) ) , this . bumpNeighbours ( ) , $ . module$build$src$core$events$events . setGroup ( ! 1 ) ) ; this . prevBlocks _ [ 0 ] = this . getInputTargetBlock ( "A" ) ; this . prevBlocks _ [ 1 ] = this . getInputTargetBlock ( "B" ) } } , module$contents$Blockly$libraryBlocks$logic _LOGIC _COMPARE _EXTENSION = function ( ) { this . mixin ( module$contents$Blockly$libraryBlocks$logic _LOGIC _COMPARE _ONCHANGE _MIXIN ) } ;
$ . module$build$src$core$extensions . register ( "logic_compare" , module$contents$Blockly$libraryBlocks$logic _LOGIC _COMPARE _EXTENSION ) ;
var module$contents$Blockly$libraryBlocks$logic _LOGIC _TERNARY _ONCHANGE _MIXIN = { prevParentConnection _ : null , onchange : function ( a ) { const b = this . getInputTargetBlock ( "THEN" ) , c = this . getInputTargetBlock ( "ELSE" ) , d = this . outputConnection . targetConnection ; if ( ( b || c ) && d ) for ( let e = 0 ; 2 > e ; e ++ ) { const f = 1 === e ? b : c ; f && ! f . workspace . connectionChecker . doTypeChecks ( f . outputConnection , d ) && ( $ . module$build$src$core$events$events . setGroup ( a . group ) , d === this . prevParentConnection _ ? ( this . unplug ( ) , d . getSourceBlock ( ) . bumpNeighbours ( ) ) :
( f . unplug ( ) , f . bumpNeighbours ( ) ) , $ . module$build$src$core$events$events . setGroup ( ! 1 ) ) } this . prevParentConnection _ = d } } ; $ . module$build$src$core$extensions . registerMixin ( "logic_ternary" , module$contents$Blockly$libraryBlocks$logic _LOGIC _TERNARY _ONCHANGE _MIXIN ) ; module$contents$Blockly$libraryBlocks$logic _defineBlocks ( module$exports$Blockly$libraryBlocks$logic . blocks ) ; var module$exports$Blockly$libraryBlocks$lists = { } , module$contents$Blockly$libraryBlocks$lists _xmlUtils = $ . module$build$src$core$utils$xml , module$contents$Blockly$libraryBlocks$lists _Xml = $ . module$build$src$core$xml , module$contents$Blockly$libraryBlocks$lists _Align = $ . Align$$module$build$src$core$input , module$contents$Blockly$libraryBlocks$lists _BlockDefinition = Object , module$contents$Blockly$libraryBlocks$lists _ConnectionType = $ . module$build$src$core$connection _type . ConnectionType , module$contents$Blockly$libraryBlocks$lists _FieldDropdown =
$ . module$build$src$core$field _dropdown . FieldDropdown , module$contents$Blockly$libraryBlocks$lists _Msg = $ . module$build$src$core$msg . Msg , module$contents$Blockly$libraryBlocks$lists _Mutator = $ . Mutator$$module$build$src$core$mutator , module$contents$Blockly$libraryBlocks$lists _createBlockDefinitionsFromJsonArray = $ . module$build$src$core$common . createBlockDefinitionsFromJsonArray , module$contents$Blockly$libraryBlocks$lists _defineBlocks = $ . module$build$src$core$common . defineBlocks ;
module$exports$Blockly$libraryBlocks$lists . blocks = module$contents$Blockly$libraryBlocks$lists _createBlockDefinitionsFromJsonArray ( [ { type : "lists_create_empty" , message0 : "%{BKY_LISTS_CREATE_EMPTY_TITLE}" , output : "Array" , style : "list_blocks" , tooltip : "%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}" , helpUrl : "%{BKY_LISTS_CREATE_EMPTY_HELPURL}" } , { type : "lists_repeat" , message0 : "%{BKY_LISTS_REPEAT_TITLE}" , args0 : [ { type : "input_value" , name : "ITEM" } , { type : "input_value" , name : "NUM" , check : "Number" } ] , output : "Array" , style : "list_blocks" ,
tooltip : "%{BKY_LISTS_REPEAT_TOOLTIP}" , helpUrl : "%{BKY_LISTS_REPEAT_HELPURL}" } , { type : "lists_reverse" , message0 : "%{BKY_LISTS_REVERSE_MESSAGE0}" , args0 : [ { type : "input_value" , name : "LIST" , check : "Array" } ] , output : "Array" , inputsInline : ! 0 , style : "list_blocks" , tooltip : "%{BKY_LISTS_REVERSE_TOOLTIP}" , helpUrl : "%{BKY_LISTS_REVERSE_HELPURL}" } , { type : "lists_isEmpty" , message0 : "%{BKY_LISTS_ISEMPTY_TITLE}" , args0 : [ { type : "input_value" , name : "VALUE" , check : [ "String" , "Array" ] } ] , output : "Boolean" , style : "list_blocks" , tooltip : "%{BKY_LISTS_ISEMPTY_TOOLTIP}" ,
helpUrl : "%{BKY_LISTS_ISEMPTY_HELPURL}" } , { type : "lists_length" , message0 : "%{BKY_LISTS_LENGTH_TITLE}" , args0 : [ { type : "input_value" , name : "VALUE" , check : [ "String" , "Array" ] } ] , output : "Number" , style : "list_blocks" , tooltip : "%{BKY_LISTS_LENGTH_TOOLTIP}" , helpUrl : "%{BKY_LISTS_LENGTH_HELPURL}" } ] ) ;
module$exports$Blockly$libraryBlocks$lists . blocks . lists _create _with = { init : function ( ) { this . setHelpUrl ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _CREATE _WITH _HELPURL ) ; this . setStyle ( "list_blocks" ) ; this . itemCount _ = 3 ; this . updateShape _ ( ) ; this . setOutput ( ! 0 , "Array" ) ; this . setMutator ( new $ . Mutator$$module$build$src$core$mutator ( [ "lists_create_with_item" ] , this ) ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _CREATE _WITH _TOOLTIP ) } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ;
a . setAttribute ( "items" , this . itemCount _ ) ; return a } , domToMutation : function ( a ) { this . itemCount _ = parseInt ( a . getAttribute ( "items" ) , 10 ) ; this . updateShape _ ( ) } , saveExtraState : function ( ) { return { itemCount : this . itemCount _ } } , loadExtraState : function ( a ) { this . itemCount _ = a . itemCount ; this . updateShape _ ( ) } , decompose : function ( a ) { const b = a . newBlock ( "lists_create_with_container" ) ; b . initSvg ( ) ; let c = b . getInput ( "STACK" ) . connection ; for ( let d = 0 ; d < this . itemCount _ ; d ++ ) { const e = a . newBlock ( "lists_create_with_item" ) ; e . initSvg ( ) ; c . connect ( e . previousConnection ) ;
c = e . nextConnection } return b } , compose : function ( a ) { var b = a . getInputTargetBlock ( "STACK" ) ; for ( a = [ ] ; b ; ) b . isInsertionMarker ( ) || a . push ( b . valueConnection _ ) , b = b . getNextBlock ( ) ; for ( b = 0 ; b < this . itemCount _ ; b ++ ) { const c = this . getInput ( "ADD" + b ) . connection . targetConnection ; c && - 1 === a . indexOf ( c ) && c . disconnect ( ) } this . itemCount _ = a . length ; this . updateShape _ ( ) ; for ( b = 0 ; b < this . itemCount _ ; b ++ ) $ . Mutator$$module$build$src$core$mutator . reconnect ( a [ b ] , this , "ADD" + b ) } , saveConnections : function ( a ) { a = a . getInputTargetBlock ( "STACK" ) ;
let b = 0 ; for ( ; a ; ) { if ( a . isInsertionMarker ( ) ) { a = a . getNextBlock ( ) ; continue } const c = this . getInput ( "ADD" + b ) ; a . valueConnection _ = c && c . connection . targetConnection ; a = a . getNextBlock ( ) ; b ++ } } , updateShape _ : function ( ) { this . itemCount _ && this . getInput ( "EMPTY" ) ? this . removeInput ( "EMPTY" ) : this . itemCount _ || this . getInput ( "EMPTY" ) || this . appendDummyInput ( "EMPTY" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _CREATE _EMPTY _TITLE ) ; for ( var a = 0 ; a < this . itemCount _ ; a ++ ) if ( ! this . getInput ( "ADD" + a ) ) { const b = this . appendValueInput ( "ADD" +
a ) . setAlign ( $ . Align$$module$build$src$core$input . RIGHT ) ; 0 === a && b . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _CREATE _WITH _INPUT _WITH ) } for ( a = this . itemCount _ ; this . getInput ( "ADD" + a ) ; a ++ ) this . removeInput ( "ADD" + a ) } } ;
module$exports$Blockly$libraryBlocks$lists . blocks . lists _create _with _container = { init : function ( ) { this . setStyle ( "list_blocks" ) ; this . appendDummyInput ( ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _CREATE _WITH _CONTAINER _TITLE _ADD ) ; this . appendStatementInput ( "STACK" ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _CREATE _WITH _CONTAINER _TOOLTIP ) ; this . contextMenu = ! 1 } } ;
module$exports$Blockly$libraryBlocks$lists . blocks . lists _create _with _item = { init : function ( ) { this . setStyle ( "list_blocks" ) ; this . appendDummyInput ( ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _CREATE _WITH _ITEM _TITLE ) ; this . setPreviousStatement ( ! 0 ) ; this . setNextStatement ( ! 0 ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _CREATE _WITH _ITEM _TOOLTIP ) ; this . contextMenu = ! 1 } } ;
module$exports$Blockly$libraryBlocks$lists . blocks . lists _indexOf = { init : function ( ) { const a = [ [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _INDEX _OF _FIRST , "FIRST" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _INDEX _OF _LAST , "LAST" ] ] ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _INDEX _OF _HELPURL ) ; this . setStyle ( "list_blocks" ) ; this . setOutput ( ! 0 , "Number" ) ; this . appendValueInput ( "VALUE" ) . setCheck ( "Array" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _INDEX _OF _INPUT _IN _LIST ) ;
this . appendValueInput ( "FIND" ) . appendField ( new module$contents$Blockly$libraryBlocks$lists _FieldDropdown ( a ) , "END" ) ; this . setInputsInline ( ! 0 ) ; const b = this ; this . setTooltip ( function ( ) { return module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _INDEX _OF _TOOLTIP . replace ( "%1" , b . workspace . options . oneBasedIndex ? "0" : "-1" ) } ) } } ;
module$exports$Blockly$libraryBlocks$lists . blocks . lists _getIndex = { init : function ( ) { var a = [ [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _GET , "GET" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _GET _REMOVE , "GET_REMOVE" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _REMOVE , "REMOVE" ] ] ; this . WHERE _OPTIONS = [ [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _FROM _START , "FROM_START" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _FROM _END ,
"FROM_END" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _FIRST , "FIRST" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _LAST , "LAST" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _RANDOM , "RANDOM" ] ] ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _HELPURL ) ; this . setStyle ( "list_blocks" ) ; a = new module$contents$Blockly$libraryBlocks$lists _FieldDropdown ( a , function ( c ) { c = "REMOVE" === c ; this . getSourceBlock ( ) . updateStatement _ ( c ) } ) ;
this . appendValueInput ( "VALUE" ) . setCheck ( "Array" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _INPUT _IN _LIST ) ; this . appendDummyInput ( ) . appendField ( a , "MODE" ) . appendField ( "" , "SPACE" ) ; this . appendDummyInput ( "AT" ) ; module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TAIL && this . appendDummyInput ( "TAIL" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TAIL ) ; this . setInputsInline ( ! 0 ) ; this . setOutput ( ! 0 ) ; this . updateAt _ ( ! 0 ) ; const b = this ; this . setTooltip ( function ( ) { const c =
b . getFieldValue ( "MODE" ) , d = b . getFieldValue ( "WHERE" ) ; let e = "" ; switch ( c + " " + d ) { case "GET FROM_START" : case "GET FROM_END" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _GET _FROM ; break ; case "GET FIRST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _GET _FIRST ; break ; case "GET LAST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _GET _LAST ; break ; case "GET RANDOM" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _GET _RANDOM ;
break ; case "GET_REMOVE FROM_START" : case "GET_REMOVE FROM_END" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _GET _REMOVE _FROM ; break ; case "GET_REMOVE FIRST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _GET _REMOVE _FIRST ; break ; case "GET_REMOVE LAST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _GET _REMOVE _LAST ; break ; case "GET_REMOVE RANDOM" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _GET _REMOVE _RANDOM ;
break ; case "REMOVE FROM_START" : case "REMOVE FROM_END" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _REMOVE _FROM ; break ; case "REMOVE FIRST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _REMOVE _FIRST ; break ; case "REMOVE LAST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _REMOVE _LAST ; break ; case "REMOVE RANDOM" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TOOLTIP _REMOVE _RANDOM } if ( "FROM_START" === d || "FROM_END" ===
d ) e += " " + ( "FROM_START" === d ? module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _INDEX _FROM _START _TOOLTIP : module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _INDEX _FROM _END _TOOLTIP ) . replace ( "%1" , b . workspace . options . oneBasedIndex ? "#1" : "#0" ) ; return e } ) } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; a . setAttribute ( "statement" , ! this . outputConnection ) ; const b = this . getInput ( "AT" ) . type === $ . module$build$src$core$connection _type . ConnectionType . INPUT _VALUE ;
a . setAttribute ( "at" , b ) ; return a } , domToMutation : function ( a ) { const b = "true" === a . getAttribute ( "statement" ) ; this . updateStatement _ ( b ) ; a = "false" !== a . getAttribute ( "at" ) ; this . updateAt _ ( a ) } , saveExtraState : function ( ) { return this . outputConnection ? null : { isStatement : ! 0 } } , loadExtraState : function ( a ) { a . isStatement ? this . updateStatement _ ( ! 0 ) : "string" === typeof a && this . domToMutation ( $ . module$build$src$core$xml . textToDom ( a ) ) } , updateStatement _ : function ( a ) { a !== ! this . outputConnection && ( this . unplug ( ! 0 , ! 0 ) , a ? ( this . setOutput ( ! 1 ) ,
this . setPreviousStatement ( ! 0 ) , this . setNextStatement ( ! 0 ) ) : ( this . setPreviousStatement ( ! 1 ) , this . setNextStatement ( ! 1 ) , this . setOutput ( ! 0 ) ) ) } , updateAt _ : function ( a ) { this . removeInput ( "AT" ) ; this . removeInput ( "ORDINAL" , ! 0 ) ; a ? ( this . appendValueInput ( "AT" ) . setCheck ( "Number" ) , module$contents$Blockly$libraryBlocks$lists _Msg . ORDINAL _NUMBER _SUFFIX && this . appendDummyInput ( "ORDINAL" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . ORDINAL _NUMBER _SUFFIX ) ) : this . appendDummyInput ( "AT" ) ; const b = new module$contents$Blockly$libraryBlocks$lists _FieldDropdown ( this . WHERE _OPTIONS ,
function ( c ) { const d = "FROM_START" === c || "FROM_END" === c ; if ( d !== a ) { const e = this . getSourceBlock ( ) ; e . updateAt _ ( d ) ; e . setFieldValue ( c , "WHERE" ) ; return null } } ) ; this . getInput ( "AT" ) . appendField ( b , "WHERE" ) ; module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _TAIL && this . moveInputBefore ( "TAIL" , null ) } } ;
module$exports$Blockly$libraryBlocks$lists . blocks . lists _setIndex = { init : function ( ) { const a = [ [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _SET , "SET" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _INSERT , "INSERT" ] ] ; this . WHERE _OPTIONS = [ [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _FROM _START , "FROM_START" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _FROM _END , "FROM_END" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _FIRST ,
"FIRST" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _LAST , "LAST" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _INDEX _RANDOM , "RANDOM" ] ] ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _HELPURL ) ; this . setStyle ( "list_blocks" ) ; this . appendValueInput ( "LIST" ) . setCheck ( "Array" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _INPUT _IN _LIST ) ; this . appendDummyInput ( ) . appendField ( new module$contents$Blockly$libraryBlocks$lists _FieldDropdown ( a ) ,
"MODE" ) . appendField ( "" , "SPACE" ) ; this . appendDummyInput ( "AT" ) ; this . appendValueInput ( "TO" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _INPUT _TO ) ; this . setInputsInline ( ! 0 ) ; this . setPreviousStatement ( ! 0 ) ; this . setNextStatement ( ! 0 ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _TOOLTIP ) ; this . updateAt _ ( ! 0 ) ; const b = this ; this . setTooltip ( function ( ) { const c = b . getFieldValue ( "MODE" ) , d = b . getFieldValue ( "WHERE" ) ; let e = "" ; switch ( c + " " + d ) { case "SET FROM_START" : case "SET FROM_END" : e =
module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _TOOLTIP _SET _FROM ; break ; case "SET FIRST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _TOOLTIP _SET _FIRST ; break ; case "SET LAST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _TOOLTIP _SET _LAST ; break ; case "SET RANDOM" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _TOOLTIP _SET _RANDOM ; break ; case "INSERT FROM_START" : case "INSERT FROM_END" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _TOOLTIP _INSERT _FROM ;
break ; case "INSERT FIRST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _TOOLTIP _INSERT _FIRST ; break ; case "INSERT LAST" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _TOOLTIP _INSERT _LAST ; break ; case "INSERT RANDOM" : e = module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SET _INDEX _TOOLTIP _INSERT _RANDOM } if ( "FROM_START" === d || "FROM_END" === d ) e += " " + module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _INDEX _FROM _START _TOOLTIP . replace ( "%1" , b . workspace . options . oneBasedIndex ?
"#1" : "#0" ) ; return e } ) } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) , b = this . getInput ( "AT" ) . type === $ . module$build$src$core$connection _type . ConnectionType . INPUT _VALUE ; a . setAttribute ( "at" , b ) ; return a } , domToMutation : function ( a ) { a = "false" !== a . getAttribute ( "at" ) ; this . updateAt _ ( a ) } , saveExtraState : function ( ) { return null } , loadExtraState : function ( ) { } , updateAt _ : function ( a ) { this . removeInput ( "AT" ) ; this . removeInput ( "ORDINAL" , ! 0 ) ; a ? ( this . appendValueInput ( "AT" ) . setCheck ( "Number" ) ,
module$contents$Blockly$libraryBlocks$lists _Msg . ORDINAL _NUMBER _SUFFIX && this . appendDummyInput ( "ORDINAL" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . ORDINAL _NUMBER _SUFFIX ) ) : this . appendDummyInput ( "AT" ) ; const b = new module$contents$Blockly$libraryBlocks$lists _FieldDropdown ( this . WHERE _OPTIONS , function ( c ) { const d = "FROM_START" === c || "FROM_END" === c ; if ( d !== a ) { const e = this . getSourceBlock ( ) ; e . updateAt _ ( d ) ; e . setFieldValue ( c , "WHERE" ) ; return null } } ) ; this . moveInputBefore ( "AT" , "TO" ) ; this . getInput ( "ORDINAL" ) &&
this . moveInputBefore ( "ORDINAL" , "TO" ) ; this . getInput ( "AT" ) . appendField ( b , "WHERE" ) } } ;
module$exports$Blockly$libraryBlocks$lists . blocks . lists _getSublist = { init : function ( ) { this . WHERE _OPTIONS _1 = [ [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _START _FROM _START , "FROM_START" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _START _FROM _END , "FROM_END" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _START _FIRST , "FIRST" ] ] ; this . WHERE _OPTIONS _2 = [ [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _END _FROM _START , "FROM_START" ] ,
[ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _END _FROM _END , "FROM_END" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _END _LAST , "LAST" ] ] ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _HELPURL ) ; this . setStyle ( "list_blocks" ) ; this . appendValueInput ( "LIST" ) . setCheck ( "Array" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _INPUT _IN _LIST ) ; this . appendDummyInput ( "AT1" ) ; this . appendDummyInput ( "AT2" ) ; module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _TAIL &&
this . appendDummyInput ( "TAIL" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _TAIL ) ; this . setInputsInline ( ! 0 ) ; this . setOutput ( ! 0 , "Array" ) ; this . updateAt _ ( 1 , ! 0 ) ; this . updateAt _ ( 2 , ! 0 ) ; this . setTooltip ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _TOOLTIP ) } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; var b = this . getInput ( "AT1" ) . type === $ . module$build$src$core$connection _type . ConnectionType . INPUT _VALUE ; a . setAttribute ( "at1" ,
b ) ; b = this . getInput ( "AT2" ) . type === $ . module$build$src$core$connection _type . ConnectionType . INPUT _VALUE ; a . setAttribute ( "at2" , b ) ; return a } , domToMutation : function ( a ) { const b = "true" === a . getAttribute ( "at1" ) ; a = "true" === a . getAttribute ( "at2" ) ; this . updateAt _ ( 1 , b ) ; this . updateAt _ ( 2 , a ) } , saveExtraState : function ( ) { return null } , loadExtraState : function ( ) { } , updateAt _ : function ( a , b ) { this . removeInput ( "AT" + a ) ; this . removeInput ( "ORDINAL" + a , ! 0 ) ; b ? ( this . appendValueInput ( "AT" + a ) . setCheck ( "Number" ) , module$contents$Blockly$libraryBlocks$lists _Msg . ORDINAL _NUMBER _SUFFIX &&
this . appendDummyInput ( "ORDINAL" + a ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . ORDINAL _NUMBER _SUFFIX ) ) : this . appendDummyInput ( "AT" + a ) ; const c = new module$contents$Blockly$libraryBlocks$lists _FieldDropdown ( this [ "WHERE_OPTIONS_" + a ] , function ( d ) { const e = "FROM_START" === d || "FROM_END" === d ; if ( e !== b ) { const f = this . getSourceBlock ( ) ; f . updateAt _ ( a , e ) ; f . setFieldValue ( d , "WHERE" + a ) ; return null } } ) ; this . getInput ( "AT" + a ) . appendField ( c , "WHERE" + a ) ; 1 === a && ( this . moveInputBefore ( "AT1" , "AT2" ) , this . getInput ( "ORDINAL1" ) &&
this . moveInputBefore ( "ORDINAL1" , "AT2" ) ) ; module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _GET _SUBLIST _TAIL && this . moveInputBefore ( "TAIL" , null ) } } ;
module$exports$Blockly$libraryBlocks$lists . blocks . lists _sort = { init : function ( ) { this . jsonInit ( { message0 : "%{BKY_LISTS_SORT_TITLE}" , args0 : [ { type : "field_dropdown" , name : "TYPE" , options : [ [ "%{BKY_LISTS_SORT_TYPE_NUMERIC}" , "NUMERIC" ] , [ "%{BKY_LISTS_SORT_TYPE_TEXT}" , "TEXT" ] , [ "%{BKY_LISTS_SORT_TYPE_IGNORECASE}" , "IGNORE_CASE" ] ] } , { type : "field_dropdown" , name : "DIRECTION" , options : [ [ "%{BKY_LISTS_SORT_ORDER_ASCENDING}" , "1" ] , [ "%{BKY_LISTS_SORT_ORDER_DESCENDING}" , "-1" ] ] } , { type : "input_value" , name : "LIST" , check : "Array" } ] ,
output : "Array" , style : "list_blocks" , tooltip : "%{BKY_LISTS_SORT_TOOLTIP}" , helpUrl : "%{BKY_LISTS_SORT_HELPURL}" } ) } } ;
module$exports$Blockly$libraryBlocks$lists . blocks . lists _split = { init : function ( ) { const a = this , b = new module$contents$Blockly$libraryBlocks$lists _FieldDropdown ( [ [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SPLIT _LIST _FROM _TEXT , "SPLIT" ] , [ module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SPLIT _TEXT _FROM _LIST , "JOIN" ] ] , function ( c ) { a . updateType _ ( c ) } ) ; this . setHelpUrl ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SPLIT _HELPURL ) ; this . setStyle ( "list_blocks" ) ; this . appendValueInput ( "INPUT" ) . setCheck ( "String" ) . appendField ( b ,
"MODE" ) ; this . appendValueInput ( "DELIM" ) . setCheck ( "String" ) . appendField ( module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SPLIT _WITH _DELIMITER ) ; this . setInputsInline ( ! 0 ) ; this . setOutput ( ! 0 , "Array" ) ; this . setTooltip ( function ( ) { const c = a . getFieldValue ( "MODE" ) ; if ( "SPLIT" === c ) return module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SPLIT _TOOLTIP _SPLIT ; if ( "JOIN" === c ) return module$contents$Blockly$libraryBlocks$lists _Msg . LISTS _SPLIT _TOOLTIP _JOIN ; throw Error ( "Unknown mode: " + c ) ; } ) } , updateType _ : function ( a ) { if ( this . getFieldValue ( "MODE" ) !==
a ) { const b = this . getInput ( "INPUT" ) . connection ; b . setShadowDom ( null ) ; const c = b . targetBlock ( ) ; c && ( b . disconnect ( ) , c . isShadow ( ) ? c . dispose ( ) : this . bumpNeighbours ( ) ) } "SPLIT" === a ? ( this . outputConnection . setCheck ( "Array" ) , this . getInput ( "INPUT" ) . setCheck ( "String" ) ) : ( this . outputConnection . setCheck ( "String" ) , this . getInput ( "INPUT" ) . setCheck ( "Array" ) ) } , mutationToDom : function ( ) { const a = $ . module$build$src$core$utils$xml . createElement ( "mutation" ) ; a . setAttribute ( "mode" , this . getFieldValue ( "MODE" ) ) ; return a } , domToMutation : function ( a ) { this . updateType _ ( a . getAttribute ( "mode" ) ) } ,
saveExtraState : function ( ) { return null } , loadExtraState : function ( ) { } } ; module$contents$Blockly$libraryBlocks$lists _defineBlocks ( module$exports$Blockly$libraryBlocks$lists . blocks ) ; var module$exports$Blockly$libraryBlocks$colour = { } , module$contents$Blockly$libraryBlocks$colour _BlockDefinition = Object , module$contents$Blockly$libraryBlocks$colour _createBlockDefinitionsFromJsonArray = $ . module$build$src$core$common . createBlockDefinitionsFromJsonArray , module$contents$Blockly$libraryBlocks$colour _defineBlocks = $ . module$build$src$core$common . defineBlocks ;
module$exports$Blockly$libraryBlocks$colour . blocks = module$contents$Blockly$libraryBlocks$colour _createBlockDefinitionsFromJsonArray ( [ { type : "colour_picker" , message0 : "%1" , args0 : [ { type : "field_colour" , name : "COLOUR" , colour : "#ff0000" } ] , output : "Colour" , helpUrl : "%{BKY_COLOUR_PICKER_HELPURL}" , style : "colour_blocks" , tooltip : "%{BKY_COLOUR_PICKER_TOOLTIP}" , extensions : [ "parent_tooltip_when_inline" ] } , { type : "colour_random" , message0 : "%{BKY_COLOUR_RANDOM_TITLE}" , output : "Colour" , helpUrl : "%{BKY_COLOUR_RANDOM_HELPURL}" ,
style : "colour_blocks" , tooltip : "%{BKY_COLOUR_RANDOM_TOOLTIP}" } , { type : "colour_rgb" , message0 : "%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3" , args0 : [ { type : "input_value" , name : "RED" , check : "Number" , align : "RIGHT" } , { type : "input_value" , name : "GREEN" , check : "Number" , align : "RIGHT" } , { type : "input_value" , name : "BLUE" , check : "Number" , align : "RIGHT" } ] , output : "Colour" , helpUrl : "%{BKY_COLOUR_RGB_HELPURL}" , style : "colour_blocks" , tooltip : "%{BKY_COLOUR_RGB_TOOLTIP}" } , { type : "colour_blend" ,
message0 : "%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3" , args0 : [ { type : "input_value" , name : "COLOUR1" , check : "Colour" , align : "RIGHT" } , { type : "input_value" , name : "COLOUR2" , check : "Colour" , align : "RIGHT" } , { type : "input_value" , name : "RATIO" , check : "Number" , align : "RIGHT" } ] , output : "Colour" , helpUrl : "%{BKY_COLOUR_BLEND_HELPURL}" , style : "colour_blocks" , tooltip : "%{BKY_COLOUR_BLEND_TOOLTIP}" } ] ) ; module$contents$Blockly$libraryBlocks$colour _defineBlocks ( module$exports$Blockly$libraryBlocks$colour . blocks ) ; var module$exports$Blockly$libraryBlocks = { } , module$contents$Blockly$libraryBlocks _BlockDefinition = Object ; module$exports$Blockly$libraryBlocks . colour = module$exports$Blockly$libraryBlocks$colour ; module$exports$Blockly$libraryBlocks . lists = module$exports$Blockly$libraryBlocks$lists ; module$exports$Blockly$libraryBlocks . logic = module$exports$Blockly$libraryBlocks$logic ; module$exports$Blockly$libraryBlocks . loops = module$exports$Blockly$libraryBlocks$loops ; module$exports$Blockly$libraryBlocks . math = module$exports$Blockly$libraryBlocks$math ;
module$exports$Blockly$libraryBlocks . procedures = module$exports$Blockly$libraryBlocks$procedures ; module$exports$Blockly$libraryBlocks . texts = module$exports$Blockly$libraryBlocks$texts ; module$exports$Blockly$libraryBlocks . variables = module$exports$Blockly$libraryBlocks$variables ; module$exports$Blockly$libraryBlocks . variablesDynamic = module$exports$Blockly$libraryBlocks$variablesDynamic ;
module$exports$Blockly$libraryBlocks . blocks = Object . assign ( { } , module$exports$Blockly$libraryBlocks$colour . blocks , module$exports$Blockly$libraryBlocks$lists . blocks , module$exports$Blockly$libraryBlocks$logic . blocks , module$exports$Blockly$libraryBlocks$loops . blocks , module$exports$Blockly$libraryBlocks$math . blocks , module$exports$Blockly$libraryBlocks$procedures . blocks , module$exports$Blockly$libraryBlocks$variables . blocks , module$exports$Blockly$libraryBlocks$variablesDynamic . blocks ) ;
module$exports$Blockly$libraryBlocks . _ _namespace _ _ = $ ;
return module$exports$Blockly$libraryBlocks ;
2021-01-16 14:07:51 +00:00
} ) ) ;
//# sourceMappingURL=blocks_compressed.js.map