blockly 7.20211209.3 → 8.0.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blockly.d.ts +18963 -18432
- package/blockly.min.js +582 -546
- package/blockly_compressed.js +448 -416
- package/blockly_compressed.js.map +1 -1
- package/blocks/blocks.js +47 -0
- package/blocks/colour.js +13 -3
- package/blocks/lists.js +33 -18
- package/blocks/logic.js +24 -8
- package/blocks/loops.js +20 -7
- package/blocks/math.js +12 -3
- package/blocks/procedures.js +41 -27
- package/blocks/text.js +33 -18
- package/blocks/variables.js +14 -3
- package/blocks/variables_dynamic.js +13 -3
- package/blocks_compressed.js +129 -126
- package/blocks_compressed.js.map +1 -1
- package/core/block.js +1869 -1814
- package/core/block_drag_surface.js +201 -200
- package/core/block_dragger.js +377 -373
- package/core/block_svg.js +1593 -1479
- package/core/blockly.js +8 -22
- package/core/blocks.js +9 -2
- package/core/browser_events.js +22 -5
- package/core/bubble.js +841 -797
- package/core/bubble_dragger.js +213 -206
- package/core/bump_objects.js +2 -2
- package/core/clipboard.js +9 -9
- package/core/comment.js +353 -332
- package/core/common.js +46 -17
- package/core/component_manager.js +181 -174
- package/core/config.js +87 -0
- package/core/connection.js +595 -584
- package/core/connection_checker.js +242 -244
- package/core/connection_db.js +235 -230
- package/core/contextmenu.js +9 -6
- package/core/contextmenu_items.js +1 -2
- package/core/contextmenu_registry.js +93 -89
- package/core/css.js +474 -474
- package/core/delete_area.js +45 -42
- package/core/drag_target.js +57 -56
- package/core/dropdowndiv.js +153 -163
- package/core/events/events.js +2 -2
- package/core/events/events_abstract.js +89 -77
- package/core/events/events_block_base.js +37 -36
- package/core/events/events_block_change.js +130 -124
- package/core/events/events_block_create.js +73 -71
- package/core/events/events_block_delete.js +84 -82
- package/core/events/events_block_drag.js +50 -49
- package/core/events/events_block_move.js +147 -140
- package/core/events/events_bubble_open.js +51 -50
- package/core/events/events_click.js +48 -44
- package/core/events/events_comment_base.js +72 -69
- package/core/events/events_comment_change.js +63 -61
- package/core/events/events_comment_create.js +44 -42
- package/core/events/events_comment_delete.js +42 -40
- package/core/events/events_comment_move.js +106 -104
- package/core/events/events_marker_move.js +65 -64
- package/core/events/events_selected.js +46 -45
- package/core/events/events_theme_change.js +36 -35
- package/core/events/events_toolbox_item_select.js +46 -45
- package/core/events/events_trashcan_open.js +37 -36
- package/core/events/events_ui.js +47 -46
- package/core/events/events_ui_base.js +30 -29
- package/core/events/events_var_base.js +37 -36
- package/core/events/events_var_create.js +50 -48
- package/core/events/events_var_delete.js +50 -48
- package/core/events/events_var_rename.js +51 -49
- package/core/events/events_viewport.js +66 -65
- package/core/events/utils.js +29 -14
- package/core/events/workspace_events.js +49 -55
- package/core/extensions.js +4 -3
- package/core/field.js +1061 -997
- package/core/field_angle.js +462 -442
- package/core/field_checkbox.js +194 -182
- package/core/field_colour.js +519 -505
- package/core/field_dropdown.js +617 -598
- package/core/field_image.js +229 -220
- package/core/field_label.js +102 -91
- package/core/field_label_serializable.js +42 -41
- package/core/field_multilineinput.js +372 -358
- package/core/field_number.js +272 -253
- package/core/field_textinput.js +499 -467
- package/core/field_variable.js +458 -420
- package/core/flyout_base.js +1005 -952
- package/core/flyout_button.js +277 -260
- package/core/flyout_horizontal.js +304 -302
- package/core/flyout_metrics_manager.js +64 -64
- package/core/flyout_vertical.js +306 -300
- package/core/generator.js +459 -446
- package/core/gesture.js +829 -813
- package/core/grid.js +166 -163
- package/core/icon.js +168 -159
- package/core/inject.js +7 -5
- package/core/input.js +257 -248
- package/core/insertion_marker_manager.js +655 -624
- package/core/internal_constants.js +0 -129
- package/core/keyboard_nav/ast_node.js +605 -596
- package/core/keyboard_nav/basic_cursor.js +166 -165
- package/core/keyboard_nav/cursor.js +99 -97
- package/core/keyboard_nav/marker.js +83 -79
- package/core/keyboard_nav/tab_navigate_cursor.js +18 -23
- package/core/marker_manager.js +153 -141
- package/core/menu.js +377 -372
- package/core/menuitem.js +223 -217
- package/core/metrics_manager.js +403 -390
- package/core/mutator.js +468 -437
- package/core/names.js +229 -188
- package/core/options.js +290 -284
- package/core/procedures.js +29 -17
- package/core/registry.js +19 -16
- package/core/rendered_connection.js +482 -463
- package/core/renderers/common/block_rendering.js +9 -3
- package/core/renderers/common/constants.js +1119 -1112
- package/core/renderers/common/debug.js +14 -0
- package/core/renderers/common/debugger.js +338 -316
- package/core/renderers/common/drawer.js +380 -370
- package/core/renderers/common/i_path_object.js +2 -2
- package/core/renderers/common/info.js +626 -618
- package/core/renderers/common/marker_svg.js +579 -541
- package/core/renderers/common/path_object.js +203 -200
- package/core/renderers/common/renderer.js +220 -218
- package/core/renderers/geras/constants.js +36 -36
- package/core/renderers/geras/drawer.js +155 -147
- package/core/renderers/geras/highlight_constants.js +244 -238
- package/core/renderers/geras/highlighter.js +231 -179
- package/core/renderers/geras/info.js +392 -369
- package/core/renderers/geras/measurables/inline_input.js +25 -19
- package/core/renderers/geras/measurables/statement_input.js +23 -17
- package/core/renderers/geras/path_object.js +106 -121
- package/core/renderers/geras/renderer.js +96 -98
- package/core/renderers/measurables/base.js +30 -18
- package/core/renderers/measurables/bottom_row.js +83 -80
- package/core/renderers/measurables/connection.js +22 -15
- package/core/renderers/measurables/external_value_input.js +35 -22
- package/core/renderers/measurables/field.js +35 -20
- package/core/renderers/measurables/hat.js +18 -13
- package/core/renderers/measurables/icon.js +24 -17
- package/core/renderers/measurables/in_row_spacer.js +15 -13
- package/core/renderers/measurables/inline_input.js +43 -33
- package/core/renderers/measurables/input_connection.js +41 -28
- package/core/renderers/measurables/input_row.js +50 -44
- package/core/renderers/measurables/jagged_edge.js +14 -12
- package/core/renderers/measurables/next_connection.js +16 -14
- package/core/renderers/measurables/output_connection.js +26 -20
- package/core/renderers/measurables/previous_connection.js +16 -15
- package/core/renderers/measurables/round_corner.js +20 -18
- package/core/renderers/measurables/row.js +184 -168
- package/core/renderers/measurables/spacer_row.js +38 -23
- package/core/renderers/measurables/square_corner.js +18 -16
- package/core/renderers/measurables/statement_input.js +23 -20
- package/core/renderers/measurables/top_row.js +88 -85
- package/core/renderers/minimalist/constants.js +8 -7
- package/core/renderers/minimalist/drawer.js +11 -10
- package/core/renderers/minimalist/info.js +18 -18
- package/core/renderers/minimalist/renderer.js +40 -39
- package/core/renderers/thrasos/info.js +258 -248
- package/core/renderers/thrasos/renderer.js +20 -20
- package/core/renderers/zelos/constants.js +898 -873
- package/core/renderers/zelos/drawer.js +186 -169
- package/core/renderers/zelos/info.js +502 -479
- package/core/renderers/zelos/marker_svg.js +129 -115
- package/core/renderers/zelos/measurables/bottom_row.js +31 -30
- package/core/renderers/zelos/measurables/inputs.js +22 -21
- package/core/renderers/zelos/measurables/row_elements.js +14 -13
- package/core/renderers/zelos/measurables/top_row.js +34 -33
- package/core/renderers/zelos/path_object.js +181 -180
- package/core/renderers/zelos/renderer.js +91 -92
- package/core/scrollbar.js +759 -713
- package/core/scrollbar_pair.js +250 -245
- package/core/serialization/blocks.js +20 -10
- package/core/serialization/workspaces.js +3 -2
- package/core/shortcut_registry.js +286 -277
- package/core/sprites.js +31 -0
- package/core/theme.js +135 -141
- package/core/theme_manager.js +147 -143
- package/core/toolbox/category.js +602 -576
- package/core/toolbox/collapsible_category.js +226 -227
- package/core/toolbox/separator.js +70 -61
- package/core/toolbox/toolbox.js +934 -927
- package/core/toolbox/toolbox_item.js +115 -99
- package/core/tooltip.js +108 -35
- package/core/touch.js +8 -3
- package/core/touch_gesture.js +254 -251
- package/core/trashcan.js +606 -595
- package/core/utils/coordinate.js +97 -95
- package/core/utils/dom.js +2 -2
- package/core/utils/global.js +2 -0
- package/core/utils/rect.js +41 -37
- package/core/utils/sentinel.js +25 -0
- package/core/utils/size.js +30 -27
- package/core/utils/svg.js +18 -16
- package/core/utils/toolbox.js +1 -1
- package/core/variable_map.js +325 -341
- package/core/variable_model.js +55 -54
- package/core/variables.js +9 -2
- package/core/variables_dynamic.js +3 -1
- package/core/warning.js +126 -120
- package/core/widgetdiv.js +4 -4
- package/core/workspace.js +685 -664
- package/core/workspace_audio.js +124 -118
- package/core/workspace_comment.js +308 -298
- package/core/workspace_comment_svg.js +1029 -951
- package/core/workspace_drag_surface_svg.js +147 -140
- package/core/workspace_dragger.js +70 -71
- package/core/workspace_svg.js +2322 -2297
- package/core/xml.js +30 -20
- package/core/zoom_controls.js +431 -439
- package/dart_compressed.js +5 -4
- package/dart_compressed.js.map +1 -1
- package/generators/dart/colour.js +56 -64
- package/generators/dart/lists.js +61 -50
- package/generators/dart/math.js +160 -148
- package/generators/dart/text.js +83 -61
- package/generators/javascript/colour.js +37 -34
- package/generators/javascript/lists.js +50 -43
- package/generators/javascript/math.js +123 -139
- package/generators/javascript/text.js +67 -81
- package/generators/lua/colour.js +25 -23
- package/generators/lua/lists.js +97 -69
- package/generators/lua/logic.js +1 -2
- package/generators/lua/math.js +182 -144
- package/generators/lua/text.js +116 -99
- package/generators/php/colour.js +38 -32
- package/generators/php/lists.js +109 -89
- package/generators/php/math.js +90 -81
- package/generators/php/text.js +63 -61
- package/generators/python/colour.js +18 -18
- package/generators/python/lists.js +38 -30
- package/generators/python/loops.js +12 -8
- package/generators/python/math.js +104 -106
- package/generators/python/text.js +34 -30
- package/javascript_compressed.js +5 -4
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +5 -4
- package/lua_compressed.js.map +1 -1
- package/msg/ab.js +1 -2
- package/msg/ace.js +1 -2
- package/msg/af.js +1 -2
- package/msg/am.js +1 -2
- package/msg/ar.js +1 -2
- package/msg/ast.js +1 -2
- package/msg/az.js +3 -4
- package/msg/ba.js +1 -2
- package/msg/bcc.js +1 -2
- package/msg/be-tarask.js +1 -2
- package/msg/be.js +5 -6
- package/msg/bg.js +1 -2
- package/msg/bn.js +1 -2
- package/msg/br.js +1 -2
- package/msg/bs.js +1 -2
- package/msg/ca.js +1 -2
- package/msg/cdo.js +1 -2
- package/msg/cs.js +16 -17
- package/msg/da.js +1 -2
- package/msg/de.js +2 -3
- package/msg/diq.js +2 -3
- package/msg/dty.js +1 -2
- package/msg/ee.js +1 -2
- package/msg/el.js +1 -2
- package/msg/en-gb.js +1 -2
- package/msg/en.js +1 -2
- package/msg/eo.js +2 -3
- package/msg/es.js +2 -3
- package/msg/et.js +1 -2
- package/msg/eu.js +1 -2
- package/msg/fa.js +2 -3
- package/msg/fi.js +1 -2
- package/msg/fo.js +1 -2
- package/msg/fr.js +5 -6
- package/msg/frr.js +1 -2
- package/msg/gl.js +1 -2
- package/msg/gn.js +1 -2
- package/msg/gor.js +1 -2
- package/msg/ha.js +1 -2
- package/msg/hak.js +1 -2
- package/msg/he.js +2 -3
- package/msg/hi.js +1 -2
- package/msg/hr.js +3 -4
- package/msg/hrx.js +1 -2
- package/msg/hu.js +1 -2
- package/msg/hy.js +3 -4
- package/msg/ia.js +1 -2
- package/msg/id.js +13 -14
- package/msg/ig.js +1 -2
- package/msg/inh.js +15 -16
- package/msg/is.js +1 -2
- package/msg/it.js +1 -2
- package/msg/ja.js +8 -9
- package/msg/ka.js +1 -2
- package/msg/kab.js +1 -2
- package/msg/kbd-cyrl.js +1 -2
- package/msg/km.js +1 -2
- package/msg/kn.js +1 -2
- package/msg/ko.js +1 -2
- package/msg/ksh.js +1 -2
- package/msg/ku-latn.js +1 -2
- package/msg/ky.js +1 -2
- package/msg/la.js +1 -2
- package/msg/lb.js +1 -2
- package/msg/lki.js +1 -2
- package/msg/lo.js +1 -2
- package/msg/lrc.js +1 -2
- package/msg/lt.js +1 -2
- package/msg/lv.js +30 -31
- package/msg/mg.js +1 -2
- package/msg/mk.js +1 -2
- package/msg/ml.js +1 -2
- package/msg/mnw.js +1 -2
- package/msg/ms.js +1 -2
- package/msg/my.js +1 -2
- package/msg/mzn.js +1 -2
- package/msg/nb.js +1 -2
- package/msg/ne.js +1 -2
- package/msg/nl.js +1 -2
- package/msg/oc.js +1 -2
- package/msg/olo.js +1 -2
- package/msg/pa.js +4 -5
- package/msg/pl.js +1 -2
- package/msg/pms.js +1 -2
- package/msg/ps.js +1 -2
- package/msg/pt-br.js +1 -2
- package/msg/pt.js +1 -2
- package/msg/ro.js +1 -2
- package/msg/ru.js +1 -2
- package/msg/sc.js +1 -2
- package/msg/sco.js +1 -2
- package/msg/sd.js +1 -2
- package/msg/shn.js +1 -2
- package/msg/si.js +1 -2
- package/msg/sk.js +1 -2
- package/msg/skr-arab.js +1 -2
- package/msg/sl.js +1 -2
- package/msg/smn.js +435 -0
- package/msg/sq.js +1 -2
- package/msg/sr-latn.js +1 -2
- package/msg/sr.js +1 -2
- package/msg/sv.js +1 -2
- package/msg/sw.js +1 -2
- package/msg/ta.js +1 -2
- package/msg/tcy.js +1 -2
- package/msg/te.js +2 -3
- package/msg/th.js +1 -2
- package/msg/ti.js +1 -2
- package/msg/tl.js +1 -2
- package/msg/tlh.js +1 -2
- package/msg/tr.js +1 -2
- package/msg/ug-arab.js +1 -2
- package/msg/uk.js +1 -2
- package/msg/ur.js +1 -2
- package/msg/uz.js +1 -2
- package/msg/vi.js +1 -2
- package/msg/xmf.js +1 -2
- package/msg/yo.js +1 -2
- package/msg/yue.js +2 -3
- package/msg/zgh.js +1 -2
- package/msg/zh-hans.js +4 -5
- package/msg/zh-hant.js +4 -5
- package/package.json +7 -6
- package/php_compressed.js +5 -4
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +5 -4
- package/python_compressed.js.map +1 -1
- package/blocks/all.js +0 -36
package/blockly_compressed.js
CHANGED
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
} else if (typeof exports === 'object') { // Node.js
|
|
8
8
|
module.exports = factory();
|
|
9
9
|
} else { // Browser
|
|
10
|
-
|
|
10
|
+
var factoryExports = factory();
|
|
11
|
+
root.Blockly = factoryExports;
|
|
11
12
|
}
|
|
12
13
|
}(this, function() {
|
|
13
|
-
|
|
14
|
+
var $={};
|
|
14
15
|
/*
|
|
15
16
|
|
|
16
17
|
Copyright The Closure Library Authors.
|
|
@@ -35,14 +36,15 @@ $.$jscomp.polyfill("Symbol",function(a){if(a)return a;var b=function(f,g){this.$
|
|
|
35
36
|
$.$jscomp.polyfill("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=$.$jscomp.global[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&$.$jscomp.defineProperty(d.prototype,a,{configurable:!0,writable:!0,value:function(){return $.$jscomp.iteratorPrototype($.$jscomp.arrayIteratorImpl(this))}})}return a},
|
|
36
37
|
"es6","es3");$.$jscomp.iteratorPrototype=function(a){a={next:a};a[Symbol.iterator]=function(){return this};return a};$.$jscomp.iteratorFromArray=function(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e};
|
|
37
38
|
$.$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $.$jscomp.iteratorFromArray(this,function(b){return b})}},"es6","es3");$.$jscomp.polyfill("Object.setPrototypeOf",function(a){return a||$.$jscomp.setPrototypeOf},"es6","es5");$.$jscomp.polyfill("Array.prototype.values",function(a){return a?a:function(){return $.$jscomp.iteratorFromArray(this,function(b,c){return c})}},"es8","es3");
|
|
39
|
+
$.$jscomp.checkEs6ConformanceViaProxy=function(){try{var a={},b=Object.create(new $.$jscomp.global.Proxy(a,{get:function(c,d,e){return c==a&&"q"==d&&e==b}}));return!0===b.q}catch(c){return!1}};$.$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$.$jscomp.ES6_CONFORMANCE=$.$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$.$jscomp.checkEs6ConformanceViaProxy();
|
|
40
|
+
$.$jscomp.polyfill("WeakMap",function(a){function b(){if(!a||!Object.seal)return!1;try{var l=Object.seal({}),m=Object.seal({}),n=new a([[l,2],[m,3]]);if(2!=n.get(l)||3!=n.get(m))return!1;n.delete(l);n.set(m,4);return!n.has(l)&&4==n.get(m)}catch(p){return!1}}function c(){}function d(l){var m=typeof l;return"object"===m&&null!==l||"function"===m}function e(l){if(!$.$jscomp.owns(l,g)){var m=new c;$.$jscomp.defineProperty(l,g,{value:m})}}function f(l){if(!$.$jscomp.ISOLATE_POLYFILLS){var m=Object[l];
|
|
41
|
+
m&&(Object[l]=function(n){if(n instanceof c)return n;Object.isExtensible(n)&&e(n);return m(n)})}}if($.$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(a&&$.$jscomp.ES6_CONFORMANCE)return a}else if(b())return a;var g="$jscomp_hidden_"+Math.random();f("freeze");f("preventExtensions");f("seal");var h=0,k=function(l){this.id_=(h+=Math.random()+1).toString();if(l){l=$.$jscomp.makeIterator(l);for(var m;!(m=l.next()).done;)m=m.value,this.set(m[0],m[1])}};k.prototype.set=function(l,m){if(!d(l))throw Error("Invalid WeakMap key");
|
|
42
|
+
e(l);if(!$.$jscomp.owns(l,g))throw Error("WeakMap key fail: "+l);l[g][this.id_]=m;return this};k.prototype.get=function(l){return d(l)&&$.$jscomp.owns(l,g)?l[g][this.id_]:void 0};k.prototype.has=function(l){return d(l)&&$.$jscomp.owns(l,g)&&$.$jscomp.owns(l[g],this.id_)};k.prototype.delete=function(l){return d(l)&&$.$jscomp.owns(l,g)&&$.$jscomp.owns(l[g],this.id_)?delete l[g][this.id_]:!1};return k},"es6","es3");
|
|
38
43
|
$.$jscomp.polyfill("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)$.$jscomp.owns(b,d)&&c.push([d,b[d]]);return c}},"es8","es3");$.$jscomp.polyfill("Object.getOwnPropertySymbols",function(a){return a?a:function(){return[]}},"es6","es5");
|
|
39
44
|
$.$jscomp.polyfill("Reflect.ownKeys",function(a){return a?a:function(b){var c=[],d=Object.getOwnPropertyNames(b);b=Object.getOwnPropertySymbols(b);for(var e=0;e<d.length;e++)("jscomp_symbol_"==d[e].substring(0,14)?b:c).push(d[e]);return c.concat(b)}},"es6","es5");$.$jscomp.polyfill("Object.getOwnPropertyDescriptors",function(a){return a?a:function(b){for(var c={},d=Reflect.ownKeys(b),e=0;e<d.length;e++)c[d[e]]=Object.getOwnPropertyDescriptor(b,d[e]);return c}},"es8","es5");
|
|
40
45
|
$.$jscomp.polyfill("Array.prototype.fill",function(a){return a?a:function(b,c,d){var e=this.length||0;0>c&&(c=Math.max(0,e+c));if(null==d||d>e)d=e;d=Number(d);0>d&&(d=Math.max(0,e+d));for(c=Number(c||0);c<d;c++)this[c]=b;return this}},"es6","es3");$.$jscomp.typedArrayFill=function(a){return a?a:Array.prototype.fill};$.$jscomp.polyfill("Int8Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");$.$jscomp.polyfill("Uint8Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");
|
|
41
46
|
$.$jscomp.polyfill("Uint8ClampedArray.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");$.$jscomp.polyfill("Int16Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");$.$jscomp.polyfill("Uint16Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");$.$jscomp.polyfill("Int32Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");$.$jscomp.polyfill("Uint32Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");
|
|
42
|
-
$.$jscomp.polyfill("Float32Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");$.$jscomp.polyfill("Float64Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");$.$jscomp.
|
|
43
|
-
$.$jscomp.polyfill("WeakMap",function(a){function b(){if(!a||!Object.seal)return!1;try{var l=Object.seal({}),m=Object.seal({}),n=new a([[l,2],[m,3]]);if(2!=n.get(l)||3!=n.get(m))return!1;n.delete(l);n.set(m,4);return!n.has(l)&&4==n.get(m)}catch(p){return!1}}function c(){}function d(l){var m=typeof l;return"object"===m&&null!==l||"function"===m}function e(l){if(!$.$jscomp.owns(l,g)){var m=new c;$.$jscomp.defineProperty(l,g,{value:m})}}function f(l){if(!$.$jscomp.ISOLATE_POLYFILLS){var m=Object[l];
|
|
44
|
-
m&&(Object[l]=function(n){if(n instanceof c)return n;Object.isExtensible(n)&&e(n);return m(n)})}}if($.$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(a&&$.$jscomp.ES6_CONFORMANCE)return a}else if(b())return a;var g="$jscomp_hidden_"+Math.random();f("freeze");f("preventExtensions");f("seal");var h=0,k=function(l){this.id_=(h+=Math.random()+1).toString();if(l){l=$.$jscomp.makeIterator(l);for(var m;!(m=l.next()).done;)m=m.value,this.set(m[0],m[1])}};k.prototype.set=function(l,m){if(!d(l))throw Error("Invalid WeakMap key");
|
|
45
|
-
e(l);if(!$.$jscomp.owns(l,g))throw Error("WeakMap key fail: "+l);l[g][this.id_]=m;return this};k.prototype.get=function(l){return d(l)&&$.$jscomp.owns(l,g)?l[g][this.id_]:void 0};k.prototype.has=function(l){return d(l)&&$.$jscomp.owns(l,g)&&$.$jscomp.owns(l[g],this.id_)};k.prototype.delete=function(l){return d(l)&&$.$jscomp.owns(l,g)&&$.$jscomp.owns(l[g],this.id_)?delete l[g][this.id_]:!1};return k},"es6","es3");$.$jscomp.MapEntry=function(){};
|
|
47
|
+
$.$jscomp.polyfill("Float32Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");$.$jscomp.polyfill("Float64Array.prototype.fill",$.$jscomp.typedArrayFill,"es6","es5");$.$jscomp.MapEntry=function(){};
|
|
46
48
|
$.$jscomp.polyfill("Map",function(a){function b(){if($.$jscomp.ASSUME_NO_NATIVE_MAP||!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var k=Object.seal({x:4}),l=new a($.$jscomp.makeIterator([[k,"s"]]));if("s"!=l.get(k)||1!=l.size||l.get({x:4})||l.set({x:4},"t")!=l||2!=l.size)return!1;var m=l.entries(),n=m.next();if(n.done||n.value[0]!=k||"s"!=n.value[1])return!1;n=m.next();return n.done||4!=n.value[0].x||"t"!=n.value[1]||!m.next().done?!1:!0}catch(p){return!1}}
|
|
47
49
|
if($.$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(a&&$.$jscomp.ES6_CONFORMANCE)return a}else if(b())return a;var c=new WeakMap,d=function(k){this.data_={};this.head_=g();this.size=0;if(k){k=$.$jscomp.makeIterator(k);for(var l;!(l=k.next()).done;)l=l.value,this.set(l[0],l[1])}};d.prototype.set=function(k,l){k=0===k?0:k;var m=e(this,k);m.list||(m.list=this.data_[m.id]=[]);m.entry?m.entry.value=l:(m.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:k,value:l},m.list.push(m.entry),
|
|
48
50
|
this.head_.previous.next=m.entry,this.head_.previous=m.entry,this.size++);return this};d.prototype.delete=function(k){k=e(this,k);return k.entry&&k.list?(k.list.splice(k.index,1),k.list.length||delete this.data_[k.id],k.entry.previous.next=k.entry.next,k.entry.next.previous=k.entry.previous,k.entry.head=null,this.size--,!0):!1};d.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=g();this.size=0};d.prototype.has=function(k){return!!e(this,k).entry};d.prototype.get=function(k){return(k=
|
|
@@ -84,9 +86,10 @@ $.module$exports$Blockly$common.setSelected=function(a){module$contents$Blockly$
|
|
|
84
86
|
$.module$exports$Blockly$common.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=a.getCachedParentSvgSize(),d=b.parentNode;if(d){var e=d.offsetWidth;d=d.offsetHeight;c.width!==e&&(b.setAttribute("width",e+"px"),a.setCachedParentSvgSize(e,null));c.height!==d&&(b.setAttribute("height",d+"px"),a.setCachedParentSvgSize(null,d));a.resize()}};$.module$exports$Blockly$common.draggingConnections=[];
|
|
85
87
|
$.module$exports$Blockly$common.getBlockTypeCounts=function(a,b){var c=Object.create(null),d=a.getDescendants(!0);b&&(a=a.getNextBlock())&&(a=d.indexOf(a),d.splice(a,d.length-a));for(a=0;b=d[a];a++)c[b.type]?c[b.type]++:c[b.type]=1;return c};var module$contents$Blockly$common_jsonInitFactory=function(a){return function(){this.jsonInit(a)}};$.module$exports$Blockly$common.defineBlocksWithJsonArray=function(a){(0,$.module$exports$Blockly$common.defineBlocks)((0,$.module$exports$Blockly$common.createBlockDefinitionsFromJsonArray)(a))};
|
|
86
88
|
$.module$exports$Blockly$common.createBlockDefinitionsFromJsonArray=function(a){for(var b={},c=0;c<a.length;c++){var d=a[c];if(d){var e=d.type;e?b[e]={init:module$contents$Blockly$common_jsonInitFactory(d)}:console.warn("Block definition #"+c+" in JSON array is missing a type attribute. Skipping.")}else console.warn("Block definition #"+c+" in JSON array is "+d+". Skipping")}return b};
|
|
87
|
-
$.module$exports$Blockly$common.defineBlocks=function(a){for(var b=$.$jscomp.makeIterator(Object.keys(a)),c=b.next();!c.done;c=b.next()){c=c.value;var d=a[c];c in module$exports$Blockly$blocks.Blocks&&console.warn('Block definiton "'+c+'" overwrites previous definition.');module$exports$Blockly$blocks.Blocks[c]=d}};var module$exports$Blockly$Tooltip={},module$contents$Blockly$
|
|
88
|
-
|
|
89
|
-
module$
|
|
89
|
+
$.module$exports$Blockly$common.defineBlocks=function(a){for(var b=$.$jscomp.makeIterator(Object.keys(a)),c=b.next();!c.done;c=b.next()){c=c.value;var d=a[c];c in module$exports$Blockly$blocks.Blocks&&console.warn('Block definiton "'+c+'" overwrites previous definition.');module$exports$Blockly$blocks.Blocks[c]=d}};var module$exports$Blockly$Tooltip={},module$contents$Blockly$Tooltip_customTooltip=void 0;module$exports$Blockly$Tooltip.setCustomTooltip=function(a){module$contents$Blockly$Tooltip_customTooltip=a};module$exports$Blockly$Tooltip.getCustomTooltip=function(){return module$contents$Blockly$Tooltip_customTooltip};var module$contents$Blockly$Tooltip_visible=!1;module$exports$Blockly$Tooltip.isVisible=function(){return module$contents$Blockly$Tooltip_visible};
|
|
90
|
+
Object.defineProperties(module$exports$Blockly$Tooltip,{visible:{get:function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.Tooltip.visible","September 2021","September 2022","Blockly.Tooltip.isVisible()");return(0,module$exports$Blockly$Tooltip.isVisible)()}}});var module$contents$Blockly$Tooltip_blocked=!1;module$exports$Blockly$Tooltip.LIMIT=50;
|
|
91
|
+
var module$contents$Blockly$Tooltip_mouseOutPid=0,module$contents$Blockly$Tooltip_showPid=0,module$contents$Blockly$Tooltip_lastX=0,module$contents$Blockly$Tooltip_lastY=0,module$contents$Blockly$Tooltip_element=null,module$contents$Blockly$Tooltip_poisonedElement=null;module$exports$Blockly$Tooltip.OFFSET_X=0;module$exports$Blockly$Tooltip.OFFSET_Y=10;module$exports$Blockly$Tooltip.RADIUS_OK=10;module$exports$Blockly$Tooltip.HOVER_MS=750;module$exports$Blockly$Tooltip.MARGINS=5;
|
|
92
|
+
var module$contents$Blockly$Tooltip_DIV=null;module$exports$Blockly$Tooltip.getDiv=function(){return module$contents$Blockly$Tooltip_DIV};Object.defineProperties(module$exports$Blockly$Tooltip,{DIV:{get:function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.Tooltip.DIV","September 2021","September 2022","Blockly.Tooltip.getDiv()");return(0,module$exports$Blockly$Tooltip.getDiv)()}}});
|
|
90
93
|
module$exports$Blockly$Tooltip.getTooltipOfObject=function(a){if(a=module$contents$Blockly$Tooltip_getTargetObject(a)){for(a=a.tooltip;"function"===typeof a;)a=a();if("string"!==typeof a)throw Error("Tooltip function must return a string.");return a}return""};var module$contents$Blockly$Tooltip_getTargetObject=function(a){for(;a&&a.tooltip;){if("string"===typeof a.tooltip||"function"===typeof a.tooltip)return a;a=a.tooltip}return null};
|
|
91
94
|
module$exports$Blockly$Tooltip.createDom=function(){module$contents$Blockly$Tooltip_DIV||(module$contents$Blockly$Tooltip_DIV=document.createElement("div"),module$contents$Blockly$Tooltip_DIV.className="blocklyTooltipDiv",((0,$.module$exports$Blockly$common.getParentContainer)()||document.body).appendChild(module$contents$Blockly$Tooltip_DIV))};
|
|
92
95
|
module$exports$Blockly$Tooltip.bindMouseEvents=function(a){a.mouseOverWrapper_=(0,module$exports$Blockly$browserEvents.bind)(a,"mouseover",null,module$contents$Blockly$Tooltip_onMouseOver);a.mouseOutWrapper_=(0,module$exports$Blockly$browserEvents.bind)(a,"mouseout",null,module$contents$Blockly$Tooltip_onMouseOut);a.addEventListener("mousemove",module$contents$Blockly$Tooltip_onMouseMove,!1)};
|
|
@@ -96,10 +99,11 @@ var module$contents$Blockly$Tooltip_onMouseOver=function(a){module$contents$Bloc
|
|
|
96
99
|
module$contents$Blockly$Tooltip_lastX-a.pageX;a=module$contents$Blockly$Tooltip_lastY-a.pageY;Math.sqrt(b*b+a*a)>module$exports$Blockly$Tooltip.RADIUS_OK&&(0,module$exports$Blockly$Tooltip.hide)()}else module$contents$Blockly$Tooltip_poisonedElement!==module$contents$Blockly$Tooltip_element&&(clearTimeout(module$contents$Blockly$Tooltip_showPid),module$contents$Blockly$Tooltip_lastX=a.pageX,module$contents$Blockly$Tooltip_lastY=a.pageY,module$contents$Blockly$Tooltip_showPid=setTimeout(module$contents$Blockly$Tooltip_show,
|
|
97
100
|
module$exports$Blockly$Tooltip.HOVER_MS))};module$exports$Blockly$Tooltip.dispose=function(){module$contents$Blockly$Tooltip_poisonedElement=module$contents$Blockly$Tooltip_element=null;(0,module$exports$Blockly$Tooltip.hide)()};module$exports$Blockly$Tooltip.hide=function(){module$contents$Blockly$Tooltip_visible&&(module$contents$Blockly$Tooltip_visible=!1,module$contents$Blockly$Tooltip_DIV&&(module$contents$Blockly$Tooltip_DIV.style.display="none"));module$contents$Blockly$Tooltip_showPid&&clearTimeout(module$contents$Blockly$Tooltip_showPid)};
|
|
98
101
|
module$exports$Blockly$Tooltip.block=function(){(0,module$exports$Blockly$Tooltip.hide)();module$contents$Blockly$Tooltip_blocked=!0};module$exports$Blockly$Tooltip.unblock=function(){module$contents$Blockly$Tooltip_blocked=!1};
|
|
99
|
-
var module$contents$Blockly$
|
|
100
|
-
document.createElement("div");c.appendChild(document.createTextNode(a[b]));module$contents$Blockly$Tooltip_DIV.appendChild(c)}
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
var module$contents$Blockly$Tooltip_renderContent=function(){module$contents$Blockly$Tooltip_DIV&&module$contents$Blockly$Tooltip_element&&("function"===typeof module$contents$Blockly$Tooltip_customTooltip?module$contents$Blockly$Tooltip_customTooltip(module$contents$Blockly$Tooltip_DIV,module$contents$Blockly$Tooltip_element):module$contents$Blockly$Tooltip_renderDefaultContent())},module$contents$Blockly$Tooltip_renderDefaultContent=function(){var a=(0,module$exports$Blockly$Tooltip.getTooltipOfObject)(module$contents$Blockly$Tooltip_element);
|
|
103
|
+
a=(0,$.module$exports$Blockly$utils$string.wrap)(a,module$exports$Blockly$Tooltip.LIMIT);a=a.split("\n");for(var b=0;b<a.length;b++){var c=document.createElement("div");c.appendChild(document.createTextNode(a[b]));module$contents$Blockly$Tooltip_DIV.appendChild(c)}},module$contents$Blockly$Tooltip_getPosition=function(a){var b=document.documentElement.clientWidth,c=document.documentElement.clientHeight,d=module$contents$Blockly$Tooltip_lastX;d=a?d-(module$exports$Blockly$Tooltip.OFFSET_X+module$contents$Blockly$Tooltip_DIV.offsetWidth):
|
|
104
|
+
d+module$exports$Blockly$Tooltip.OFFSET_X;var e=module$contents$Blockly$Tooltip_lastY+module$exports$Blockly$Tooltip.OFFSET_Y;e+module$contents$Blockly$Tooltip_DIV.offsetHeight>c+window.scrollY&&(e-=module$contents$Blockly$Tooltip_DIV.offsetHeight+2*module$exports$Blockly$Tooltip.OFFSET_Y);a?d=Math.max(module$exports$Blockly$Tooltip.MARGINS-window.scrollX,d):d+module$contents$Blockly$Tooltip_DIV.offsetWidth>b+window.scrollX-2*module$exports$Blockly$Tooltip.MARGINS&&(d=b-module$contents$Blockly$Tooltip_DIV.offsetWidth-
|
|
105
|
+
2*module$exports$Blockly$Tooltip.MARGINS);return{x:d,y:e}},module$contents$Blockly$Tooltip_show=function(){if(!module$contents$Blockly$Tooltip_blocked&&(module$contents$Blockly$Tooltip_poisonedElement=module$contents$Blockly$Tooltip_element,module$contents$Blockly$Tooltip_DIV)){module$contents$Blockly$Tooltip_DIV.textContent="";module$contents$Blockly$Tooltip_renderContent();var a=module$contents$Blockly$Tooltip_element.RTL;module$contents$Blockly$Tooltip_DIV.style.direction=a?"rtl":"ltr";module$contents$Blockly$Tooltip_DIV.style.display=
|
|
106
|
+
"block";module$contents$Blockly$Tooltip_visible=!0;a=module$contents$Blockly$Tooltip_getPosition(a);var b=a.y;module$contents$Blockly$Tooltip_DIV.style.left=a.x+"px";module$contents$Blockly$Tooltip_DIV.style.top=b+"px"}};var module$exports$Blockly$utils$dom={SVG_NS:"http://www.w3.org/2000/svg",HTML_NS:"http://www.w3.org/1999/xhtml",XLINK_NS:"http://www.w3.org/1999/xlink",NodeType:{ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16}},module$contents$Blockly$utils$dom_cacheWidths=null,module$contents$Blockly$utils$dom_cacheReference=0,module$contents$Blockly$utils$dom_canvasContext=null;
|
|
103
107
|
module$exports$Blockly$utils$dom.createSvgElement=function(a,b,c){a=document.createElementNS(module$exports$Blockly$utils$dom.SVG_NS,String(a));for(var d in b)a.setAttribute(d,b[d]);document.body.runtimeStyle&&(a.runtimeStyle=a.currentStyle=a.style);c&&c.appendChild(a);return a};module$exports$Blockly$utils$dom.addClass=function(a,b){var c=a.getAttribute("class")||"";if(-1!==(" "+c+" ").indexOf(" "+b+" "))return!1;c&&(c+=" ");a.setAttribute("class",c+b);return!0};
|
|
104
108
|
module$exports$Blockly$utils$dom.removeClasses=function(a,b){b=b.split(" ");for(var c=0;c<b.length;c++)(0,module$exports$Blockly$utils$dom.removeClass)(a,b[c])};module$exports$Blockly$utils$dom.removeClass=function(a,b){var c=a.getAttribute("class");if(-1===(" "+c+" ").indexOf(" "+b+" "))return!1;c=c.split(/\s+/);for(var d=0;d<c.length;d++)c[d]&&c[d]!==b||(c.splice(d,1),d--);c.length?a.setAttribute("class",c.join(" ")):a.removeAttribute("class");return!0};
|
|
105
109
|
module$exports$Blockly$utils$dom.hasClass=function(a,b){return-1!==(" "+a.getAttribute("class")+" ").indexOf(" "+b+" ")};module$exports$Blockly$utils$dom.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};module$exports$Blockly$utils$dom.insertAfter=function(a,b){var c=b.nextSibling;b=b.parentNode;if(!b)throw Error("Reference node has no parent.");c?b.insertBefore(a,c):b.appendChild(a)};
|
|
@@ -141,10 +145,10 @@ module$exports$Blockly$Events$utils.COMMENT_MOVE="comment_move";module$exports$B
|
|
|
141
145
|
module$exports$Blockly$Events$utils.fire=function(a){(0,module$exports$Blockly$Events$utils.isEnabled)()&&(module$contents$Blockly$Events$utils_FIRE_QUEUE.length||setTimeout(module$contents$Blockly$Events$utils_fireNow,0),module$contents$Blockly$Events$utils_FIRE_QUEUE.push(a))};
|
|
142
146
|
var module$contents$Blockly$Events$utils_fireNow=function(){for(var a=(0,module$exports$Blockly$Events$utils.filter)(module$contents$Blockly$Events$utils_FIRE_QUEUE,!0),b=module$contents$Blockly$Events$utils_FIRE_QUEUE.length=0,c;c=a[b];b++)if(c.workspaceId){var d=module$exports$Blockly$Workspace.Workspace.getById(c.workspaceId);d&&d.fireChangeListener(c)}};
|
|
143
147
|
module$exports$Blockly$Events$utils.filter=function(a,b){a=a.slice();b||a.reverse();for(var c=[],d=Object.create(null),e=0,f=void 0;f=a[e];e++)if(!f.isNull()){var g=[f.isUiEvent?module$exports$Blockly$Events$utils.UI:f.type,f.blockId,f.workspaceId].join(" "),h=d[g],k=h?h.event:null;if(!h)d[g]={event:f,index:e},c.push(f);else if(f.type===module$exports$Blockly$Events$utils.MOVE&&h.index===e-1)k.newParentId=f.newParentId,k.newInputName=f.newInputName,k.newCoordinate=f.newCoordinate,h.index=e;else if(f.type===
|
|
144
|
-
module$exports$Blockly$Events$utils.CHANGE&&f.element===k.element&&f.name===k.name)k.newValue=f.newValue;else if(f.type===module$exports$Blockly$Events$utils.VIEWPORT_CHANGE)k.viewTop=
|
|
145
|
-
"mutation"===c.element&&a.unshift(a.splice(b,1)[0]);return a};module$exports$Blockly$Events$utils.clearPendingUndo=function(){for(var a=0,b;b=module$contents$Blockly$Events$utils_FIRE_QUEUE[a];a++)b.recordUndo=!1};module$exports$Blockly$Events$utils.disable=function(){module$contents$Blockly$Events$utils_disabled++};module$exports$Blockly$Events$utils.enable=function(){module$contents$Blockly$Events$utils_disabled--};
|
|
146
|
-
module$exports$Blockly$Events$utils.getGroup=function(){return module$contents$Blockly$Events$utils_group};module$exports$Blockly$Events$utils.setGroup=function(a){module$contents$Blockly$Events$utils_group="boolean"===typeof a?a?(0,module$exports$Blockly$utils$idGenerator.genUid)():"":a};
|
|
147
|
-
module$exports$Blockly$Events$utils.fromJson=function(a,b){var c=(0,module$exports$Blockly$Events$utils.get)(a.type);if(!c)throw Error("Unknown event type.");c=new c;c.fromJson(a);c.workspaceId=b.id;return c};module$exports$Blockly$Events$utils.get=function(a){return(0,module$exports$Blockly$registry.getClass)(module$exports$Blockly$registry.Type.EVENT,a)};
|
|
148
|
+
module$exports$Blockly$Events$utils.CHANGE&&f.element===k.element&&f.name===k.name)k.newValue=f.newValue;else if(f.type===module$exports$Blockly$Events$utils.VIEWPORT_CHANGE)h=f,k.viewTop=h.viewTop,k.viewLeft=h.viewLeft,k.scale=h.scale,k.oldScale=h.oldScale;else if(f.type!==module$exports$Blockly$Events$utils.CLICK||k.type!==module$exports$Blockly$Events$utils.BUBBLE_OPEN)d[g]={event:f,index:e},c.push(f)}a=c.filter(function(l){return!l.isNull()});b||a.reverse();b=1;for(c=void 0;c=a[b];b++)c.type===
|
|
149
|
+
module$exports$Blockly$Events$utils.CHANGE&&"mutation"===c.element&&a.unshift(a.splice(b,1)[0]);return a};module$exports$Blockly$Events$utils.clearPendingUndo=function(){for(var a=0,b;b=module$contents$Blockly$Events$utils_FIRE_QUEUE[a];a++)b.recordUndo=!1};module$exports$Blockly$Events$utils.disable=function(){module$contents$Blockly$Events$utils_disabled++};module$exports$Blockly$Events$utils.enable=function(){module$contents$Blockly$Events$utils_disabled--};
|
|
150
|
+
module$exports$Blockly$Events$utils.isEnabled=function(){return 0===module$contents$Blockly$Events$utils_disabled};module$exports$Blockly$Events$utils.getGroup=function(){return module$contents$Blockly$Events$utils_group};module$exports$Blockly$Events$utils.setGroup=function(a){module$contents$Blockly$Events$utils_group="boolean"===typeof a?a?(0,module$exports$Blockly$utils$idGenerator.genUid)():"":a};
|
|
151
|
+
module$exports$Blockly$Events$utils.getDescendantIds=function(a){var b=[];a=a.getDescendants(!1);for(var c=0,d;d=a[c];c++)b[c]=d.id;return b};module$exports$Blockly$Events$utils.fromJson=function(a,b){var c=(0,module$exports$Blockly$Events$utils.get)(a.type);if(!c)throw Error("Unknown event type.");c=new c;c.fromJson(a);c.workspaceId=b.id;return c};module$exports$Blockly$Events$utils.get=function(a){return(0,module$exports$Blockly$registry.getClass)(module$exports$Blockly$registry.Type.EVENT,a)};
|
|
148
152
|
module$exports$Blockly$Events$utils.disableOrphans=function(a){if((a.type===module$exports$Blockly$Events$utils.MOVE||a.type===module$exports$Blockly$Events$utils.CREATE)&&a.workspaceId){var b=module$exports$Blockly$Workspace.Workspace.getById(a.workspaceId),c=b.getBlockById(a.blockId);if(c){a=module$contents$Blockly$Events$utils_recordUndo;try{module$contents$Blockly$Events$utils_recordUndo=!1;var d=c.getParent();if(d&&d.isEnabled()){var e=c.getDescendants(!1);b=0;for(d=void 0;d=e[b];b++)d.setEnabled(!0)}else if((c.outputConnection||
|
|
149
153
|
c.previousConnection)&&!b.isDragging()){do c.setEnabled(!1),c=c.getNextBlock();while(c)}}finally{module$contents$Blockly$Events$utils_recordUndo=a}}}};module$exports$Blockly$Events$utils.TEST_ONLY={FIRE_QUEUE:module$contents$Blockly$Events$utils_FIRE_QUEUE,fireNow:module$contents$Blockly$Events$utils_fireNow};var module$exports$Blockly$utils$math={toRadians:function(a){return a*Math.PI/180},toDegrees:function(a){return 180*a/Math.PI},clamp:function(a,b,c){if(c<a){var d=c;c=a;a=d}return Math.max(a,Math.min(b,c))}};var module$exports$Blockly$bumpObjects={bumpIntoBounds:function(a,b,c){var d=c.getBoundingRectangle(),e=d.right-d.left,f=(0,module$exports$Blockly$utils$math.clamp)(b.top,d.top,b.top+b.height-(d.bottom-d.top))-d.top,g=b.left;b=b.left+b.width-e;a.RTL?g=Math.min(b,g):b=Math.max(g,b);return(a=(0,module$exports$Blockly$utils$math.clamp)(g,d.left,b)-d.left)||f?(c.moveBy(a,f),!0):!1},bumpIntoBoundsHandler:function(a){return function(b){var c=a.getMetricsManager();if(c.hasFixedEdges()&&!a.isDragging())if(-1!==
|
|
150
154
|
module$exports$Blockly$Events$utils.BUMP_EVENTS.indexOf(b.type)){c=c.getScrollMetrics(!0);var d=module$contents$Blockly$bumpObjects_extractObjectFromEvent(a,b);if(d){var e=(0,module$exports$Blockly$Events$utils.getGroup)();(0,module$exports$Blockly$Events$utils.setGroup)(b.group);(0,module$exports$Blockly$bumpObjects.bumpIntoBounds)(a,c,d)&&!b.group&&console.warn("Moved object in bounds but there was no event group. This may break undo.");null!==e&&(0,module$exports$Blockly$Events$utils.setGroup)(e)}}else b.type===
|
|
@@ -159,7 +163,33 @@ module$exports$Blockly$utils$style.getViewportPageOffset=function(){var a=docume
|
|
|
159
163
|
module$exports$Blockly$utils$style.getBorderBox=function(a){var b=(0,module$exports$Blockly$utils$style.getComputedStyle)(a,"borderLeftWidth"),c=(0,module$exports$Blockly$utils$style.getComputedStyle)(a,"borderRightWidth"),d=(0,module$exports$Blockly$utils$style.getComputedStyle)(a,"borderTopWidth");a=(0,module$exports$Blockly$utils$style.getComputedStyle)(a,"borderBottomWidth");return{top:parseFloat(d),right:parseFloat(c),bottom:parseFloat(a),left:parseFloat(b)}};
|
|
160
164
|
module$exports$Blockly$utils$style.scrollIntoContainerView=function(a,b,c){a=(0,module$exports$Blockly$utils$style.getContainerOffsetToScrollInto)(a,b,c);b.scrollLeft=a.x;b.scrollTop=a.y};
|
|
161
165
|
module$exports$Blockly$utils$style.getContainerOffsetToScrollInto=function(a,b,c){var d=(0,module$exports$Blockly$utils$style.getPageOffset)(a),e=(0,module$exports$Blockly$utils$style.getPageOffset)(b),f=(0,module$exports$Blockly$utils$style.getBorderBox)(b),g=d.x-e.x-f.left;d=d.y-e.y-f.top;e=module$contents$Blockly$utils$style_getSizeWithDisplay(a);a=b.clientWidth-e.width;e=b.clientHeight-e.height;f=b.scrollLeft;b=b.scrollTop;c?(f+=g-a/2,b+=d-e/2):(f+=Math.min(g,Math.max(g-a,0)),b+=Math.min(d,Math.max(d-
|
|
162
|
-
e,0)));return new module$exports$Blockly$utils$Coordinate.Coordinate(f,b)};var module$exports$Blockly$utils$Rect={Rect:function(a,b,c,d){this.top=a;this.bottom=b;this.left=c;this.right=d}};module$exports$Blockly$utils$Rect.Rect.prototype.contains=function(a,b){return a>=this.left&&a<=this.right&&b>=this.top&&b<=this.bottom};module$exports$Blockly$utils$Rect.Rect.prototype.intersects=function(a){return!(this.left>a.right||this.right<a.left||this.top>a.bottom||this.bottom<a.top)};var module$exports$Blockly$
|
|
166
|
+
e,0)));return new module$exports$Blockly$utils$Coordinate.Coordinate(f,b)};var module$exports$Blockly$utils$Rect={Rect:function(a,b,c,d){this.top=a;this.bottom=b;this.left=c;this.right=d}};module$exports$Blockly$utils$Rect.Rect.prototype.contains=function(a,b){return a>=this.left&&a<=this.right&&b>=this.top&&b<=this.bottom};module$exports$Blockly$utils$Rect.Rect.prototype.intersects=function(a){return!(this.left>a.right||this.right<a.left||this.top>a.bottom||this.bottom<a.top)};var module$exports$Blockly$dropDownDiv={ARROW_SIZE:16,BORDER_SIZE:1,ARROW_HORIZONTAL_PADDING:12,PADDING_Y:16,ANIMATION_TIME:.25},module$contents$Blockly$dropDownDiv_animateOutTimer=null,module$contents$Blockly$dropDownDiv_onHide=null,module$contents$Blockly$dropDownDiv_renderedClassName="",module$contents$Blockly$dropDownDiv_themeClassName="",module$contents$Blockly$dropDownDiv_div,module$contents$Blockly$dropDownDiv_content,module$contents$Blockly$dropDownDiv_arrow,module$contents$Blockly$dropDownDiv_boundsElement=
|
|
167
|
+
null,module$contents$Blockly$dropDownDiv_owner=null,module$contents$Blockly$dropDownDiv_positionToField=null;
|
|
168
|
+
module$exports$Blockly$dropDownDiv.createDom=function(){module$contents$Blockly$dropDownDiv_div||(module$contents$Blockly$dropDownDiv_div=document.createElement("div"),module$contents$Blockly$dropDownDiv_div.className="blocklyDropDownDiv",((0,$.module$exports$Blockly$common.getParentContainer)()||document.body).appendChild(module$contents$Blockly$dropDownDiv_div),module$contents$Blockly$dropDownDiv_content=document.createElement("div"),module$contents$Blockly$dropDownDiv_content.className="blocklyDropDownContent",
|
|
169
|
+
module$contents$Blockly$dropDownDiv_div.appendChild(module$contents$Blockly$dropDownDiv_content),module$contents$Blockly$dropDownDiv_arrow=document.createElement("div"),module$contents$Blockly$dropDownDiv_arrow.className="blocklyDropDownArrow",module$contents$Blockly$dropDownDiv_div.appendChild(module$contents$Blockly$dropDownDiv_arrow),module$contents$Blockly$dropDownDiv_div.style.opacity=0,module$contents$Blockly$dropDownDiv_div.style.transition="transform "+module$exports$Blockly$dropDownDiv.ANIMATION_TIME+
|
|
170
|
+
"s, opacity "+module$exports$Blockly$dropDownDiv.ANIMATION_TIME+"s",module$contents$Blockly$dropDownDiv_div.addEventListener("focusin",function(){(0,module$exports$Blockly$utils$dom.addClass)(module$contents$Blockly$dropDownDiv_div,"blocklyFocused")}),module$contents$Blockly$dropDownDiv_div.addEventListener("focusout",function(){(0,module$exports$Blockly$utils$dom.removeClass)(module$contents$Blockly$dropDownDiv_div,"blocklyFocused")}))};
|
|
171
|
+
module$exports$Blockly$dropDownDiv.setBoundsElement=function(a){module$contents$Blockly$dropDownDiv_boundsElement=a};module$exports$Blockly$dropDownDiv.getContentDiv=function(){return module$contents$Blockly$dropDownDiv_content};module$exports$Blockly$dropDownDiv.clearContent=function(){module$contents$Blockly$dropDownDiv_content.textContent="";module$contents$Blockly$dropDownDiv_content.style.width=""};
|
|
172
|
+
module$exports$Blockly$dropDownDiv.setColour=function(a,b){module$contents$Blockly$dropDownDiv_div.style.backgroundColor=a;module$contents$Blockly$dropDownDiv_div.style.borderColor=b};module$exports$Blockly$dropDownDiv.showPositionedByBlock=function(a,b,c,d){return module$contents$Blockly$dropDownDiv_showPositionedByRect(module$contents$Blockly$dropDownDiv_getScaledBboxOfBlock(b),a,c,d)};
|
|
173
|
+
module$exports$Blockly$dropDownDiv.showPositionedByField=function(a,b,c){module$contents$Blockly$dropDownDiv_positionToField=!0;return module$contents$Blockly$dropDownDiv_showPositionedByRect(module$contents$Blockly$dropDownDiv_getScaledBboxOfField(a),a,b,c)};
|
|
174
|
+
var module$contents$Blockly$dropDownDiv_getScaledBboxOfBlock=function(a){var b=a.getSvgRoot(),c=b.getBBox(),d=a.workspace.scale;a=c.height*d;c=c.width*d;b=(0,module$exports$Blockly$utils$style.getPageOffset)(b);return new module$exports$Blockly$utils$Rect.Rect(b.y,b.y+a,b.x,b.x+c)},module$contents$Blockly$dropDownDiv_getScaledBboxOfField=function(a){a=a.getScaledBBox();return new module$exports$Blockly$utils$Rect.Rect(a.top,a.bottom,a.left,a.right)},module$contents$Blockly$dropDownDiv_showPositionedByRect=
|
|
175
|
+
function(a,b,c,d){var e=a.left+(a.right-a.left)/2,f=a.bottom;a=a.top;d&&(a+=d);d=b.getSourceBlock();for(var g=d.workspace;g.options.parentWorkspace;)g=g.options.parentWorkspace;(0,module$exports$Blockly$dropDownDiv.setBoundsElement)(g.getParentSvg().parentNode);return(0,module$exports$Blockly$dropDownDiv.show)(b,d.RTL,e,f,e,a,c)};
|
|
176
|
+
module$exports$Blockly$dropDownDiv.show=function(a,b,c,d,e,f,g){module$contents$Blockly$dropDownDiv_owner=a;module$contents$Blockly$dropDownDiv_onHide=g||null;module$contents$Blockly$dropDownDiv_div.style.direction=b?"rtl":"ltr";a=(0,$.module$exports$Blockly$common.getMainWorkspace)();module$contents$Blockly$dropDownDiv_renderedClassName=a.getRenderer().getClassName();module$contents$Blockly$dropDownDiv_themeClassName=a.getTheme().getClassName();(0,module$exports$Blockly$utils$dom.addClass)(module$contents$Blockly$dropDownDiv_div,
|
|
177
|
+
module$contents$Blockly$dropDownDiv_renderedClassName);(0,module$exports$Blockly$utils$dom.addClass)(module$contents$Blockly$dropDownDiv_div,module$contents$Blockly$dropDownDiv_themeClassName);return module$contents$Blockly$dropDownDiv_positionInternal(c,d,e,f)};module$exports$Blockly$dropDownDiv.TEST_ONLY={};
|
|
178
|
+
module$exports$Blockly$dropDownDiv.TEST_ONLY.getBoundsInfo=function(){var a=(0,module$exports$Blockly$utils$style.getPageOffset)(module$contents$Blockly$dropDownDiv_boundsElement),b=(0,module$exports$Blockly$utils$style.getSize)(module$contents$Blockly$dropDownDiv_boundsElement);return{left:a.x,right:a.x+b.width,top:a.y,bottom:a.y+b.height,width:b.width,height:b.height}};
|
|
179
|
+
module$exports$Blockly$dropDownDiv.TEST_ONLY.getPositionMetrics=function(a,b,c,d){var e=module$exports$Blockly$dropDownDiv.TEST_ONLY.getBoundsInfo(),f=(0,module$exports$Blockly$utils$style.getSize)(module$contents$Blockly$dropDownDiv_div);return b+f.height<e.bottom?module$contents$Blockly$dropDownDiv_getPositionBelowMetrics(a,b,e,f):d-f.height>e.top?module$contents$Blockly$dropDownDiv_getPositionAboveMetrics(c,d,e,f):b+f.height<document.documentElement.clientHeight?module$contents$Blockly$dropDownDiv_getPositionBelowMetrics(a,
|
|
180
|
+
b,e,f):d-f.height>document.documentElement.clientTop?module$contents$Blockly$dropDownDiv_getPositionAboveMetrics(c,d,e,f):module$contents$Blockly$dropDownDiv_getPositionTopOfPageMetrics(a,e,f)};
|
|
181
|
+
var module$contents$Blockly$dropDownDiv_getPositionBelowMetrics=function(a,b,c,d){a=(0,module$exports$Blockly$dropDownDiv.getPositionX)(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+module$exports$Blockly$dropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:-(module$exports$Blockly$dropDownDiv.ARROW_SIZE/2+module$exports$Blockly$dropDownDiv.BORDER_SIZE),arrowAtTop:!0,arrowVisible:!0}},module$contents$Blockly$dropDownDiv_getPositionAboveMetrics=function(a,b,c,d){a=(0,module$exports$Blockly$dropDownDiv.getPositionX)(a,
|
|
182
|
+
c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-module$exports$Blockly$dropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:d.height-2*module$exports$Blockly$dropDownDiv.BORDER_SIZE-module$exports$Blockly$dropDownDiv.ARROW_SIZE/2,arrowAtTop:!1,arrowVisible:!0}},module$contents$Blockly$dropDownDiv_getPositionTopOfPageMetrics=function(a,b,c){a=(0,module$exports$Blockly$dropDownDiv.getPositionX)(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,
|
|
183
|
+
finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}};module$exports$Blockly$dropDownDiv.getPositionX=function(a,b,c,d){b=(0,module$exports$Blockly$utils$math.clamp)(b,a-d/2,c-d);a=a-module$exports$Blockly$dropDownDiv.ARROW_SIZE/2-b;c=module$exports$Blockly$dropDownDiv.ARROW_HORIZONTAL_PADDING;a=(0,module$exports$Blockly$utils$math.clamp)(c,a,d-c-module$exports$Blockly$dropDownDiv.ARROW_SIZE);return{arrowX:a,divX:b}};module$exports$Blockly$dropDownDiv.isVisible=function(){return!!module$contents$Blockly$dropDownDiv_owner};
|
|
184
|
+
module$exports$Blockly$dropDownDiv.hideIfOwner=function(a,b){return module$contents$Blockly$dropDownDiv_owner===a?(b?(0,module$exports$Blockly$dropDownDiv.hideWithoutAnimation)():(0,module$exports$Blockly$dropDownDiv.hide)(),!0):!1};
|
|
185
|
+
module$exports$Blockly$dropDownDiv.hide=function(){module$contents$Blockly$dropDownDiv_div.style.transform="translate(0, 0)";module$contents$Blockly$dropDownDiv_div.style.opacity=0;module$contents$Blockly$dropDownDiv_animateOutTimer=setTimeout(function(){(0,module$exports$Blockly$dropDownDiv.hideWithoutAnimation)()},1E3*module$exports$Blockly$dropDownDiv.ANIMATION_TIME);module$contents$Blockly$dropDownDiv_onHide&&(module$contents$Blockly$dropDownDiv_onHide(),module$contents$Blockly$dropDownDiv_onHide=
|
|
186
|
+
null)};
|
|
187
|
+
module$exports$Blockly$dropDownDiv.hideWithoutAnimation=function(){(0,module$exports$Blockly$dropDownDiv.isVisible)()&&(module$contents$Blockly$dropDownDiv_animateOutTimer&&clearTimeout(module$contents$Blockly$dropDownDiv_animateOutTimer),module$contents$Blockly$dropDownDiv_div.style.transform="",module$contents$Blockly$dropDownDiv_div.style.left="",module$contents$Blockly$dropDownDiv_div.style.top="",module$contents$Blockly$dropDownDiv_div.style.opacity=0,module$contents$Blockly$dropDownDiv_div.style.display="none",
|
|
188
|
+
module$contents$Blockly$dropDownDiv_div.style.backgroundColor="",module$contents$Blockly$dropDownDiv_div.style.borderColor="",module$contents$Blockly$dropDownDiv_onHide&&(module$contents$Blockly$dropDownDiv_onHide(),module$contents$Blockly$dropDownDiv_onHide=null),(0,module$exports$Blockly$dropDownDiv.clearContent)(),module$contents$Blockly$dropDownDiv_owner=null,module$contents$Blockly$dropDownDiv_renderedClassName&&((0,module$exports$Blockly$utils$dom.removeClass)(module$contents$Blockly$dropDownDiv_div,
|
|
189
|
+
module$contents$Blockly$dropDownDiv_renderedClassName),module$contents$Blockly$dropDownDiv_renderedClassName=""),module$contents$Blockly$dropDownDiv_themeClassName&&((0,module$exports$Blockly$utils$dom.removeClass)(module$contents$Blockly$dropDownDiv_div,module$contents$Blockly$dropDownDiv_themeClassName),module$contents$Blockly$dropDownDiv_themeClassName=""),(0,$.module$exports$Blockly$common.getMainWorkspace)().markFocused())};
|
|
190
|
+
var module$contents$Blockly$dropDownDiv_positionInternal=function(a,b,c,d){a=module$exports$Blockly$dropDownDiv.TEST_ONLY.getPositionMetrics(a,b,c,d);a.arrowVisible?(module$contents$Blockly$dropDownDiv_arrow.style.display="",module$contents$Blockly$dropDownDiv_arrow.style.transform="translate("+a.arrowX+"px,"+a.arrowY+"px) rotate(45deg)",module$contents$Blockly$dropDownDiv_arrow.setAttribute("class",a.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):module$contents$Blockly$dropDownDiv_arrow.style.display=
|
|
191
|
+
"none";b=Math.floor(a.initialX);c=Math.floor(a.initialY);d=Math.floor(a.finalX);var e=Math.floor(a.finalY);module$contents$Blockly$dropDownDiv_div.style.left=b+"px";module$contents$Blockly$dropDownDiv_div.style.top=c+"px";module$contents$Blockly$dropDownDiv_div.style.display="block";module$contents$Blockly$dropDownDiv_div.style.opacity=1;module$contents$Blockly$dropDownDiv_div.style.transform="translate("+(d-b)+"px,"+(e-c)+"px)";return!!a.arrowAtTop};
|
|
192
|
+
module$exports$Blockly$dropDownDiv.repositionForWindowResize=function(){if(module$contents$Blockly$dropDownDiv_owner){var a=module$contents$Blockly$dropDownDiv_owner,b=a.getSourceBlock();a=module$contents$Blockly$dropDownDiv_positionToField?module$contents$Blockly$dropDownDiv_getScaledBboxOfField(a):module$contents$Blockly$dropDownDiv_getScaledBboxOfBlock(b);b=a.left+(a.right-a.left)/2;module$contents$Blockly$dropDownDiv_positionInternal(b,a.bottom,b,a.top)}else(0,module$exports$Blockly$dropDownDiv.hide)()};var module$exports$Blockly$utils$svgMath={},module$contents$Blockly$utils$svgMath_XY_REGEX=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,module$contents$Blockly$utils$svgMath_XY_STYLE_REGEX=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/;
|
|
163
193
|
module$exports$Blockly$utils$svgMath.getRelativeXY=function(a){var b=new module$exports$Blockly$utils$Coordinate.Coordinate(0,0),c=a.getAttribute("x");c&&(b.x=parseInt(c,10));if(c=a.getAttribute("y"))b.y=parseInt(c,10);if(c=(c=a.getAttribute("transform"))&&c.match(module$contents$Blockly$utils$svgMath_XY_REGEX))b.x+=Number(c[1]),c[3]&&(b.y+=Number(c[3]));(a=a.getAttribute("style"))&&-1<a.indexOf("translate")&&(a=a.match(module$contents$Blockly$utils$svgMath_XY_STYLE_REGEX))&&(b.x+=Number(a[1]),a[3]&&
|
|
164
194
|
(b.y+=Number(a[3])));return b};module$exports$Blockly$utils$svgMath.getInjectionDivXY=function(a){for(var b=0,c=0;a;){var d=(0,module$exports$Blockly$utils$svgMath.getRelativeXY)(a);b+=d.x;c+=d.y;if(-1!==(" "+(a.getAttribute("class")||"")+" ").indexOf(" injectionDiv "))break;a=a.parentNode}return new module$exports$Blockly$utils$Coordinate.Coordinate(b,c)};
|
|
165
195
|
module$exports$Blockly$utils$svgMath.is3dSupported=function(){if(void 0!==module$exports$Blockly$utils$svgMath.is3dSupported.cached_)return module$exports$Blockly$utils$svgMath.is3dSupported.cached_;if(!$.module$exports$Blockly$utils$global.globalThis.getComputedStyle)return!1;var a=document.createElement("p"),b="none",c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(a,null);
|
|
@@ -179,35 +209,7 @@ module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.transla
|
|
|
179
209
|
module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.translateBy=function(a,b){this.surfaceXY_=new module$exports$Blockly$utils$Coordinate.Coordinate(this.surfaceXY_.x+a,this.surfaceXY_.y+b);this.translateSurfaceInternal_()};module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.translateSurface=function(a,b){this.surfaceXY_=new module$exports$Blockly$utils$Coordinate.Coordinate(a*this.scale_,b*this.scale_);this.translateSurfaceInternal_()};
|
|
180
210
|
module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.getSurfaceTranslation=function(){var a=(0,module$exports$Blockly$utils$svgMath.getRelativeXY)(this.SVG_);return new module$exports$Blockly$utils$Coordinate.Coordinate(a.x/this.scale_,a.y/this.scale_)};module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.getGroup=function(){return this.dragGroup_};module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.getSvgRoot=function(){return this.SVG_};
|
|
181
211
|
module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.getCurrentBlock=function(){return this.dragGroup_.firstChild};module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.getWsTranslation=function(){return this.childSurfaceXY_.clone()};
|
|
182
|
-
module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.clearAndHide=function(a){var b=this.getCurrentBlock();b&&(a?a.appendChild(b):this.dragGroup_.removeChild(b));this.SVG_.style.display="none";if(this.dragGroup_.childNodes.length)throw Error("Drag group was not cleared.");this.surfaceXY_=null};var module$exports$Blockly$
|
|
183
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.onHide_=null;module$exports$Blockly$DropDownDiv.DropDownDiv.rendererClassName_="";module$exports$Blockly$DropDownDiv.DropDownDiv.themeClassName_="";module$exports$Blockly$DropDownDiv.DropDownDiv.boundsElement_=null;module$exports$Blockly$DropDownDiv.DropDownDiv.owner_=null;module$exports$Blockly$DropDownDiv.DropDownDiv.positionToField_=null;
|
|
184
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.createDom=function(){if(!module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_){var a=document.createElement("div");a.className="blocklyDropDownDiv";((0,$.module$exports$Blockly$common.getParentContainer)()||document.body).appendChild(a);module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_=a;a=document.createElement("div");a.className="blocklyDropDownContent";module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.appendChild(a);module$exports$Blockly$DropDownDiv.DropDownDiv.content_=
|
|
185
|
-
a;a=document.createElement("div");a.className="blocklyDropDownArrow";module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.appendChild(a);module$exports$Blockly$DropDownDiv.DropDownDiv.arrow_=a;module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.style.opacity=0;module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.style.transition="transform "+module$exports$Blockly$DropDownDiv.DropDownDiv.ANIMATION_TIME+"s, opacity "+module$exports$Blockly$DropDownDiv.DropDownDiv.ANIMATION_TIME+"s";module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.addEventListener("focusin",
|
|
186
|
-
function(){(0,module$exports$Blockly$utils$dom.addClass)(module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_,"blocklyFocused")});module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.addEventListener("focusout",function(){(0,module$exports$Blockly$utils$dom.removeClass)(module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_,"blocklyFocused")})}};module$exports$Blockly$DropDownDiv.DropDownDiv.setBoundsElement=function(a){module$exports$Blockly$DropDownDiv.DropDownDiv.boundsElement_=a};
|
|
187
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.getContentDiv=function(){return module$exports$Blockly$DropDownDiv.DropDownDiv.content_};module$exports$Blockly$DropDownDiv.DropDownDiv.clearContent=function(){module$exports$Blockly$DropDownDiv.DropDownDiv.content_.textContent="";module$exports$Blockly$DropDownDiv.DropDownDiv.content_.style.width=""};
|
|
188
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.setColour=function(a,b){module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.style.backgroundColor=a;module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.style.borderColor=b};module$exports$Blockly$DropDownDiv.DropDownDiv.showPositionedByBlock=function(a,b,c,d){return module$contents$Blockly$DropDownDiv_showPositionedByRect(module$contents$Blockly$DropDownDiv_getScaledBboxOfBlock(b),a,c,d)};
|
|
189
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.showPositionedByField=function(a,b,c){module$exports$Blockly$DropDownDiv.DropDownDiv.positionToField_=!0;return module$contents$Blockly$DropDownDiv_showPositionedByRect(module$contents$Blockly$DropDownDiv_getScaledBboxOfField(a),a,b,c)};
|
|
190
|
-
var module$contents$Blockly$DropDownDiv_internal={},module$contents$Blockly$DropDownDiv_getScaledBboxOfBlock=function(a){var b=a.getSvgRoot(),c=b.getBBox(),d=a.workspace.scale;a=c.height*d;c=c.width*d;b=(0,module$exports$Blockly$utils$style.getPageOffset)(b);return new module$exports$Blockly$utils$Rect.Rect(b.y,b.y+a,b.x,b.x+c)},module$contents$Blockly$DropDownDiv_getScaledBboxOfField=function(a){a=a.getScaledBBox();return new module$exports$Blockly$utils$Rect.Rect(a.top,a.bottom,a.left,a.right)},
|
|
191
|
-
module$contents$Blockly$DropDownDiv_showPositionedByRect=function(a,b,c,d){var e=a.left+(a.right-a.left)/2,f=a.bottom;a=a.top;d&&(a+=d);d=b.getSourceBlock();for(var g=d.workspace;g.options.parentWorkspace;)g=g.options.parentWorkspace;module$exports$Blockly$DropDownDiv.DropDownDiv.setBoundsElement(g.getParentSvg().parentNode);return module$exports$Blockly$DropDownDiv.DropDownDiv.show(b,d.RTL,e,f,e,a,c)};
|
|
192
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.show=function(a,b,c,d,e,f,g){module$exports$Blockly$DropDownDiv.DropDownDiv.owner_=a;module$exports$Blockly$DropDownDiv.DropDownDiv.onHide_=g||null;a=module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_;a.style.direction=b?"rtl":"ltr";b=(0,$.module$exports$Blockly$common.getMainWorkspace)();module$exports$Blockly$DropDownDiv.DropDownDiv.rendererClassName_=b.getRenderer().getClassName();module$exports$Blockly$DropDownDiv.DropDownDiv.themeClassName_=b.getTheme().getClassName();
|
|
193
|
-
(0,module$exports$Blockly$utils$dom.addClass)(a,module$exports$Blockly$DropDownDiv.DropDownDiv.rendererClassName_);(0,module$exports$Blockly$utils$dom.addClass)(a,module$exports$Blockly$DropDownDiv.DropDownDiv.themeClassName_);return module$contents$Blockly$DropDownDiv_positionInternal(c,d,e,f)};
|
|
194
|
-
module$contents$Blockly$DropDownDiv_internal.getBoundsInfo=function(){var a=(0,module$exports$Blockly$utils$style.getPageOffset)(module$exports$Blockly$DropDownDiv.DropDownDiv.boundsElement_),b=(0,module$exports$Blockly$utils$style.getSize)(module$exports$Blockly$DropDownDiv.DropDownDiv.boundsElement_);return{left:a.x,right:a.x+b.width,top:a.y,bottom:a.y+b.height,width:b.width,height:b.height}};
|
|
195
|
-
module$contents$Blockly$DropDownDiv_internal.getPositionMetrics=function(a,b,c,d){var e=module$contents$Blockly$DropDownDiv_internal.getBoundsInfo(),f=(0,module$exports$Blockly$utils$style.getSize)(module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_);return b+f.height<e.bottom?module$contents$Blockly$DropDownDiv_getPositionBelowMetrics(a,b,e,f):d-f.height>e.top?module$contents$Blockly$DropDownDiv_getPositionAboveMetrics(c,d,e,f):b+f.height<document.documentElement.clientHeight?module$contents$Blockly$DropDownDiv_getPositionBelowMetrics(a,
|
|
196
|
-
b,e,f):d-f.height>document.documentElement.clientTop?module$contents$Blockly$DropDownDiv_getPositionAboveMetrics(c,d,e,f):module$contents$Blockly$DropDownDiv_getPositionTopOfPageMetrics(a,e,f)};
|
|
197
|
-
var module$contents$Blockly$DropDownDiv_getPositionBelowMetrics=function(a,b,c,d){a=module$exports$Blockly$DropDownDiv.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+module$exports$Blockly$DropDownDiv.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:-(module$exports$Blockly$DropDownDiv.DropDownDiv.ARROW_SIZE/2+module$exports$Blockly$DropDownDiv.DropDownDiv.BORDER_SIZE),arrowAtTop:!0,arrowVisible:!0}},module$contents$Blockly$DropDownDiv_getPositionAboveMetrics=
|
|
198
|
-
function(a,b,c,d){a=module$exports$Blockly$DropDownDiv.DropDownDiv.getPositionX(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-module$exports$Blockly$DropDownDiv.DropDownDiv.PADDING_Y,arrowX:a.arrowX,arrowY:d.height-2*module$exports$Blockly$DropDownDiv.DropDownDiv.BORDER_SIZE-module$exports$Blockly$DropDownDiv.DropDownDiv.ARROW_SIZE/2,arrowAtTop:!1,arrowVisible:!0}},module$contents$Blockly$DropDownDiv_getPositionTopOfPageMetrics=function(a,b,c){a=
|
|
199
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.getPositionX(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}};
|
|
200
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.getPositionX=function(a,b,c,d){b=(0,module$exports$Blockly$utils$math.clamp)(b,a-d/2,c-d);a=a-module$exports$Blockly$DropDownDiv.DropDownDiv.ARROW_SIZE/2-b;c=module$exports$Blockly$DropDownDiv.DropDownDiv.ARROW_HORIZONTAL_PADDING;a=(0,module$exports$Blockly$utils$math.clamp)(c,a,d-c-module$exports$Blockly$DropDownDiv.DropDownDiv.ARROW_SIZE);return{arrowX:a,divX:b}};module$exports$Blockly$DropDownDiv.DropDownDiv.isVisible=function(){return!!module$exports$Blockly$DropDownDiv.DropDownDiv.owner_};
|
|
201
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.hideIfOwner=function(a,b){return module$exports$Blockly$DropDownDiv.DropDownDiv.owner_===a?(b?module$exports$Blockly$DropDownDiv.DropDownDiv.hideWithoutAnimation():module$exports$Blockly$DropDownDiv.DropDownDiv.hide(),!0):!1};
|
|
202
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.hide=function(){module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.style.transform="translate(0, 0)";module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_.style.opacity=0;module$exports$Blockly$DropDownDiv.DropDownDiv.animateOutTimer_=setTimeout(function(){module$exports$Blockly$DropDownDiv.DropDownDiv.hideWithoutAnimation()},1E3*module$exports$Blockly$DropDownDiv.DropDownDiv.ANIMATION_TIME);module$exports$Blockly$DropDownDiv.DropDownDiv.onHide_&&(module$exports$Blockly$DropDownDiv.DropDownDiv.onHide_(),
|
|
203
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.onHide_=null)};
|
|
204
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.hideWithoutAnimation=function(){if(module$exports$Blockly$DropDownDiv.DropDownDiv.isVisible()){module$exports$Blockly$DropDownDiv.DropDownDiv.animateOutTimer_&&clearTimeout(module$exports$Blockly$DropDownDiv.DropDownDiv.animateOutTimer_);var a=module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor="";a.style.borderColor="";module$exports$Blockly$DropDownDiv.DropDownDiv.onHide_&&
|
|
205
|
-
(module$exports$Blockly$DropDownDiv.DropDownDiv.onHide_(),module$exports$Blockly$DropDownDiv.DropDownDiv.onHide_=null);module$exports$Blockly$DropDownDiv.DropDownDiv.clearContent();module$exports$Blockly$DropDownDiv.DropDownDiv.owner_=null;module$exports$Blockly$DropDownDiv.DropDownDiv.rendererClassName_&&((0,module$exports$Blockly$utils$dom.removeClass)(a,module$exports$Blockly$DropDownDiv.DropDownDiv.rendererClassName_),module$exports$Blockly$DropDownDiv.DropDownDiv.rendererClassName_="");module$exports$Blockly$DropDownDiv.DropDownDiv.themeClassName_&&
|
|
206
|
-
((0,module$exports$Blockly$utils$dom.removeClass)(a,module$exports$Blockly$DropDownDiv.DropDownDiv.themeClassName_),module$exports$Blockly$DropDownDiv.DropDownDiv.themeClassName_="");(0,$.module$exports$Blockly$common.getMainWorkspace)().markFocused()}};
|
|
207
|
-
var module$contents$Blockly$DropDownDiv_positionInternal=function(a,b,c,d){a=module$contents$Blockly$DropDownDiv_internal.getPositionMetrics(a,b,c,d);a.arrowVisible?(module$exports$Blockly$DropDownDiv.DropDownDiv.arrow_.style.display="",module$exports$Blockly$DropDownDiv.DropDownDiv.arrow_.style.transform="translate("+a.arrowX+"px,"+a.arrowY+"px) rotate(45deg)",module$exports$Blockly$DropDownDiv.DropDownDiv.arrow_.setAttribute("class",a.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):
|
|
208
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.arrow_.style.display="none";b=Math.floor(a.initialX);c=Math.floor(a.initialY);d=Math.floor(a.finalX);var e=Math.floor(a.finalY),f=module$exports$Blockly$DropDownDiv.DropDownDiv.DIV_;f.style.left=b+"px";f.style.top=c+"px";f.style.display="block";f.style.opacity=1;f.style.transform="translate("+(d-b)+"px,"+(e-c)+"px)";return!!a.arrowAtTop};
|
|
209
|
-
module$exports$Blockly$DropDownDiv.DropDownDiv.repositionForWindowResize=function(){if(module$exports$Blockly$DropDownDiv.DropDownDiv.owner_){var a=module$exports$Blockly$DropDownDiv.DropDownDiv.owner_,b=a.getSourceBlock();a=module$exports$Blockly$DropDownDiv.DropDownDiv.positionToField_?module$contents$Blockly$DropDownDiv_getScaledBboxOfField(a):module$contents$Blockly$DropDownDiv_getScaledBboxOfBlock(b);b=a.left+(a.right-a.left)/2;module$contents$Blockly$DropDownDiv_positionInternal(b,a.bottom,
|
|
210
|
-
b,a.top)}else module$exports$Blockly$DropDownDiv.DropDownDiv.hide()};module$exports$Blockly$DropDownDiv.DropDownDiv.TEST_ONLY=module$contents$Blockly$DropDownDiv_internal;var module$exports$Blockly$Grid={Grid:function(a,b){this.scale_=1;this.gridPattern_=a;this.spacing_=b.spacing;this.length_=b.length;this.line2_=(this.line1_=a.firstChild)&&this.line1_.nextSibling;this.snapToGrid_=b.snap}};module$exports$Blockly$Grid.Grid.prototype.dispose=function(){this.gridPattern_=null};module$exports$Blockly$Grid.Grid.prototype.shouldSnap=function(){return this.snapToGrid_};module$exports$Blockly$Grid.Grid.prototype.getSpacing=function(){return this.spacing_};
|
|
212
|
+
module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg.prototype.clearAndHide=function(a){var b=this.getCurrentBlock();b&&(a?a.appendChild(b):this.dragGroup_.removeChild(b));this.SVG_.style.display="none";if(this.dragGroup_.childNodes.length)throw Error("Drag group was not cleared.");this.surfaceXY_=null};var module$exports$Blockly$Grid={Grid:function(a,b){this.scale_=1;this.gridPattern_=a;this.spacing_=b.spacing;this.length_=b.length;this.line2_=(this.line1_=a.firstChild)&&this.line1_.nextSibling;this.snapToGrid_=b.snap}};module$exports$Blockly$Grid.Grid.prototype.dispose=function(){this.gridPattern_=null};module$exports$Blockly$Grid.Grid.prototype.shouldSnap=function(){return this.snapToGrid_};module$exports$Blockly$Grid.Grid.prototype.getSpacing=function(){return this.spacing_};
|
|
211
213
|
module$exports$Blockly$Grid.Grid.prototype.getPatternId=function(){return this.gridPattern_.id};module$exports$Blockly$Grid.Grid.prototype.update=function(a){this.scale_=a;var b=this.spacing_*a||100;this.gridPattern_.setAttribute("width",b);this.gridPattern_.setAttribute("height",b);b=Math.floor(this.spacing_/2)+.5;var c=b-this.length_/2,d=b+this.length_/2;b*=a;c*=a;d*=a;this.setLineAttributes_(this.line1_,a,c,d,b,b);this.setLineAttributes_(this.line2_,a,b,b,c,d)};
|
|
212
214
|
module$exports$Blockly$Grid.Grid.prototype.setLineAttributes_=function(a,b,c,d,e,f){a&&(a.setAttribute("stroke-width",b),a.setAttribute("x1",c),a.setAttribute("y1",e),a.setAttribute("x2",d),a.setAttribute("y2",f))};module$exports$Blockly$Grid.Grid.prototype.moveTo=function(a,b){this.gridPattern_.setAttribute("x",a);this.gridPattern_.setAttribute("y",b);(module$exports$Blockly$utils$userAgent.IE||module$exports$Blockly$utils$userAgent.EDGE)&&this.update(this.scale_)};
|
|
213
215
|
module$exports$Blockly$Grid.Grid.createDom=function(a,b,c){a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATTERN,{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},c);0<b.length&&0<b.spacing?((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.LINE,{stroke:b.colour},a),1<b.length&&(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.LINE,{stroke:b.colour},a)):(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.LINE,
|
|
@@ -229,21 +231,21 @@ $.module$exports$Blockly$Xml.domToWorkspace=function(a,b){if(a instanceof module
|
|
|
229
231
|
h.nodeName.toLowerCase(),l=h;if("block"===k||"shadow"===k&&!(0,module$exports$Blockly$Events$utils.getRecordUndo)()){var m=(0,$.module$exports$Blockly$Xml.domToBlock)(l,b);c.push(m.id);var n=l.hasAttribute("x")?parseInt(l.getAttribute("x"),10):10,p=l.hasAttribute("y")?parseInt(l.getAttribute("y"),10):10;isNaN(n)||isNaN(p)||m.moveBy(b.RTL?d-n:n,p);f=!1}else{if("shadow"===k)throw TypeError("Shadow block cannot be a top-level block.");if("comment"===k)if(b.rendered){var q=module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg;
|
|
230
232
|
q?q.fromXmlRendered(l,b,d):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment.")}else{var r=module$exports$Blockly$WorkspaceComment.WorkspaceComment;r?r.fromXml(l,b):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.")}else if("variables"===k){if(f)(0,$.module$exports$Blockly$Xml.domToVariables)(l,b);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");
|
|
231
233
|
f=!1}}}}finally{e||(0,module$exports$Blockly$Events$utils.setGroup)(!1),(0,module$exports$Blockly$utils$dom.stopTextWidthCache)()}b.setResizesEnabled&&b.setResizesEnabled(!0);(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.FINISHED_LOADING))(b));return c};
|
|
232
|
-
$.module$exports$Blockly$Xml.appendDomToWorkspace=function(a,b){
|
|
234
|
+
$.module$exports$Blockly$Xml.appendDomToWorkspace=function(a,b){if(!b.getBlocksBoundingBox)return(0,$.module$exports$Blockly$Xml.domToWorkspace)(a,b);var c=b.getBlocksBoundingBox();a=(0,$.module$exports$Blockly$Xml.domToWorkspace)(a,b);if(c&&c.top!==c.bottom){var d=c.bottom;c=b.RTL?c.right:c.left;for(var e=Infinity,f=-Infinity,g=Infinity,h=0;h<a.length;h++){var k=b.getBlockById(a[h]).getRelativeToSurfaceXY();k.y<g&&(g=k.y);k.x<e&&(e=k.x);k.x>f&&(f=k.x)}d=d-g+10;c=b.RTL?c-f:c-e;for(e=0;e<a.length;e++)b.getBlockById(a[e]).moveBy(c,
|
|
233
235
|
d)}return a};
|
|
234
|
-
$.module$exports$Blockly$Xml.domToBlock=function(a,b){if(a instanceof module$exports$Blockly$Workspace.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to domToBlock, swap the arguments.")}(0,module$exports$Blockly$Events$utils.disable)();c=b.getAllVariables();try{var d=module$contents$Blockly$Xml_domToBlockHeadless(a,b);var e=d.getDescendants(!1);
|
|
235
|
-
|
|
236
|
+
$.module$exports$Blockly$Xml.domToBlock=function(a,b){if(a instanceof module$exports$Blockly$Workspace.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to domToBlock, swap the arguments.")}(0,module$exports$Blockly$Events$utils.disable)();c=b.getAllVariables();try{var d=module$contents$Blockly$Xml_domToBlockHeadless(a,b);if(b.rendered){var e=d,f=d.getDescendants(!1);e.setConnectionTracking(!1);for(var g=f.length-1;0<=g;g--)f[g].initSvg();for(var h=f.length-1;0<=h;h--)f[h].render(!1);setTimeout(function(){e.disposed||
|
|
237
|
+
e.setConnectionTracking(!0)},1);e.updateDisabled();b.resizeContents()}else for(var k=d.getDescendants(!1),l=k.length-1;0<=l;l--)k[l].initModel()}finally{(0,module$exports$Blockly$Events$utils.enable)()}if((0,module$exports$Blockly$Events$utils.isEnabled)()){a=$.module$exports$Blockly$Variables.getAddedVariables(b,c);for(b=0;b<a.length;b++)f=a[b],(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.VAR_CREATE))(f));(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CREATE))(d))}return d};
|
|
236
238
|
$.module$exports$Blockly$Xml.domToVariables=function(a,b){for(var c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(d.nodeType===module$exports$Blockly$utils$dom.NodeType.ELEMENT_NODE){var e=d.getAttribute("type"),f=d.getAttribute("id");b.createVariable(d.textContent,e,f)}}};
|
|
237
239
|
var module$contents$Blockly$Xml_childNodeTagMap,module$contents$Blockly$Xml_mapSupportedXmlTags=function(a){for(var b={mutation:[],comment:[],data:[],field:[],input:[],next:[]},c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(d.nodeType!==module$exports$Blockly$utils$dom.NodeType.TEXT_NODE)switch(d.nodeName.toLowerCase()){case "mutation":b.mutation.push(d);break;case "comment":if(!module$exports$Blockly$Comment){console.warn("Missing require for Comment, ignoring block comment.");break}b.comment.push(d);
|
|
238
|
-
break;case "data":b.data.push(d);break;case "title":case "field":b.field.push(d);break;case "value":case "statement":b.input.push(d);break;case "next":b.next.push(d);break;default:console.warn("Ignoring unknown tag: "+d.nodeName)}}return b},module$contents$Blockly$Xml_applyMutationTagNodes=function(a,b){for(var c=!1,d=0;d<a.length;d++){var e=a[d];b.domToMutation&&(b.domToMutation(e),b.initSvg&&(c=!0))}return c},module$contents$Blockly$Xml_applyCommentTagNodes=function(a,b){for(var c=0;
|
|
239
|
-
a[
|
|
240
|
-
function(a,b){for(var c=0;c<a.length;c++){var d=a[c],e=d.getAttribute("name");module$contents$Blockly$Xml_domToField(b,e,d)}},module$contents$Blockly$Xml_findChildBlocks=function(a){for(var b={childBlockElement:null,childShadowElement:null},c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];d.nodeType===module$exports$Blockly$utils$dom.NodeType.ELEMENT_NODE&&
|
|
241
|
-
function(a,b,c,d){for(var e=0;e<a.length;e++){var f=a[e],g=f.getAttribute("name"),h=c.getInput(g);if(!h){console.warn("Ignoring non-existent input "+g+" in block "+d);break}f=module$contents$Blockly$Xml_findChildBlocks(f);if(f.childBlockElement){if(!h.connection)throw TypeError("Input connection does not exist.");module$contents$Blockly$Xml_domToBlockHeadless(f.childBlockElement,
|
|
242
|
-
function(a,b,c){for(var d=0;d<a.length;d++){var e=module$contents$Blockly$Xml_findChildBlocks(a[d]);if(e.childBlockElement){if(!c.nextConnection)throw TypeError("Next statement does not exist.");if(c.nextConnection.isConnected())throw TypeError("Next statement is already connected.");module$contents$Blockly$Xml_domToBlockHeadless(e.childBlockElement,b,c.nextConnection
|
|
243
|
-
function(a,b,c,d){var e=a.getAttribute("type");if(!e)throw TypeError("Block type unspecified: "+a.outerHTML);var f=a.getAttribute("id");f=b.newBlock(e,f);var g=module$contents$Blockly$Xml_mapSupportedXmlTags(a),h=module$contents$Blockly$Xml_applyMutationTagNodes(g.mutation,f);module$contents$Blockly$Xml_applyCommentTagNodes(g.comment,f);module$contents$Blockly$Xml_applyDataTagNodes(g.data,
|
|
244
|
-
else if(f.outputConnection)c.connect(f.outputConnection);else if(f.previousConnection)c.connect(f.previousConnection);else throw TypeError("Child block does not have output or previous statement.");module$contents$Blockly$Xml_applyFieldTagNodes(g.field,f);module$contents$Blockly$Xml_applyInputTagNodes(g.input,b,f,e);module$contents$Blockly$Xml_applyNextTagNodes(g.next,
|
|
245
|
-
b&&"disabled"!==b);(b=a.getAttribute("deletable"))&&f.setDeletable("true"===b);(b=a.getAttribute("movable"))&&f.setMovable("true"===b);(b=a.getAttribute("editable"))&&f.setEditable("true"===b);(b=a.getAttribute("collapsed"))&&f.setCollapsed("true"===b);if("shadow"===a.nodeName.toLowerCase()){a=f.getChildren(!1);for(b=0;b<a.length;b++)if(!a[b].isShadow())throw TypeError("Shadow block not allowed non-shadow child.");
|
|
246
|
-
f.setShadow(!0)}return f},module$contents$Blockly$Xml_domToField=function(a,b,c){var d=a.getField(b);d?d.fromXml(c):console.warn("Ignoring non-existent field "+b+" in block "+a.type)};$.module$exports$Blockly$Xml.deleteNext=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("next"===c.nodeName.toLowerCase()){a.removeChild(c);break}}};var module$exports$Blockly$utils$toolbox={},module$contents$Blockly$utils$toolbox_CATEGORY_TOOLBOX_KIND="categoryToolbox",module$contents$Blockly$utils$toolbox_FLYOUT_TOOLBOX_KIND="flyoutToolbox";module$exports$Blockly$utils$toolbox.Position={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3};
|
|
240
|
+
break;case "data":b.data.push(d);break;case "title":case "field":b.field.push(d);break;case "value":case "statement":b.input.push(d);break;case "next":b.next.push(d);break;default:console.warn("Ignoring unknown tag: "+d.nodeName)}}return b},module$contents$Blockly$Xml_applyMutationTagNodes=function(a,b){for(var c=!1,d=0;d<a.length;d++){var e=a[d];b.domToMutation&&(b.domToMutation(e),b.initSvg&&(c=!0))}return c},module$contents$Blockly$Xml_applyCommentTagNodes=function(a,b){for(var c={},d=0;d<a.length;c=
|
|
241
|
+
{$jscomp$loop$prop$blockSvg$289:c.$jscomp$loop$prop$blockSvg$289},d++){var e=a[d],f=e.textContent,g="true"===e.getAttribute("pinned"),h=parseInt(e.getAttribute("w"),10);e=parseInt(e.getAttribute("h"),10);b.setCommentText(f);b.commentModel.pinned=g;isNaN(h)||isNaN(e)||(b.commentModel.size=new module$exports$Blockly$utils$Size.Size(h,e));g&&b.getCommentIcon&&!b.isInFlyout&&(c.$jscomp$loop$prop$blockSvg$289=b,setTimeout(function(k){return function(){k.$jscomp$loop$prop$blockSvg$289.getCommentIcon().setVisible(!0)}}(c),
|
|
242
|
+
1))}},module$contents$Blockly$Xml_applyDataTagNodes=function(a,b){for(var c=0;c<a.length;c++)b.data=a[c].textContent},module$contents$Blockly$Xml_applyFieldTagNodes=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],e=d.getAttribute("name");module$contents$Blockly$Xml_domToField(b,e,d)}},module$contents$Blockly$Xml_findChildBlocks=function(a){for(var b={childBlockElement:null,childShadowElement:null},c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];d.nodeType===module$exports$Blockly$utils$dom.NodeType.ELEMENT_NODE&&
|
|
243
|
+
("block"===d.nodeName.toLowerCase()?b.childBlockElement=d:"shadow"===d.nodeName.toLowerCase()&&(b.childShadowElement=d))}return b},module$contents$Blockly$Xml_applyInputTagNodes=function(a,b,c,d){for(var e=0;e<a.length;e++){var f=a[e],g=f.getAttribute("name"),h=c.getInput(g);if(!h){console.warn("Ignoring non-existent input "+g+" in block "+d);break}f=module$contents$Blockly$Xml_findChildBlocks(f);if(f.childBlockElement){if(!h.connection)throw TypeError("Input connection does not exist.");module$contents$Blockly$Xml_domToBlockHeadless(f.childBlockElement,
|
|
244
|
+
b,h.connection,!1)}f.childShadowElement&&h.connection.setShadowDom(f.childShadowElement)}},module$contents$Blockly$Xml_applyNextTagNodes=function(a,b,c){for(var d=0;d<a.length;d++){var e=module$contents$Blockly$Xml_findChildBlocks(a[d]);if(e.childBlockElement){if(!c.nextConnection)throw TypeError("Next statement does not exist.");if(c.nextConnection.isConnected())throw TypeError("Next statement is already connected.");module$contents$Blockly$Xml_domToBlockHeadless(e.childBlockElement,b,c.nextConnection,
|
|
245
|
+
!0)}e.childShadowElement&&c.nextConnection&&c.nextConnection.setShadowDom(e.childShadowElement)}},module$contents$Blockly$Xml_domToBlockHeadless=function(a,b,c,d){var e=a.getAttribute("type");if(!e)throw TypeError("Block type unspecified: "+a.outerHTML);var f=a.getAttribute("id");f=b.newBlock(e,f);var g=module$contents$Blockly$Xml_mapSupportedXmlTags(a),h=module$contents$Blockly$Xml_applyMutationTagNodes(g.mutation,f);module$contents$Blockly$Xml_applyCommentTagNodes(g.comment,f);module$contents$Blockly$Xml_applyDataTagNodes(g.data,
|
|
246
|
+
f);if(c)if(d)if(f.previousConnection)c.connect(f.previousConnection);else throw TypeError("Next block does not have previous statement.");else if(f.outputConnection)c.connect(f.outputConnection);else if(f.previousConnection)c.connect(f.previousConnection);else throw TypeError("Child block does not have output or previous statement.");module$contents$Blockly$Xml_applyFieldTagNodes(g.field,f);module$contents$Blockly$Xml_applyInputTagNodes(g.input,b,f,e);module$contents$Blockly$Xml_applyNextTagNodes(g.next,
|
|
247
|
+
b,f);h&&f.initSvg();(b=a.getAttribute("inline"))&&f.setInputsInline("true"===b);(b=a.getAttribute("disabled"))&&f.setEnabled("true"!==b&&"disabled"!==b);(b=a.getAttribute("deletable"))&&f.setDeletable("true"===b);(b=a.getAttribute("movable"))&&f.setMovable("true"===b);(b=a.getAttribute("editable"))&&f.setEditable("true"===b);(b=a.getAttribute("collapsed"))&&f.setCollapsed("true"===b);if("shadow"===a.nodeName.toLowerCase()){a=f.getChildren(!1);for(b=0;b<a.length;b++)if(!a[b].isShadow())throw TypeError("Shadow block not allowed non-shadow child.");
|
|
248
|
+
if(f.getVarModels().length)throw TypeError("Shadow blocks cannot have variable references.");f.setShadow(!0)}return f},module$contents$Blockly$Xml_domToField=function(a,b,c){var d=a.getField(b);d?d.fromXml(c):console.warn("Ignoring non-existent field "+b+" in block "+a.type)};$.module$exports$Blockly$Xml.deleteNext=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("next"===c.nodeName.toLowerCase()){a.removeChild(c);break}}};var module$exports$Blockly$utils$toolbox={},module$contents$Blockly$utils$toolbox_CATEGORY_TOOLBOX_KIND="categoryToolbox",module$contents$Blockly$utils$toolbox_FLYOUT_TOOLBOX_KIND="flyoutToolbox";module$exports$Blockly$utils$toolbox.Position={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3};
|
|
247
249
|
module$exports$Blockly$utils$toolbox.convertToolboxDefToJson=function(a){if(!a)return null;if(a instanceof Element||"string"===typeof a)a=(0,module$exports$Blockly$utils$toolbox.parseToolboxTree)(a),a=module$contents$Blockly$utils$toolbox_convertToToolboxJson(a);module$contents$Blockly$utils$toolbox_validateToolbox(a);return a};
|
|
248
250
|
var module$contents$Blockly$utils$toolbox_validateToolbox=function(a){var b=a.kind;a=a.contents;if(b&&b!==module$contents$Blockly$utils$toolbox_FLYOUT_TOOLBOX_KIND&&b!==module$contents$Blockly$utils$toolbox_CATEGORY_TOOLBOX_KIND)throw Error("Invalid toolbox kind "+b+". Please supply either "+module$contents$Blockly$utils$toolbox_FLYOUT_TOOLBOX_KIND+" or "+module$contents$Blockly$utils$toolbox_CATEGORY_TOOLBOX_KIND);if(!a)throw Error("Toolbox must have a contents attribute.");};
|
|
249
251
|
module$exports$Blockly$utils$toolbox.convertFlyoutDefToJsonArray=function(a){return a?a.contents?a.contents:Array.isArray(a)&&0<a.length&&!a[0].nodeType?a:module$contents$Blockly$utils$toolbox_xmlToJsonArray(a):[]};module$exports$Blockly$utils$toolbox.hasCategories=function(a){if(!a)return!1;var b=a.kind;return b?b===module$contents$Blockly$utils$toolbox_CATEGORY_TOOLBOX_KIND:!!a.contents.filter(function(c){return"CATEGORY"===c.kind.toUpperCase()}).length};
|
|
@@ -258,7 +260,7 @@ b.categoryStyles);(0,$.module$exports$Blockly$utils$object.deepMerge)(c.componen
|
|
|
258
260
|
{colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}};module$exports$Blockly$Themes$Classic.Classic=new module$exports$Blockly$Theme.Theme("classic",module$contents$Blockly$Themes$Classic_defaultBlockStyles,module$contents$Blockly$Themes$Classic_categoryStyles);var module$exports$Blockly$Options={Options:function(a){var b=null,c=!1,d=!1,e=!1,f=!1,g=!1,h=!1,k=!!a.readOnly;k||(b=(0,module$exports$Blockly$utils$toolbox.convertToolboxDefToJson)(a.toolbox),c=(0,module$exports$Blockly$utils$toolbox.hasCategories)(b),d=a.trashcan,void 0===d&&(d=c),e=a.collapse,void 0===e&&(e=c),f=a.comments,void 0===f&&(f=c),g=a.disable,void 0===g&&(g=c),h=a.sounds,void 0===h&&(h=!0));var l=a.maxTrashcanContents;d?void 0===l&&(l=32):l=0;var m=!!a.rtl,n=a.horizontalLayout;void 0===
|
|
259
261
|
n&&(n=!1);var p=a.toolboxPosition;p="end"!==p;p=n?p?module$exports$Blockly$utils$toolbox.Position.TOP:module$exports$Blockly$utils$toolbox.Position.BOTTOM:p===m?module$exports$Blockly$utils$toolbox.Position.RIGHT:module$exports$Blockly$utils$toolbox.Position.LEFT;var q=a.css;void 0===q&&(q=!0);var r="https://blockly-demo.appspot.com/static/media/";a.media?r=a.media:a.path&&(r=a.path+"media/");var t=void 0===a.oneBasedIndex?!0:!!a.oneBasedIndex;var u=a.renderer||"geras",v=a.plugins||{};this.RTL=m;
|
|
260
262
|
this.oneBasedIndex=t;this.collapse=e;this.comments=f;this.disable=g;this.readOnly=k;this.maxBlocks=a.maxBlocks||Infinity;this.maxInstances=a.maxInstances;this.pathToMedia=r;this.hasCategories=c;this.moveOptions=module$exports$Blockly$Options.Options.parseMoveOptions_(a,c);this.hasScrollbars=!!this.moveOptions.scrollbars;this.hasTrashcan=d;this.maxTrashcanContents=l;this.hasSounds=h;this.hasCss=q;this.horizontalLayout=n;this.languageTree=b;this.gridOptions=module$exports$Blockly$Options.Options.parseGridOptions_(a);
|
|
261
|
-
this.zoomOptions=module$exports$Blockly$Options.Options.parseZoomOptions_(a);this.toolboxPosition=p;this.theme=module$exports$Blockly$Options.Options.parseThemeOptions_(a);this.renderer=u;this.rendererOverrides=a.rendererOverrides;this.gridPattern=null;this.parentWorkspace=a.parentWorkspace;this.plugins=v}};
|
|
263
|
+
this.zoomOptions=module$exports$Blockly$Options.Options.parseZoomOptions_(a);this.toolboxPosition=p;this.theme=module$exports$Blockly$Options.Options.parseThemeOptions_(a);this.renderer=u;this.rendererOverrides=a.rendererOverrides;this.gridPattern=null;this.parentWorkspace=a.parentWorkspace;this.plugins=v;this.getMetrics=this.setMetrics=void 0}};
|
|
262
264
|
module$exports$Blockly$Options.Options.parseMoveOptions_=function(a,b){var c=a.move||{},d={};void 0===c.scrollbars&&void 0===a.scrollbars?d.scrollbars=b:"object"===typeof c.scrollbars?(d.scrollbars={},d.scrollbars.horizontal=!!c.scrollbars.horizontal,d.scrollbars.vertical=!!c.scrollbars.vertical,d.scrollbars.horizontal&&d.scrollbars.vertical?d.scrollbars=!0:d.scrollbars.horizontal||d.scrollbars.vertical||(d.scrollbars=!1)):d.scrollbars=!!c.scrollbars||!!a.scrollbars;d.wheel=d.scrollbars&&void 0!==
|
|
263
265
|
c.wheel?!!c.wheel:"object"===typeof d.scrollbars;d.drag=d.scrollbars?void 0===c.drag?!0:!!c.drag:!1;return d};
|
|
264
266
|
module$exports$Blockly$Options.Options.parseZoomOptions_=function(a){a=a.zoom||{};var b={};b.controls=void 0===a.controls?!1:!!a.controls;b.wheel=void 0===a.wheel?!1:!!a.wheel;b.startScale=void 0===a.startScale?1:Number(a.startScale);b.maxScale=void 0===a.maxScale?3:Number(a.maxScale);b.minScale=void 0===a.minScale?.3:Number(a.minScale);b.scaleSpeed=void 0===a.scaleSpeed?1.2:Number(a.scaleSpeed);b.pinch=void 0===a.pinch?b.wheel||b.controls:!!a.pinch;return b};
|
|
@@ -302,8 +304,8 @@ module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.set=function(a,b,c)
|
|
|
302
304
|
module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.setY=function(a){this.vScroll&&this.vScroll.set(a,!0)};module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.setContainerVisible=function(a){this.hScroll&&this.hScroll.setContainerVisible(a);this.vScroll&&this.vScroll.setContainerVisible(a)};module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.isVisible=function(){var a=!1;this.hScroll&&(a=this.hScroll.isVisible());this.vScroll&&(a=a||this.vScroll.isVisible());return a};
|
|
303
305
|
module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.resizeContent=function(a){this.hScroll&&this.hScroll.resizeContentHorizontal(a);this.vScroll&&this.vScroll.resizeContentVertical(a)};module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.resizeView=function(a){this.hScroll&&this.hScroll.resizeViewHorizontal(a);this.vScroll&&this.vScroll.resizeViewVertical(a)};var module$exports$Blockly$utils$KeyCodes={KeyCodes:{WIN_KEY_FF_LINUX:0,MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PLUS_SIGN:43,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,FF_SEMICOLON:59,FF_EQUALS:61,FF_DASH:173,FF_HASH:163,QUESTION_MARK:63,AT_SIGN:64,A:65,B:66,C:67,D:68,E:69,F:70,G:71,
|
|
304
306
|
H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SCROLL_LOCK:145,FIRST_MEDIA_KEY:166,LAST_MEDIA_KEY:183,SEMICOLON:186,
|
|
305
|
-
DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,TILDE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,MAC_WK_CMD_LEFT:91,MAC_WK_CMD_RIGHT:93,WIN_IME:229,VK_NONAME:252,PHANTOM:255}};var module$exports$Blockly$ShortcutRegistry={ShortcutRegistry:function(){module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.
|
|
306
|
-
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.
|
|
307
|
+
DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,TILDE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,MAC_WK_CMD_LEFT:91,MAC_WK_CMD_RIGHT:93,WIN_IME:229,VK_NONAME:252,PHANTOM:255}};var module$exports$Blockly$ShortcutRegistry={ShortcutRegistry:function(){this.reset()}};module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.reset=function(){this.registry_=Object.create(null);this.keyMap_=Object.create(null)};module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.register=function(a,b){if(this.registry_[a.name]&&!b)throw Error('Shortcut with name "'+a.name+'" already exists.');this.registry_[a.name]=a};
|
|
308
|
+
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.unregister=function(a){if(!this.registry_[a])return console.warn('Keyboard shortcut with name "'+a+'" not found.'),!1;this.removeAllKeyMappings(a);delete this.registry_[a];return!0};
|
|
307
309
|
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.addKeyMapping=function(a,b,c){a=String(a);var d=this.keyMap_[a];if(d&&!c)throw Error('Shortcut with name "'+b+'" collides with shortcuts '+d.toString());d&&c?d.unshift(b):this.keyMap_[a]=[b]};
|
|
308
310
|
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.removeKeyMapping=function(a,b,c){var d=this.keyMap_[a];if(!d&&!c)return console.warn('No keyboard shortcut with name "'+b+'" registered with key code "'+a+'"'),!1;var e=d.indexOf(b);if(-1<e)return d.splice(e,1),0===d.length&&delete this.keyMap_[a],!0;c||console.warn('No keyboard shortcut with name "'+b+'" registered with key code "'+a+'"');return!1};
|
|
309
311
|
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.removeAllKeyMappings=function(a){for(var b in this.keyMap_)this.removeKeyMapping(b,a,!0)};module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.setKeyMap=function(a){this.keyMap_=a};module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.getKeyMap=function(){return(0,$.module$exports$Blockly$utils$object.deepMerge)(Object.create(null),this.keyMap_)};
|
|
@@ -311,14 +313,15 @@ module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.getRegistry=f
|
|
|
311
313
|
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.getShortcutNamesByKeyCode=function(a){return this.keyMap_[a]||[]};module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.getKeyCodesByShortcutName=function(a){var b=[],c;for(c in this.keyMap_)-1<this.keyMap_[c].indexOf(a)&&b.push(c);return b};
|
|
312
314
|
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.serializeKeyEvent_=function(a){var b="",c;for(c in module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.modifierKeys)a.getModifierState(c)&&(""!==b&&(b+="+"),b+=c);""!==b&&a.keyCode?b=b+"+"+a.keyCode:a.keyCode&&(b=a.keyCode.toString());return b};
|
|
313
315
|
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.checkModifiers_=function(a){for(var b=(0,$.module$exports$Blockly$utils$object.values)(module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.modifierKeys),c=0,d;d=a[c];c++)if(0>b.indexOf(d))throw Error(d+" is not a valid modifier key.");};
|
|
314
|
-
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.createSerializedKey=function(a,b){var c="";if(b){this.checkModifiers_(b);for(var d in module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.modifierKeys)-1<b.indexOf(module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.modifierKeys[d])&&(""!==c&&(c+="+"),c+=d)}""!==c&&a?c=c+"+"+a:a&&(c=a.toString());return c};
|
|
316
|
+
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.prototype.createSerializedKey=function(a,b){var c="";if(b){this.checkModifiers_(b);for(var d in module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.modifierKeys)-1<b.indexOf(module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.modifierKeys[d])&&(""!==c&&(c+="+"),c+=d)}""!==c&&a?c=c+"+"+a:a&&(c=a.toString());return c};
|
|
317
|
+
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.modifierKeys={Shift:module$exports$Blockly$utils$KeyCodes.KeyCodes.SHIFT,Control:module$exports$Blockly$utils$KeyCodes.KeyCodes.CTRL,Alt:module$exports$Blockly$utils$KeyCodes.KeyCodes.ALT,Meta:module$exports$Blockly$utils$KeyCodes.KeyCodes.META};var module$contents$Blockly$ShortcutRegistry_registry=new module$exports$Blockly$ShortcutRegistry.ShortcutRegistry;module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.registry=module$contents$Blockly$ShortcutRegistry_registry;var module$exports$Blockly$WorkspaceDragSurfaceSvg={WorkspaceDragSurfaceSvg:function(a){this.SVG_=null;this.container_=a;this.previousSibling_=null;this.createDom()}};
|
|
315
318
|
module$exports$Blockly$WorkspaceDragSurfaceSvg.WorkspaceDragSurfaceSvg.prototype.createDom=function(){this.SVG_||(this.SVG_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.SVG,{xmlns:module$exports$Blockly$utils$dom.SVG_NS,"xmlns:html":module$exports$Blockly$utils$dom.HTML_NS,"xmlns:xlink":module$exports$Blockly$utils$dom.XLINK_NS,version:"1.1","class":"blocklyWsDragSurface blocklyOverflowVisible"},null),this.container_.appendChild(this.SVG_))};
|
|
316
319
|
module$exports$Blockly$WorkspaceDragSurfaceSvg.WorkspaceDragSurfaceSvg.prototype.translateSurface=function(a,b){a=a.toFixed(0);b=b.toFixed(0);this.SVG_.style.display="block";(0,module$exports$Blockly$utils$dom.setCssTransform)(this.SVG_,"translate3d("+a+"px, "+b+"px, 0)")};module$exports$Blockly$WorkspaceDragSurfaceSvg.WorkspaceDragSurfaceSvg.prototype.getSurfaceTranslation=function(){return(0,module$exports$Blockly$utils$svgMath.getRelativeXY)(this.SVG_)};
|
|
317
320
|
module$exports$Blockly$WorkspaceDragSurfaceSvg.WorkspaceDragSurfaceSvg.prototype.clearAndHide=function(a){if(!a)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var b=this.SVG_.childNodes[0],c=this.SVG_.childNodes[1];if(!(b&&c&&(0,module$exports$Blockly$utils$dom.hasClass)(b,"blocklyBlockCanvas")&&(0,module$exports$Blockly$utils$dom.hasClass)(c,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");null!==this.previousSibling_?
|
|
318
321
|
(0,module$exports$Blockly$utils$dom.insertAfter)(b,this.previousSibling_):a.insertBefore(b,a.firstChild);(0,module$exports$Blockly$utils$dom.insertAfter)(c,b);this.SVG_.style.display="none";if(this.SVG_.childNodes.length)throw Error("Drag surface was not cleared.");(0,module$exports$Blockly$utils$dom.setCssTransform)(this.SVG_,"");this.previousSibling_=null};
|
|
319
322
|
module$exports$Blockly$WorkspaceDragSurfaceSvg.WorkspaceDragSurfaceSvg.prototype.setContentsAndShow=function(a,b,c,d,e,f){if(this.SVG_.childNodes.length)throw Error("Already dragging a block.");this.previousSibling_=c;a.setAttribute("transform","translate(0, 0) scale("+f+")");b.setAttribute("transform","translate(0, 0) scale("+f+")");this.SVG_.setAttribute("width",d);this.SVG_.setAttribute("height",e);this.SVG_.appendChild(a);this.SVG_.appendChild(b);this.SVG_.style.display="block"};var module$exports$Blockly$clipboard={},module$contents$Blockly$clipboard_copyData=null;module$exports$Blockly$clipboard.copy=function(a){module$contents$Blockly$clipboard_copyData=a.toCopyData()};
|
|
320
|
-
module$exports$Blockly$clipboard.paste=function(){if(!module$contents$Blockly$clipboard_copyData)return
|
|
321
|
-
module$exports$Blockly$clipboard.duplicate=function(a){var b=module$contents$Blockly$clipboard_copyData;(0,module$exports$Blockly$clipboard.copy)(a);a.workspace.paste(module$contents$Blockly$clipboard_copyData.saveInfo);module$contents$Blockly$clipboard_copyData=b};var module$contents$Blockly$config_Config,module$contents$Blockly$config_DEFAULT_SNAP_RADIUS;$.module$exports$Blockly$config={};module$contents$Blockly$config_DEFAULT_SNAP_RADIUS=28;$.module$exports$Blockly$config.config={dragRadius:5,flyoutDragRadius:10,snapRadius:module$contents$Blockly$config_DEFAULT_SNAP_RADIUS,connectingSnapRadius:module$contents$Blockly$config_DEFAULT_SNAP_RADIUS,currentConnectionPreference:8,bumpDelay:250};var module$exports$Blockly$MenuItem={MenuItem:function(a,b){this.content_=a;this.value_=b;this.enabled_=!0;this.element_=null;this.rightToLeft_=!1;this.roleName_=null;this.highlight_=this.checked_=this.checkable_=!1;this.actionHandler_=null}};
|
|
323
|
+
module$exports$Blockly$clipboard.paste=function(){if(!module$contents$Blockly$clipboard_copyData)return null;var a=module$contents$Blockly$clipboard_copyData.source;a.isFlyout&&(a=a.targetWorkspace);return module$contents$Blockly$clipboard_copyData.typeCounts&&a.isCapacityAvailable(module$contents$Blockly$clipboard_copyData.typeCounts)?a.paste(module$contents$Blockly$clipboard_copyData.saveInfo):null};
|
|
324
|
+
module$exports$Blockly$clipboard.duplicate=function(a){var b=module$contents$Blockly$clipboard_copyData;(0,module$exports$Blockly$clipboard.copy)(a);a=a.workspace.paste(module$contents$Blockly$clipboard_copyData.saveInfo);module$contents$Blockly$clipboard_copyData=b;return a};var module$contents$Blockly$config_Config,module$contents$Blockly$config_DEFAULT_SNAP_RADIUS;$.module$exports$Blockly$config={};module$contents$Blockly$config_DEFAULT_SNAP_RADIUS=28;$.module$exports$Blockly$config.config={dragRadius:5,flyoutDragRadius:10,snapRadius:module$contents$Blockly$config_DEFAULT_SNAP_RADIUS,connectingSnapRadius:module$contents$Blockly$config_DEFAULT_SNAP_RADIUS,currentConnectionPreference:8,bumpDelay:250};var module$exports$Blockly$MenuItem={MenuItem:function(a,b){this.content_=a;this.value_=b;this.enabled_=!0;this.element_=null;this.rightToLeft_=!1;this.roleName_=null;this.highlight_=this.checked_=this.checkable_=!1;this.actionHandler_=null}};
|
|
322
325
|
module$exports$Blockly$MenuItem.MenuItem.prototype.createDom=function(){var a=document.createElement("div");a.id=(0,module$exports$Blockly$utils$idGenerator.getNextUniqueId)();this.element_=a;a.className="blocklyMenuItem goog-menuitem "+(this.enabled_?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked_?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight_?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft_?"blocklyMenuItemRtl goog-menuitem-rtl ":
|
|
323
326
|
"");var b=document.createElement("div");b.className="blocklyMenuItemContent goog-menuitem-content";if(this.checkable_){var c=document.createElement("div");c.className="blocklyMenuItemCheckbox goog-menuitem-checkbox";b.appendChild(c)}c=this.content_;"string"===typeof this.content_&&(c=document.createTextNode(this.content_));b.appendChild(c);a.appendChild(b);this.roleName_&&(0,module$exports$Blockly$utils$aria.setRole)(a,this.roleName_);(0,module$exports$Blockly$utils$aria.setState)(a,module$exports$Blockly$utils$aria.State.SELECTED,
|
|
324
327
|
this.checkable_&&this.checked_||!1);(0,module$exports$Blockly$utils$aria.setState)(a,module$exports$Blockly$utils$aria.State.DISABLED,!this.enabled_);return a};module$exports$Blockly$MenuItem.MenuItem.prototype.dispose=function(){this.element_=null};module$exports$Blockly$MenuItem.MenuItem.prototype.getElement=function(){return this.element_};module$exports$Blockly$MenuItem.MenuItem.prototype.getId=function(){return this.element_.id};module$exports$Blockly$MenuItem.MenuItem.prototype.getValue=function(){return this.value_};
|
|
@@ -354,13 +357,13 @@ var module$contents$Blockly$serialization$blocks_appendPrivate=function(a,b,c){v
|
|
|
354
357
|
a);module$contents$Blockly$serialization$blocks_tryToConnectParent(c,e,a);module$contents$Blockly$serialization$blocks_loadIcons(e,a);module$contents$Blockly$serialization$blocks_loadFields(e,a);module$contents$Blockly$serialization$blocks_loadInputBlocks(e,a);module$contents$Blockly$serialization$blocks_loadNextBlocks(e,a);module$contents$Blockly$serialization$blocks_initBlock(e,b.rendered);return e},module$contents$Blockly$serialization$blocks_loadCoords=function(a,b){var c=void 0===b.x?0:b.x;b=
|
|
355
358
|
void 0===b.y?0:b.y;var d=a.workspace;c=d.RTL?d.getWidth()-c:c;a.moveBy(c,b)},module$contents$Blockly$serialization$blocks_loadAttributes=function(a,b){b.collapsed&&a.setCollapsed(!0);!1===b.enabled&&a.setEnabled(!1);void 0!==b.inline&&a.setInputsInline(b.inline);void 0!==b.data&&(a.data=b.data)},module$contents$Blockly$serialization$blocks_loadExtraState=function(a,b){b.extraState&&(a.loadExtraState?a.loadExtraState(b.extraState):a.domToMutation((0,$.module$exports$Blockly$Xml.textToDom)(b.extraState)))},
|
|
356
359
|
module$contents$Blockly$serialization$blocks_tryToConnectParent=function(a,b,c){if(a){if(a.getSourceBlock().isShadow()&&!b.isShadow())throw new module$exports$Blockly$serialization$exceptions.RealChildOfShadow(c);if(a.type===$.module$exports$Blockly$inputTypes.inputTypes.VALUE){var d=b.outputConnection;if(!d)throw new module$exports$Blockly$serialization$exceptions.MissingConnection("output",b,c);}else if(d=b.previousConnection,!d)throw new module$exports$Blockly$serialization$exceptions.MissingConnection("previous",
|
|
357
|
-
b,c);if(!a.connect(d)){var e=b.workspace.connectionChecker;throw new module$exports$Blockly$serialization$exceptions.BadConnectionCheck(e.getErrorMessage(e.canConnectWithReason(d,a,!1),d,a),a.type===$.module$exports$Blockly$inputTypes.inputTypes.VALUE?"output connection":"previous connection",b,c);}}},module$contents$Blockly$serialization$blocks_loadIcons=function(a,b){b.icons&&(b=b.icons.comment)&&(a.setCommentText(b.text),a.commentModel.pinned=b.pinned,
|
|
358
|
-
b.height),b.pinned&&a.
|
|
359
|
-
d=0;d<c.length;d++){var e=c[d],f=a.getInput(e);if(!f||!f.connection)throw new module$exports$Blockly$serialization$exceptions.MissingConnection(e,a,b);module$contents$Blockly$serialization$blocks_loadConnection(f.connection,b.inputs[e])}},module$contents$Blockly$serialization$blocks_loadNextBlocks=function(a,b){if(b.next){if(!a.nextConnection)throw new module$exports$Blockly$serialization$exceptions.MissingConnection("next",a,b);module$contents$Blockly$serialization$blocks_loadConnection(a.nextConnection,
|
|
360
|
+
b,c);if(!a.connect(d)){var e=b.workspace.connectionChecker;throw new module$exports$Blockly$serialization$exceptions.BadConnectionCheck(e.getErrorMessage(e.canConnectWithReason(d,a,!1),d,a),a.type===$.module$exports$Blockly$inputTypes.inputTypes.VALUE?"output connection":"previous connection",b,c);}}},module$contents$Blockly$serialization$blocks_loadIcons=function(a,b){b.icons&&(b=b.icons.comment)&&(a.setCommentText(b.text),"pinned"in b&&(a.commentModel.pinned=b.pinned),"width"in b&&"height"in b&&
|
|
361
|
+
(a.commentModel.size=new module$exports$Blockly$utils$Size.Size(b.width,b.height)),b.pinned&&a.rendered&&!a.isInFlyout&&setTimeout(function(){return a.getCommentIcon().setVisible(!0)},1))},module$contents$Blockly$serialization$blocks_loadFields=function(a,b){if(b.fields)for(var c=Object.keys(b.fields),d=0;d<c.length;d++){var e=c[d],f=b.fields[e],g=a.getField(e);g?g.loadState(f):console.warn("Ignoring non-existant field "+e+" in block "+a.type)}},module$contents$Blockly$serialization$blocks_loadInputBlocks=
|
|
362
|
+
function(a,b){if(b.inputs)for(var c=Object.keys(b.inputs),d=0;d<c.length;d++){var e=c[d],f=a.getInput(e);if(!f||!f.connection)throw new module$exports$Blockly$serialization$exceptions.MissingConnection(e,a,b);module$contents$Blockly$serialization$blocks_loadConnection(f.connection,b.inputs[e])}},module$contents$Blockly$serialization$blocks_loadNextBlocks=function(a,b){if(b.next){if(!a.nextConnection)throw new module$exports$Blockly$serialization$exceptions.MissingConnection("next",a,b);module$contents$Blockly$serialization$blocks_loadConnection(a.nextConnection,
|
|
360
363
|
b.next)}},module$contents$Blockly$serialization$blocks_loadConnection=function(a,b){b.shadow&&a.setShadowState(b.shadow);b.block&&module$contents$Blockly$serialization$blocks_appendPrivate(b.block,a.getSourceBlock().workspace,{parentConnection:a})},module$contents$Blockly$serialization$blocks_initBlock=function(a,b){b?(a.setConnectionTracking(!1),a.initSvg(),a.render(!1)):a.initModel()},module$contents$Blockly$serialization$blocks_saveBlock=module$exports$Blockly$serialization$blocks.save,module$contents$Blockly$serialization$blocks_BlockSerializer=
|
|
361
364
|
function(){this.priority=module$exports$Blockly$serialization$priorities.BLOCKS};module$contents$Blockly$serialization$blocks_BlockSerializer.prototype.save=function(a){var b=[];a=$.$jscomp.makeIterator(a.getTopBlocks(!1));for(var c=a.next();!c.done;c=a.next())(c=module$contents$Blockly$serialization$blocks_saveBlock(c.value,{addCoordinates:!0,doFullSerialization:!1}))&&b.push(c);return b.length?{languageVersion:0,blocks:b}:null};
|
|
362
365
|
module$contents$Blockly$serialization$blocks_BlockSerializer.prototype.load=function(a,b){a=$.$jscomp.makeIterator(a.blocks);for(var c=a.next();!c.done;c=a.next())(0,module$exports$Blockly$serialization$blocks.append)(c.value,b,{recordUndo:(0,module$exports$Blockly$Events$utils.getRecordUndo)()})};module$contents$Blockly$serialization$blocks_BlockSerializer.prototype.clear=function(a){a=$.$jscomp.makeIterator(a.getTopBlocks(!1));for(var b=a.next();!b.done;b=a.next())b.value.dispose(!1)};
|
|
363
|
-
(0,module$exports$Blockly$serialization$registry.register)("blocks",new module$contents$Blockly$serialization$blocks_BlockSerializer);var module$exports$Blockly$Events$Abstract={Abstract:function(){this.isBlank=null;this.workspaceId=void 0;this.group=(0,module$exports$Blockly$Events$utils.getGroup)();this.recordUndo=(0,module$exports$Blockly$Events$utils.getRecordUndo)();this.isUiEvent=!1}};module$exports$Blockly$Events$Abstract.Abstract.prototype.toJson=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};
|
|
366
|
+
(0,module$exports$Blockly$serialization$registry.register)("blocks",new module$contents$Blockly$serialization$blocks_BlockSerializer);var module$exports$Blockly$Events$Abstract={Abstract:function(){this.isBlank=null;this.workspaceId=void 0;this.group=(0,module$exports$Blockly$Events$utils.getGroup)();this.recordUndo=(0,module$exports$Blockly$Events$utils.getRecordUndo)();this.isUiEvent=!1;this.type=void 0}};module$exports$Blockly$Events$Abstract.Abstract.prototype.toJson=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};
|
|
364
367
|
module$exports$Blockly$Events$Abstract.Abstract.prototype.fromJson=function(a){this.isBlank=!1;this.group=a.group};module$exports$Blockly$Events$Abstract.Abstract.prototype.isNull=function(){return!1};module$exports$Blockly$Events$Abstract.Abstract.prototype.run=function(a){};
|
|
365
368
|
module$exports$Blockly$Events$Abstract.Abstract.prototype.getEventWorkspace_=function(){var a;this.workspaceId&&(a=module$exports$Blockly$Workspace.Workspace.getById(this.workspaceId));if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a};var module$exports$Blockly$Events$BlockBase={BlockBase:function(a){module$exports$Blockly$Events$Abstract.Abstract.call(this);this.blockId=(this.isBlank="undefined"===typeof a)?"":a.id;this.workspaceId=this.isBlank?"":a.workspace.id}};$.$jscomp.inherits(module$exports$Blockly$Events$BlockBase.BlockBase,module$exports$Blockly$Events$Abstract.Abstract);
|
|
366
369
|
module$exports$Blockly$Events$BlockBase.BlockBase.prototype.toJson=function(){var a=module$exports$Blockly$Events$Abstract.Abstract.prototype.toJson.call(this);a.blockId=this.blockId;return a};module$exports$Blockly$Events$BlockBase.BlockBase.prototype.fromJson=function(a){module$exports$Blockly$Events$Abstract.Abstract.prototype.fromJson.call(this,a);this.blockId=a.blockId};var module$exports$Blockly$Events$BlockCreate={BlockCreate:function(a){module$exports$Blockly$Events$BlockBase.BlockBase.call(this,a);this.type=module$exports$Blockly$Events$utils.CREATE;a&&(a.isShadow()&&(this.recordUndo=!1),this.xml=(0,$.module$exports$Blockly$Xml.blockToDomWithXY)(a),this.ids=(0,module$exports$Blockly$Events$utils.getDescendantIds)(a),this.json=(0,module$exports$Blockly$serialization$blocks.save)(a,{addCoordinates:!0}))}};
|
|
@@ -376,8 +379,10 @@ $.module$exports$Blockly$ContextMenu.hide=function(){(0,module$exports$Blockly$W
|
|
|
376
379
|
$.module$exports$Blockly$ContextMenu.callbackFactory=function(a,b){return function(){(0,module$exports$Blockly$Events$utils.disable)();try{var c=(0,$.module$exports$Blockly$Xml.domToBlock)(b,a.workspace);var d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-$.module$exports$Blockly$config.config.snapRadius:d.x+$.module$exports$Blockly$config.config.snapRadius;d.y+=2*$.module$exports$Blockly$config.config.snapRadius;c.moveBy(d.x,d.y)}finally{(0,module$exports$Blockly$Events$utils.enable)()}(0,module$exports$Blockly$Events$utils.isEnabled)()&&
|
|
377
380
|
!c.isShadow()&&(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CREATE))(c));c.select()}};$.module$exports$Blockly$ContextMenu.commentDeleteOption=function(a){return{text:$.module$exports$Blockly$Msg.Msg.REMOVE_COMMENT,enabled:!0,callback:function(){(0,module$exports$Blockly$Events$utils.setGroup)(!0);a.dispose();(0,module$exports$Blockly$Events$utils.setGroup)(!1)}}};
|
|
378
381
|
$.module$exports$Blockly$ContextMenu.commentDuplicateOption=function(a){return{text:$.module$exports$Blockly$Msg.Msg.DUPLICATE_COMMENT,enabled:!0,callback:function(){(0,module$exports$Blockly$clipboard.duplicate)(a)}}};
|
|
379
|
-
$.module$exports$Blockly$ContextMenu.workspaceCommentOption=function(a,b){var c=module$exports$Blockly$WorkspaceCommentSvg;if(!c)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!module$exports$Blockly$utils$userAgent.IE};d.text=$.module$exports$Blockly$Msg.Msg.ADD_COMMENT;d.callback=function(){var e=new c(a,$.module$exports$Blockly$Msg.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT,c.DEFAULT_SIZE,c.DEFAULT_SIZE),f=a.getInjectionDiv().getBoundingClientRect();f=
|
|
380
|
-
f.left,b.clientY-f.top);var g=a.getOriginOffsetInPixels();f=module$exports$Blockly$utils$Coordinate.Coordinate.difference(f,g);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.rendered&&(e.initSvg(),e.render(),e.select())};return d};var module$exports$Blockly$utils$array={removeElem:function(a,b){b=a.indexOf(b);if(-1===b)return!1;a.splice(b,1);return!0}};var module$exports$Blockly$blockRendering$
|
|
382
|
+
$.module$exports$Blockly$ContextMenu.workspaceCommentOption=function(a,b){var c=module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg;if(!c)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!module$exports$Blockly$utils$userAgent.IE};d.text=$.module$exports$Blockly$Msg.Msg.ADD_COMMENT;d.callback=function(){var e=new c(a,$.module$exports$Blockly$Msg.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT,c.DEFAULT_SIZE,c.DEFAULT_SIZE),f=a.getInjectionDiv().getBoundingClientRect();f=
|
|
383
|
+
new module$exports$Blockly$utils$Coordinate.Coordinate(b.clientX-f.left,b.clientY-f.top);var g=a.getOriginOffsetInPixels();f=module$exports$Blockly$utils$Coordinate.Coordinate.difference(f,g);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.rendered&&(e.initSvg(),e.render(),e.select())};return d};var module$exports$Blockly$utils$array={removeElem:function(a,b){b=a.indexOf(b);if(-1===b)return!1;a.splice(b,1);return!0}};var module$exports$Blockly$blockRendering$debug={},module$contents$Blockly$blockRendering$debug_useDebugger=!1;module$exports$Blockly$blockRendering$debug.isDebuggerEnabled=function(){return module$contents$Blockly$blockRendering$debug_useDebugger};
|
|
384
|
+
module$exports$Blockly$blockRendering$debug.startDebugger=function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.blockRendering.debug.startDebugger()","February 2022","September 2022","the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)");module$contents$Blockly$blockRendering$debug_useDebugger=!0};
|
|
385
|
+
module$exports$Blockly$blockRendering$debug.stopDebugger=function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.blockRendering.debug.stopDebugger()","February 2022","September 2022","the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)");module$contents$Blockly$blockRendering$debug_useDebugger=!1};var module$exports$Blockly$blockRendering$Types={Types:{NONE:0,FIELD:1,HAT:2,ICON:4,SPACER:8,BETWEEN_ROW_SPACER:16,IN_ROW_SPACER:32,EXTERNAL_VALUE_INPUT:64,INPUT:128,INLINE_INPUT:256,STATEMENT_INPUT:512,CONNECTION:1024,PREVIOUS_CONNECTION:2048,NEXT_CONNECTION:4096,OUTPUT_CONNECTION:8192,CORNER:16384,LEFT_SQUARE_CORNER:32768,LEFT_ROUND_CORNER:65536,RIGHT_SQUARE_CORNER:131072,RIGHT_ROUND_CORNER:262144,JAGGED_EDGE:524288,ROW:1048576,TOP_ROW:2097152,BOTTOM_ROW:4194304,INPUT_ROW:8388608}};
|
|
381
386
|
module$exports$Blockly$blockRendering$Types.Types.LEFT_CORNER=module$exports$Blockly$blockRendering$Types.Types.LEFT_SQUARE_CORNER|module$exports$Blockly$blockRendering$Types.Types.LEFT_ROUND_CORNER;module$exports$Blockly$blockRendering$Types.Types.RIGHT_CORNER=module$exports$Blockly$blockRendering$Types.Types.RIGHT_SQUARE_CORNER|module$exports$Blockly$blockRendering$Types.Types.RIGHT_ROUND_CORNER;module$exports$Blockly$blockRendering$Types.Types.nextTypeValue_=16777216;
|
|
382
387
|
module$exports$Blockly$blockRendering$Types.Types.getType=function(a){Object.prototype.hasOwnProperty.call(module$exports$Blockly$blockRendering$Types.Types,a)||(module$exports$Blockly$blockRendering$Types.Types[a]=module$exports$Blockly$blockRendering$Types.Types.nextTypeValue_,module$exports$Blockly$blockRendering$Types.Types.nextTypeValue_<<=1);return module$exports$Blockly$blockRendering$Types.Types[a]};module$exports$Blockly$blockRendering$Types.Types.isField=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.FIELD};
|
|
383
388
|
module$exports$Blockly$blockRendering$Types.Types.isHat=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.HAT};module$exports$Blockly$blockRendering$Types.Types.isIcon=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.ICON};module$exports$Blockly$blockRendering$Types.Types.isSpacer=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.SPACER};
|
|
@@ -387,7 +392,7 @@ module$exports$Blockly$blockRendering$Types.Types.isNextConnection=function(a){r
|
|
|
387
392
|
module$exports$Blockly$blockRendering$Types.Types.isRightRoundedCorner=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.RIGHT_ROUND_CORNER};module$exports$Blockly$blockRendering$Types.Types.isLeftSquareCorner=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.LEFT_SQUARE_CORNER};module$exports$Blockly$blockRendering$Types.Types.isRightSquareCorner=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.RIGHT_SQUARE_CORNER};
|
|
388
393
|
module$exports$Blockly$blockRendering$Types.Types.isCorner=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.CORNER};module$exports$Blockly$blockRendering$Types.Types.isJaggedEdge=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.JAGGED_EDGE};module$exports$Blockly$blockRendering$Types.Types.isRow=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.ROW};
|
|
389
394
|
module$exports$Blockly$blockRendering$Types.Types.isBetweenRowSpacer=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.BETWEEN_ROW_SPACER};module$exports$Blockly$blockRendering$Types.Types.isTopRow=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.TOP_ROW};module$exports$Blockly$blockRendering$Types.Types.isBottomRow=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.BOTTOM_ROW};
|
|
390
|
-
module$exports$Blockly$blockRendering$Types.Types.isTopOrBottomRow=function(a){return a.type&(module$exports$Blockly$blockRendering$Types.Types.TOP_ROW|module$exports$Blockly$blockRendering$Types.Types.BOTTOM_ROW)};module$exports$Blockly$blockRendering$Types.Types.isInputRow=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.INPUT_ROW};var module$exports$Blockly$blockRendering$Row={Row:function(a){this.type=module$exports$Blockly$blockRendering$Types.Types.ROW;this.elements=[];this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0;this.
|
|
395
|
+
module$exports$Blockly$blockRendering$Types.Types.isTopOrBottomRow=function(a){return a.type&(module$exports$Blockly$blockRendering$Types.Types.TOP_ROW|module$exports$Blockly$blockRendering$Types.Types.BOTTOM_ROW)};module$exports$Blockly$blockRendering$Types.Types.isInputRow=function(a){return a.type&module$exports$Blockly$blockRendering$Types.Types.INPUT_ROW};var module$exports$Blockly$blockRendering$Row={Row:function(a){this.type=module$exports$Blockly$blockRendering$Types.Types.ROW;this.elements=[];this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0;this.hasStatement=this.hasExternalInput=!1;this.statementEdge=0;this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=!1;this.constants_=a;this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT;this.align=null}};
|
|
391
396
|
module$exports$Blockly$blockRendering$Row.Row.prototype.getLastInput=function(){for(var a=this.elements.length-1;0<=a;a--){var b=this.elements[a];if(module$exports$Blockly$blockRendering$Types.Types.isInput(b))return b}return null};module$exports$Blockly$blockRendering$Row.Row.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};module$exports$Blockly$blockRendering$Row.Row.prototype.startsWithElemSpacer=function(){return!0};
|
|
392
397
|
module$exports$Blockly$blockRendering$Row.Row.prototype.endsWithElemSpacer=function(){return!0};module$exports$Blockly$blockRendering$Row.Row.prototype.getFirstSpacer=function(){for(var a=0;a<this.elements.length;a++){var b=this.elements[a];if(module$exports$Blockly$blockRendering$Types.Types.isSpacer(b))return b}return null};module$exports$Blockly$blockRendering$Row.Row.prototype.getLastSpacer=function(){for(var a=this.elements.length-1;0<=a;a--){var b=this.elements[a];if(module$exports$Blockly$blockRendering$Types.Types.isSpacer(b))return b}return null};var module$exports$Blockly$blockRendering$BottomRow={BottomRow:function(a){module$exports$Blockly$blockRendering$Row.Row.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.BOTTOM_ROW;this.hasNextConnection=!1;this.connection=null;this.baseline=this.descenderHeight=0}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$BottomRow.BottomRow,module$exports$Blockly$blockRendering$Row.Row);
|
|
393
398
|
module$exports$Blockly$blockRendering$BottomRow.BottomRow.prototype.hasLeftSquareCorner=function(a){return!!a.outputConnection||!!a.getNextBlock()};module$exports$Blockly$blockRendering$BottomRow.BottomRow.prototype.hasRightSquareCorner=function(a){return!0};
|
|
@@ -439,103 +444,12 @@ module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototyp
|
|
|
439
444
|
module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.injectCSS_=function(a,b){b=this.getCSS_(b);a="blockly-renderer-style-"+a;this.cssNode_=document.getElementById(a);var c=b.join("\n");this.cssNode_?this.cssNode_.firstChild.textContent=c:(b=document.createElement("style"),b.id=a,a=document.createTextNode(c),b.appendChild(a),document.head.insertBefore(b,document.head.firstChild),this.cssNode_=b)};
|
|
440
445
|
module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.getCSS_=function(a){return[a+" .blocklyText, ",a+" .blocklyFlyoutLabelText {","font: "+this.FIELD_TEXT_FONTWEIGHT+" "+this.FIELD_TEXT_FONTSIZE+"pt "+this.FIELD_TEXT_FONTFAMILY+";","}",a+" .blocklyText {","fill: #fff;","}",a+" .blocklyNonEditableText>rect,",a+" .blocklyEditableText>rect {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","fill-opacity: .6;","stroke: none;","}",a+" .blocklyNonEditableText>text,",a+" .blocklyEditableText>text {",
|
|
441
446
|
"fill: #000;","}",a+" .blocklyFlyoutLabelText {","fill: #000;","}",a+" .blocklyText.blocklyBubbleText {","fill: #000;","}",a+" .blocklyEditableText:not(.editing):hover>rect {","stroke: #fff;","stroke-width: 2;","}",a+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",a+" .blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",a+" .blocklyHighlightedConnectionPath {","stroke: #fc3;","}",a+" .blocklyReplaceable .blocklyPath {",
|
|
442
|
-
"fill-opacity: .5;","}",a+" .blocklyReplaceable .blocklyPathLight,",a+" .blocklyReplaceable .blocklyPathDark {","display: none;","}",a+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"]};var module$exports$Blockly$blockRendering$
|
|
443
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.recordSizeOnBlock_=function(){this.block_.height=this.info_.height;this.block_.width=this.info_.widthWithChildren};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.hideHiddenIcons_=function(){for(var a=0,b;b=this.info_.hiddenIcons[a];a++)b.icon.iconGroup_.setAttribute("display","none")};
|
|
444
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawOutline_=function(){this.drawTop_();for(var a=1;a<this.info_.rows.length-1;a++){var b=this.info_.rows[a];b.hasJaggedEdge?this.drawJaggedEdge_(b):b.hasStatement?this.drawStatementInput_(b):b.hasExternalInput?this.drawValueInput_(b):this.drawRightSideRow_(b)}this.drawBottom_();this.drawLeft_()};
|
|
445
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawTop_=function(){var a=this.info_.topRow,b=a.elements;this.positionPreviousConnection_();this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.moveBy)(a.xPos,this.info_.startY);for(var c=0,d;d=b[c];c++)module$exports$Blockly$blockRendering$Types.Types.isLeftRoundedCorner(d)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topLeft:module$exports$Blockly$blockRendering$Types.Types.isRightRoundedCorner(d)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topRight:
|
|
446
|
-
module$exports$Blockly$blockRendering$Types.Types.isPreviousConnection(d)?this.outlinePath_+=d.shape.pathLeft:module$exports$Blockly$blockRendering$Types.Types.isHat(d)?this.outlinePath_+=this.constants_.START_HAT.path:module$exports$Blockly$blockRendering$Types.Types.isSpacer(d)&&(this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",d.width));this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",a.height)};
|
|
447
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawJaggedEdge_=function(a){this.outlinePath_+=this.constants_.JAGGED_TEETH.path+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",a.height-this.constants_.JAGGED_TEETH.height)};
|
|
448
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawValueInput_=function(a){var b=a.getLastInput();this.positionExternalValueConnection_(a);var c="function"===typeof b.shape.pathDown?b.shape.pathDown(b.height):b.shape.pathDown;this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",b.xPos+b.width)+c+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",a.height-b.connectionHeight)};
|
|
449
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawStatementInput_=function(a){var b=a.getLastInput(),c=b.xPos+b.notchOffset+b.shape.width;b=b.shape.pathRight+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",-(b.notchOffset-this.constants_.INSIDE_CORNERS.width))+this.constants_.INSIDE_CORNERS.pathTop;var d=a.height-2*this.constants_.INSIDE_CORNERS.height;this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",c)+b+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",
|
|
450
|
-
d)+this.constants_.INSIDE_CORNERS.pathBottom+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a.xPos+a.width);this.positionStatementInputConnection_(a)};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawRightSideRow_=function(a){this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.yPos+a.height)};
|
|
451
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawBottom_=function(){var a=this.info_.bottomRow,b=a.elements;this.positionNextConnection_();for(var c=0,d="",e=b.length-1,f;f=b[e];e--)module$exports$Blockly$blockRendering$Types.Types.isNextConnection(f)?d+=f.shape.pathRight:module$exports$Blockly$blockRendering$Types.Types.isLeftSquareCorner(f)?d+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a.xPos):module$exports$Blockly$blockRendering$Types.Types.isLeftRoundedCorner(f)?
|
|
452
|
-
d+=this.constants_.OUTSIDE_CORNERS.bottomLeft:module$exports$Blockly$blockRendering$Types.Types.isRightRoundedCorner(f)?(d+=this.constants_.OUTSIDE_CORNERS.bottomRight,c=this.constants_.OUTSIDE_CORNERS.rightHeight):module$exports$Blockly$blockRendering$Types.Types.isSpacer(f)&&(d+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",-1*f.width));this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.baseline-c);this.outlinePath_+=d};
|
|
453
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawLeft_=function(){var a=this.info_.outputConnection;this.positionOutputConnection_();if(a){var b=a.connectionOffsetY+a.height;a="function"===typeof a.shape.pathUp?a.shape.pathUp(a.height):a.shape.pathUp;this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",b)+a}this.outlinePath_+="z"};
|
|
454
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawInternals_=function(){for(var a=0,b;b=this.info_.rows[a];a++)for(var c=0,d;d=b.elements[c];c++)module$exports$Blockly$blockRendering$Types.Types.isInlineInput(d)?this.drawInlineInput_(d):(module$exports$Blockly$blockRendering$Types.Types.isIcon(d)||module$exports$Blockly$blockRendering$Types.Types.isField(d))&&this.layoutField_(d)};
|
|
455
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.layoutField_=function(a){if(module$exports$Blockly$blockRendering$Types.Types.isField(a))var b=a.field.getSvgRoot();else module$exports$Blockly$blockRendering$Types.Types.isIcon(a)&&(b=a.icon.iconGroup_);var c=a.centerline-a.height/2,d=a.xPos,e="";this.info_.RTL&&(d=-(d+a.width),a.flipRtl&&(d+=a.width,e="scale(-1 1)"));module$exports$Blockly$blockRendering$Types.Types.isIcon(a)?(b.setAttribute("display","block"),b.setAttribute("transform",
|
|
456
|
-
"translate("+d+","+c+")"),a.icon.computeIconLocation()):b.setAttribute("transform","translate("+d+","+c+")"+e);this.info_.isInsertionMarker&&b.setAttribute("display","none")};
|
|
457
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawInlineInput_=function(a){var b=a.width,c=a.height,d=a.connectionOffsetY,e=a.connectionHeight+d;this.inlinePath_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(a.xPos+a.connectionWidth,a.centerline-c/2)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",d)+a.shape.pathDown+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",c-e)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",b-a.connectionWidth)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",
|
|
458
|
-
-c)+"z";this.positionInlineInputConnection_(a)};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionInlineInputConnection_=function(a){var b=a.centerline-a.height/2;if(a.connectionModel){var c=a.xPos+a.connectionWidth+a.connectionOffsetX;this.info_.RTL&&(c*=-1);a.connectionModel.setOffsetInBlock(c,b+a.connectionOffsetY)}};
|
|
459
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionStatementInputConnection_=function(a){var b=a.getLastInput();if(b.connectionModel){var c=a.xPos+a.statementEdge+b.notchOffset;this.info_.RTL&&(c*=-1);b.connectionModel.setOffsetInBlock(c,a.yPos)}};
|
|
460
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionExternalValueConnection_=function(a){var b=a.getLastInput();if(b.connectionModel){var c=a.xPos+a.width;this.info_.RTL&&(c*=-1);b.connectionModel.setOffsetInBlock(c,a.yPos)}};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionPreviousConnection_=function(){var a=this.info_.topRow;if(a.connection){var b=a.xPos+a.notchOffset;a.connection.connectionModel.setOffsetInBlock(this.info_.RTL?-b:b,0)}};
|
|
461
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionNextConnection_=function(){var a=this.info_.bottomRow;if(a.connection){var b=a.connection,c=b.xPos;b.connectionModel.setOffsetInBlock(this.info_.RTL?-c:c,a.baseline)}};
|
|
462
|
-
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionOutputConnection_=function(){if(this.info_.outputConnection){var a=this.info_.startX+this.info_.outputConnection.connectionOffsetX;this.block_.outputConnection.setOffsetInBlock(this.info_.RTL?-a:a,this.info_.outputConnection.connectionOffsetY)}};var module$exports$Blockly$blockRendering$InputConnection={InputConnection:function(a,b){module$exports$Blockly$blockRendering$Connection.Connection.call(this,a,b.connection);this.type|=module$exports$Blockly$blockRendering$Types.Types.INPUT;this.input=b;this.align=b.align;(this.connectedBlock=b.connection&&b.connection.targetBlock()?b.connection.targetBlock():null)?(a=this.connectedBlock.getHeightWidth(),this.connectedBlockWidth=a.width,this.connectedBlockHeight=a.height):this.connectedBlockHeight=
|
|
463
|
-
this.connectedBlockWidth=0;this.connectionOffsetY=this.connectionOffsetX=0}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$InputConnection.InputConnection,module$exports$Blockly$blockRendering$Connection.Connection);var module$exports$Blockly$blockRendering$ExternalValueInput={ExternalValueInput:function(a,b){module$exports$Blockly$blockRendering$InputConnection.InputConnection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.EXTERNAL_VALUE_INPUT;this.height=0;this.height=this.connectedBlock?this.connectedBlockHeight-this.constants_.TAB_OFFSET_FROM_TOP-this.constants_.MEDIUM_PADDING:this.shape.height;this.width=this.shape.width+this.constants_.EXTERNAL_VALUE_INPUT_PADDING;this.connectionOffsetY=
|
|
464
|
-
this.constants_.TAB_OFFSET_FROM_TOP;this.connectionHeight=this.shape.height;this.connectionWidth=this.shape.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$ExternalValueInput.ExternalValueInput,module$exports$Blockly$blockRendering$InputConnection.InputConnection);var module$exports$Blockly$blockRendering$Field={Field:function(a,b,c){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.field=b;this.isEditable=b.EDITABLE;this.flipRtl=b.getFlipRtl();this.type|=module$exports$Blockly$blockRendering$Types.Types.FIELD;a=this.field.getSize();this.height=a.height;this.width=a.width;this.parentInput=c}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$Field.Field,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$Hat={Hat:function(a){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.HAT;this.height=this.constants_.START_HAT.height;this.width=this.constants_.START_HAT.width;this.ascenderHeight=this.height}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$Hat.Hat,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$IPathObject={IPathObject:function(a,b){}};var module$exports$Blockly$blockRendering$Icon={Icon:function(a,b){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.icon=b;this.isVisible=b.isVisible();this.type|=module$exports$Blockly$blockRendering$Types.Types.ICON;a=b.getCorrectedSize();this.height=a.height;this.width=a.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$Icon.Icon,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$InRowSpacer={InRowSpacer:function(a,b){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type=this.type|module$exports$Blockly$blockRendering$Types.Types.SPACER|module$exports$Blockly$blockRendering$Types.Types.IN_ROW_SPACER;this.width=b;this.height=this.constants_.SPACER_DEFAULT_HEIGHT}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$InRowSpacer.InRowSpacer,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$InlineInput={InlineInput:function(a,b){module$exports$Blockly$blockRendering$InputConnection.InputConnection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.INLINE_INPUT;this.connectedBlock?(this.width=this.connectedBlockWidth,this.height=this.connectedBlockHeight):(this.height=this.constants_.EMPTY_INLINE_INPUT_HEIGHT,this.width=this.constants_.EMPTY_INLINE_INPUT_PADDING);this.connectionHeight=this.isDynamicShape?this.shape.height(this.height):
|
|
465
|
-
this.shape.height;this.connectionWidth=this.isDynamicShape?this.shape.width(this.height):this.shape.width;this.connectedBlock||(this.width+=this.connectionWidth*(this.isDynamicShape?2:1));this.connectionOffsetY=this.isDynamicShape?this.shape.connectionOffsetY(this.connectionHeight):this.constants_.TAB_OFFSET_FROM_TOP;this.connectionOffsetX=this.isDynamicShape?this.shape.connectionOffsetX(this.connectionWidth):0}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$InlineInput.InlineInput,module$exports$Blockly$blockRendering$InputConnection.InputConnection);var module$exports$Blockly$blockRendering$InputRow={InputRow:function(a){module$exports$Blockly$blockRendering$Row.Row.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.INPUT_ROW;this.connectedBlockWidths=0}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$InputRow.InputRow,module$exports$Blockly$blockRendering$Row.Row);
|
|
466
|
-
module$exports$Blockly$blockRendering$InputRow.InputRow.prototype.measure=function(){this.width=this.minWidth;this.height=this.minHeight;for(var a=0,b=0;b<this.elements.length;b++){var c=this.elements[b];this.width+=c.width;module$exports$Blockly$blockRendering$Types.Types.isInput(c)&&(module$exports$Blockly$blockRendering$Types.Types.isStatementInput(c)?a+=c.connectedBlockWidth:module$exports$Blockly$blockRendering$Types.Types.isExternalInput(c)&&0!==c.connectedBlockWidth&&(a+=c.connectedBlockWidth-
|
|
467
|
-
c.connectionWidth));module$exports$Blockly$blockRendering$Types.Types.isSpacer(c)||(this.height=Math.max(this.height,c.height))}this.connectedBlockWidths=a;this.widthWithConnectedBlocks=this.width+a};module$exports$Blockly$blockRendering$InputRow.InputRow.prototype.endsWithElemSpacer=function(){return!this.hasExternalInput&&!this.hasStatement};var module$exports$Blockly$blockRendering$JaggedEdge={JaggedEdge:function(a){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.JAGGED_EDGE;this.height=this.constants_.JAGGED_TEETH.height;this.width=this.constants_.JAGGED_TEETH.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$JaggedEdge.JaggedEdge,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$ASTNode={ASTNode:function(a,b,c){if(!b)throw Error("Cannot create a node without a location.");this.type_=a;this.isConnection_=module$exports$Blockly$ASTNode.ASTNode.isConnectionType_(a);this.location_=b;this.wsCoordinate_=null;this.processParams_(c||null)}};module$exports$Blockly$ASTNode.ASTNode.prototype.processParams_=function(a){a&&a.wsCoordinate&&(this.wsCoordinate_=a.wsCoordinate)};module$exports$Blockly$ASTNode.ASTNode.prototype.getLocation=function(){return this.location_};
|
|
468
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.getType=function(){return this.type_};module$exports$Blockly$ASTNode.ASTNode.prototype.getWsCoordinate=function(){return this.wsCoordinate_};module$exports$Blockly$ASTNode.ASTNode.prototype.isConnection=function(){return this.isConnection_};
|
|
469
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.findNextForInput_=function(){var a=this.location_.getParentInput(),b=a.getSourceBlock();for(a=b.inputList.indexOf(a)+1;a<b.inputList.length;a++){for(var c=b.inputList[a],d=c.fieldRow,e=0;e<d.length;e++){var f=d[e];if(f.isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(f)}if(c.connection)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(c)}return null};
|
|
470
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.findNextForField_=function(){var a=this.location_,b=a.getParentInput(),c=a.getSourceBlock(),d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)+1;d<c.inputList.length;d++){b=c.inputList[d];for(var e=b.fieldRow;a<e.length;){if(e[a].isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(e[a]);a++}a=0;if(b.connection)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(b)}return null};
|
|
471
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.findPrevForInput_=function(){for(var a=this.location_.getParentInput(),b=a.getSourceBlock(),c=b.inputList.indexOf(a);0<=c;c--){var d=b.inputList[c];if(d.connection&&d!==a)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(d);d=d.fieldRow;for(var e=d.length-1;0<=e;e--){var f=d[e];if(f.isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(f)}}return null};
|
|
472
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.findPrevForField_=function(){var a=this.location_,b=a.getParentInput(),c=a.getSourceBlock(),d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)-1;0<=d;d--){var e=c.inputList[d];if(e.connection&&e!==b)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(e);for(e=e.fieldRow;-1<a;){if(e[a].isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(e[a]);a--}0<=d-1&&
|
|
473
|
-
(a=c.inputList[d-1].fieldRow.length-1)}return null};
|
|
474
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.navigateBetweenStacks_=function(a){var b=this.getLocation();b.getSourceBlock&&(b=b.getSourceBlock());if(!b||!b.workspace)return null;var c=b.getRootBlock();b=c.workspace.getTopBlocks(!0);for(var d=0;d<b.length;d++)if(c.id===b[d].id)return a=d+(a?1:-1),-1===a||a===b.length?null:module$exports$Blockly$ASTNode.ASTNode.createStackNode(b[a]);throw Error("Couldn't find "+(a?"next":"previous")+" stack?!");};
|
|
475
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.findTopASTNodeForBlock_=function(a){var b=module$contents$Blockly$ASTNode_getParentConnection(a);return b?module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(b):module$exports$Blockly$ASTNode.ASTNode.createBlockNode(a)};
|
|
476
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.getOutAstNodeForBlock_=function(a){if(!a)return null;a=a.getTopStackBlock();var b=module$contents$Blockly$ASTNode_getParentConnection(a);return b&&b.targetConnection&&b.targetConnection.getParentInput()?module$exports$Blockly$ASTNode.ASTNode.createInputNode(b.targetConnection.getParentInput()):module$exports$Blockly$ASTNode.ASTNode.createStackNode(a)};
|
|
477
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.findFirstFieldOrInput_=function(a){a=a.inputList;for(var b=0;b<a.length;b++){for(var c=a[b],d=c.fieldRow,e=0;e<d.length;e++){var f=d[e];if(f.isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(f)}if(c.connection)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(c)}return null};
|
|
478
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.getSourceBlock=function(){return this.getType()===module$exports$Blockly$ASTNode.ASTNode.types.BLOCK?this.getLocation():this.getType()===module$exports$Blockly$ASTNode.ASTNode.types.STACK?this.getLocation():this.getType()===module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE?null:this.getLocation().getSourceBlock()};
|
|
479
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.next=function(){switch(this.type_){case module$exports$Blockly$ASTNode.ASTNode.types.STACK:return this.navigateBetweenStacks_(!0);case module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.FIELD:return this.findNextForField_();case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:return this.findNextForInput_();
|
|
480
|
-
case module$exports$Blockly$ASTNode.ASTNode.types.BLOCK:return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(this.location_.nextConnection);case module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.NEXT:return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(this.location_.targetConnection)}return null};
|
|
481
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.in=function(){switch(this.type_){case module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE:var a=this.location_.getTopBlocks(!0);if(0<a.length)return module$exports$Blockly$ASTNode.ASTNode.createStackNode(a[0]);break;case module$exports$Blockly$ASTNode.ASTNode.types.STACK:return this.findTopASTNodeForBlock_(this.location_);case module$exports$Blockly$ASTNode.ASTNode.types.BLOCK:return this.findFirstFieldOrInput_(this.location_);case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(this.location_.targetConnection)}return null};
|
|
482
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.prev=function(){switch(this.type_){case module$exports$Blockly$ASTNode.ASTNode.types.STACK:return this.navigateBetweenStacks_(!1);case module$exports$Blockly$ASTNode.ASTNode.types.FIELD:return this.findPrevForField_();case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:return this.findPrevForInput_();case module$exports$Blockly$ASTNode.ASTNode.types.BLOCK:var a=module$contents$Blockly$ASTNode_getParentConnection(this.location_);return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(a);
|
|
483
|
-
case module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS:if((a=this.location_.targetConnection)&&!a.getParentInput())return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(a);break;case module$exports$Blockly$ASTNode.ASTNode.types.NEXT:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock())}return null};
|
|
484
|
-
module$exports$Blockly$ASTNode.ASTNode.prototype.out=function(){switch(this.type_){case module$exports$Blockly$ASTNode.ASTNode.types.STACK:var a=this.location_,b=a.getRelativeToSurfaceXY();b=new module$exports$Blockly$utils$Coordinate.Coordinate(b.x,b.y+module$exports$Blockly$ASTNode.ASTNode.DEFAULT_OFFSET_Y);return module$exports$Blockly$ASTNode.ASTNode.createWorkspaceNode(a.workspace,b);case module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT:return a=this.location_,(b=a.targetConnection)?module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(b):
|
|
485
|
-
module$exports$Blockly$ASTNode.ASTNode.createStackNode(a.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.FIELD:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.BLOCK:return this.getOutAstNodeForBlock_(this.location_);case module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS:return this.getOutAstNodeForBlock_(this.location_.getSourceBlock());
|
|
486
|
-
case module$exports$Blockly$ASTNode.ASTNode.types.NEXT:return this.getOutAstNodeForBlock_(this.location_.getSourceBlock())}return null};module$exports$Blockly$ASTNode.ASTNode.isConnectionType_=function(a){switch(a){case module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS:case module$exports$Blockly$ASTNode.ASTNode.types.NEXT:case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:case module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT:return!0}return!1};
|
|
487
|
-
module$exports$Blockly$ASTNode.ASTNode.createFieldNode=function(a){return a?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.FIELD,a):null};
|
|
488
|
-
module$exports$Blockly$ASTNode.ASTNode.createConnectionNode=function(a){if(!a)return null;var b=a.type;return b===$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE||b===$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT&&a.getParentInput()?module$exports$Blockly$ASTNode.ASTNode.createInputNode(a.getParentInput()):b===$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.NEXT,
|
|
489
|
-
a):b===$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT,a):b===$.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS,a):null};
|
|
490
|
-
module$exports$Blockly$ASTNode.ASTNode.createInputNode=function(a){return a&&a.connection?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.INPUT,a.connection):null};module$exports$Blockly$ASTNode.ASTNode.createBlockNode=function(a){return a?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.BLOCK,a):null};
|
|
491
|
-
module$exports$Blockly$ASTNode.ASTNode.createStackNode=function(a){return a?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.STACK,a):null};module$exports$Blockly$ASTNode.ASTNode.createWorkspaceNode=function(a,b){return b&&a?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE,a,{wsCoordinate:b}):null};
|
|
492
|
-
module$exports$Blockly$ASTNode.ASTNode.createTopNode=function(a){var b=module$contents$Blockly$ASTNode_getParentConnection(a);return b?module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(b):module$exports$Blockly$ASTNode.ASTNode.createBlockNode(a)};module$exports$Blockly$ASTNode.ASTNode.types={FIELD:"field",BLOCK:"block",INPUT:"input",OUTPUT:"output",NEXT:"next",PREVIOUS:"previous",STACK:"stack",WORKSPACE:"workspace"};module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS=!1;
|
|
493
|
-
module$exports$Blockly$ASTNode.ASTNode.DEFAULT_OFFSET_Y=-20;var module$contents$Blockly$ASTNode_getParentConnection=function(a){var b=a.outputConnection;if(!b||a.previousConnection&&a.previousConnection.isConnected())b=a.previousConnection;return b};var module$exports$Blockly$Events$UiBase={UiBase:function(a){module$exports$Blockly$Events$Abstract.Abstract.call(this);this.isBlank="undefined"===typeof a;this.workspaceId=a?a:"";this.recordUndo=!1;this.isUiEvent=!0}};$.$jscomp.inherits(module$exports$Blockly$Events$UiBase.UiBase,module$exports$Blockly$Events$Abstract.Abstract);var module$exports$Blockly$Events$MarkerMove={MarkerMove:function(a,b,c,d){var e=a?a.workspace.id:void 0;d&&d.getType()===module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE&&(e=d.getLocation().id);module$exports$Blockly$Events$UiBase.UiBase.call(this,e);this.blockId=a?a.id:null;this.oldNode=c;this.newNode=d;this.isCursor=b;this.type=module$exports$Blockly$Events$utils.MARKER_MOVE}};$.$jscomp.inherits(module$exports$Blockly$Events$MarkerMove.MarkerMove,module$exports$Blockly$Events$UiBase.UiBase);
|
|
494
|
-
module$exports$Blockly$Events$MarkerMove.MarkerMove.prototype.toJson=function(){var a=module$exports$Blockly$Events$UiBase.UiBase.prototype.toJson.call(this);a.isCursor=this.isCursor;a.blockId=this.blockId;a.oldNode=this.oldNode;a.newNode=this.newNode;return a};
|
|
495
|
-
module$exports$Blockly$Events$MarkerMove.MarkerMove.prototype.fromJson=function(a){module$exports$Blockly$Events$UiBase.UiBase.prototype.fromJson.call(this,a);this.isCursor=a.isCursor;this.blockId=a.blockId;this.oldNode=a.oldNode;this.newNode=a.newNode};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.MARKER_MOVE,module$exports$Blockly$Events$MarkerMove.MarkerMove);var module$exports$Blockly$blockRendering$MarkerSvg={},module$contents$Blockly$blockRendering$MarkerSvg_CURSOR_CLASS="blocklyCursor",module$contents$Blockly$blockRendering$MarkerSvg_MARKER_CLASS="blocklyMarker",module$contents$Blockly$blockRendering$MarkerSvg_HEIGHT_MULTIPLIER=.75;
|
|
496
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg=function(a,b,c){this.workspace_=a;this.marker_=c;this.parent_=null;this.constants_=b;this.currentMarkerSvg=null;a=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=c.colour||a;this.markerSvgRect_=this.markerSvgLine_=this.markerInput_=this.markerBlock_=this.svgGroup_=this.markerSvg_=null};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.getSvgRoot=function(){return this.svgGroup_};
|
|
497
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.getMarker=function(){return this.marker_};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.isCursor=function(){return"cursor"===this.marker_.type};
|
|
498
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.createDom=function(){var a=this.isCursor()?module$contents$Blockly$blockRendering$MarkerSvg_CURSOR_CLASS:module$contents$Blockly$blockRendering$MarkerSvg_MARKER_CLASS;this.svgGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{"class":a},null);this.createDomInternal_();return this.svgGroup_};
|
|
499
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.setParent_=function(a){this.isCursor()?(this.parent_&&this.parent_.setCursorSvg(null),a.setCursorSvg(this.getSvgRoot())):(this.parent_&&this.parent_.setMarkerSvg(null),a.setMarkerSvg(this.getSvgRoot()));this.parent_=a};
|
|
500
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.draw=function(a,b){if(b){this.constants_=this.workspace_.getRenderer().getConstants();var c=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=this.marker_.colour||c;this.applyColour_(b);this.showAtLocation_(b);this.fireMarkerEvent_(a,b);a=this.currentMarkerSvg.childNodes[0];void 0!==a&&a.beginElement&&a.beginElement()}else this.hide()};
|
|
501
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showAtLocation_=function(a){var b=a.getLocation().type;a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.BLOCK?this.showWithBlock_(a):a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT?this.showWithOutput_(a):b===$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE?this.showWithInput_(a):b===$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT?this.showWithNext_(a):a.getType()===
|
|
502
|
-
module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS?this.showWithPrevious_(a):a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.FIELD?this.showWithField_(a):a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE?this.showWithCoordinates_(a):a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.STACK&&this.showWithStack_(a)};
|
|
503
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithBlockPrevOutput_=function(a){a=a.getSourceBlock();var b=a.width,c=a.height,d=c*module$contents$Blockly$blockRendering$MarkerSvg_HEIGHT_MULTIPLIER,e=this.constants_.CURSOR_BLOCK_PADDING;a.previousConnection?(c=this.constants_.shapeFor(a.previousConnection),this.positionPrevious_(b,e,d,c)):a.outputConnection?(d=this.constants_.shapeFor(a.outputConnection),this.positionOutput_(b,c,d)):this.positionBlock_(b,e,d);this.setParent_(a);
|
|
504
|
-
this.showCurrent_()};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithBlock_=function(a){this.showWithBlockPrevOutput_(a)};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithPrevious_=function(a){this.showWithBlockPrevOutput_(a)};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithOutput_=function(a){this.showWithBlockPrevOutput_(a)};
|
|
505
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithCoordinates_=function(a){var b=a.getWsCoordinate();a=b.x;b=b.y;this.workspace_.RTL&&(a-=this.constants_.CURSOR_WS_WIDTH);this.positionLine_(a,b,this.constants_.CURSOR_WS_WIDTH);this.setParent_(this.workspace_);this.showCurrent_()};
|
|
506
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithField_=function(a){a=a.getLocation();var b=a.getSize().width,c=a.getSize().height;this.positionRect_(0,0,b,c);this.setParent_(a);this.showCurrent_()};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithInput_=function(a){a=a.getLocation();var b=a.getSourceBlock();this.positionInput_(a);this.setParent_(b);this.showCurrent_()};
|
|
507
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithNext_=function(a){var b=a.getLocation();a=b.getSourceBlock();var c=0;b=b.getOffsetInBlock().y;var d=a.getHeightWidth().width;this.workspace_.RTL&&(c=-d);this.positionLine_(c,b,d);this.setParent_(a);this.showCurrent_()};
|
|
508
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithStack_=function(a){a=a.getLocation();var b=a.getHeightWidth(),c=b.width+this.constants_.CURSOR_STACK_PADDING;b=b.height+this.constants_.CURSOR_STACK_PADDING;var d=-this.constants_.CURSOR_STACK_PADDING/2,e=-this.constants_.CURSOR_STACK_PADDING/2,f=d;this.workspace_.RTL&&(f=-(c+d));this.positionRect_(f,e,c,b);this.setParent_(a);this.showCurrent_()};
|
|
509
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showCurrent_=function(){this.hide();this.currentMarkerSvg.style.display=""};
|
|
510
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionBlock_=function(a,b,c){a=(0,module$exports$Blockly$utils$svgPaths.moveBy)(-b,c)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",-b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a+2*b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",c);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_};
|
|
511
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionInput_=function(a){var b=a.getOffsetInBlock().x,c=a.getOffsetInBlock().y;a=(0,module$exports$Blockly$utils$svgPaths.moveTo)(0,0)+this.constants_.shapeFor(a).pathDown;this.markerInput_.setAttribute("d",a);this.markerInput_.setAttribute("transform","translate("+b+","+c+")"+(this.workspace_.RTL?" scale(-1 1)":""));this.currentMarkerSvg=this.markerInput_};
|
|
512
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionLine_=function(a,b,c){this.markerSvgLine_.setAttribute("x",a);this.markerSvgLine_.setAttribute("y",b);this.markerSvgLine_.setAttribute("width",c);this.currentMarkerSvg=this.markerSvgLine_};
|
|
513
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionOutput_=function(a,b,c){a=(0,module$exports$Blockly$utils$svgPaths.moveBy)(a,0)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",-(a-c.width))+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",this.constants_.TAB_OFFSET_FROM_TOP)+c.pathDown+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&
|
|
514
|
-
this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_};
|
|
515
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionPrevious_=function(a,b,c,d){a=(0,module$exports$Blockly$utils$svgPaths.moveBy)(-b,c)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",-b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",this.constants_.NOTCH_OFFSET_LEFT)+d.pathLeft+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a+2*b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",c);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&
|
|
516
|
-
this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionRect_=function(a,b,c,d){this.markerSvgRect_.setAttribute("x",a);this.markerSvgRect_.setAttribute("y",b);this.markerSvgRect_.setAttribute("width",c);this.markerSvgRect_.setAttribute("height",d);this.currentMarkerSvg=this.markerSvgRect_};
|
|
517
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.flipRtl_=function(a){a.setAttribute("transform","scale(-1 1)")};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.hide=function(){this.markerSvgLine_.style.display="none";this.markerSvgRect_.style.display="none";this.markerInput_.style.display="none";this.markerBlock_.style.display="none"};
|
|
518
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.fireMarkerEvent_=function(a,b){var c=b.getSourceBlock();a=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.MARKER_MOVE))(c,this.isCursor(),a,b);(0,module$exports$Blockly$Events$utils.fire)(a)};
|
|
519
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.getBlinkProperties_=function(){return{attributeType:"XML",attributeName:"fill",dur:"1s",values:this.colour_+";transparent;transparent;",repeatCount:"indefinite"}};
|
|
520
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.createDomInternal_=function(){this.markerSvg_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.svgGroup_);this.markerSvgLine_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT,style:"display: none"},
|
|
521
|
-
this.markerSvg_);this.markerSvgRect_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyVerticalMarker",rx:10,ry:10,style:"display: none"},this.markerSvg_);this.markerInput_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{transform:"",style:"display: none"},this.markerSvg_);this.markerBlock_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{transform:"",
|
|
522
|
-
style:"display: none",fill:"none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_);if(this.isCursor()){var a=this.getBlinkProperties_();(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.ANIMATE,a,this.markerSvgLine_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.ANIMATE,a,this.markerInput_);a.attributeName="stroke";(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.ANIMATE,
|
|
523
|
-
a,this.markerBlock_)}return this.markerSvg_};
|
|
524
|
-
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.applyColour_=function(a){this.markerSvgLine_.setAttribute("fill",this.colour_);this.markerSvgRect_.setAttribute("stroke",this.colour_);this.markerInput_.setAttribute("fill",this.colour_);this.markerBlock_.setAttribute("stroke",this.colour_);this.isCursor()&&(a=this.colour_+";transparent;transparent;",this.markerSvgLine_.firstChild.setAttribute("values",a),this.markerInput_.firstChild.setAttribute("values",a),this.markerBlock_.firstChild.setAttribute("values",
|
|
525
|
-
a))};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.dispose=function(){this.svgGroup_&&(0,module$exports$Blockly$utils$dom.removeNode)(this.svgGroup_)};var module$exports$Blockly$blockRendering$NextConnection={NextConnection:function(a,b){module$exports$Blockly$blockRendering$Connection.Connection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.NEXT_CONNECTION;this.height=this.shape.height;this.width=this.shape.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$NextConnection.NextConnection,module$exports$Blockly$blockRendering$Connection.Connection);var module$exports$Blockly$blockRendering$OutputConnection={OutputConnection:function(a,b){module$exports$Blockly$blockRendering$Connection.Connection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.OUTPUT_CONNECTION;this.height=this.isDynamicShape?0:this.shape.height;this.startX=this.width=this.isDynamicShape?0:this.shape.width;this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP;this.connectionOffsetX=0}};
|
|
526
|
-
$.$jscomp.inherits(module$exports$Blockly$blockRendering$OutputConnection.OutputConnection,module$exports$Blockly$blockRendering$Connection.Connection);var module$exports$Blockly$blockRendering$PathObject={PathObject:function(a,b,c){this.constants=c;this.svgRoot=a;this.svgPath=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyPath"},this.svgRoot);this.style=b;this.markerSvg=this.cursorSvg=null}};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setPath=function(a){this.svgPath.setAttribute("d",a)};
|
|
527
|
-
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.flipRTL=function(){this.svgPath.setAttribute("transform","scale(-1 1)")};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setCursorSvg=function(a){a?(this.svgRoot.appendChild(a),this.cursorSvg=a):this.cursorSvg=null};
|
|
528
|
-
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setMarkerSvg=function(a){a?(this.cursorSvg?this.svgRoot.insertBefore(a,this.cursorSvg):this.svgRoot.appendChild(a),this.markerSvg=a):this.markerSvg=null};
|
|
529
|
-
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.applyColour=function(a){this.svgPath.setAttribute("stroke",this.style.colourTertiary);this.svgPath.setAttribute("fill",this.style.colourPrimary);this.updateShadow_(a.isShadow());this.updateDisabled_(!a.isEnabled()||a.getInheritedDisabled())};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setStyle=function(a){this.style=a};
|
|
530
|
-
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setClass_=function(a,b){b?(0,module$exports$Blockly$utils$dom.addClass)(this.svgRoot,a):(0,module$exports$Blockly$utils$dom.removeClass)(this.svgRoot,a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateHighlighted=function(a){a?this.svgPath.setAttribute("filter","url(#"+this.constants.embossFilterId+")"):this.svgPath.setAttribute("filter","none")};
|
|
531
|
-
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateShadow_=function(a){a&&(this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary))};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateDisabled_=function(a){this.setClass_("blocklyDisabled",a);a&&this.svgPath.setAttribute("fill","url(#"+this.constants.disabledPatternId+")")};
|
|
532
|
-
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateSelected=function(a){this.setClass_("blocklySelected",a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateDraggingDelete=function(a){this.setClass_("blocklyDraggingDelete",a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateInsertionMarker=function(a){this.setClass_("blocklyInsertionMarker",a)};
|
|
533
|
-
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateMovable=function(a){this.setClass_("blocklyDraggable",a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateReplacementFade=function(a){this.setClass_("blocklyReplaceable",a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateShapeForInputHighlight=function(a,b){};var module$exports$Blockly$blockRendering$PreviousConnection={PreviousConnection:function(a,b){module$exports$Blockly$blockRendering$Connection.Connection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.PREVIOUS_CONNECTION;this.height=this.shape.height;this.width=this.shape.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$PreviousConnection.PreviousConnection,module$exports$Blockly$blockRendering$Connection.Connection);var module$exports$Blockly$fieldRegistry={register:function(a,b){(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.FIELD,a,b)},unregister:function(a){(0,module$exports$Blockly$registry.unregister)(module$exports$Blockly$registry.Type.FIELD,a)},fromJson:function(a){var b=(0,module$exports$Blockly$registry.getObject)(module$exports$Blockly$registry.Type.FIELD,a.type);return b?b.fromJson(a):(console.warn("Blockly could not create a field of type "+a.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),
|
|
447
|
+
"fill-opacity: .5;","}",a+" .blocklyReplaceable .blocklyPathLight,",a+" .blocklyReplaceable .blocklyPathDark {","display: none;","}",a+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"]};var module$exports$Blockly$blockRendering$Field={Field:function(a,b,c){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.field=b;this.isEditable=b.EDITABLE;this.flipRtl=b.getFlipRtl();this.type|=module$exports$Blockly$blockRendering$Types.Types.FIELD;a=this.field.getSize();this.height=a.height;this.width=a.width;this.parentInput=c}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$Field.Field,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$fieldRegistry={register:function(a,b){(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.FIELD,a,b)},unregister:function(a){(0,module$exports$Blockly$registry.unregister)(module$exports$Blockly$registry.Type.FIELD,a)},fromJson:function(a){var b=(0,module$exports$Blockly$registry.getObject)(module$exports$Blockly$registry.Type.FIELD,a.type);return b?b.fromJson(a):(console.warn("Blockly could not create a field of type "+a.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),
|
|
534
448
|
null)}};var module$exports$Blockly$IASTNodeLocation={IASTNodeLocation:function(){}};var module$exports$Blockly$IASTNodeLocationSvg={IASTNodeLocationSvg:function(){}};var module$exports$Blockly$IASTNodeLocationWithBlock={IASTNodeLocationWithBlock:function(){}};var module$exports$Blockly$IKeyboardAccessible={IKeyboardAccessible:function(){}};var module$exports$Blockly$IRegistrable={IRegistrable:function(){}};var module$exports$Blockly$MarkerManager={MarkerManager:function(a){this.cursorSvg_=this.cursor_=null;this.markers_=Object.create(null);this.workspace_=a;this.markerSvg_=null}};module$exports$Blockly$MarkerManager.MarkerManager.prototype.registerMarker=function(a,b){this.markers_[a]&&this.unregisterMarker(a);b.setDrawer(this.workspace_.getRenderer().makeMarkerDrawer(this.workspace_,b));this.setMarkerSvg(b.getDrawer().createDom());this.markers_[a]=b};
|
|
535
449
|
module$exports$Blockly$MarkerManager.MarkerManager.prototype.unregisterMarker=function(a){var b=this.markers_[a];if(b)b.dispose(),delete this.markers_[a];else throw Error("Marker with ID "+a+" does not exist. Can only unregister markers that exist.");};module$exports$Blockly$MarkerManager.MarkerManager.prototype.getCursor=function(){return this.cursor_};module$exports$Blockly$MarkerManager.MarkerManager.prototype.getMarker=function(a){return this.markers_[a]||null};
|
|
536
450
|
module$exports$Blockly$MarkerManager.MarkerManager.prototype.setCursor=function(a){this.cursor_&&this.cursor_.getDrawer()&&this.cursor_.getDrawer().dispose();if(this.cursor_=a)a=this.workspace_.getRenderer().makeMarkerDrawer(this.workspace_,this.cursor_),this.cursor_.setDrawer(a),this.setCursorSvg(this.cursor_.getDrawer().createDom())};
|
|
537
451
|
module$exports$Blockly$MarkerManager.MarkerManager.prototype.setCursorSvg=function(a){a?(this.workspace_.getBlockCanvas().appendChild(a),this.cursorSvg_=a):this.cursorSvg_=null};module$exports$Blockly$MarkerManager.MarkerManager.prototype.setMarkerSvg=function(a){a?this.workspace_.getBlockCanvas()&&(this.cursorSvg_?this.workspace_.getBlockCanvas().insertBefore(a,this.cursorSvg_):this.workspace_.getBlockCanvas().appendChild(a)):this.markerSvg_=null};
|
|
538
|
-
module$exports$Blockly$MarkerManager.MarkerManager.prototype.updateMarkers=function(){this.workspace_.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace_.getCursor().draw()};module$exports$Blockly$MarkerManager.MarkerManager.prototype.dispose=function(){for(var a=Object.keys(this.markers_),b=0,c;c=a[b];b++)this.unregisterMarker(c);this.markers_=null;this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)};module$exports$Blockly$MarkerManager.MarkerManager.LOCAL_MARKER="local_marker_1";var module$exports$Blockly$Events$BlockChange={BlockChange:function(a,b,c,d,e){module$exports$Blockly$Events$BlockBase.BlockBase.call(this,a);this.type=module$exports$Blockly$Events$utils.CHANGE;a&&(this.element="undefined"===typeof b?"":b,this.name="undefined"===typeof c?"":c,this.oldValue="undefined"===typeof d?"":d,this.newValue="undefined"===typeof e?"":e)}};$.$jscomp.inherits(module$exports$Blockly$Events$BlockChange.BlockChange,module$exports$Blockly$Events$BlockBase.BlockBase);
|
|
452
|
+
module$exports$Blockly$MarkerManager.MarkerManager.prototype.updateMarkers=function(){this.workspace_.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace_.getCursor().draw()};module$exports$Blockly$MarkerManager.MarkerManager.prototype.dispose=function(){for(var a=Object.keys(this.markers_),b=0,c;c=a[b];b++)this.unregisterMarker(c);this.markers_=null;this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)};module$exports$Blockly$MarkerManager.MarkerManager.LOCAL_MARKER="local_marker_1";var module$exports$Blockly$utils$Sentinel={Sentinel:function(){}};var module$exports$Blockly$Events$BlockChange={BlockChange:function(a,b,c,d,e){module$exports$Blockly$Events$BlockBase.BlockBase.call(this,a);this.type=module$exports$Blockly$Events$utils.CHANGE;a&&(this.element="undefined"===typeof b?"":b,this.name="undefined"===typeof c?"":c,this.oldValue="undefined"===typeof d?"":d,this.newValue="undefined"===typeof e?"":e)}};$.$jscomp.inherits(module$exports$Blockly$Events$BlockChange.BlockChange,module$exports$Blockly$Events$BlockBase.BlockBase);
|
|
539
453
|
module$exports$Blockly$Events$BlockChange.BlockChange.prototype.toJson=function(){var a=module$exports$Blockly$Events$BlockBase.BlockBase.prototype.toJson.call(this);a.element=this.element;this.name&&(a.name=this.name);a.oldValue=this.oldValue;a.newValue=this.newValue;return a};
|
|
540
454
|
module$exports$Blockly$Events$BlockChange.BlockChange.prototype.fromJson=function(a){module$exports$Blockly$Events$BlockBase.BlockBase.prototype.fromJson.call(this,a);this.element=a.element;this.name=a.name;this.oldValue=a.oldValue;this.newValue=a.newValue};module$exports$Blockly$Events$BlockChange.BlockChange.prototype.isNull=function(){return this.oldValue===this.newValue};
|
|
541
455
|
module$exports$Blockly$Events$BlockChange.BlockChange.prototype.run=function(a){var b=this.getEventWorkspace_().getBlockById(this.blockId);if(b)switch(b.mutator&&b.mutator.setVisible(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(b=b.getField(this.name))?b.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":b.setCommentText(a||null);break;case "collapsed":b.setCollapsed(!!a);break;case "disabled":b.setEnabled(!a);break;case "inline":b.setInputsInline(!!a);
|
|
@@ -585,7 +499,7 @@ $.module$exports$Blockly$Names.Names.prototype.populateVariables=function(a){a=(
|
|
|
585
499
|
$.module$exports$Blockly$Names.Names.prototype.getName=function(a,b){var c=a;b===$.module$exports$Blockly$Names.NameType.VARIABLE&&(a=this.getNameForUserVariable_(a))&&(c=a);a=c.toLowerCase();var d=b===$.module$exports$Blockly$Names.NameType.VARIABLE||b===$.module$exports$Blockly$Names.NameType.DEVELOPER_VARIABLE?this.variablePrefix_:"";b in this.db_||(this.db_[b]=Object.create(null));var e=this.db_[b];if(a in e)return d+e[a];b=this.getDistinctName(c,b);e[a]=b.substr(d.length);return b};
|
|
586
500
|
$.module$exports$Blockly$Names.Names.prototype.getUserNames=function(a){return Object.keys(this.db_[a]||{})};$.module$exports$Blockly$Names.Names.prototype.getDistinctName=function(a,b){a=this.safeName_(a);for(var c="";this.dbReverse_[a+c]||a+c in this.reservedDict_;)c=c?c+1:2;a+=c;this.dbReverse_[a]=!0;return(b===$.module$exports$Blockly$Names.NameType.VARIABLE||b===$.module$exports$Blockly$Names.NameType.DEVELOPER_VARIABLE?this.variablePrefix_:"")+a};
|
|
587
501
|
$.module$exports$Blockly$Names.Names.prototype.safeName_=function(a){a?(a=encodeURI(a.replace(/ /g,"_")).replace(/[^\w]/g,"_"),-1!=="0123456789".indexOf(a[0])&&(a="my_"+a)):a=$.module$exports$Blockly$Msg.Msg.UNNAMED_KEY||"unnamed";return a};$.module$exports$Blockly$Names.Names.equals=function(a,b){return a.toLowerCase()===b.toLowerCase()};$.module$exports$Blockly$Names.NameType={DEVELOPER_VARIABLE:"DEVELOPER_VARIABLE",VARIABLE:"VARIABLE",PROCEDURE:"PROCEDURE"};
|
|
588
|
-
$.module$exports$Blockly$Names.Names.DEVELOPER_VARIABLE_TYPE=$.module$exports$Blockly$Names.NameType.DEVELOPER_VARIABLE;var module$exports$Blockly$Events$VarDelete={VarDelete:function(a){module$exports$Blockly$Events$VarBase.VarBase.call(this,a);this.type=module$exports$Blockly$Events$utils.VAR_DELETE;a&&(this.varType=a.type,this.varName=a.name)}};$.$jscomp.inherits(module$exports$Blockly$Events$VarDelete.VarDelete,module$exports$Blockly$Events$VarBase.VarBase);
|
|
502
|
+
$.module$exports$Blockly$Names.Names.NameType=$.module$exports$Blockly$Names.NameType;$.module$exports$Blockly$Names.Names.DEVELOPER_VARIABLE_TYPE=$.module$exports$Blockly$Names.NameType.DEVELOPER_VARIABLE;var module$exports$Blockly$Events$VarDelete={VarDelete:function(a){module$exports$Blockly$Events$VarBase.VarBase.call(this,a);this.type=module$exports$Blockly$Events$utils.VAR_DELETE;a&&(this.varType=a.type,this.varName=a.name)}};$.$jscomp.inherits(module$exports$Blockly$Events$VarDelete.VarDelete,module$exports$Blockly$Events$VarBase.VarBase);
|
|
589
503
|
module$exports$Blockly$Events$VarDelete.VarDelete.prototype.toJson=function(){var a=module$exports$Blockly$Events$VarBase.VarBase.prototype.toJson.call(this);a.varType=this.varType;a.varName=this.varName;return a};module$exports$Blockly$Events$VarDelete.VarDelete.prototype.fromJson=function(a){module$exports$Blockly$Events$VarBase.VarBase.prototype.fromJson.call(this,a);this.varType=a.varType;this.varName=a.varName};
|
|
590
504
|
module$exports$Blockly$Events$VarDelete.VarDelete.prototype.run=function(a){var b=this.getEventWorkspace_();a?b.deleteVariableById(this.varId):b.createVariable(this.varName,this.varType,this.varId)};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.VAR_DELETE,module$exports$Blockly$Events$VarDelete.VarDelete);var module$exports$Blockly$Events$VarRename={VarRename:function(a,b){module$exports$Blockly$Events$VarBase.VarBase.call(this,a);this.type=module$exports$Blockly$Events$utils.VAR_RENAME;a&&(this.oldName=a.name,this.newName="undefined"===typeof b?"":b)}};$.$jscomp.inherits(module$exports$Blockly$Events$VarRename.VarRename,module$exports$Blockly$Events$VarBase.VarBase);
|
|
591
505
|
module$exports$Blockly$Events$VarRename.VarRename.prototype.toJson=function(){var a=module$exports$Blockly$Events$VarBase.VarBase.prototype.toJson.call(this);a.oldName=this.oldName;a.newName=this.newName;return a};module$exports$Blockly$Events$VarRename.VarRename.prototype.fromJson=function(a){module$exports$Blockly$Events$VarBase.VarBase.prototype.fromJson.call(this,a);this.oldName=a.oldName;this.newName=a.newName};
|
|
@@ -642,10 +556,10 @@ module$exports$Blockly$Connection.Connection.CAN_CONNECT};module$exports$Blockly
|
|
|
642
556
|
module$exports$Blockly$ConnectionChecker.ConnectionChecker.prototype.doDragChecks=function(a,b,c){if(a.distanceFrom(b)>c||b.getSourceBlock().isInsertionMarker())return!1;switch(b.type){case $.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(a,b);case $.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE:if(b.isConnected()&&!b.targetBlock().isInsertionMarker()||a.isConnected())return!1;break;case $.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE:if(b.isConnected()&&
|
|
643
557
|
!b.targetBlock().isMovable()&&!b.targetBlock().isShadow())return!1;break;case $.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT:if(b.isConnected()&&!a.getSourceBlock().nextConnection&&!b.targetBlock().isShadow()&&b.targetBlock().nextConnection)return!1;break;default:return!1}return-1!==$.module$exports$Blockly$common.draggingConnections.indexOf(b)?!1:!0};
|
|
644
558
|
module$exports$Blockly$ConnectionChecker.ConnectionChecker.prototype.canConnectToPrevious_=function(a,b){if(a.targetConnection||-1!==$.module$exports$Blockly$common.draggingConnections.indexOf(b))return!1;if(!b.targetConnection)return!0;a=b.targetBlock();return a.isInsertionMarker()?!a.getPreviousBlock():!1};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.CONNECTION_CHECKER,module$exports$Blockly$registry.DEFAULT,module$exports$Blockly$ConnectionChecker.ConnectionChecker);var module$exports$Blockly$Workspace={},module$contents$Blockly$Workspace_WorkspaceDB_=Object.create(null);
|
|
645
|
-
module$exports$Blockly$Workspace.Workspace=function(a){this.id=(0,module$exports$Blockly$utils$idGenerator.genUid)();module$contents$Blockly$Workspace_WorkspaceDB_[this.id]=this;this.options=a||new module$exports$Blockly$Options.Options({});this.RTL=!!this.options.RTL;this.horizontalLayout=!!this.options.horizontalLayout;this.toolboxPosition=this.options.toolboxPosition;this.isClearing=this.rendered=!1;this.MAX_UNDO=1024;this.connectionDBList=null;this.connectionChecker=
|
|
646
|
-
this.options,!0))(this);this.topBlocks_=[];this.topComments_=[];this.commentDB_=Object.create(null);this.listeners_=[];this.undoStack_=[];this.redoStack_=[];this.blockDB_=Object.create(null);this.typedBlocksDB_=Object.create(null);this.variableMap_=new module$exports$Blockly$VariableMap.VariableMap(this);this.potentialVariableMap_=null};
|
|
647
|
-
module$exports$Blockly$Workspace.Workspace.
|
|
648
|
-
module$exports$Blockly$Workspace.Workspace.prototype.removeTopBlock=function(a){if(!(0,module$exports$Blockly$utils$array.removeElem)(this.topBlocks_,a))throw Error("Block not present in workspace's list of top-most blocks.");};
|
|
559
|
+
module$exports$Blockly$Workspace.Workspace=function(a){this.id=(0,module$exports$Blockly$utils$idGenerator.genUid)();module$contents$Blockly$Workspace_WorkspaceDB_[this.id]=this;this.options=a||new module$exports$Blockly$Options.Options({});this.RTL=!!this.options.RTL;this.horizontalLayout=!!this.options.horizontalLayout;this.toolboxPosition=this.options.toolboxPosition;this.isClearing=this.isMutator=this.isFlyout=this.rendered=!1;this.MAX_UNDO=1024;this.connectionDBList=null;this.connectionChecker=
|
|
560
|
+
new ((0,module$exports$Blockly$registry.getClassFromOptions)(module$exports$Blockly$registry.Type.CONNECTION_CHECKER,this.options,!0))(this);this.topBlocks_=[];this.topComments_=[];this.commentDB_=Object.create(null);this.listeners_=[];this.undoStack_=[];this.redoStack_=[];this.blockDB_=Object.create(null);this.typedBlocksDB_=Object.create(null);this.variableMap_=new module$exports$Blockly$VariableMap.VariableMap(this);this.potentialVariableMap_=null};
|
|
561
|
+
module$exports$Blockly$Workspace.Workspace.prototype.dispose=function(){this.listeners_.length=0;this.clear();delete module$contents$Blockly$Workspace_WorkspaceDB_[this.id]};module$exports$Blockly$Workspace.Workspace.prototype.sortObjects_=function(a,b){a=a.getRelativeToSurfaceXY();b=b.getRelativeToSurfaceXY();return a.y+module$exports$Blockly$Workspace.Workspace.prototype.sortObjects_.offset*a.x-(b.y+module$exports$Blockly$Workspace.Workspace.prototype.sortObjects_.offset*b.x)};
|
|
562
|
+
module$exports$Blockly$Workspace.Workspace.prototype.addTopBlock=function(a){this.topBlocks_.push(a)};module$exports$Blockly$Workspace.Workspace.prototype.removeTopBlock=function(a){if(!(0,module$exports$Blockly$utils$array.removeElem)(this.topBlocks_,a))throw Error("Block not present in workspace's list of top-most blocks.");};
|
|
649
563
|
module$exports$Blockly$Workspace.Workspace.prototype.getTopBlocks=function(a){var b=[].concat(this.topBlocks_);a&&1<b.length&&(this.sortObjects_.offset=Math.sin((0,module$exports$Blockly$utils$math.toRadians)(module$exports$Blockly$Workspace.Workspace.SCAN_ANGLE)),this.RTL&&(this.sortObjects_.offset*=-1),b.sort(this.sortObjects_));return b};module$exports$Blockly$Workspace.Workspace.prototype.addTypedBlock=function(a){this.typedBlocksDB_[a.type]||(this.typedBlocksDB_[a.type]=[]);this.typedBlocksDB_[a.type].push(a)};
|
|
650
564
|
module$exports$Blockly$Workspace.Workspace.prototype.removeTypedBlock=function(a){(0,module$exports$Blockly$utils$array.removeElem)(this.typedBlocksDB_[a.type],a);this.typedBlocksDB_[a.type].length||delete this.typedBlocksDB_[a.type]};
|
|
651
565
|
module$exports$Blockly$Workspace.Workspace.prototype.getBlocksByType=function(a,b){if(!this.typedBlocksDB_[a])return[];a=this.typedBlocksDB_[a].slice(0);b&&1<a.length&&(this.sortObjects_.offset=Math.sin((0,module$exports$Blockly$utils$math.toRadians)(module$exports$Blockly$Workspace.Workspace.SCAN_ANGLE)),this.RTL&&(this.sortObjects_.offset*=-1),a.sort(this.sortObjects_));return a.filter(function(c){return!c.isInsertionMarker()})};
|
|
@@ -664,7 +578,7 @@ module$exports$Blockly$Workspace.Workspace.prototype.clearUndo=function(){this.u
|
|
|
664
578
|
module$exports$Blockly$Workspace.Workspace.prototype.fireChangeListener=function(a){if(a.recordUndo)for(this.undoStack_.push(a),this.redoStack_.length=0;this.undoStack_.length>this.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(var b=0;b<this.listeners_.length;b++)(0,this.listeners_[b])(a)};module$exports$Blockly$Workspace.Workspace.prototype.getBlockById=function(a){return this.blockDB_[a]||null};
|
|
665
579
|
module$exports$Blockly$Workspace.Workspace.prototype.setBlockById=function(a,b){this.blockDB_[a]=b};module$exports$Blockly$Workspace.Workspace.prototype.removeBlockById=function(a){delete this.blockDB_[a]};module$exports$Blockly$Workspace.Workspace.prototype.getCommentById=function(a){return this.commentDB_[a]||null};module$exports$Blockly$Workspace.Workspace.prototype.allInputsFilled=function(a){for(var b=this.getTopBlocks(!1),c=0;c<b.length;c++)if(!b[c].allInputsFilled(a))return!1;return!0};
|
|
666
580
|
module$exports$Blockly$Workspace.Workspace.prototype.getPotentialVariableMap=function(){return this.potentialVariableMap_};module$exports$Blockly$Workspace.Workspace.prototype.createPotentialVariableMap=function(){this.potentialVariableMap_=new module$exports$Blockly$VariableMap.VariableMap(this)};module$exports$Blockly$Workspace.Workspace.prototype.getVariableMap=function(){return this.variableMap_};
|
|
667
|
-
module$exports$Blockly$Workspace.Workspace.prototype.setVariableMap=function(a){this.variableMap_=a};module$exports$Blockly$Workspace.Workspace.getById=function(a){return module$contents$Blockly$Workspace_WorkspaceDB_[a]||null};module$exports$Blockly$Workspace.Workspace.getAll=function(){var a=[],b;for(b in module$contents$Blockly$Workspace_WorkspaceDB_)a.push(module$contents$Blockly$Workspace_WorkspaceDB_[b]);return a};var module$exports$Blockly$Bubble={Bubble:function(a,b,c,d,e,f){this.workspace_=a;this.content_=b;this.shape_=c;this.rendered_=!1;this.anchorXY_=this.resizeGroup_=this.bubbleBack_=this.bubbleArrow_=this.bubbleGroup_=null;this.height_=this.width_=this.relativeTop_=this.relativeLeft_=0;this.autoLayout_=!0;this.onMouseDownResizeWrapper_=this.onMouseDownBubbleWrapper_=this.moveCallback_=this.resizeCallback_=null;this.disposed=!1;c=module$exports$Blockly$Bubble.Bubble.ARROW_ANGLE;this.workspace_.RTL&&
|
|
581
|
+
module$exports$Blockly$Workspace.Workspace.prototype.setVariableMap=function(a){this.variableMap_=a};module$exports$Blockly$Workspace.Workspace.getById=function(a){return module$contents$Blockly$Workspace_WorkspaceDB_[a]||null};module$exports$Blockly$Workspace.Workspace.getAll=function(){var a=[],b;for(b in module$contents$Blockly$Workspace_WorkspaceDB_)a.push(module$contents$Blockly$Workspace_WorkspaceDB_[b]);return a};module$exports$Blockly$Workspace.Workspace.SCAN_ANGLE=3;var module$exports$Blockly$Bubble={Bubble:function(a,b,c,d,e,f){this.workspace_=a;this.content_=b;this.shape_=c;this.rendered_=!1;this.anchorXY_=this.resizeGroup_=this.bubbleBack_=this.bubbleArrow_=this.bubbleGroup_=null;this.height_=this.width_=this.relativeTop_=this.relativeLeft_=0;this.autoLayout_=!0;this.onMouseDownResizeWrapper_=this.onMouseDownBubbleWrapper_=this.moveCallback_=this.resizeCallback_=null;this.disposed=!1;c=module$exports$Blockly$Bubble.Bubble.ARROW_ANGLE;this.workspace_.RTL&&
|
|
668
582
|
(c=-c);this.arrow_radians_=(0,module$exports$Blockly$utils$math.toRadians)(c);a.getBubbleCanvas().appendChild(this.createDom_(b,!(!e||!f)));this.setAnchorLocation(d);e&&f||(a=this.content_.getBBox(),e=a.width+2*module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH,f=a.height+2*module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH);this.setBubbleSize(e,f);this.positionBubble_();this.renderArrow_();this.rendered_=!0}};
|
|
669
583
|
module$exports$Blockly$Bubble.Bubble.prototype.createDom_=function(a,b){this.bubbleGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{},null);var c={filter:"url(#"+this.workspace_.getRenderer().getConstants().embossFilterId+")"};module$exports$Blockly$utils$userAgent.JAVA_FX&&(c={});c=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,c,this.bubbleGroup_);this.bubbleArrow_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,
|
|
670
584
|
{},c);this.bubbleBack_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyDraggable",x:0,y:0,rx:module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH,ry:module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH},c);b?(this.resizeGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{"class":this.workspace_.RTL?"blocklyResizeSW":"blocklyResizeSE"},this.bubbleGroup_),b=2*module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH,
|
|
@@ -735,7 +649,7 @@ module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.prototype.h
|
|
|
735
649
|
c?(c=a.targetConnection,c.getSourceBlock().unplug(!1),d=d?d.targetConnection:null,b.unplug(!0),d&&d.connect(c)):b.unplug(!0);if(a.targetConnection)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");this.markerConnection_=null;(a=b.getSvgRoot())&&a.setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")};
|
|
736
650
|
module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.prototype.showInsertionInputOutline_=function(){var a=this.closestConnection_;this.highlightedBlock_=a.getSourceBlock();this.highlightedBlock_.highlightShapeForInput(a,!0)};module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.prototype.hideInsertionInputOutline_=function(){this.highlightedBlock_.highlightShapeForInput(this.closestConnection_,!1);this.highlightedBlock_=null};
|
|
737
651
|
module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.prototype.showReplacementFade_=function(){this.fadedBlock_=this.closestConnection_.targetBlock();this.fadedBlock_.fadeForReplacement(!0)};module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.prototype.hideReplacementFade_=function(){this.fadedBlock_.fadeForReplacement(!1);this.fadedBlock_=null};
|
|
738
|
-
module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.prototype.getInsertionMarkers=function(){var a=[];this.firstMarker_&&a.push(this.firstMarker_);this.lastMarker_&&a.push(this.lastMarker_);return a};module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.PREVIEW_TYPE={INSERTION_MARKER:0,INPUT_OUTLINE:1,REPLACEMENT_FADE:2};var module$exports$Blockly$Events$BlockDrag={BlockDrag:function(a,b,c){module$exports$Blockly$Events$UiBase.UiBase.call(this,a?a.workspace.id:void 0);this.blockId=a?a.id:null;this.isStart=b;this.blocks=c;this.type=module$exports$Blockly$Events$utils.BLOCK_DRAG}};$.$jscomp.inherits(module$exports$Blockly$Events$BlockDrag.BlockDrag,module$exports$Blockly$Events$UiBase.UiBase);
|
|
652
|
+
module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.prototype.getInsertionMarkers=function(){var a=[];this.firstMarker_&&a.push(this.firstMarker_);this.lastMarker_&&a.push(this.lastMarker_);return a};module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.PREVIEW_TYPE={INSERTION_MARKER:0,INPUT_OUTLINE:1,REPLACEMENT_FADE:2};var module$exports$Blockly$Events$UiBase={UiBase:function(a){module$exports$Blockly$Events$Abstract.Abstract.call(this);this.isBlank="undefined"===typeof a;this.workspaceId=a?a:"";this.recordUndo=!1;this.isUiEvent=!0}};$.$jscomp.inherits(module$exports$Blockly$Events$UiBase.UiBase,module$exports$Blockly$Events$Abstract.Abstract);var module$exports$Blockly$Events$BlockDrag={BlockDrag:function(a,b,c){module$exports$Blockly$Events$UiBase.UiBase.call(this,a?a.workspace.id:void 0);this.blockId=a?a.id:null;this.isStart=b;this.blocks=c;this.type=module$exports$Blockly$Events$utils.BLOCK_DRAG}};$.$jscomp.inherits(module$exports$Blockly$Events$BlockDrag.BlockDrag,module$exports$Blockly$Events$UiBase.UiBase);
|
|
739
653
|
module$exports$Blockly$Events$BlockDrag.BlockDrag.prototype.toJson=function(){var a=module$exports$Blockly$Events$UiBase.UiBase.prototype.toJson.call(this);a.isStart=this.isStart;a.blockId=this.blockId;a.blocks=this.blocks;return a};module$exports$Blockly$Events$BlockDrag.BlockDrag.prototype.fromJson=function(a){module$exports$Blockly$Events$UiBase.UiBase.prototype.fromJson.call(this,a);this.isStart=a.isStart;this.blockId=a.blockId;this.blocks=a.blocks};
|
|
740
654
|
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.BLOCK_DRAG,module$exports$Blockly$Events$BlockDrag.BlockDrag);var module$exports$Blockly$BlockDragger={BlockDragger:function(a,b){this.draggingBlock_=a;this.workspace_=b;this.draggedConnectionManager_=new module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager(this.draggingBlock_);this.dragTarget_=null;this.wouldDeleteBlock_=!1;this.startXY_=this.draggingBlock_.getRelativeToSurfaceXY();this.dragIconData_=module$contents$Blockly$BlockDragger_initIconData(a)}};
|
|
741
655
|
module$exports$Blockly$BlockDragger.BlockDragger.prototype.dispose=function(){this.dragIconData_.length=0;this.draggedConnectionManager_&&this.draggedConnectionManager_.dispose()};
|
|
@@ -787,9 +701,8 @@ module$exports$Blockly$Gesture.Gesture.prototype.setStartBlock=function(a){this.
|
|
|
787
701
|
module$exports$Blockly$Gesture.Gesture.prototype.setStartWorkspace_=function(a){this.startWorkspace_||(this.startWorkspace_=a)};module$exports$Blockly$Gesture.Gesture.prototype.setStartFlyout_=function(a){this.flyout_||(this.flyout_=a)};module$exports$Blockly$Gesture.Gesture.prototype.isBubbleClick_=function(){return!!this.startBubble_&&!this.hasExceededDragRadius_};module$exports$Blockly$Gesture.Gesture.prototype.isBlockClick_=function(){return!!this.startBlock_&&!this.hasExceededDragRadius_&&!this.isFieldClick_()};
|
|
788
702
|
module$exports$Blockly$Gesture.Gesture.prototype.isFieldClick_=function(){return(this.startField_?this.startField_.isClickable():!1)&&!this.hasExceededDragRadius_&&(!this.flyout_||!this.flyout_.autoClose)};module$exports$Blockly$Gesture.Gesture.prototype.isWorkspaceClick_=function(){return!this.startBlock_&&!this.startBubble_&&!this.startField_&&!this.hasExceededDragRadius_};
|
|
789
703
|
module$exports$Blockly$Gesture.Gesture.prototype.isDragging=function(){return this.isDraggingWorkspace_||this.isDraggingBlock_||this.isDraggingBubble_};module$exports$Blockly$Gesture.Gesture.prototype.hasStarted=function(){return this.hasStarted_};module$exports$Blockly$Gesture.Gesture.prototype.getInsertionMarkers=function(){return this.blockDragger_?this.blockDragger_.getInsertionMarkers():[]};
|
|
790
|
-
module$exports$Blockly$Gesture.Gesture.prototype.getCurrentDragger=function(){return this.isDraggingBlock_?this.blockDragger_:this.isDraggingWorkspace_?this.workspaceDragger_:this.isDraggingBubble_?this.bubbleDragger_:null};module$exports$Blockly$Gesture.Gesture.inProgress=function(){for(var a=module$exports$Blockly$Workspace.Workspace.getAll(),b=0,c;c=a[b];b++)if(c.currentGesture_)return!0;return!1};var module$exports$Blockly$Field={Field:function(a,b,c){this.value_=this.DEFAULT_VALUE;this.tooltip_=this.validator_=null;this.size_=new module$exports$Blockly$utils$Size.Size(0,0);this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=null;
|
|
791
|
-
|
|
792
|
-
module$exports$Blockly$Field.Field.NBSP="\u00a0";module$exports$Blockly$Field.Field.prototype.EDITABLE=!0;module$exports$Blockly$Field.Field.prototype.SERIALIZABLE=!1;module$exports$Blockly$Field.Field.prototype.configure_=function(a){var b=a.tooltip;"string"===typeof b&&(b=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.tooltip));b&&this.setTooltip(b)};
|
|
704
|
+
module$exports$Blockly$Gesture.Gesture.prototype.getCurrentDragger=function(){return this.isDraggingBlock_?this.blockDragger_:this.isDraggingWorkspace_?this.workspaceDragger_:this.isDraggingBubble_?this.bubbleDragger_:null};module$exports$Blockly$Gesture.Gesture.inProgress=function(){for(var a=module$exports$Blockly$Workspace.Workspace.getAll(),b=0,c;c=a[b];b++)if(c.currentGesture_)return!0;return!1};var module$exports$Blockly$Field={Field:function(a,b,c){this.name=void 0;this.value_=this.constructor.prototype.DEFAULT_VALUE;this.tooltip_=this.validator_=null;this.size_=new module$exports$Blockly$utils$Size.Size(0,0);this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=null;this.disposed=!1;this.maxDisplayLength=50;this.sourceBlock_=null;this.enabled_=this.visible_=this.isDirty_=!0;this.suffixField=this.prefixField=
|
|
705
|
+
this.clickTarget_=null;this.EDITABLE=!0;this.SERIALIZABLE=!1;this.CURSOR="";a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}};module$exports$Blockly$Field.Field.prototype.configure_=function(a){var b=a.tooltip;"string"===typeof b&&(b=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.tooltip));b&&this.setTooltip(b)};
|
|
793
706
|
module$exports$Blockly$Field.Field.prototype.setSourceBlock=function(a){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=a};module$exports$Blockly$Field.Field.prototype.getConstants=function(){!this.constants_&&this.sourceBlock_&&this.sourceBlock_.workspace&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants());return this.constants_};module$exports$Blockly$Field.Field.prototype.getSourceBlock=function(){return this.sourceBlock_};
|
|
794
707
|
module$exports$Blockly$Field.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{},null),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())};
|
|
795
708
|
module$exports$Blockly$Field.Field.prototype.initView=function(){this.createBorderRect_();this.createTextElement_()};module$exports$Blockly$Field.Field.prototype.initModel=function(){};
|
|
@@ -799,30 +712,142 @@ module$exports$Blockly$Field.Field.prototype.bindEvents_=function(){(0,module$ex
|
|
|
799
712
|
module$exports$Blockly$Field.Field.prototype.saveState=function(a){a=this.saveLegacyState(module$exports$Blockly$Field.Field);return null!==a?a:this.getValue()};module$exports$Blockly$Field.Field.prototype.loadState=function(a){this.loadLegacyState(module$exports$Blockly$Field.Field,a)||this.setValue(a)};
|
|
800
713
|
module$exports$Blockly$Field.Field.prototype.saveLegacyState=function(a){return a.prototype.saveState===this.saveState&&a.prototype.toXml!==this.toXml?(a=(0,$.module$exports$Blockly$utils$xml.createElement)("field"),a.setAttribute("name",this.name||""),(0,$.module$exports$Blockly$Xml.domToText)(this.toXml(a)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null};
|
|
801
714
|
module$exports$Blockly$Field.Field.prototype.loadLegacyState=function(a,b){return a.prototype.loadState===this.loadState&&a.prototype.fromXml!==this.fromXml?(this.fromXml((0,$.module$exports$Blockly$Xml.textToDom)(b)),!0):!1};
|
|
802
|
-
module$exports$Blockly$Field.Field.prototype.dispose=function(){module$exports$Blockly$
|
|
715
|
+
module$exports$Blockly$Field.Field.prototype.dispose=function(){(0,module$exports$Blockly$dropDownDiv.hideIfOwner)(this);(0,module$exports$Blockly$WidgetDiv.hideIfOwner)(this);(0,module$exports$Blockly$Tooltip.unbindMouseEvents)(this.getClickTarget_());this.mouseDownWrapper_&&(0,module$exports$Blockly$browserEvents.unbind)(this.mouseDownWrapper_);(0,module$exports$Blockly$utils$dom.removeNode)(this.fieldGroup_);this.disposed=!0};
|
|
803
716
|
module$exports$Blockly$Field.Field.prototype.updateEditable=function(){var a=this.fieldGroup_;this.EDITABLE&&a&&(this.enabled_&&this.sourceBlock_.isEditable()?((0,module$exports$Blockly$utils$dom.addClass)(a,"blocklyEditableText"),(0,module$exports$Blockly$utils$dom.removeClass)(a,"blocklyNonEditableText"),a.style.cursor=this.CURSOR):((0,module$exports$Blockly$utils$dom.addClass)(a,"blocklyNonEditableText"),(0,module$exports$Blockly$utils$dom.removeClass)(a,"blocklyEditableText"),a.style.cursor=""))};
|
|
804
|
-
module$exports$Blockly$Field.Field.prototype.setEnabled=function(a){this.enabled_=a;this.updateEditable()};module$exports$Blockly$Field.Field.prototype.isEnabled=function(){return this.enabled_};module$exports$Blockly$Field.Field.prototype.isClickable=function(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()
|
|
717
|
+
module$exports$Blockly$Field.Field.prototype.setEnabled=function(a){this.enabled_=a;this.updateEditable()};module$exports$Blockly$Field.Field.prototype.isEnabled=function(){return this.enabled_};module$exports$Blockly$Field.Field.prototype.isClickable=function(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==module$exports$Blockly$Field.Field.prototype.showEditor_};
|
|
805
718
|
module$exports$Blockly$Field.Field.prototype.isCurrentlyEditable=function(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()};module$exports$Blockly$Field.Field.prototype.isSerializable=function(){var a=!1;this.name&&(this.SERIALIZABLE?a=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),a=!0));return a};
|
|
806
719
|
module$exports$Blockly$Field.Field.prototype.isVisible=function(){return this.visible_};module$exports$Blockly$Field.Field.prototype.setVisible=function(a){if(this.visible_!==a){this.visible_=a;var b=this.getSvgRoot();b&&(b.style.display=a?"block":"none")}};module$exports$Blockly$Field.Field.prototype.setValidator=function(a){this.validator_=a};module$exports$Blockly$Field.Field.prototype.getValidator=function(){return this.validator_};module$exports$Blockly$Field.Field.prototype.getSvgRoot=function(){return this.fieldGroup_};
|
|
807
|
-
module$exports$Blockly$Field.Field.prototype.applyColour=function(){};module$exports$Blockly$Field.Field.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_()};module$exports$Blockly$Field.Field.prototype.showEditor=function(a){this.isClickable()&&this.showEditor_(a)};
|
|
720
|
+
module$exports$Blockly$Field.Field.prototype.applyColour=function(){};module$exports$Blockly$Field.Field.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_()};module$exports$Blockly$Field.Field.prototype.showEditor=function(a){this.isClickable()&&this.showEditor_(a)};module$exports$Blockly$Field.Field.prototype.showEditor_=function(a){};
|
|
808
721
|
module$exports$Blockly$Field.Field.prototype.updateSize_=function(a){var b=this.getConstants();a=void 0!==a?a:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var c=2*a,d=b.FIELD_TEXT_HEIGHT,e=0;this.textElement_&&(e=(0,module$exports$Blockly$utils$dom.getFastTextWidth)(this.textElement_,b.FIELD_TEXT_FONTSIZE,b.FIELD_TEXT_FONTWEIGHT,b.FIELD_TEXT_FONTFAMILY),c+=e);this.borderRect_&&(d=Math.max(d,b.FIELD_BORDER_RECT_HEIGHT));this.size_.height=d;this.size_.width=c;this.positionTextElement_(a,
|
|
809
722
|
e);this.positionBorderRect_()};module$exports$Blockly$Field.Field.prototype.positionTextElement_=function(a,b){if(this.textElement_){var c=this.getConstants(),d=this.size_.height/2;this.textElement_.setAttribute("x",this.sourceBlock_.RTL?this.size_.width-b-a:a);this.textElement_.setAttribute("y",c.FIELD_TEXT_BASELINE_CENTER?d:d-c.FIELD_TEXT_HEIGHT/2+c.FIELD_TEXT_BASELINE)}};
|
|
810
723
|
module$exports$Blockly$Field.Field.prototype.positionBorderRect_=function(){this.borderRect_&&(this.borderRect_.setAttribute("width",this.size_.width),this.borderRect_.setAttribute("height",this.size_.height),this.borderRect_.setAttribute("rx",this.getConstants().FIELD_BORDER_RECT_RADIUS),this.borderRect_.setAttribute("ry",this.getConstants().FIELD_BORDER_RECT_RADIUS))};
|
|
811
724
|
module$exports$Blockly$Field.Field.prototype.getSize=function(){if(!this.isVisible())return new module$exports$Blockly$utils$Size.Size(0,0);this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&0===this.size_.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.render_());return this.size_};
|
|
812
725
|
module$exports$Blockly$Field.Field.prototype.getScaledBBox=function(){if(this.borderRect_){var a=this.borderRect_.getBoundingClientRect();var b=(0,module$exports$Blockly$utils$style.getPageOffset)(this.borderRect_);var c=a.width;var d=a.height}else d=this.sourceBlock_.getHeightWidth(),a=this.sourceBlock_.workspace.scale,b=this.getAbsoluteXY_(),c=d.width*a,d=d.height*a,module$exports$Blockly$utils$userAgent.GECKO?(b.x+=1.5*a,b.y+=1.5*a):module$exports$Blockly$utils$userAgent.EDGE||module$exports$Blockly$utils$userAgent.IE||
|
|
813
726
|
(b.x-=.5*a,b.y-=.5*a),c+=1*a,d+=1*a;return new module$exports$Blockly$utils$Rect.Rect(b.y,b.y+d,b.x,b.x+c)};module$exports$Blockly$Field.Field.prototype.getDisplayText_=function(){var a=this.getText();if(!a)return module$exports$Blockly$Field.Field.NBSP;a.length>this.maxDisplayLength&&(a=a.substring(0,this.maxDisplayLength-2)+"\u2026");a=a.replace(/\s/g,module$exports$Blockly$Field.Field.NBSP);this.sourceBlock_&&this.sourceBlock_.RTL&&(a+="\u200f");return a};
|
|
814
|
-
module$exports$Blockly$Field.Field.prototype.getText=function(){
|
|
727
|
+
module$exports$Blockly$Field.Field.prototype.getText=function(){var a=this.getText_();return null!==a?String(a):String(this.getValue())};module$exports$Blockly$Field.Field.prototype.getText_=function(){return null};module$exports$Blockly$Field.Field.prototype.markDirty=function(){this.isDirty_=!0;this.constants_=null};
|
|
728
|
+
module$exports$Blockly$Field.Field.prototype.forceRerender=function(){this.isDirty_=!0;this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours(),this.updateMarkers_())};
|
|
815
729
|
module$exports$Blockly$Field.Field.prototype.setValue=function(a){if(null!==a){var b=this.doClassValidation_(a);a=this.processValidation_(a,b);if(!(a instanceof Error)){if(b=this.getValidator())if(b=b.call(this,a),a=this.processValidation_(a,b),a instanceof Error)return;b=this.sourceBlock_;if(!b||!b.disposed){var c=this.getValue();c===a?this.doValueUpdate_(a):(this.doValueUpdate_(a),b&&(0,module$exports$Blockly$Events$utils.isEnabled)()&&(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CHANGE))(b,
|
|
816
730
|
"field",this.name||null,c,a)),this.isDirty_&&this.forceRerender())}}}};module$exports$Blockly$Field.Field.prototype.processValidation_=function(a,b){if(null===b)return this.doValueInvalid_(a),this.isDirty_&&this.forceRerender(),Error();void 0!==b&&(a=b);return a};module$exports$Blockly$Field.Field.prototype.getValue=function(){return this.value_};module$exports$Blockly$Field.Field.prototype.doClassValidation_=function(a){return null===a||void 0===a?null:a};
|
|
817
731
|
module$exports$Blockly$Field.Field.prototype.doValueUpdate_=function(a){this.value_=a;this.isDirty_=!0};module$exports$Blockly$Field.Field.prototype.doValueInvalid_=function(a){};module$exports$Blockly$Field.Field.prototype.onMouseDown_=function(a){this.sourceBlock_&&this.sourceBlock_.workspace&&(a=this.sourceBlock_.workspace.getGesture(a))&&a.setStartField(this)};
|
|
818
732
|
module$exports$Blockly$Field.Field.prototype.setTooltip=function(a){a||""===a||(a=this.sourceBlock_);var b=this.getClickTarget_();b?b.tooltip=a:this.tooltip_=a};module$exports$Blockly$Field.Field.prototype.getTooltip=function(){var a=this.getClickTarget_();return a?(0,module$exports$Blockly$Tooltip.getTooltipOfObject)(a):(0,module$exports$Blockly$Tooltip.getTooltipOfObject)({tooltip:this.tooltip_})};
|
|
819
|
-
module$exports$Blockly$Field.Field.prototype.getClickTarget_=function(){return this.clickTarget_||this.getSvgRoot()};module$exports$Blockly$Field.Field.prototype.getAbsoluteXY_=function(){return(0,module$exports$Blockly$utils$style.getPageOffset)(this.getClickTarget_())};module$exports$Blockly$Field.Field.prototype.referencesVariables=function(){return!1};
|
|
733
|
+
module$exports$Blockly$Field.Field.prototype.getClickTarget_=function(){return this.clickTarget_||this.getSvgRoot()};module$exports$Blockly$Field.Field.prototype.getAbsoluteXY_=function(){return(0,module$exports$Blockly$utils$style.getPageOffset)(this.getClickTarget_())};module$exports$Blockly$Field.Field.prototype.referencesVariables=function(){return!1};module$exports$Blockly$Field.Field.prototype.refreshVariableName=function(){};
|
|
820
734
|
module$exports$Blockly$Field.Field.prototype.getParentInput=function(){for(var a=null,b=this.sourceBlock_,c=b.inputList,d=0;d<b.inputList.length;d++)for(var e=c[d],f=e.fieldRow,g=0;g<f.length;g++)if(f[g]===this){a=e;break}return a};module$exports$Blockly$Field.Field.prototype.getFlipRtl=function(){return!1};module$exports$Blockly$Field.Field.prototype.isTabNavigable=function(){return!1};module$exports$Blockly$Field.Field.prototype.onShortcut=function(a){return!1};
|
|
821
735
|
module$exports$Blockly$Field.Field.prototype.setCursorSvg=function(a){a?(this.fieldGroup_.appendChild(a),this.cursorSvg_=a):this.cursorSvg_=null};module$exports$Blockly$Field.Field.prototype.setMarkerSvg=function(a){a?(this.fieldGroup_.appendChild(a),this.markerSvg_=a):this.markerSvg_=null};
|
|
822
|
-
module$exports$Blockly$Field.Field.prototype.updateMarkers_=function(){var a=this.sourceBlock_.workspace;a.keyboardAccessibilityMode&&this.cursorSvg_&&a.getCursor().draw();a.keyboardAccessibilityMode&&this.markerSvg_&&a.getMarker(module$exports$Blockly$MarkerManager.MarkerManager.LOCAL_MARKER).draw()};$.module$exports$Blockly$FieldLabel={FieldLabel:function(a,b,c){this.class_=null
|
|
823
|
-
$.module$exports$Blockly$FieldLabel.FieldLabel.
|
|
824
|
-
$.module$exports$Blockly$FieldLabel.FieldLabel.prototype.
|
|
825
|
-
$.module$exports$Blockly$FieldLabel.FieldLabel.prototype.
|
|
736
|
+
module$exports$Blockly$Field.Field.prototype.updateMarkers_=function(){var a=this.sourceBlock_.workspace;a.keyboardAccessibilityMode&&this.cursorSvg_&&a.getCursor().draw();a.keyboardAccessibilityMode&&this.markerSvg_&&a.getMarker(module$exports$Blockly$MarkerManager.MarkerManager.LOCAL_MARKER).draw()};module$exports$Blockly$Field.Field.prototype.DEFAULT_VALUE=null;module$exports$Blockly$Field.Field.NBSP="\u00a0";module$exports$Blockly$Field.Field.SKIP_SETUP=new module$exports$Blockly$utils$Sentinel.Sentinel;$.module$exports$Blockly$FieldLabel={FieldLabel:function(a,b,c){module$exports$Blockly$Field.Field.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);this.class_=null;this.EDITABLE=!1;a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(c?this.configure_(c):this.class_=b||null,this.setValue(a))}};$.$jscomp.inherits($.module$exports$Blockly$FieldLabel.FieldLabel,module$exports$Blockly$Field.Field);
|
|
737
|
+
$.module$exports$Blockly$FieldLabel.FieldLabel.prototype.configure_=function(a){module$exports$Blockly$Field.Field.prototype.configure_.call(this,a);this.class_=a["class"]};$.module$exports$Blockly$FieldLabel.FieldLabel.prototype.initView=function(){this.createTextElement_();this.class_&&(0,module$exports$Blockly$utils$dom.addClass)(this.textElement_,this.class_)};$.module$exports$Blockly$FieldLabel.FieldLabel.prototype.doClassValidation_=function(a){return null===a||void 0===a?null:String(a)};
|
|
738
|
+
$.module$exports$Blockly$FieldLabel.FieldLabel.prototype.setClass=function(a){this.textElement_&&(this.class_&&(0,module$exports$Blockly$utils$dom.removeClass)(this.textElement_,this.class_),a&&(0,module$exports$Blockly$utils$dom.addClass)(this.textElement_,a));this.class_=a};$.module$exports$Blockly$FieldLabel.FieldLabel.fromJson=function(a){return new this((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.text),void 0,a)};
|
|
739
|
+
$.module$exports$Blockly$FieldLabel.FieldLabel.prototype.DEFAULT_VALUE="";(0,module$exports$Blockly$fieldRegistry.register)("field_label",$.module$exports$Blockly$FieldLabel.FieldLabel);var module$exports$Blockly$blockRendering$InputConnection={InputConnection:function(a,b){module$exports$Blockly$blockRendering$Connection.Connection.call(this,a,b.connection);this.type|=module$exports$Blockly$blockRendering$Types.Types.INPUT;this.input=b;this.align=b.align;(this.connectedBlock=b.connection&&b.connection.targetBlock()?b.connection.targetBlock():null)?(a=this.connectedBlock.getHeightWidth(),this.connectedBlockWidth=a.width,this.connectedBlockHeight=a.height):this.connectedBlockHeight=
|
|
740
|
+
this.connectedBlockWidth=0;this.connectionOffsetY=this.connectionOffsetX=0}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$InputConnection.InputConnection,module$exports$Blockly$blockRendering$Connection.Connection);var module$exports$Blockly$blockRendering$Debug={Debug:function(a){this.debugElements_=[];this.svgRoot_=null;this.constants_=a;this.randomColour_=""}};module$exports$Blockly$blockRendering$Debug.Debug.prototype.clearElems=function(){for(var a=0;a<this.debugElements_.length;a++)(0,module$exports$Blockly$utils$dom.removeNode)(this.debugElements_[a]);this.debugElements_=[]};
|
|
741
|
+
module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawSpacerRow=function(a,b,c){if(module$exports$Blockly$blockRendering$Debug.Debug.config.rowSpacers){var d=Math.abs(a.height),e=0>a.height;e&&(b-=d);this.debugElements_.push((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"rowSpacerRect blockRenderDebug",x:c?-(a.xPos+a.width):a.xPos,y:b,width:a.width,height:d,stroke:e?"black":"blue",fill:"blue","fill-opacity":"0.5","stroke-width":"1px"},
|
|
742
|
+
this.svgRoot_))}};
|
|
743
|
+
module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawSpacerElem=function(a,b,c){if(module$exports$Blockly$blockRendering$Debug.Debug.config.elemSpacers){b=Math.abs(a.width);var d=0>a.width,e=d?a.xPos-b:a.xPos;c&&(e=-(e+b));this.debugElements_.push((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"elemSpacerRect blockRenderDebug",x:e,y:a.centerline-a.height/2,width:b,height:a.height,stroke:"pink",fill:d?"black":"pink","fill-opacity":"0.5",
|
|
744
|
+
"stroke-width":"1px"},this.svgRoot_))}};
|
|
745
|
+
module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawRenderedElem=function(a,b){if(module$exports$Blockly$blockRendering$Debug.Debug.config.elems){var c=a.xPos;b&&(c=-(c+a.width));b=a.centerline-a.height/2;this.debugElements_.push((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"rowRenderingRect blockRenderDebug",x:c,y:b,width:a.width,height:a.height,stroke:"black",fill:"none","stroke-width":"1px"},this.svgRoot_));module$exports$Blockly$blockRendering$Types.Types.isField(a)&&
|
|
746
|
+
a instanceof module$exports$Blockly$blockRendering$Field.Field&&a.field instanceof $.module$exports$Blockly$FieldLabel.FieldLabel&&this.debugElements_.push((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"rowRenderingRect blockRenderDebug",x:c,y:b+this.constants_.FIELD_TEXT_BASELINE,width:a.width,height:"0.1px",stroke:"red",fill:"none","stroke-width":"0.5px"},this.svgRoot_))}module$exports$Blockly$blockRendering$Types.Types.isInput(a)&&a instanceof
|
|
747
|
+
module$exports$Blockly$blockRendering$InputConnection.InputConnection&&module$exports$Blockly$blockRendering$Debug.Debug.config.connections&&this.drawConnection(a.connectionModel)};
|
|
748
|
+
module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawConnection=function(a){if(module$exports$Blockly$blockRendering$Debug.Debug.config.connections){if(a.type===$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE){var b=4;var c="magenta";var d="none"}else a.type===$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE?(b=2,d=c="magenta"):a.type===$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT?(b=4,c="goldenrod",d="none"):a.type===$.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT&&
|
|
749
|
+
(b=2,d=c="goldenrod");this.debugElements_.push((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CIRCLE,{"class":"blockRenderDebug",cx:a.offsetInBlock_.x,cy:a.offsetInBlock_.y,r:b,fill:d,stroke:c},this.svgRoot_))}};
|
|
750
|
+
module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawRenderedRow=function(a,b,c){module$exports$Blockly$blockRendering$Debug.Debug.config.rows&&(this.debugElements_.push((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"elemRenderingRect blockRenderDebug",x:c?-(a.xPos+a.width):a.xPos,y:a.yPos,width:a.width,height:a.height,stroke:"red",fill:"none","stroke-width":"1px"},this.svgRoot_)),module$exports$Blockly$blockRendering$Types.Types.isTopOrBottomRow(a)||
|
|
751
|
+
module$exports$Blockly$blockRendering$Debug.Debug.config.connectedBlockBounds&&this.debugElements_.push((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"connectedBlockWidth blockRenderDebug",x:c?-(a.xPos+a.widthWithConnectedBlocks):a.xPos,y:a.yPos,width:a.widthWithConnectedBlocks,height:a.height,stroke:this.randomColour_,fill:"none","stroke-width":"1px","stroke-dasharray":"3,3"},this.svgRoot_)))};
|
|
752
|
+
module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawRowWithElements=function(a,b,c){for(var d=0;d<a.elements.length;d++){var e=a.elements[d];e?module$exports$Blockly$blockRendering$Types.Types.isSpacer(e)?this.drawSpacerElem(e,a.height,c):this.drawRenderedElem(e,c):console.warn("A row has an undefined or null element.",a,e)}this.drawRenderedRow(a,b,c)};
|
|
753
|
+
module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawBoundingBox=function(a){if(module$exports$Blockly$blockRendering$Debug.Debug.config.blockBounds){var b=a.RTL?-a.width:0;this.debugElements_.push((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blockBoundingBox blockRenderDebug",x:b,y:0,width:a.width,height:a.height,stroke:"black",fill:"none","stroke-width":"1px","stroke-dasharray":"5,5"},this.svgRoot_));module$exports$Blockly$blockRendering$Debug.Debug.config.connectedBlockBounds&&
|
|
754
|
+
(b=a.RTL?-a.widthWithChildren:0,this.debugElements_.push((0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blockRenderDebug",x:b,y:0,width:a.widthWithChildren,height:a.height,stroke:"#DF57BC",fill:"none","stroke-width":"1px","stroke-dasharray":"3,3"},this.svgRoot_)))}};
|
|
755
|
+
module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawDebug=function(a,b){this.clearElems();this.svgRoot_=a.getSvgRoot();this.randomColour_="#"+Math.floor(16777215*Math.random()).toString(16);for(var c=0,d=0;d<b.rows.length;d++){var e=b.rows[d];module$exports$Blockly$blockRendering$Types.Types.isBetweenRowSpacer(e)?this.drawSpacerRow(e,c,b.RTL):this.drawRowWithElements(e,c,b.RTL);c+=e.height}a.previousConnection&&this.drawConnection(a.previousConnection);a.nextConnection&&this.drawConnection(a.nextConnection);
|
|
756
|
+
a.outputConnection&&this.drawConnection(a.outputConnection);b.rightSide&&this.drawRenderedElem(b.rightSide,b.RTL);this.drawBoundingBox(b);this.drawRender(a.pathObject.svgPath)};module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawRender=function(a){module$exports$Blockly$blockRendering$Debug.Debug.config.render&&(a.setAttribute("filter","url(#"+this.constants_.debugFilterId+")"),setTimeout(function(){a.setAttribute("filter","")},100))};
|
|
757
|
+
module$exports$Blockly$blockRendering$Debug.Debug.config={rowSpacers:!0,elemSpacers:!0,rows:!0,elems:!0,connections:!0,blockBounds:!0,connectedBlockBounds:!0,render:!0};var module$exports$Blockly$blockRendering$Drawer={Drawer:function(a,b){this.block_=a;this.info_=b;this.topLeft_=a.getRelativeToSurfaceXY();this.inlinePath_=this.outlinePath_="";this.constants_=b.getRenderer().getConstants()}};
|
|
758
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.draw=function(){this.hideHiddenIcons_();this.drawOutline_();this.drawInternals_();this.block_.pathObject.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&this.block_.pathObject.flipRTL();(0,module$exports$Blockly$blockRendering$debug.isDebuggerEnabled)()&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_);this.recordSizeOnBlock_()};
|
|
759
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.recordSizeOnBlock_=function(){this.block_.height=this.info_.height;this.block_.width=this.info_.widthWithChildren};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.hideHiddenIcons_=function(){for(var a=0,b;b=this.info_.hiddenIcons[a];a++)b.icon.iconGroup_.setAttribute("display","none")};
|
|
760
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawOutline_=function(){this.drawTop_();for(var a=1;a<this.info_.rows.length-1;a++){var b=this.info_.rows[a];b.hasJaggedEdge?this.drawJaggedEdge_(b):b.hasStatement?this.drawStatementInput_(b):b.hasExternalInput?this.drawValueInput_(b):this.drawRightSideRow_(b)}this.drawBottom_();this.drawLeft_()};
|
|
761
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawTop_=function(){var a=this.info_.topRow,b=a.elements;this.positionPreviousConnection_();this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.moveBy)(a.xPos,this.info_.startY);for(var c=0,d;d=b[c];c++)module$exports$Blockly$blockRendering$Types.Types.isLeftRoundedCorner(d)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topLeft:module$exports$Blockly$blockRendering$Types.Types.isRightRoundedCorner(d)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topRight:
|
|
762
|
+
module$exports$Blockly$blockRendering$Types.Types.isPreviousConnection(d)&&d instanceof module$exports$Blockly$blockRendering$Connection.Connection?this.outlinePath_+=d.shape.pathLeft:module$exports$Blockly$blockRendering$Types.Types.isHat(d)?this.outlinePath_+=this.constants_.START_HAT.path:module$exports$Blockly$blockRendering$Types.Types.isSpacer(d)&&(this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",d.width));this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",
|
|
763
|
+
a.height)};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawJaggedEdge_=function(a){this.outlinePath_+=this.constants_.JAGGED_TEETH.path+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",a.height-this.constants_.JAGGED_TEETH.height)};
|
|
764
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawValueInput_=function(a){var b=a.getLastInput();this.positionExternalValueConnection_(a);var c="function"===typeof b.shape.pathDown?b.shape.pathDown(b.height):b.shape.pathDown;this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",b.xPos+b.width)+c+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",a.height-b.connectionHeight)};
|
|
765
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawStatementInput_=function(a){var b=a.getLastInput(),c=b.xPos+b.notchOffset+b.shape.width;b=b.shape.pathRight+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",-(b.notchOffset-this.constants_.INSIDE_CORNERS.width))+this.constants_.INSIDE_CORNERS.pathTop;var d=a.height-2*this.constants_.INSIDE_CORNERS.height;this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",c)+b+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",
|
|
766
|
+
d)+this.constants_.INSIDE_CORNERS.pathBottom+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a.xPos+a.width);this.positionStatementInputConnection_(a)};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawRightSideRow_=function(a){this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.yPos+a.height)};
|
|
767
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawBottom_=function(){var a=this.info_.bottomRow,b=a.elements;this.positionNextConnection_();for(var c=0,d="",e=b.length-1,f;f=b[e];e--)module$exports$Blockly$blockRendering$Types.Types.isNextConnection(f)&&f instanceof module$exports$Blockly$blockRendering$Connection.Connection?d+=f.shape.pathRight:module$exports$Blockly$blockRendering$Types.Types.isLeftSquareCorner(f)?d+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a.xPos):
|
|
768
|
+
module$exports$Blockly$blockRendering$Types.Types.isLeftRoundedCorner(f)?d+=this.constants_.OUTSIDE_CORNERS.bottomLeft:module$exports$Blockly$blockRendering$Types.Types.isRightRoundedCorner(f)?(d+=this.constants_.OUTSIDE_CORNERS.bottomRight,c=this.constants_.OUTSIDE_CORNERS.rightHeight):module$exports$Blockly$blockRendering$Types.Types.isSpacer(f)&&(d+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",-1*f.width));this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",
|
|
769
|
+
a.baseline-c);this.outlinePath_+=d};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawLeft_=function(){var a=this.info_.outputConnection;this.positionOutputConnection_();if(a){var b=a.connectionOffsetY+a.height;a="function"===typeof a.shape.pathUp?a.shape.pathUp(a.height):a.shape.pathUp;this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",b)+a}this.outlinePath_+="z"};
|
|
770
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawInternals_=function(){for(var a=0,b;b=this.info_.rows[a];a++)for(var c=0,d;d=b.elements[c];c++)module$exports$Blockly$blockRendering$Types.Types.isInlineInput(d)?this.drawInlineInput_(d):(module$exports$Blockly$blockRendering$Types.Types.isIcon(d)||module$exports$Blockly$blockRendering$Types.Types.isField(d))&&this.layoutField_(d)};
|
|
771
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.layoutField_=function(a){if(module$exports$Blockly$blockRendering$Types.Types.isField(a))var b=a.field.getSvgRoot();else module$exports$Blockly$blockRendering$Types.Types.isIcon(a)&&(b=a.icon.iconGroup_);var c=a.centerline-a.height/2,d=a.xPos,e="";this.info_.RTL&&(d=-(d+a.width),a.flipRtl&&(d+=a.width,e="scale(-1 1)"));module$exports$Blockly$blockRendering$Types.Types.isIcon(a)?(b.setAttribute("display","block"),b.setAttribute("transform",
|
|
772
|
+
"translate("+d+","+c+")"),a.icon.computeIconLocation()):b.setAttribute("transform","translate("+d+","+c+")"+e);this.info_.isInsertionMarker&&b.setAttribute("display","none")};
|
|
773
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawInlineInput_=function(a){var b=a.width,c=a.height,d=a.connectionOffsetY,e=a.connectionHeight+d;this.inlinePath_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(a.xPos+a.connectionWidth,a.centerline-c/2)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",d)+a.shape.pathDown+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",c-e)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",b-a.connectionWidth)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",
|
|
774
|
+
-c)+"z";this.positionInlineInputConnection_(a)};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionInlineInputConnection_=function(a){var b=a.centerline-a.height/2;if(a.connectionModel){var c=a.xPos+a.connectionWidth+a.connectionOffsetX;this.info_.RTL&&(c*=-1);a.connectionModel.setOffsetInBlock(c,b+a.connectionOffsetY)}};
|
|
775
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionStatementInputConnection_=function(a){var b=a.getLastInput();if(b.connectionModel){var c=a.xPos+a.statementEdge+b.notchOffset;this.info_.RTL&&(c*=-1);b.connectionModel.setOffsetInBlock(c,a.yPos)}};
|
|
776
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionExternalValueConnection_=function(a){var b=a.getLastInput();if(b.connectionModel){var c=a.xPos+a.width;this.info_.RTL&&(c*=-1);b.connectionModel.setOffsetInBlock(c,a.yPos)}};module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionPreviousConnection_=function(){var a=this.info_.topRow;if(a.connection){var b=a.xPos+a.notchOffset;a.connection.connectionModel.setOffsetInBlock(this.info_.RTL?-b:b,0)}};
|
|
777
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionNextConnection_=function(){var a=this.info_.bottomRow;if(a.connection){var b=a.connection,c=b.xPos;b.connectionModel.setOffsetInBlock(this.info_.RTL?-c:c,a.baseline)}};
|
|
778
|
+
module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.positionOutputConnection_=function(){if(this.info_.outputConnection){var a=this.info_.startX+this.info_.outputConnection.connectionOffsetX;this.block_.outputConnection.setOffsetInBlock(this.info_.RTL?-a:a,this.info_.outputConnection.connectionOffsetY)}};var module$exports$Blockly$blockRendering$ExternalValueInput={ExternalValueInput:function(a,b){module$exports$Blockly$blockRendering$InputConnection.InputConnection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.EXTERNAL_VALUE_INPUT;this.height=0;this.height=this.connectedBlock?this.connectedBlockHeight-this.constants_.TAB_OFFSET_FROM_TOP-this.constants_.MEDIUM_PADDING:this.shape.height;this.width=this.shape.width+this.constants_.EXTERNAL_VALUE_INPUT_PADDING;this.connectionOffsetY=
|
|
779
|
+
this.constants_.TAB_OFFSET_FROM_TOP;this.connectionHeight=this.shape.height;this.connectionWidth=this.shape.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$ExternalValueInput.ExternalValueInput,module$exports$Blockly$blockRendering$InputConnection.InputConnection);var module$exports$Blockly$blockRendering$Hat={Hat:function(a){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.HAT;this.height=this.constants_.START_HAT.height;this.width=this.constants_.START_HAT.width;this.ascenderHeight=this.height}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$Hat.Hat,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$IPathObject={IPathObject:function(a,b){}};var module$exports$Blockly$blockRendering$Icon={Icon:function(a,b){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.icon=b;this.isVisible=b.isVisible();this.type|=module$exports$Blockly$blockRendering$Types.Types.ICON;a=b.getCorrectedSize();this.height=a.height;this.width=a.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$Icon.Icon,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$InRowSpacer={InRowSpacer:function(a,b){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type=this.type|module$exports$Blockly$blockRendering$Types.Types.SPACER|module$exports$Blockly$blockRendering$Types.Types.IN_ROW_SPACER;this.width=b;this.height=this.constants_.SPACER_DEFAULT_HEIGHT}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$InRowSpacer.InRowSpacer,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$InlineInput={InlineInput:function(a,b){module$exports$Blockly$blockRendering$InputConnection.InputConnection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.INLINE_INPUT;this.connectedBlock?(this.width=this.connectedBlockWidth,this.height=this.connectedBlockHeight):(this.height=this.constants_.EMPTY_INLINE_INPUT_HEIGHT,this.width=this.constants_.EMPTY_INLINE_INPUT_PADDING);this.connectionHeight=this.isDynamicShape?this.shape.height(this.height):
|
|
780
|
+
this.shape.height;this.connectionWidth=this.isDynamicShape?this.shape.width(this.height):this.shape.width;this.connectedBlock||(this.width+=this.connectionWidth*(this.isDynamicShape?2:1));this.connectionOffsetY=this.isDynamicShape?this.shape.connectionOffsetY(this.connectionHeight):this.constants_.TAB_OFFSET_FROM_TOP;this.connectionOffsetX=this.isDynamicShape?this.shape.connectionOffsetX(this.connectionWidth):0}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$InlineInput.InlineInput,module$exports$Blockly$blockRendering$InputConnection.InputConnection);var module$exports$Blockly$blockRendering$StatementInput={StatementInput:function(a,b){module$exports$Blockly$blockRendering$InputConnection.InputConnection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.STATEMENT_INPUT;this.height=this.connectedBlock?this.connectedBlockHeight+this.constants_.STATEMENT_BOTTOM_SPACER:this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT;this.width=this.constants_.STATEMENT_INPUT_NOTCH_OFFSET+this.shape.width}};
|
|
781
|
+
$.$jscomp.inherits(module$exports$Blockly$blockRendering$StatementInput.StatementInput,module$exports$Blockly$blockRendering$InputConnection.InputConnection);var module$exports$Blockly$blockRendering$InputRow={InputRow:function(a){module$exports$Blockly$blockRendering$Row.Row.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.INPUT_ROW;this.connectedBlockWidths=0}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$InputRow.InputRow,module$exports$Blockly$blockRendering$Row.Row);
|
|
782
|
+
module$exports$Blockly$blockRendering$InputRow.InputRow.prototype.measure=function(){this.width=this.minWidth;this.height=this.minHeight;for(var a=0,b=0;b<this.elements.length;b++){var c=this.elements[b];this.width+=c.width;module$exports$Blockly$blockRendering$Types.Types.isInput(c)&&c instanceof module$exports$Blockly$blockRendering$InputConnection.InputConnection&&(module$exports$Blockly$blockRendering$Types.Types.isStatementInput(c)&&c instanceof module$exports$Blockly$blockRendering$StatementInput.StatementInput?
|
|
783
|
+
a+=c.connectedBlockWidth:module$exports$Blockly$blockRendering$Types.Types.isExternalInput(c)&&c instanceof module$exports$Blockly$blockRendering$ExternalValueInput.ExternalValueInput&&0!==c.connectedBlockWidth&&(a+=c.connectedBlockWidth-c.connectionWidth));module$exports$Blockly$blockRendering$Types.Types.isSpacer(c)||(this.height=Math.max(this.height,c.height))}this.connectedBlockWidths=a;this.widthWithConnectedBlocks=this.width+a};
|
|
784
|
+
module$exports$Blockly$blockRendering$InputRow.InputRow.prototype.endsWithElemSpacer=function(){return!this.hasExternalInput&&!this.hasStatement};var module$exports$Blockly$blockRendering$JaggedEdge={JaggedEdge:function(a){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.JAGGED_EDGE;this.height=this.constants_.JAGGED_TEETH.height;this.width=this.constants_.JAGGED_TEETH.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$JaggedEdge.JaggedEdge,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$ASTNode={ASTNode:function(a,b,c){if(!b)throw Error("Cannot create a node without a location.");this.type_=a;this.isConnection_=module$exports$Blockly$ASTNode.ASTNode.isConnectionType_(a);this.location_=b;this.wsCoordinate_=null;this.processParams_(c||null)}};module$exports$Blockly$ASTNode.ASTNode.prototype.processParams_=function(a){a&&a.wsCoordinate&&(this.wsCoordinate_=a.wsCoordinate)};module$exports$Blockly$ASTNode.ASTNode.prototype.getLocation=function(){return this.location_};
|
|
785
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.getType=function(){return this.type_};module$exports$Blockly$ASTNode.ASTNode.prototype.getWsCoordinate=function(){return this.wsCoordinate_};module$exports$Blockly$ASTNode.ASTNode.prototype.isConnection=function(){return this.isConnection_};
|
|
786
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.findNextForInput_=function(){var a=this.location_.getParentInput(),b=a.getSourceBlock();for(a=b.inputList.indexOf(a)+1;a<b.inputList.length;a++){for(var c=b.inputList[a],d=c.fieldRow,e=0;e<d.length;e++){var f=d[e];if(f.isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(f)}if(c.connection)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(c)}return null};
|
|
787
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.findNextForField_=function(){var a=this.location_,b=a.getParentInput(),c=a.getSourceBlock(),d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)+1;d<c.inputList.length;d++){b=c.inputList[d];for(var e=b.fieldRow;a<e.length;){if(e[a].isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(e[a]);a++}a=0;if(b.connection)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(b)}return null};
|
|
788
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.findPrevForInput_=function(){for(var a=this.location_.getParentInput(),b=a.getSourceBlock(),c=b.inputList.indexOf(a);0<=c;c--){var d=b.inputList[c];if(d.connection&&d!==a)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(d);d=d.fieldRow;for(var e=d.length-1;0<=e;e--){var f=d[e];if(f.isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(f)}}return null};
|
|
789
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.findPrevForField_=function(){var a=this.location_,b=a.getParentInput(),c=a.getSourceBlock(),d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)-1;0<=d;d--){var e=c.inputList[d];if(e.connection&&e!==b)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(e);for(e=e.fieldRow;-1<a;){if(e[a].isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(e[a]);a--}0<=d-1&&
|
|
790
|
+
(a=c.inputList[d-1].fieldRow.length-1)}return null};
|
|
791
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.navigateBetweenStacks_=function(a){var b=this.getLocation();b.getSourceBlock&&(b=b.getSourceBlock());if(!b||!b.workspace)return null;var c=b.getRootBlock();b=c.workspace.getTopBlocks(!0);for(var d=0;d<b.length;d++)if(c.id===b[d].id)return a=d+(a?1:-1),-1===a||a===b.length?null:module$exports$Blockly$ASTNode.ASTNode.createStackNode(b[a]);throw Error("Couldn't find "+(a?"next":"previous")+" stack?!");};
|
|
792
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.findTopASTNodeForBlock_=function(a){var b=module$contents$Blockly$ASTNode_getParentConnection(a);return b?module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(b):module$exports$Blockly$ASTNode.ASTNode.createBlockNode(a)};
|
|
793
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.getOutAstNodeForBlock_=function(a){if(!a)return null;a=a.getTopStackBlock();var b=module$contents$Blockly$ASTNode_getParentConnection(a);return b&&b.targetConnection&&b.targetConnection.getParentInput()?module$exports$Blockly$ASTNode.ASTNode.createInputNode(b.targetConnection.getParentInput()):module$exports$Blockly$ASTNode.ASTNode.createStackNode(a)};
|
|
794
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.findFirstFieldOrInput_=function(a){a=a.inputList;for(var b=0;b<a.length;b++){for(var c=a[b],d=c.fieldRow,e=0;e<d.length;e++){var f=d[e];if(f.isClickable()||module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS)return module$exports$Blockly$ASTNode.ASTNode.createFieldNode(f)}if(c.connection)return module$exports$Blockly$ASTNode.ASTNode.createInputNode(c)}return null};
|
|
795
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.getSourceBlock=function(){return this.getType()===module$exports$Blockly$ASTNode.ASTNode.types.BLOCK?this.getLocation():this.getType()===module$exports$Blockly$ASTNode.ASTNode.types.STACK?this.getLocation():this.getType()===module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE?null:this.getLocation().getSourceBlock()};
|
|
796
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.next=function(){switch(this.type_){case module$exports$Blockly$ASTNode.ASTNode.types.STACK:return this.navigateBetweenStacks_(!0);case module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.FIELD:return this.findNextForField_();case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:return this.findNextForInput_();
|
|
797
|
+
case module$exports$Blockly$ASTNode.ASTNode.types.BLOCK:return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(this.location_.nextConnection);case module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.NEXT:return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(this.location_.targetConnection)}return null};
|
|
798
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.in=function(){switch(this.type_){case module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE:var a=this.location_.getTopBlocks(!0);if(0<a.length)return module$exports$Blockly$ASTNode.ASTNode.createStackNode(a[0]);break;case module$exports$Blockly$ASTNode.ASTNode.types.STACK:return this.findTopASTNodeForBlock_(this.location_);case module$exports$Blockly$ASTNode.ASTNode.types.BLOCK:return this.findFirstFieldOrInput_(this.location_);case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(this.location_.targetConnection)}return null};
|
|
799
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.prev=function(){switch(this.type_){case module$exports$Blockly$ASTNode.ASTNode.types.STACK:return this.navigateBetweenStacks_(!1);case module$exports$Blockly$ASTNode.ASTNode.types.FIELD:return this.findPrevForField_();case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:return this.findPrevForInput_();case module$exports$Blockly$ASTNode.ASTNode.types.BLOCK:var a=module$contents$Blockly$ASTNode_getParentConnection(this.location_);return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(a);
|
|
800
|
+
case module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS:if((a=this.location_.targetConnection)&&!a.getParentInput())return module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(a);break;case module$exports$Blockly$ASTNode.ASTNode.types.NEXT:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock())}return null};
|
|
801
|
+
module$exports$Blockly$ASTNode.ASTNode.prototype.out=function(){switch(this.type_){case module$exports$Blockly$ASTNode.ASTNode.types.STACK:var a=this.location_,b=a.getRelativeToSurfaceXY();b=new module$exports$Blockly$utils$Coordinate.Coordinate(b.x,b.y+module$exports$Blockly$ASTNode.ASTNode.DEFAULT_OFFSET_Y);return module$exports$Blockly$ASTNode.ASTNode.createWorkspaceNode(a.workspace,b);case module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT:return a=this.location_,(b=a.targetConnection)?module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(b):
|
|
802
|
+
module$exports$Blockly$ASTNode.ASTNode.createStackNode(a.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.FIELD:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:return module$exports$Blockly$ASTNode.ASTNode.createBlockNode(this.location_.getSourceBlock());case module$exports$Blockly$ASTNode.ASTNode.types.BLOCK:return this.getOutAstNodeForBlock_(this.location_);case module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS:return this.getOutAstNodeForBlock_(this.location_.getSourceBlock());
|
|
803
|
+
case module$exports$Blockly$ASTNode.ASTNode.types.NEXT:return this.getOutAstNodeForBlock_(this.location_.getSourceBlock())}return null};module$exports$Blockly$ASTNode.ASTNode.isConnectionType_=function(a){switch(a){case module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS:case module$exports$Blockly$ASTNode.ASTNode.types.NEXT:case module$exports$Blockly$ASTNode.ASTNode.types.INPUT:case module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT:return!0}return!1};
|
|
804
|
+
module$exports$Blockly$ASTNode.ASTNode.createFieldNode=function(a){return a?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.FIELD,a):null};
|
|
805
|
+
module$exports$Blockly$ASTNode.ASTNode.createConnectionNode=function(a){if(!a)return null;var b=a.type;return b===$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE||b===$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT&&a.getParentInput()?module$exports$Blockly$ASTNode.ASTNode.createInputNode(a.getParentInput()):b===$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.NEXT,
|
|
806
|
+
a):b===$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT,a):b===$.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS,a):null};
|
|
807
|
+
module$exports$Blockly$ASTNode.ASTNode.createInputNode=function(a){return a&&a.connection?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.INPUT,a.connection):null};module$exports$Blockly$ASTNode.ASTNode.createBlockNode=function(a){return a?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.BLOCK,a):null};
|
|
808
|
+
module$exports$Blockly$ASTNode.ASTNode.createStackNode=function(a){return a?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.STACK,a):null};module$exports$Blockly$ASTNode.ASTNode.createWorkspaceNode=function(a,b){return b&&a?new module$exports$Blockly$ASTNode.ASTNode(module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE,a,{wsCoordinate:b}):null};
|
|
809
|
+
module$exports$Blockly$ASTNode.ASTNode.createTopNode=function(a){var b=module$contents$Blockly$ASTNode_getParentConnection(a);return b?module$exports$Blockly$ASTNode.ASTNode.createConnectionNode(b):module$exports$Blockly$ASTNode.ASTNode.createBlockNode(a)};module$exports$Blockly$ASTNode.ASTNode.types={FIELD:"field",BLOCK:"block",INPUT:"input",OUTPUT:"output",NEXT:"next",PREVIOUS:"previous",STACK:"stack",WORKSPACE:"workspace"};module$exports$Blockly$ASTNode.ASTNode.NAVIGATE_ALL_FIELDS=!1;
|
|
810
|
+
module$exports$Blockly$ASTNode.ASTNode.DEFAULT_OFFSET_Y=-20;var module$contents$Blockly$ASTNode_getParentConnection=function(a){var b=a.outputConnection;if(!b||a.previousConnection&&a.previousConnection.isConnected())b=a.previousConnection;return b};var module$exports$Blockly$Events$MarkerMove={MarkerMove:function(a,b,c,d){var e=a?a.workspace.id:void 0;d&&d.getType()===module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE&&(e=d.getLocation().id);module$exports$Blockly$Events$UiBase.UiBase.call(this,e);this.blockId=a?a.id:null;this.oldNode=c;this.newNode=d;this.isCursor=b;this.type=module$exports$Blockly$Events$utils.MARKER_MOVE}};$.$jscomp.inherits(module$exports$Blockly$Events$MarkerMove.MarkerMove,module$exports$Blockly$Events$UiBase.UiBase);
|
|
811
|
+
module$exports$Blockly$Events$MarkerMove.MarkerMove.prototype.toJson=function(){var a=module$exports$Blockly$Events$UiBase.UiBase.prototype.toJson.call(this);a.isCursor=this.isCursor;a.blockId=this.blockId;a.oldNode=this.oldNode;a.newNode=this.newNode;return a};
|
|
812
|
+
module$exports$Blockly$Events$MarkerMove.MarkerMove.prototype.fromJson=function(a){module$exports$Blockly$Events$UiBase.UiBase.prototype.fromJson.call(this,a);this.isCursor=a.isCursor;this.blockId=a.blockId;this.oldNode=a.oldNode;this.newNode=a.newNode};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.MARKER_MOVE,module$exports$Blockly$Events$MarkerMove.MarkerMove);var module$exports$Blockly$blockRendering$MarkerSvg={},module$contents$Blockly$blockRendering$MarkerSvg_CURSOR_CLASS="blocklyCursor",module$contents$Blockly$blockRendering$MarkerSvg_MARKER_CLASS="blocklyMarker",module$contents$Blockly$blockRendering$MarkerSvg_HEIGHT_MULTIPLIER=.75;
|
|
813
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg=function(a,b,c){this.workspace_=a;this.marker_=c;this.parent_=null;this.constants_=b;this.currentMarkerSvg=null;a=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=c.colour||a;this.markerSvgRect_=this.markerSvgLine_=this.markerInput_=this.markerBlock_=this.svgGroup_=this.markerSvg_=null};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.getSvgRoot=function(){return this.svgGroup_};
|
|
814
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.getMarker=function(){return this.marker_};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.isCursor=function(){return"cursor"===this.marker_.type};
|
|
815
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.createDom=function(){var a=this.isCursor()?module$contents$Blockly$blockRendering$MarkerSvg_CURSOR_CLASS:module$contents$Blockly$blockRendering$MarkerSvg_MARKER_CLASS;this.svgGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{"class":a},null);this.createDomInternal_();return this.svgGroup_};
|
|
816
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.setParent_=function(a){this.isCursor()?(this.parent_&&this.parent_.setCursorSvg(null),a.setCursorSvg(this.getSvgRoot())):(this.parent_&&this.parent_.setMarkerSvg(null),a.setMarkerSvg(this.getSvgRoot()));this.parent_=a};
|
|
817
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.draw=function(a,b){if(b){this.constants_=this.workspace_.getRenderer().getConstants();var c=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=this.marker_.colour||c;this.applyColour_(b);this.showAtLocation_(b);this.fireMarkerEvent_(a,b);a=this.currentMarkerSvg.childNodes[0];void 0!==a&&a.beginElement&&a.beginElement()}else this.hide()};
|
|
818
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showAtLocation_=function(a){var b=a.getLocation().type;a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.BLOCK?this.showWithBlock_(a):a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT?this.showWithOutput_(a):b===$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE?this.showWithInput_(a):b===$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT?this.showWithNext_(a):a.getType()===
|
|
819
|
+
module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS?this.showWithPrevious_(a):a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.FIELD?this.showWithField_(a):a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE?this.showWithCoordinates_(a):a.getType()===module$exports$Blockly$ASTNode.ASTNode.types.STACK&&this.showWithStack_(a)};
|
|
820
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithBlockPrevOutput_=function(a){a=a.getSourceBlock();var b=a.width,c=a.height,d=c*module$contents$Blockly$blockRendering$MarkerSvg_HEIGHT_MULTIPLIER,e=this.constants_.CURSOR_BLOCK_PADDING;a.previousConnection?(c=this.constants_.shapeFor(a.previousConnection),this.positionPrevious_(b,e,d,c)):a.outputConnection?(d=this.constants_.shapeFor(a.outputConnection),this.positionOutput_(b,c,d)):this.positionBlock_(b,e,d);this.setParent_(a);
|
|
821
|
+
this.showCurrent_()};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithBlock_=function(a){this.showWithBlockPrevOutput_(a)};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithPrevious_=function(a){this.showWithBlockPrevOutput_(a)};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithOutput_=function(a){this.showWithBlockPrevOutput_(a)};
|
|
822
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithCoordinates_=function(a){var b=a.getWsCoordinate();a=b.x;b=b.y;this.workspace_.RTL&&(a-=this.constants_.CURSOR_WS_WIDTH);this.positionLine_(a,b,this.constants_.CURSOR_WS_WIDTH);this.setParent_(this.workspace_);this.showCurrent_()};
|
|
823
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithField_=function(a){a=a.getLocation();var b=a.getSize().width,c=a.getSize().height;this.positionRect_(0,0,b,c);this.setParent_(a);this.showCurrent_()};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithInput_=function(a){a=a.getLocation();var b=a.getSourceBlock();this.positionInput_(a);this.setParent_(b);this.showCurrent_()};
|
|
824
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithNext_=function(a){var b=a.getLocation();a=b.getSourceBlock();var c=0;b=b.getOffsetInBlock().y;var d=a.getHeightWidth().width;this.workspace_.RTL&&(c=-d);this.positionLine_(c,b,d);this.setParent_(a);this.showCurrent_()};
|
|
825
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showWithStack_=function(a){a=a.getLocation();var b=a.getHeightWidth(),c=b.width+this.constants_.CURSOR_STACK_PADDING;b=b.height+this.constants_.CURSOR_STACK_PADDING;var d=-this.constants_.CURSOR_STACK_PADDING/2,e=-this.constants_.CURSOR_STACK_PADDING/2,f=d;this.workspace_.RTL&&(f=-(c+d));this.positionRect_(f,e,c,b);this.setParent_(a);this.showCurrent_()};
|
|
826
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.showCurrent_=function(){this.hide();this.currentMarkerSvg.style.display=""};
|
|
827
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionBlock_=function(a,b,c){a=(0,module$exports$Blockly$utils$svgPaths.moveBy)(-b,c)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",-b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a+2*b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",c);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_};
|
|
828
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionInput_=function(a){var b=a.getOffsetInBlock().x,c=a.getOffsetInBlock().y;a=(0,module$exports$Blockly$utils$svgPaths.moveTo)(0,0)+this.constants_.shapeFor(a).pathDown;this.markerInput_.setAttribute("d",a);this.markerInput_.setAttribute("transform","translate("+b+","+c+")"+(this.workspace_.RTL?" scale(-1 1)":""));this.currentMarkerSvg=this.markerInput_};
|
|
829
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionLine_=function(a,b,c){this.markerSvgLine_.setAttribute("x",a);this.markerSvgLine_.setAttribute("y",b);this.markerSvgLine_.setAttribute("width",c);this.currentMarkerSvg=this.markerSvgLine_};
|
|
830
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionOutput_=function(a,b,c){a=(0,module$exports$Blockly$utils$svgPaths.moveBy)(a,0)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",-(a-c.width))+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",this.constants_.TAB_OFFSET_FROM_TOP)+c.pathDown+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&
|
|
831
|
+
this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_};
|
|
832
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionPrevious_=function(a,b,c,d){a=(0,module$exports$Blockly$utils$svgPaths.moveBy)(-b,c)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",-b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",this.constants_.NOTCH_OFFSET_LEFT)+d.pathLeft+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a+2*b)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",c);this.markerBlock_.setAttribute("d",a);this.workspace_.RTL&&
|
|
833
|
+
this.flipRtl_(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.positionRect_=function(a,b,c,d){this.markerSvgRect_.setAttribute("x",a);this.markerSvgRect_.setAttribute("y",b);this.markerSvgRect_.setAttribute("width",c);this.markerSvgRect_.setAttribute("height",d);this.currentMarkerSvg=this.markerSvgRect_};
|
|
834
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.flipRtl_=function(a){a.setAttribute("transform","scale(-1 1)")};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.hide=function(){this.markerSvgLine_.style.display="none";this.markerSvgRect_.style.display="none";this.markerInput_.style.display="none";this.markerBlock_.style.display="none"};
|
|
835
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.fireMarkerEvent_=function(a,b){var c=b.getSourceBlock();a=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.MARKER_MOVE))(c,this.isCursor(),a,b);(0,module$exports$Blockly$Events$utils.fire)(a)};
|
|
836
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.getBlinkProperties_=function(){return{attributeType:"XML",attributeName:"fill",dur:"1s",values:this.colour_+";transparent;transparent;",repeatCount:"indefinite"}};
|
|
837
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.createDomInternal_=function(){this.markerSvg_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.svgGroup_);this.markerSvgLine_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT,style:"display: none"},
|
|
838
|
+
this.markerSvg_);this.markerSvgRect_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyVerticalMarker",rx:10,ry:10,style:"display: none"},this.markerSvg_);this.markerInput_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{transform:"",style:"display: none"},this.markerSvg_);this.markerBlock_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{transform:"",
|
|
839
|
+
style:"display: none",fill:"none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_);if(this.isCursor()){var a=this.getBlinkProperties_();(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.ANIMATE,a,this.markerSvgLine_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.ANIMATE,a,this.markerInput_);a.attributeName="stroke";(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.ANIMATE,
|
|
840
|
+
a,this.markerBlock_)}return this.markerSvg_};
|
|
841
|
+
module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.applyColour_=function(a){this.markerSvgLine_.setAttribute("fill",this.colour_);this.markerSvgRect_.setAttribute("stroke",this.colour_);this.markerInput_.setAttribute("fill",this.colour_);this.markerBlock_.setAttribute("stroke",this.colour_);this.isCursor()&&(a=this.colour_+";transparent;transparent;",this.markerSvgLine_.firstChild.setAttribute("values",a),this.markerInput_.firstChild.setAttribute("values",a),this.markerBlock_.firstChild.setAttribute("values",
|
|
842
|
+
a))};module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.dispose=function(){this.svgGroup_&&(0,module$exports$Blockly$utils$dom.removeNode)(this.svgGroup_)};var module$exports$Blockly$blockRendering$NextConnection={NextConnection:function(a,b){module$exports$Blockly$blockRendering$Connection.Connection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.NEXT_CONNECTION;this.height=this.shape.height;this.width=this.shape.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$NextConnection.NextConnection,module$exports$Blockly$blockRendering$Connection.Connection);var module$exports$Blockly$blockRendering$OutputConnection={OutputConnection:function(a,b){module$exports$Blockly$blockRendering$Connection.Connection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.OUTPUT_CONNECTION;this.height=this.isDynamicShape?0:this.shape.height;this.startX=this.width=this.isDynamicShape?0:this.shape.width;this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP;this.connectionOffsetX=0}};
|
|
843
|
+
$.$jscomp.inherits(module$exports$Blockly$blockRendering$OutputConnection.OutputConnection,module$exports$Blockly$blockRendering$Connection.Connection);var module$exports$Blockly$blockRendering$PathObject={PathObject:function(a,b,c){this.constants=c;this.svgRoot=a;this.svgPath=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyPath"},this.svgRoot);this.style=b;this.markerSvg=this.cursorSvg=null}};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setPath=function(a){this.svgPath.setAttribute("d",a)};
|
|
844
|
+
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.flipRTL=function(){this.svgPath.setAttribute("transform","scale(-1 1)")};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setCursorSvg=function(a){a?(this.svgRoot.appendChild(a),this.cursorSvg=a):this.cursorSvg=null};
|
|
845
|
+
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setMarkerSvg=function(a){a?(this.cursorSvg?this.svgRoot.insertBefore(a,this.cursorSvg):this.svgRoot.appendChild(a),this.markerSvg=a):this.markerSvg=null};
|
|
846
|
+
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.applyColour=function(a){this.svgPath.setAttribute("stroke",this.style.colourTertiary);this.svgPath.setAttribute("fill",this.style.colourPrimary);this.updateShadow_(a.isShadow());this.updateDisabled_(!a.isEnabled()||a.getInheritedDisabled())};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setStyle=function(a){this.style=a};
|
|
847
|
+
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setClass_=function(a,b){b?(0,module$exports$Blockly$utils$dom.addClass)(this.svgRoot,a):(0,module$exports$Blockly$utils$dom.removeClass)(this.svgRoot,a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateHighlighted=function(a){a?this.svgPath.setAttribute("filter","url(#"+this.constants.embossFilterId+")"):this.svgPath.setAttribute("filter","none")};
|
|
848
|
+
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateShadow_=function(a){a&&(this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary))};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateDisabled_=function(a){this.setClass_("blocklyDisabled",a);a&&this.svgPath.setAttribute("fill","url(#"+this.constants.disabledPatternId+")")};
|
|
849
|
+
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateSelected=function(a){this.setClass_("blocklySelected",a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateDraggingDelete=function(a){this.setClass_("blocklyDraggingDelete",a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateInsertionMarker=function(a){this.setClass_("blocklyInsertionMarker",a)};
|
|
850
|
+
module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateMovable=function(a){this.setClass_("blocklyDraggable",a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateReplacementFade=function(a){this.setClass_("blocklyReplaceable",a)};module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateShapeForInputHighlight=function(a,b){};var module$exports$Blockly$blockRendering$PreviousConnection={PreviousConnection:function(a,b){module$exports$Blockly$blockRendering$Connection.Connection.call(this,a,b);this.type|=module$exports$Blockly$blockRendering$Types.Types.PREVIOUS_CONNECTION;this.height=this.shape.height;this.width=this.shape.width}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$PreviousConnection.PreviousConnection,module$exports$Blockly$blockRendering$Connection.Connection);$.module$exports$Blockly$Input={Input:function(a,b,c,d){if(a!==$.module$exports$Blockly$inputTypes.inputTypes.DUMMY&&!b)throw Error("Value inputs and statement inputs must have non-empty name.");this.type=a;this.name=b;this.sourceBlock_=c;this.connection=d;this.fieldRow=[];this.align=$.module$exports$Blockly$Input.Align.LEFT;this.visible_=!0}};$.module$exports$Blockly$Input.Input.prototype.getSourceBlock=function(){return this.sourceBlock_};
|
|
826
851
|
$.module$exports$Blockly$Input.Input.prototype.appendField=function(a,b){this.insertFieldAt(this.fieldRow.length,a,b);return this};
|
|
827
852
|
$.module$exports$Blockly$Input.Input.prototype.insertFieldAt=function(a,b,c){if(0>a||a>this.fieldRow.length)throw Error("index "+a+" out of bounds.");if(!(b||""===b&&c))return a;"string"===typeof b&&(b=(0,module$exports$Blockly$fieldRegistry.fromJson)({type:"field_label",text:b}));b.setSourceBlock(this.sourceBlock_);this.sourceBlock_.rendered&&(b.init(),b.applyColour());b.name=c;b.setVisible(this.isVisible());b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);a++;b.suffixField&&
|
|
828
853
|
(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours());return a};
|
|
@@ -830,14 +855,13 @@ $.module$exports$Blockly$Input.Input.prototype.removeField=function(a,b){for(var
|
|
|
830
855
|
$.module$exports$Blockly$Input.Input.prototype.setVisible=function(a){var b=[];if(this.visible_===a)return b;this.visible_=a;for(var c=0,d;d=this.fieldRow[c];c++)d.setVisible(a);this.connection&&(this.connection=this.connection,a?b=this.connection.startTrackingAll():this.connection.stopTrackingAll(),c=this.connection.targetBlock())&&(c.getSvgRoot().style.display=a?"block":"none");return b};$.module$exports$Blockly$Input.Input.prototype.markDirty=function(){for(var a=0,b;b=this.fieldRow[a];a++)b.markDirty()};
|
|
831
856
|
$.module$exports$Blockly$Input.Input.prototype.setCheck=function(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setCheck(a);return this};$.module$exports$Blockly$Input.Input.prototype.setAlign=function(a){this.align=a;this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render());return this};
|
|
832
857
|
$.module$exports$Blockly$Input.Input.prototype.setShadowDom=function(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setShadowDom(a);return this};$.module$exports$Blockly$Input.Input.prototype.getShadowDom=function(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()};$.module$exports$Blockly$Input.Input.prototype.init=function(){if(this.sourceBlock_.workspace.rendered)for(var a=0;a<this.fieldRow.length;a++)this.fieldRow[a].init()};
|
|
833
|
-
$.module$exports$Blockly$Input.Input.prototype.dispose=function(){for(var a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose();this.sourceBlock_=null};var module$exports$Blockly$blockRendering$RoundCorner={RoundCorner:function(a,b){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type=(b&&"left"!==b?module$exports$Blockly$blockRendering$Types.Types.RIGHT_ROUND_CORNER:module$exports$Blockly$blockRendering$Types.Types.LEFT_ROUND_CORNER)|module$exports$Blockly$blockRendering$Types.Types.CORNER;this.width=this.constants_.CORNER_RADIUS;this.height=this.constants_.CORNER_RADIUS/2}};
|
|
858
|
+
$.module$exports$Blockly$Input.Input.prototype.dispose=function(){for(var a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose();this.sourceBlock_=null};$.module$exports$Blockly$Input.Align={LEFT:-1,CENTRE:0,RIGHT:1};$.module$exports$Blockly$Input.Input.Align=$.module$exports$Blockly$Input.Align;var module$exports$Blockly$blockRendering$RoundCorner={RoundCorner:function(a,b){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type=(b&&"left"!==b?module$exports$Blockly$blockRendering$Types.Types.RIGHT_ROUND_CORNER:module$exports$Blockly$blockRendering$Types.Types.LEFT_ROUND_CORNER)|module$exports$Blockly$blockRendering$Types.Types.CORNER;this.width=this.constants_.CORNER_RADIUS;this.height=this.constants_.CORNER_RADIUS/2}};
|
|
834
859
|
$.$jscomp.inherits(module$exports$Blockly$blockRendering$RoundCorner.RoundCorner,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$SpacerRow={SpacerRow:function(a,b,c){module$exports$Blockly$blockRendering$Row.Row.call(this,a);this.type=this.type|module$exports$Blockly$blockRendering$Types.Types.SPACER|module$exports$Blockly$blockRendering$Types.Types.BETWEEN_ROW_SPACER;this.width=c;this.height=b;this.precedesStatement=this.followsStatement=!1;this.widthWithConnectedBlocks=0;this.elements=[new module$exports$Blockly$blockRendering$InRowSpacer.InRowSpacer(this.constants_,c)]}};
|
|
835
860
|
$.$jscomp.inherits(module$exports$Blockly$blockRendering$SpacerRow.SpacerRow,module$exports$Blockly$blockRendering$Row.Row);module$exports$Blockly$blockRendering$SpacerRow.SpacerRow.prototype.measure=function(){};var module$exports$Blockly$blockRendering$SquareCorner={SquareCorner:function(a,b){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type=(b&&"left"!==b?module$exports$Blockly$blockRendering$Types.Types.RIGHT_SQUARE_CORNER:module$exports$Blockly$blockRendering$Types.Types.LEFT_SQUARE_CORNER)|module$exports$Blockly$blockRendering$Types.Types.CORNER;this.width=this.height=this.constants_.NO_PADDING}};
|
|
836
|
-
$.$jscomp.inherits(module$exports$Blockly$blockRendering$SquareCorner.SquareCorner,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$
|
|
837
|
-
$.$jscomp.inherits(module$exports$Blockly$blockRendering$StatementInput.StatementInput,module$exports$Blockly$blockRendering$InputConnection.InputConnection);var module$exports$Blockly$blockRendering$TopRow={TopRow:function(a){module$exports$Blockly$blockRendering$Row.Row.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.TOP_ROW;this.ascenderHeight=this.capline=0;this.hasPreviousConnection=!1;this.connection=null}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$TopRow.TopRow,module$exports$Blockly$blockRendering$Row.Row);
|
|
861
|
+
$.$jscomp.inherits(module$exports$Blockly$blockRendering$SquareCorner.SquareCorner,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$blockRendering$TopRow={TopRow:function(a){module$exports$Blockly$blockRendering$Row.Row.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.TOP_ROW;this.ascenderHeight=this.capline=0;this.hasPreviousConnection=!1;this.connection=null}};$.$jscomp.inherits(module$exports$Blockly$blockRendering$TopRow.TopRow,module$exports$Blockly$blockRendering$Row.Row);
|
|
838
862
|
module$exports$Blockly$blockRendering$TopRow.TopRow.prototype.hasLeftSquareCorner=function(a){var b=(a.hat?"cap"===a.hat:this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection,c=a.getPreviousBlock();return!!a.outputConnection||b||(c?c.getNextBlock()===a:!1)};module$exports$Blockly$blockRendering$TopRow.TopRow.prototype.hasRightSquareCorner=function(a){return!0};
|
|
839
|
-
module$exports$Blockly$blockRendering$TopRow.TopRow.prototype.measure=function(){for(var a=0,b=0,c=0,d=0;d<this.elements.length;d++){var e=this.elements[d];b+=e.width;module$exports$Blockly$blockRendering$Types.Types.isSpacer(e)||(module$exports$Blockly$blockRendering$Types.Types.isHat(e)?c=Math.max(c,e.ascenderHeight):a=Math.max(a,e.height))}this.width=Math.max(this.minWidth,b);this.height=Math.max(this.minHeight,a)+c;this.capline=this.ascenderHeight=
|
|
840
|
-
module$exports$Blockly$blockRendering$TopRow.TopRow.prototype.startsWithElemSpacer=function(){return!1};module$exports$Blockly$blockRendering$TopRow.TopRow.prototype.endsWithElemSpacer=function(){return!1};var module$exports$Blockly$blockRendering$RenderInfo={RenderInfo:function(a,b){this.block_=b;this.renderer_=a;this.constants_=this.renderer_.getConstants();this.outputConnection=b.outputConnection?new module$exports$Blockly$blockRendering$OutputConnection.OutputConnection(this.constants_,b.outputConnection):null;this.isInline=b.getInputsInline()&&!b.isCollapsed();this.isCollapsed=b.isCollapsed();this.isInsertionMarker=b.isInsertionMarker();this.RTL=b.RTL;this.statementEdge=this.width=this.widthWithChildren=
|
|
863
|
+
module$exports$Blockly$blockRendering$TopRow.TopRow.prototype.measure=function(){for(var a=0,b=0,c=0,d=0;d<this.elements.length;d++){var e=this.elements[d];b+=e.width;module$exports$Blockly$blockRendering$Types.Types.isSpacer(e)||(module$exports$Blockly$blockRendering$Types.Types.isHat(e)&&e instanceof module$exports$Blockly$blockRendering$Hat.Hat?c=Math.max(c,e.ascenderHeight):a=Math.max(a,e.height))}this.width=Math.max(this.minWidth,b);this.height=Math.max(this.minHeight,a)+c;this.capline=this.ascenderHeight=
|
|
864
|
+
c;this.widthWithConnectedBlocks=this.width};module$exports$Blockly$blockRendering$TopRow.TopRow.prototype.startsWithElemSpacer=function(){return!1};module$exports$Blockly$blockRendering$TopRow.TopRow.prototype.endsWithElemSpacer=function(){return!1};var module$exports$Blockly$blockRendering$RenderInfo={RenderInfo:function(a,b){this.block_=b;this.renderer_=a;this.constants_=this.renderer_.getConstants();this.outputConnection=b.outputConnection?new module$exports$Blockly$blockRendering$OutputConnection.OutputConnection(this.constants_,b.outputConnection):null;this.isInline=b.getInputsInline()&&!b.isCollapsed();this.isCollapsed=b.isCollapsed();this.isInsertionMarker=b.isInsertionMarker();this.RTL=b.RTL;this.statementEdge=this.width=this.widthWithChildren=
|
|
841
865
|
this.height=0;this.rows=[];this.inputRows=[];this.hiddenIcons=[];this.topRow=new module$exports$Blockly$blockRendering$TopRow.TopRow(this.constants_);this.bottomRow=new module$exports$Blockly$blockRendering$BottomRow.BottomRow(this.constants_);this.startY=this.startX=0}};module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.getRenderer=function(){return this.renderer_};
|
|
842
866
|
module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.measure=function(){this.createRows_();this.addElemSpacing_();this.addRowSpacing_();this.computeBounds_();this.alignRowElements_();this.finalize_()};
|
|
843
867
|
module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.createRows_=function(){this.populateTopRow_();this.rows.push(this.topRow);var a=new module$exports$Blockly$blockRendering$InputRow.InputRow(this.constants_);this.inputRows.push(a);for(var b=this.block_.getIcons(),c=0,d;d=b[c];c++){var e=new module$exports$Blockly$blockRendering$Icon.Icon(this.constants_,d);this.isCollapsed&&d.collapseHidden?this.hiddenIcons.push(e):a.elements.push(e)}d=null;for(b=0;c=this.block_.inputList[b];b++)if(c.isVisible()){this.shouldStartNewRow_(c,
|
|
@@ -871,17 +895,47 @@ b-this.bottomRow.descenderHeight};var module$exports$Blockly$blockRendering$Rend
|
|
|
871
895
|
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.createDom=function(a,b){this.constants_.createDom(a,this.name+"-"+b.name,"."+this.getClassName()+"."+b.getClassName())};
|
|
872
896
|
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.refreshDom=function(a,b){var c=this.getConstants();c.dispose();this.constants_=this.makeConstants_();this.overrides&&(0,$.module$exports$Blockly$utils$object.mixin)(this.constants_,this.overrides);this.constants_.randomIdentifier=c.randomIdentifier;this.constants_.setTheme(b);this.constants_.init();this.createDom(a,b)};module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.dispose=function(){this.constants_&&this.constants_.dispose()};
|
|
873
897
|
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.makeConstants_=function(){return new module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider};module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.makeRenderInfo_=function(a){return new module$exports$Blockly$blockRendering$RenderInfo.RenderInfo(this,a)};
|
|
874
|
-
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.makeDrawer_=function(a,b){return new module$exports$Blockly$blockRendering$Drawer.Drawer(a,b)};module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.
|
|
875
|
-
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.
|
|
876
|
-
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.orphanCanConnectAtEnd=function(a,b,c){return!!module$exports$Blockly$Connection.Connection.getConnectionForOrphanedConnection(a,c===$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE?b.outputConnection:b.previousConnection)};
|
|
898
|
+
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.makeDrawer_=function(a,b){return new module$exports$Blockly$blockRendering$Drawer.Drawer(a,b)};module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.makeDebugger_=function(){var a=module$exports$Blockly$blockRendering$Debug.Debug;if(!a)throw Error("Missing require for Blockly.blockRendering.Debug");return new a(this.getConstants())};
|
|
899
|
+
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.makeMarkerDrawer=function(a,b){return new module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg(a,this.getConstants(),b)};module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.makePathObject=function(a,b){return new module$exports$Blockly$blockRendering$PathObject.PathObject(a,b,this.constants_)};module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.getConstants=function(){return this.constants_};
|
|
900
|
+
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.shouldHighlightConnection=function(a){return!0};module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.orphanCanConnectAtEnd=function(a,b,c){return!!module$exports$Blockly$Connection.Connection.getConnectionForOrphanedConnection(a,c===$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE?b.outputConnection:b.previousConnection)};
|
|
877
901
|
module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.getConnectionPreviewMethod=function(a,b,c){return b.type===$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE||b.type===$.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT?!a.isConnected()||this.orphanCanConnectAtEnd(c,a.targetBlock(),b.type)?module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER:module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE:
|
|
878
|
-
module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER};module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.render=function(a){var b=this.makeRenderInfo_(a);b.measure();this.makeDrawer_(a,b).draw()};var module$exports$Blockly$blockRendering={
|
|
879
|
-
module$exports$Blockly$
|
|
880
|
-
module$exports$Blockly$blockRendering.
|
|
881
|
-
module$exports$Blockly$blockRendering.
|
|
882
|
-
module$exports$Blockly$blockRendering.
|
|
883
|
-
module$exports$Blockly$blockRendering.
|
|
884
|
-
module$exports$Blockly$blockRendering.
|
|
902
|
+
module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER};module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.render=function(a){(0,module$exports$Blockly$blockRendering$debug.isDebuggerEnabled)()&&!a.renderingDebugger&&(a.renderingDebugger=this.makeDebugger_());var b=this.makeRenderInfo_(a);b.measure();this.makeDrawer_(a,b).draw()};var module$exports$Blockly$blockRendering={isDebuggerEnabled:function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.blockRendering.isDebuggerEnabled()","September 2021","September 2022","the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)");return(0,module$exports$Blockly$blockRendering$debug.isDebuggerEnabled)()},register:function(a,b){(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.RENDERER,a,b)},unregister:function(a){(0,module$exports$Blockly$registry.unregister)(module$exports$Blockly$registry.Type.RENDERER,
|
|
903
|
+
a)},startDebugger:function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.blockRendering.startDebugger()","September 2021","September 2022","the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)");(0,module$exports$Blockly$blockRendering$debug.startDebugger)()},stopDebugger:function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.blockRendering.stopDebugger()","September 2021","September 2022","the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)");
|
|
904
|
+
(0,module$exports$Blockly$blockRendering$debug.stopDebugger)()},init:function(a,b,c){a=new ((0,module$exports$Blockly$registry.getClass)(module$exports$Blockly$registry.Type.RENDERER,a))(a);a.init(b,c);return a}};module$exports$Blockly$blockRendering.BottomRow=module$exports$Blockly$blockRendering$BottomRow.BottomRow;module$exports$Blockly$blockRendering.Connection=module$exports$Blockly$blockRendering$Connection.Connection;module$exports$Blockly$blockRendering.ConstantProvider=module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider;
|
|
905
|
+
module$exports$Blockly$blockRendering.Debug=module$exports$Blockly$blockRendering$Debug.Debug;module$exports$Blockly$blockRendering.Drawer=module$exports$Blockly$blockRendering$Drawer.Drawer;module$exports$Blockly$blockRendering.ExternalValueInput=module$exports$Blockly$blockRendering$ExternalValueInput.ExternalValueInput;module$exports$Blockly$blockRendering.Field=module$exports$Blockly$blockRendering$Field.Field;module$exports$Blockly$blockRendering.Hat=module$exports$Blockly$blockRendering$Hat.Hat;
|
|
906
|
+
module$exports$Blockly$blockRendering.Icon=module$exports$Blockly$blockRendering$Icon.Icon;module$exports$Blockly$blockRendering.InRowSpacer=module$exports$Blockly$blockRendering$InRowSpacer.InRowSpacer;module$exports$Blockly$blockRendering.InlineInput=module$exports$Blockly$blockRendering$InlineInput.InlineInput;module$exports$Blockly$blockRendering.InputConnection=module$exports$Blockly$blockRendering$InputConnection.InputConnection;module$exports$Blockly$blockRendering.InputRow=module$exports$Blockly$blockRendering$InputRow.InputRow;
|
|
907
|
+
module$exports$Blockly$blockRendering.IPathObject=module$exports$Blockly$blockRendering$IPathObject.IPathObject;module$exports$Blockly$blockRendering.JaggedEdge=module$exports$Blockly$blockRendering$JaggedEdge.JaggedEdge;module$exports$Blockly$blockRendering.MarkerSvg=module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg;module$exports$Blockly$blockRendering.Measurable=module$exports$Blockly$blockRendering$Measurable.Measurable;module$exports$Blockly$blockRendering.NextConnection=module$exports$Blockly$blockRendering$NextConnection.NextConnection;
|
|
908
|
+
module$exports$Blockly$blockRendering.OutputConnection=module$exports$Blockly$blockRendering$OutputConnection.OutputConnection;module$exports$Blockly$blockRendering.PathObject=module$exports$Blockly$blockRendering$PathObject.PathObject;module$exports$Blockly$blockRendering.PreviousConnection=module$exports$Blockly$blockRendering$PreviousConnection.PreviousConnection;module$exports$Blockly$blockRendering.Renderer=module$exports$Blockly$blockRendering$Renderer.Renderer;
|
|
909
|
+
module$exports$Blockly$blockRendering.RenderInfo=module$exports$Blockly$blockRendering$RenderInfo.RenderInfo;module$exports$Blockly$blockRendering.RoundCorner=module$exports$Blockly$blockRendering$RoundCorner.RoundCorner;module$exports$Blockly$blockRendering.Row=module$exports$Blockly$blockRendering$Row.Row;module$exports$Blockly$blockRendering.SpacerRow=module$exports$Blockly$blockRendering$SpacerRow.SpacerRow;module$exports$Blockly$blockRendering.SquareCorner=module$exports$Blockly$blockRendering$SquareCorner.SquareCorner;
|
|
910
|
+
module$exports$Blockly$blockRendering.StatementInput=module$exports$Blockly$blockRendering$StatementInput.StatementInput;module$exports$Blockly$blockRendering.TopRow=module$exports$Blockly$blockRendering$TopRow.TopRow;module$exports$Blockly$blockRendering.Types=module$exports$Blockly$blockRendering$Types.Types;module$exports$Blockly$blockRendering.debug=module$exports$Blockly$blockRendering$debug;$.module$exports$Blockly$FieldDropdown={FieldDropdown:function(a,b,c){module$exports$Blockly$Field.Field.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);this.svgArrow_=this.arrow_=this.imageElement_=this.menu_=this.selectedMenuItem_=null;this.SERIALIZABLE=!0;this.CURSOR="default";a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(Array.isArray(a)&&module$contents$Blockly$FieldDropdown_validateOptions(a),this.menuGenerator_=a,this.suffixField=this.prefixField=this.generatedOptions_=null,
|
|
911
|
+
this.trimOptions_(),this.selectedOption_=this.getOptions(!1)[0],c&&this.configure_(c),this.setValue(this.selectedOption_[1]),b&&this.setValidator(b))}};$.$jscomp.inherits($.module$exports$Blockly$FieldDropdown.FieldDropdown,module$exports$Blockly$Field.Field);$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.fromXml=function(a){this.isOptionListDynamic()&&this.getOptions(!1);this.setValue(a.textContent)};
|
|
912
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.loadState=function(a){this.loadLegacyState($.module$exports$Blockly$FieldDropdown.FieldDropdown,a)||(this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(a))};
|
|
913
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.initView=function(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot();this.createTextElement_();this.imageElement_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.IMAGE,{},this.fieldGroup_);this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&(0,module$exports$Blockly$utils$dom.addClass)(this.borderRect_,
|
|
914
|
+
"blocklyDropdownRect")};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.shouldAddBorderRect_=function(){return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.sourceBlock_.isShadow()};
|
|
915
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.createTextArrow_=function(){this.arrow_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.TSPAN,{},this.textElement_);this.arrow_.appendChild(document.createTextNode(this.sourceBlock_.RTL?$.module$exports$Blockly$FieldDropdown.FieldDropdown.ARROW_CHAR+" ":" "+$.module$exports$Blockly$FieldDropdown.FieldDropdown.ARROW_CHAR));this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textContent_):
|
|
916
|
+
this.textElement_.appendChild(this.arrow_)};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.createSVGArrow_=function(){this.svgArrow_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.IMAGE,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(module$exports$Blockly$utils$dom.XLINK_NS,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)};
|
|
917
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.showEditor_=function(a){this.dropdownCreate_();this.menu_.openingCoords=a&&"number"===typeof a.clientX?new module$exports$Blockly$utils$Coordinate.Coordinate(a.clientX,a.clientY):null;(0,module$exports$Blockly$dropDownDiv.clearContent)();this.menu_.render((0,module$exports$Blockly$dropDownDiv.getContentDiv)());a=this.menu_.getElement();(0,module$exports$Blockly$utils$dom.addClass)(a,"blocklyDropdownMenu");if(this.getConstants().FIELD_DROPDOWN_COLOURED_DIV){a=
|
|
918
|
+
this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().getColour():this.sourceBlock_.getColour();var b=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;(0,module$exports$Blockly$dropDownDiv.setColour)(a,b)}(0,module$exports$Blockly$dropDownDiv.showPositionedByField)(this,this.dropdownDispose_.bind(this));this.menu_.focus();this.selectedMenuItem_&&this.menu_.setHighlighted(this.selectedMenuItem_);this.applyColour()};
|
|
919
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.dropdownCreate_=function(){var a=new module$exports$Blockly$Menu.Menu;a.setRole(module$exports$Blockly$utils$aria.Role.LISTBOX);this.menu_=a;var b=this.getOptions(!1);this.selectedMenuItem_=null;for(var c=0;c<b.length;c++){var d=b[c][0],e=b[c][1];if("object"===typeof d){var f=new Image(d.width,d.height);f.src=d.src;f.alt=d.alt||"";d=f}d=new module$exports$Blockly$MenuItem.MenuItem(d,e);d.setRole(module$exports$Blockly$utils$aria.Role.OPTION);
|
|
920
|
+
d.setRightToLeft(this.sourceBlock_.RTL);d.setCheckable(!0);a.addChild(d);d.setChecked(e===this.value_);e===this.value_&&(this.selectedMenuItem_=d);d.onAction(this.handleMenuActionEvent_,this)}};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.dropdownDispose_=function(){this.menu_&&this.menu_.dispose();this.selectedMenuItem_=this.menu_=null;this.applyColour()};
|
|
921
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.handleMenuActionEvent_=function(a){(0,module$exports$Blockly$dropDownDiv.hideIfOwner)(this,!0);this.onItemSelected_(this.menu_,a)};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.onItemSelected_=function(a,b){this.setValue(b.getValue())};
|
|
922
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.trimOptions_=function(){var a=this.menuGenerator_;if(Array.isArray(a)){for(var b=!1,c=0;c<a.length;c++){var d=a[c][0];"string"===typeof d?a[c][0]=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(d):(null!==d.alt&&(a[c][0].alt=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(d.alt)),b=!0)}if(!(b||2>a.length)){b=[];for(c=0;c<a.length;c++)b.push(a[c][0]);c=(0,$.module$exports$Blockly$utils$string.shortestStringLength)(b);
|
|
923
|
+
d=(0,$.module$exports$Blockly$utils$string.commonWordPrefix)(b,c);var e=(0,$.module$exports$Blockly$utils$string.commonWordSuffix)(b,c);!d&&!e||c<=d+e||(d&&(this.prefixField=b[0].substring(0,d-1)),e&&(this.suffixField=b[0].substr(1-e)),this.menuGenerator_=$.module$exports$Blockly$FieldDropdown.FieldDropdown.applyTrim_(a,d,e))}}};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.isOptionListDynamic=function(){return"function"===typeof this.menuGenerator_};
|
|
924
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.getOptions=function(a){return this.isOptionListDynamic()?(this.generatedOptions_&&a||(this.generatedOptions_=this.menuGenerator_.call(this),module$contents$Blockly$FieldDropdown_validateOptions(this.generatedOptions_)),this.generatedOptions_):this.menuGenerator_};
|
|
925
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.doClassValidation_=function(a){for(var b=!1,c=this.getOptions(!0),d=0,e;e=c[d];d++)if(e[1]===a){b=!0;break}return b?a:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+a),null)};
|
|
926
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.doValueUpdate_=function(a){module$exports$Blockly$Field.Field.prototype.doValueUpdate_.call(this,a);a=this.getOptions(!0);for(var b=0,c;c=a[b];b++)c[1]===this.value_&&(this.selectedOption_=c)};
|
|
927
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.applyColour=function(){this.borderRect_&&(this.borderRect_.setAttribute("stroke",this.sourceBlock_.style.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",this.sourceBlock_.style.colourTertiary):this.borderRect_.setAttribute("fill","transparent"));this.sourceBlock_&&this.arrow_&&(this.sourceBlock_.isShadow()?this.arrow_.style.fill=this.sourceBlock_.style.colourSecondary:this.arrow_.style.fill=this.sourceBlock_.style.colourPrimary)};
|
|
928
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.render_=function(){this.textContent_.nodeValue="";this.imageElement_.style.display="none";var a=this.selectedOption_&&this.selectedOption_[0];a&&"object"===typeof a?this.renderSelectedImage_(a):this.renderSelectedText_();this.positionBorderRect_()};
|
|
929
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.renderSelectedImage_=function(a){this.imageElement_.style.display="";this.imageElement_.setAttributeNS(module$exports$Blockly$utils$dom.XLINK_NS,"xlink:href",a.src);this.imageElement_.setAttribute("height",a.height);this.imageElement_.setAttribute("width",a.width);var b=Number(a.height);a=Number(a.width);var c=!!this.borderRect_,d=Math.max(c?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,b+module$contents$Blockly$FieldDropdown_IMAGE_Y_PADDING);
|
|
930
|
+
c=c?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var e=this.svgArrow_?this.positionSVGArrow_(a+c,d/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):(0,module$exports$Blockly$utils$dom.getFastTextWidth)(this.arrow_,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);this.size_.width=a+e+2*c;this.size_.height=d;var f=0;this.sourceBlock_.RTL?this.imageElement_.setAttribute("x",c+e):(f=a+e,this.textElement_.setAttribute("text-anchor",
|
|
931
|
+
"end"),this.imageElement_.setAttribute("x",c));this.imageElement_.setAttribute("y",d/2-b/2);this.positionTextElement_(f+c,a+e)};
|
|
932
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.renderSelectedText_=function(){this.textContent_.nodeValue=this.getDisplayText_();(0,module$exports$Blockly$utils$dom.addClass)(this.textElement_,"blocklyDropdownText");this.textElement_.setAttribute("text-anchor","start");var a=!!this.borderRect_,b=Math.max(a?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT),c=(0,module$exports$Blockly$utils$dom.getFastTextWidth)(this.textElement_,this.getConstants().FIELD_TEXT_FONTSIZE,
|
|
933
|
+
this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);a=a?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var d=0;this.svgArrow_&&(d=this.positionSVGArrow_(c+a,b/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2));this.size_.width=c+d+2*a;this.size_.height=b;this.positionTextElement_(a,c)};
|
|
934
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.positionSVGArrow_=function(a,b){if(!this.svgArrow_)return 0;var c=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,d=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,e=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;this.svgArrow_.setAttribute("transform","translate("+(this.sourceBlock_.RTL?c:a+d)+","+b+")");return e+d};
|
|
935
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.getText_=function(){if(!this.selectedOption_)return null;var a=this.selectedOption_[0];return"object"===typeof a?a.alt:a};$.module$exports$Blockly$FieldDropdown.FieldDropdown.fromJson=function(a){return new this(a.options,void 0,a)};$.module$exports$Blockly$FieldDropdown.FieldDropdown.applyTrim_=function(a,b,c){for(var d=[],e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];f=f.substring(b,f.length-c);d[e]=[f,g]}return d};var module$contents$Blockly$FieldDropdown_ImageProperties;
|
|
936
|
+
$.module$exports$Blockly$FieldDropdown.FieldDropdown.CHECKMARK_OVERHANG=25;$.module$exports$Blockly$FieldDropdown.FieldDropdown.MAX_MENU_HEIGHT_VH=.45;var module$contents$Blockly$FieldDropdown_IMAGE_Y_OFFSET=5,module$contents$Blockly$FieldDropdown_IMAGE_Y_PADDING=2*module$contents$Blockly$FieldDropdown_IMAGE_Y_OFFSET;$.module$exports$Blockly$FieldDropdown.FieldDropdown.ARROW_CHAR=module$exports$Blockly$utils$userAgent.ANDROID?"\u25bc":"\u25be";
|
|
937
|
+
var module$contents$Blockly$FieldDropdown_validateOptions=function(a){if(!Array.isArray(a))throw TypeError("FieldDropdown options must be an array.");if(!a.length)throw TypeError("FieldDropdown options must not be an empty array.");for(var b=!1,c=0;c<a.length;c++){var d=a[c];Array.isArray(d)?"string"!==typeof d[1]?(b=!0,console.error("Invalid option["+c+"]: Each FieldDropdown option id must be a string. Found "+d[1]+" in: ",d)):d[0]&&"string"!==typeof d[0]&&"string"!==typeof d[0].src&&(b=!0,console.error("Invalid option["+
|
|
938
|
+
c+"]: Each FieldDropdown option must have a string label or image description. Found"+d[0]+" in: ",d)):(b=!0,console.error("Invalid option["+c+"]: Each FieldDropdown option must be an array. Found: ",d))}if(b)throw TypeError("Found invalid FieldDropdown options.");};(0,module$exports$Blockly$fieldRegistry.register)("field_dropdown",$.module$exports$Blockly$FieldDropdown.FieldDropdown);var module$contents$Blockly$Extensions_allExtensions;$.module$exports$Blockly$Extensions={};module$contents$Blockly$Extensions_allExtensions=Object.create(null);$.module$exports$Blockly$Extensions.TEST_ONLY={allExtensions:module$contents$Blockly$Extensions_allExtensions};
|
|
885
939
|
$.module$exports$Blockly$Extensions.register=function(a,b){if("string"!==typeof a||""===a.trim())throw Error('Error: Invalid extension name "'+a+'"');if(module$contents$Blockly$Extensions_allExtensions[a])throw Error('Error: Extension "'+a+'" is already registered.');if("function"!==typeof b)throw Error('Error: Extension "'+a+'" must be a function');module$contents$Blockly$Extensions_allExtensions[a]=b};
|
|
886
940
|
$.module$exports$Blockly$Extensions.registerMixin=function(a,b){if(!b||"object"!==typeof b)throw Error('Error: Mixin "'+a+'" must be a object');(0,$.module$exports$Blockly$Extensions.register)(a,function(){this.mixin(b)})};
|
|
887
941
|
$.module$exports$Blockly$Extensions.registerMutator=function(a,b,c,d){var e='Error when registering mutator "'+a+'": ';module$contents$Blockly$Extensions_checkHasMutatorProperties(e,b);var f=module$contents$Blockly$Extensions_checkMutatorDialog(b,e);if(c&&"function"!==typeof c)throw Error(e+'Extension "'+a+'" is not a function');(0,$.module$exports$Blockly$Extensions.register)(a,function(){if(f){var g=$.module$exports$Blockly$Mutator.Mutator;if(!g)throw Error(e+"Missing require for Blockly.Mutator");
|
|
@@ -895,9 +949,9 @@ b.push(a.domToMutation);void 0!==a.mutationToDom&&b.push(a.mutationToDom);void 0
|
|
|
895
949
|
$.module$exports$Blockly$Extensions.runAfterPageLoad=function(a){if("object"!==typeof document)throw Error("runAfterPageLoad() requires browser document.");if("complete"===document.readyState)a();else var b=setInterval(function(){"complete"===document.readyState&&(clearInterval(b),a())},10)};
|
|
896
950
|
$.module$exports$Blockly$Extensions.buildTooltipForDropdown=function(a,b){var c=[];"object"===typeof document&&(0,$.module$exports$Blockly$Extensions.runAfterPageLoad)(function(){for(var d in b)(0,module$exports$Blockly$utils$parsing.checkMessageReferences)(b[d])});return function(){this.type&&-1===c.indexOf(this.type)&&(module$contents$Blockly$Extensions_checkDropdownOptionsInTable(this,a,b),c.push(this.type));this.setTooltip(function(){var d=String(this.getFieldValue(a)),e=b[d];null===e?-1===c.indexOf(this.type)&&
|
|
897
951
|
(d="No tooltip mapping for value "+d+" of field "+a,null!==this.type&&(d+=" of block type "+this.type),console.warn(d+".")):e=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(e);return e}.bind(this))}};
|
|
898
|
-
var module$contents$Blockly$Extensions_checkDropdownOptionsInTable=function(a,b,c){var d=a.getField(b);if(
|
|
952
|
+
var module$contents$Blockly$Extensions_checkDropdownOptionsInTable=function(a,b,c){var d=a.getField(b);if(d instanceof $.module$exports$Blockly$FieldDropdown.FieldDropdown&&!d.isOptionListDynamic()){d=d.getOptions();for(var e=0;e<d.length;e++){var f=d[e][1];null===c[f]&&console.warn("No tooltip mapping for value "+f+" of field "+b+" of block type "+a.type)}}};
|
|
899
953
|
$.module$exports$Blockly$Extensions.buildTooltipWithFieldText=function(a,b){"object"===typeof document&&(0,$.module$exports$Blockly$Extensions.runAfterPageLoad)(function(){(0,module$exports$Blockly$utils$parsing.checkMessageReferences)(a)});return function(){this.setTooltip(function(){var c=this.getField(b);return(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a).replace("%1",c?c.getText():"")}.bind(this))}};
|
|
900
|
-
var module$contents$Blockly$Extensions_extensionParentTooltip=function(){
|
|
954
|
+
var module$contents$Blockly$Extensions_extensionParentTooltip=function(){var a=this.tooltip;this.setTooltip(function(){var b=this.getParent();return b&&b.getInputsInline()&&b.tooltip||a}.bind(this))};(0,$.module$exports$Blockly$Extensions.register)("parent_tooltip_when_inline",module$contents$Blockly$Extensions_extensionParentTooltip);var module$exports$Blockly$utils$Metrics={Metrics:function(){}};var module$exports$Blockly$utils={aria:module$exports$Blockly$utils$aria,colour:module$exports$Blockly$utils$colour};module$exports$Blockly$utils.Coordinate=module$exports$Blockly$utils$Coordinate.Coordinate;module$exports$Blockly$utils.deprecation=module$exports$Blockly$utils$deprecation;module$exports$Blockly$utils.dom=module$exports$Blockly$utils$dom;module$exports$Blockly$utils.global=$.module$exports$Blockly$utils$global.globalThis;module$exports$Blockly$utils.idGenerator=module$exports$Blockly$utils$idGenerator;
|
|
901
955
|
module$exports$Blockly$utils.KeyCodes=module$exports$Blockly$utils$KeyCodes.KeyCodes;module$exports$Blockly$utils.math=module$exports$Blockly$utils$math;module$exports$Blockly$utils.Metrics=module$exports$Blockly$utils$Metrics.Metrics;module$exports$Blockly$utils.object=$.module$exports$Blockly$utils$object;module$exports$Blockly$utils.parsing=module$exports$Blockly$utils$parsing;module$exports$Blockly$utils.Rect=module$exports$Blockly$utils$Rect.Rect;module$exports$Blockly$utils.Size=module$exports$Blockly$utils$Size.Size;
|
|
902
956
|
module$exports$Blockly$utils.string=$.module$exports$Blockly$utils$string;module$exports$Blockly$utils.style=module$exports$Blockly$utils$style;module$exports$Blockly$utils.Svg=module$exports$Blockly$utils$Svg.Svg;module$exports$Blockly$utils.svgPaths=module$exports$Blockly$utils$svgPaths;module$exports$Blockly$utils.svgMath=module$exports$Blockly$utils$svgMath;module$exports$Blockly$utils.toolbox=module$exports$Blockly$utils$toolbox;module$exports$Blockly$utils.userAgent=module$exports$Blockly$utils$userAgent;
|
|
903
957
|
module$exports$Blockly$utils.xml=$.module$exports$Blockly$utils$xml;module$exports$Blockly$utils.noEvent=function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.utils.noEvent","September 2021","September 2022");a.preventDefault();a.stopPropagation()};module$exports$Blockly$utils.isTargetInput=function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.utils.isTargetInput","September 2021","September 2022","Blockly.browserEvents.isTargetInput");return(0,module$exports$Blockly$browserEvents.isTargetInput)(a)};
|
|
@@ -917,8 +971,9 @@ module$exports$Blockly$Events$BlockDelete.BlockDelete.prototype.fromJson=functio
|
|
|
917
971
|
module$exports$Blockly$Events$BlockDelete.BlockDelete.prototype.run=function(a){var b=this.getEventWorkspace_();if(a)for(a=0;a<this.ids.length;a++){var c=this.ids[a],d=b.getBlockById(c);d?d.dispose(!1):c===this.blockId&&console.warn("Can't delete non-existent block: "+c)}else(0,module$exports$Blockly$serialization$blocks.append)(this.oldJson,b)};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.DELETE,module$exports$Blockly$Events$BlockDelete.BlockDelete);var module$exports$Blockly$Block={Block:function(a,b,c){var d=$.module$exports$Blockly$Generator.Generator;if(d&&"undefined"!==typeof d.prototype[b])throw Error('Block prototypeName "'+b+'" conflicts with Blockly.Generator members.');this.data=null;this.disposed=!1;this.hue_=null;this.colour_="#000000";this.styleName_="";this.loadExtraState=this.saveExtraState=this.domToMutation=this.mutationToDom=this.init=void 0;this.suppressPrefixSuffix=!1;this.getDeveloperVariables=void 0;this.id=c&&!a.getBlockById(c)?
|
|
918
972
|
c:(0,module$exports$Blockly$utils$idGenerator.genUid)();a.setBlockById(this.id,this);this.previousConnection=this.nextConnection=this.outputConnection=null;this.inputList=[];this.inputsInline=void 0;this.disabled=!1;this.tooltip="";this.contextMenu=!0;this.parentBlock_=null;this.childBlocks_=[];this.editable_=this.movable_=this.deletable_=!0;this.collapsed_=this.isShadow_=!1;this.comment=this.outputShape_=null;this.commentModel={text:null,pinned:!1,size:new module$exports$Blockly$utils$Size.Size(160,
|
|
919
973
|
80)};this.xy_=new module$exports$Blockly$utils$Coordinate.Coordinate(0,0);this.workspace=a;this.isInFlyout=a.isFlyout;this.isInMutator=a.isMutator;this.RTL=a.RTL;this.isInsertionMarker_=!1;this.hat=void 0;this.onchangeWrapper_=this.helpUrl=this.rendered=null;this.statementInputCount=0;if(b){this.type=b;c=module$exports$Blockly$blocks.Blocks[b];if(!c||"object"!==typeof c)throw TypeError("Invalid block definition for type: "+b);(0,$.module$exports$Blockly$utils$object.mixin)(this,c)}a.addTopBlock(this);
|
|
920
|
-
a.addTypedBlock(this);
|
|
921
|
-
(0,module$exports$Blockly$Events$utils.setGroup)(!
|
|
974
|
+
a.addTypedBlock(this);this.constructor===module$exports$Blockly$Block.Block&&this.doInit_()}};
|
|
975
|
+
module$exports$Blockly$Block.Block.prototype.doInit_=function(){var a=(0,module$exports$Blockly$Events$utils.getGroup)();a||(0,module$exports$Blockly$Events$utils.setGroup)(!0);var b=(0,module$exports$Blockly$Events$utils.getRecordUndo)();try{"function"===typeof this.init&&((0,module$exports$Blockly$Events$utils.setRecordUndo)(!1),this.init(),(0,module$exports$Blockly$Events$utils.setRecordUndo)(b)),(0,module$exports$Blockly$Events$utils.isEnabled)()&&(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CREATE))(this))}finally{a||
|
|
976
|
+
(0,module$exports$Blockly$Events$utils.setGroup)(!1),(0,module$exports$Blockly$Events$utils.setRecordUndo)(b)}this.inputsInlineDefault=this.inputsInline;"function"===typeof this.onchange&&this.setOnChange(this.onchange)};
|
|
922
977
|
module$exports$Blockly$Block.Block.prototype.dispose=function(a){if(this.workspace){this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_);this.unplug(a);(0,module$exports$Blockly$Events$utils.isEnabled)()&&(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.DELETE))(this));(0,module$exports$Blockly$Events$utils.disable)();try{this.workspace&&(this.workspace.removeTopBlock(this),this.workspace.removeTypedBlock(this),
|
|
923
978
|
this.workspace.removeBlockById(this.id),this.workspace=null);(0,$.module$exports$Blockly$common.getSelected)()===this&&(0,$.module$exports$Blockly$common.setSelected)(null);for(var b=this.childBlocks_.length-1;0<=b;b--)this.childBlocks_[b].dispose(!1);a=0;for(b=void 0;b=this.inputList[a];a++)b.dispose();this.inputList.length=0;var c=this.getConnections_(!0);a=0;for(b=void 0;b=c[a];a++)b.dispose()}finally{(0,module$exports$Blockly$Events$utils.enable)(),this.disposed=!0}}};
|
|
924
979
|
module$exports$Blockly$Block.Block.prototype.initModel=function(){for(var a=0,b;b=this.inputList[a];a++)for(var c=0,d;d=b.fieldRow[c];c++)d.initModel&&d.initModel()};module$exports$Blockly$Block.Block.prototype.unplug=function(a){this.outputConnection&&this.unplugFromRow_(a);this.previousConnection&&this.unplugFromStack_(a)};
|
|
@@ -974,10 +1029,10 @@ module$exports$Blockly$Block.Block.prototype.getInputTargetBlock=function(a){ret
|
|
|
974
1029
|
module$exports$Blockly$Block.Block.prototype.setCommentText=function(a){this.commentModel.text!==a&&((0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CHANGE))(this,"comment",null,this.commentModel.text,a)),this.comment=this.commentModel.text=a)};module$exports$Blockly$Block.Block.prototype.setWarningText=function(a,b){};module$exports$Blockly$Block.Block.prototype.setMutator=function(a){};
|
|
975
1030
|
module$exports$Blockly$Block.Block.prototype.getRelativeToSurfaceXY=function(){return this.xy_};module$exports$Blockly$Block.Block.prototype.moveBy=function(a,b){if(this.parentBlock_)throw Error("Block has parent.");var c=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.MOVE))(this);this.xy_.translate(a,b);c.recordNew();(0,module$exports$Blockly$Events$utils.fire)(c)};
|
|
976
1031
|
module$exports$Blockly$Block.Block.prototype.makeConnection_=function(a){return new module$exports$Blockly$Connection.Connection(this,a)};module$exports$Blockly$Block.Block.prototype.allInputsFilled=function(a){void 0===a&&(a=!0);if(!a&&this.isShadow())return!1;for(var b=0,c;c=this.inputList[b];b++)if(c.connection&&(c=c.connection.targetBlock(),!c||!c.allInputsFilled(a)))return!1;return(b=this.getNextBlock())?b.allInputsFilled(a):!0};
|
|
977
|
-
module$exports$Blockly$Block.Block.prototype.toDevString=function(){var a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a};var module$exports$Blockly$ContextMenuRegistry={ContextMenuRegistry:function(){module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.
|
|
978
|
-
module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.prototype.
|
|
979
|
-
module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.prototype.
|
|
980
|
-
module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.
|
|
1032
|
+
module$exports$Blockly$Block.Block.prototype.toDevString=function(){var a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a};module$exports$Blockly$Block.Block.COLLAPSED_INPUT_NAME=module$exports$Blockly$constants.COLLAPSED_INPUT_NAME;module$exports$Blockly$Block.Block.COLLAPSED_FIELD_NAME=module$exports$Blockly$constants.COLLAPSED_FIELD_NAME;var module$exports$Blockly$ContextMenuRegistry={ContextMenuRegistry:function(){this.reset()}};module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.prototype.reset=function(){this.registry_=Object.create(null)};module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.prototype.register=function(a){if(this.registry_[a.id])throw Error('Menu item with ID "'+a.id+'" is already registered.');this.registry_[a.id]=a};
|
|
1033
|
+
module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.prototype.unregister=function(a){if(!this.registry_[a])throw Error('Menu item with ID "'+a+'" not found.');delete this.registry_[a]};module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.prototype.getItem=function(a){return this.registry_[a]||null};
|
|
1034
|
+
module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.prototype.getContextMenuOptions=function(a,b){var c=[],d=this.registry_;Object.keys(d).forEach(function(e){e=d[e];if(a===e.scopeType){var f=e.preconditionFn(b);"hidden"!==f&&(e={text:"function"===typeof e.displayText?e.displayText(b):e.displayText,enabled:"enabled"===f,callback:e.callback,scope:b,weight:e.weight},c.push(e))}});c.sort(function(e,f){return e.weight-f.weight});return c};
|
|
1035
|
+
module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.ScopeType={BLOCK:"block",WORKSPACE:"workspace"};module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.registry=new module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry;var module$exports$Blockly$IBoundedElement={IBoundedElement:function(){}};var module$exports$Blockly$IMovable={IMovable:function(){}};var module$exports$Blockly$ISelectable={ISelectable:function(){}};var module$exports$Blockly$ICopyable={ICopyable:function(){}};var module$exports$Blockly$RenderedConnection={},module$contents$Blockly$RenderedConnection_BUMP_RANDOMNESS=10;
|
|
981
1036
|
module$exports$Blockly$RenderedConnection.RenderedConnection=function(a,b){module$exports$Blockly$Connection.Connection.call(this,a,b);this.db_=a.workspace.connectionDBList[b];this.dbOpposite_=a.workspace.connectionDBList[module$exports$Blockly$internalConstants.OPPOSITE_TYPE[b]];this.offsetInBlock_=new module$exports$Blockly$utils$Coordinate.Coordinate(0,0);this.trackedState_=module$exports$Blockly$RenderedConnection.RenderedConnection.TrackedState.WILL_TRACK;this.targetConnection=null};
|
|
982
1037
|
$.$jscomp.inherits(module$exports$Blockly$RenderedConnection.RenderedConnection,module$exports$Blockly$Connection.Connection);module$exports$Blockly$RenderedConnection.RenderedConnection.prototype.dispose=function(){module$exports$Blockly$Connection.Connection.prototype.dispose.call(this);this.trackedState_===module$exports$Blockly$RenderedConnection.RenderedConnection.TrackedState.TRACKED&&this.db_.removeConnection(this,this.y)};
|
|
983
1038
|
module$exports$Blockly$RenderedConnection.RenderedConnection.prototype.getSourceBlock=function(){return module$exports$Blockly$Connection.Connection.prototype.getSourceBlock.call(this)};module$exports$Blockly$RenderedConnection.RenderedConnection.prototype.targetBlock=function(){return module$exports$Blockly$Connection.Connection.prototype.targetBlock.call(this)};
|
|
@@ -1011,20 +1066,20 @@ module$exports$Blockly$BasicCursor.BasicCursor.prototype.prev=function(){var a=t
|
|
|
1011
1066
|
module$exports$Blockly$BasicCursor.BasicCursor.prototype.getNextNode_=function(a,b){if(!a)return null;var c=a.in()||a.next();if(b(c))return c;if(c)return this.getNextNode_(c,b);a=this.findSiblingOrParent_(a.out());return b(a)?a:a?this.getNextNode_(a,b):null};module$exports$Blockly$BasicCursor.BasicCursor.prototype.getPreviousNode_=function(a,b){if(!a)return null;var c=a.prev();c=c?this.getRightMostChild_(c):a.out();return b(c)?c:c?this.getPreviousNode_(c,b):null};
|
|
1012
1067
|
module$exports$Blockly$BasicCursor.BasicCursor.prototype.validNode_=function(a){var b=!1;a=a&&a.getType();if(a===module$exports$Blockly$ASTNode.ASTNode.types.OUTPUT||a===module$exports$Blockly$ASTNode.ASTNode.types.INPUT||a===module$exports$Blockly$ASTNode.ASTNode.types.FIELD||a===module$exports$Blockly$ASTNode.ASTNode.types.NEXT||a===module$exports$Blockly$ASTNode.ASTNode.types.PREVIOUS||a===module$exports$Blockly$ASTNode.ASTNode.types.WORKSPACE)b=!0;return b};
|
|
1013
1068
|
module$exports$Blockly$BasicCursor.BasicCursor.prototype.findSiblingOrParent_=function(a){if(!a)return null;var b=a.next();return b?b:this.findSiblingOrParent_(a.out())};module$exports$Blockly$BasicCursor.BasicCursor.prototype.getRightMostChild_=function(a){if(!a.in())return a;for(a=a.in();a.next();)a=a.next();return this.getRightMostChild_(a)};module$exports$Blockly$BasicCursor.BasicCursor.registrationName="basicCursor";
|
|
1014
|
-
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.CURSOR,module$exports$Blockly$BasicCursor.BasicCursor.registrationName,module$exports$Blockly$BasicCursor.BasicCursor);var module$exports$Blockly$TabNavigateCursor={TabNavigateCursor:function(){module$exports$Blockly$BasicCursor.BasicCursor.
|
|
1069
|
+
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.CURSOR,module$exports$Blockly$BasicCursor.BasicCursor.registrationName,module$exports$Blockly$BasicCursor.BasicCursor);var module$exports$Blockly$TabNavigateCursor={TabNavigateCursor:function(){module$exports$Blockly$BasicCursor.BasicCursor.apply(this,arguments)}};$.$jscomp.inherits(module$exports$Blockly$TabNavigateCursor.TabNavigateCursor,module$exports$Blockly$BasicCursor.BasicCursor);
|
|
1015
1070
|
module$exports$Blockly$TabNavigateCursor.TabNavigateCursor.prototype.validNode_=function(a){var b=!1,c=a&&a.getType();a&&(a=a.getLocation(),c===module$exports$Blockly$ASTNode.ASTNode.types.FIELD&&a&&a.isTabNavigable()&&a.isClickable()&&(b=!0));return b};var module$exports$Blockly$Events$Selected={Selected:function(a,b,c){module$exports$Blockly$Events$UiBase.UiBase.call(this,c);this.oldElementId=a;this.newElementId=b;this.type=module$exports$Blockly$Events$utils.SELECTED}};$.$jscomp.inherits(module$exports$Blockly$Events$Selected.Selected,module$exports$Blockly$Events$UiBase.UiBase);
|
|
1016
1071
|
module$exports$Blockly$Events$Selected.Selected.prototype.toJson=function(){var a=module$exports$Blockly$Events$UiBase.UiBase.prototype.toJson.call(this);a.oldElementId=this.oldElementId;a.newElementId=this.newElementId;return a};module$exports$Blockly$Events$Selected.Selected.prototype.fromJson=function(a){module$exports$Blockly$Events$UiBase.UiBase.prototype.fromJson.call(this,a);this.oldElementId=a.oldElementId;this.newElementId=a.newElementId};
|
|
1017
|
-
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.SELECTED,module$exports$Blockly$Events$Selected.Selected);var module$exports$Blockly$BlockSvg={BlockSvg:function(a,b,c){this.
|
|
1018
|
-
this.
|
|
1019
|
-
this.svgGroup_.setAttribute("data-id",this.id)}}
|
|
1072
|
+
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.SELECTED,module$exports$Blockly$Events$Selected.Selected);var module$exports$Blockly$BlockSvg={BlockSvg:function(a,b,c){module$exports$Blockly$Block.Block.call(this,a,b,c);this.decompose=this.decompose;this.compose=this.compose;this.saveConnections=this.saveConnections;this.customContextMenu=this.customContextMenu;this.renderingDebugger=null;this.width=this.height=0;this.warning=this.commentIcon_=this.comment=this.mutator=this.warningTextDb_=null;this.svgGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,
|
|
1073
|
+
{},null);this.svgGroup_.translate_="";this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup_,this.style);this.eventsInit_=this.renderIsInProgress_=this.rendered=!1;this.useDragSurface_=(0,module$exports$Blockly$utils$svgMath.is3dSupported)()&&!!a.getBlockDragSurface();a=this.pathObject.svgPath;a.tooltip=this;(0,module$exports$Blockly$Tooltip.bindMouseEvents)(a);this.svgGroup_.dataset?this.svgGroup_.dataset.id=this.id:module$exports$Blockly$utils$userAgent.IE&&
|
|
1074
|
+
this.svgGroup_.setAttribute("data-id",this.id);this.doInit_()}};$.$jscomp.inherits(module$exports$Blockly$BlockSvg.BlockSvg,module$exports$Blockly$Block.Block);
|
|
1020
1075
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.initSvg=function(){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");for(var a=0,b;b=this.inputList[a];a++)b.init();a=this.getIcons();for(b=0;b<a.length;b++)a[b].createIcon();this.applyColour();this.pathObject.updateMovable(this.isMovable());a=this.getSvgRoot();this.workspace.options.readOnly||this.eventsInit_||!a||(0,module$exports$Blockly$browserEvents.conditionalBind)(a,"mousedown",this,this.onMouseDown_);this.eventsInit_=!0;
|
|
1021
1076
|
a.parentNode||this.workspace.getCanvas().appendChild(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getColourSecondary=function(){return this.style.colourSecondary};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getColourTertiary=function(){return this.style.colourTertiary};
|
|
1022
1077
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.select=function(){if(this.isShadow()&&this.getParent())this.getParent().select();else if((0,$.module$exports$Blockly$common.getSelected)()!==this){var a=null;if((0,$.module$exports$Blockly$common.getSelected)()){a=(0,$.module$exports$Blockly$common.getSelected)().id;(0,module$exports$Blockly$Events$utils.disable)();try{(0,$.module$exports$Blockly$common.getSelected)().unselect()}finally{(0,module$exports$Blockly$Events$utils.enable)()}}a=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.SELECTED))(a,
|
|
1023
1078
|
this.id,this.workspace.id);(0,module$exports$Blockly$Events$utils.fire)(a);(0,$.module$exports$Blockly$common.setSelected)(this);this.addSelect()}};
|
|
1024
1079
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.unselect=function(){if((0,$.module$exports$Blockly$common.getSelected)()===this){var a=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.SELECTED))(this.id,null,this.workspace.id);a.workspaceId=this.workspace.id;(0,module$exports$Blockly$Events$utils.fire)(a);(0,$.module$exports$Blockly$common.setSelected)(null);this.removeSelect()}};
|
|
1025
1080
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.getIcons=function(){var a=[];this.mutator&&a.push(this.mutator);this.commentIcon_&&a.push(this.commentIcon_);this.warning&&a.push(this.warning);return a};
|
|
1026
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setParent=function(a){var b=this.parentBlock_;if(a!==b){(0,module$exports$Blockly$utils$dom.startTextWidthCache)();module$exports$Blockly$
|
|
1027
|
-
|
|
1081
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setParent=function(a){var b=this.parentBlock_;if(a!==b){(0,module$exports$Blockly$utils$dom.startTextWidthCache)();module$exports$Blockly$Block.Block.prototype.setParent.call(this,a);(0,module$exports$Blockly$utils$dom.stopTextWidthCache)();var c=this.getSvgRoot();if(!this.workspace.isClearing&&c){var d=this.getRelativeToSurfaceXY();a?(a.getSvgRoot().appendChild(c),a=this.getRelativeToSurfaceXY(),this.moveConnections(a.x-d.x,a.y-d.y)):b&&(this.workspace.getCanvas().appendChild(c),
|
|
1082
|
+
this.translate(d.x,d.y));this.applyColour()}}};
|
|
1028
1083
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.getRelativeToSurfaceXY=function(){var a=0,b=0,c=this.useDragSurface_?this.workspace.getBlockDragSurface().getGroup():null,d=this.getSvgRoot();if(d){do{var e=(0,module$exports$Blockly$utils$svgMath.getRelativeXY)(d);a+=e.x;b+=e.y;this.useDragSurface_&&this.workspace.getBlockDragSurface().getCurrentBlock()===d&&(e=this.workspace.getBlockDragSurface().getSurfaceTranslation(),a+=e.x,b+=e.y);d=d.parentNode}while(d&&d!==this.workspace.getCanvas()&&d!==
|
|
1029
1084
|
c)}return new module$exports$Blockly$utils$Coordinate.Coordinate(a,b)};
|
|
1030
1085
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.moveBy=function(a,b){if(this.parentBlock_)throw Error("Block has parent.");var c=(0,module$exports$Blockly$Events$utils.isEnabled)(),d;c&&(d=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.MOVE))(this));var e=this.getRelativeToSurfaceXY();this.translate(e.x+a,e.y+b);this.moveConnections(a,b);c&&(d.recordNew(),(0,module$exports$Blockly$Events$utils.fire)(d));this.workspace.resizeContents()};
|
|
@@ -1033,7 +1088,7 @@ module$exports$Blockly$BlockSvg.BlockSvg.prototype.moveTo=function(a){var b=this
|
|
|
1033
1088
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.moveDuringDrag=function(a){this.useDragSurface_?this.workspace.getBlockDragSurface().translateSurface(a.x,a.y):(this.svgGroup_.translate_="translate("+a.x+","+a.y+")",this.svgGroup_.setAttribute("transform",this.svgGroup_.translate_+this.svgGroup_.skew_))};module$exports$Blockly$BlockSvg.BlockSvg.prototype.clearTransformAttributes_=function(){this.getSvgRoot().removeAttribute("transform")};
|
|
1034
1089
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.snapToGrid=function(){if(this.workspace&&!this.workspace.isDragging()&&!this.getParent()&&!this.isInFlyout){var a=this.workspace.getGrid();if(a&&a.shouldSnap()){var b=a.getSpacing(),c=b/2,d=this.getRelativeToSurfaceXY();a=Math.round(Math.round((d.x-c)/b)*b+c-d.x);b=Math.round(Math.round((d.y-c)/b)*b+c-d.y);(a||b)&&this.moveBy(a,b)}}};
|
|
1035
1090
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.getBoundingRectangle=function(){var a=this.getRelativeToSurfaceXY(),b=this.getHeightWidth();if(this.RTL){var c=a.x-b.width;var d=a.x}else c=a.x,d=a.x+b.width;return new module$exports$Blockly$utils$Rect.Rect(a.y,a.y+b.height,c,d)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.markDirty=function(){this.pathObject.constants=this.workspace.getRenderer().getConstants();for(var a=0,b;b=this.inputList[a];a++)b.markDirty()};
|
|
1036
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setCollapsed=function(a){this.collapsed_!==a&&(module$exports$Blockly$
|
|
1091
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setCollapsed=function(a){this.collapsed_!==a&&(module$exports$Blockly$Block.Block.prototype.setCollapsed.call(this,a),a?this.rendered&&this.render():this.updateCollapsed_())};
|
|
1037
1092
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.updateCollapsed_=function(){for(var a=this.isCollapsed(),b=module$exports$Blockly$constants.COLLAPSED_INPUT_NAME,c=module$exports$Blockly$constants.COLLAPSED_FIELD_NAME,d=0,e;e=this.inputList[d];d++)e.name!==b&&e.setVisible(!a);if(a){a=this.getIcons();for(d=0;e=a[d];d++)e.setVisible(!1);a=this.toString(module$exports$Blockly$internalConstants.COLLAPSE_CHARS);(d=this.getField(c))?d.setValue(a):(this.getInput(b)||this.appendDummyInput(b)).appendField(new $.module$exports$Blockly$FieldLabel.FieldLabel(a),
|
|
1038
1093
|
c)}else this.updateDisabled(),this.removeInput(b)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.tab=function(a,b){var c=new module$exports$Blockly$TabNavigateCursor.TabNavigateCursor;c.setCurNode(module$exports$Blockly$ASTNode.ASTNode.createFieldNode(a));a=c.getCurNode();b?c.next():c.prev();(b=c.getCurNode())&&b!==a&&(b.getLocation().showEditor(),this.workspace.keyboardAccessibilityMode&&this.workspace.getCursor().setCurNode(b))};
|
|
1039
1094
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.onMouseDown_=function(a){var b=this.workspace&&this.workspace.getGesture(a);b&&b.handleBlockStart(a,this)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.showHelp=function(){var a="function"===typeof this.helpUrl?this.helpUrl():this.helpUrl;a&&window.open(a)};
|
|
@@ -1041,38 +1096,41 @@ module$exports$Blockly$BlockSvg.BlockSvg.prototype.generateContextMenu=function(
|
|
|
1041
1096
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.showContextMenu=function(a){var b=this.generateContextMenu();b&&b.length&&((0,$.module$exports$Blockly$ContextMenu.show)(a,b,this.RTL),(0,$.module$exports$Blockly$ContextMenu.setCurrentBlock)(this))};
|
|
1042
1097
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.moveConnections=function(a,b){if(this.rendered){for(var c=this.getConnections_(!1),d=0;d<c.length;d++)c[d].moveBy(a,b);c=this.getIcons();for(d=0;d<c.length;d++)c[d].computeIconLocation();for(c=0;c<this.childBlocks_.length;c++)this.childBlocks_[c].moveConnections(a,b)}};
|
|
1043
1098
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setDragging=function(a){if(a){var b=this.getSvgRoot();b.translate_="";b.skew_="";$.module$exports$Blockly$common.draggingConnections.push.apply($.module$exports$Blockly$common.draggingConnections,$.$jscomp.arrayFromIterable(this.getConnections_(!0)));(0,module$exports$Blockly$utils$dom.addClass)(this.svgGroup_,"blocklyDragging")}else $.module$exports$Blockly$common.draggingConnections.length=0,(0,module$exports$Blockly$utils$dom.removeClass)(this.svgGroup_,
|
|
1044
|
-
"blocklyDragging");for(b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setMovable=function(a){module$exports$Blockly$
|
|
1045
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setShadow=function(a){module$exports$Blockly$
|
|
1099
|
+
"blocklyDragging");for(b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setMovable=function(a){module$exports$Blockly$Block.Block.prototype.setMovable.call(this,a);this.pathObject.updateMovable(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setEditable=function(a){module$exports$Blockly$Block.Block.prototype.setEditable.call(this,a);a=this.getIcons();for(var b=0;b<a.length;b++)a[b].updateEditable()};
|
|
1100
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setShadow=function(a){module$exports$Blockly$Block.Block.prototype.setShadow.call(this,a);this.applyColour()};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setInsertionMarker=function(a){this.isInsertionMarker_!==a&&(this.isInsertionMarker_=a)&&(this.setColour(this.workspace.getRenderer().getConstants().INSERTION_MARKER_COLOUR),this.pathObject.updateInsertionMarker(!0))};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getSvgRoot=function(){return this.svgGroup_};
|
|
1046
1101
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.dispose=function(a,b){if(this.workspace){(0,module$exports$Blockly$Tooltip.dispose)();(0,module$exports$Blockly$Tooltip.unbindMouseEvents)(this.pathObject.svgPath);(0,module$exports$Blockly$utils$dom.startTextWidthCache)();var c=this.workspace;(0,$.module$exports$Blockly$common.getSelected)()===this&&(this.unselect(),this.workspace.cancelCurrentGesture());(0,$.module$exports$Blockly$ContextMenu.getCurrentBlock)()===this&&(0,$.module$exports$Blockly$ContextMenu.hide)();
|
|
1047
|
-
b&&this.rendered&&(this.unplug(a),(0,module$exports$Blockly$blockAnimations.disposeUiEffect)(this));this.rendered=!1;if(this.warningTextDb_){for(var d in this.warningTextDb_)clearTimeout(this.warningTextDb_[d]);this.warningTextDb_=null}b=this.getIcons();for(d=0;d<b.length;d++)b[d].dispose();module$exports$Blockly$
|
|
1102
|
+
b&&this.rendered&&(this.unplug(a),(0,module$exports$Blockly$blockAnimations.disposeUiEffect)(this));this.rendered=!1;if(this.warningTextDb_){for(var d in this.warningTextDb_)clearTimeout(this.warningTextDb_[d]);this.warningTextDb_=null}b=this.getIcons();for(d=0;d<b.length;d++)b[d].dispose();module$exports$Blockly$Block.Block.prototype.dispose.call(this,!!a);(0,module$exports$Blockly$utils$dom.removeNode)(this.svgGroup_);c.resizeContents();this.svgGroup_=null;(0,module$exports$Blockly$utils$dom.stopTextWidthCache)()}};
|
|
1048
1103
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.checkAndDelete=function(){this.workspace.isFlyout||((0,module$exports$Blockly$Events$utils.setGroup)(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),(0,module$exports$Blockly$Events$utils.setGroup)(!1))};
|
|
1049
1104
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.toCopyData=function(){return this.isInsertionMarker_?null:{saveInfo:(0,module$exports$Blockly$serialization$blocks.save)(this,{addCoordinates:!0,addNextBlocks:!1}),source:this.workspace,typeCounts:(0,$.module$exports$Blockly$common.getBlockTypeCounts)(this,!0)}};
|
|
1050
1105
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.applyColour=function(){this.pathObject.applyColour(this);for(var a=this.getIcons(),b=0;b<a.length;b++)a[b].applyColour();for(a=0;b=this.inputList[a];a++)for(var c=0,d;d=b.fieldRow[c];c++)d.applyColour()};module$exports$Blockly$BlockSvg.BlockSvg.prototype.updateDisabled=function(){var a=this.getChildren(!1);this.applyColour();if(!this.isCollapsed())for(var b=0,c;c=a[b];b++)c.rendered&&c.updateDisabled()};
|
|
1051
1106
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.getCommentIcon=function(){return this.commentIcon_};
|
|
1052
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setCommentText=function(a){var b=module$exports$Blockly$Comment.Comment;if(!b)throw Error("Missing require for Blockly.Comment");this.commentModel.text!==a&&(module$exports$Blockly$
|
|
1107
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setCommentText=function(a){var b=module$exports$Blockly$Comment.Comment;if(!b)throw Error("Missing require for Blockly.Comment");this.commentModel.text!==a&&(module$exports$Blockly$Block.Block.prototype.setCommentText.call(this,a),a=null!==a,!!this.commentIcon_===a?this.commentIcon_.updateText():(a?this.comment=this.commentIcon_=new b(this):(this.commentIcon_.dispose(),this.comment=this.commentIcon_=null),this.rendered&&(this.render(),this.bumpNeighbours())))};
|
|
1053
1108
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setWarningText=function(a,b){var c=module$exports$Blockly$Warning.Warning;if(!c)throw Error("Missing require for Blockly.Warning");this.warningTextDb_||(this.warningTextDb_=Object.create(null));var d=b||"";if(d)this.warningTextDb_[d]&&(clearTimeout(this.warningTextDb_[d]),delete this.warningTextDb_[d]);else{b=$.$jscomp.makeIterator(Object.keys(this.warningTextDb_));for(var e=b.next();!e.done;e=b.next())e=e.value,clearTimeout(this.warningTextDb_[e]),
|
|
1054
1109
|
delete this.warningTextDb_[e]}if(this.workspace.isDragging()){var f=this;this.warningTextDb_[d]=setTimeout(function(){f.workspace&&(delete f.warningTextDb_[d],f.setWarningText(a,d))},100)}else{this.isInFlyout&&(a=null);b=!1;if("string"===typeof a){e=this.getSurroundParent();for(var g=null;e;)e.isCollapsed()&&(g=e),e=e.getSurroundParent();g&&g.setWarningText($.module$exports$Blockly$Msg.Msg.COLLAPSED_WARNINGS_WARNING,module$exports$Blockly$BlockSvg.BlockSvg.COLLAPSED_WARNING_ID);this.warning||(this.warning=
|
|
1055
1110
|
new c(this),b=!0);this.warning.setText(a,d)}else this.warning&&!d?(this.warning.dispose(),b=!0):this.warning&&(c=this.warning.getText(),this.warning.setText("",d),(b=this.warning.getText())||this.warning.dispose(),b=c!==b);b&&this.rendered&&(this.render(),this.bumpNeighbours())}};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setMutator=function(a){this.mutator&&this.mutator!==a&&this.mutator.dispose();a&&(a.setBlock(this),this.mutator=a,a.createIcon());this.rendered&&(this.render(),this.bumpNeighbours())};
|
|
1056
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setEnabled=function(a){this.isEnabled()!==a&&(module$exports$Blockly$
|
|
1111
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setEnabled=function(a){this.isEnabled()!==a&&(module$exports$Blockly$Block.Block.prototype.setEnabled.call(this,a),this.rendered&&!this.getInheritedDisabled()&&this.updateDisabled())};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setHighlighted=function(a){this.rendered&&this.pathObject.updateHighlighted(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.addSelect=function(){this.pathObject.updateSelected(!0)};
|
|
1057
1112
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.removeSelect=function(){this.pathObject.updateSelected(!1)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setDeleteStyle=function(a){this.pathObject.updateDraggingDelete(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getColour=function(){return this.style.colourPrimary};
|
|
1058
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setColour=function(a){module$exports$Blockly$
|
|
1113
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setColour=function(a){module$exports$Blockly$Block.Block.prototype.setColour.call(this,a);a=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_);this.pathObject.setStyle(a.style);this.style=a.style;this.styleName_=a.name;this.applyColour()};
|
|
1059
1114
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setStyle=function(a){var b=this.workspace.getRenderer().getConstants().getBlockStyle(a);this.styleName_=a;if(b)this.hat=b.hat,this.pathObject.setStyle(b),this.colour_=b.colourPrimary,this.style=b,this.applyColour();else throw Error("Invalid style name: "+a);};module$exports$Blockly$BlockSvg.BlockSvg.prototype.bringToFront=function(){var a=this;do{var b=a.getSvgRoot(),c=b.parentNode,d=c.childNodes;d[d.length-1]!==b&&c.appendChild(b);a=a.getParent()}while(a)};
|
|
1060
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setPreviousStatement=function(a,b){module$exports$Blockly$
|
|
1061
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setOutput=function(a,b){module$exports$Blockly$
|
|
1062
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.removeInput=function(a,b){a=module$exports$Blockly$
|
|
1063
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.appendInput_=function(a,b){a=module$exports$Blockly$
|
|
1115
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setPreviousStatement=function(a,b){module$exports$Blockly$Block.Block.prototype.setPreviousStatement.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours())};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setNextStatement=function(a,b){module$exports$Blockly$Block.Block.prototype.setNextStatement.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours())};
|
|
1116
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setOutput=function(a,b){module$exports$Blockly$Block.Block.prototype.setOutput.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours())};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setInputsInline=function(a){module$exports$Blockly$Block.Block.prototype.setInputsInline.call(this,a);this.rendered&&(this.render(),this.bumpNeighbours())};
|
|
1117
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.removeInput=function(a,b){a=module$exports$Blockly$Block.Block.prototype.removeInput.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours());return a};module$exports$Blockly$BlockSvg.BlockSvg.prototype.moveNumberedInputBefore=function(a,b){module$exports$Blockly$Block.Block.prototype.moveNumberedInputBefore.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours())};
|
|
1118
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.appendInput_=function(a,b){a=module$exports$Blockly$Block.Block.prototype.appendInput_.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours());return a};
|
|
1064
1119
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setConnectionTracking=function(a){this.previousConnection&&this.previousConnection.setTracking(a);this.outputConnection&&this.outputConnection.setTracking(a);if(this.nextConnection){this.nextConnection.setTracking(a);var b=this.nextConnection.targetBlock();b&&b.setConnectionTracking(a)}if(!this.collapsed_)for(b=0;b<this.inputList.length;b++){var c=this.inputList[b].connection;c&&(c.setTracking(a),(c=c.targetBlock())&&c.setConnectionTracking(a))}};
|
|
1065
1120
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.getConnections_=function(a){var b=[];if(a||this.rendered)if(this.outputConnection&&b.push(this.outputConnection),this.previousConnection&&b.push(this.previousConnection),this.nextConnection&&b.push(this.nextConnection),a||!this.collapsed_){a=0;for(var c;c=this.inputList[a];a++)c.connection&&b.push(c.connection)}return b};
|
|
1066
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.lastConnectionInStack=function(a){return module$exports$Blockly$
|
|
1121
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.lastConnectionInStack=function(a){return module$exports$Blockly$Block.Block.prototype.lastConnectionInStack.call(this,a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getMatchingConnection=function(a,b){return module$exports$Blockly$Block.Block.prototype.getMatchingConnection.call(this,a,b)};
|
|
1067
1122
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.makeConnection_=function(a){return new module$exports$Blockly$RenderedConnection.RenderedConnection(this,a)};
|
|
1068
1123
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.bumpNeighbours=function(){if(this.workspace&&!this.workspace.isDragging()){var a=this.getRootBlock();if(!a.isInFlyout)for(var b=this.getConnections_(!1),c=0,d;d=b[c];c++){var e=d;e.isConnected()&&e.isSuperior()&&e.targetBlock().bumpNeighbours();d=d.neighbours($.module$exports$Blockly$config.config.snapRadius);for(var f=0,g;g=d[f];f++)e.isConnected()&&g.isConnected()||g.getSourceBlock().getRootBlock()!==a&&(e.isSuperior()?g.bumpAwayFrom(e):e.bumpAwayFrom(g))}}};
|
|
1069
1124
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.scheduleSnapAndBump=function(){var a=this,b=(0,module$exports$Blockly$Events$utils.getGroup)();setTimeout(function(){(0,module$exports$Blockly$Events$utils.setGroup)(b);a.snapToGrid();(0,module$exports$Blockly$Events$utils.setGroup)(!1)},$.module$exports$Blockly$config.config.bumpDelay/2);setTimeout(function(){(0,module$exports$Blockly$Events$utils.setGroup)(b);a.bumpNeighbours();(0,module$exports$Blockly$Events$utils.setGroup)(!1)},$.module$exports$Blockly$config.config.bumpDelay)};
|
|
1070
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.positionNearConnection=function(a,b){a.type!==$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT&&a.type!==$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE||this.moveBy(b.x-a.x,b.y-a.y)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getParent=function(){return module$exports$Blockly$
|
|
1125
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.positionNearConnection=function(a,b){a.type!==$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT&&a.type!==$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE||this.moveBy(b.x-a.x,b.y-a.y)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getParent=function(){return module$exports$Blockly$Block.Block.prototype.getParent.call(this)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getSurroundParent=function(){return module$exports$Blockly$Block.Block.prototype.getSurroundParent.call(this)};
|
|
1126
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.getNextBlock=function(){return module$exports$Blockly$Block.Block.prototype.getNextBlock.call(this)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getPreviousBlock=function(){return module$exports$Blockly$Block.Block.prototype.getPreviousBlock.call(this)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getFirstStatementConnection=function(){return module$exports$Blockly$Block.Block.prototype.getFirstStatementConnection.call(this)};
|
|
1127
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.getTopStackBlock=function(){return module$exports$Blockly$Block.Block.prototype.getTopStackBlock.call(this)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getChildren=function(a){return module$exports$Blockly$Block.Block.prototype.getChildren.call(this,a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getDescendants=function(a){return module$exports$Blockly$Block.Block.prototype.getDescendants.call(this,a)};
|
|
1128
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.getInputTargetBlock=function(a){return module$exports$Blockly$Block.Block.prototype.getInputTargetBlock.call(this,a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getRootBlock=function(){return module$exports$Blockly$Block.Block.prototype.getRootBlock.call(this)};
|
|
1071
1129
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.render=function(a){if(!this.renderIsInProgress_){this.renderIsInProgress_=!0;try{this.rendered=!0;(0,module$exports$Blockly$utils$dom.startTextWidthCache)();this.isCollapsed()&&this.updateCollapsed_();this.workspace.getRenderer().render(this);this.updateConnectionLocations_();if(!1!==a){var b=this.getParent();b?b.render(!0):this.workspace.resizeContents()}(0,module$exports$Blockly$utils$dom.stopTextWidthCache)();this.updateMarkers_()}finally{this.renderIsInProgress_=
|
|
1072
1130
|
!1}}};module$exports$Blockly$BlockSvg.BlockSvg.prototype.updateMarkers_=function(){this.workspace.keyboardAccessibilityMode&&this.pathObject.cursorSvg&&this.workspace.getCursor().draw();this.workspace.keyboardAccessibilityMode&&this.pathObject.markerSvg&&this.workspace.getMarker(module$exports$Blockly$MarkerManager.MarkerManager.LOCAL_MARKER).draw()};
|
|
1073
1131
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.updateConnectionLocations_=function(){var a=this.getRelativeToSurfaceXY();this.previousConnection&&this.previousConnection.moveToOffset(a);this.outputConnection&&this.outputConnection.moveToOffset(a);for(var b=0;b<this.inputList.length;b++){var c=this.inputList[b].connection;c&&(c.moveToOffset(a),c.isConnected()&&c.tighten())}this.nextConnection&&(this.nextConnection.moveToOffset(a),this.nextConnection.isConnected()&&this.nextConnection.tighten())};
|
|
1074
1132
|
module$exports$Blockly$BlockSvg.BlockSvg.prototype.setCursorSvg=function(a){this.pathObject.setCursorSvg(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.setMarkerSvg=function(a){this.pathObject.setMarkerSvg(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.getHeightWidth=function(){var a=this.height,b=this.width,c=this.getNextBlock();if(c){c=c.getHeightWidth();var d=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;a+=c.height-d;b=Math.max(b,c.width)}return{height:a,width:b}};
|
|
1075
|
-
module$exports$Blockly$BlockSvg.BlockSvg.prototype.fadeForReplacement=function(a){this.pathObject.updateReplacementFade(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.highlightShapeForInput=function(a,b){this.pathObject.updateShapeForInputHighlight(a,b)};var module$exports$Blockly$ConnectionDB={ConnectionDB:function(a){this.connections_=[];this.connectionChecker_=a}};module$exports$Blockly$ConnectionDB.ConnectionDB.prototype.addConnection=function(a,b){b=this.calculateIndexForYPos_(b);this.connections_.splice(b,0,a)};
|
|
1133
|
+
module$exports$Blockly$BlockSvg.BlockSvg.prototype.fadeForReplacement=function(a){this.pathObject.updateReplacementFade(a)};module$exports$Blockly$BlockSvg.BlockSvg.prototype.highlightShapeForInput=function(a,b){this.pathObject.updateShapeForInputHighlight(a,b)};module$exports$Blockly$BlockSvg.BlockSvg.INLINE=-1;module$exports$Blockly$BlockSvg.BlockSvg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var module$exports$Blockly$ConnectionDB={ConnectionDB:function(a){this.connections_=[];this.connectionChecker_=a}};module$exports$Blockly$ConnectionDB.ConnectionDB.prototype.addConnection=function(a,b){b=this.calculateIndexForYPos_(b);this.connections_.splice(b,0,a)};
|
|
1076
1134
|
module$exports$Blockly$ConnectionDB.ConnectionDB.prototype.findIndexOfConnection_=function(a,b){if(!this.connections_.length)return-1;var c=this.calculateIndexForYPos_(b);if(c>=this.connections_.length)return-1;b=a.y;for(var d=c;0<=d&&this.connections_[d].y===b;){if(this.connections_[d]===a)return d;d--}for(d=c;d<this.connections_.length&&this.connections_[d].y===b;){if(this.connections_[d]===a)return d;d++}return-1};
|
|
1077
1135
|
module$exports$Blockly$ConnectionDB.ConnectionDB.prototype.calculateIndexForYPos_=function(a){if(!this.connections_.length)return 0;for(var b=0,c=this.connections_.length;b<c;){var d=Math.floor((b+c)/2);if(this.connections_[d].y<a)b=d+1;else if(this.connections_[d].y>a)c=d;else{b=d;break}}return b};
|
|
1078
1136
|
module$exports$Blockly$ConnectionDB.ConnectionDB.prototype.removeConnection=function(a,b){a=this.findIndexOfConnection_(a,b);if(-1===a)throw Error("Unable to find connection in connectionDB.");this.connections_.splice(a,1)};
|
|
@@ -1115,8 +1173,8 @@ module$exports$Blockly$MetricsManager.MetricsManager.prototype.getPaddedContent_
|
|
|
1115
1173
|
module$exports$Blockly$MetricsManager.MetricsManager.prototype.getScrollMetrics=function(a,b,c){a=a?this.workspace_.scale:1;b=b||this.getViewMetrics(!1);var d=c||this.getContentMetrics();c=this.getComputedFixedEdges_(b);b=this.getPaddedContent_(b,d);d=void 0!==c.top?c.top:b.top;var e=void 0!==c.left?c.left:b.left;return{top:d/a,left:e/a,width:((void 0!==c.right?c.right:b.right)-e)/a,height:((void 0!==c.bottom?c.bottom:b.bottom)-d)/a}};
|
|
1116
1174
|
module$exports$Blockly$MetricsManager.MetricsManager.prototype.getUiMetrics=function(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}};
|
|
1117
1175
|
module$exports$Blockly$MetricsManager.MetricsManager.prototype.getMetrics=function(){var a=this.getToolboxMetrics(),b=this.getFlyoutMetrics(!0),c=this.getSvgMetrics(),d=this.getAbsoluteMetrics(),e=this.getViewMetrics(),f=this.getContentMetrics(),g=this.getScrollMetrics(!1,e,f);return{contentHeight:f.height,contentWidth:f.width,contentTop:f.top,contentLeft:f.left,scrollHeight:g.height,scrollWidth:g.width,scrollTop:g.top,scrollLeft:g.left,viewHeight:e.height,viewWidth:e.width,viewTop:e.top,viewLeft:e.left,
|
|
1118
|
-
absoluteTop:d.top,absoluteLeft:d.left,svgHeight:c.height,svgWidth:c.width,toolboxWidth:a.width,toolboxHeight:a.height,toolboxPosition:a.position,flyoutWidth:b.width,flyoutHeight:b.height}};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.METRICS_MANAGER,module$exports$Blockly$registry.DEFAULT,module$exports$Blockly$MetricsManager.MetricsManager);var module$exports$Blockly$WorkspaceSvg={WorkspaceSvg:function(a,b,c){module$exports$Blockly$Workspace.Workspace.call(this,a);this.resizeHandlerWrapper_=null;this.
|
|
1119
|
-
this.
|
|
1176
|
+
absoluteTop:d.top,absoluteLeft:d.left,svgHeight:c.height,svgWidth:c.width,toolboxWidth:a.width,toolboxHeight:a.height,toolboxPosition:a.position,flyoutWidth:b.width,flyoutHeight:b.height}};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.METRICS_MANAGER,module$exports$Blockly$registry.DEFAULT,module$exports$Blockly$MetricsManager.MetricsManager);var module$exports$Blockly$WorkspaceSvg={WorkspaceSvg:function(a,b,c){module$exports$Blockly$Workspace.Workspace.call(this,a);this.resizeHandlerWrapper_=null;this.resizesEnabled_=this.isVisible_=this.rendered=!0;this.startScrollY=this.startScrollX=this.scrollY=this.scrollX=0;this.dragDeltaXY_=null;this.oldScale_=this.scale=1;this.oldLeft_=this.oldTop_=0;this.workspaceDragSurface_=this.blockDragSurface_=this.currentGesture_=this.toolbox_=this.flyout_=this.scrollbar=this.trashcan=null;this.isDragSurfaceActive_=
|
|
1177
|
+
this.useWorkspaceDragSurface_=!1;this.inverseScreenCTM_=this.targetWorkspace=this.lastRecordedPageScroll_=this.injectionDiv_=null;this.inverseScreenCTMDirty_=!0;this.metricsManager_=new ((0,module$exports$Blockly$registry.getClassFromOptions)(module$exports$Blockly$registry.Type.METRICS_MANAGER,a,!0))(this);this.getMetrics=a.getMetrics||this.metricsManager_.getMetrics.bind(this.metricsManager_);this.setMetrics=a.setMetrics||module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.setTopLevelWorkspaceMetrics_;
|
|
1120
1178
|
this.componentManager_=new module$exports$Blockly$ComponentManager.ComponentManager;this.connectionDBList=module$exports$Blockly$ConnectionDB.ConnectionDB.init(this.connectionChecker);b&&(this.blockDragSurface_=b);c&&(this.workspaceDragSurface_=c);this.useWorkspaceDragSurface_=!!this.workspaceDragSurface_&&(0,module$exports$Blockly$utils$svgMath.is3dSupported)();this.highlightedBlocks_=[];this.audioManager_=new module$exports$Blockly$WorkspaceAudio.WorkspaceAudio(a.parentWorkspace);this.grid_=this.options.gridPattern?
|
|
1121
1179
|
new module$exports$Blockly$Grid.Grid(this.options.gridPattern,a.gridOptions):null;this.markerManager_=new module$exports$Blockly$MarkerManager.MarkerManager(this);this.toolboxCategoryCallbacks_=Object.create(null);this.flyoutButtonCallbacks_=Object.create(null);(a=$.module$exports$Blockly$Variables)&&a.flyoutCategory&&this.registerToolboxCategoryCallback(a.CATEGORY_NAME,a.flyoutCategory);(a=module$exports$Blockly$VariablesDynamic)&&a.flyoutCategory&&this.registerToolboxCategoryCallback(a.CATEGORY_NAME,
|
|
1122
1180
|
a.flyoutCategory);(a=$.module$exports$Blockly$Procedures)&&a.flyoutCategory&&(this.registerToolboxCategoryCallback(a.CATEGORY_NAME,a.flyoutCategory),this.addChangeListener(a.mutatorOpenListener));this.themeManager_=this.options.parentWorkspace?this.options.parentWorkspace.getThemeManager():new module$exports$Blockly$ThemeManager.ThemeManager(this,this.options.theme||module$exports$Blockly$Themes$Classic.Classic);this.themeManager_.subscribeWorkspace(this);this.renderer_=(0,module$exports$Blockly$blockRendering.init)(this.options.renderer||
|
|
@@ -1145,7 +1203,7 @@ this.options,!0))(b):new ((0,module$exports$Blockly$registry.getClassFromOptions
|
|
|
1145
1203
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getToolbox=function(){return this.toolbox_};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.updateScreenCalculations_=function(){this.updateInverseScreenCTM();this.recordDragTargets()};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.resizeContents=function(){this.resizesEnabled_&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())};
|
|
1146
1204
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.resize=function(){this.toolbox_&&this.toolbox_.position();this.flyout_&&this.flyout_.position();for(var a=this.componentManager_.getComponents(module$exports$Blockly$ComponentManager.ComponentManager.Capability.POSITIONABLE,!0),b=this.getMetricsManager().getUiMetrics(),c=[],d=0,e;e=a[d];d++)e.position(b,c),(e=e.getBoundingRectangle())&&c.push(e);this.scrollbar&&this.scrollbar.resize();this.updateScreenCalculations_()};
|
|
1147
1205
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.updateScreenCalculationsIfScrolled=function(){var a=(0,module$exports$Blockly$utils$svgMath.getDocumentScroll)();module$exports$Blockly$utils$Coordinate.Coordinate.equals(this.lastRecordedPageScroll_,a)||(this.lastRecordedPageScroll_=a,this.updateScreenCalculations_())};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getCanvas=function(){return this.svgBlockCanvas_};
|
|
1148
|
-
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.setCachedParentSvgSize=function(a,b){var c=this.getParentSvg();a&&(this.cachedParentSvgSize_.width=a,c.cachedWidth_=a);b&&(this.cachedParentSvgSize_.height=b,c.cachedHeight_=b)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getBubbleCanvas=function(){return this.svgBubbleCanvas_};
|
|
1206
|
+
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.setCachedParentSvgSize=function(a,b){var c=this.getParentSvg();null!=a&&(this.cachedParentSvgSize_.width=a,c.cachedWidth_=a);null!=b&&(this.cachedParentSvgSize_.height=b,c.cachedHeight_=b)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getBubbleCanvas=function(){return this.svgBubbleCanvas_};
|
|
1149
1207
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getParentSvg=function(){if(!this.cachedParentSvg_)for(var a=this.svgGroup_;a;){if("svg"===a.tagName){this.cachedParentSvg_=a;break}a=a.parentNode}return this.cachedParentSvg_};
|
|
1150
1208
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.maybeFireViewportChangeEvent=function(){if((0,module$exports$Blockly$Events$utils.isEnabled)()){var a=this.scale,b=-this.scrollY,c=-this.scrollX;if(!(a===this.oldScale_&&1>Math.abs(b-this.oldTop_)&&1>Math.abs(c-this.oldLeft_))){var d=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.VIEWPORT_CHANGE))(b,c,a,this.id,this.oldScale_);this.oldScale_=a;this.oldTop_=b;this.oldLeft_=c;(0,module$exports$Blockly$Events$utils.fire)(d)}}};
|
|
1151
1209
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.translate=function(a,b){if(this.useWorkspaceDragSurface_&&this.isDragSurfaceActive_)this.workspaceDragSurface_.translateSurface(a,b);else{var c="translate("+a+","+b+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",c);this.svgBubbleCanvas_.setAttribute("transform",c)}this.blockDragSurface_&&this.blockDragSurface_.translateAndScaleGroup(a,b,this.scale);this.grid_&&this.grid_.moveTo(a,b);this.maybeFireViewportChangeEvent()};
|
|
@@ -1155,12 +1213,12 @@ c,this.scale);this.workspaceDragSurface_.translateSurface(d.x,d.y)}};module$expo
|
|
|
1155
1213
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.setVisible=function(a){this.isVisible_=a;if(this.svgGroup_)if(this.scrollbar&&this.scrollbar.setContainerVisible(a),this.getFlyout()&&this.getFlyout().setContainerVisible(a),this.getParentSvg().style.display=a?"block":"none",this.toolbox_&&this.toolbox_.setVisible(a),a){a=this.getAllBlocks(!1);for(var b=a.length-1;0<=b;b--)a[b].markDirty();this.render();this.toolbox_&&this.toolbox_.position()}else this.hideChaff(!0)};
|
|
1156
1214
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.render=function(){for(var a=this.getAllBlocks(!1),b=a.length-1;0<=b;b--)a[b].render(!1);if(this.currentGesture_)for(a=this.currentGesture_.getInsertionMarkers(),b=0;b<a.length;b++)a[b].render(!1);this.markerManager_.updateMarkers()};
|
|
1157
1215
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.highlightBlock=function(a,b){if(void 0===b){for(var c=0,d;d=this.highlightedBlocks_[c];c++)d.setHighlighted(!1);this.highlightedBlocks_.length=0}if(a=a?this.getBlockById(a):null)(b=void 0===b||b)?-1===this.highlightedBlocks_.indexOf(a)&&this.highlightedBlocks_.push(a):(0,module$exports$Blockly$utils$array.removeElem)(this.highlightedBlocks_,a),a.setHighlighted(b)};
|
|
1158
|
-
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.paste=function(a){if(this.rendered
|
|
1216
|
+
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.paste=function(a){if(!this.rendered||!a.type&&!a.tagName)return null;this.currentGesture_&&this.currentGesture_.cancel();var b=(0,module$exports$Blockly$Events$utils.getGroup)();b||(0,module$exports$Blockly$Events$utils.setGroup)(!0);a=a.type?this.pasteBlock_(null,a):"comment"===a.tagName.toLowerCase()?this.pasteWorkspaceComment_(a):this.pasteBlock_(a,null);(0,module$exports$Blockly$Events$utils.setGroup)(b);return a};
|
|
1159
1217
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.pasteBlock_=function(a,b){(0,module$exports$Blockly$Events$utils.disable)();try{var c=0,d=0;if(a){var e=(0,$.module$exports$Blockly$Xml.domToBlock)(a,this);c=parseInt(a.getAttribute("x"),10);this.RTL&&(c=-c);d=parseInt(a.getAttribute("y"),10)}else b&&(e=(0,module$exports$Blockly$serialization$blocks.append)(b,this),c=b.x||10,this.RTL&&(c=this.getWidth()-c),d=b.y||10);if(!isNaN(c)&&!isNaN(d)){do{var f=!1;var g=this.getAllBlocks(!1);a=0;for(b=
|
|
1160
1218
|
void 0;b=g[a];a++){var h=b.getRelativeToSurfaceXY();if(1>=Math.abs(c-h.x)&&1>=Math.abs(d-h.y)){f=!0;break}}if(!f){var k=e.getConnections_(!1);a=0;for(b=void 0;b=k[a];a++)if(b.closest($.module$exports$Blockly$config.config.snapRadius,new module$exports$Blockly$utils$Coordinate.Coordinate(c,d)).connection){f=!0;break}}f&&(c=this.RTL?c-$.module$exports$Blockly$config.config.snapRadius:c+$.module$exports$Blockly$config.config.snapRadius,d+=2*$.module$exports$Blockly$config.config.snapRadius)}while(f);
|
|
1161
|
-
e.moveTo(new module$exports$Blockly$utils$Coordinate.Coordinate(c,d))}}finally{(0,module$exports$Blockly$Events$utils.enable)()}(0,module$exports$Blockly$Events$utils.isEnabled)()&&!e.isShadow()&&(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CREATE))(e));e.select()};
|
|
1219
|
+
e.moveTo(new module$exports$Blockly$utils$Coordinate.Coordinate(c,d))}}finally{(0,module$exports$Blockly$Events$utils.enable)()}(0,module$exports$Blockly$Events$utils.isEnabled)()&&!e.isShadow()&&(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CREATE))(e));e.select();return e};
|
|
1162
1220
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.pasteWorkspaceComment_=function(a){(0,module$exports$Blockly$Events$utils.disable)();try{var b=module$exports$Blockly$WorkspaceCommentSvg.fromXml(a,this);var c=parseInt(a.getAttribute("x"),10),d=parseInt(a.getAttribute("y"),10);isNaN(c)||isNaN(d)||(this.RTL&&(c=-c),b.moveBy(c+50,d+50))}finally{(0,module$exports$Blockly$Events$utils.enable)()}(0,module$exports$Blockly$Events$utils.isEnabled)()&&module$exports$Blockly$WorkspaceComment.fireCreateEvent(b);
|
|
1163
|
-
b.select()};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.refreshToolboxSelection=function(){var a=this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox_&&a.toolbox_.getFlyout()&&a.toolbox_.refreshSelection()};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.renameVariableById=function(a,b){module$exports$Blockly$Workspace.Workspace.prototype.renameVariableById.call(this,a,b);this.refreshToolboxSelection()};
|
|
1221
|
+
b.select();return b};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.refreshToolboxSelection=function(){var a=this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox_&&a.toolbox_.getFlyout()&&a.toolbox_.refreshSelection()};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.renameVariableById=function(a,b){module$exports$Blockly$Workspace.Workspace.prototype.renameVariableById.call(this,a,b);this.refreshToolboxSelection()};
|
|
1164
1222
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.deleteVariableById=function(a){module$exports$Blockly$Workspace.Workspace.prototype.deleteVariableById.call(this,a);this.refreshToolboxSelection()};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.createVariable=function(a,b,c){a=module$exports$Blockly$Workspace.Workspace.prototype.createVariable.call(this,a,b,c);this.refreshToolboxSelection();return a};
|
|
1165
1223
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.recordDeleteAreas=function(){module$exports$Blockly$utils.deprecation.warn("WorkspaceSvg.prototype.recordDeleteAreas","June 2021","June 2022","WorkspaceSvg.prototype.recordDragTargets");this.recordDragTargets()};
|
|
1166
1224
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.recordDragTargets=function(){var a=this.componentManager_.getComponents(module$exports$Blockly$ComponentManager.ComponentManager.Capability.DRAG_TARGET,!0);this.dragTargetAreas_=[];for(var b=0,c;c=a[b];b++){var d=c.getClientRect();d&&this.dragTargetAreas_.push({component:c,clientRect:d})}};
|
|
@@ -1187,22 +1245,23 @@ module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.centerOnBlock=functio
|
|
|
1187
1245
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.setScale=function(a){this.options.zoomOptions.maxScale&&a>this.options.zoomOptions.maxScale?a=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&a<this.options.zoomOptions.minScale&&(a=this.options.zoomOptions.minScale);this.scale=a;this.hideChaff(!1);(a=this.getFlyout(!1))&&a.isVisible()&&(a.reflow(),this.recordDragTargets());this.grid_&&this.grid_.update(this.scale);a=this.getMetrics();this.scrollX-=a.absoluteLeft;this.scrollY-=
|
|
1188
1246
|
a.absoluteTop;a.viewLeft+=a.absoluteLeft;a.viewTop+=a.absoluteTop;this.scroll(this.scrollX,this.scrollY);this.scrollbar&&(this.flyout_?this.scrollbar.resizeView(a):this.scrollbar.resizeContent(a))};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getScale=function(){return this.options.parentWorkspace?this.options.parentWorkspace.getScale():this.scale};
|
|
1189
1247
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.scroll=function(a,b){this.hideChaff(!0);var c=this.getMetrics();a=Math.min(a,-c.scrollLeft);b=Math.min(b,-c.scrollTop);var d=c.scrollTop+Math.max(0,c.scrollHeight-c.viewHeight);a=Math.max(a,-(c.scrollLeft+Math.max(0,c.scrollWidth-c.viewWidth)));b=Math.max(b,-d);this.scrollX=a;this.scrollY=b;this.scrollbar&&this.scrollbar.set(-(a+c.scrollLeft),-(b+c.scrollTop),!1);a+=c.absoluteLeft;b+=c.absoluteTop;this.translate(a,b)};
|
|
1190
|
-
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getBlockById=function(a){return module$exports$Blockly$Workspace.Workspace.prototype.getBlockById.call(this,a)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.
|
|
1191
|
-
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.
|
|
1192
|
-
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.
|
|
1193
|
-
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.
|
|
1248
|
+
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getBlockById=function(a){return module$exports$Blockly$Workspace.Workspace.prototype.getBlockById.call(this,a)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getAllBlocks=function(a){return module$exports$Blockly$Workspace.Workspace.prototype.getAllBlocks.call(this,a)};
|
|
1249
|
+
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getTopBlocks=function(a){return module$exports$Blockly$Workspace.Workspace.prototype.getTopBlocks.call(this,a)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.addTopBlock=function(a){this.addTopBoundedElement(a);module$exports$Blockly$Workspace.Workspace.prototype.addTopBlock.call(this,a)};
|
|
1250
|
+
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.removeTopBlock=function(a){this.removeTopBoundedElement(a);module$exports$Blockly$Workspace.Workspace.prototype.removeTopBlock.call(this,a)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.addTopComment=function(a){this.addTopBoundedElement(a);module$exports$Blockly$Workspace.Workspace.prototype.addTopComment.call(this,a)};
|
|
1251
|
+
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.removeTopComment=function(a){this.removeTopBoundedElement(a);module$exports$Blockly$Workspace.Workspace.prototype.removeTopComment.call(this,a)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.addTopBoundedElement=function(a){this.topBoundedElements_.push(a)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.removeTopBoundedElement=function(a){(0,module$exports$Blockly$utils$array.removeElem)(this.topBoundedElements_,a)};
|
|
1252
|
+
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getTopBoundedElements=function(){return[].concat(this.topBoundedElements_)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.setResizesEnabled=function(a){var b=!this.resizesEnabled_&&a;this.resizesEnabled_=a;b&&this.resizeContents()};
|
|
1194
1253
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.clear=function(){this.setResizesEnabled(!1);module$exports$Blockly$Workspace.Workspace.prototype.clear.call(this);this.topBoundedElements_=[];this.setResizesEnabled(!0)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.registerButtonCallback=function(a,b){if("function"!==typeof b)throw TypeError("Button callbacks must be functions.");this.flyoutButtonCallbacks_[a]=b};
|
|
1195
1254
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getButtonCallback=function(a){return(a=this.flyoutButtonCallbacks_[a])?a:null};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.removeButtonCallback=function(a){this.flyoutButtonCallbacks_[a]=null};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.registerToolboxCategoryCallback=function(a,b){if("function"!==typeof b)throw TypeError("Toolbox category callbacks must be functions.");this.toolboxCategoryCallbacks_[a]=b};
|
|
1196
1255
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getToolboxCategoryCallback=function(a){return this.toolboxCategoryCallbacks_[a]||null};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.removeToolboxCategoryCallback=function(a){this.toolboxCategoryCallbacks_[a]=null};
|
|
1197
1256
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getGesture=function(a){var b="mousedown"===a.type||"touchstart"===a.type||"pointerdown"===a.type,c=this.currentGesture_;return c?b&&c.hasStarted()?(console.warn("Tried to start the same gesture twice."),c.cancel(),null):c:b?this.currentGesture_=new module$exports$Blockly$TouchGesture.TouchGesture(a,this):null};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.clearGesture=function(){this.currentGesture_=null};
|
|
1198
1257
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.cancelCurrentGesture=function(){this.currentGesture_&&this.currentGesture_.cancel()};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getAudioManager=function(){return this.audioManager_};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getGrid=function(){return this.grid_};
|
|
1199
|
-
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.hideChaff=function(a){(0,module$exports$Blockly$Tooltip.hide)();(0,module$exports$Blockly$WidgetDiv.hide)();module$exports$Blockly$
|
|
1258
|
+
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.hideChaff=function(a){(0,module$exports$Blockly$Tooltip.hide)();(0,module$exports$Blockly$WidgetDiv.hide)();(0,module$exports$Blockly$dropDownDiv.hideWithoutAnimation)();var b=!!a;this.getComponentManager().getComponents(module$exports$Blockly$ComponentManager.ComponentManager.Capability.AUTOHIDEABLE,!0).forEach(function(c){return c.autoHide(b)})};
|
|
1200
1259
|
module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.setTopLevelWorkspaceMetrics_=function(a){var b=this.getMetrics();"number"===typeof a.x&&(this.scrollX=-(b.scrollLeft+(b.scrollWidth-b.viewWidth)*a.x));"number"===typeof a.y&&(this.scrollY=-(b.scrollTop+(b.scrollHeight-b.viewHeight)*a.y));this.translate(this.scrollX+b.absoluteLeft,this.scrollY+b.absoluteTop)};module$exports$Blockly$WorkspaceSvg.resizeSvgContents=function(a){a.resizeContents()};var module$exports$Blockly$inject={inject:function(a,b){"string"===typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!a||!(0,module$exports$Blockly$utils$dom.containsNode)(document,a))throw Error("Error: container is not in current document.");b=new module$exports$Blockly$Options.Options(b||{});var c=document.createElement("div");c.className="injectionDiv";c.tabIndex=0;(0,module$exports$Blockly$utils$aria.setState)(c,module$exports$Blockly$utils$aria.State.LABEL,$.module$exports$Blockly$Msg.Msg.WORKSPACE_ARIA_LABEL);
|
|
1201
1260
|
a.appendChild(c);a=module$contents$Blockly$inject_createDom(c,b);var d=new module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg(c),e=new module$exports$Blockly$WorkspaceDragSurfaceSvg.WorkspaceDragSurfaceSvg(c),f=module$contents$Blockly$inject_createMainWorkspace(a,b,d,e);module$contents$Blockly$inject_init(f);(0,$.module$exports$Blockly$common.setMainWorkspace)(f);(0,$.module$exports$Blockly$common.svgResize)(f);c.addEventListener("focusin",function(){(0,$.module$exports$Blockly$common.setMainWorkspace)(f)});
|
|
1202
1261
|
return f}},module$contents$Blockly$inject_createDom=function(a,b){a.setAttribute("dir","LTR");(0,module$exports$Blockly$Css.inject)(b.hasCss,b.pathToMedia);a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.SVG,{xmlns:module$exports$Blockly$utils$dom.SVG_NS,"xmlns:html":module$exports$Blockly$utils$dom.HTML_NS,"xmlns:xlink":module$exports$Blockly$utils$dom.XLINK_NS,version:"1.1","class":"blocklySvg",tabindex:"0"},a);var c=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.DEFS,
|
|
1203
1262
|
{},a),d=String(Math.random()).substring(2);b.gridPattern=module$exports$Blockly$Grid.Grid.createDom(d,b.gridOptions,c);return a},module$contents$Blockly$inject_createMainWorkspace=function(a,b,c,d){b.parentWorkspace=null;b=new module$exports$Blockly$WorkspaceSvg.WorkspaceSvg(b,c,d);c=b.options;b.scale=c.zoomOptions.startScale;a.appendChild(b.createDom("blocklyMainBackground"));(0,module$exports$Blockly$utils$dom.addClass)(b.getInjectionDiv(),b.getRenderer().getClassName());(0,module$exports$Blockly$utils$dom.addClass)(b.getInjectionDiv(),
|
|
1204
1263
|
b.getTheme().getClassName());!c.hasCategories&&c.languageTree&&(d=b.addFlyout(module$exports$Blockly$utils$Svg.Svg.SVG),(0,module$exports$Blockly$utils$dom.insertAfter)(d,a));c.hasTrashcan&&b.addTrashcan();c.zoomOptions&&c.zoomOptions.controls&&b.addZoomControls();b.getThemeManager().subscribe(a,"workspaceBackgroundColour","background-color");b.translate(0,0);b.addChangeListener((0,module$exports$Blockly$bumpObjects.bumpIntoBoundsHandler)(b));(0,$.module$exports$Blockly$common.svgResize)(b);(0,module$exports$Blockly$WidgetDiv.createDom)();
|
|
1205
|
-
module$exports$Blockly$
|
|
1264
|
+
(0,module$exports$Blockly$dropDownDiv.createDom)();(0,module$exports$Blockly$Tooltip.createDom)();return b},module$contents$Blockly$inject_init=function(a){var b=a.options,c=a.getParentSvg();(0,module$exports$Blockly$browserEvents.conditionalBind)(c.parentNode,"contextmenu",null,function(e){(0,module$exports$Blockly$browserEvents.isTargetInput)(e)||e.preventDefault()});c=(0,module$exports$Blockly$browserEvents.conditionalBind)(window,"resize",null,function(){a.hideChaff(!0);(0,$.module$exports$Blockly$common.svgResize)(a);
|
|
1206
1265
|
module$exports$Blockly$bumpObjects.bumpTopObjectsIntoBounds(a)});a.setResizeHandlerWrapper(c);module$contents$Blockly$inject_bindDocumentEvents();if(b.languageTree){c=a.getToolbox();var d=a.getFlyout(!0);c?c.init():d&&(d.init(a),d.show(b.languageTree),"function"===typeof d.scrollToStart&&d.scrollToStart())}b.hasTrashcan&&a.trashcan.init();b.zoomOptions&&b.zoomOptions.controls&&a.zoomControls_.init();b.moveOptions&&b.moveOptions.scrollbars?(a.scrollbar=new module$exports$Blockly$ScrollbarPair.ScrollbarPair(a,
|
|
1207
1266
|
!0===b.moveOptions.scrollbars||!!b.moveOptions.scrollbars.horizontal,!0===b.moveOptions.scrollbars||!!b.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),a.scrollbar.resize()):a.setMetrics({x:.5,y:.5});b.hasSounds&&module$contents$Blockly$inject_loadSounds(b.pathToMedia,a)},module$contents$Blockly$inject_onKeyDown=function(a){var b=(0,$.module$exports$Blockly$common.getMainWorkspace)();if(b&&!((0,module$exports$Blockly$browserEvents.isTargetInput)(a)||b.rendered&&!b.isVisible()))module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.registry.onKeyDown(b,
|
|
1208
1267
|
a)},module$contents$Blockly$inject_documentEventsBound=!1,module$contents$Blockly$inject_bindDocumentEvents=function(){module$contents$Blockly$inject_documentEventsBound||((0,module$exports$Blockly$browserEvents.conditionalBind)(document,"scroll",null,function(){for(var a=module$exports$Blockly$Workspace.Workspace.getAll(),b=0,c;c=a[b];b++)c.updateInverseScreenCTM&&c.updateInverseScreenCTM()}),(0,module$exports$Blockly$browserEvents.conditionalBind)(document,"keydown",null,module$contents$Blockly$inject_onKeyDown),
|
|
@@ -1212,8 +1271,8 @@ a)},module$contents$Blockly$inject_documentEventsBound=!1,module$contents$Blockl
|
|
|
1212
1271
|
module$exports$Blockly$DragTarget.DragTarget.prototype.shouldPreventMove=function(a){return!1};var module$exports$Blockly$IDeleteArea={IDeleteArea:function(){}};var module$exports$Blockly$DeleteArea={DeleteArea:function(){module$exports$Blockly$DragTarget.DragTarget.call(this);this.wouldDelete_=!1}};$.$jscomp.inherits(module$exports$Blockly$DeleteArea.DeleteArea,module$exports$Blockly$DragTarget.DragTarget);module$exports$Blockly$DeleteArea.DeleteArea.prototype.wouldDelete=function(a,b){a instanceof module$exports$Blockly$BlockSvg.BlockSvg?(a=!a.getParent()&&a.isDeletable(),this.updateWouldDelete_(a&&!b)):this.updateWouldDelete_(a.isDeletable());return this.wouldDelete_};
|
|
1213
1272
|
module$exports$Blockly$DeleteArea.DeleteArea.prototype.updateWouldDelete_=function(a){this.wouldDelete_=a};var module$exports$Blockly$FlyoutMetricsManager={FlyoutMetricsManager:function(a,b){module$exports$Blockly$MetricsManager.MetricsManager.call(this,a);this.flyout_=b}};$.$jscomp.inherits(module$exports$Blockly$FlyoutMetricsManager.FlyoutMetricsManager,module$exports$Blockly$MetricsManager.MetricsManager);module$exports$Blockly$FlyoutMetricsManager.FlyoutMetricsManager.prototype.getBoundingBox_=function(){try{var a=this.workspace_.getCanvas().getBBox()}catch(b){a={height:0,y:0,width:0,x:0}}return a};
|
|
1214
1273
|
module$exports$Blockly$FlyoutMetricsManager.FlyoutMetricsManager.prototype.getContentMetrics=function(a){var b=this.getBoundingBox_();a=a?1:this.workspace_.scale;return{height:b.height*a,width:b.width*a,top:b.y*a,left:b.x*a}};module$exports$Blockly$FlyoutMetricsManager.FlyoutMetricsManager.prototype.getScrollMetrics=function(a,b,c){b=c||this.getContentMetrics();c=this.flyout_.MARGIN*this.workspace_.scale;a=a?this.workspace_.scale:1;return{height:(b.height+2*c)/a,width:(b.width+b.left+c)/a,top:0,left:0}};var module$exports$Blockly$IFlyout={IFlyout:function(){}};var module$exports$Blockly$Flyout={Flyout:function(a){module$exports$Blockly$DeleteArea.DeleteArea.call(this);a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new module$exports$Blockly$WorkspaceSvg.WorkspaceSvg(a);this.workspace_.setMetricsManager(new module$exports$Blockly$FlyoutMetricsManager.FlyoutMetricsManager(this.workspace_,this));this.workspace_.isFlyout=!0;this.workspace_.setVisible(this.isVisible_);this.id=(0,module$exports$Blockly$utils$idGenerator.genUid)();this.RTL=!!a.RTL;this.horizontalLayout=
|
|
1215
|
-
!1;this.toolboxPosition_=a.toolboxPosition;this.eventWrappers_=[];this.filterWrapper_=this.reflowWrapper_=null;this.mats_=[];this.buttons_=[];this.listeners_=[];this.permanentlyDisabled_=[];this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH;this.targetWorkspace=null;this.recycledBlocks_=[];this.autoClose=!0;this.isVisible_=!1;this.containerVisible_=!0;this.MARGIN=this.CORNER_RADIUS=8;this.GAP_X=3*this.MARGIN;this.GAP_Y=3*this.MARGIN;this.SCROLLBAR_MARGIN=
|
|
1216
|
-
0;this.dragAngleRange_=70;this.svgGroup_=this.svgBackground_=null}};$.$jscomp.inherits(module$exports$Blockly$Flyout.Flyout,module$exports$Blockly$DeleteArea.DeleteArea);
|
|
1274
|
+
!1;this.toolboxPosition_=a.toolboxPosition;this.eventWrappers_=[];this.filterWrapper_=this.reflowWrapper_=null;this.mats_=[];this.buttons_=[];this.listeners_=[];this.permanentlyDisabled_=[];this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH;this.targetWorkspace=null;this.recycledBlocks_=[];this.autoClose=!0;this.isVisible_=!1;this.containerVisible_=!0;this.rectMap_=new WeakMap;this.MARGIN=this.CORNER_RADIUS=8;this.GAP_X=3*this.MARGIN;this.GAP_Y=3*this.MARGIN;this.SCROLLBAR_MARGIN=
|
|
1275
|
+
2.5;this.height_=this.width_=0;this.dragAngleRange_=70;this.svgGroup_=this.svgBackground_=null}};$.$jscomp.inherits(module$exports$Blockly$Flyout.Flyout,module$exports$Blockly$DeleteArea.DeleteArea);
|
|
1217
1276
|
module$exports$Blockly$Flyout.Flyout.prototype.createDom=function(a){this.svgGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(a,{"class":"blocklyFlyout",style:"display: none"},null);this.svgBackground_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyFlyoutBackground"},this.svgGroup_);this.svgGroup_.appendChild(this.workspace_.createDom());this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour",
|
|
1218
1277
|
"fill");this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity");return this.svgGroup_};
|
|
1219
1278
|
module$exports$Blockly$Flyout.Flyout.prototype.init=function(a){this.targetWorkspace=a;this.workspace_.targetWorkspace=a;this.workspace_.scrollbar=new module$exports$Blockly$ScrollbarPair.ScrollbarPair(this.workspace_,this.horizontalLayout,!this.horizontalLayout,"blocklyFlyoutScrollbar",this.SCROLLBAR_MARGIN);this.hide();Array.prototype.push.apply(this.eventWrappers_,(0,module$exports$Blockly$browserEvents.conditionalBind)(this.svgGroup_,"wheel",this,this.wheel_));this.autoClose||(this.filterWrapper_=
|
|
@@ -1242,7 +1301,7 @@ module$exports$Blockly$Flyout.Flyout.prototype.onMouseDown_=function(a){var b=th
|
|
|
1242
1301
|
module$exports$Blockly$Flyout.Flyout.prototype.createBlock=function(a){var b=null;(0,module$exports$Blockly$Events$utils.disable)();var c=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{b=this.placeNewBlock_(a)}finally{(0,module$exports$Blockly$Events$utils.enable)()}this.targetWorkspace.hideChaff();a=(0,$.module$exports$Blockly$Variables.getAddedVariables)(this.targetWorkspace,c);if((0,module$exports$Blockly$Events$utils.isEnabled)()){(0,module$exports$Blockly$Events$utils.setGroup)(!0);
|
|
1243
1302
|
for(c=0;c<a.length;c++){var d=a[c];(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.VAR_CREATE))(d))}(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CREATE))(b))}this.autoClose?this.hide():this.filterForCapacity_();return b};
|
|
1244
1303
|
module$exports$Blockly$Flyout.Flyout.prototype.initFlyoutButton_=function(a,b,c){var d=a.createDom();a.moveTo(b,c);a.show();this.listeners_.push((0,module$exports$Blockly$browserEvents.conditionalBind)(d,"mousedown",this,this.onMouseDown_));this.buttons_.push(a)};
|
|
1245
|
-
module$exports$Blockly$Flyout.Flyout.prototype.createRect_=function(a,b,c,d,e){b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"fill-opacity":0,x:b,y:c,height:d.height,width:d.width},null);b.tooltip=a;(0,module$exports$Blockly$Tooltip.bindMouseEvents)(b);this.workspace_.getCanvas().insertBefore(b,a.getSvgRoot());a
|
|
1304
|
+
module$exports$Blockly$Flyout.Flyout.prototype.createRect_=function(a,b,c,d,e){b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"fill-opacity":0,x:b,y:c,height:d.height,width:d.width},null);b.tooltip=a;(0,module$exports$Blockly$Tooltip.bindMouseEvents)(b);this.workspace_.getCanvas().insertBefore(b,a.getSvgRoot());this.rectMap_.set(a,b);return this.mats_[e]=b};
|
|
1246
1305
|
module$exports$Blockly$Flyout.Flyout.prototype.moveRectToBlock_=function(a,b){var c=b.getHeightWidth();a.setAttribute("width",c.width);a.setAttribute("height",c.height);b=b.getRelativeToSurfaceXY();a.setAttribute("y",b.y);a.setAttribute("x",this.RTL?b.x-c.width:b.x)};
|
|
1247
1306
|
module$exports$Blockly$Flyout.Flyout.prototype.filterForCapacity_=function(){for(var a=this.workspace_.getTopBlocks(!1),b=0,c;c=a[b];b++)if(-1===this.permanentlyDisabled_.indexOf(c))for(var d=this.targetWorkspace.isCapacityAvailable((0,$.module$exports$Blockly$common.getBlockTypeCounts)(c));c;)c.setEnabled(d),c=c.getNextBlock()};
|
|
1248
1307
|
module$exports$Blockly$Flyout.Flyout.prototype.reflow=function(){this.reflowWrapper_&&this.workspace_.removeChangeListener(this.reflowWrapper_);this.reflowInternal_();this.reflowWrapper_&&this.workspace_.addChangeListener(this.reflowWrapper_)};module$exports$Blockly$Flyout.Flyout.prototype.isScrollable=function(){return this.workspace_.scrollbar?this.workspace_.scrollbar.isVisible():!1};
|
|
@@ -1254,18 +1313,18 @@ module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.getX=function(){i
|
|
|
1254
1313
|
module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.position=function(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var a=this.targetWorkspace.getMetricsManager().getViewMetrics();this.height_=a.height;this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,a.height-2*this.CORNER_RADIUS);a=this.getX();var b=this.getY();this.positionAt_(this.width_,this.height_,a,b)}};
|
|
1255
1314
|
module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.setBackgroundPath_=function(a,b){var c=this.toolboxPosition_===module$exports$Blockly$utils$toolbox.Position.RIGHT,d=a+this.CORNER_RADIUS;d=["M "+(c?d:0)+",0"];d.push("h",c?-a:a);d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("v",Math.max(0,b));d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS);
|
|
1256
1315
|
d.push("h",c?a:-a);d.push("z");this.svgBackground_.setAttribute("d",d.join(" "))};module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.scrollToStart=function(){this.workspace_.scrollbar.setY(0)};
|
|
1257
|
-
module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.wheel_=function(a){var b=(0,module$exports$Blockly$browserEvents.getScrollDeltaPixels)(a);if(b.y){var c=this.workspace_.getMetricsManager(),d=c.getScrollMetrics();b=c.getViewMetrics().top-d.top+b.y;this.workspace_.scrollbar.setY(b);(0,module$exports$Blockly$WidgetDiv.hide)();module$exports$Blockly$
|
|
1316
|
+
module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.wheel_=function(a){var b=(0,module$exports$Blockly$browserEvents.getScrollDeltaPixels)(a);if(b.y){var c=this.workspace_.getMetricsManager(),d=c.getScrollMetrics();b=c.getViewMetrics().top-d.top+b.y;this.workspace_.scrollbar.setY(b);(0,module$exports$Blockly$WidgetDiv.hide)();(0,module$exports$Blockly$dropDownDiv.hideWithoutAnimation)()}a.preventDefault();a.stopPropagation()};
|
|
1258
1317
|
module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace.scale;for(var c=this.MARGIN,d=this.RTL?c:c+this.tabWidth_,e=0,f;f=a[e];e++)if("block"===f.type){f=f.block;for(var g=f.getDescendants(!1),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();k=f.outputConnection?d-this.tabWidth_:d;f.moveBy(k,c);k=this.createRect_(f,this.RTL?k-h.width:k,c,h,e);this.addBlockListeners_(g,f,k);c+=h.height+b[e]}else"button"===
|
|
1259
1318
|
f.type&&(this.initFlyoutButton_(f.button,d,c),c+=f.button.height+b[e])};module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;return a<b&&a>-b||a<-180+b||a>180-b?!0:!1};
|
|
1260
1319
|
module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.left;return this.toolboxPosition_===module$exports$Blockly$utils$toolbox.Position.LEFT?new module$exports$Blockly$utils$Rect.Rect(-1E9,1E9,-1E9,b+a.width):new module$exports$Blockly$utils$Rect.Rect(-1E9,1E9,b,1E9)};
|
|
1261
1320
|
module$exports$Blockly$VerticalFlyout.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.getFlyoutScale();for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++){var e=d.getHeightWidth().width;d.outputConnection&&(e-=this.tabWidth_);a=Math.max(a,e)}for(c=0;d=this.buttons_[c];c++)a=Math.max(a,d.width);a+=1.5*this.MARGIN+this.tabWidth_;a*=this.workspace_.scale;a+=module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness;if(this.width_!==a){for(c=0;d=b[c];c++){if(this.RTL){e=
|
|
1262
|
-
d.getRelativeToSurfaceXY().x;var f=a/this.workspace_.scale-this.MARGIN;d.outputConnection||(f-=this.tabWidth_);d.moveBy(f-e,0)}d
|
|
1263
|
-
a,this.targetWorkspace.scrollY);this.width_=a;this.position();this.targetWorkspace.recordDragTargets()}};module$exports$Blockly$VerticalFlyout.VerticalFlyout.registryName="verticalFlyout";(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.FLYOUTS_VERTICAL_TOOLBOX,module$exports$Blockly$registry.DEFAULT,module$exports$Blockly$VerticalFlyout.VerticalFlyout);var module$exports$Blockly$IToolboxItem={IToolboxItem:function(){}};var module$exports$Blockly$ISelectableToolboxItem={ISelectableToolboxItem:function(){}};var module$exports$Blockly$ICollapsibleToolboxItem={ICollapsibleToolboxItem:function(){}};var module$exports$Blockly$ToolboxItem={ToolboxItem:function(a,b,c){this.id_=a.toolboxitemid||(0,module$exports$Blockly$utils$idGenerator.getNextUniqueId)();this.level_=(this.parent_=c||null)?this.parent_.getLevel()+1:0;this.toolboxItemDef_=a;this.parentToolbox_=b;this.workspace_=this.parentToolbox_.getWorkspace()}};module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.init=function(){};module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.getDiv=function(){return null};
|
|
1264
|
-
module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.
|
|
1265
|
-
module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.dispose=function(){};var module$exports$Blockly$ToolboxCategory={ToolboxCategory:function(a,b,c){module$exports$Blockly$
|
|
1266
|
-
|
|
1267
|
-
module$exports$Blockly$ToolboxCategory.ToolboxCategory.
|
|
1268
|
-
module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.parseContents_=function(a){var b=a.contents;if(a.custom)this.flyoutItems_=a.custom;else if(b)for(a=0;a<b.length;a++)this.flyoutItems_.push(b[a])};module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.
|
|
1321
|
+
d.getRelativeToSurfaceXY().x;var f=a/this.workspace_.scale-this.MARGIN;d.outputConnection||(f-=this.tabWidth_);d.moveBy(f-e,0)}this.rectMap_.has(d)&&this.moveRectToBlock_(this.rectMap_.get(d),d)}if(this.RTL)for(b=0;c=this.buttons_[b];b++)d=c.getPosition().y,c.moveTo(a/this.workspace_.scale-c.width-this.MARGIN-this.tabWidth_,d);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==module$exports$Blockly$utils$toolbox.Position.LEFT||this.targetWorkspace.getToolbox()||
|
|
1322
|
+
this.targetWorkspace.translate(this.targetWorkspace.scrollX+a,this.targetWorkspace.scrollY);this.width_=a;this.position();this.targetWorkspace.recordDragTargets()}};module$exports$Blockly$VerticalFlyout.VerticalFlyout.registryName="verticalFlyout";(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.FLYOUTS_VERTICAL_TOOLBOX,module$exports$Blockly$registry.DEFAULT,module$exports$Blockly$VerticalFlyout.VerticalFlyout);var module$exports$Blockly$IToolboxItem={IToolboxItem:function(){}};var module$exports$Blockly$ISelectableToolboxItem={ISelectableToolboxItem:function(){}};var module$exports$Blockly$ICollapsibleToolboxItem={ICollapsibleToolboxItem:function(){}};var module$exports$Blockly$ToolboxItem={ToolboxItem:function(a,b,c){this.id_=a.toolboxitemid||(0,module$exports$Blockly$utils$idGenerator.getNextUniqueId)();this.level_=(this.parent_=c||null)?this.parent_.getLevel()+1:0;this.toolboxItemDef_=a;this.parentToolbox_=b;this.workspace_=this.parentToolbox_.getWorkspace()}};module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.init=function(){};module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.getDiv=function(){return null};
|
|
1323
|
+
module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.getClickTarget=function(){return null};module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.getId=function(){return this.id_};module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.getParent=function(){return null};module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.getLevel=function(){return this.level_};module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.isSelectable=function(){return!1};
|
|
1324
|
+
module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.isCollapsible=function(){return!1};module$exports$Blockly$ToolboxItem.ToolboxItem.prototype.dispose=function(){};var module$exports$Blockly$ToolboxCategory={ToolboxCategory:function(a,b,c){module$exports$Blockly$ToolboxItem.ToolboxItem.call(this,a,b,c);this.colour_=this.name_="";this.labelDom_=this.iconDom_=this.rowContents_=this.rowDiv_=this.htmlDiv_=null;this.cssConfig_=this.makeDefaultCssConfig_();this.isDisabled_=this.isHidden_=!1;this.flyoutItems_=[]}};$.$jscomp.inherits(module$exports$Blockly$ToolboxCategory.ToolboxCategory,module$exports$Blockly$ToolboxItem.ToolboxItem);
|
|
1325
|
+
module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.init=function(){this.parseCategoryDef_(this.toolboxItemDef_);this.parseContents_(this.toolboxItemDef_);this.createDom_();"true"===this.toolboxItemDef_.hidden&&this.hide()};
|
|
1326
|
+
module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.makeDefaultCssConfig_=function(){return{container:"blocklyToolboxCategory",row:"blocklyTreeRow",rowcontentcontainer:"blocklyTreeRowContentContainer",icon:"blocklyTreeIcon",label:"blocklyTreeLabel",contents:"blocklyToolboxContents",selected:"blocklyTreeSelected",openicon:"blocklyTreeIconOpen",closedicon:"blocklyTreeIconClosed"}};
|
|
1327
|
+
module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.parseContents_=function(a){var b=a.contents;if(a.custom)this.flyoutItems_=a.custom;else if(b)for(a=0;a<b.length;a++)this.flyoutItems_.push(b[a])};module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.parseCategoryDef_=function(a){this.name_=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.name);this.colour_=this.getColour_(a);(0,$.module$exports$Blockly$utils$object.mixin)(this.cssConfig_,a.cssconfig||a.cssConfig)};
|
|
1269
1328
|
module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.createDom_=function(){this.htmlDiv_=this.createContainer_();(0,module$exports$Blockly$utils$aria.setRole)(this.htmlDiv_,module$exports$Blockly$utils$aria.Role.TREEITEM);(0,module$exports$Blockly$utils$aria.setState)(this.htmlDiv_,module$exports$Blockly$utils$aria.State.SELECTED,!1);(0,module$exports$Blockly$utils$aria.setState)(this.htmlDiv_,module$exports$Blockly$utils$aria.State.LEVEL,this.level_);this.rowDiv_=this.createRowContainer_();
|
|
1270
1329
|
this.rowDiv_.style.pointerEvents="auto";this.htmlDiv_.appendChild(this.rowDiv_);this.rowContents_=this.createRowContentsContainer_();this.rowContents_.style.pointerEvents="none";this.rowDiv_.appendChild(this.rowContents_);this.iconDom_=this.createIconDom_();(0,module$exports$Blockly$utils$aria.setRole)(this.iconDom_,module$exports$Blockly$utils$aria.Role.PRESENTATION);this.rowContents_.appendChild(this.iconDom_);this.labelDom_=this.createLabelDom_(this.name_);this.rowContents_.appendChild(this.labelDom_);
|
|
1271
1330
|
(0,module$exports$Blockly$utils$aria.setState)(this.htmlDiv_,module$exports$Blockly$utils$aria.State.LABELLEDBY,this.labelDom_.getAttribute("id"));this.addColourBorder_(this.colour_);return this.htmlDiv_};module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.createContainer_=function(){var a=document.createElement("div");(0,module$exports$Blockly$utils$dom.addClass)(a,this.cssConfig_.container);return a};
|
|
@@ -1283,22 +1342,23 @@ module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.onClick=functio
|
|
|
1283
1342
|
module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.setSelected=function(a){if(a){var b=this.parseColour_(module$exports$Blockly$ToolboxCategory.ToolboxCategory.defaultBackgroundColour);this.rowDiv_.style.backgroundColor=this.colour_||b;(0,module$exports$Blockly$utils$dom.addClass)(this.rowDiv_,this.cssConfig_.selected)}else this.rowDiv_.style.backgroundColor="",(0,module$exports$Blockly$utils$dom.removeClass)(this.rowDiv_,this.cssConfig_.selected);(0,module$exports$Blockly$utils$aria.setState)(this.htmlDiv_,
|
|
1284
1343
|
module$exports$Blockly$utils$aria.State.SELECTED,a)};module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.setDisabled=function(a){this.isDisabled_=a;this.getDiv().setAttribute("disabled",a);a?this.getDiv().setAttribute("disabled","true"):this.getDiv().removeAttribute("disabled")};module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.getName=function(){return this.name_};module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.getParent=function(){return this.parent_};
|
|
1285
1344
|
module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.getDiv=function(){return this.htmlDiv_};module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.getContents=function(){return this.flyoutItems_};
|
|
1286
|
-
module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.updateFlyoutContents=function(a){this.flyoutItems_=[];"string"===typeof a?this.toolboxItemDef_.custom=a:(delete this.toolboxItemDef_.custom,this.toolboxItemDef_.contents=(0,module$exports$Blockly$utils$toolbox.convertFlyoutDefToJsonArray)(a));this.parseContents_(this.toolboxItemDef_)};module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.dispose=function(){(0,module$exports$Blockly$utils$dom.removeNode)(this.htmlDiv_)};
|
|
1345
|
+
module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.updateFlyoutContents=function(a){this.flyoutItems_=[];"string"===typeof a?this.toolboxItemDef_.custom=a:(delete this.toolboxItemDef_.custom,this.toolboxItemDef_.contents=(0,module$exports$Blockly$utils$toolbox.convertFlyoutDefToJsonArray)(a));this.parseContents_(this.toolboxItemDef_)};module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.dispose=function(){(0,module$exports$Blockly$utils$dom.removeNode)(this.htmlDiv_)};
|
|
1346
|
+
module$exports$Blockly$ToolboxCategory.ToolboxCategory.registrationName="category";module$exports$Blockly$ToolboxCategory.ToolboxCategory.nestedPadding=19;module$exports$Blockly$ToolboxCategory.ToolboxCategory.borderWidth=8;module$exports$Blockly$ToolboxCategory.ToolboxCategory.defaultBackgroundColour="#57e";(0,module$exports$Blockly$Css.register)('\n.blocklyTreeRow:not(.blocklyTreeSelected):hover {\n background-color: rgba(255, 255, 255, .2);\n}\n\n.blocklyToolboxDiv[layout="h"] .blocklyToolboxCategory {\n margin: 1px 5px 1px 0;\n}\n\n.blocklyToolboxDiv[dir="RTL"][layout="h"] .blocklyToolboxCategory {\n margin: 1px 0 1px 5px;\n}\n\n.blocklyTreeRow {\n height: 22px;\n line-height: 22px;\n margin-bottom: 3px;\n padding-right: 8px;\n white-space: nowrap;\n}\n\n.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {\n margin-left: 8px;\n padding-right: 0;\n}\n\n.blocklyTreeIcon {\n background-image: url(<<<PATH>>>/sprites.png);\n height: 16px;\n vertical-align: middle;\n visibility: hidden;\n width: 16px;\n}\n\n.blocklyTreeIconClosed {\n background-position: -32px -1px;\n}\n\n.blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed {\n background-position: 0 -1px;\n}\n\n.blocklyTreeSelected>.blocklyTreeIconClosed {\n background-position: -32px -17px;\n}\n\n.blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed {\n background-position: 0 -17px;\n}\n\n.blocklyTreeIconOpen {\n background-position: -16px -1px;\n}\n\n.blocklyTreeSelected>.blocklyTreeIconOpen {\n background-position: -16px -17px;\n}\n\n.blocklyTreeLabel {\n cursor: default;\n font: 16px sans-serif;\n padding: 0 3px;\n vertical-align: middle;\n}\n\n.blocklyToolboxDelete .blocklyTreeLabel {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyTreeSelected .blocklyTreeLabel {\n color: #fff;\n}\n');
|
|
1287
1347
|
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.TOOLBOX_ITEM,module$exports$Blockly$ToolboxCategory.ToolboxCategory.registrationName,module$exports$Blockly$ToolboxCategory.ToolboxCategory);var module$exports$Blockly$ToolboxSeparator={ToolboxSeparator:function(a,b){module$exports$Blockly$ToolboxItem.ToolboxItem.call(this,a,b);this.cssConfig_={container:"blocklyTreeSeparator"};this.htmlDiv_=null;(0,$.module$exports$Blockly$utils$object.mixin)(this.cssConfig_,a.cssconfig||a.cssConfig)}};$.$jscomp.inherits(module$exports$Blockly$ToolboxSeparator.ToolboxSeparator,module$exports$Blockly$ToolboxItem.ToolboxItem);module$exports$Blockly$ToolboxSeparator.ToolboxSeparator.prototype.init=function(){this.createDom_()};
|
|
1288
1348
|
module$exports$Blockly$ToolboxSeparator.ToolboxSeparator.prototype.createDom_=function(){var a=document.createElement("div");(0,module$exports$Blockly$utils$dom.addClass)(a,this.cssConfig_.container);return this.htmlDiv_=a};module$exports$Blockly$ToolboxSeparator.ToolboxSeparator.prototype.getDiv=function(){return this.htmlDiv_};module$exports$Blockly$ToolboxSeparator.ToolboxSeparator.prototype.dispose=function(){(0,module$exports$Blockly$utils$dom.removeNode)(this.htmlDiv_)};
|
|
1289
1349
|
module$exports$Blockly$ToolboxSeparator.ToolboxSeparator.registrationName="sep";(0,module$exports$Blockly$Css.register)('\n.blocklyTreeSeparator {\n border-bottom: solid #e5e5e5 1px;\n height: 0;\n margin: 5px 0;\n}\n\n.blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator {\n border-right: solid #e5e5e5 1px;\n border-bottom: none;\n height: auto;\n margin: 0 5px 0 5px;\n padding: 5px 0;\n width: 0;\n}\n');
|
|
1290
|
-
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.TOOLBOX_ITEM,module$exports$Blockly$ToolboxSeparator.ToolboxSeparator.registrationName,module$exports$Blockly$ToolboxSeparator.ToolboxSeparator);var module$exports$Blockly$CollapsibleToolboxCategory={CollapsibleToolboxCategory:function(a,b,c){this.subcategoriesDiv_=null;this.expanded_=!1;this.toolboxItems_=[]
|
|
1291
|
-
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.
|
|
1350
|
+
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.TOOLBOX_ITEM,module$exports$Blockly$ToolboxSeparator.ToolboxSeparator.registrationName,module$exports$Blockly$ToolboxSeparator.ToolboxSeparator);var module$exports$Blockly$CollapsibleToolboxCategory={CollapsibleToolboxCategory:function(a,b,c){module$exports$Blockly$ToolboxCategory.ToolboxCategory.call(this,a,b,c);this.subcategoriesDiv_=null;this.expanded_=!1;this.toolboxItems_=[]}};$.$jscomp.inherits(module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory,module$exports$Blockly$ToolboxCategory.ToolboxCategory);
|
|
1351
|
+
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.makeDefaultCssConfig_=function(){var a=module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.makeDefaultCssConfig_.call(this);a.contents="blocklyToolboxContents";return a};
|
|
1292
1352
|
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.parseContents_=function(a){var b=a.contents,c=!0;if(a.custom)this.flyoutItems_=a.custom;else if(b)for(a=0;a<b.length;a++){var d=b[a];!(0,module$exports$Blockly$registry.hasItem)(module$exports$Blockly$registry.Type.TOOLBOX_ITEM,d.kind)||d.kind.toLowerCase()===module$exports$Blockly$ToolboxSeparator.ToolboxSeparator.registrationName&&c?(this.flyoutItems_.push(d),c=!0):(this.createToolboxItem_(d),c=!1)}};
|
|
1293
1353
|
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.createToolboxItem_=function(a){var b=a.kind;"CATEGORY"==b.toUpperCase()&&(0,module$exports$Blockly$utils$toolbox.isCategoryCollapsible)(a)&&(b=module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.registrationName);a=new ((0,module$exports$Blockly$registry.getClass)(module$exports$Blockly$registry.Type.TOOLBOX_ITEM,b))(a,this.parentToolbox_,this);this.toolboxItems_.push(a)};
|
|
1294
|
-
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.init=function(){module$exports$Blockly$
|
|
1295
|
-
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.createDom_=function(){module$exports$Blockly$
|
|
1354
|
+
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.init=function(){module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.init.call(this);this.setExpanded("true"===this.toolboxItemDef_.expanded||this.toolboxItemDef_.expanded)};
|
|
1355
|
+
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.createDom_=function(){module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.createDom_.call(this);var a=this.getChildToolboxItems();this.subcategoriesDiv_=this.createSubCategoriesDom_(a);(0,module$exports$Blockly$utils$aria.setRole)(this.subcategoriesDiv_,module$exports$Blockly$utils$aria.Role.GROUP);this.htmlDiv_.appendChild(this.subcategoriesDiv_);return this.htmlDiv_};
|
|
1296
1356
|
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.createIconDom_=function(){var a=document.createElement("span");this.parentToolbox_.isHorizontal()||((0,module$exports$Blockly$utils$dom.addClass)(a,this.cssConfig_.icon),a.style.visibility="visible");a.style.display="inline-block";return a};
|
|
1297
1357
|
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.createSubCategoriesDom_=function(a){var b=document.createElement("div");(0,module$exports$Blockly$utils$dom.addClass)(b,this.cssConfig_.contents);for(var c=0;c<a.length;c++){var d=a[c];d.init();var e=d.getDiv();b.appendChild(e);d.getClickTarget&&d.getClickTarget().setAttribute("id",d.getId())}return b};
|
|
1298
1358
|
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.setExpanded=function(a){this.expanded_!==a&&((this.expanded_=a)?(this.subcategoriesDiv_.style.display="block",this.openIcon_(this.iconDom_)):(this.subcategoriesDiv_.style.display="none",this.closeIcon_(this.iconDom_)),(0,module$exports$Blockly$utils$aria.setState)(this.htmlDiv_,module$exports$Blockly$utils$aria.State.EXPANDED,a),this.parentToolbox_.handleToolboxItemResize())};
|
|
1299
1359
|
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.setVisible_=function(a){this.htmlDiv_.style.display=a?"block":"none";for(var b=this.getChildToolboxItems(),c=0;c<b.length;c++)b[c].setVisible_(a);this.isHidden_=!a;this.parentToolbox_.getSelectedItem()===this&&this.parentToolbox_.clearSelection()};module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.isExpanded=function(){return this.expanded_};
|
|
1300
1360
|
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.isCollapsible=function(){return!0};module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.onClick=function(a){this.toggleExpanded()};module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.toggleExpanded=function(){this.setExpanded(!this.expanded_)};module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.getDiv=function(){return this.htmlDiv_};
|
|
1301
|
-
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.getChildToolboxItems=function(){return this.toolboxItems_};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.TOOLBOX_ITEM,module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.registrationName,module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory);var module$exports$Blockly$IAutoHideable={IAutoHideable:function(){}};var module$exports$Blockly$IStyleable={IStyleable:function(){}};var module$exports$Blockly$IToolbox={IToolbox:function(){}};var module$exports$Blockly$Events$ToolboxItemSelect={ToolboxItemSelect:function(a,b,c){module$exports$Blockly$Events$UiBase.UiBase.call(this,c);this.oldItem=a;this.newItem=b;this.type=module$exports$Blockly$Events$utils.TOOLBOX_ITEM_SELECT}};$.$jscomp.inherits(module$exports$Blockly$Events$ToolboxItemSelect.ToolboxItemSelect,module$exports$Blockly$Events$UiBase.UiBase);
|
|
1361
|
+
module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.getChildToolboxItems=function(){return this.toolboxItems_};module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.registrationName="collapsibleCategory";(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.TOOLBOX_ITEM,module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.registrationName,module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory);var module$exports$Blockly$IAutoHideable={IAutoHideable:function(){}};var module$exports$Blockly$IStyleable={IStyleable:function(){}};var module$exports$Blockly$IToolbox={IToolbox:function(){}};var module$exports$Blockly$Events$ToolboxItemSelect={ToolboxItemSelect:function(a,b,c){module$exports$Blockly$Events$UiBase.UiBase.call(this,c);this.oldItem=a;this.newItem=b;this.type=module$exports$Blockly$Events$utils.TOOLBOX_ITEM_SELECT}};$.$jscomp.inherits(module$exports$Blockly$Events$ToolboxItemSelect.ToolboxItemSelect,module$exports$Blockly$Events$UiBase.UiBase);
|
|
1302
1362
|
module$exports$Blockly$Events$ToolboxItemSelect.ToolboxItemSelect.prototype.toJson=function(){var a=module$exports$Blockly$Events$UiBase.UiBase.prototype.toJson.call(this);a.oldItem=this.oldItem;a.newItem=this.newItem;return a};module$exports$Blockly$Events$ToolboxItemSelect.ToolboxItemSelect.prototype.fromJson=function(a){module$exports$Blockly$Events$UiBase.UiBase.prototype.fromJson.call(this,a);this.oldItem=a.oldItem;this.newItem=a.newItem};
|
|
1303
1363
|
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.TOOLBOX_ITEM_SELECT,module$exports$Blockly$Events$ToolboxItemSelect.ToolboxItemSelect);var module$exports$Blockly$Toolbox={Toolbox:function(a){module$exports$Blockly$DeleteArea.DeleteArea.call(this);this.workspace_=a;this.id="toolbox";this.toolboxDef_=a.options.languageTree||{contents:[]};this.horizontalLayout_=a.options.horizontalLayout;this.contentsDiv_=this.HtmlDiv=null;this.isVisible_=!1;this.contents_=[];this.height_=this.width_=0;this.RTL=a.options.RTL;this.flyout_=null;this.contentMap_=Object.create(null);this.toolboxPosition=a.options.toolboxPosition;this.previouslySelectedItem_=
|
|
1304
1364
|
this.selectedItem_=null;this.boundEvents_=[]}};$.$jscomp.inherits(module$exports$Blockly$Toolbox.Toolbox,module$exports$Blockly$DeleteArea.DeleteArea);module$exports$Blockly$Toolbox.Toolbox.prototype.onShortcut=function(a){return!1};
|
|
@@ -1314,7 +1374,7 @@ this.selectedItem_.isCollapsible()&&(this.selectedItem_.toggleExpanded(),b=!0);b
|
|
|
1314
1374
|
module$exports$Blockly$Toolbox.Toolbox.prototype.createFlyout_=function(){var a=this.workspace_,b=new module$exports$Blockly$Options.Options({parentWorkspace:a,rtl:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,renderer:a.options.renderer,rendererOverrides:a.options.rendererOverrides,move:{scrollbars:!0}});b.toolboxPosition=a.options.toolboxPosition;return new (a.horizontalLayout?(0,module$exports$Blockly$registry.getClassFromOptions)(module$exports$Blockly$registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,
|
|
1315
1375
|
a.options,!0):(0,module$exports$Blockly$registry.getClassFromOptions)(module$exports$Blockly$registry.Type.FLYOUTS_VERTICAL_TOOLBOX,a.options,!0))(b)};module$exports$Blockly$Toolbox.Toolbox.prototype.render=function(a){this.toolboxDef_=a;for(var b=0;b<this.contents_.length;b++){var c=this.contents_[b];c&&c.dispose()}this.contents_=[];this.contentMap_=Object.create(null);this.renderContents_(a.contents);this.position();this.handleToolboxItemResize()};
|
|
1316
1376
|
module$exports$Blockly$Toolbox.Toolbox.prototype.renderContents_=function(a){for(var b=document.createDocumentFragment(),c=0;c<a.length;c++)this.createToolboxItem_(a[c],b);this.contentsDiv_.appendChild(b)};
|
|
1317
|
-
module$exports$Blockly$Toolbox.Toolbox.prototype.createToolboxItem_=function(a,b){var c=a.kind;"CATEGORY"===c.toUpperCase()&&(0,module$exports$Blockly$utils$toolbox.isCategoryCollapsible)(a)&&(c=module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.registrationName);if(c=(0,module$exports$Blockly$registry.getClass)(module$exports$Blockly$registry.Type.TOOLBOX_ITEM,c.toLowerCase()))a=new c(a,this),
|
|
1377
|
+
module$exports$Blockly$Toolbox.Toolbox.prototype.createToolboxItem_=function(a,b){var c=a.kind;"CATEGORY"===c.toUpperCase()&&(0,module$exports$Blockly$utils$toolbox.isCategoryCollapsible)(a)&&(c=module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.registrationName);if(c=(0,module$exports$Blockly$registry.getClass)(module$exports$Blockly$registry.Type.TOOLBOX_ITEM,c.toLowerCase()))a=new c(a,this),a.init(),this.addToolboxItem_(a),(c=a.getDiv())&&b.appendChild(c),a.getClickTarget()&&
|
|
1318
1378
|
a.getClickTarget().setAttribute("id",a.getId())};module$exports$Blockly$Toolbox.Toolbox.prototype.addToolboxItem_=function(a){this.contents_.push(a);this.contentMap_[a.getId()]=a;if(a.isCollapsible()){a=a.getChildToolboxItems();for(var b=0;b<a.length;b++)this.addToolboxItem_(a[b])}};module$exports$Blockly$Toolbox.Toolbox.prototype.getToolboxItems=function(){return this.contents_};
|
|
1319
1379
|
module$exports$Blockly$Toolbox.Toolbox.prototype.addStyle=function(a){(0,module$exports$Blockly$utils$dom.addClass)(this.HtmlDiv,a)};module$exports$Blockly$Toolbox.Toolbox.prototype.removeStyle=function(a){(0,module$exports$Blockly$utils$dom.removeClass)(this.HtmlDiv,a)};
|
|
1320
1380
|
module$exports$Blockly$Toolbox.Toolbox.prototype.getClientRect=function(){if(!this.HtmlDiv||!this.isVisible_)return null;var a=this.HtmlDiv.getBoundingClientRect(),b=a.top,c=b+a.height,d=a.left;a=d+a.width;return this.toolboxPosition===module$exports$Blockly$utils$toolbox.Position.TOP?new module$exports$Blockly$utils$Rect.Rect(-1E7,c,-1E7,1E7):this.toolboxPosition===module$exports$Blockly$utils$toolbox.Position.BOTTOM?new module$exports$Blockly$utils$Rect.Rect(b,1E7,-1E7,1E7):this.toolboxPosition===
|
|
@@ -1341,12 +1401,12 @@ module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.getY=function
|
|
|
1341
1401
|
module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.position=function(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var a=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=a.width;this.setBackgroundPath_(a.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS);a=this.getX();var b=this.getY();this.positionAt_(this.width_,this.height_,a,b)}};
|
|
1342
1402
|
module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.setBackgroundPath_=function(a,b){var c=this.toolboxPosition_===module$exports$Blockly$utils$toolbox.Position.TOP,d=["M 0,"+(c?0:this.CORNER_RADIUS)];c?(d.push("h",a+2*this.CORNER_RADIUS),d.push("v",b),d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),d.push("h",-a),d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(d.push("a",this.CORNER_RADIUS,
|
|
1343
1403
|
this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),d.push("h",a),d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),d.push("v",b),d.push("h",-a-2*this.CORNER_RADIUS));d.push("z");this.svgBackground_.setAttribute("d",d.join(" "))};module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.scrollToStart=function(){this.workspace_.scrollbar.setX(this.RTL?Infinity:0)};
|
|
1344
|
-
module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.wheel_=function(a){var b=(0,module$exports$Blockly$browserEvents.getScrollDeltaPixels)(a);if(b=b.x||b.y){var c=this.workspace_.getMetricsManager(),d=c.getScrollMetrics();b=c.getViewMetrics().left-d.left+b;this.workspace_.scrollbar.setX(b);(0,module$exports$Blockly$WidgetDiv.hide)();module$exports$Blockly$
|
|
1404
|
+
module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.wheel_=function(a){var b=(0,module$exports$Blockly$browserEvents.getScrollDeltaPixels)(a);if(b=b.x||b.y){var c=this.workspace_.getMetricsManager(),d=c.getScrollMetrics();b=c.getViewMetrics().left-d.left+b;this.workspace_.scrollbar.setX(b);(0,module$exports$Blockly$WidgetDiv.hide)();(0,module$exports$Blockly$dropDownDiv.hideWithoutAnimation)()}a.preventDefault();a.stopPropagation()};
|
|
1345
1405
|
module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.layout_=function(a,b){this.workspace_.scale=this.targetWorkspace.scale;var c=this.MARGIN,d=c+this.tabWidth_;this.RTL&&(a=a.reverse());for(var e=0,f;f=a[e];e++)if("block"===f.type){f=f.block;for(var g=f.getDescendants(!1),h=0,k;k=g[h];h++)k.isInFlyout=!0;f.render();g=f.getSvgRoot();h=f.getHeightWidth();k=f.outputConnection?this.tabWidth_:0;k=this.RTL?d+h.width:d-k;f.moveBy(k,c);k=this.createRect_(f,k,c,h,e);d+=h.width+b[e];this.addBlockListeners_(g,
|
|
1346
1406
|
f,k)}else"button"===f.type&&(this.initFlyoutButton_(f.button,d,c),d+=f.button.width+b[e])};module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.isDragTowardWorkspace=function(a){a=Math.atan2(a.y,a.x)/Math.PI*180;var b=this.dragAngleRange_;return a<90+b&&a>90-b||a>-90-b&&a<-90+b?!0:!1};
|
|
1347
1407
|
module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;var a=this.svgGroup_.getBoundingClientRect(),b=a.top;return this.toolboxPosition_===module$exports$Blockly$utils$toolbox.Position.TOP?new module$exports$Blockly$utils$Rect.Rect(-1E9,b+a.height,-1E9,1E9):new module$exports$Blockly$utils$Rect.Rect(b,1E9,-1E9,1E9)};
|
|
1348
|
-
module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.getFlyoutScale();for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);c=this.buttons_;d=0;for(var e;e=c[d];d++)a=Math.max(a,e.height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness;if(this.height_!==a){for(c=0;d=b[c];c++)d
|
|
1349
|
-
d);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==module$exports$Blockly$utils$toolbox.Position.TOP||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+a);this.height_=a;this.position();this.targetWorkspace.recordDragTargets()}};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,module$exports$Blockly$registry.DEFAULT,module$exports$Blockly$HorizontalFlyout.HorizontalFlyout);$.module$exports$Blockly$Generator={Generator:function(a){this.name_=a;this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g");this.STATEMENT_SUFFIX=this.STATEMENT_PREFIX=this.INFINITE_LOOP_TRAP=null;this.INDENT=" ";this.COMMENT_WRAP=60;this.ORDER_OVERRIDES=[];this.isInitialized=null}};
|
|
1408
|
+
module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.getFlyoutScale();for(var a=0,b=this.workspace_.getTopBlocks(!1),c=0,d;d=b[c];c++)a=Math.max(a,d.getHeightWidth().height);c=this.buttons_;d=0;for(var e;e=c[d];d++)a=Math.max(a,e.height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness;if(this.height_!==a){for(c=0;d=b[c];c++)this.rectMap_.has(d)&&this.moveRectToBlock_(this.rectMap_.get(d),
|
|
1409
|
+
d);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==module$exports$Blockly$utils$toolbox.Position.TOP||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+a);this.height_=a;this.position();this.targetWorkspace.recordDragTargets()}};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,module$exports$Blockly$registry.DEFAULT,module$exports$Blockly$HorizontalFlyout.HorizontalFlyout);$.module$exports$Blockly$Generator={Generator:function(a){this.name_=a;this.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}";this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g");this.STATEMENT_SUFFIX=this.STATEMENT_PREFIX=this.INFINITE_LOOP_TRAP=null;this.INDENT=" ";this.COMMENT_WRAP=60;this.ORDER_OVERRIDES=[];this.isInitialized=null;this.RESERVED_WORDS_="";this.nameDB_=this.functionNames_=this.definitions_=void 0}};
|
|
1350
1410
|
$.module$exports$Blockly$Generator.Generator.prototype.workspaceToCode=function(a){a||(console.warn("No workspace specified in workspaceToCode call. Guessing."),a=(0,$.module$exports$Blockly$common.getMainWorkspace)());var b=[];this.init(a);a=a.getTopBlocks(!0);for(var c=0,d;d=a[c];c++){var e=this.blockToCode(d);Array.isArray(e)&&(e=e[0]);e&&(d.outputConnection&&(e=this.scrubNakedValue(e),this.STATEMENT_PREFIX&&!d.suppressPrefixSuffix&&(e=this.injectId(this.STATEMENT_PREFIX,d)+e),this.STATEMENT_SUFFIX&&
|
|
1351
1411
|
!d.suppressPrefixSuffix&&(e+=this.injectId(this.STATEMENT_SUFFIX,d))),b.push(e))}b=b.join("\n");b=this.finish(b);b=b.replace(/^\s+\n/,"");b=b.replace(/\n\s+$/,"\n");return b=b.replace(/[ \t]+\n/g,"\n")};$.module$exports$Blockly$Generator.Generator.prototype.prefixLines=function(a,b){return b+a.replace(/(?!\n$)\n/g,"\n"+b)};
|
|
1352
1412
|
$.module$exports$Blockly$Generator.Generator.prototype.allNestedComments=function(a){var b=[];a=a.getDescendants(!0);for(var c=0;c<a.length;c++){var d=a[c].getCommentText();d&&b.push(d)}b.length&&b.push("");return b.join("\n")};
|
|
@@ -1355,86 +1415,56 @@ if(Array.isArray(c)){if(!a.outputConnection)throw TypeError("Expecting string fr
|
|
|
1355
1415
|
$.module$exports$Blockly$Generator.Generator.prototype.valueToCode=function(a,b,c){if(isNaN(c))throw TypeError("Expecting valid order from block: "+a.type);var d=a.getInputTargetBlock(b);if(!d)return"";b=this.blockToCode(d);if(""===b)return"";if(!Array.isArray(b))throw TypeError("Expecting tuple from value block: "+d.type);a=b[0];b=b[1];if(isNaN(b))throw TypeError("Expecting valid order from value block: "+d.type);if(!a)return"";d=!1;var e=Math.floor(c),f=Math.floor(b);if(e<=f&&(e!==f||0!==e&&99!==
|
|
1356
1416
|
e))for(d=!0,e=0;e<this.ORDER_OVERRIDES.length;e++)if(this.ORDER_OVERRIDES[e][0]===c&&this.ORDER_OVERRIDES[e][1]===b){d=!1;break}d&&(a="("+a+")");return a};$.module$exports$Blockly$Generator.Generator.prototype.statementToCode=function(a,b){a=a.getInputTargetBlock(b);b=this.blockToCode(a);if("string"!==typeof b)throw TypeError("Expecting code from statement block: "+(a&&a.type));b&&(b=this.prefixLines(b,this.INDENT));return b};
|
|
1357
1417
|
$.module$exports$Blockly$Generator.Generator.prototype.addLoopTrap=function(a,b){this.INFINITE_LOOP_TRAP&&(a=this.prefixLines(this.injectId(this.INFINITE_LOOP_TRAP,b),this.INDENT)+a);this.STATEMENT_SUFFIX&&!b.suppressPrefixSuffix&&(a=this.prefixLines(this.injectId(this.STATEMENT_SUFFIX,b),this.INDENT)+a);this.STATEMENT_PREFIX&&!b.suppressPrefixSuffix&&(a+=this.prefixLines(this.injectId(this.STATEMENT_PREFIX,b),this.INDENT));return a};
|
|
1358
|
-
$.module$exports$Blockly$Generator.Generator.prototype.injectId=function(a,b){b=b.id.replace(/\$/g,"$$$$");return a.replace(/%1/g,"'"+b+"'")};$.module$exports$Blockly$Generator.Generator.prototype.
|
|
1359
|
-
Object.defineProperties($.module$exports$Blockly$Generator.Generator.prototype,{variableDB_:{get:function(){(0,module$exports$Blockly$utils$deprecation.warn)("variableDB_","May 2021","May 2026","nameDB_");return this.nameDB_},set:function(a){(0,module$exports$Blockly$utils$deprecation.warn)("variableDB_","May 2021","May 2026","nameDB_");this.nameDB_=a}}});
|
|
1418
|
+
$.module$exports$Blockly$Generator.Generator.prototype.injectId=function(a,b){b=b.id.replace(/\$/g,"$$$$");return a.replace(/%1/g,"'"+b+"'")};$.module$exports$Blockly$Generator.Generator.prototype.addReservedWords=function(a){this.RESERVED_WORDS_+=a+","};
|
|
1360
1419
|
$.module$exports$Blockly$Generator.Generator.prototype.provideFunction_=function(a,b){if(!this.definitions_[a]){var c=this.nameDB_.getDistinctName(a,$.module$exports$Blockly$Names.NameType.PROCEDURE);this.functionNames_[a]=c;Array.isArray(b)&&(b=b.join("\n"));b=b.trim().replace(this.FUNCTION_NAME_PLACEHOLDER_REGEXP_,c);for(var d;d!==b;)d=b,b=b.replace(/^(( {2})*) {2}/gm,"$1\x00");b=b.replace(/\0/g,this.INDENT);this.definitions_[a]=b}return this.functionNames_[a]};
|
|
1361
|
-
$.module$exports$Blockly$Generator.Generator.prototype.init=function(a){this.definitions_=Object.create(null);this.functionNames_=Object.create(null)};$.module$exports$Blockly$Generator.Generator.prototype.scrub_=function(a,b,c){return b};$.module$exports$Blockly$Generator.Generator.prototype.finish=function(a){delete this.definitions_;delete this.functionNames_;return a};$.module$exports$Blockly$Generator.Generator.prototype.scrubNakedValue=function(a){return a}
|
|
1362
|
-
(0
|
|
1363
|
-
|
|
1364
|
-
var module$contents$Blockly$FieldDropdown_IMAGE_Y_OFFSET=5,module$contents$Blockly$FieldDropdown_IMAGE_Y_PADDING=2*module$contents$Blockly$FieldDropdown_IMAGE_Y_OFFSET;$.module$exports$Blockly$FieldDropdown.FieldDropdown.ARROW_CHAR=module$exports$Blockly$utils$userAgent.ANDROID?"\u25bc":"\u25be";$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.CURSOR="default";
|
|
1365
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.initView=function(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot();this.createTextElement_();this.imageElement_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.IMAGE,{},this.fieldGroup_);this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&(0,module$exports$Blockly$utils$dom.addClass)(this.borderRect_,
|
|
1366
|
-
"blocklyDropdownRect")};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.shouldAddBorderRect_=function(){return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.sourceBlock_.isShadow()};
|
|
1367
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.createTextArrow_=function(){this.arrow_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.TSPAN,{},this.textElement_);this.arrow_.appendChild(document.createTextNode(this.sourceBlock_.RTL?$.module$exports$Blockly$FieldDropdown.FieldDropdown.ARROW_CHAR+" ":" "+$.module$exports$Blockly$FieldDropdown.FieldDropdown.ARROW_CHAR));this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textContent_):
|
|
1368
|
-
this.textElement_.appendChild(this.arrow_)};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.createSVGArrow_=function(){this.svgArrow_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.IMAGE,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(module$exports$Blockly$utils$dom.XLINK_NS,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)};
|
|
1369
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.showEditor_=function(a){this.dropdownCreate_();this.menu_.openingCoords=a&&"number"===typeof a.clientX?new module$exports$Blockly$utils$Coordinate.Coordinate(a.clientX,a.clientY):null;module$exports$Blockly$DropDownDiv.DropDownDiv.clearContent();this.menu_.render(module$exports$Blockly$DropDownDiv.DropDownDiv.getContentDiv());a=this.menu_.getElement();(0,module$exports$Blockly$utils$dom.addClass)(a,"blocklyDropdownMenu");if(this.getConstants().FIELD_DROPDOWN_COLOURED_DIV){a=
|
|
1370
|
-
this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().getColour():this.sourceBlock_.getColour();var b=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;module$exports$Blockly$DropDownDiv.DropDownDiv.setColour(a,b)}module$exports$Blockly$DropDownDiv.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this));this.menu_.focus();this.selectedMenuItem_&&this.menu_.setHighlighted(this.selectedMenuItem_);this.applyColour()};
|
|
1371
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.dropdownCreate_=function(){var a=new module$exports$Blockly$Menu.Menu;a.setRole(module$exports$Blockly$utils$aria.Role.LISTBOX);this.menu_=a;var b=this.getOptions(!1);this.selectedMenuItem_=null;for(var c=0;c<b.length;c++){var d=b[c][0],e=b[c][1];if("object"===typeof d){var f=new Image(d.width,d.height);f.src=d.src;f.alt=d.alt||"";d=f}d=new module$exports$Blockly$MenuItem.MenuItem(d,e);d.setRole(module$exports$Blockly$utils$aria.Role.OPTION);
|
|
1372
|
-
d.setRightToLeft(this.sourceBlock_.RTL);d.setCheckable(!0);a.addChild(d);d.setChecked(e===this.value_);e===this.value_&&(this.selectedMenuItem_=d);d.onAction(this.handleMenuActionEvent_,this)}};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.dropdownDispose_=function(){this.menu_&&this.menu_.dispose();this.selectedMenuItem_=this.menu_=null;this.applyColour()};
|
|
1373
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.handleMenuActionEvent_=function(a){module$exports$Blockly$DropDownDiv.DropDownDiv.hideIfOwner(this,!0);this.onItemSelected_(this.menu_,a)};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.onItemSelected_=function(a,b){this.setValue(b.getValue())};
|
|
1374
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.trimOptions_=function(){var a=this.menuGenerator_;if(Array.isArray(a)){for(var b=!1,c=0;c<a.length;c++){var d=a[c][0];"string"===typeof d?a[c][0]=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(d):(null!==d.alt&&(a[c][0].alt=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(d.alt)),b=!0)}if(!(b||2>a.length)){b=[];for(c=0;c<a.length;c++)b.push(a[c][0]);c=(0,$.module$exports$Blockly$utils$string.shortestStringLength)(b);
|
|
1375
|
-
d=(0,$.module$exports$Blockly$utils$string.commonWordPrefix)(b,c);var e=(0,$.module$exports$Blockly$utils$string.commonWordSuffix)(b,c);!d&&!e||c<=d+e||(d&&(this.prefixField=b[0].substring(0,d-1)),e&&(this.suffixField=b[0].substr(1-e)),this.menuGenerator_=$.module$exports$Blockly$FieldDropdown.FieldDropdown.applyTrim_(a,d,e))}}};
|
|
1376
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.applyTrim_=function(a,b,c){for(var d=[],e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];f=f.substring(b,f.length-c);d[e]=[f,g]}return d};$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.isOptionListDynamic=function(){return"function"===typeof this.menuGenerator_};
|
|
1377
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.getOptions=function(a){return this.isOptionListDynamic()?(this.generatedOptions_&&a||(this.generatedOptions_=this.menuGenerator_.call(this),module$contents$Blockly$FieldDropdown_validateOptions(this.generatedOptions_)),this.generatedOptions_):this.menuGenerator_};
|
|
1378
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.doClassValidation_=function(a){for(var b=!1,c=this.getOptions(!0),d=0,e;e=c[d];d++)if(e[1]===a){b=!0;break}return b?a:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+a),null)};
|
|
1379
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.doValueUpdate_=function(a){$.module$exports$Blockly$FieldDropdown.FieldDropdown.superClass_.doValueUpdate_.call(this,a);a=this.getOptions(!0);for(var b=0,c;c=a[b];b++)c[1]===this.value_&&(this.selectedOption_=c)};
|
|
1380
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.applyColour=function(){this.borderRect_&&(this.borderRect_.setAttribute("stroke",this.sourceBlock_.style.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",this.sourceBlock_.style.colourTertiary):this.borderRect_.setAttribute("fill","transparent"));this.sourceBlock_&&this.arrow_&&(this.sourceBlock_.isShadow()?this.arrow_.style.fill=this.sourceBlock_.style.colourSecondary:this.arrow_.style.fill=this.sourceBlock_.style.colourPrimary)};
|
|
1381
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.render_=function(){this.textContent_.nodeValue="";this.imageElement_.style.display="none";var a=this.selectedOption_&&this.selectedOption_[0];a&&"object"===typeof a?this.renderSelectedImage_(a):this.renderSelectedText_();this.positionBorderRect_()};
|
|
1382
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.renderSelectedImage_=function(a){this.imageElement_.style.display="";this.imageElement_.setAttributeNS(module$exports$Blockly$utils$dom.XLINK_NS,"xlink:href",a.src);this.imageElement_.setAttribute("height",a.height);this.imageElement_.setAttribute("width",a.width);var b=Number(a.height);a=Number(a.width);var c=!!this.borderRect_,d=Math.max(c?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,b+module$contents$Blockly$FieldDropdown_IMAGE_Y_PADDING);
|
|
1383
|
-
c=c?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var e=this.svgArrow_?this.positionSVGArrow_(a+c,d/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):(0,module$exports$Blockly$utils$dom.getFastTextWidth)(this.arrow_,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);this.size_.width=a+e+2*c;this.size_.height=d;var f=0;this.sourceBlock_.RTL?this.imageElement_.setAttribute("x",c+e):(f=a+e,this.textElement_.setAttribute("text-anchor",
|
|
1384
|
-
"end"),this.imageElement_.setAttribute("x",c));this.imageElement_.setAttribute("y",d/2-b/2);this.positionTextElement_(f+c,a+e)};
|
|
1385
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.renderSelectedText_=function(){this.textContent_.nodeValue=this.getDisplayText_();(0,module$exports$Blockly$utils$dom.addClass)(this.textElement_,"blocklyDropdownText");this.textElement_.setAttribute("text-anchor","start");var a=!!this.borderRect_,b=Math.max(a?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT),c=(0,module$exports$Blockly$utils$dom.getFastTextWidth)(this.textElement_,this.getConstants().FIELD_TEXT_FONTSIZE,
|
|
1386
|
-
this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);a=a?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var d=0;this.svgArrow_&&(d=this.positionSVGArrow_(c+a,b/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2));this.size_.width=c+d+2*a;this.size_.height=b;this.positionTextElement_(a,c)};
|
|
1387
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.positionSVGArrow_=function(a,b){if(!this.svgArrow_)return 0;var c=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,d=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,e=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;this.svgArrow_.setAttribute("transform","translate("+(this.sourceBlock_.RTL?c:a+d)+","+b+")");return e+d};
|
|
1388
|
-
$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.getText_=function(){if(!this.selectedOption_)return null;var a=this.selectedOption_[0];return"object"===typeof a?a.alt:a};
|
|
1389
|
-
var module$contents$Blockly$FieldDropdown_validateOptions=function(a){if(!Array.isArray(a))throw TypeError("FieldDropdown options must be an array.");if(!a.length)throw TypeError("FieldDropdown options must not be an empty array.");for(var b=!1,c=0;c<a.length;c++){var d=a[c];Array.isArray(d)?"string"!==typeof d[1]?(b=!0,console.error("Invalid option["+c+"]: Each FieldDropdown option id must be a string. Found "+d[1]+" in: ",d)):d[0]&&"string"!==typeof d[0]&&"string"!==typeof d[0].src&&(b=!0,console.error("Invalid option["+
|
|
1390
|
-
c+"]: Each FieldDropdown option must have a string label or image description. Found"+d[0]+" in: ",d)):(b=!0,console.error("Invalid option["+c+"]: Each FieldDropdown option must be an array. Found: ",d))}if(b)throw TypeError("Found invalid FieldDropdown options.");};(0,module$exports$Blockly$fieldRegistry.register)("field_dropdown",$.module$exports$Blockly$FieldDropdown.FieldDropdown);var module$exports$Blockly$FieldVariable={FieldVariable:function(a,b,c,d,e){this.menuGenerator_=module$exports$Blockly$FieldVariable.FieldVariable.dropdownCreate;this.defaultVariableName="string"===typeof a?a:"";this.size_=new module$exports$Blockly$utils$Size.Size(0,0);e&&this.configure_(e);b&&this.setValidator(b);e||this.setTypes_(c,d)}};(0,$.module$exports$Blockly$utils$object.inherits)(module$exports$Blockly$FieldVariable.FieldVariable,$.module$exports$Blockly$FieldDropdown.FieldDropdown);
|
|
1391
|
-
module$exports$Blockly$FieldVariable.FieldVariable.fromJson=function(a){return new this((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.variable),void 0,void 0,void 0,a)};module$exports$Blockly$FieldVariable.FieldVariable.prototype.SERIALIZABLE=!0;module$exports$Blockly$FieldVariable.FieldVariable.prototype.configure_=function(a){module$exports$Blockly$FieldVariable.FieldVariable.superClass_.configure_.call(this,a);this.setTypes_(a.variableTypes,a.defaultType)};
|
|
1420
|
+
$.module$exports$Blockly$Generator.Generator.prototype.init=function(a){this.definitions_=Object.create(null);this.functionNames_=Object.create(null)};$.module$exports$Blockly$Generator.Generator.prototype.scrub_=function(a,b,c){return b};$.module$exports$Blockly$Generator.Generator.prototype.finish=function(a){delete this.definitions_;delete this.functionNames_;return a};$.module$exports$Blockly$Generator.Generator.prototype.scrubNakedValue=function(a){return a};
|
|
1421
|
+
Object.defineProperties($.module$exports$Blockly$Generator.Generator.prototype,{variableDB_:{get:function(){(0,module$exports$Blockly$utils$deprecation.warn)("variableDB_","May 2021","May 2026","nameDB_");return this.nameDB_},set:function(a){(0,module$exports$Blockly$utils$deprecation.warn)("variableDB_","May 2021","May 2026","nameDB_");this.nameDB_=a}}});var module$exports$Blockly$FieldVariable={FieldVariable:function(a,b,c,d,e){$.module$exports$Blockly$FieldDropdown.FieldDropdown.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);this.menuGenerator_=module$exports$Blockly$FieldVariable.FieldVariable.dropdownCreate;this.defaultVariableName="string"===typeof a?a:"";this.defaultType_="";this.variableTypes=[];this.size_=new module$exports$Blockly$utils$Size.Size(0,0);this.variable_=null;this.SERIALIZABLE=!0;a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&
|
|
1422
|
+
(e?this.configure_(e):this.setTypes_(c,d),b&&this.setValidator(b))}};$.$jscomp.inherits(module$exports$Blockly$FieldVariable.FieldVariable,$.module$exports$Blockly$FieldDropdown.FieldDropdown);module$exports$Blockly$FieldVariable.FieldVariable.prototype.configure_=function(a){$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.configure_.call(this,a);this.setTypes_(a.variableTypes,a.defaultType)};
|
|
1392
1423
|
module$exports$Blockly$FieldVariable.FieldVariable.prototype.initModel=function(){if(!this.variable_){var a=(0,$.module$exports$Blockly$Variables.getOrCreateVariablePackage)(this.sourceBlock_.workspace,null,this.defaultVariableName,this.defaultType_);this.doValueUpdate_(a.getId())}};
|
|
1393
|
-
module$exports$Blockly$FieldVariable.FieldVariable.prototype.shouldAddBorderRect_=function(){return module$exports$Blockly$
|
|
1424
|
+
module$exports$Blockly$FieldVariable.FieldVariable.prototype.shouldAddBorderRect_=function(){return $.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.shouldAddBorderRect_.call(this)&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||"variables_get"!==this.sourceBlock_.type)};
|
|
1394
1425
|
module$exports$Blockly$FieldVariable.FieldVariable.prototype.fromXml=function(a){var b=a.getAttribute("id"),c=a.textContent,d=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";b=(0,$.module$exports$Blockly$Variables.getOrCreateVariablePackage)(this.sourceBlock_.workspace,b,c,d);if(null!==d&&d!==b.type)throw Error("Serialized variable type with id '"+b.getId()+"' had type "+b.type+", and does not match variable field that references it: "+(0,$.module$exports$Blockly$Xml.domToText)(a)+
|
|
1395
1426
|
".");this.setValue(b.getId())};module$exports$Blockly$FieldVariable.FieldVariable.prototype.toXml=function(a){this.initModel();a.id=this.variable_.getId();a.textContent=this.variable_.name;this.variable_.type&&a.setAttribute("variabletype",this.variable_.type);return a};
|
|
1396
1427
|
module$exports$Blockly$FieldVariable.FieldVariable.prototype.saveState=function(a){var b=this.saveLegacyState(module$exports$Blockly$FieldVariable.FieldVariable);if(null!==b)return b;this.initModel();b={id:this.variable_.getId()};a&&(b.name=this.variable_.name,b.type=this.variable_.type);return b};
|
|
1397
1428
|
module$exports$Blockly$FieldVariable.FieldVariable.prototype.loadState=function(a){this.loadLegacyState(module$exports$Blockly$FieldVariable.FieldVariable,a)||(a=(0,$.module$exports$Blockly$Variables.getOrCreateVariablePackage)(this.sourceBlock_.workspace,a.id||null,a.name,a.type||""),this.setValue(a.getId()))};
|
|
1398
|
-
module$exports$Blockly$FieldVariable.FieldVariable.prototype.setSourceBlock=function(a){if(a.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.")
|
|
1429
|
+
module$exports$Blockly$FieldVariable.FieldVariable.prototype.setSourceBlock=function(a){if(a.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.setSourceBlock.call(this,a)};module$exports$Blockly$FieldVariable.FieldVariable.prototype.getValue=function(){return this.variable_?this.variable_.getId():null};
|
|
1399
1430
|
module$exports$Blockly$FieldVariable.FieldVariable.prototype.getText=function(){return this.variable_?this.variable_.name:""};module$exports$Blockly$FieldVariable.FieldVariable.prototype.getVariable=function(){return this.variable_};module$exports$Blockly$FieldVariable.FieldVariable.prototype.getValidator=function(){return this.variable_?this.validator_:null};
|
|
1400
1431
|
module$exports$Blockly$FieldVariable.FieldVariable.prototype.doClassValidation_=function(a){if(null===a)return null;var b=(0,$.module$exports$Blockly$Variables.getVariable)(this.sourceBlock_.workspace,a);if(!b)return console.warn("Variable id doesn't point to a real variable! ID was "+a),null;b=b.type;return this.typeIsAllowed_(b)?a:(console.warn("Variable type doesn't match this field! Type was "+b),null)};
|
|
1401
|
-
module$exports$Blockly$FieldVariable.FieldVariable.prototype.doValueUpdate_=function(a){this.variable_=(0,$.module$exports$Blockly$Variables.getVariable)(this.sourceBlock_.workspace,a)
|
|
1432
|
+
module$exports$Blockly$FieldVariable.FieldVariable.prototype.doValueUpdate_=function(a){this.variable_=(0,$.module$exports$Blockly$Variables.getVariable)(this.sourceBlock_.workspace,a);$.module$exports$Blockly$FieldDropdown.FieldDropdown.prototype.doValueUpdate_.call(this,a)};module$exports$Blockly$FieldVariable.FieldVariable.prototype.typeIsAllowed_=function(a){var b=this.getVariableTypes_();if(!b)return!0;for(var c=0;c<b.length;c++)if(a===b[c])return!0;return!1};
|
|
1402
1433
|
module$exports$Blockly$FieldVariable.FieldVariable.prototype.getVariableTypes_=function(){var a=this.variableTypes;if(null===a&&this.sourceBlock_&&this.sourceBlock_.workspace)return this.sourceBlock_.workspace.getVariableTypes();a=a||[""];if(0===a.length)throw a=this.getText(),Error("'variableTypes' of field variable "+a+" was an empty list");return a};
|
|
1403
1434
|
module$exports$Blockly$FieldVariable.FieldVariable.prototype.setTypes_=function(a,b){b=b||"";if(null===a||void 0===a)a=null;else if(Array.isArray(a)){for(var c=!1,d=0;d<a.length;d++)a[d]===b&&(c=!0);if(!c)throw Error("Invalid default type '"+b+"' in the definition of a FieldVariable");}else throw Error("'variableTypes' was not an array in the definition of a FieldVariable");this.defaultType_=b;this.variableTypes=a};module$exports$Blockly$FieldVariable.FieldVariable.prototype.refreshVariableName=function(){this.forceRerender()};
|
|
1404
|
-
module$exports$Blockly$FieldVariable.FieldVariable.dropdownCreate=function(){if(!this.variable_)throw Error("Tried to call dropdownCreate on a variable field with no variable selected.");var a=this.getText(),b=[];if(this.sourceBlock_&&this.sourceBlock_.workspace)for(var c=this.getVariableTypes_(),d=0;d<c.length;d++){var e=this.sourceBlock_.workspace.getVariablesOfType(c[d]);b=b.concat(e)}b.sort(module$exports$Blockly$VariableModel.VariableModel.compareByName);c=[];for(d=0;d<b.length;d++)c[d]=[b[d].name,
|
|
1405
|
-
b[d].getId()];c.push([$.module$exports$Blockly$Msg.Msg.RENAME_VARIABLE,module$exports$Blockly$internalConstants.RENAME_VARIABLE_ID]);$.module$exports$Blockly$Msg.Msg.DELETE_VARIABLE&&c.push([$.module$exports$Blockly$Msg.Msg.DELETE_VARIABLE.replace("%1",a),module$exports$Blockly$internalConstants.DELETE_VARIABLE_ID]);return c};
|
|
1406
1435
|
module$exports$Blockly$FieldVariable.FieldVariable.prototype.onItemSelected_=function(a,b){a=b.getValue();if(this.sourceBlock_&&this.sourceBlock_.workspace){if(a===module$exports$Blockly$internalConstants.RENAME_VARIABLE_ID){(0,$.module$exports$Blockly$Variables.renameVariable)(this.sourceBlock_.workspace,this.variable_);return}if(a===module$exports$Blockly$internalConstants.DELETE_VARIABLE_ID){this.sourceBlock_.workspace.deleteVariableById(this.variable_.getId());return}}this.setValue(a)};
|
|
1407
|
-
module$exports$Blockly$FieldVariable.FieldVariable.prototype.referencesVariables=function(){return!0};
|
|
1408
|
-
|
|
1409
|
-
$.module$exports$Blockly$
|
|
1436
|
+
module$exports$Blockly$FieldVariable.FieldVariable.prototype.referencesVariables=function(){return!0};module$exports$Blockly$FieldVariable.FieldVariable.fromJson=function(a){return new this((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.variable),void 0,void 0,void 0,a)};
|
|
1437
|
+
module$exports$Blockly$FieldVariable.FieldVariable.dropdownCreate=function(){if(!this.variable_)throw Error("Tried to call dropdownCreate on a variable field with no variable selected.");var a=this.getText(),b=[];if(this.sourceBlock_&&this.sourceBlock_.workspace)for(var c=this.getVariableTypes_(),d=0;d<c.length;d++){var e=this.sourceBlock_.workspace.getVariablesOfType(c[d]);b=b.concat(e)}b.sort(module$exports$Blockly$VariableModel.VariableModel.compareByName);c=[];for(d=0;d<b.length;d++)c[d]=[b[d].name,
|
|
1438
|
+
b[d].getId()];c.push([$.module$exports$Blockly$Msg.Msg.RENAME_VARIABLE,module$exports$Blockly$internalConstants.RENAME_VARIABLE_ID]);$.module$exports$Blockly$Msg.Msg.DELETE_VARIABLE&&c.push([$.module$exports$Blockly$Msg.Msg.DELETE_VARIABLE.replace("%1",a),module$exports$Blockly$internalConstants.DELETE_VARIABLE_ID]);return c};(0,module$exports$Blockly$fieldRegistry.register)("field_variable",module$exports$Blockly$FieldVariable.FieldVariable);$.module$exports$Blockly$FieldTextInput={FieldTextInput:function(a,b,c){module$exports$Blockly$Field.Field.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);this.spellcheck_=!0;this.htmlInput_=null;this.isTextValid_=this.isBeingEdited_=!1;this.onKeyInputWrapper_=this.onKeyDownWrapper_=null;this.fullBlockClickTarget_=!1;this.workspace_=null;this.SERIALIZABLE=!0;this.CURSOR="text";a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}};
|
|
1439
|
+
$.$jscomp.inherits($.module$exports$Blockly$FieldTextInput.FieldTextInput,module$exports$Blockly$Field.Field);$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.configure_=function(a){module$exports$Blockly$Field.Field.prototype.configure_.call(this,a);"boolean"===typeof a.spellcheck&&(this.spellcheck_=a.spellcheck)};
|
|
1410
1440
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.initView=function(){if(this.getConstants().FULL_BLOCK_FIELDS){for(var a=0,b=0,c=0,d;d=this.sourceBlock_.inputList[c];c++){for(var e=0;d.fieldRow[e];e++)a++;d.connection&&b++}this.fullBlockClickTarget_=1>=a&&this.sourceBlock_.outputConnection&&!b}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_();this.createTextElement_()};
|
|
1411
1441
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.doClassValidation_=function(a){return null===a||void 0===a?null:String(a)};
|
|
1412
1442
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.doValueInvalid_=function(a){this.isBeingEdited_&&(this.isTextValid_=!1,a=this.value_,this.value_=this.htmlInput_.untypedDefaultValue_,this.sourceBlock_&&(0,module$exports$Blockly$Events$utils.isEnabled)()&&(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CHANGE))(this.sourceBlock_,"field",this.name||null,a,this.value_)))};
|
|
1413
1443
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.doValueUpdate_=function(a){this.isTextValid_=!0;this.value_=a;this.isBeingEdited_||(this.isDirty_=!0)};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.applyColour=function(){this.sourceBlock_&&this.getConstants().FULL_BLOCK_FIELDS&&(this.borderRect_?this.borderRect_.setAttribute("stroke",this.sourceBlock_.style.colourTertiary):this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR))};
|
|
1414
|
-
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.render_=function(){
|
|
1415
|
-
|
|
1444
|
+
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.render_=function(){module$exports$Blockly$Field.Field.prototype.render_.call(this);if(this.isBeingEdited_){this.resizeEditor_();var a=this.htmlInput_;this.isTextValid_?((0,module$exports$Blockly$utils$dom.removeClass)(a,"blocklyInvalidInput"),(0,module$exports$Blockly$utils$aria.setState)(a,module$exports$Blockly$utils$aria.State.INVALID,!1)):((0,module$exports$Blockly$utils$dom.addClass)(a,"blocklyInvalidInput"),(0,module$exports$Blockly$utils$aria.setState)(a,
|
|
1445
|
+
module$exports$Blockly$utils$aria.State.INVALID,!0))}};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.setSpellcheck=function(a){a!==this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))};
|
|
1416
1446
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.showEditor_=function(a,b){this.workspace_=this.sourceBlock_.workspace;a=b||!1;!a&&(module$exports$Blockly$utils$userAgent.MOBILE||module$exports$Blockly$utils$userAgent.ANDROID||module$exports$Blockly$utils$userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(a)};
|
|
1417
1447
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.showPromptEditor_=function(){(0,module$exports$Blockly$dialog.prompt)($.module$exports$Blockly$Msg.Msg.CHANGE_VALUE_TITLE,this.getText(),function(a){null!==a&&this.setValue(this.getValueFromEditorText_(a))}.bind(this))};
|
|
1418
1448
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.showInlineEditor_=function(a){(0,module$exports$Blockly$WidgetDiv.show)(this,this.sourceBlock_.RTL,this.widgetDispose_.bind(this));this.htmlInput_=this.widgetCreate_();this.isBeingEdited_=!0;a||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())};
|
|
1419
1449
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.widgetCreate_=function(){(0,module$exports$Blockly$Events$utils.setGroup)(!0);var a=(0,module$exports$Blockly$WidgetDiv.getDiv)();(0,module$exports$Blockly$utils$dom.addClass)(this.getClickTarget_(),"editing");var b=document.createElement("input");b.className="blocklyHtmlInput";b.setAttribute("spellcheck",this.spellcheck_);var c=this.workspace_.getScale(),d=this.getConstants().FIELD_TEXT_FONTSIZE*c+"pt";a.style.fontSize=d;b.style.fontSize=
|
|
1420
1450
|
d;d=$.module$exports$Blockly$FieldTextInput.FieldTextInput.BORDERRADIUS*c+"px";if(this.fullBlockClickTarget_){d=this.getScaledBBox();d=(d.bottom-d.top)/2+"px";var e=this.sourceBlock_.getParent()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;b.style.border=1*c+"px solid "+e;a.style.borderRadius=d;a.style.transition="box-shadow 0.25s ease 0s";this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(a.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*c+"px")}b.style.borderRadius=
|
|
1421
1451
|
d;a.appendChild(b);b.value=b.defaultValue=this.getEditorText_(this.value_);b.untypedDefaultValue_=this.value_;b.oldValue_=null;this.resizeEditor_();this.bindInputEvents_(b);return b};
|
|
1422
|
-
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.widgetDispose_=function(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();
|
|
1423
|
-
|
|
1452
|
+
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.widgetDispose_=function(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();this.onFinishEditing_(this.value_);(0,module$exports$Blockly$Events$utils.setGroup)(!1);this.unbindInputEvents_();var a=(0,module$exports$Blockly$WidgetDiv.getDiv)().style;a.width="auto";a.height="auto";a.fontSize="";a.transition="";a.boxShadow="";this.htmlInput_=null;(0,module$exports$Blockly$utils$dom.removeClass)(this.getClickTarget_(),"editing")};
|
|
1453
|
+
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.onFinishEditing_=function(a){};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.bindInputEvents_=function(a){this.onKeyDownWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(a,"keydown",this,this.onHtmlInputKeyDown_);this.onKeyInputWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(a,"input",this,this.onHtmlInputChange_)};
|
|
1424
1454
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.unbindInputEvents_=function(){this.onKeyDownWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null);this.onKeyInputWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)};
|
|
1425
|
-
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.onHtmlInputKeyDown_=function(a){a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.ENTER?((0,module$exports$Blockly$WidgetDiv.hide)(),module$exports$Blockly$
|
|
1426
|
-
|
|
1455
|
+
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.onHtmlInputKeyDown_=function(a){a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.ENTER?((0,module$exports$Blockly$WidgetDiv.hide)(),(0,module$exports$Blockly$dropDownDiv.hideWithoutAnimation)()):a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.ESC?(this.setValue(this.htmlInput_.untypedDefaultValue_),(0,module$exports$Blockly$WidgetDiv.hide)(),(0,module$exports$Blockly$dropDownDiv.hideWithoutAnimation)()):a.keyCode===
|
|
1456
|
+
module$exports$Blockly$utils$KeyCodes.KeyCodes.TAB&&((0,module$exports$Blockly$WidgetDiv.hide)(),(0,module$exports$Blockly$dropDownDiv.hideWithoutAnimation)(),this.sourceBlock_.tab(this,!a.shiftKey),a.preventDefault())};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.onHtmlInputChange_=function(a){a=this.htmlInput_.value;a!==this.htmlInput_.oldValue_&&(this.htmlInput_.oldValue_=a,a=this.getValueFromEditorText_(a),this.setValue(a),this.forceRerender(),this.resizeEditor_())};
|
|
1427
1457
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.setEditorValue_=function(a){this.isDirty_=!0;this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(a));this.setValue(a)};
|
|
1428
1458
|
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.resizeEditor_=function(){var a=(0,module$exports$Blockly$WidgetDiv.getDiv)(),b=this.getScaledBBox();a.style.width=b.right-b.left+"px";a.style.height=b.bottom-b.top+"px";b=new module$exports$Blockly$utils$Coordinate.Coordinate(this.sourceBlock_.RTL?b.right-a.offsetWidth:b.left,b.top);a.style.left=b.x+"px";a.style.top=b.y+"px"};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.isTabNavigable=function(){return!0};
|
|
1429
|
-
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.getText_=function(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.getEditorText_=function(a){return String(a)};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.getValueFromEditorText_=function(a){return a};
|
|
1430
|
-
module$exports$Blockly$
|
|
1431
|
-
module$exports$Blockly$FieldNumber.FieldNumber.prototype.
|
|
1432
|
-
module$exports$Blockly$FieldNumber.FieldNumber.prototype.
|
|
1433
|
-
module$exports$Blockly$FieldNumber.FieldNumber.prototype.
|
|
1434
|
-
module$exports$Blockly$FieldNumber.FieldNumber.prototype.getPrecision=function(){return this.precision_};
|
|
1459
|
+
$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.getText_=function(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.getEditorText_=function(a){return String(a)};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.getValueFromEditorText_=function(a){return a};
|
|
1460
|
+
$.module$exports$Blockly$FieldTextInput.FieldTextInput.fromJson=function(a){return new this((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.text),void 0,a)};$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.DEFAULT_VALUE="";$.module$exports$Blockly$FieldTextInput.FieldTextInput.BORDERRADIUS=4;(0,module$exports$Blockly$fieldRegistry.register)("field_input",$.module$exports$Blockly$FieldTextInput.FieldTextInput);var module$exports$Blockly$FieldNumber={FieldNumber:function(a,b,c,d,e,f){$.module$exports$Blockly$FieldTextInput.FieldTextInput.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);this.min_=-Infinity;this.max_=Infinity;this.precision_=0;this.decimalPlaces_=null;this.SERIALIZABLE=!0;a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(f?this.configure_(f):this.setConstraints(b,c,d),this.setValue(a),e&&this.setValidator(e))}};$.$jscomp.inherits(module$exports$Blockly$FieldNumber.FieldNumber,$.module$exports$Blockly$FieldTextInput.FieldTextInput);
|
|
1461
|
+
module$exports$Blockly$FieldNumber.FieldNumber.prototype.configure_=function(a){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.configure_.call(this,a);this.setMinInternal_(a.min);this.setMaxInternal_(a.max);this.setPrecisionInternal_(a.precision)};module$exports$Blockly$FieldNumber.FieldNumber.prototype.setConstraints=function(a,b,c){this.setMinInternal_(a);this.setMaxInternal_(b);this.setPrecisionInternal_(c);this.setValue(this.getValue())};
|
|
1462
|
+
module$exports$Blockly$FieldNumber.FieldNumber.prototype.setMin=function(a){this.setMinInternal_(a);this.setValue(this.getValue())};module$exports$Blockly$FieldNumber.FieldNumber.prototype.setMinInternal_=function(a){null==a?this.min_=-Infinity:(a=Number(a),isNaN(a)||(this.min_=a))};module$exports$Blockly$FieldNumber.FieldNumber.prototype.getMin=function(){return this.min_};module$exports$Blockly$FieldNumber.FieldNumber.prototype.setMax=function(a){this.setMaxInternal_(a);this.setValue(this.getValue())};
|
|
1463
|
+
module$exports$Blockly$FieldNumber.FieldNumber.prototype.setMaxInternal_=function(a){null==a?this.max_=Infinity:(a=Number(a),isNaN(a)||(this.max_=a))};module$exports$Blockly$FieldNumber.FieldNumber.prototype.getMax=function(){return this.max_};module$exports$Blockly$FieldNumber.FieldNumber.prototype.setPrecision=function(a){this.setPrecisionInternal_(a);this.setValue(this.getValue())};
|
|
1464
|
+
module$exports$Blockly$FieldNumber.FieldNumber.prototype.setPrecisionInternal_=function(a){this.precision_=Number(a)||0;var b=String(this.precision_);-1!==b.indexOf("e")&&(b=this.precision_.toLocaleString("en-US",{maximumFractionDigits:20}));var c=b.indexOf(".");this.decimalPlaces_=-1===c?a?0:null:b.length-c-1};module$exports$Blockly$FieldNumber.FieldNumber.prototype.getPrecision=function(){return this.precision_};
|
|
1435
1465
|
module$exports$Blockly$FieldNumber.FieldNumber.prototype.doClassValidation_=function(a){if(null===a)return null;a=String(a);a=a.replace(/O/ig,"0");a=a.replace(/,/g,"");a=a.replace(/infinity/i,"Infinity");a=Number(a||0);if(isNaN(a))return null;a=Math.min(Math.max(a,this.min_),this.max_);this.precision_&&isFinite(a)&&(a=Math.round(a/this.precision_)*this.precision_);null!==this.decimalPlaces_&&(a=Number(a.toFixed(this.decimalPlaces_)));return a};
|
|
1436
|
-
module$exports$Blockly$FieldNumber.FieldNumber.prototype.widgetCreate_=function(){var a
|
|
1437
|
-
(0,module$exports$Blockly$fieldRegistry.register)("field_number",module$exports$Blockly$FieldNumber.FieldNumber);var module$exports$Blockly$FieldMultilineInput={FieldMultilineInput:function(a,b,c){$.module$exports$Blockly$FieldTextInput.FieldTextInput.call(this,
|
|
1466
|
+
module$exports$Blockly$FieldNumber.FieldNumber.prototype.widgetCreate_=function(){var a=$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.widgetCreate_.call(this);-Infinity<this.min_&&(0,module$exports$Blockly$utils$aria.setState)(a,module$exports$Blockly$utils$aria.State.VALUEMIN,this.min_);Infinity>this.max_&&(0,module$exports$Blockly$utils$aria.setState)(a,module$exports$Blockly$utils$aria.State.VALUEMAX,this.max_);return a};
|
|
1467
|
+
module$exports$Blockly$FieldNumber.FieldNumber.fromJson=function(a){return new this(a.value,void 0,void 0,void 0,void 0,a)};module$exports$Blockly$FieldNumber.FieldNumber.prototype.DEFAULT_VALUE=0;(0,module$exports$Blockly$fieldRegistry.register)("field_number",module$exports$Blockly$FieldNumber.FieldNumber);var module$exports$Blockly$FieldMultilineInput={FieldMultilineInput:function(a,b,c){$.module$exports$Blockly$FieldTextInput.FieldTextInput.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);this.textGroup_=null;this.maxLines_=Infinity;this.isOverflowedY_=!1;a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}};$.$jscomp.inherits(module$exports$Blockly$FieldMultilineInput.FieldMultilineInput,$.module$exports$Blockly$FieldTextInput.FieldTextInput);
|
|
1438
1468
|
module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.configure_=function(a){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.configure_.call(this,a);a.maxLines&&this.setMaxLines(a.maxLines)};module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.toXml=function(a){a.textContent=this.getValue().replace(/\n/g," ");return a};
|
|
1439
1469
|
module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.fromXml=function(a){this.setValue(a.textContent.replace(/ /g,"\n"))};module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.saveState=function(){var a=this.saveLegacyState(module$exports$Blockly$FieldMultilineInput.FieldMultilineInput);return null!==a?a:this.getValue()};
|
|
1440
1470
|
module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.loadState=function(a){this.loadLegacyState(module$exports$Blockly$Field.Field,a)||this.setValue(a)};module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.initView=function(){this.createBorderRect_();this.textGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{"class":"blocklyEditableText"},this.fieldGroup_)};
|
|
@@ -1450,18 +1480,16 @@ module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.widgetC
|
|
|
1450
1480
|
d=this.getConstants().FIELD_BORDER_RECT_X_PADDING*b;var e=this.getConstants().FIELD_BORDER_RECT_Y_PADDING*b/2;c.style.padding=e+"px "+d+"px "+e+"px "+d+"px";d=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING;c.style.lineHeight=d*b+"px";a.appendChild(c);c.value=c.defaultValue=this.getEditorText_(this.value_);c.untypedDefaultValue_=this.value_;c.oldValue_=null;module$exports$Blockly$utils$userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_();
|
|
1451
1481
|
this.bindInputEvents_(c);return c};module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.setMaxLines=function(a){"number"===typeof a&&0<a&&a!==this.maxLines_&&(this.maxLines_=a,this.forceRerender())};module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.getMaxLines=function(){return this.maxLines_};
|
|
1452
1482
|
module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.onHtmlInputKeyDown_=function(a){a.keyCode!==module$exports$Blockly$utils$KeyCodes.KeyCodes.ENTER&&$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.onHtmlInputKeyDown_.call(this,a)};module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.fromJson=function(a){return new this((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.text),void 0,a)};(0,module$exports$Blockly$Css.register)("\n.blocklyHtmlTextAreaInput {\n font-family: monospace;\n resize: none;\n overflow: hidden;\n height: 100%;\n text-align: left;\n}\n\n.blocklyHtmlTextAreaInputOverflowedY {\n overflow-y: scroll;\n}\n");
|
|
1453
|
-
(0,module$exports$Blockly$fieldRegistry.register)("field_multilinetext",module$exports$Blockly$FieldMultilineInput.FieldMultilineInput);var module$exports$Blockly$FieldLabelSerializable={FieldLabelSerializable:function(a,b,c){$.module$exports$Blockly$FieldLabel.FieldLabel.call(this,
|
|
1454
|
-
module$exports$Blockly$FieldLabelSerializable.FieldLabelSerializable.fromJson=function(a){return new this((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.text),void 0,a)};(0,module$exports$Blockly$fieldRegistry.register)("field_label_serializable",module$exports$Blockly$FieldLabelSerializable.FieldLabelSerializable);var module$exports$Blockly$FieldColour={FieldColour:function(a,b,c){module$exports$Blockly$
|
|
1455
|
-
|
|
1456
|
-
module$exports$Blockly$FieldColour.FieldColour.prototype.columns_=0;module$exports$Blockly$FieldColour.FieldColour.prototype.configure_=function(a){module$exports$Blockly$FieldColour.FieldColour.superClass_.configure_.call(this,a);a.colourOptions&&(this.colours_=a.colourOptions,this.titles_=a.colourTitles);a.columns&&(this.columns_=a.columns)};
|
|
1483
|
+
(0,module$exports$Blockly$fieldRegistry.register)("field_multilinetext",module$exports$Blockly$FieldMultilineInput.FieldMultilineInput);var module$exports$Blockly$FieldLabelSerializable={FieldLabelSerializable:function(a,b,c){$.module$exports$Blockly$FieldLabel.FieldLabel.call(this,String(null!=a?a:""),b,c);this.EDITABLE=!1;this.SERIALIZABLE=!0}};$.$jscomp.inherits(module$exports$Blockly$FieldLabelSerializable.FieldLabelSerializable,$.module$exports$Blockly$FieldLabel.FieldLabel);
|
|
1484
|
+
module$exports$Blockly$FieldLabelSerializable.FieldLabelSerializable.fromJson=function(a){return new this((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.text),void 0,a)};(0,module$exports$Blockly$fieldRegistry.register)("field_label_serializable",module$exports$Blockly$FieldLabelSerializable.FieldLabelSerializable);var module$exports$Blockly$FieldColour={FieldColour:function(a,b,c){module$exports$Blockly$Field.Field.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);this.onKeyDownWrapper_=this.onMouseLeaveWrapper_=this.onMouseEnterWrapper_=this.onMouseMoveWrapper_=this.onClickWrapper_=this.highlightedIndex_=this.picker_=null;this.SERIALIZABLE=!0;this.CURSOR="default";this.isDirty_=!1;this.titles_=this.colours_=null;this.columns_=0;a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(c&&this.configure_(c),
|
|
1485
|
+
this.setValue(a),b&&this.setValidator(b))}};$.$jscomp.inherits(module$exports$Blockly$FieldColour.FieldColour,module$exports$Blockly$Field.Field);module$exports$Blockly$FieldColour.FieldColour.prototype.configure_=function(a){module$exports$Blockly$Field.Field.prototype.configure_.call(this,a);a.colourOptions&&(this.colours_=a.colourOptions,this.titles_=a.colourTitles);a.columns&&(this.columns_=a.columns)};
|
|
1457
1486
|
module$exports$Blockly$FieldColour.FieldColour.prototype.initView=function(){this.size_=new module$exports$Blockly$utils$Size.Size(this.getConstants().FIELD_COLOUR_DEFAULT_WIDTH,this.getConstants().FIELD_COLOUR_DEFAULT_HEIGHT);this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.clickTarget_=this.sourceBlock_.getSvgRoot():(this.createBorderRect_(),this.borderRect_.style.fillOpacity="1")};
|
|
1458
1487
|
module$exports$Blockly$FieldColour.FieldColour.prototype.applyColour=function(){this.getConstants().FIELD_COLOUR_FULL_BLOCK?(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getValue()),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff")):this.borderRect_&&(this.borderRect_.style.fill=this.getValue())};module$exports$Blockly$FieldColour.FieldColour.prototype.doClassValidation_=function(a){return"string"!==typeof a?null:(0,module$exports$Blockly$utils$colour.parse)(a)};
|
|
1459
1488
|
module$exports$Blockly$FieldColour.FieldColour.prototype.doValueUpdate_=function(a){this.value_=a;this.borderRect_?this.borderRect_.style.fill=a:this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",a),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff"))};module$exports$Blockly$FieldColour.FieldColour.prototype.getText=function(){var a=this.value_;/^#(.)\1(.)\2(.)\3$/.test(a)&&(a="#"+a[1]+a[3]+a[5]);return a};
|
|
1460
|
-
module$exports$Blockly$FieldColour.FieldColour.
|
|
1461
|
-
module$exports$Blockly$FieldColour.FieldColour.prototype.
|
|
1462
|
-
module$exports$Blockly$FieldColour.FieldColour.prototype.showEditor_=function(){this.dropdownCreate_();module$exports$Blockly$DropDownDiv.DropDownDiv.getContentDiv().appendChild(this.picker_);module$exports$Blockly$DropDownDiv.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this));this.picker_.focus({preventScroll:!0})};module$exports$Blockly$FieldColour.FieldColour.prototype.onClick_=function(a){a=(a=a.target)&&a.label;null!==a&&(this.setValue(a),module$exports$Blockly$DropDownDiv.DropDownDiv.hideIfOwner(this))};
|
|
1489
|
+
module$exports$Blockly$FieldColour.FieldColour.prototype.setColours=function(a,b){this.colours_=a;b&&(this.titles_=b);return this};module$exports$Blockly$FieldColour.FieldColour.prototype.setColumns=function(a){this.columns_=a;return this};
|
|
1490
|
+
module$exports$Blockly$FieldColour.FieldColour.prototype.showEditor_=function(){this.dropdownCreate_();(0,module$exports$Blockly$dropDownDiv.getContentDiv)().appendChild(this.picker_);(0,module$exports$Blockly$dropDownDiv.showPositionedByField)(this,this.dropdownDispose_.bind(this));this.picker_.focus({preventScroll:!0})};module$exports$Blockly$FieldColour.FieldColour.prototype.onClick_=function(a){a=(a=a.target)&&a.label;null!==a&&(this.setValue(a),(0,module$exports$Blockly$dropDownDiv.hideIfOwner)(this))};
|
|
1463
1491
|
module$exports$Blockly$FieldColour.FieldColour.prototype.onKeyDown_=function(a){var b=!1;if(a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.UP)this.moveHighlightBy_(0,-1),b=!0;else if(a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.DOWN)this.moveHighlightBy_(0,1),b=!0;else if(a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.LEFT)this.moveHighlightBy_(-1,0),b=!0;else if(a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.RIGHT)this.moveHighlightBy_(1,0),b=!0;
|
|
1464
|
-
else if(a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.ENTER){if(b=this.getHighlighted_())b=b&&b.label,null!==b&&this.setValue(b);module$exports$Blockly$
|
|
1492
|
+
else if(a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.ENTER){if(b=this.getHighlighted_())b=b&&b.label,null!==b&&this.setValue(b);(0,module$exports$Blockly$dropDownDiv.hideWithoutAnimation)();b=!0}b&&a.stopPropagation()};
|
|
1465
1493
|
module$exports$Blockly$FieldColour.FieldColour.prototype.moveHighlightBy_=function(a,b){var c=this.colours_||module$exports$Blockly$FieldColour.FieldColour.COLOURS,d=this.columns_||module$exports$Blockly$FieldColour.FieldColour.COLUMNS,e=this.highlightedIndex_%d,f=Math.floor(this.highlightedIndex_/d);e+=a;f+=b;0>a?0>e&&0<f?(e=d-1,f--):0>e&&(e=0):0<a?e>d-1&&f<Math.floor(c.length/d)-1?(e=0,f++):e>d-1&&e--:0>b?0>f&&(f=0):0<b&&f>Math.floor(c.length/d)-1&&(f=Math.floor(c.length/d)-1);this.setHighlightedCell_(this.picker_.childNodes[f].childNodes[e],
|
|
1466
1494
|
f*d+e)};module$exports$Blockly$FieldColour.FieldColour.prototype.onMouseMove_=function(a){var b=(a=a.target)&&Number(a.getAttribute("data-index"));null!==b&&b!==this.highlightedIndex_&&this.setHighlightedCell_(a,b)};module$exports$Blockly$FieldColour.FieldColour.prototype.onMouseEnter_=function(){this.picker_.focus({preventScroll:!0})};
|
|
1467
1495
|
module$exports$Blockly$FieldColour.FieldColour.prototype.onMouseLeave_=function(){this.picker_.blur();var a=this.getHighlighted_();a&&(0,module$exports$Blockly$utils$dom.removeClass)(a,"blocklyColourHighlighted")};module$exports$Blockly$FieldColour.FieldColour.prototype.getHighlighted_=function(){var a=this.columns_||module$exports$Blockly$FieldColour.FieldColour.COLUMNS,b=this.picker_.childNodes[Math.floor(this.highlightedIndex_/a)];return b?b.childNodes[this.highlightedIndex_%a]:null};
|
|
@@ -1472,42 +1500,39 @@ var h=document.createElement("td");f.appendChild(h);h.label=b[g];h.title=c[g]||b
|
|
|
1472
1500
|
b[g];b[g]===d&&(h.className="blocklyColourSelected",this.highlightedIndex_=g)}this.onClickWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(e,"click",this,this.onClick_,!0);this.onMouseMoveWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(e,"mousemove",this,this.onMouseMove_,!0);this.onMouseEnterWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(e,"mouseenter",this,this.onMouseEnter_,!0);this.onMouseLeaveWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(e,
|
|
1473
1501
|
"mouseleave",this,this.onMouseLeave_,!0);this.onKeyDownWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(e,"keydown",this,this.onKeyDown_);this.picker_=e};
|
|
1474
1502
|
module$exports$Blockly$FieldColour.FieldColour.prototype.dropdownDispose_=function(){this.onClickWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onClickWrapper_),this.onClickWrapper_=null);this.onMouseMoveWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null);this.onMouseEnterWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onMouseEnterWrapper_),this.onMouseEnterWrapper_=null);this.onMouseLeaveWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onMouseLeaveWrapper_),
|
|
1475
|
-
this.onMouseLeaveWrapper_=null);this.onKeyDownWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null);this.highlightedIndex_=this.picker_=null};(0,module$exports$Blockly$
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.configure_=function(a){
|
|
1479
|
-
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.initView=function(){
|
|
1480
|
-
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getDisplayText_=function(){return this.checkChar_
|
|
1503
|
+
this.onMouseLeaveWrapper_=null);this.onKeyDownWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null);this.highlightedIndex_=this.picker_=null};module$exports$Blockly$FieldColour.FieldColour.fromJson=function(a){return new this(a.colour,void 0,a)};module$exports$Blockly$FieldColour.FieldColour.COLOURS="#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033".split(" ");
|
|
1504
|
+
module$exports$Blockly$FieldColour.FieldColour.prototype.DEFAULT_VALUE=module$exports$Blockly$FieldColour.FieldColour.COLOURS[0];module$exports$Blockly$FieldColour.FieldColour.TITLES=[];module$exports$Blockly$FieldColour.FieldColour.COLUMNS=7;(0,module$exports$Blockly$Css.register)("\n.blocklyColourTable {\n border-collapse: collapse;\n display: block;\n outline: none;\n padding: 1px;\n}\n\n.blocklyColourTable>tr>td {\n border: .5px solid #888;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-block;\n height: 20px;\n padding: 0;\n width: 20px;\n}\n\n.blocklyColourTable>tr>td.blocklyColourHighlighted {\n border-color: #eee;\n box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);\n position: relative;\n}\n\n.blocklyColourSelected, .blocklyColourSelected:hover {\n border-color: #eee !important;\n outline: 1px solid #333;\n position: relative;\n}\n");
|
|
1505
|
+
(0,module$exports$Blockly$fieldRegistry.register)("field_colour",module$exports$Blockly$FieldColour.FieldColour);$.module$exports$Blockly$FieldCheckbox={FieldCheckbox:function(a,b,c){module$exports$Blockly$Field.Field.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);this.checkChar_=$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.CHECK_CHAR;this.SERIALIZABLE=!0;this.CURSOR="default";a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}};$.$jscomp.inherits($.module$exports$Blockly$FieldCheckbox.FieldCheckbox,module$exports$Blockly$Field.Field);
|
|
1506
|
+
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.configure_=function(a){module$exports$Blockly$Field.Field.prototype.configure_.call(this,a);a.checkCharacter&&(this.checkChar_=a.checkCharacter)};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.saveState=function(){var a=this.saveLegacyState($.module$exports$Blockly$FieldCheckbox.FieldCheckbox);return null!==a?a:this.getValueBoolean()};
|
|
1507
|
+
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.initView=function(){module$exports$Blockly$Field.Field.prototype.initView.call(this);(0,module$exports$Blockly$utils$dom.addClass)(this.textElement_,"blocklyCheckbox");this.textElement_.style.display=this.value_?"block":"none"};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)};
|
|
1508
|
+
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getDisplayText_=function(){return this.checkChar_};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.setCheckCharacter=function(a){this.checkChar_=a||$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.CHECK_CHAR;this.forceRerender()};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.showEditor_=function(){this.setValue(!this.value_)};
|
|
1481
1509
|
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.doClassValidation_=function(a){return!0===a||"TRUE"===a?"TRUE":!1===a||"FALSE"===a?"FALSE":null};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.doValueUpdate_=function(a){this.value_=this.convertValueToBool_(a);this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getValue=function(){return this.value_?"TRUE":"FALSE"};
|
|
1482
|
-
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getValueBoolean=function(){return this.value_};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getText=function(){return String(this.convertValueToBool_(this.value_))};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.convertValueToBool_=function(a){return"string"===typeof a?"TRUE"===a:!!a}
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
module$exports$Blockly$FieldAngle.FieldAngle.prototype.configure_=function(a){module$exports$Blockly$
|
|
1486
|
-
(this.round_=a))};module$exports$Blockly$FieldAngle.FieldAngle.prototype.initView=function(){module$exports$Blockly$
|
|
1487
|
-
module$exports$Blockly$FieldAngle.FieldAngle.prototype.render_=function(){module$exports$Blockly$
|
|
1488
|
-
module$exports$Blockly$FieldAngle.FieldAngle.prototype.showEditor_=function(a){module$exports$Blockly$
|
|
1489
|
-
|
|
1510
|
+
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getValueBoolean=function(){return this.value_};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getText=function(){return String(this.convertValueToBool_(this.value_))};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.convertValueToBool_=function(a){return"string"===typeof a?"TRUE"===a:!!a};$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.fromJson=function(a){return new this(a.checked,void 0,a)};
|
|
1511
|
+
$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.DEFAULT_VALUE=!1;$.module$exports$Blockly$FieldCheckbox.FieldCheckbox.CHECK_CHAR="\u2713";(0,module$exports$Blockly$fieldRegistry.register)("field_checkbox",$.module$exports$Blockly$FieldCheckbox.FieldCheckbox);var module$exports$Blockly$FieldAngle={FieldAngle:function(a,b,c){$.module$exports$Blockly$FieldTextInput.FieldTextInput.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);this.clockwise_=module$exports$Blockly$FieldAngle.FieldAngle.CLOCKWISE;this.offset_=module$exports$Blockly$FieldAngle.FieldAngle.OFFSET;this.wrap_=module$exports$Blockly$FieldAngle.FieldAngle.WRAP;this.round_=module$exports$Blockly$FieldAngle.FieldAngle.ROUND;this.moveSurfaceWrapper_=this.clickSurfaceWrapper_=this.clickWrapper_=
|
|
1512
|
+
this.symbol_=this.line_=this.gauge_=this.editor_=null;this.SERIALIZABLE=!0;a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}};$.$jscomp.inherits(module$exports$Blockly$FieldAngle.FieldAngle,$.module$exports$Blockly$FieldTextInput.FieldTextInput);
|
|
1513
|
+
module$exports$Blockly$FieldAngle.FieldAngle.prototype.configure_=function(a){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.configure_.call(this,a);switch(a.mode){case "compass":this.clockwise_=!0;this.offset_=90;break;case "protractor":this.clockwise_=!1,this.offset_=0}var b=a.clockwise;"boolean"===typeof b&&(this.clockwise_=b);b=a.offset;null!==b&&(b=Number(b),isNaN(b)||(this.offset_=b));b=a.wrap;null!==b&&(b=Number(b),isNaN(b)||(this.wrap_=b));a=a.round;null!==a&&(a=Number(a),
|
|
1514
|
+
isNaN(a)||(this.round_=a))};module$exports$Blockly$FieldAngle.FieldAngle.prototype.initView=function(){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.initView.call(this);this.symbol_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.TSPAN,{},null);this.symbol_.appendChild(document.createTextNode("\u00b0"));this.textElement_.appendChild(this.symbol_)};
|
|
1515
|
+
module$exports$Blockly$FieldAngle.FieldAngle.prototype.render_=function(){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.render_.call(this);this.updateGraph_()};
|
|
1516
|
+
module$exports$Blockly$FieldAngle.FieldAngle.prototype.showEditor_=function(a){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.showEditor_.call(this,a,module$exports$Blockly$utils$userAgent.MOBILE||module$exports$Blockly$utils$userAgent.ANDROID||module$exports$Blockly$utils$userAgent.IPAD);this.dropdownCreate_();(0,module$exports$Blockly$dropDownDiv.getContentDiv)().appendChild(this.editor_);(0,module$exports$Blockly$dropDownDiv.setColour)(this.sourceBlock_.style.colourPrimary,this.sourceBlock_.style.colourTertiary);
|
|
1517
|
+
(0,module$exports$Blockly$dropDownDiv.showPositionedByField)(this,this.dropdownDispose_.bind(this));this.updateGraph_()};
|
|
1490
1518
|
module$exports$Blockly$FieldAngle.FieldAngle.prototype.dropdownCreate_=function(){var a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.SVG,{xmlns:module$exports$Blockly$utils$dom.SVG_NS,"xmlns:html":module$exports$Blockly$utils$dom.HTML_NS,"xmlns:xlink":module$exports$Blockly$utils$dom.XLINK_NS,version:"1.1",height:2*module$exports$Blockly$FieldAngle.FieldAngle.HALF+"px",width:2*module$exports$Blockly$FieldAngle.FieldAngle.HALF+"px",style:"touch-action: none"},
|
|
1491
1519
|
null),b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CIRCLE,{cx:module$exports$Blockly$FieldAngle.FieldAngle.HALF,cy:module$exports$Blockly$FieldAngle.FieldAngle.HALF,r:module$exports$Blockly$FieldAngle.FieldAngle.RADIUS,"class":"blocklyAngleCircle"},a);this.gauge_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyAngleGauge"},a);this.line_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.LINE,
|
|
1492
1520
|
{x1:module$exports$Blockly$FieldAngle.FieldAngle.HALF,y1:module$exports$Blockly$FieldAngle.FieldAngle.HALF,"class":"blocklyAngleLine"},a);for(var c=0;360>c;c+=15)(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.LINE,{x1:module$exports$Blockly$FieldAngle.FieldAngle.HALF+module$exports$Blockly$FieldAngle.FieldAngle.RADIUS,y1:module$exports$Blockly$FieldAngle.FieldAngle.HALF,x2:module$exports$Blockly$FieldAngle.FieldAngle.HALF+module$exports$Blockly$FieldAngle.FieldAngle.RADIUS-
|
|
1493
1521
|
(0===c%45?10:5),y2:module$exports$Blockly$FieldAngle.FieldAngle.HALF,"class":"blocklyAngleMarks",transform:"rotate("+c+","+module$exports$Blockly$FieldAngle.FieldAngle.HALF+","+module$exports$Blockly$FieldAngle.FieldAngle.HALF+")"},a);this.clickWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(a,"click",this,this.hide_);this.clickSurfaceWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(b,"click",this,this.onMouseMove_,!0,!0);this.moveSurfaceWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(b,
|
|
1494
1522
|
"mousemove",this,this.onMouseMove_,!0,!0);this.editor_=a};
|
|
1495
1523
|
module$exports$Blockly$FieldAngle.FieldAngle.prototype.dropdownDispose_=function(){this.clickWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.clickWrapper_),this.clickWrapper_=null);this.clickSurfaceWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.clickSurfaceWrapper_),this.clickSurfaceWrapper_=null);this.moveSurfaceWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.moveSurfaceWrapper_),this.moveSurfaceWrapper_=null);this.line_=this.gauge_=null};
|
|
1496
|
-
module$exports$Blockly$FieldAngle.FieldAngle.prototype.hide_=function(){module$exports$Blockly$
|
|
1524
|
+
module$exports$Blockly$FieldAngle.FieldAngle.prototype.hide_=function(){(0,module$exports$Blockly$dropDownDiv.hideIfOwner)(this);(0,module$exports$Blockly$WidgetDiv.hide)()};
|
|
1497
1525
|
module$exports$Blockly$FieldAngle.FieldAngle.prototype.onMouseMove_=function(a){var b=this.gauge_.ownerSVGElement.getBoundingClientRect(),c=a.clientX-b.left-module$exports$Blockly$FieldAngle.FieldAngle.HALF;a=a.clientY-b.top-module$exports$Blockly$FieldAngle.FieldAngle.HALF;b=Math.atan(-a/c);isNaN(b)||(b=(0,module$exports$Blockly$utils$math.toDegrees)(b),0>c?b+=180:0<a&&(b+=360),b=this.clockwise_?this.offset_+360-b:360-(this.offset_-b),this.displayMouseOrKeyboardValue_(b))};
|
|
1498
1526
|
module$exports$Blockly$FieldAngle.FieldAngle.prototype.displayMouseOrKeyboardValue_=function(a){this.round_&&(a=Math.round(a/this.round_)*this.round_);a=this.wrapValue_(a);a!==this.value_&&this.setEditorValue_(a)};
|
|
1499
1527
|
module$exports$Blockly$FieldAngle.FieldAngle.prototype.updateGraph_=function(){if(this.gauge_){var a=Number(this.getText())+this.offset_,b=(0,module$exports$Blockly$utils$math.toRadians)(a%360);a=["M ",module$exports$Blockly$FieldAngle.FieldAngle.HALF,",",module$exports$Blockly$FieldAngle.FieldAngle.HALF];var c=module$exports$Blockly$FieldAngle.FieldAngle.HALF,d=module$exports$Blockly$FieldAngle.FieldAngle.HALF;if(!isNaN(b)){var e=Number(this.clockwise_),f=(0,module$exports$Blockly$utils$math.toRadians)(this.offset_),
|
|
1500
1528
|
g=Math.cos(f)*module$exports$Blockly$FieldAngle.FieldAngle.RADIUS,h=Math.sin(f)*-module$exports$Blockly$FieldAngle.FieldAngle.RADIUS;e&&(b=2*f-b);c+=Math.cos(b)*module$exports$Blockly$FieldAngle.FieldAngle.RADIUS;d-=Math.sin(b)*module$exports$Blockly$FieldAngle.FieldAngle.RADIUS;b=Math.abs(Math.floor((b-f)/Math.PI)%2);e&&(b=1-b);a.push(" l ",g,",",h," A ",module$exports$Blockly$FieldAngle.FieldAngle.RADIUS,",",module$exports$Blockly$FieldAngle.FieldAngle.RADIUS," 0 ",b," ",e," ",c,",",d," z")}this.gauge_.setAttribute("d",
|
|
1501
1529
|
a.join(""));this.line_.setAttribute("x2",c);this.line_.setAttribute("y2",d)}};
|
|
1502
|
-
module$exports$Blockly$FieldAngle.FieldAngle.prototype.onHtmlInputKeyDown_=function(a){module$exports$Blockly$
|
|
1503
|
-
(b=1);if(b){var c=this.getValue();this.displayMouseOrKeyboardValue_(c+b*this.round_);a.preventDefault();a.stopPropagation()}};module$exports$Blockly$FieldAngle.FieldAngle.prototype.doClassValidation_=function(a){a=Number(a);return isNaN(a)||!isFinite(a)?null:this.wrapValue_(a)};module$exports$Blockly$FieldAngle.FieldAngle.prototype.wrapValue_=function(a){a%=360;0>a&&(a+=360);a>this.wrap_&&(a-=360);return a};
|
|
1504
|
-
|
|
1505
|
-
module$exports$Blockly$
|
|
1506
|
-
module$exports$Blockly$zelos$
|
|
1507
|
-
module$exports$Blockly$zelos$
|
|
1508
|
-
module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.hide=function(){module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.hide.call(this);this.markerCircle_.style.display="none"};
|
|
1509
|
-
module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.createDomInternal_=function(){module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.createDomInternal_.call(this);this.markerCircle_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CIRCLE,{r:this.constants_.CURSOR_RADIUS,style:"display: none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_);if(this.isCursor()){var a=this.getBlinkProperties_();(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.ANIMATE,
|
|
1510
|
-
a,this.markerCircle_)}return this.markerSvg_};module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.applyColour_=function(a){module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.applyColour_.call(this,a);this.markerCircle_.setAttribute("fill",this.colour_);this.markerCircle_.setAttribute("stroke",this.colour_);this.isCursor()&&this.markerCircle_.firstChild.setAttribute("values",this.colour_+";transparent;transparent;")};var module$exports$Blockly$zelos$ConstantProvider={ConstantProvider:function(){module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.call(this);this.SMALL_PADDING=this.GRID_UNIT=4;this.MEDIUM_PADDING=2*this.GRID_UNIT;this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT;this.LARGE_PADDING=4*this.GRID_UNIT;this.CORNER_RADIUS=1*this.GRID_UNIT;this.NOTCH_WIDTH=9*this.GRID_UNIT;this.NOTCH_HEIGHT=2*this.GRID_UNIT;this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT;this.MIN_BLOCK_WIDTH=
|
|
1530
|
+
module$exports$Blockly$FieldAngle.FieldAngle.prototype.onHtmlInputKeyDown_=function(a){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.onHtmlInputKeyDown_.call(this,a);var b;a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.LEFT?b=this.sourceBlock_.RTL?1:-1:a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.RIGHT?b=this.sourceBlock_.RTL?-1:1:a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.DOWN?b=-1:a.keyCode===module$exports$Blockly$utils$KeyCodes.KeyCodes.UP&&
|
|
1531
|
+
(b=1);if(b){var c=this.getValue();this.displayMouseOrKeyboardValue_(c+b*this.round_);a.preventDefault();a.stopPropagation()}};module$exports$Blockly$FieldAngle.FieldAngle.prototype.doClassValidation_=function(a){a=Number(a);return isNaN(a)||!isFinite(a)?null:this.wrapValue_(a)};module$exports$Blockly$FieldAngle.FieldAngle.prototype.wrapValue_=function(a){a%=360;0>a&&(a+=360);a>this.wrap_&&(a-=360);return a};
|
|
1532
|
+
module$exports$Blockly$FieldAngle.FieldAngle.fromJson=function(a){return new this(a.angle,void 0,a)};module$exports$Blockly$FieldAngle.FieldAngle.prototype.DEFAULT_VALUE=0;module$exports$Blockly$FieldAngle.FieldAngle.ROUND=15;module$exports$Blockly$FieldAngle.FieldAngle.HALF=50;module$exports$Blockly$FieldAngle.FieldAngle.CLOCKWISE=!1;module$exports$Blockly$FieldAngle.FieldAngle.OFFSET=0;module$exports$Blockly$FieldAngle.FieldAngle.WRAP=360;
|
|
1533
|
+
module$exports$Blockly$FieldAngle.FieldAngle.RADIUS=module$exports$Blockly$FieldAngle.FieldAngle.HALF-1;(0,module$exports$Blockly$Css.register)("\n.blocklyAngleCircle {\n stroke: #444;\n stroke-width: 1;\n fill: #ddd;\n fill-opacity: .8;\n}\n\n.blocklyAngleMarks {\n stroke: #444;\n stroke-width: 1;\n}\n\n.blocklyAngleGauge {\n fill: #f88;\n fill-opacity: .8;\n pointer-events: none;\n}\n\n.blocklyAngleLine {\n stroke: #f00;\n stroke-width: 2;\n stroke-linecap: round;\n pointer-events: none;\n}\n");
|
|
1534
|
+
(0,module$exports$Blockly$fieldRegistry.register)("field_angle",module$exports$Blockly$FieldAngle.FieldAngle);var module$exports$Blockly$zelos$BottomRow={BottomRow:function(a){module$exports$Blockly$blockRendering$BottomRow.BottomRow.call(this,a)}};$.$jscomp.inherits(module$exports$Blockly$zelos$BottomRow.BottomRow,module$exports$Blockly$blockRendering$BottomRow.BottomRow);module$exports$Blockly$zelos$BottomRow.BottomRow.prototype.endsWithElemSpacer=function(){return!1};module$exports$Blockly$zelos$BottomRow.BottomRow.prototype.hasLeftSquareCorner=function(a){return!!a.outputConnection};
|
|
1535
|
+
module$exports$Blockly$zelos$BottomRow.BottomRow.prototype.hasRightSquareCorner=function(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection};var module$exports$Blockly$zelos$ConstantProvider={ConstantProvider:function(){module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.call(this);this.SMALL_PADDING=this.GRID_UNIT=4;this.MEDIUM_PADDING=2*this.GRID_UNIT;this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT;this.LARGE_PADDING=4*this.GRID_UNIT;this.CORNER_RADIUS=1*this.GRID_UNIT;this.NOTCH_WIDTH=9*this.GRID_UNIT;this.NOTCH_HEIGHT=2*this.GRID_UNIT;this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT;this.MIN_BLOCK_WIDTH=
|
|
1511
1536
|
2*this.GRID_UNIT;this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT;this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT;this.TAB_OFFSET_FROM_TOP=0;this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS;this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING;this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS;this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT;this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT;this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT;
|
|
1512
1537
|
this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT;this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT;this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT;this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT;this.CURSOR_WS_WIDTH=20*this.GRID_UNIT;this.CURSOR_COLOUR="#ffa200";this.CURSOR_RADIUS=5;this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0;this.START_HAT_HEIGHT=22;this.START_HAT_WIDTH=96;this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5};this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,
|
|
1513
1538
|
2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}};this.FULL_BLOCK_FIELDS=!0;this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT;this.FIELD_TEXT_FONTWEIGHT="bold";this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif';this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS;this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT;this.FIELD_BORDER_RECT_Y_PADDING=
|
|
@@ -1541,8 +1566,8 @@ module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.getCSS_
|
|
|
1541
1566
|
a+" .blocklyNonEditableText>g>text,",a+" .blocklyEditableText>g>text {","fill: #575E75;","}",a+" .blocklyFlyoutLabelText {","fill: #575E75;","}",a+" .blocklyText.blocklyBubbleText {","fill: #575E75;","}",a+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>rect,",a+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",a+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+
|
|
1542
1567
|
";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","color: #575E75;","}",a+" .blocklyDropdownText {","fill: #fff !important;","}",a+".blocklyWidgetDiv .goog-menuitem,",a+".blocklyDropDownDiv .goog-menuitem {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","}",a+".blocklyDropDownDiv .goog-menuitem-content {","color: #fff;","}",a+" .blocklyHighlightedConnectionPath {","stroke: "+this.SELECTED_GLOW_COLOUR+";","}",a+" .blocklyDisabled > .blocklyOutlinePath {","fill: url(#blocklyDisabledPattern"+this.randomIdentifier+
|
|
1543
1568
|
")","}",a+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"]};var module$exports$Blockly$zelos$Drawer={Drawer:function(a,b){module$exports$Blockly$blockRendering$Drawer.Drawer.call(this,a,b)}};$.$jscomp.inherits(module$exports$Blockly$zelos$Drawer.Drawer,module$exports$Blockly$blockRendering$Drawer.Drawer);
|
|
1544
|
-
module$exports$Blockly$zelos$Drawer.Drawer.prototype.draw=function(){var a=this.block_.pathObject;a.beginDrawing();this.hideHiddenIcons_();this.drawOutline_();this.drawInternals_();a.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&a.flipRTL();this.recordSizeOnBlock_();this.info_.outputConnection&&(a.outputShapeType=this.info_.outputConnection.shape.type);
|
|
1545
|
-
module$exports$Blockly$zelos$Drawer.Drawer.prototype.drawOutline_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawOutline_.call(this)};
|
|
1569
|
+
module$exports$Blockly$zelos$Drawer.Drawer.prototype.draw=function(){var a=this.block_.pathObject;a.beginDrawing();this.hideHiddenIcons_();this.drawOutline_();this.drawInternals_();a.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&a.flipRTL();(0,module$exports$Blockly$blockRendering$debug.isDebuggerEnabled)()&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_);this.recordSizeOnBlock_();this.info_.outputConnection&&(a.outputShapeType=this.info_.outputConnection.shape.type);
|
|
1570
|
+
a.endDrawing()};module$exports$Blockly$zelos$Drawer.Drawer.prototype.drawOutline_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawOutline_.call(this)};
|
|
1546
1571
|
module$exports$Blockly$zelos$Drawer.Drawer.prototype.drawLeft_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawLeft_.call(this)};
|
|
1547
1572
|
module$exports$Blockly$zelos$Drawer.Drawer.prototype.drawRightSideRow_=function(a){if(!(0>=a.height))if(module$exports$Blockly$blockRendering$Types.Types.isSpacer(a)&&(a.precedesStatement||a.followsStatement)){var b=this.constants_.INSIDE_CORNERS.rightHeight;b=a.height-(a.precedesStatement?b:0);this.outlinePath_+=(a.followsStatement?this.constants_.INSIDE_CORNERS.pathBottomRight:"")+(0<b?(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.yPos+b):"")+(a.precedesStatement?this.constants_.INSIDE_CORNERS.pathTopRight:
|
|
1548
1573
|
"")}else this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.yPos+a.height)};module$exports$Blockly$zelos$Drawer.Drawer.prototype.drawRightDynamicConnection_=function(){this.outlinePath_+=this.info_.outputConnection.shape.pathRightDown(this.info_.outputConnection.height)};
|
|
@@ -1552,7 +1577,12 @@ module$exports$Blockly$zelos$Drawer.Drawer.prototype.drawFlatBottom_=function(){
|
|
|
1552
1577
|
module$exports$Blockly$zelos$Drawer.Drawer.prototype.drawInlineInput_=function(a){this.positionInlineInputConnection_(a);var b=a.input.name;if(!a.connectedBlock&&!this.info_.isInsertionMarker){var c=a.width-2*a.connectionWidth;a=(0,module$exports$Blockly$utils$svgPaths.moveTo)(a.xPos+a.connectionWidth,a.centerline-a.height/2)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",c)+a.shape.pathRightDown(a.height)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",-c)+a.shape.pathUp(a.height)+
|
|
1553
1578
|
"z";this.block_.pathObject.setOutlinePath(b,a)}};
|
|
1554
1579
|
module$exports$Blockly$zelos$Drawer.Drawer.prototype.drawStatementInput_=function(a){var b=a.getLastInput(),c=b.xPos+b.notchOffset+b.shape.width,d=b.shape.pathRight+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",-(b.notchOffset-this.constants_.INSIDE_CORNERS.width))+this.constants_.INSIDE_CORNERS.pathTop,e=a.height-2*this.constants_.INSIDE_CORNERS.height;b=this.constants_.INSIDE_CORNERS.pathBottom+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",b.notchOffset-this.constants_.INSIDE_CORNERS.width)+
|
|
1555
|
-
(b.connectedBottomNextConnection?"":b.shape.pathLeft);this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",c)+d+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",e)+b+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a.xPos+a.width);this.positionStatementInputConnection_(a)};var module$exports$Blockly$zelos$
|
|
1580
|
+
(b.connectedBottomNextConnection?"":b.shape.pathLeft);this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",c)+d+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",e)+b+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a.xPos+a.width);this.positionStatementInputConnection_(a)};var module$exports$Blockly$zelos$MarkerSvg={MarkerSvg:function(a,b,c){module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.call(this,a,b,c);this.markerCircle_=null}};$.$jscomp.inherits(module$exports$Blockly$zelos$MarkerSvg.MarkerSvg,module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg);
|
|
1581
|
+
module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.showWithInputOutput_=function(a){var b=a.getSourceBlock();a=a.getLocation().getOffsetInBlock();this.positionCircle_(a.x,a.y);this.setParent_(b);this.showCurrent_()};module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.showWithOutput_=function(a){this.showWithInputOutput_(a)};module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.showWithInput_=function(a){this.showWithInputOutput_(a)};
|
|
1582
|
+
module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.showWithBlock_=function(a){a=a.getLocation();var b=a.getHeightWidth();this.positionRect_(0,0,b.width,b.height);this.setParent_(a);this.showCurrent_()};module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.positionCircle_=function(a,b){this.markerCircle_.setAttribute("cx",a);this.markerCircle_.setAttribute("cy",b);this.currentMarkerSvg=this.markerCircle_};
|
|
1583
|
+
module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.hide=function(){module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.hide.call(this);this.markerCircle_.style.display="none"};
|
|
1584
|
+
module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.createDomInternal_=function(){module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.createDomInternal_.call(this);this.markerCircle_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CIRCLE,{r:this.constants_.CURSOR_RADIUS,style:"display: none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_);if(this.isCursor()){var a=this.getBlinkProperties_();(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.ANIMATE,
|
|
1585
|
+
a,this.markerCircle_)}return this.markerSvg_};module$exports$Blockly$zelos$MarkerSvg.MarkerSvg.prototype.applyColour_=function(a){module$exports$Blockly$blockRendering$MarkerSvg.MarkerSvg.prototype.applyColour_.call(this,a);this.markerCircle_.setAttribute("fill",this.colour_);this.markerCircle_.setAttribute("stroke",this.colour_);this.isCursor()&&this.markerCircle_.firstChild.setAttribute("values",this.colour_+";transparent;transparent;")};var module$exports$Blockly$zelos$PathObject={PathObject:function(a,b,c){module$exports$Blockly$blockRendering$PathObject.PathObject.call(this,a,b,c);this.constants=c;this.svgPathSelected_=null;this.outlines_=Object.create(null);this.outputShapeType=this.remainingOutlines_=null}};$.$jscomp.inherits(module$exports$Blockly$zelos$PathObject.PathObject,module$exports$Blockly$blockRendering$PathObject.PathObject);
|
|
1556
1586
|
module$exports$Blockly$zelos$PathObject.PathObject.prototype.setPath=function(a){module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.setPath.call(this,a);this.svgPathSelected_&&this.svgPathSelected_.setAttribute("d",a)};
|
|
1557
1587
|
module$exports$Blockly$zelos$PathObject.PathObject.prototype.applyColour=function(a){module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.applyColour.call(this,a);a.isShadow()&&a.getParent()&&this.svgPath.setAttribute("stroke",a.getParent().style.colourTertiary);for(var b in this.outlines_)this.outlines_[b].setAttribute("fill",this.style.colourTertiary)};
|
|
1558
1588
|
module$exports$Blockly$zelos$PathObject.PathObject.prototype.flipRTL=function(){module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.flipRTL.call(this);for(var a in this.outlines_)this.outlines_[a].setAttribute("transform","scale(-1 1)")};
|
|
@@ -1561,16 +1591,17 @@ module$exports$Blockly$zelos$PathObject.PathObject.prototype.updateReplacementFa
|
|
|
1561
1591
|
module$exports$Blockly$zelos$PathObject.PathObject.prototype.updateShapeForInputHighlight=function(a,b){a=a.getParentInput().name;(a=this.getOutlinePath_(a))&&(b?a.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):a.removeAttribute("filter"))};module$exports$Blockly$zelos$PathObject.PathObject.prototype.beginDrawing=function(){this.remainingOutlines_=Object.create(null);for(var a in this.outlines_)this.remainingOutlines_[a]=1};
|
|
1562
1592
|
module$exports$Blockly$zelos$PathObject.PathObject.prototype.endDrawing=function(){if(this.remainingOutlines_)for(var a in this.remainingOutlines_)this.removeOutlinePath_(a);this.remainingOutlines_=null};module$exports$Blockly$zelos$PathObject.PathObject.prototype.setOutlinePath=function(a,b){a=this.getOutlinePath_(a);a.setAttribute("d",b);a.setAttribute("fill",this.style.colourTertiary)};
|
|
1563
1593
|
module$exports$Blockly$zelos$PathObject.PathObject.prototype.getOutlinePath_=function(a){this.outlines_[a]||(this.outlines_[a]=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyOutlinePath",d:""},this.svgRoot));this.remainingOutlines_&&delete this.remainingOutlines_[a];return this.outlines_[a]};
|
|
1564
|
-
module$exports$Blockly$zelos$PathObject.PathObject.prototype.removeOutlinePath_=function(a){this.outlines_[a].parentNode.removeChild(this.outlines_[a]);delete this.outlines_[a]}
|
|
1565
|
-
module$exports$Blockly$
|
|
1566
|
-
|
|
1567
|
-
(0,$.module$exports$Blockly$utils$object.inherits)($.module$exports$Blockly$FieldImage.FieldImage,module$exports$Blockly$Field.Field);$.module$exports$Blockly$FieldImage.FieldImage.prototype.DEFAULT_VALUE="";$.module$exports$Blockly$FieldImage.FieldImage.fromJson=function(a){return new this(a.src,a.width,a.height,void 0,void 0,void 0,a)};$.module$exports$Blockly$FieldImage.FieldImage.Y_PADDING=1;$.module$exports$Blockly$FieldImage.FieldImage.prototype.EDITABLE=!1;
|
|
1568
|
-
$.module$exports$Blockly$FieldImage.FieldImage.prototype.isDirty_=!1;$.module$exports$Blockly$FieldImage.FieldImage.prototype.configure_=function(a){$.module$exports$Blockly$FieldImage.FieldImage.superClass_.configure_.call(this,a);this.flipRtl_=!!a.flipRtl;this.altText_=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.alt)||""};
|
|
1594
|
+
module$exports$Blockly$zelos$PathObject.PathObject.prototype.removeOutlinePath_=function(a){this.outlines_[a].parentNode.removeChild(this.outlines_[a]);delete this.outlines_[a]};$.module$exports$Blockly$FieldImage={FieldImage:function(a,b,c,d,e,f,g){module$exports$Blockly$Field.Field.call(this,module$exports$Blockly$Field.Field.SKIP_SETUP);if(!a)throw Error("Src value of an image field is required");c=Number((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(c));b=Number((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(b));if(isNaN(c)||isNaN(b))throw Error("Height and width values of an image field must cast to numbers.");if(0>=c||0>=b)throw Error("Height and width values of an image field must be greater than 0.");
|
|
1595
|
+
this.size_=new module$exports$Blockly$utils$Size.Size(b,c+$.module$exports$Blockly$FieldImage.FieldImage.Y_PADDING);this.imageHeight_=c;this.clickHandler_=null;"function"===typeof e&&(this.clickHandler_=e);this.imageElement_=null;this.flipRtl_=this.isDirty_=this.EDITABLE=!1;this.altText_="";a!==module$exports$Blockly$Field.Field.SKIP_SETUP&&(g?this.configure_(g):(this.flipRtl_=!!f,this.altText_=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(d)||""),this.setValue((0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a)))}};
|
|
1596
|
+
$.$jscomp.inherits($.module$exports$Blockly$FieldImage.FieldImage,module$exports$Blockly$Field.Field);$.module$exports$Blockly$FieldImage.FieldImage.prototype.configure_=function(a){module$exports$Blockly$Field.Field.prototype.configure_.call(this,a);this.flipRtl_=!!a.flipRtl;this.altText_=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.alt)||""};
|
|
1569
1597
|
$.module$exports$Blockly$FieldImage.FieldImage.prototype.initView=function(){this.imageElement_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.IMAGE,{height:this.imageHeight_+"px",width:this.size_.width+"px",alt:this.altText_},this.fieldGroup_);this.imageElement_.setAttributeNS(module$exports$Blockly$utils$dom.XLINK_NS,"xlink:href",this.value_);this.clickHandler_&&(this.imageElement_.style.cursor="pointer")};
|
|
1570
1598
|
$.module$exports$Blockly$FieldImage.FieldImage.prototype.updateSize_=function(){};$.module$exports$Blockly$FieldImage.FieldImage.prototype.doClassValidation_=function(a){return"string"!==typeof a?null:a};$.module$exports$Blockly$FieldImage.FieldImage.prototype.doValueUpdate_=function(a){this.value_=a;this.imageElement_&&this.imageElement_.setAttributeNS(module$exports$Blockly$utils$dom.XLINK_NS,"xlink:href",String(this.value_))};
|
|
1571
1599
|
$.module$exports$Blockly$FieldImage.FieldImage.prototype.getFlipRtl=function(){return this.flipRtl_};$.module$exports$Blockly$FieldImage.FieldImage.prototype.setAlt=function(a){a!==this.altText_&&(this.altText_=a||"",this.imageElement_&&this.imageElement_.setAttribute("alt",this.altText_))};$.module$exports$Blockly$FieldImage.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.clickHandler_(this)};
|
|
1572
|
-
$.module$exports$Blockly$FieldImage.FieldImage.prototype.setOnClickHandler=function(a){this.clickHandler_=a};$.module$exports$Blockly$FieldImage.FieldImage.prototype.getText_=function(){return this.altText_}
|
|
1573
|
-
|
|
1600
|
+
$.module$exports$Blockly$FieldImage.FieldImage.prototype.setOnClickHandler=function(a){this.clickHandler_=a};$.module$exports$Blockly$FieldImage.FieldImage.prototype.getText_=function(){return this.altText_};$.module$exports$Blockly$FieldImage.FieldImage.fromJson=function(a){return new this(a.src,a.width,a.height,void 0,void 0,void 0,a)};$.module$exports$Blockly$FieldImage.FieldImage.prototype.DEFAULT_VALUE="";$.module$exports$Blockly$FieldImage.FieldImage.Y_PADDING=1;
|
|
1601
|
+
(0,module$exports$Blockly$fieldRegistry.register)("field_image",$.module$exports$Blockly$FieldImage.FieldImage);var module$exports$Blockly$zelos$RightConnectionShape={RightConnectionShape:function(a){module$exports$Blockly$blockRendering$Measurable.Measurable.call(this,a);this.type|=module$exports$Blockly$blockRendering$Types.Types.getType("RIGHT_CONNECTION");this.width=this.height=0}};$.$jscomp.inherits(module$exports$Blockly$zelos$RightConnectionShape.RightConnectionShape,module$exports$Blockly$blockRendering$Measurable.Measurable);var module$exports$Blockly$zelos$StatementInput={StatementInput:function(a,b){module$exports$Blockly$blockRendering$StatementInput.StatementInput.call(this,a,b);if(this.connectedBlock){for(a=this.connectedBlock;b=a.getNextBlock();)a=b;a.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}};$.$jscomp.inherits(module$exports$Blockly$zelos$StatementInput.StatementInput,module$exports$Blockly$blockRendering$StatementInput.StatementInput);var module$exports$Blockly$zelos$TopRow={TopRow:function(a){module$exports$Blockly$blockRendering$TopRow.TopRow.call(this,a)}};$.$jscomp.inherits(module$exports$Blockly$zelos$TopRow.TopRow,module$exports$Blockly$blockRendering$TopRow.TopRow);module$exports$Blockly$zelos$TopRow.TopRow.prototype.endsWithElemSpacer=function(){return!1};
|
|
1602
|
+
module$exports$Blockly$zelos$TopRow.TopRow.prototype.hasLeftSquareCorner=function(a){var b=(a.hat?"cap"===a.hat:this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection;return!!a.outputConnection||b};module$exports$Blockly$zelos$TopRow.TopRow.prototype.hasRightSquareCorner=function(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection};var module$exports$Blockly$zelos$RenderInfo={RenderInfo:function(a,b){module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.call(this,a,b);this.topRow=new module$exports$Blockly$zelos$TopRow.TopRow(this.constants_);this.bottomRow=new module$exports$Blockly$zelos$BottomRow.BottomRow(this.constants_);this.isInline=!0;this.isMultiRow=!b.getInputsInline()||b.isCollapsed();this.hasStatementInput=0<b.statementInputCount;this.rightSide=this.outputConnection?new module$exports$Blockly$zelos$RightConnectionShape.RightConnectionShape(this.constants_):
|
|
1603
|
+
null;this.rightAlignedDummyInputs_=new WeakMap}};$.$jscomp.inherits(module$exports$Blockly$zelos$RenderInfo.RenderInfo,module$exports$Blockly$blockRendering$RenderInfo.RenderInfo);module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.getRenderer=function(){return this.renderer_};
|
|
1604
|
+
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.measure=function(){this.createRows_();this.addElemSpacing_();this.addRowSpacing_();this.adjustXPosition_();this.computeBounds_();this.alignRowElements_();this.finalize_()};
|
|
1574
1605
|
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.shouldStartNewRow_=function(a,b){return b?a.type===$.module$exports$Blockly$inputTypes.inputTypes.STATEMENT||b.type===$.module$exports$Blockly$inputTypes.inputTypes.STATEMENT?!0:a.type===$.module$exports$Blockly$inputTypes.inputTypes.VALUE||a.type===$.module$exports$Blockly$inputTypes.inputTypes.DUMMY?!this.isInline||this.isMultiRow:!1:!1};
|
|
1575
1606
|
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.getDesiredRowWidth_=function(a){return a.hasStatement?this.width-this.startX-(this.constants_.INSIDE_CORNERS.rightWidth||0):module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.getDesiredRowWidth_.call(this,a)};
|
|
1576
1607
|
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.getInRowSpacing_=function(a,b){return a&&b||!this.outputConnection||!this.outputConnection.isDynamicShape||this.hasStatementInput||this.bottomRow.hasNextConnection?!a&&b&&module$exports$Blockly$blockRendering$Types.Types.isStatementInput(b)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:a&&module$exports$Blockly$blockRendering$Types.Types.isLeftRoundedCorner(a)&&b&&(module$exports$Blockly$blockRendering$Types.Types.isPreviousConnection(b)||
|
|
@@ -1579,26 +1610,25 @@ module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.getSpacerRowHeight_
|
|
|
1579
1610
|
0),d&&c?Math.max(a,this.constants_.DUMMY_INPUT_MIN_HEIGHT):a):module$exports$Blockly$blockRendering$Types.Types.isTopRow(a)?a.hasPreviousConnection||this.outputConnection&&!this.hasStatementInput?this.constants_.NO_PADDING:Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):module$exports$Blockly$blockRendering$Types.Types.isBottomRow(b)?this.outputConnection?!b.hasNextConnection&&this.hasStatementInput?Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):this.constants_.NO_PADDING:
|
|
1580
1611
|
Math.max(this.topRow.minHeight,Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.CORNER_RADIUS))-this.constants_.CORNER_RADIUS:this.constants_.MEDIUM_PADDING};
|
|
1581
1612
|
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.getSpacerRowWidth_=function(a,b){var c=this.width-this.startX;return module$exports$Blockly$blockRendering$Types.Types.isInputRow(a)&&a.hasStatement||module$exports$Blockly$blockRendering$Types.Types.isInputRow(b)&&b.hasStatement?Math.max(c,this.constants_.STATEMENT_INPUT_SPACER_MIN_WIDTH):c};
|
|
1582
|
-
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.getElemCenterline_=function(a,b){if(a.hasStatement&&!module$exports$Blockly$blockRendering$Types.Types.isSpacer(b)&&!module$exports$Blockly$blockRendering$Types.Types.isStatementInput(b))return a.yPos+this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT/2;if(module$exports$Blockly$blockRendering$Types.Types.isInlineInput(b)){var c=b.connectedBlock;if(c&&c.outputConnection&&
|
|
1583
|
-
a,b)};
|
|
1584
|
-
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.addInput_=function(a,b){if(a.type===$.module$exports$Blockly$inputTypes.inputTypes.DUMMY&&b.hasDummyInput&&b.align===$.module$exports$Blockly$Input.Align.LEFT&&a.align===$.module$exports$Blockly$Input.Align.RIGHT)b
|
|
1585
|
-
(b.align=a.align);return}module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.addInput_.call(this,a,b)};
|
|
1586
|
-
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.addAlignmentPadding_=function(a,b){if(a
|
|
1613
|
+
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.getElemCenterline_=function(a,b){if(a.hasStatement&&!module$exports$Blockly$blockRendering$Types.Types.isSpacer(b)&&!module$exports$Blockly$blockRendering$Types.Types.isStatementInput(b))return a.yPos+this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT/2;if(module$exports$Blockly$blockRendering$Types.Types.isInlineInput(b)&&b instanceof module$exports$Blockly$blockRendering$InputConnection.InputConnection){var c=b.connectedBlock;if(c&&c.outputConnection&&
|
|
1614
|
+
c.nextConnection)return a.yPos+c.height/2}return module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.getElemCenterline_.call(this,a,b)};
|
|
1615
|
+
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.addInput_=function(a,b){if(a.type===$.module$exports$Blockly$inputTypes.inputTypes.DUMMY&&b.hasDummyInput&&b.align===$.module$exports$Blockly$Input.Align.LEFT&&a.align===$.module$exports$Blockly$Input.Align.RIGHT)this.rightAlignedDummyInputs_.set(b,a);else if(a.type===$.module$exports$Blockly$inputTypes.inputTypes.STATEMENT){b.elements.push(new module$exports$Blockly$zelos$StatementInput.StatementInput(this.constants_,a));b.hasStatement=
|
|
1616
|
+
!0;null===b.align&&(b.align=a.align);return}module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.addInput_.call(this,a,b)};
|
|
1617
|
+
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.addAlignmentPadding_=function(a,b){if(this.rightAlignedDummyInputs_.get(a)){for(var c,d=0;d<a.elements.length;d++){var e=a.elements[d];module$exports$Blockly$blockRendering$Types.Types.isSpacer(e)&&(c=e);if(module$exports$Blockly$blockRendering$Types.Types.isField(e)&&e instanceof module$exports$Blockly$blockRendering$Field.Field&&e.parentInput===this.rightAlignedDummyInputs_.get(a))break}if(c){c.width+=b;a.width+=b;return}}module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.addAlignmentPadding_.call(this,
|
|
1587
1618
|
a,b)};
|
|
1588
1619
|
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.adjustXPosition_=function(){for(var a=this.constants_.NOTCH_OFFSET_LEFT+this.constants_.NOTCH_WIDTH,b=a,c=2;c<this.rows.length-1;c+=2){var d=this.rows[c-1],e=this.rows[c],f=this.rows[c+1];d=2===c?!!this.topRow.hasPreviousConnection:!!d.followsStatement;f=c+2>=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!f.precedesStatement;if(module$exports$Blockly$blockRendering$Types.Types.isInputRow(e)&&e.hasStatement)e.measure(),b=e.width-e.getLastInput().width+
|
|
1589
|
-
a;else if(d&&(2===c||f)&&module$exports$Blockly$blockRendering$Types.Types.isInputRow(e)&&!e.hasStatement){f=e.xPos;d=null;for(var g=0;g<e.elements.length;g++){var h=e.elements[g];module$exports$Blockly$blockRendering$Types.Types.isSpacer(h)&&(d=h)
|
|
1590
|
-
h.field instanceof $.module$exports$Blockly$FieldImage.FieldImage)
|
|
1620
|
+
a;else if(d&&(2===c||f)&&module$exports$Blockly$blockRendering$Types.Types.isInputRow(e)&&!e.hasStatement){f=e.xPos;d=null;for(var g=0;g<e.elements.length;g++){var h=e.elements[g];module$exports$Blockly$blockRendering$Types.Types.isSpacer(h)&&(d=h);d&&(module$exports$Blockly$blockRendering$Types.Types.isField(h)||module$exports$Blockly$blockRendering$Types.Types.isInput(h))&&f<b&&!(module$exports$Blockly$blockRendering$Types.Types.isField(h)&&h instanceof module$exports$Blockly$blockRendering$Field.Field&&
|
|
1621
|
+
(h.field instanceof $.module$exports$Blockly$FieldLabel.FieldLabel||h.field instanceof $.module$exports$Blockly$FieldImage.FieldImage))&&(d.width+=b-f);f+=h.width}}}};
|
|
1591
1622
|
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.finalizeOutputConnection_=function(){if(this.outputConnection&&this.outputConnection.isDynamicShape){for(var a=0,b=0;b<this.rows.length;b++){var c=this.rows[b];c.yPos=a;a+=c.height}this.height=a;b=this.bottomRow.hasNextConnection?this.height-this.bottomRow.descenderHeight:this.height;a=this.outputConnection.shape.height(b);b=this.outputConnection.shape.width(b);this.outputConnection.height=a;this.outputConnection.width=b;this.outputConnection.startX=
|
|
1592
1623
|
b;this.outputConnection.connectionOffsetY=this.outputConnection.shape.connectionOffsetY(a);this.outputConnection.connectionOffsetX=this.outputConnection.shape.connectionOffsetX(b);c=0;this.hasStatementInput||this.bottomRow.hasNextConnection||(c=b,this.rightSide.height=a,this.rightSide.width=c,this.rightSide.centerline=a/2,this.rightSide.xPos=this.width+c);this.startX=b;this.width+=b+c;this.widthWithChildren+=b+c}};
|
|
1593
1624
|
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.finalizeHorizontalAlignment_=function(){if(this.outputConnection&&!this.hasStatementInput&&!this.bottomRow.hasNextConnection){for(var a=0,b=0;b<this.rows.length;b++){var c=this.rows[b];if(module$exports$Blockly$blockRendering$Types.Types.isInputRow(c)){a=c.elements[c.elements.length-2];var d=this.getNegativeSpacing_(c.elements[1]),e=this.getNegativeSpacing_(a);a=d+e;var f=this.constants_.MIN_BLOCK_WIDTH+2*this.outputConnection.width;this.width-
|
|
1594
|
-
a<f&&(a=this.width-f,d=a/2,e=a/2);c.elements.unshift(new module$exports$Blockly$blockRendering$InRowSpacer.InRowSpacer(this.constants_,-d));c.elements.push(new module$exports$Blockly$blockRendering$InRowSpacer.InRowSpacer(this.constants_,-e))}}if(a)for(this.width-=a,this.widthWithChildren-=a,this.rightSide.xPos-=a,b=0;b<this.rows.length;b++)c=this.rows[b],module$exports$Blockly$blockRendering$Types.Types.isTopOrBottomRow(c)&&(c.elements[1].width-=a,c.
|
|
1595
|
-
a,c.
|
|
1596
|
-
module$exports$Blockly$
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
module$exports$Blockly$
|
|
1600
|
-
|
|
1601
|
-
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.finalize_=function(){this.finalizeOutputConnection_();this.finalizeHorizontalAlignment_();this.finalizeVerticalAlignment_();module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.finalize_.call(this);this.rightSide&&(this.widthWithChildren+=this.rightSide.width)};var module$exports$Blockly$zelos$Renderer={Renderer:function(a){module$exports$Blockly$blockRendering$Renderer.Renderer.call(this,a)}};$.$jscomp.inherits(module$exports$Blockly$zelos$Renderer.Renderer,module$exports$Blockly$blockRendering$Renderer.Renderer);module$exports$Blockly$zelos$Renderer.Renderer.prototype.makeConstants_=function(){return new module$exports$Blockly$zelos$ConstantProvider.ConstantProvider};
|
|
1625
|
+
a<f&&(a=this.width-f,d=a/2,e=a/2);c.elements.unshift(new module$exports$Blockly$blockRendering$InRowSpacer.InRowSpacer(this.constants_,-d));c.elements.push(new module$exports$Blockly$blockRendering$InRowSpacer.InRowSpacer(this.constants_,-e))}}if(a)for(this.width-=a,this.widthWithChildren-=a,this.rightSide.xPos-=a,b=0;b<this.rows.length;b++)c=this.rows[b],module$exports$Blockly$blockRendering$Types.Types.isTopOrBottomRow(c)&&(c.elements[1].width-=a),c.width-=a,c.widthWithConnectedBlocks-=a}};
|
|
1626
|
+
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.getNegativeSpacing_=function(a){if(!a)return 0;var b=this.outputConnection.width,c=this.outputConnection.shape.type,d=this.constants_;if(this.isMultiRow&&1<this.inputRows.length)switch(c){case d.SHAPES.ROUND:return c=this.constants_.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,c=this.height/2>c?c:this.height/2,b-c*(1-Math.sin(Math.acos((c-this.constants_.SMALL_PADDING)/c)));default:return 0}if(module$exports$Blockly$blockRendering$Types.Types.isInlineInput(a)&&
|
|
1627
|
+
a instanceof module$exports$Blockly$blockRendering$InputConnection.InputConnection){var e=a.connectedBlock;a=e?e.pathObject.outputShapeType:a.shape.type;return e&&e.outputConnection&&(e.statementInputCount||e.nextConnection)||c===d.SHAPES.HEXAGONAL&&c!==a?0:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][a]}return module$exports$Blockly$blockRendering$Types.Types.isField(a)&&a instanceof module$exports$Blockly$blockRendering$Field.Field?c===d.SHAPES.ROUND&&a.field instanceof $.module$exports$Blockly$FieldTextInput.FieldTextInput?
|
|
1628
|
+
b-2.75*d.GRID_UNIT:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][0]:module$exports$Blockly$blockRendering$Types.Types.isIcon(a)?this.constants_.SMALL_PADDING:0};
|
|
1629
|
+
module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.finalizeVerticalAlignment_=function(){if(!this.outputConnection)for(var a=2;a<this.rows.length-1;a+=2){var b=this.rows[a-1],c=this.rows[a],d=this.rows[a+1],e=2===a,f=a+2>=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!d.precedesStatement;if(e?this.topRow.hasPreviousConnection:b.followsStatement){var g=c.elements[1];g=3===c.elements.length&&g instanceof module$exports$Blockly$blockRendering$Field.Field&&(g.field instanceof $.module$exports$Blockly$FieldLabel.FieldLabel||
|
|
1630
|
+
g.field instanceof $.module$exports$Blockly$FieldImage.FieldImage);if(!e&&g)b.height-=this.constants_.SMALL_PADDING,d.height-=this.constants_.SMALL_PADDING,c.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!f)b.height+=this.constants_.SMALL_PADDING;else if(f){e=!1;for(f=0;f<c.elements.length;f++)if(g=c.elements[f],g instanceof module$exports$Blockly$blockRendering$InputConnection.InputConnection&&module$exports$Blockly$blockRendering$Types.Types.isInlineInput(g)&&g.connectedBlock&&!g.connectedBlock.isShadow()&&
|
|
1631
|
+
40<=g.connectedBlock.getHeightWidth().height){e=!0;break}e&&(b.height-=this.constants_.SMALL_PADDING,d.height-=this.constants_.SMALL_PADDING)}}}};module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.finalize_=function(){this.finalizeOutputConnection_();this.finalizeHorizontalAlignment_();this.finalizeVerticalAlignment_();module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.finalize_.call(this);this.rightSide&&(this.widthWithChildren+=this.rightSide.width)};var module$exports$Blockly$zelos$Renderer={Renderer:function(a){module$exports$Blockly$blockRendering$Renderer.Renderer.call(this,a)}};$.$jscomp.inherits(module$exports$Blockly$zelos$Renderer.Renderer,module$exports$Blockly$blockRendering$Renderer.Renderer);module$exports$Blockly$zelos$Renderer.Renderer.prototype.makeConstants_=function(){return new module$exports$Blockly$zelos$ConstantProvider.ConstantProvider};
|
|
1602
1632
|
module$exports$Blockly$zelos$Renderer.Renderer.prototype.makeRenderInfo_=function(a){return new module$exports$Blockly$zelos$RenderInfo.RenderInfo(this,a)};module$exports$Blockly$zelos$Renderer.Renderer.prototype.makeDrawer_=function(a,b){return new module$exports$Blockly$zelos$Drawer.Drawer(a,b)};module$exports$Blockly$zelos$Renderer.Renderer.prototype.makeMarkerDrawer=function(a,b){return new module$exports$Blockly$zelos$MarkerSvg.MarkerSvg(a,this.getConstants(),b)};
|
|
1603
1633
|
module$exports$Blockly$zelos$Renderer.Renderer.prototype.makePathObject=function(a,b){return new module$exports$Blockly$zelos$PathObject.PathObject(a,b,this.getConstants())};module$exports$Blockly$zelos$Renderer.Renderer.prototype.shouldHighlightConnection=function(a){return a.type!==$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE&&a.type!==$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE};
|
|
1604
1634
|
module$exports$Blockly$zelos$Renderer.Renderer.prototype.getConnectionPreviewMethod=function(a,b,c){return b.type===$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE?a.isConnected()?module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE:module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE:module$exports$Blockly$blockRendering$Renderer.Renderer.prototype.getConnectionPreviewMethod.call(this,a,b,
|
|
@@ -1619,16 +1649,17 @@ module$exports$Blockly$thrasos$RenderInfo.RenderInfo.prototype.getElemCenterline
|
|
|
1619
1649
|
a.capline-b.height/2:a.capline+b.height/2;var c=a.yPos;return c=module$exports$Blockly$blockRendering$Types.Types.isField(b)&&a.hasStatement?c+(this.constants_.TALL_INPUT_FIELD_OFFSET_Y+b.height/2):c+a.height/2};
|
|
1620
1650
|
module$exports$Blockly$thrasos$RenderInfo.RenderInfo.prototype.finalize_=function(){for(var a=0,b=0,c=0;c<this.rows.length;c++){var d=this.rows[c];d.yPos=b;d.xPos=this.startX;b+=d.height;a=Math.max(a,d.widthWithConnectedBlocks);var e=b-this.topRow.ascenderHeight;d===this.bottomRow&&e<this.constants_.MIN_BLOCK_HEIGHT&&(e=this.constants_.MIN_BLOCK_HEIGHT-e,this.bottomRow.height+=e,b+=e);this.recordElemPositions_(d)}this.outputConnection&&this.block_.nextConnection&&this.block_.nextConnection.isConnected()&&
|
|
1621
1651
|
(a=Math.max(a,this.block_.nextConnection.targetBlock().getHeightWidth().width));this.bottomRow.baseline=b-this.bottomRow.descenderHeight;this.widthWithChildren=a+this.startX;this.height=b;this.startY=this.topRow.capline};var module$exports$Blockly$thrasos$Renderer={Renderer:function(a){module$exports$Blockly$blockRendering$Renderer.Renderer.call(this,a)}};$.$jscomp.inherits(module$exports$Blockly$thrasos$Renderer.Renderer,module$exports$Blockly$blockRendering$Renderer.Renderer);module$exports$Blockly$thrasos$Renderer.Renderer.prototype.makeRenderInfo_=function(a){return new module$exports$Blockly$thrasos$RenderInfo.RenderInfo(this,a)};(0,module$exports$Blockly$blockRendering.register)("thrasos",module$exports$Blockly$thrasos$Renderer.Renderer);var module$exports$Blockly$thrasos={};module$exports$Blockly$thrasos.RenderInfo=module$exports$Blockly$thrasos$RenderInfo.RenderInfo;module$exports$Blockly$thrasos.Renderer=module$exports$Blockly$thrasos$Renderer.Renderer;var module$exports$Blockly$serialization$workspaces={save:function(a){var b=Object.create(null),c=(0,module$exports$Blockly$registry.getAllItems)(module$exports$Blockly$registry.Type.SERIALIZER,!0),d;for(d in c){var e=c[d].save(a);e&&(b[d]=e)}return b},load:function(a,b,c){c=void 0===c?{}:c;var d=void 0===c.recordUndo?!1:c.recordUndo;if(c=(0,module$exports$Blockly$registry.getAllItems)(module$exports$Blockly$registry.Type.SERIALIZER,!0)){var e=Object.entries(c).sort(function(h,k){return k[1].priority-
|
|
1622
|
-
h[1].priority});c=(0,module$exports$Blockly$Events$utils.getRecordUndo)();(0,module$exports$Blockly$Events$utils.setRecordUndo)(d);(d=(0,module$exports$Blockly$Events$utils.getGroup)())||(0,module$exports$Blockly$Events$utils.setGroup)(!0);(0,module$exports$Blockly$utils$dom.startTextWidthCache)();b.
|
|
1623
|
-
for(f=e.next();!f.done;f=e.next())g=$.$jscomp.makeIterator(f.value),f=g.next().value,g=g.next().value,a[f]&&g.load(a[f],b);b.
|
|
1652
|
+
h[1].priority});c=(0,module$exports$Blockly$Events$utils.getRecordUndo)();(0,module$exports$Blockly$Events$utils.setRecordUndo)(d);(d=(0,module$exports$Blockly$Events$utils.getGroup)())||(0,module$exports$Blockly$Events$utils.setGroup)(!0);(0,module$exports$Blockly$utils$dom.startTextWidthCache)();b instanceof module$exports$Blockly$WorkspaceSvg.WorkspaceSvg&&b.setResizesEnabled(!1);for(var f=$.$jscomp.makeIterator(e.reverse()),g=f.next();!g.done;g=f.next())g=$.$jscomp.makeIterator(g.value),g.next(),
|
|
1653
|
+
g.next().value.clear(b);e=$.$jscomp.makeIterator(e.reverse());for(f=e.next();!f.done;f=e.next())g=$.$jscomp.makeIterator(f.value),f=g.next().value,g=g.next().value,a[f]&&g.load(a[f],b);b instanceof module$exports$Blockly$WorkspaceSvg.WorkspaceSvg&&b.setResizesEnabled(!0);(0,module$exports$Blockly$utils$dom.stopTextWidthCache)();(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.FINISHED_LOADING))(b));(0,module$exports$Blockly$Events$utils.setGroup)(d);
|
|
1654
|
+
(0,module$exports$Blockly$Events$utils.setRecordUndo)(c)}}};var module$exports$Blockly$serialization$variables={},module$contents$Blockly$serialization$variables_VariableSerializer=function(){this.priority=module$exports$Blockly$serialization$priorities.VARIABLES};module$contents$Blockly$serialization$variables_VariableSerializer.prototype.save=function(a){var b=[];a=$.$jscomp.makeIterator(a.getAllVariables());for(var c=a.next();!c.done;c=a.next()){c=c.value;var d={name:c.name,id:c.getId()};c.type&&(d.type=c.type);b.push(d)}return b.length?b:null};
|
|
1624
1655
|
module$contents$Blockly$serialization$variables_VariableSerializer.prototype.load=function(a,b){a=$.$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next())c=c.value,b.createVariable(c.name,c.type,c.id)};module$contents$Blockly$serialization$variables_VariableSerializer.prototype.clear=function(a){a.getVariableMap().clear()};(0,module$exports$Blockly$serialization$registry.register)("variables",new module$contents$Blockly$serialization$variables_VariableSerializer);var module$exports$Blockly$minimalist$ConstantProvider={ConstantProvider:function(){module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.call(this)}};$.$jscomp.inherits(module$exports$Blockly$minimalist$ConstantProvider.ConstantProvider,module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider);var module$exports$Blockly$minimalist$Drawer={Drawer:function(a,b){module$exports$Blockly$blockRendering$Drawer.Drawer.call(this,a,b)}};$.$jscomp.inherits(module$exports$Blockly$minimalist$Drawer.Drawer,module$exports$Blockly$blockRendering$Drawer.Drawer);var module$exports$Blockly$minimalist$RenderInfo={RenderInfo:function(a,b){module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.call(this,a,b)}};$.$jscomp.inherits(module$exports$Blockly$minimalist$RenderInfo.RenderInfo,module$exports$Blockly$blockRendering$RenderInfo.RenderInfo);module$exports$Blockly$minimalist$RenderInfo.RenderInfo.prototype.getRenderer=function(){return this.renderer_};var module$exports$Blockly$minimalist$Renderer={Renderer:function(a){module$exports$Blockly$blockRendering$Renderer.Renderer.call(this,a)}};$.$jscomp.inherits(module$exports$Blockly$minimalist$Renderer.Renderer,module$exports$Blockly$blockRendering$Renderer.Renderer);module$exports$Blockly$minimalist$Renderer.Renderer.prototype.makeConstants_=function(){return new module$exports$Blockly$minimalist$ConstantProvider.ConstantProvider};
|
|
1625
|
-
module$exports$Blockly$minimalist$Renderer.Renderer.prototype.makeRenderInfo_=function(a){return new module$exports$Blockly$minimalist$RenderInfo.RenderInfo(this,a)};module$exports$Blockly$minimalist$Renderer.Renderer.prototype.makeDrawer_=function(a,b){return new module$exports$Blockly$minimalist$Drawer.Drawer(a,b)};(0,module$exports$Blockly$blockRendering.register)("minimalist",module$exports$Blockly$minimalist$Renderer.Renderer);var module$exports$Blockly$minimalist={};module$exports$Blockly$minimalist.ConstantProvider=module$exports$Blockly$minimalist$ConstantProvider.ConstantProvider;module$exports$Blockly$minimalist.Drawer=module$exports$Blockly$minimalist$Drawer.Drawer;module$exports$Blockly$minimalist.RenderInfo=module$exports$Blockly$minimalist$RenderInfo.RenderInfo;module$exports$Blockly$minimalist.Renderer=module$exports$Blockly$minimalist$Renderer.Renderer;var module$exports$Blockly$geras$StatementInput={StatementInput:function(a,b){module$exports$Blockly$blockRendering$StatementInput.StatementInput.call(this,a,b);this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}};$.$jscomp.inherits(module$exports$Blockly$geras$StatementInput.StatementInput,module$exports$Blockly$blockRendering$StatementInput.StatementInput);var module$exports$Blockly$geras$PathObject={PathObject:function(a,b,c){this
|
|
1626
|
-
{"class":"blocklyPathLight"},this.svgRoot);this.colourDark="#000000"
|
|
1627
|
-
module$exports$Blockly$geras$PathObject.PathObject.prototype.
|
|
1628
|
-
module$exports$Blockly$geras$PathObject.PathObject.prototype.applyColour=function(a){this.svgPathLight.style.display="";this.svgPathDark.style.display="";this.svgPathLight.setAttribute("stroke",this.style.colourTertiary);this.svgPathDark.setAttribute("fill",this.colourDark);module$exports$Blockly$
|
|
1656
|
+
module$exports$Blockly$minimalist$Renderer.Renderer.prototype.makeRenderInfo_=function(a){return new module$exports$Blockly$minimalist$RenderInfo.RenderInfo(this,a)};module$exports$Blockly$minimalist$Renderer.Renderer.prototype.makeDrawer_=function(a,b){return new module$exports$Blockly$minimalist$Drawer.Drawer(a,b)};(0,module$exports$Blockly$blockRendering.register)("minimalist",module$exports$Blockly$minimalist$Renderer.Renderer);var module$exports$Blockly$minimalist={};module$exports$Blockly$minimalist.ConstantProvider=module$exports$Blockly$minimalist$ConstantProvider.ConstantProvider;module$exports$Blockly$minimalist.Drawer=module$exports$Blockly$minimalist$Drawer.Drawer;module$exports$Blockly$minimalist.RenderInfo=module$exports$Blockly$minimalist$RenderInfo.RenderInfo;module$exports$Blockly$minimalist.Renderer=module$exports$Blockly$minimalist$Renderer.Renderer;var module$exports$Blockly$geras$StatementInput={StatementInput:function(a,b){module$exports$Blockly$blockRendering$StatementInput.StatementInput.call(this,a,b);this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}};$.$jscomp.inherits(module$exports$Blockly$geras$StatementInput.StatementInput,module$exports$Blockly$blockRendering$StatementInput.StatementInput);var module$exports$Blockly$geras$PathObject={PathObject:function(a,b,c){module$exports$Blockly$blockRendering$PathObject.PathObject.call(this,a,b,c);this.constants=c;this.svgPathDark=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyPathDark",transform:"translate(1,1)"});this.svgRoot.insertBefore(this.svgPathDark,this.svgPath);this.svgPathLight=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,
|
|
1657
|
+
{"class":"blocklyPathLight"},this.svgRoot);this.colourDark="#000000"}};$.$jscomp.inherits(module$exports$Blockly$geras$PathObject.PathObject,module$exports$Blockly$blockRendering$PathObject.PathObject);module$exports$Blockly$geras$PathObject.PathObject.prototype.setPath=function(a){this.svgPath.setAttribute("d",a);this.svgPathDark.setAttribute("d",a)};module$exports$Blockly$geras$PathObject.PathObject.prototype.setHighlightPath=function(a){this.svgPathLight.setAttribute("d",a)};
|
|
1658
|
+
module$exports$Blockly$geras$PathObject.PathObject.prototype.flipRTL=function(){this.svgPath.setAttribute("transform","scale(-1 1)");this.svgPathLight.setAttribute("transform","scale(-1 1)");this.svgPathDark.setAttribute("transform","translate(1,1) scale(-1 1)")};
|
|
1659
|
+
module$exports$Blockly$geras$PathObject.PathObject.prototype.applyColour=function(a){this.svgPathLight.style.display="";this.svgPathDark.style.display="";this.svgPathLight.setAttribute("stroke",this.style.colourTertiary);this.svgPathDark.setAttribute("fill",this.colourDark);module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.applyColour.call(this,a);this.svgPath.setAttribute("stroke","none")};
|
|
1629
1660
|
module$exports$Blockly$geras$PathObject.PathObject.prototype.setStyle=function(a){this.style=a;this.colourDark=(0,module$exports$Blockly$utils$colour.blend)("#000",this.style.colourPrimary,.2)||this.colourDark};module$exports$Blockly$geras$PathObject.PathObject.prototype.updateHighlighted=function(a){a?(this.svgPath.setAttribute("filter","url(#"+this.constants.embossFilterId+")"),this.svgPathLight.style.display="none"):(this.svgPath.setAttribute("filter","none"),this.svgPathLight.style.display="inline")};
|
|
1630
1661
|
module$exports$Blockly$geras$PathObject.PathObject.prototype.updateShadow_=function(a){a&&(this.svgPathLight.style.display="none",this.svgPathDark.setAttribute("fill",this.style.colourSecondary),this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary))};
|
|
1631
|
-
module$exports$Blockly$geras$PathObject.PathObject.prototype.updateDisabled_=function(a){module$exports$Blockly$
|
|
1662
|
+
module$exports$Blockly$geras$PathObject.PathObject.prototype.updateDisabled_=function(a){module$exports$Blockly$blockRendering$PathObject.PathObject.prototype.updateDisabled_.call(this,a);a&&this.svgPath.setAttribute("stroke","none")};var module$exports$Blockly$geras$ConstantProvider={ConstantProvider:function(){module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.call(this);this.FIELD_TEXT_BASELINE_CENTER=!1;this.DARK_PATH_OFFSET=1;this.MAX_BOTTOM_WIDTH=30;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}};$.$jscomp.inherits(module$exports$Blockly$geras$ConstantProvider.ConstantProvider,module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider);
|
|
1632
1663
|
module$exports$Blockly$geras$ConstantProvider.ConstantProvider.prototype.getCSS_=function(a){return module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.getCSS_.call(this,a).concat([a+" .blocklyInsertionMarker>.blocklyPathLight,",a+" .blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"])};var module$exports$Blockly$geras$InlineInput={InlineInput:function(a,b){module$exports$Blockly$blockRendering$InlineInput.InlineInput.call(this,a,b);this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}};$.$jscomp.inherits(module$exports$Blockly$geras$InlineInput.InlineInput,module$exports$Blockly$blockRendering$InlineInput.InlineInput);var module$exports$Blockly$geras$Highlighter={Highlighter:function(a){this.info_=a;this.inlineSteps_=this.steps_="";this.RTL_=this.info_.RTL;a=a.getRenderer();this.constants_=a.getConstants();this.highlightConstants_=a.getHighlightConstants();this.highlightOffset_=this.highlightConstants_.OFFSET;this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER;this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER;this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB;this.notchPaths_=this.highlightConstants_.NOTCH;
|
|
1633
1664
|
this.startPaths_=this.highlightConstants_.START_HAT;this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}};module$exports$Blockly$geras$Highlighter.Highlighter.prototype.getPath=function(){return this.steps_+"\n"+this.inlineSteps_};
|
|
1634
1665
|
module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawTopCorner=function(a){this.steps_+=(0,module$exports$Blockly$utils$svgPaths.moveBy)(a.xPos,this.info_.startY);for(var b=0,c;c=a.elements[b];b++)module$exports$Blockly$blockRendering$Types.Types.isLeftSquareCorner(c)?this.steps_+=this.highlightConstants_.START_POINT:module$exports$Blockly$blockRendering$Types.Types.isLeftRoundedCorner(c)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):module$exports$Blockly$blockRendering$Types.Types.isPreviousConnection(c)?
|
|
@@ -1637,18 +1668,19 @@ module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawJaggedEdge_=f
|
|
|
1637
1668
|
module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawValueInput=function(a){var b=a.getLastInput();if(this.RTL_){var c=a.height-b.connectionHeight;this.steps_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(b.xPos+b.width-this.highlightOffset_,a.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",c)}else this.steps_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(b.xPos+b.width,a.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)};
|
|
1638
1669
|
module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawStatementInput=function(a){var b=a.getLastInput();if(this.RTL_){var c=a.height-2*this.insideCornerPaths_.height;this.steps_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(b.xPos,a.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",c)+this.insideCornerPaths_.pathBottom(this.RTL_)+(0,module$exports$Blockly$utils$svgPaths.lineTo)(a.width-b.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=
|
|
1639
1670
|
(0,module$exports$Blockly$utils$svgPaths.moveTo)(b.xPos,a.yPos+a.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+(0,module$exports$Blockly$utils$svgPaths.lineTo)(a.width-b.xPos-this.insideCornerPaths_.width,0)};
|
|
1640
|
-
module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawRightSideRow=function(a){var b=a.xPos+a.width-this.highlightOffset_;a.followsStatement&&(this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",b));this.RTL_&&(this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",b),a.height>this.highlightOffset_&&(this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.yPos+a.height-
|
|
1641
|
-
|
|
1642
|
-
(this.steps_+=(0,module$exports$Blockly$utils$svgPaths.
|
|
1671
|
+
module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawRightSideRow=function(a){var b=a.xPos+a.width-this.highlightOffset_;a instanceof module$exports$Blockly$blockRendering$SpacerRow.SpacerRow&&a.followsStatement&&(this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",b));this.RTL_&&(this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",b),a.height>this.highlightOffset_&&(this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.yPos+a.height-
|
|
1672
|
+
this.highlightOffset_)))};
|
|
1673
|
+
module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawBottomRow=function(a){if(this.RTL_)this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.baseline-this.highlightOffset_);else{var b=this.info_.bottomRow.elements[0];module$exports$Blockly$blockRendering$Types.Types.isLeftSquareCorner(b)?this.steps_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(a.xPos+this.highlightOffset_,a.baseline-this.highlightOffset_):module$exports$Blockly$blockRendering$Types.Types.isLeftRoundedCorner(b)&&(this.steps_+=
|
|
1674
|
+
(0,module$exports$Blockly$utils$svgPaths.moveTo)(a.xPos,a.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}};
|
|
1643
1675
|
module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawLeft=function(){var a=this.info_.outputConnection;a&&(a=a.connectionOffsetY+a.height,this.RTL_?this.steps_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(this.info_.startX,a):(this.steps_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(this.info_.startX+this.highlightOffset_,this.info_.bottomRow.baseline-this.highlightOffset_),this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_));
|
|
1644
1676
|
this.RTL_||(a=this.info_.topRow,module$exports$Blockly$blockRendering$Types.Types.isLeftRoundedCorner(a.elements[0])?this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",this.outsideCornerPaths_.height):this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.capline+this.highlightOffset_))};
|
|
1645
1677
|
module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawInlineInput=function(a){var b=this.highlightOffset_,c=a.xPos+a.connectionWidth,d=a.centerline-a.height/2,e=a.width-a.connectionWidth,f=d+b;this.RTL_?(d=a.connectionOffsetY-b,a=a.height-(a.connectionOffsetY+a.connectionHeight)+b,this.inlineSteps_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(c-b,f)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",d)+this.puzzleTabPaths_.pathDown(this.RTL_)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",
|
|
1646
1678
|
a)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",e)):this.inlineSteps_+=(0,module$exports$Blockly$utils$svgPaths.moveTo)(a.xPos+a.width+b,f)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",a.height)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",-e)+(0,module$exports$Blockly$utils$svgPaths.moveTo)(c,d+a.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)};var module$exports$Blockly$geras$Drawer={Drawer:function(a,b){module$exports$Blockly$blockRendering$Drawer.Drawer.call(this,a,b);this.highlighter_=new module$exports$Blockly$geras$Highlighter.Highlighter(b)}};$.$jscomp.inherits(module$exports$Blockly$geras$Drawer.Drawer,module$exports$Blockly$blockRendering$Drawer.Drawer);
|
|
1647
|
-
module$exports$Blockly$geras$Drawer.Drawer.prototype.draw=function(){this.hideHiddenIcons_();this.drawOutline_();this.drawInternals_();var a=this.block_.pathObject;a.setPath(this.outlinePath_+"\n"+this.inlinePath_);a.setHighlightPath(this.highlighter_.getPath());this.info_.RTL&&a.flipRTL();
|
|
1648
|
-
module$exports$Blockly$geras$Drawer.Drawer.prototype.
|
|
1649
|
-
module$exports$Blockly$geras$Drawer.Drawer.prototype.
|
|
1650
|
-
module$exports$Blockly$geras$Drawer.Drawer.prototype.
|
|
1651
|
-
module$exports$Blockly$geras$Drawer.Drawer.prototype.drawInlineInput_=function(a){this.highlighter_.drawInlineInput(a);module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawInlineInput_.call(this,a)};
|
|
1679
|
+
module$exports$Blockly$geras$Drawer.Drawer.prototype.draw=function(){this.hideHiddenIcons_();this.drawOutline_();this.drawInternals_();var a=this.block_.pathObject;a.setPath(this.outlinePath_+"\n"+this.inlinePath_);a.setHighlightPath(this.highlighter_.getPath());this.info_.RTL&&a.flipRTL();(0,module$exports$Blockly$blockRendering$debug.isDebuggerEnabled)()&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_);this.recordSizeOnBlock_()};
|
|
1680
|
+
module$exports$Blockly$geras$Drawer.Drawer.prototype.drawTop_=function(){this.highlighter_.drawTopCorner(this.info_.topRow);this.highlighter_.drawRightSideRow(this.info_.topRow);module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawTop_.call(this)};module$exports$Blockly$geras$Drawer.Drawer.prototype.drawJaggedEdge_=function(a){this.highlighter_.drawJaggedEdge_(a);module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawJaggedEdge_.call(this,a)};
|
|
1681
|
+
module$exports$Blockly$geras$Drawer.Drawer.prototype.drawValueInput_=function(a){this.highlighter_.drawValueInput(a);module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawValueInput_.call(this,a)};module$exports$Blockly$geras$Drawer.Drawer.prototype.drawStatementInput_=function(a){this.highlighter_.drawStatementInput(a);module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawStatementInput_.call(this,a)};
|
|
1682
|
+
module$exports$Blockly$geras$Drawer.Drawer.prototype.drawRightSideRow_=function(a){this.highlighter_.drawRightSideRow(a);this.outlinePath_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a.xPos+a.width)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("V",a.yPos+a.height)};module$exports$Blockly$geras$Drawer.Drawer.prototype.drawBottom_=function(){this.highlighter_.drawBottomRow(this.info_.bottomRow);module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawBottom_.call(this)};
|
|
1683
|
+
module$exports$Blockly$geras$Drawer.Drawer.prototype.drawLeft_=function(){this.highlighter_.drawLeft();module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawLeft_.call(this)};module$exports$Blockly$geras$Drawer.Drawer.prototype.drawInlineInput_=function(a){this.highlighter_.drawInlineInput(a);module$exports$Blockly$blockRendering$Drawer.Drawer.prototype.drawInlineInput_.call(this,a)};
|
|
1652
1684
|
module$exports$Blockly$geras$Drawer.Drawer.prototype.positionInlineInputConnection_=function(a){var b=a.centerline-a.height/2;if(a.connectionModel){var c=a.xPos+a.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(c*=-1);a.connectionModel.setOffsetInBlock(c,b+a.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}};
|
|
1653
1685
|
module$exports$Blockly$geras$Drawer.Drawer.prototype.positionStatementInputConnection_=function(a){var b=a.getLastInput();if(b.connectionModel){var c=a.xPos+a.statementEdge+b.notchOffset;c=this.info_.RTL?-1*c:c+this.constants_.DARK_PATH_OFFSET;b.connectionModel.setOffsetInBlock(c,a.yPos+this.constants_.DARK_PATH_OFFSET)}};
|
|
1654
1686
|
module$exports$Blockly$geras$Drawer.Drawer.prototype.positionExternalValueConnection_=function(a){var b=a.getLastInput();if(b.connectionModel){var c=a.xPos+a.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(c*=-1);b.connectionModel.setOffsetInBlock(c,a.yPos)}};
|
|
@@ -1681,8 +1713,8 @@ module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.getSpacerRowHeight_
|
|
|
1681
1713
|
b.hasStatement?this.constants_.BETWEEN_STATEMENT_PADDING_Y:a.hasStatement&&b.hasStatement||!a.hasStatement&&b.hasDummyInput||a.hasDummyInput?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING};
|
|
1682
1714
|
module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.getElemCenterline_=function(a,b){if(module$exports$Blockly$blockRendering$Types.Types.isSpacer(b))return a.yPos+b.height/2;if(module$exports$Blockly$blockRendering$Types.Types.isBottomRow(a))return a=a.yPos+a.height-a.descenderHeight,module$exports$Blockly$blockRendering$Types.Types.isNextConnection(b)?a+b.height/2:a-b.height/2;if(module$exports$Blockly$blockRendering$Types.Types.isTopRow(a))return module$exports$Blockly$blockRendering$Types.Types.isHat(b)?
|
|
1683
1715
|
a.capline-b.height/2:a.capline+b.height/2;var c=a.yPos;module$exports$Blockly$blockRendering$Types.Types.isField(b)||module$exports$Blockly$blockRendering$Types.Types.isIcon(b)?(c+=b.height/2,(a.hasInlineInput||a.hasStatement)&&b.height+this.constants_.TALL_INPUT_FIELD_OFFSET_Y<=a.height&&(c+=this.constants_.TALL_INPUT_FIELD_OFFSET_Y)):c=module$exports$Blockly$blockRendering$Types.Types.isInlineInput(b)?c+b.height/2:c+a.height/2;return c};
|
|
1684
|
-
module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.alignRowElements_=function(){if(this.isInline){for(var a=0,b=
|
|
1685
|
-
|
|
1716
|
+
module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.alignRowElements_=function(){if(this.isInline){for(var a=0,b=new WeakMap,c=null,d=this.rows.length-1,e;e=this.rows[d];d--)b.set(e,a),module$exports$Blockly$blockRendering$Types.Types.isInputRow(e)&&(e.hasStatement&&this.alignStatementRow_(e),c&&c.hasStatement&&e.width<c.width?b.set(e,c.width):a=e.width,c=e);for(a=d=0;c=this.rows[a];a++)c.hasStatement?d=this.getDesiredRowWidth_(c):module$exports$Blockly$blockRendering$Types.Types.isSpacer(c)?
|
|
1717
|
+
c.width=Math.max(d,b.get(c)):(e=c.width,d=Math.max(d,b.get(c))-e,0<d&&this.addAlignmentPadding_(c,d),d=c.width)}else module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.alignRowElements_.call(this)};
|
|
1686
1718
|
module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.getDesiredRowWidth_=function(a){return this.isInline&&a.hasStatement?this.statementEdge+this.constants_.MAX_BOTTOM_WIDTH+this.startX:module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.getDesiredRowWidth_.call(this,a)};
|
|
1687
1719
|
module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.finalize_=function(){for(var a=0,b=0,c=0,d;d=this.rows[c];c++){d.yPos=b;d.xPos=this.startX;b+=d.height;a=Math.max(a,d.widthWithConnectedBlocks);var e=b-this.topRow.ascenderHeight;d===this.bottomRow&&e<this.constants_.MIN_BLOCK_HEIGHT&&(e=this.constants_.MIN_BLOCK_HEIGHT-e,this.bottomRow.height+=e,b+=e);this.recordElemPositions_(d)}this.outputConnection&&this.block_.nextConnection&&this.block_.nextConnection.isConnected()&&(a=Math.max(a,
|
|
1688
1720
|
this.block_.nextConnection.targetBlock().getHeightWidth().width-this.constants_.DARK_PATH_OFFSET));this.bottomRow.baseline=b-this.bottomRow.descenderHeight;this.widthWithChildren=a+this.startX+this.constants_.DARK_PATH_OFFSET;this.width+=this.constants_.DARK_PATH_OFFSET;this.height=b+this.constants_.DARK_PATH_OFFSET;this.startY=this.topRow.capline};var module$exports$Blockly$geras$Renderer={Renderer:function(a){module$exports$Blockly$blockRendering$Renderer.Renderer.call(this,a);this.highlightConstants_=null}};$.$jscomp.inherits(module$exports$Blockly$geras$Renderer.Renderer,module$exports$Blockly$blockRendering$Renderer.Renderer);
|
|
@@ -1708,7 +1740,7 @@ preconditionFn:function(c){var d=(0,$.module$exports$Blockly$common.getSelected)
|
|
|
1708
1740
|
[module$exports$Blockly$utils$KeyCodes.KeyCodes.SHIFT,module$exports$Blockly$utils$KeyCodes.KeyCodes.CTRL]);module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.registry.addKeyMapping(b,a.name);b=module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.registry.createSerializedKey(module$exports$Blockly$utils$KeyCodes.KeyCodes.Z,[module$exports$Blockly$utils$KeyCodes.KeyCodes.SHIFT,module$exports$Blockly$utils$KeyCodes.KeyCodes.ALT]);module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.registry.addKeyMapping(b,
|
|
1709
1741
|
a.name);b=module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.registry.createSerializedKey(module$exports$Blockly$utils$KeyCodes.KeyCodes.Z,[module$exports$Blockly$utils$KeyCodes.KeyCodes.SHIFT,module$exports$Blockly$utils$KeyCodes.KeyCodes.META]);module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.registry.addKeyMapping(b,a.name);b=module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.registry.createSerializedKey(module$exports$Blockly$utils$KeyCodes.KeyCodes.Y,[module$exports$Blockly$utils$KeyCodes.KeyCodes.CTRL]);
|
|
1710
1742
|
module$exports$Blockly$ShortcutRegistry.ShortcutRegistry.registry.addKeyMapping(b,a.name)},registerDefaultShortcuts:function(){(0,module$exports$Blockly$ShortcutItems.registerEscape)();(0,module$exports$Blockly$ShortcutItems.registerDelete)();(0,module$exports$Blockly$ShortcutItems.registerCopy)();(0,module$exports$Blockly$ShortcutItems.registerCut)();(0,module$exports$Blockly$ShortcutItems.registerPaste)();(0,module$exports$Blockly$ShortcutItems.registerUndo)();(0,module$exports$Blockly$ShortcutItems.registerRedo)()}};
|
|
1711
|
-
(0,module$exports$Blockly$ShortcutItems.registerDefaultShortcuts)();var module$exports$Blockly$Events$FinishedLoading={FinishedLoading:function(a){this.isBlank="undefined"===typeof a;this.workspaceId=a?a.id:"";this.
|
|
1743
|
+
(0,module$exports$Blockly$ShortcutItems.registerDefaultShortcuts)();var module$exports$Blockly$Events$FinishedLoading={FinishedLoading:function(a){module$exports$Blockly$Events$Abstract.Abstract.call(this);this.isBlank="undefined"===typeof a;this.workspaceId=a?a.id:"";this.recordUndo=!1;this.type=module$exports$Blockly$Events$utils.FINISHED_LOADING}};$.$jscomp.inherits(module$exports$Blockly$Events$FinishedLoading.FinishedLoading,module$exports$Blockly$Events$Abstract.Abstract);
|
|
1712
1744
|
module$exports$Blockly$Events$FinishedLoading.FinishedLoading.prototype.toJson=function(){var a={type:this.type};this.group&&(a.group=this.group);this.workspaceId&&(a.workspaceId=this.workspaceId);return a};module$exports$Blockly$Events$FinishedLoading.FinishedLoading.prototype.fromJson=function(a){this.isBlank=!1;this.workspaceId=a.workspaceId;this.group=a.group};
|
|
1713
1745
|
(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.FINISHED_LOADING,module$exports$Blockly$Events$FinishedLoading.FinishedLoading);var module$exports$Blockly$Events$Ui={Ui:function(a,b,c,d){module$exports$Blockly$Events$UiBase.UiBase.call(this,a?a.workspace.id:void 0);this.blockId=a?a.id:null;this.element="undefined"===typeof b?"":b;this.oldValue="undefined"===typeof c?"":c;this.newValue="undefined"===typeof d?"":d;this.type=module$exports$Blockly$Events$utils.UI}};$.$jscomp.inherits(module$exports$Blockly$Events$Ui.Ui,module$exports$Blockly$Events$UiBase.UiBase);
|
|
1714
1746
|
module$exports$Blockly$Events$Ui.Ui.prototype.toJson=function(){var a=module$exports$Blockly$Events$UiBase.UiBase.prototype.toJson.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.blockId&&(a.blockId=this.blockId);return a};module$exports$Blockly$Events$Ui.Ui.prototype.fromJson=function(a){module$exports$Blockly$Events$UiBase.UiBase.prototype.fromJson.call(this,a);this.element=a.element;this.newValue=a.newValue;this.blockId=a.blockId};
|
|
@@ -1767,7 +1799,24 @@ module$exports$Blockly$Icon.Icon.prototype.createIcon=function(){this.iconGroup_
|
|
|
1767
1799
|
this,this.iconClick_),this.updateEditable())};module$exports$Blockly$Icon.Icon.prototype.dispose=function(){(0,module$exports$Blockly$utils$dom.removeNode)(this.iconGroup_);this.iconGroup_=null;this.setVisible(!1);this.block_=null};module$exports$Blockly$Icon.Icon.prototype.updateEditable=function(){};module$exports$Blockly$Icon.Icon.prototype.isVisible=function(){return!!this.bubble_};
|
|
1768
1800
|
module$exports$Blockly$Icon.Icon.prototype.iconClick_=function(a){this.block_.workspace.isDragging()||this.block_.isInFlyout||(0,module$exports$Blockly$browserEvents.isRightButton)(a)||this.setVisible(!this.isVisible())};module$exports$Blockly$Icon.Icon.prototype.applyColour=function(){this.isVisible()&&this.bubble_.setColour(this.block_.style.colourPrimary)};module$exports$Blockly$Icon.Icon.prototype.setIconLocation=function(a){this.iconXY_=a;this.isVisible()&&this.bubble_.setAnchorLocation(a)};
|
|
1769
1801
|
module$exports$Blockly$Icon.Icon.prototype.computeIconLocation=function(){var a=this.block_.getRelativeToSurfaceXY(),b=(0,module$exports$Blockly$utils$svgMath.getRelativeXY)(this.iconGroup_);a=new module$exports$Blockly$utils$Coordinate.Coordinate(a.x+b.x+this.SIZE/2,a.y+b.y+this.SIZE/2);module$exports$Blockly$utils$Coordinate.Coordinate.equals(this.getIconLocation(),a)||this.setIconLocation(a)};module$exports$Blockly$Icon.Icon.prototype.getIconLocation=function(){return this.iconXY_};
|
|
1770
|
-
module$exports$Blockly$Icon.Icon.prototype.getCorrectedSize=function(){return new module$exports$Blockly$utils$Size.Size(this.SIZE,this.SIZE-2)};module$exports$Blockly$Icon.Icon.prototype.drawIcon_=function(a){};module$exports$Blockly$Icon.Icon.prototype.setVisible=function(a){}
|
|
1802
|
+
module$exports$Blockly$Icon.Icon.prototype.getCorrectedSize=function(){return new module$exports$Blockly$utils$Size.Size(this.SIZE,this.SIZE-2)};module$exports$Blockly$Icon.Icon.prototype.drawIcon_=function(a){};module$exports$Blockly$Icon.Icon.prototype.setVisible=function(a){};$.module$exports$Blockly$Mutator={Mutator:function(a){module$exports$Blockly$Icon.Icon.call(this,null);this.quarkNames_=a;this.workspace_=null;this.workspaceHeight_=this.workspaceWidth_=0;this.sourceListener_=this.rootBlock_=this.svgDialog_=null}};$.$jscomp.inherits($.module$exports$Blockly$Mutator.Mutator,module$exports$Blockly$Icon.Icon);$.module$exports$Blockly$Mutator.Mutator.prototype.setBlock=function(a){this.block_=a};$.module$exports$Blockly$Mutator.Mutator.prototype.getWorkspace=function(){return this.workspace_};
|
|
1803
|
+
$.module$exports$Blockly$Mutator.Mutator.prototype.drawIcon_=function(a){(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},
|
|
1804
|
+
a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CIRCLE,{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},a)};$.module$exports$Blockly$Mutator.Mutator.prototype.iconClick_=function(a){this.block_.isEditable()&&module$exports$Blockly$Icon.Icon.prototype.iconClick_.call(this,a)};
|
|
1805
|
+
$.module$exports$Blockly$Mutator.Mutator.prototype.createEditor_=function(){this.svgDialog_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.SVG,{x:module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH,y:module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH},null);if(this.quarkNames_.length){var a=(0,$.module$exports$Blockly$utils$xml.createElement)("xml");for(var b=0,c;c=this.quarkNames_[b];b++){var d=(0,$.module$exports$Blockly$utils$xml.createElement)("block");
|
|
1806
|
+
d.setAttribute("type",c);a.appendChild(d)}}else a=null;b=new module$exports$Blockly$Options.Options({disable:!1,parentWorkspace:this.block_.workspace,media:this.block_.workspace.options.pathToMedia,rtl:this.block_.RTL,horizontalLayout:!1,renderer:this.block_.workspace.options.renderer,rendererOverrides:this.block_.workspace.options.rendererOverrides});b.toolboxPosition=this.block_.RTL?module$exports$Blockly$utils$toolbox.Position.RIGHT:module$exports$Blockly$utils$toolbox.Position.LEFT;if(c=!!a)b.languageTree=
|
|
1807
|
+
(0,module$exports$Blockly$utils$toolbox.convertToolboxDefToJson)(a);this.workspace_=new module$exports$Blockly$WorkspaceSvg.WorkspaceSvg(b);this.workspace_.isMutator=!0;this.workspace_.addChangeListener(module$exports$Blockly$Events$utils.disableOrphans);a=c?this.workspace_.addFlyout(module$exports$Blockly$utils$Svg.Svg.G):null;b=this.workspace_.createDom("blocklyMutatorBackground");a&&b.insertBefore(a,this.workspace_.svgBlockCanvas_);this.svgDialog_.appendChild(b);return this.svgDialog_};
|
|
1808
|
+
$.module$exports$Blockly$Mutator.Mutator.prototype.updateEditable=function(){module$exports$Blockly$Icon.Icon.prototype.updateEditable.call(this);this.block_.isInFlyout||(this.block_.isEditable()?this.iconGroup_&&(0,module$exports$Blockly$utils$dom.removeClass)(this.iconGroup_,"blocklyIconGroupReadonly"):(this.setVisible(!1),this.iconGroup_&&(0,module$exports$Blockly$utils$dom.addClass)(this.iconGroup_,"blocklyIconGroupReadonly")))};
|
|
1809
|
+
$.module$exports$Blockly$Mutator.Mutator.prototype.resizeBubble_=function(){var a=2*module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH,b=this.workspace_.getCanvas().getBBox(),c=b.width+b.x,d=b.height+3*a,e=this.workspace_.getFlyout();if(e){var f=e.getWorkspace().getMetricsManager().getScrollMetrics();d=Math.max(d,f.height+20);c+=e.getWidth()}this.block_.RTL&&(c=-b.x);c+=3*a;if(Math.abs(this.workspaceWidth_-c)>a||Math.abs(this.workspaceHeight_-d)>a)this.workspaceWidth_=c,this.workspaceHeight_=d,this.bubble_.setBubbleSize(c+
|
|
1810
|
+
a,d+a),this.svgDialog_.setAttribute("width",this.workspaceWidth_),this.svgDialog_.setAttribute("height",this.workspaceHeight_),this.workspace_.setCachedParentSvgSize(this.workspaceWidth_,this.workspaceHeight_);this.block_.RTL&&(a="translate("+this.workspaceWidth_+",0)",this.workspace_.getCanvas().setAttribute("transform",a));this.workspace_.resize()};$.module$exports$Blockly$Mutator.Mutator.prototype.onBubbleMove_=function(){this.workspace_&&this.workspace_.recordDragTargets()};
|
|
1811
|
+
$.module$exports$Blockly$Mutator.Mutator.prototype.setVisible=function(a){var b=this;if(a!==this.isVisible())if((0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.BUBBLE_OPEN))(this.block_,a,"mutator")),a){this.bubble_=new module$exports$Blockly$Bubble.Bubble(this.block_.workspace,this.createEditor_(),this.block_.pathObject.svgPath,this.iconXY_,null,null);this.bubble_.setSvgId(this.block_.id);this.bubble_.registerMoveEvent(this.onBubbleMove_.bind(this));
|
|
1812
|
+
var c=this.workspace_.options.languageTree;a=this.workspace_.getFlyout();c&&(a.init(this.workspace_),a.show(c));this.rootBlock_=this.block_.decompose(this.workspace_);c=this.rootBlock_.getDescendants(!1);for(var d=0,e=void 0;e=c[d];d++)e.render();this.rootBlock_.setMovable(!1);this.rootBlock_.setDeletable(!1);a?(c=2*a.CORNER_RADIUS,a=this.rootBlock_.RTL?a.getWidth()+c:c):a=c=16;this.block_.RTL&&(a=-a);this.rootBlock_.moveBy(a,c);if(this.block_.saveConnections){var f=this.rootBlock_;this.block_.saveConnections(f);
|
|
1813
|
+
this.sourceListener_=function(){b.block_&&b.block_.saveConnections(f)};this.block_.workspace.addChangeListener(this.sourceListener_)}this.resizeBubble_();this.workspace_.addChangeListener(this.workspaceChanged_.bind(this));this.updateWorkspace_();this.applyColour()}else this.svgDialog_=null,this.workspace_.dispose(),this.rootBlock_=this.workspace_=null,this.bubble_.dispose(),this.bubble_=null,this.workspaceHeight_=this.workspaceWidth_=0,this.sourceListener_&&(this.block_.workspace.removeChangeListener(this.sourceListener_),
|
|
1814
|
+
this.sourceListener_=null)};$.module$exports$Blockly$Mutator.Mutator.prototype.workspaceChanged_=function(a){a.isUiEvent||a.type===module$exports$Blockly$Events$utils.CHANGE&&"disabled"===a.element||a.type===module$exports$Blockly$Events$utils.CREATE||this.updateWorkspace_()};
|
|
1815
|
+
$.module$exports$Blockly$Mutator.Mutator.prototype.updateWorkspace_=function(){if(!this.workspace_.isDragging())for(var a=this.workspace_.getTopBlocks(!1),b=0,c=void 0;c=a[b];b++){var d=c.getRelativeToSurfaceXY();20>d.y&&c.moveBy(0,20-d.y);if(c.RTL){var e=-20,f=this.workspace_.getFlyout();f&&(e-=f.getWidth());d.x>e&&c.moveBy(e-d.x,0)}else 20>d.x&&c.moveBy(20-d.x,0)}if(this.rootBlock_.workspace===this.workspace_){(a=(0,module$exports$Blockly$Events$utils.getGroup)())||(0,module$exports$Blockly$Events$utils.setGroup)(!0);
|
|
1816
|
+
var g=this.block_;b=module$exports$Blockly$Events$BlockChange.BlockChange.getExtraBlockState_(g);c=g.rendered;g.rendered=!1;g.compose(this.rootBlock_);g.rendered=c;g.initSvg();g.rendered&&g.render();c=module$exports$Blockly$Events$BlockChange.BlockChange.getExtraBlockState_(g);if(b!==c){(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CHANGE))(g,"mutation",null,b,c));var h=(0,module$exports$Blockly$Events$utils.getGroup)();
|
|
1817
|
+
setTimeout(function(){var k=(0,module$exports$Blockly$Events$utils.getGroup)();(0,module$exports$Blockly$Events$utils.setGroup)(h);g.bumpNeighbours();(0,module$exports$Blockly$Events$utils.setGroup)(k)},$.module$exports$Blockly$config.config.bumpDelay)}this.workspace_.isDragging()||this.resizeBubble_();(0,module$exports$Blockly$Events$utils.setGroup)(a)}};$.module$exports$Blockly$Mutator.Mutator.prototype.dispose=function(){this.block_.mutator=null;module$exports$Blockly$Icon.Icon.prototype.dispose.call(this)};
|
|
1818
|
+
$.module$exports$Blockly$Mutator.Mutator.prototype.updateBlockStyle=function(){var a=this.workspace_;if(a&&a.getAllBlocks(!1)){for(var b=a.getAllBlocks(!1),c=0,d;d=b[c];c++)d.setStyle(d.getStyleName());if(a=a.getFlyout())for(a=a.workspace_.getAllBlocks(!1),b=0;c=a[b];b++)c.setStyle(c.getStyleName())}};
|
|
1819
|
+
$.module$exports$Blockly$Mutator.Mutator.reconnect=function(a,b,c){if(!a||!a.getSourceBlock().workspace)return!1;c=b.getInput(c).connection;var d=a.targetBlock();return d&&d!==b||c.targetConnection===a?!1:(c.isConnected()&&c.disconnect(),c.connect(a),!0)};$.module$exports$Blockly$Mutator.Mutator.findParentWs=function(a){var b=null;if(a&&a.options){var c=a.options.parentWorkspace;a.isFlyout?c&&c.options&&(b=c.options.parentWorkspace):c&&(b=c)}return b};var module$exports$Blockly$Warning={Warning:function(a){module$exports$Blockly$Icon.Icon.call(this,a);this.createIcon();this.text_=Object.create(null);this.paragraphElement_=null;this.collapseHidden=!1}};$.$jscomp.inherits(module$exports$Blockly$Warning.Warning,module$exports$Blockly$Icon.Icon);
|
|
1771
1820
|
module$exports$Blockly$Warning.Warning.prototype.drawIcon_=function(a){(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,
|
|
1772
1821
|
{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},a)};module$exports$Blockly$Warning.Warning.prototype.setVisible=function(a){a!==this.isVisible()&&((0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.BUBBLE_OPEN))(this.block_,a,"warning")),a?this.createBubble_():this.disposeBubble_())};
|
|
1773
1822
|
module$exports$Blockly$Warning.Warning.prototype.createBubble_=function(){this.paragraphElement_=module$exports$Blockly$Bubble.Bubble.textToDom(this.getText());this.bubble_=module$exports$Blockly$Bubble.Bubble.createNonEditableBubble(this.paragraphElement_,this.block_,this.iconXY_);this.applyColour()};module$exports$Blockly$Warning.Warning.prototype.disposeBubble_=function(){this.bubble_.dispose();this.paragraphElement_=this.bubble_=null};
|
|
@@ -1892,7 +1941,7 @@ module$exports$Blockly$Trashcan.Trashcan.prototype.setLidAngle_=function(a){var
|
|
|
1892
1941
|
module$exports$Blockly$Trashcan.Trashcan.prototype.setMinOpenness_=function(a){this.minOpenness_=a;this.isLidOpen||this.setLidAngle_(a*module$contents$Blockly$Trashcan_MAX_LID_ANGLE)};module$exports$Blockly$Trashcan.Trashcan.prototype.closeLid=function(){this.setLidOpen(!1)};module$exports$Blockly$Trashcan.Trashcan.prototype.click=function(){this.hasContents_()&&this.openFlyout()};
|
|
1893
1942
|
module$exports$Blockly$Trashcan.Trashcan.prototype.fireUiEvent_=function(a){a=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.TRASHCAN_OPEN))(a,this.workspace_.id);(0,module$exports$Blockly$Events$utils.fire)(a)};module$exports$Blockly$Trashcan.Trashcan.prototype.blockMouseDownWhenOpenable_=function(a){!this.contentsIsOpen()&&this.hasContents_()&&a.stopPropagation()};
|
|
1894
1943
|
module$exports$Blockly$Trashcan.Trashcan.prototype.mouseOver_=function(){this.hasContents_()&&this.setLidOpen(!0)};module$exports$Blockly$Trashcan.Trashcan.prototype.mouseOut_=function(){this.setLidOpen(!1)};
|
|
1895
|
-
module$exports$Blockly$Trashcan.Trashcan.prototype.onDelete_=function(a){if(!(0>=this.workspace_.options.maxTrashcanContents||a.type!==module$exports$Blockly$Events$utils.DELETE||a.wasShadow)&&(a=this.cleanBlockJson_(a.oldJson),-1===this.contents_.indexOf(a))){for(this.contents_.unshift(a);this.contents_.length>this.workspace_.options.maxTrashcanContents;)this.contents_.pop();this.setMinOpenness_(module$contents$Blockly$Trashcan_HAS_BLOCKS_LID_ANGLE)}};
|
|
1944
|
+
module$exports$Blockly$Trashcan.Trashcan.prototype.onDelete_=function(a){if(!(0>=this.workspace_.options.maxTrashcanContents||a.type!==module$exports$Blockly$Events$utils.DELETE||a.type!==module$exports$Blockly$Events$utils.DELETE||a.wasShadow)&&(a=this.cleanBlockJson_(a.oldJson),-1===this.contents_.indexOf(a))){for(this.contents_.unshift(a);this.contents_.length>this.workspace_.options.maxTrashcanContents;)this.contents_.pop();this.setMinOpenness_(module$contents$Blockly$Trashcan_HAS_BLOCKS_LID_ANGLE)}};
|
|
1896
1945
|
module$exports$Blockly$Trashcan.Trashcan.prototype.cleanBlockJson_=function(a){function b(c){if(c){delete c.id;delete c.x;delete c.y;delete c.enabled;if(c.icons&&c.icons.comment){var d=c.icons.comment;delete d.height;delete d.width;delete d.pinned}d=c.inputs;for(var e in d){var f=d[e];b(f.block);b(f.shadow)}c.next&&(c=c.next,b(c.block),b(c.shadow))}}a=JSON.parse(JSON.stringify(a));b(a);a.kind="BLOCK";return JSON.stringify(a)};
|
|
1897
1946
|
var module$contents$Blockly$Trashcan_WIDTH=47,module$contents$Blockly$Trashcan_BODY_HEIGHT=44,module$contents$Blockly$Trashcan_LID_HEIGHT=16,module$contents$Blockly$Trashcan_MARGIN_VERTICAL=20,module$contents$Blockly$Trashcan_MARGIN_HORIZONTAL=20,module$contents$Blockly$Trashcan_MARGIN_HOTSPOT=10,module$contents$Blockly$Trashcan_SPRITE_LEFT=0,module$contents$Blockly$Trashcan_SPRITE_TOP=32,module$contents$Blockly$Trashcan_HAS_BLOCKS_LID_ANGLE=.1,module$contents$Blockly$Trashcan_ANIMATION_LENGTH=80,
|
|
1898
1947
|
module$contents$Blockly$Trashcan_ANIMATION_FRAMES=4,module$contents$Blockly$Trashcan_OPACITY_MIN=.4,module$contents$Blockly$Trashcan_OPACITY_MAX=.8,module$contents$Blockly$Trashcan_MAX_LID_ANGLE=45;var module$exports$Blockly$FlyoutButton={FlyoutButton:function(a,b,c,d){this.workspace_=a;this.targetWorkspace_=b;this.text_=c.text;this.position_=new module$exports$Blockly$utils$Coordinate.Coordinate(0,0);this.isLabel_=d;this.callbackKey_=c.callbackKey||c.callbackkey;this.cssClass_=c["web-class"]||null;this.onMouseUpWrapper_=null;this.info=c;this.height=this.width=0;this.svgText_=this.svgGroup_=null}};
|
|
@@ -1910,8 +1959,8 @@ c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR");b.push(c);a.registerButto
|
|
|
1910
1959
|
return b=b.concat(a)},flyoutCategoryBlocks:function(a){a=a.getAllVariables();var b=[];if(0<a.length){if(module$exports$Blockly$blocks.Blocks.variables_set_dynamic){var c=a[a.length-1],d=(0,$.module$exports$Blockly$utils$xml.createElement)("block");d.setAttribute("type","variables_set_dynamic");d.setAttribute("gap",24);d.appendChild((0,$.module$exports$Blockly$Variables.generateVariableFieldDom)(c));b.push(d)}if(module$exports$Blockly$blocks.Blocks.variables_get_dynamic)for(a.sort(module$exports$Blockly$VariableModel.VariableModel.compareByName),
|
|
1911
1960
|
c=0;d=a[c];c++){var e=(0,$.module$exports$Blockly$utils$xml.createElement)("block");e.setAttribute("type","variables_get_dynamic");e.setAttribute("gap",8);e.appendChild((0,$.module$exports$Blockly$Variables.generateVariableFieldDom)(d));b.push(e)}}return b}};var module$exports$Blockly$IRegistrableField={IRegistrableField:{}};var module$contents$Blockly$Procedures_procTupleComparator;$.module$exports$Blockly$Procedures={CATEGORY_NAME:"PROCEDURE",DEFAULT_ARG:"x",allProcedures:function(a){var b=a.getBlocksByType("procedures_defnoreturn",!1).map(function(c){return c.getProcedureDef()});a=a.getBlocksByType("procedures_defreturn",!1).map(function(c){return c.getProcedureDef()});b.sort(module$contents$Blockly$Procedures_procTupleComparator);a.sort(module$contents$Blockly$Procedures_procTupleComparator);return[b,a]}};
|
|
1912
1961
|
module$contents$Blockly$Procedures_procTupleComparator=function(a,b){return a[0].localeCompare(b[0],void 0,{sensitivity:"base"})};$.module$exports$Blockly$Procedures.findLegalName=function(a,b){if(b.isInFlyout)return a;for(a=a||$.module$exports$Blockly$Msg.Msg.UNNAMED_KEY||"unnamed";!module$contents$Blockly$Procedures_isLegalName(a,b.workspace,b);){var c=a.match(/^(.*?)(\d+)$/);a=c?c[1]+(parseInt(c[2],10)+1):a+"2"}return a};
|
|
1913
|
-
var module$contents$Blockly$Procedures_isLegalName=function(a,b,c){return!(0,$.module$exports$Blockly$Procedures.isNameUsed)(a,b,c)};$.module$exports$Blockly$Procedures.isNameUsed=function(a,b,c){b=b.getAllBlocks(!1);for(var d=0;d<b.length;d++)if(b[d]!==c
|
|
1914
|
-
$.module$exports$Blockly$Procedures.rename=function(a){a=a.trim();var b=(0,$.module$exports$Blockly$Procedures.findLegalName)(a,this.getSourceBlock()),c=this.getValue();if(c!==a&&c!==b){a=this.getSourceBlock().workspace.getAllBlocks(!1);for(var d=0;d<a.length;d++)a[d].renameProcedure&&
|
|
1962
|
+
var module$contents$Blockly$Procedures_isLegalName=function(a,b,c){return!(0,$.module$exports$Blockly$Procedures.isNameUsed)(a,b,c)};$.module$exports$Blockly$Procedures.isNameUsed=function(a,b,c){b=b.getAllBlocks(!1);for(var d=0;d<b.length;d++)if(b[d]!==c){var e=b[d];if(e.getProcedureDef&&(e=e.getProcedureDef(),$.module$exports$Blockly$Names.Names.equals(e[0],a)))return!0}return!1};
|
|
1963
|
+
$.module$exports$Blockly$Procedures.rename=function(a){a=a.trim();var b=(0,$.module$exports$Blockly$Procedures.findLegalName)(a,this.getSourceBlock()),c=this.getValue();if(c!==a&&c!==b){a=this.getSourceBlock().workspace.getAllBlocks(!1);for(var d=0;d<a.length;d++){var e=a[d];e.renameProcedure&&e.renameProcedure(c,b)}}return b};
|
|
1915
1964
|
$.module$exports$Blockly$Procedures.flyoutCategory=function(a){function b(f,g){for(var h=0;h<f.length;h++){var k=f[h][0],l=f[h][1],m=(0,$.module$exports$Blockly$utils$xml.createElement)("block");m.setAttribute("type",g);m.setAttribute("gap",16);var n=(0,$.module$exports$Blockly$utils$xml.createElement)("mutation");n.setAttribute("name",k);m.appendChild(n);for(k=0;k<l.length;k++){var p=(0,$.module$exports$Blockly$utils$xml.createElement)("arg");p.setAttribute("name",l[k]);n.appendChild(p)}c.push(m)}}
|
|
1916
1965
|
var c=[];if(module$exports$Blockly$blocks.Blocks.procedures_defnoreturn){var d=(0,$.module$exports$Blockly$utils$xml.createElement)("block");d.setAttribute("type","procedures_defnoreturn");d.setAttribute("gap",16);var e=(0,$.module$exports$Blockly$utils$xml.createElement)("field");e.setAttribute("name","NAME");e.appendChild((0,$.module$exports$Blockly$utils$xml.createTextNode)($.module$exports$Blockly$Msg.Msg.PROCEDURES_DEFNORETURN_PROCEDURE));d.appendChild(e);c.push(d)}module$exports$Blockly$blocks.Blocks.procedures_defreturn&&
|
|
1917
1966
|
(d=(0,$.module$exports$Blockly$utils$xml.createElement)("block"),d.setAttribute("type","procedures_defreturn"),d.setAttribute("gap",16),e=(0,$.module$exports$Blockly$utils$xml.createElement)("field"),e.setAttribute("name","NAME"),e.appendChild((0,$.module$exports$Blockly$utils$xml.createTextNode)($.module$exports$Blockly$Msg.Msg.PROCEDURES_DEFRETURN_PROCEDURE)),d.appendChild(e),c.push(d));module$exports$Blockly$blocks.Blocks.procedures_ifreturn&&(d=(0,$.module$exports$Blockly$utils$xml.createElement)("block"),
|
|
@@ -1920,26 +1969,9 @@ var module$contents$Blockly$Procedures_updateMutatorFlyout=function(a){for(var b
|
|
|
1920
1969
|
b);b=(0,$.module$exports$Blockly$utils$xml.createTextNode)(b);e.appendChild(b);d.appendChild(e);c.appendChild(d);a.updateToolbox(c)};
|
|
1921
1970
|
$.module$exports$Blockly$Procedures.mutatorOpenListener=function(a){if(a.type===module$exports$Blockly$Events$utils.BUBBLE_OPEN&&"mutator"===a.bubbleType&&a.isOpen){a=module$exports$Blockly$Workspace.Workspace.getById(a.workspaceId).getBlockById(a.blockId);var b=a.type;if("procedures_defnoreturn"===b||"procedures_defreturn"===b)a=a.mutator.getWorkspace(),module$contents$Blockly$Procedures_updateMutatorFlyout(a),a.addChangeListener(module$contents$Blockly$Procedures_mutatorChangeListener)}};
|
|
1922
1971
|
var module$contents$Blockly$Procedures_mutatorChangeListener=function(a){if(a.type===module$exports$Blockly$Events$utils.CREATE||a.type===module$exports$Blockly$Events$utils.DELETE||a.type===module$exports$Blockly$Events$utils.CHANGE)a=module$exports$Blockly$Workspace.Workspace.getById(a.workspaceId),module$contents$Blockly$Procedures_updateMutatorFlyout(a)};
|
|
1923
|
-
$.module$exports$Blockly$Procedures.getCallers=function(a,b){var c=[];b=b.getAllBlocks(!1);for(var d=0;d<b.length;d++)
|
|
1972
|
+
$.module$exports$Blockly$Procedures.getCallers=function(a,b){var c=[];b=b.getAllBlocks(!1);for(var d=0;d<b.length;d++){var e=b[d];e.getProcedureCall&&(e=e.getProcedureCall())&&$.module$exports$Blockly$Names.Names.equals(e,a)&&c.push(b[d])}return c};
|
|
1924
1973
|
$.module$exports$Blockly$Procedures.mutateCallers=function(a){var b=(0,module$exports$Blockly$Events$utils.getRecordUndo)(),c=a.getProcedureDef()[0],d=a.mutationToDom(!0);a=(0,$.module$exports$Blockly$Procedures.getCallers)(c,a.workspace);c=0;for(var e;e=a[c];c++){var f=e.mutationToDom();f=f&&(0,$.module$exports$Blockly$Xml.domToText)(f);e.domToMutation(d);var g=e.mutationToDom();g=g&&(0,$.module$exports$Blockly$Xml.domToText)(g);f!==g&&((0,module$exports$Blockly$Events$utils.setRecordUndo)(!1),(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CHANGE))(e,
|
|
1925
|
-
"mutation",null,f,g)),(0,module$exports$Blockly$Events$utils.setRecordUndo)(b))}};$.module$exports$Blockly$Procedures.getDefinition=function(a,b){b=b.getAllBlocks(!1);for(var c=0;c<b.length;c++)
|
|
1926
|
-
$.module$exports$Blockly$Mutator.Mutator.prototype.drawIcon_=function(a){(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},
|
|
1927
|
-
a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CIRCLE,{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},a)};$.module$exports$Blockly$Mutator.Mutator.prototype.iconClick_=function(a){this.block_.isEditable()&&module$exports$Blockly$Icon.Icon.prototype.iconClick_.call(this,a)};
|
|
1928
|
-
$.module$exports$Blockly$Mutator.Mutator.prototype.createEditor_=function(){this.svgDialog_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.SVG,{x:module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH,y:module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH},null);if(this.quarkNames_.length){var a=(0,$.module$exports$Blockly$utils$xml.createElement)("xml");for(var b=0,c;c=this.quarkNames_[b];b++){var d=(0,$.module$exports$Blockly$utils$xml.createElement)("block");
|
|
1929
|
-
d.setAttribute("type",c);a.appendChild(d)}}else a=null;b=new module$exports$Blockly$Options.Options({disable:!1,parentWorkspace:this.block_.workspace,media:this.block_.workspace.options.pathToMedia,rtl:this.block_.RTL,horizontalLayout:!1,renderer:this.block_.workspace.options.renderer,rendererOverrides:this.block_.workspace.options.rendererOverrides});b.toolboxPosition=this.block_.RTL?module$exports$Blockly$utils$toolbox.Position.RIGHT:module$exports$Blockly$utils$toolbox.Position.LEFT;if(c=!!a)b.languageTree=
|
|
1930
|
-
(0,module$exports$Blockly$utils$toolbox.convertToolboxDefToJson)(a);this.workspace_=new module$exports$Blockly$WorkspaceSvg.WorkspaceSvg(b);this.workspace_.isMutator=!0;this.workspace_.addChangeListener(module$exports$Blockly$Events$utils.disableOrphans);a=c?this.workspace_.addFlyout(module$exports$Blockly$utils$Svg.Svg.G):null;b=this.workspace_.createDom("blocklyMutatorBackground");a&&b.insertBefore(a,this.workspace_.svgBlockCanvas_);this.svgDialog_.appendChild(b);return this.svgDialog_};
|
|
1931
|
-
$.module$exports$Blockly$Mutator.Mutator.prototype.updateEditable=function(){module$exports$Blockly$Icon.Icon.prototype.updateEditable.call(this);this.block_.isInFlyout||(this.block_.isEditable()?this.iconGroup_&&(0,module$exports$Blockly$utils$dom.removeClass)(this.iconGroup_,"blocklyIconGroupReadonly"):(this.setVisible(!1),this.iconGroup_&&(0,module$exports$Blockly$utils$dom.addClass)(this.iconGroup_,"blocklyIconGroupReadonly")))};
|
|
1932
|
-
$.module$exports$Blockly$Mutator.Mutator.prototype.resizeBubble_=function(){var a=2*module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH,b=this.workspace_.getCanvas().getBBox(),c=b.width+b.x,d=b.height+3*a,e=this.workspace_.getFlyout();if(e){var f=e.getWorkspace().getMetricsManager().getScrollMetrics();d=Math.max(d,f.height+20);c+=e.getWidth()}this.block_.RTL&&(c=-b.x);c+=3*a;if(Math.abs(this.workspaceWidth_-c)>a||Math.abs(this.workspaceHeight_-d)>a)this.workspaceWidth_=c,this.workspaceHeight_=d,this.bubble_.setBubbleSize(c+
|
|
1933
|
-
a,d+a),this.svgDialog_.setAttribute("width",this.workspaceWidth_),this.svgDialog_.setAttribute("height",this.workspaceHeight_),this.workspace_.setCachedParentSvgSize(this.workspaceWidth_,this.workspaceHeight_);this.block_.RTL&&(a="translate("+this.workspaceWidth_+",0)",this.workspace_.getCanvas().setAttribute("transform",a));this.workspace_.resize()};$.module$exports$Blockly$Mutator.Mutator.prototype.onBubbleMove_=function(){this.workspace_&&this.workspace_.recordDragTargets()};
|
|
1934
|
-
$.module$exports$Blockly$Mutator.Mutator.prototype.setVisible=function(a){if(a!==this.isVisible())if((0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.BUBBLE_OPEN))(this.block_,a,"mutator")),a){this.bubble_=new module$exports$Blockly$Bubble.Bubble(this.block_.workspace,this.createEditor_(),this.block_.pathObject.svgPath,this.iconXY_,null,null);this.bubble_.setSvgId(this.block_.id);this.bubble_.registerMoveEvent(this.onBubbleMove_.bind(this));
|
|
1935
|
-
var b=this.workspace_.options.languageTree;a=this.workspace_.getFlyout();b&&(a.init(this.workspace_),a.show(b));this.rootBlock_=this.block_.decompose(this.workspace_);b=this.rootBlock_.getDescendants(!1);for(var c=0,d=void 0;d=b[c];c++)d.render();this.rootBlock_.setMovable(!1);this.rootBlock_.setDeletable(!1);a?(b=2*a.CORNER_RADIUS,a=this.rootBlock_.RTL?a.getWidth()+b:b):a=b=16;this.block_.RTL&&(a=-a);this.rootBlock_.moveBy(a,b);if(this.block_.saveConnections){var e=this.rootBlock_,f=this.block_;
|
|
1936
|
-
f.saveConnections(this.rootBlock_);this.sourceListener_=function(){f.saveConnections(e)};this.block_.workspace.addChangeListener(this.sourceListener_)}this.resizeBubble_();this.workspace_.addChangeListener(this.workspaceChanged_.bind(this));this.updateWorkspace_();this.applyColour()}else this.svgDialog_=null,this.workspace_.dispose(),this.rootBlock_=this.workspace_=null,this.bubble_.dispose(),this.bubble_=null,this.workspaceHeight_=this.workspaceWidth_=0,this.sourceListener_&&(this.block_.workspace.removeChangeListener(this.sourceListener_),
|
|
1937
|
-
this.sourceListener_=null)};$.module$exports$Blockly$Mutator.Mutator.prototype.workspaceChanged_=function(a){a.isUiEvent||a.type===module$exports$Blockly$Events$utils.CHANGE&&"disabled"===a.element||a.type===module$exports$Blockly$Events$utils.CREATE||this.updateWorkspace_()};
|
|
1938
|
-
$.module$exports$Blockly$Mutator.Mutator.prototype.updateWorkspace_=function(){if(!this.workspace_.isDragging())for(var a=this.workspace_.getTopBlocks(!1),b=0,c=void 0;c=a[b];b++){var d=c.getRelativeToSurfaceXY();20>d.y&&c.moveBy(0,20-d.y);if(c.RTL){var e=-20,f=this.workspace_.getFlyout();f&&(e-=f.getWidth());d.x>e&&c.moveBy(e-d.x,0)}else 20>d.x&&c.moveBy(20-d.x,0)}if(this.rootBlock_.workspace===this.workspace_){(a=(0,module$exports$Blockly$Events$utils.getGroup)())||(0,module$exports$Blockly$Events$utils.setGroup)(!0);
|
|
1939
|
-
var g=this.block_;b=module$exports$Blockly$Events$BlockChange.BlockChange.getExtraBlockState_(g);c=g.rendered;g.rendered=!1;g.compose(this.rootBlock_);g.rendered=c;g.initSvg();g.rendered&&g.render();c=module$exports$Blockly$Events$BlockChange.BlockChange.getExtraBlockState_(g);if(b!==c){(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CHANGE))(g,"mutation",null,b,c));var h=(0,module$exports$Blockly$Events$utils.getGroup)();
|
|
1940
|
-
setTimeout(function(){var k=(0,module$exports$Blockly$Events$utils.getGroup)();(0,module$exports$Blockly$Events$utils.setGroup)(h);g.bumpNeighbours();(0,module$exports$Blockly$Events$utils.setGroup)(k)},$.module$exports$Blockly$config.config.bumpDelay)}this.workspace_.isDragging()||this.resizeBubble_();(0,module$exports$Blockly$Events$utils.setGroup)(a)}};$.module$exports$Blockly$Mutator.Mutator.prototype.dispose=function(){this.block_.mutator=null;module$exports$Blockly$Icon.Icon.prototype.dispose.call(this)};
|
|
1941
|
-
$.module$exports$Blockly$Mutator.Mutator.prototype.updateBlockStyle=function(){var a=this.workspace_;if(a&&a.getAllBlocks(!1)){for(var b=a.getAllBlocks(!1),c=0,d;d=b[c];c++)d.setStyle(d.getStyleName());if(a=a.getFlyout())for(a=a.workspace_.getAllBlocks(!1),b=0;c=a[b];b++)c.setStyle(c.getStyleName())}};
|
|
1942
|
-
$.module$exports$Blockly$Mutator.Mutator.reconnect=function(a,b,c){if(!a||!a.getSourceBlock().workspace)return!1;c=b.getInput(c).connection;var d=a.targetBlock();return d&&d!==b||c.targetConnection===a?!1:(c.isConnected()&&c.disconnect(),c.connect(a),!0)};$.module$exports$Blockly$Mutator.Mutator.findParentWs=function(a){var b=null;if(a&&a.options){var c=a.options.parentWorkspace;a.isFlyout?c&&c.options&&(b=c.options.parentWorkspace):c&&(b=c)}return b};$.Blockly={VERSION:"7.20211209.0"};$.Blockly.ALIGN_LEFT=$.module$exports$Blockly$Input.Align.LEFT;$.Blockly.ALIGN_CENTRE=$.module$exports$Blockly$Input.Align.CENTRE;$.Blockly.ALIGN_RIGHT=$.module$exports$Blockly$Input.Align.RIGHT;$.Blockly.INPUT_VALUE=$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE;$.Blockly.OUTPUT_VALUE=$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE;$.Blockly.NEXT_STATEMENT=$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT;
|
|
1974
|
+
"mutation",null,f,g)),(0,module$exports$Blockly$Events$utils.setRecordUndo)(b))}};$.module$exports$Blockly$Procedures.getDefinition=function(a,b){b=b.getAllBlocks(!1);for(var c=0;c<b.length;c++){var d=b[c];if(d.getProcedureDef&&(d=d.getProcedureDef())&&$.module$exports$Blockly$Names.Names.equals(d[0],a))return b[c]}return null};$.Blockly={VERSION:"8.0.1-beta.0"};$.Blockly.ALIGN_LEFT=$.module$exports$Blockly$Input.Align.LEFT;$.Blockly.ALIGN_CENTRE=$.module$exports$Blockly$Input.Align.CENTRE;$.Blockly.ALIGN_RIGHT=$.module$exports$Blockly$Input.Align.RIGHT;$.Blockly.INPUT_VALUE=$.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE;$.Blockly.OUTPUT_VALUE=$.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE;$.Blockly.NEXT_STATEMENT=$.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT;
|
|
1943
1975
|
$.Blockly.PREVIOUS_STATEMENT=$.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT;$.Blockly.DUMMY_INPUT=$.module$exports$Blockly$inputTypes.inputTypes.DUMMY;$.Blockly.TOOLBOX_AT_TOP=module$exports$Blockly$utils$toolbox.Position.TOP;$.Blockly.TOOLBOX_AT_BOTTOM=module$exports$Blockly$utils$toolbox.Position.BOTTOM;$.Blockly.TOOLBOX_AT_LEFT=module$exports$Blockly$utils$toolbox.Position.LEFT;$.Blockly.TOOLBOX_AT_RIGHT=module$exports$Blockly$utils$toolbox.Position.RIGHT;
|
|
1944
1976
|
$.Blockly.svgResize=$.module$exports$Blockly$common.svgResize;var module$contents$Blockly_hideChaff=function(a){(0,$.module$exports$Blockly$common.getMainWorkspace)().hideChaff(a)};$.Blockly.hideChaff=module$contents$Blockly_hideChaff;$.Blockly.getMainWorkspace=$.module$exports$Blockly$common.getMainWorkspace;$.Blockly.defineBlocksWithJsonArray=$.module$exports$Blockly$common.defineBlocksWithJsonArray;$.Blockly.setParentContainer=$.module$exports$Blockly$common.setParentContainer;
|
|
1945
1977
|
Object.defineProperties($.Blockly,{alert:{set:function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.alert","December 2021","December 2022");(0,module$exports$Blockly$dialog.setAlert)(a)},get:function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.alert","December 2021","December 2022","Blockly.dialog.alert()");return module$exports$Blockly$dialog.alert}},confirm:{set:function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.confirm","December 2021","December 2022");
|
|
@@ -1947,7 +1979,7 @@ Object.defineProperties($.Blockly,{alert:{set:function(a){(0,module$exports$Bloc
|
|
|
1947
1979
|
"December 2022");(0,module$exports$Blockly$dialog.setPrompt)(a)},get:function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.prompt","December 2021","December 2022","Blockly.dialog.prompt()");return module$exports$Blockly$dialog.prompt}},selected:{get:function(){return(0,$.module$exports$Blockly$common.getSelected)()},set:function(a){(0,$.module$exports$Blockly$common.setSelected)(a)}},HSV_SATURATION:{get:function(){return module$exports$Blockly$utils.colour.getHsvSaturation()},set:function(a){module$exports$Blockly$utils.colour.setHsvSaturation(a)}},
|
|
1948
1980
|
HSV_VALUE:{get:function(){return module$exports$Blockly$utils.colour.getHsvValue()},set:function(a){module$exports$Blockly$utils.colour.setHsvValue(a)}}});$.Blockly.svgSize=module$exports$Blockly$utils$svgMath.svgSize;var module$contents$Blockly_resizeSvgContentsLocal=function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.resizeSvgContents","December 2021","December 2022","Blockly.WorkspaceSvg.resizeSvgContents");(0,module$exports$Blockly$WorkspaceSvg.resizeSvgContents)(a)};
|
|
1949
1981
|
$.Blockly.resizeSvgContents=module$contents$Blockly_resizeSvgContentsLocal;var module$contents$Blockly_copy=function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.copy","December 2021","December 2022","Blockly.clipboard.copy");(0,module$exports$Blockly$clipboard.copy)(a)};$.Blockly.copy=module$contents$Blockly_copy;
|
|
1950
|
-
var module$contents$Blockly_paste=function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.paste","December 2021","December 2022","Blockly.clipboard.paste");return(0,module$exports$Blockly$clipboard.paste)()};$.Blockly.paste=module$contents$Blockly_paste;var module$contents$Blockly_duplicate=function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.duplicate","December 2021","December 2022","Blockly.clipboard.duplicate");(0,module$exports$Blockly$clipboard.duplicate)(a)};
|
|
1982
|
+
var module$contents$Blockly_paste=function(){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.paste","December 2021","December 2022","Blockly.clipboard.paste");return!!(0,module$exports$Blockly$clipboard.paste)()};$.Blockly.paste=module$contents$Blockly_paste;var module$contents$Blockly_duplicate=function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.duplicate","December 2021","December 2022","Blockly.clipboard.duplicate");(0,module$exports$Blockly$clipboard.duplicate)(a)};
|
|
1951
1983
|
$.Blockly.duplicate=module$contents$Blockly_duplicate;var module$contents$Blockly_isNumber=function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.isNumber","December 2021","December 2022","Blockly.utils.string.isNumber");return module$exports$Blockly$utils.string.isNumber(a)};$.Blockly.isNumber=module$contents$Blockly_isNumber;
|
|
1952
1984
|
var module$contents$Blockly_hueToHex=function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.hueToHex","December 2021","December 2022","Blockly.utils.colour.hueToHex");return(0,module$exports$Blockly$utils$colour.hueToHex)(a)};$.Blockly.hueToHex=module$contents$Blockly_hueToHex;
|
|
1953
1985
|
var module$contents$Blockly_bindEvent_=function(a,b,c,d){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.bindEvent_","December 2021","December 2022","Blockly.browserEvents.bind");return(0,module$exports$Blockly$browserEvents.bind)(a,b,c,d)};$.Blockly.bindEvent_=module$contents$Blockly_bindEvent_;var module$contents$Blockly_unbindEvent_=function(a){(0,module$exports$Blockly$utils$deprecation.warn)("Blockly.unbindEvent_","December 2021","December 2022","Blockly.browserEvents.unbind");return(0,module$exports$Blockly$browserEvents.unbind)(a)};
|
|
@@ -1956,7 +1988,7 @@ $.Blockly.DRAG_STACK=module$exports$Blockly$internalConstants.DRAG_STACK;$.Block
|
|
|
1956
1988
|
$.Blockly.VARIABLE_CATEGORY_NAME=$.module$exports$Blockly$Variables.CATEGORY_NAME;$.Blockly.VARIABLE_DYNAMIC_CATEGORY_NAME=module$exports$Blockly$VariablesDynamic.CATEGORY_NAME;$.Blockly.PROCEDURE_CATEGORY_NAME=$.module$exports$Blockly$Procedures.CATEGORY_NAME;$.Blockly.ASTNode=module$exports$Blockly$ASTNode.ASTNode;$.Blockly.BasicCursor=module$exports$Blockly$BasicCursor.BasicCursor;$.Blockly.Block=module$exports$Blockly$Block.Block;$.Blockly.BlocklyOptions=module$exports$Blockly$BlocklyOptions.BlocklyOptions;
|
|
1957
1989
|
$.Blockly.BlockDragger=module$exports$Blockly$BlockDragger.BlockDragger;$.Blockly.BlockDragSurfaceSvg=module$exports$Blockly$BlockDragSurfaceSvg.BlockDragSurfaceSvg;$.Blockly.BlockSvg=module$exports$Blockly$BlockSvg.BlockSvg;$.Blockly.Blocks=module$exports$Blockly$blocks.Blocks;$.Blockly.Bubble=module$exports$Blockly$Bubble.Bubble;$.Blockly.BubbleDragger=module$exports$Blockly$BubbleDragger.BubbleDragger;$.Blockly.CollapsibleToolboxCategory=module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory;
|
|
1958
1990
|
$.Blockly.Comment=module$exports$Blockly$Comment.Comment;$.Blockly.ComponentManager=module$exports$Blockly$ComponentManager.ComponentManager;$.Blockly.Connection=module$exports$Blockly$Connection.Connection;$.Blockly.ConnectionType=$.module$exports$Blockly$ConnectionType.ConnectionType;$.Blockly.ConnectionChecker=module$exports$Blockly$ConnectionChecker.ConnectionChecker;$.Blockly.ConnectionDB=module$exports$Blockly$ConnectionDB.ConnectionDB;$.Blockly.ContextMenu=$.module$exports$Blockly$ContextMenu;
|
|
1959
|
-
$.Blockly.ContextMenuItems=module$exports$Blockly$ContextMenuItems;$.Blockly.ContextMenuRegistry=module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry;$.Blockly.Css=module$exports$Blockly$Css;$.Blockly.Cursor=module$exports$Blockly$Cursor.Cursor;$.Blockly.DeleteArea=module$exports$Blockly$DeleteArea.DeleteArea;$.Blockly.DragTarget=module$exports$Blockly$DragTarget.DragTarget;$.Blockly.DropDownDiv=module$exports$Blockly$
|
|
1991
|
+
$.Blockly.ContextMenuItems=module$exports$Blockly$ContextMenuItems;$.Blockly.ContextMenuRegistry=module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry;$.Blockly.Css=module$exports$Blockly$Css;$.Blockly.Cursor=module$exports$Blockly$Cursor.Cursor;$.Blockly.DeleteArea=module$exports$Blockly$DeleteArea.DeleteArea;$.Blockly.DragTarget=module$exports$Blockly$DragTarget.DragTarget;$.Blockly.DropDownDiv=module$exports$Blockly$dropDownDiv;$.Blockly.Events=$.module$exports$Blockly$Events;
|
|
1960
1992
|
$.Blockly.Extensions=$.module$exports$Blockly$Extensions;$.Blockly.Field=module$exports$Blockly$Field.Field;$.Blockly.FieldAngle=module$exports$Blockly$FieldAngle.FieldAngle;$.Blockly.FieldCheckbox=$.module$exports$Blockly$FieldCheckbox.FieldCheckbox;$.Blockly.FieldColour=module$exports$Blockly$FieldColour.FieldColour;$.Blockly.FieldDropdown=$.module$exports$Blockly$FieldDropdown.FieldDropdown;$.Blockly.FieldImage=$.module$exports$Blockly$FieldImage.FieldImage;$.Blockly.FieldLabel=$.module$exports$Blockly$FieldLabel.FieldLabel;
|
|
1961
1993
|
$.Blockly.FieldLabelSerializable=module$exports$Blockly$FieldLabelSerializable.FieldLabelSerializable;$.Blockly.FieldMultilineInput=module$exports$Blockly$FieldMultilineInput.FieldMultilineInput;$.Blockly.FieldNumber=module$exports$Blockly$FieldNumber.FieldNumber;$.Blockly.FieldTextInput=$.module$exports$Blockly$FieldTextInput.FieldTextInput;$.Blockly.FieldVariable=module$exports$Blockly$FieldVariable.FieldVariable;$.Blockly.Flyout=module$exports$Blockly$Flyout.Flyout;$.Blockly.FlyoutButton=module$exports$Blockly$FlyoutButton.FlyoutButton;
|
|
1962
1994
|
$.Blockly.FlyoutMetricsManager=module$exports$Blockly$FlyoutMetricsManager.FlyoutMetricsManager;$.Blockly.Generator=$.module$exports$Blockly$Generator.Generator;$.Blockly.Gesture=module$exports$Blockly$Gesture.Gesture;$.Blockly.Grid=module$exports$Blockly$Grid.Grid;$.Blockly.HorizontalFlyout=module$exports$Blockly$HorizontalFlyout.HorizontalFlyout;$.Blockly.IASTNodeLocation=module$exports$Blockly$IASTNodeLocation.IASTNodeLocation;$.Blockly.IASTNodeLocationSvg=module$exports$Blockly$IASTNodeLocationSvg.IASTNodeLocationSvg;
|
|
@@ -1975,7 +2007,7 @@ $.Blockly.geras=module$exports$Blockly$geras;$.Blockly.inject=module$exports$Blo
|
|
|
1975
2007
|
$.Blockly.serialization={blocks:module$exports$Blockly$serialization$blocks,exceptions:module$exports$Blockly$serialization$exceptions,priorities:module$exports$Blockly$serialization$priorities,registry:module$exports$Blockly$serialization$registry,variables:module$exports$Blockly$serialization$variables,workspaces:module$exports$Blockly$serialization$workspaces,ISerializer:module$exports$Blockly$serialization$ISerializer.ISerializer};$.Blockly.thrasos=module$exports$Blockly$thrasos;
|
|
1976
2008
|
$.Blockly.uiPosition=module$exports$Blockly$uiPosition;$.Blockly.utils=module$exports$Blockly$utils;$.Blockly.zelos=module$exports$Blockly$zelos;"Blockly"in $.module$exports$Blockly$utils$global.globalThis||($.module$exports$Blockly$utils$global.globalThis.Blockly={Msg:$.module$exports$Blockly$Msg.Msg});
|
|
1977
2009
|
if(!COMPILED&&"object"===typeof $.module$exports$Blockly$utils$global.globalThis.Blockly&&$.module$exports$Blockly$utils$global.globalThis.Blockly!==$.Blockly){var descriptors=Object.getOwnPropertyDescriptors($.Blockly),accessors={},key;for(key in descriptors)if(descriptors[key].get||descriptors[key].set)accessors[key]=descriptors[key];Object.defineProperties($.module$exports$Blockly$utils$global.globalThis.Blockly,accessors)};
|
|
1978
|
-
$.Blockly.
|
|
2010
|
+
$.Blockly.__namespace__=$;
|
|
1979
2011
|
return $.Blockly;
|
|
1980
2012
|
}));
|
|
1981
2013
|
|