// Do not edit this file; automatically generated. /* eslint-disable */ ;(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD define([], factory); } else if (typeof exports === 'object') { // Node.js module.exports = factory(); } else { // Browser var factoryExports = factory(); root.Blockly = factoryExports; } }(this, function() { var $={}; /* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ $.$jscomp=$.$jscomp||{};$.$jscomp.scope={};$.$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$.$jscomp.createTemplateTagFirstArgWithRaw=function(a,b){a.raw=b;return a};$.$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b>>0,$.$jscomp.propertyToPolyfillSymbol[e]= $.$jscomp.IS_SYMBOL_NATIVE?$.$jscomp.global.Symbol(e):$.$jscomp.POLYFILL_PREFIX+c+"$"+e),$.$jscomp.defineProperty(d,$.$jscomp.propertyToPolyfillSymbol[e],{configurable:!0,writable:!0,value:b})))};$.$jscomp.assign=$.$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c=f}},"es6","es3");$.$jscomp.initSymbol=function(){}; $.$jscomp.polyfill("Symbol",function(a){if(a)return a;var b=function(f,g){this.$jscomp$symbol$id_=f;$.$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:g})};b.prototype.toString=function(){return this.$jscomp$symbol$id_};var c="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",d=0,e=function(f){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new b(c+(f||"")+"_"+d++,f)};return e},"es6","es3"); $.$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;cc&&(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>>/g,a),module$exports$Blockly$Css.content="",a=document.createElement("style"),a.id="blockly-common-style",b=document.createTextNode(b),a.appendChild(b),document.head.insertBefore(a,document.head.firstChild)))};module$exports$Blockly$Css.content='\n.blocklySvg {\n background-color: #fff;\n outline: none;\n overflow: hidden; /* IE overflows by default. */\n position: absolute;\n display: block;\n}\n\n.blocklyWidgetDiv {\n display: none;\n position: absolute;\n z-index: 99999; /* big value for bootstrap3 compatibility */\n}\n\n.injectionDiv {\n height: 100%;\n position: relative;\n overflow: hidden; /* So blocks in drag surface disappear at edges */\n touch-action: none;\n}\n\n.blocklyNonSelectable {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n}\n\n.blocklyWsDragSurface {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n}\n\n/* Added as a separate rule with multiple classes to make it more specific\n than a bootstrap rule that selects svg:root. See issue #1275 for context.\n*/\n.blocklyWsDragSurface.blocklyOverflowVisible {\n overflow: visible;\n}\n\n.blocklyBlockDragSurface {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: visible !important;\n z-index: 50; /* Display below toolbox, but above everything else. */\n}\n\n.blocklyBlockCanvas.blocklyCanvasTransitioning,\n.blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: transform .5s;\n}\n\n.blocklyTooltipDiv {\n background-color: #ffffc7;\n border: 1px solid #ddc;\n box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);\n color: #000;\n display: none;\n font: 9pt sans-serif;\n opacity: .9;\n padding: 2px;\n position: absolute;\n z-index: 100000; /* big value for bootstrap3 compatibility */\n}\n\n.blocklyDropDownDiv {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1000;\n display: none;\n border: 1px solid;\n border-color: #dadce0;\n background-color: #fff;\n border-radius: 2px;\n padding: 4px;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv.blocklyFocused {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownContent {\n max-height: 300px; // @todo: spec for maximum height.\n overflow: auto;\n overflow-x: hidden;\n position: relative;\n}\n\n.blocklyDropDownArrow {\n position: absolute;\n left: 0;\n top: 0;\n width: 16px;\n height: 16px;\n z-index: -1;\n background-color: inherit;\n border-color: inherit;\n}\n\n.blocklyDropDownButton {\n display: inline-block;\n float: left;\n padding: 0;\n margin: 4px;\n border-radius: 4px;\n outline: none;\n border: 1px solid;\n transition: box-shadow .1s;\n cursor: pointer;\n}\n\n.blocklyArrowTop {\n border-top: 1px solid;\n border-left: 1px solid;\n border-top-left-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyArrowBottom {\n border-bottom: 1px solid;\n border-right: 1px solid;\n border-bottom-right-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyResizeSE {\n cursor: se-resize;\n fill: #aaa;\n}\n\n.blocklyResizeSW {\n cursor: sw-resize;\n fill: #aaa;\n}\n\n.blocklyResizeLine {\n stroke: #515A5A;\n stroke-width: 1;\n}\n\n.blocklyHighlightedConnectionPath {\n fill: none;\n stroke: #fc3;\n stroke-width: 4px;\n}\n\n.blocklyPathLight {\n fill: none;\n stroke-linecap: round;\n stroke-width: 1;\n}\n\n.blocklySelected>.blocklyPathLight {\n display: none;\n}\n\n.blocklyDraggable {\n /* backup for browsers (e.g. IE11) that don\'t support grab */\n cursor: url("<<>>/handopen.cur"), auto;\n cursor: grab;\n cursor: -webkit-grab;\n}\n\n /* backup for browsers (e.g. IE11) that don\'t support grabbing */\n.blocklyDragging {\n /* backup for browsers (e.g. IE11) that don\'t support grabbing */\n cursor: url("<<>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n /* Changes cursor on mouse down. Not effective in Firefox because of\n https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */\n.blocklyDraggable:active {\n /* backup for browsers (e.g. IE11) that don\'t support grabbing */\n cursor: url("<<>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Change the cursor on the whole drag surface in case the mouse gets\n ahead of block during a drag. This way the cursor is still a closed hand.\n */\n.blocklyBlockDragSurface .blocklyDraggable {\n /* backup for browsers (e.g. IE11) that don\'t support grabbing */\n cursor: url("<<>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n.blocklyDragging.blocklyDraggingDelete {\n cursor: url("<<>>/handdelete.cur"), auto;\n}\n\n.blocklyDragging>.blocklyPath,\n.blocklyDragging>.blocklyPathLight {\n fill-opacity: .8;\n stroke-opacity: .8;\n}\n\n.blocklyDragging>.blocklyPathDark {\n display: none;\n}\n\n.blocklyDisabled>.blocklyPath {\n fill-opacity: .5;\n stroke-opacity: .5;\n}\n\n.blocklyDisabled>.blocklyPathLight,\n.blocklyDisabled>.blocklyPathDark {\n display: none;\n}\n\n.blocklyInsertionMarker>.blocklyPath,\n.blocklyInsertionMarker>.blocklyPathLight,\n.blocklyInsertionMarker>.blocklyPathDark {\n fill-opacity: .2;\n stroke: none;\n}\n\n.blocklyMultilineText {\n font-family: monospace;\n}\n\n.blocklyNonEditableText>text {\n pointer-events: none;\n}\n\n.blocklyFlyout {\n position: absolute;\n z-index: 20;\n}\n\n.blocklyText text {\n cursor: default;\n}\n\n/*\n Don\'t allow users to select text. It gets annoying when trying to\n drag a block and selected text moves instead.\n*/\n.blocklySvg text,\n.blocklyBlockDragSurface text {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n cursor: inherit;\n}\n\n.blocklyHidden {\n display: none;\n}\n\n.blocklyFieldDropdown:not(.blocklyHidden) {\n display: block;\n}\n\n.blocklyIconGroup {\n cursor: default;\n}\n\n.blocklyIconGroup:not(:hover),\n.blocklyIconGroupReadonly {\n opacity: .6;\n}\n\n.blocklyIconShape {\n fill: #00f;\n stroke: #fff;\n stroke-width: 1px;\n}\n\n.blocklyIconSymbol {\n fill: #fff;\n}\n\n.blocklyMinimalBody {\n margin: 0;\n padding: 0;\n}\n\n.blocklyHtmlInput {\n border: none;\n border-radius: 4px;\n height: 100%;\n margin: 0;\n outline: none;\n padding: 0;\n width: 100%;\n text-align: center;\n display: block;\n box-sizing: border-box;\n}\n\n/* Edge and IE introduce a close icon when the input value is longer than a\n certain length. This affects our sizing calculations of the text input.\n Hiding the close icon to avoid that. */\n.blocklyHtmlInput::-ms-clear {\n display: none;\n}\n\n.blocklyMainBackground {\n stroke-width: 1;\n stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */\n}\n\n.blocklyMutatorBackground {\n fill: #fff;\n stroke: #ddd;\n stroke-width: 1;\n}\n\n.blocklyFlyoutBackground {\n fill: #ddd;\n fill-opacity: .8;\n}\n\n.blocklyMainWorkspaceScrollbar {\n z-index: 20;\n}\n\n.blocklyFlyoutScrollbar {\n z-index: 30;\n}\n\n.blocklyScrollbarHorizontal,\n.blocklyScrollbarVertical {\n position: absolute;\n outline: none;\n}\n\n.blocklyScrollbarBackground {\n opacity: 0;\n}\n\n.blocklyScrollbarHandle {\n fill: #ccc;\n}\n\n.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyScrollbarHandle:hover {\n fill: #bbb;\n}\n\n/* Darken flyout scrollbars due to being on a grey background. */\n/* By contrast, workspace scrollbars are on a white background. */\n.blocklyFlyout .blocklyScrollbarHandle {\n fill: #bbb;\n}\n\n.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyFlyout .blocklyScrollbarHandle:hover {\n fill: #aaa;\n}\n\n.blocklyInvalidInput {\n background: #faa;\n}\n\n.blocklyVerticalMarker {\n stroke-width: 3px;\n fill: rgba(255,255,255,.5);\n pointer-events: none;\n}\n\n.blocklyComputeCanvas {\n position: absolute;\n width: 0;\n height: 0;\n}\n\n.blocklyNoPointerEvents {\n pointer-events: none;\n}\n\n.blocklyContextMenu {\n border-radius: 4px;\n max-height: 100%;\n}\n\n.blocklyDropdownMenu {\n border-radius: 2px;\n padding: 0 !important;\n}\n\n.blocklyDropdownMenu .blocklyMenuItem {\n /* 28px on the left for icon or checkbox. */\n padding-left: 28px;\n}\n\n/* BiDi override for the resting state. */\n.blocklyDropdownMenu .blocklyMenuItemRtl {\n /* Flip left/right padding for BiDi. */\n padding-left: 5px;\n padding-right: 28px;\n}\n\n.blocklyWidgetDiv .blocklyMenu {\n background: #fff;\n border: 1px solid transparent;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n font: normal 13px Arial, sans-serif;\n margin: 0;\n outline: none;\n padding: 4px 0;\n position: absolute;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n.blocklyWidgetDiv .blocklyMenu.blocklyFocused {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv .blocklyMenu {\n background: inherit; /* Compatibility with gapi, reset from goog-menu */\n border: inherit; /* Compatibility with gapi, reset from goog-menu */\n font: normal 13px "Helvetica Neue", Helvetica, sans-serif;\n outline: none;\n position: relative; /* Compatibility with gapi, reset from goog-menu */\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n/* State: resting. */\n.blocklyMenuItem {\n border: none;\n color: #000;\n cursor: pointer;\n list-style: none;\n margin: 0;\n /* 7em on the right for shortcut. */\n min-width: 7em;\n padding: 6px 15px;\n white-space: nowrap;\n}\n\n/* State: disabled. */\n.blocklyMenuItemDisabled {\n color: #ccc;\n cursor: inherit;\n}\n\n/* State: hover. */\n.blocklyMenuItemHighlight {\n background-color: rgba(0,0,0,.1);\n}\n\n/* State: selected/checked. */\n.blocklyMenuItemCheckbox {\n height: 16px;\n position: absolute;\n width: 16px;\n}\n\n.blocklyMenuItemSelected .blocklyMenuItemCheckbox {\n background: url(<<>>/sprites.png) no-repeat -48px -16px;\n float: left;\n margin-left: -24px;\n position: static; /* Scroll with the menu. */\n}\n\n.blocklyMenuItemRtl .blocklyMenuItemCheckbox {\n float: right;\n margin-right: -24px;\n}\n';var module$contents$Blockly$utils$string_wrapLine,module$contents$Blockly$utils$string_wrapScore,module$contents$Blockly$utils$string_wrapMutate,module$contents$Blockly$utils$string_wrapToText; $.module$exports$Blockly$utils$string={startsWith:function(a,b){return 0===a.lastIndexOf(b,0)},shortestStringLength:function(a){return a.length?a.reduce(function(b,c){return b.lengthb&&(b=c[d].length);var e=-Infinity,f=1;do{d=e;var g=a;a=[];e=c.length/f;for(var h=1,k=0;kd);return g}; module$contents$Blockly$utils$string_wrapScore=function(a,b,c){for(var d=[0],e=[],f=0;fd&&(d=h,e=g)}return e?module$contents$Blockly$utils$string_wrapMutate(a,e,c):b};module$contents$Blockly$utils$string_wrapToText=function(a,b){for(var c=[],d=0;dmodule$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, 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)}; 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}; 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); a=(0,$.module$exports$Blockly$utils$string.wrap)(a,module$exports$Blockly$Tooltip.LIMIT);a=a.split("\n");for(var b=0;bc+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- 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= "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; 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}; module$exports$Blockly$utils$dom.removeClasses=function(a,b){b=b.split(" ");for(var c=0;ce?module$contents$Blockly$WidgetDiv_positionInternal(a,0,c.height+e):module$contents$Blockly$WidgetDiv_positionInternal(a,e,c.height)}; var module$contents$Blockly$WidgetDiv_calculateX=function(a,b,c,d){return d?Math.min(Math.max(b.right-c.width,a.left),a.right-c.width):Math.max(Math.min(b.left,a.right-c.width),a.left)},module$contents$Blockly$WidgetDiv_calculateY=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};var module$exports$Blockly$utils$aria={},module$contents$Blockly$utils$aria_ARIA_PREFIX="aria-",module$contents$Blockly$utils$aria_ROLE_ATTRIBUTE="role";module$exports$Blockly$utils$aria.Role={GRID:"grid",GRIDCELL:"gridcell",GROUP:"group",LISTBOX:"listbox",MENU:"menu",MENUITEM:"menuitem",MENUITEMCHECKBOX:"menuitemcheckbox",OPTION:"option",PRESENTATION:"presentation",ROW:"row",TREE:"tree",TREEITEM:"treeitem"}; module$exports$Blockly$utils$aria.State={ACTIVEDESCENDANT:"activedescendant",COLCOUNT:"colcount",DISABLED:"disabled",EXPANDED:"expanded",INVALID:"invalid",LABEL:"label",LABELLEDBY:"labelledby",LEVEL:"level",ORIENTATION:"orientation",POSINSET:"posinset",ROWCOUNT:"rowcount",SELECTED:"selected",SETSIZE:"setsize",VALUEMAX:"valuemax",VALUEMIN:"valuemin"};module$exports$Blockly$utils$aria.setRole=function(a,b){a.setAttribute(module$contents$Blockly$utils$aria_ROLE_ATTRIBUTE,b)}; module$exports$Blockly$utils$aria.setState=function(a,b,c){Array.isArray(c)&&(c=c.join(" "));a.setAttribute(module$contents$Blockly$utils$aria_ARIA_PREFIX+b,c)};var module$exports$Blockly$utils$idGenerator={TEST_ONLY:{}},module$contents$Blockly$utils$idGenerator_nextId=0;module$exports$Blockly$utils$idGenerator.getNextUniqueId=function(){return"blockly-"+(module$contents$Blockly$utils$idGenerator_nextId++).toString(36)};var module$contents$Blockly$utils$idGenerator_soup="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; module$exports$Blockly$utils$idGenerator.TEST_ONLY.genUid=function(){for(var a=module$contents$Blockly$utils$idGenerator_soup.length,b=[],c=0;20>c;c++)b[c]=module$contents$Blockly$utils$idGenerator_soup.charAt(Math.random()*a);return b.join("")};module$exports$Blockly$utils$idGenerator.genUid=function(){return module$exports$Blockly$utils$idGenerator.TEST_ONLY.genUid()};var module$exports$Blockly$registry={},module$contents$Blockly$registry_typeMap=Object.create(null);module$exports$Blockly$registry.TEST_ONLY={typeMap:module$contents$Blockly$registry_typeMap};var module$contents$Blockly$registry_nameMap=Object.create(null);module$exports$Blockly$registry.DEFAULT="default";module$exports$Blockly$registry.Type=function(a){this.name_=a};module$exports$Blockly$registry.Type.prototype.toString=function(){return this.name_}; module$exports$Blockly$registry.Type.CONNECTION_CHECKER=new module$exports$Blockly$registry.Type("connectionChecker");module$exports$Blockly$registry.Type.CURSOR=new module$exports$Blockly$registry.Type("cursor");module$exports$Blockly$registry.Type.EVENT=new module$exports$Blockly$registry.Type("event");module$exports$Blockly$registry.Type.FIELD=new module$exports$Blockly$registry.Type("field");module$exports$Blockly$registry.Type.RENDERER=new module$exports$Blockly$registry.Type("renderer"); module$exports$Blockly$registry.Type.TOOLBOX=new module$exports$Blockly$registry.Type("toolbox");module$exports$Blockly$registry.Type.THEME=new module$exports$Blockly$registry.Type("theme");module$exports$Blockly$registry.Type.TOOLBOX_ITEM=new module$exports$Blockly$registry.Type("toolboxItem");module$exports$Blockly$registry.Type.FLYOUTS_VERTICAL_TOOLBOX=new module$exports$Blockly$registry.Type("flyoutsVerticalToolbox");module$exports$Blockly$registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX=new module$exports$Blockly$registry.Type("flyoutsHorizontalToolbox"); module$exports$Blockly$registry.Type.METRICS_MANAGER=new module$exports$Blockly$registry.Type("metricsManager");module$exports$Blockly$registry.Type.BLOCK_DRAGGER=new module$exports$Blockly$registry.Type("blockDragger");module$exports$Blockly$registry.Type.SERIALIZER=new module$exports$Blockly$registry.Type("serializer"); module$exports$Blockly$registry.register=function(a,b,c,d){if(!(a instanceof module$exports$Blockly$registry.Type)&&"string"!==typeof a||""===String(a).trim())throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=String(a).toLowerCase();if("string"!==typeof b||""===b.trim())throw Error('Invalid name "'+b+'". The name must be a non-empty string.');var e=b.toLowerCase();if(!c)throw Error("Can not register a null value");var f=module$contents$Blockly$registry_typeMap[a], g=module$contents$Blockly$registry_nameMap[a];f||(f=module$contents$Blockly$registry_typeMap[a]=Object.create(null),g=module$contents$Blockly$registry_nameMap[a]=Object.create(null));module$contents$Blockly$registry_validate(a,c);if(!d&&f[e])throw Error('Name "'+e+'" with type "'+a+'" already registered.');f[e]=c;g[e]=b}; var module$contents$Blockly$registry_validate=function(a,b){switch(a){case String(module$exports$Blockly$registry.Type.FIELD):if("function"!==typeof b.fromJson)throw Error('Type "'+a+'" must have a fromJson function');}}; module$exports$Blockly$registry.unregister=function(a,b){a=String(a).toLowerCase();b=b.toLowerCase();var c=module$contents$Blockly$registry_typeMap[a];c&&c[b]?(delete module$contents$Blockly$registry_typeMap[a][b],delete module$contents$Blockly$registry_nameMap[a][b]):console.warn("Unable to unregister ["+b+"]["+a+"] from the registry.")}; var module$contents$Blockly$registry_getItem=function(a,b,c){a=String(a).toLowerCase();b=b.toLowerCase();var d=module$contents$Blockly$registry_typeMap[a];if(!d||!d[b]){b="Unable to find ["+b+"]["+a+"] in the registry.";if(c)throw Error(b+" You must require or register a "+a+" plugin.");console.warn(b);return null}return d[b]};module$exports$Blockly$registry.hasItem=function(a,b){a=String(a).toLowerCase();b=b.toLowerCase();return(a=module$contents$Blockly$registry_typeMap[a])?!!a[b]:!1}; module$exports$Blockly$registry.getClass=function(a,b,c){return module$contents$Blockly$registry_getItem(a,b,c)};module$exports$Blockly$registry.getObject=function(a,b,c){return module$contents$Blockly$registry_getItem(a,b,c)}; module$exports$Blockly$registry.getAllItems=function(a,b,c){a=String(a).toLowerCase();var d=module$contents$Blockly$registry_typeMap[a];if(!d){d="Unable to find ["+a+"] in the registry.";if(c)throw Error(d+" You must require or register a "+a+" plugin.");console.warn(d);return null}if(!b)return d;a=module$contents$Blockly$registry_nameMap[a];c=Object.create(null);b=Object.keys(d);for(var e=0;eb.oldScale&&(0,module$exports$Blockly$bumpObjects.bumpTopObjectsIntoBounds)(a)}}},module$contents$Blockly$bumpObjects_extractObjectFromEvent=function(a,b){var c=null;switch(b.type){case module$exports$Blockly$Events$utils.CREATE:case module$exports$Blockly$Events$utils.MOVE:(c=a.getBlockById(b.blockId))&&(c=c.getRootBlock());break;case module$exports$Blockly$Events$utils.COMMENT_CREATE:case module$exports$Blockly$Events$utils.COMMENT_MOVE:c= a.getCommentById(b.commentId)}return c};module$exports$Blockly$bumpObjects.bumpTopObjectsIntoBounds=function(a){var b=a.getMetricsManager();if(b.hasFixedEdges()&&!a.isDragging()){b=b.getScrollMetrics(!0);for(var c=a.getTopBoundedElements(),d=0,e;e=c[d];d++)(0,module$exports$Blockly$bumpObjects.bumpIntoBounds)(a,b,e)}};var module$exports$Blockly$utils$Coordinate={Coordinate:function(a,b){this.x=a;this.y=b}};module$exports$Blockly$utils$Coordinate.Coordinate.prototype.clone=function(){return new module$exports$Blockly$utils$Coordinate.Coordinate(this.x,this.y)};module$exports$Blockly$utils$Coordinate.Coordinate.prototype.scale=function(a){this.x*=a;this.y*=a;return this};module$exports$Blockly$utils$Coordinate.Coordinate.prototype.translate=function(a,b){this.x+=a;this.y+=b;return this}; module$exports$Blockly$utils$Coordinate.Coordinate.equals=function(a,b){return a===b?!0:a&&b?a.x===b.x&&a.y===b.y:!1};module$exports$Blockly$utils$Coordinate.Coordinate.distance=function(a,b){var c=a.x-b.x;a=a.y-b.y;return Math.sqrt(c*c+a*a)};module$exports$Blockly$utils$Coordinate.Coordinate.magnitude=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)}; module$exports$Blockly$utils$Coordinate.Coordinate.difference=function(a,b){return new module$exports$Blockly$utils$Coordinate.Coordinate(a.x-b.x,a.y-b.y)};module$exports$Blockly$utils$Coordinate.Coordinate.sum=function(a,b){return new module$exports$Blockly$utils$Coordinate.Coordinate(a.x+b.x,a.y+b.y)};var module$exports$Blockly$utils$Size={Size:function(a,b){this.width=a;this.height=b}};module$exports$Blockly$utils$Size.Size.equals=function(a,b){return a===b?!0:a&&b?a.width===b.width&&a.height===b.height:!1};var module$exports$Blockly$utils$style={getSize:function(a){if("none"!==module$contents$Blockly$utils$style_getStyle(a,"display"))return module$contents$Blockly$utils$style_getSizeWithDisplay(a);var b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";var f=a.offsetWidth;a=a.offsetHeight;b.display=c;b.position=e;b.visibility=d;return new module$exports$Blockly$utils$Size.Size(f,a)}},module$contents$Blockly$utils$style_getSizeWithDisplay= function(a){return new module$exports$Blockly$utils$Size.Size(a.offsetWidth,a.offsetHeight)},module$contents$Blockly$utils$style_getStyle=function(a,b){return(0,module$exports$Blockly$utils$style.getComputedStyle)(a,b)||(0,module$exports$Blockly$utils$style.getCascadedStyle)(a,b)||a.style&&a.style[b]}; module$exports$Blockly$utils$style.getComputedStyle=function(a,b){return document.defaultView&&document.defaultView.getComputedStyle&&(a=document.defaultView.getComputedStyle(a,null))?a[b]||a.getPropertyValue(b)||"":""};module$exports$Blockly$utils$style.getCascadedStyle=function(a,b){return a.currentStyle?a.currentStyle[b]:null}; module$exports$Blockly$utils$style.getPageOffset=function(a){var b=new module$exports$Blockly$utils$Coordinate.Coordinate(0,0);a=a.getBoundingClientRect();var c=document.documentElement;c=new module$exports$Blockly$utils$Coordinate.Coordinate(window.pageXOffset||c.scrollLeft,window.pageYOffset||c.scrollTop);b.x=a.left+c.x;b.y=a.top+c.y;return b}; module$exports$Blockly$utils$style.getViewportPageOffset=function(){var a=document.body,b=document.documentElement;return new module$exports$Blockly$utils$Coordinate.Coordinate(a.scrollLeft||b.scrollLeft,a.scrollTop||b.scrollTop)};module$exports$Blockly$utils$style.setElementShown=function(a,b){a.style.display=b?"":"none"};module$exports$Blockly$utils$style.isRightToLeft=function(a){return"rtl"===module$contents$Blockly$utils$style_getStyle(a,"direction")}; 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)}}; 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}; 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- 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.righta.bottom||this.bottome.top?module$contents$Blockly$dropDownDiv_getPositionAboveMetrics(c,d,e,f):b+f.heightdocument.documentElement.clientTop?module$contents$Blockly$dropDownDiv_getPositionAboveMetrics(c,d,e,f):module$contents$Blockly$dropDownDiv_getPositionTopOfPageMetrics(a,e,f)}; 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, 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, 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}; 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}; 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= null)}; 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", 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, 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())}; 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= "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}; 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)?/; 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/g,"<$1$2>")};$.module$exports$Blockly$Xml.domToPrettyText=function(a){a=(0,$.module$exports$Blockly$Xml.domToText)(a).split("<");for(var b="",c=1;c"!==d.slice(-2)&&(b+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; $.module$exports$Blockly$Xml.textToDom=function(a){var b=(0,$.module$exports$Blockly$utils$xml.textToDomDocument)(a);if(!b||!b.documentElement||b.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return b.documentElement};$.module$exports$Blockly$Xml.clearWorkspaceAndLoadFromXml=function(a,b){b.setResizesEnabled(!1);b.clear();a=(0,$.module$exports$Blockly$Xml.domToWorkspace)(a,b);b.setResizesEnabled(!0);return a}; $.module$exports$Blockly$Xml.domToWorkspace=function(a,b){if(a instanceof module$exports$Blockly$Workspace.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to domToWorkspace, swap the arguments.")}var d;b.RTL&&(d=b.getWidth());c=[];(0,module$exports$Blockly$utils$dom.startTextWidthCache)();var e=(0,module$exports$Blockly$Events$utils.getGroup)();e||(0,module$exports$Blockly$Events$utils.setGroup)(!0);b.setResizesEnabled&&b.setResizesEnabled(!1);var f=!0;try{for(var g=0,h=void 0;h=a.childNodes[g];g++){var k= 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; 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."); 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}; $.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;hf&&(f=k.x)}d=d-g+10;c=b.RTL?c-f:c-e;for(e=0;e document.");}else a=null;return a};$.module$exports$Blockly$utils$object={inherits:function(a,b){a.superClass_=b.prototype;Object.setPrototypeOf(a,b);a.prototype=Object.create(b.prototype);a.prototype.constructor=a},mixin:function(a,b){for(var c in b)a[c]=b[c]},deepMerge:function(a,b){for(var c in b)a[c]=null!==b[c]&&"object"===typeof b[c]?(0,$.module$exports$Blockly$utils$object.deepMerge)(a[c]||Object.create(null),b[c]):b[c];return a},values:function(a){return Object.values?Object.values(a):Object.keys(a).map(function(b){return a[b]})}};var module$exports$Blockly$Theme={Theme:function(a,b,c,d){this.name=a;this.blockStyles=b||Object.create(null);this.categoryStyles=c||Object.create(null);this.componentStyles=d||Object.create(null);this.fontStyle=Object.create(null);this.startHats=null;(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.THEME,a,this)}};module$exports$Blockly$Theme.Theme.prototype.getClassName=function(){return this.name+"-theme"}; module$exports$Blockly$Theme.Theme.prototype.setBlockStyle=function(a,b){this.blockStyles[a]=b};module$exports$Blockly$Theme.Theme.prototype.setCategoryStyle=function(a,b){this.categoryStyles[a]=b};module$exports$Blockly$Theme.Theme.prototype.getComponentStyle=function(a){return(a=this.componentStyles[a])&&"string"===typeof a&&this.getComponentStyle(a)?this.getComponentStyle(a):a?String(a):null};module$exports$Blockly$Theme.Theme.prototype.setComponentStyle=function(a,b){this.componentStyles[a]=b}; module$exports$Blockly$Theme.Theme.prototype.setFontStyle=function(a){this.fontStyle=a};module$exports$Blockly$Theme.Theme.prototype.setStartHats=function(a){this.startHats=a}; module$exports$Blockly$Theme.Theme.defineTheme=function(a,b){var c=new module$exports$Blockly$Theme.Theme(a),d=b.base;d&&("string"===typeof d&&(d=(0,module$exports$Blockly$registry.getObject)(module$exports$Blockly$registry.Type.THEME,d)),d instanceof module$exports$Blockly$Theme.Theme&&((0,$.module$exports$Blockly$utils$object.deepMerge)(c,d),c.name=a));(0,$.module$exports$Blockly$utils$object.deepMerge)(c.blockStyles,b.blockStyles);(0,$.module$exports$Blockly$utils$object.deepMerge)(c.categoryStyles, b.categoryStyles);(0,$.module$exports$Blockly$utils$object.deepMerge)(c.componentStyles,b.componentStyles);(0,$.module$exports$Blockly$utils$object.deepMerge)(c.fontStyle,b.fontStyle);null!==b.startHats&&(c.startHats=b.startHats);return c};var module$exports$Blockly$Themes$Classic={},module$contents$Blockly$Themes$Classic_defaultBlockStyles={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},module$contents$Blockly$Themes$Classic_categoryStyles= {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=== 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; 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); 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}}; 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!== c.wheel?!!c.wheel:"object"===typeof d.scrollbars;d.drag=d.scrollbars?void 0===c.drag?!0:!!c.drag:!1;return d}; 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}; module$exports$Blockly$Options.Options.parseGridOptions_=function(a){a=a.grid||{};var b={};b.spacing=Number(a.spacing)||0;b.colour=a.colour||"#888";b.length=void 0===a.length?1:Number(a.length);b.snap=0=a||isNaN(a)?0:Math.min(a,this.scrollbarLength_)};module$exports$Blockly$Scrollbar.Scrollbar.prototype.setHandleLength_=function(a){this.handleLength_=a;this.svgHandle_.setAttribute(this.lengthAttribute_,this.handleLength_)}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.constrainHandlePosition_=function(a){return a=0>=a||isNaN(a)?0:Math.min(a,this.scrollbarLength_-this.handleLength_)};module$exports$Blockly$Scrollbar.Scrollbar.prototype.setHandlePosition=function(a){this.handlePosition_=a;this.svgHandle_.setAttribute(this.positionAttribute_,this.handlePosition_)}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.setScrollbarLength_=function(a){this.scrollbarLength_=a;this.outerSvg_.setAttribute(this.lengthAttribute_,this.scrollbarLength_);this.svgBackground_.setAttribute(this.lengthAttribute_,this.scrollbarLength_)}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.setPosition=function(a,b){this.position.x=a;this.position.y=b;(0,module$exports$Blockly$utils$dom.setCssTransform)(this.outerSvg_,"translate("+(this.position.x+this.origin_.x)+"px,"+(this.position.y+this.origin_.y)+"px)")}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.resize=function(a){if(!a&&(a=this.workspace_.getMetrics(),!a))return;this.oldHostMetrics_&&module$exports$Blockly$Scrollbar.Scrollbar.metricsAreEquivalent_(a,this.oldHostMetrics_)||(this.horizontal_?this.resizeHorizontal_(a):this.resizeVertical_(a),this.oldHostMetrics_=a,this.updateMetrics_())}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.requiresViewResize_=function(a){return this.oldHostMetrics_?this.oldHostMetrics_.viewWidth!==a.viewWidth||this.oldHostMetrics_.viewHeight!==a.viewHeight||this.oldHostMetrics_.absoluteLeft!==a.absoluteLeft||this.oldHostMetrics_.absoluteTop!==a.absoluteTop:!0};module$exports$Blockly$Scrollbar.Scrollbar.prototype.resizeHorizontal_=function(a){this.requiresViewResize_(a)?this.resizeViewHorizontal(a):this.resizeContentHorizontal(a)}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.resizeViewHorizontal=function(a){var b=a.viewWidth-2*this.margin_;this.pair_&&(b-=module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness);this.setScrollbarLength_(Math.max(0,b));b=a.absoluteLeft+this.margin_;this.pair_&&this.workspace_.RTL&&(b+=module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness);this.setPosition(b,a.absoluteTop+a.viewHeight-module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness-this.margin_);this.resizeContentHorizontal(a)}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.resizeContentHorizontal=function(a){if(a.viewWidth>=a.scrollWidth)this.setHandleLength_(this.scrollbarLength_),this.setHandlePosition(0),this.pair_||this.setVisible(!1);else{this.pair_||this.setVisible(!0);var b=this.scrollbarLength_*a.viewWidth/a.scrollWidth;b=this.constrainHandleLength_(b);this.setHandleLength_(b);b=a.scrollWidth-a.viewWidth;var c=this.scrollbarLength_-this.handleLength_;a=(a.viewLeft-a.scrollLeft)/b*c;a=this.constrainHandlePosition_(a); this.setHandlePosition(a);this.ratio=c/b}};module$exports$Blockly$Scrollbar.Scrollbar.prototype.resizeVertical_=function(a){this.requiresViewResize_(a)?this.resizeViewVertical(a):this.resizeContentVertical(a)}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.resizeViewVertical=function(a){var b=a.viewHeight-2*this.margin_;this.pair_&&(b-=module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness);this.setScrollbarLength_(Math.max(0,b));this.setPosition(this.workspace_.RTL?a.absoluteLeft+this.margin_:a.absoluteLeft+a.viewWidth-module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness-this.margin_,a.absoluteTop+this.margin_);this.resizeContentVertical(a)}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.resizeContentVertical=function(a){if(a.viewHeight>=a.scrollHeight)this.setHandleLength_(this.scrollbarLength_),this.setHandlePosition(0),this.pair_||this.setVisible(!1);else{this.pair_||this.setVisible(!0);var b=this.scrollbarLength_*a.viewHeight/a.scrollHeight;b=this.constrainHandleLength_(b);this.setHandleLength_(b);b=a.scrollHeight-a.viewHeight;var c=this.scrollbarLength_-this.handleLength_;a=(a.viewTop-a.scrollTop)/b*c;a=this.constrainHandlePosition_(a); this.setHandlePosition(a);this.ratio=c/b}}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.createDom_=function(a){var b="blocklyScrollbar"+(this.horizontal_?"Horizontal":"Vertical");a&&(b+=" "+a);this.outerSvg_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.SVG,{"class":b},null);this.svgGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{},this.outerSvg_);this.svgBackground_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyScrollbarBackground"}, this.svgGroup_);a=Math.floor((module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness-5)/2);this.svgHandle_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyScrollbarHandle",rx:a,ry:a},this.svgGroup_);this.workspace_.getThemeManager().subscribe(this.svgHandle_,"scrollbarColour","fill");this.workspace_.getThemeManager().subscribe(this.svgHandle_,"scrollbarOpacity","fill-opacity");(0,module$exports$Blockly$utils$dom.insertAfter)(this.outerSvg_, this.workspace_.getParentSvg())};module$exports$Blockly$Scrollbar.Scrollbar.prototype.isVisible=function(){return this.isVisible_};module$exports$Blockly$Scrollbar.Scrollbar.prototype.setContainerVisible=function(a){var b=a!==this.containerVisible_;this.containerVisible_=a;b&&this.updateDisplay_()}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.setVisible=function(a){var b=a!==this.isVisible();if(this.pair_)throw Error("Unable to toggle visibility of paired scrollbars.");this.isVisible_=a;b&&this.updateDisplay_()};module$exports$Blockly$Scrollbar.Scrollbar.prototype.updateDisplay_=function(){this.containerVisible_&&this.isVisible()?this.outerSvg_.setAttribute("display","block"):this.outerSvg_.setAttribute("display","none")}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.onMouseDownBar_=function(a){this.workspace_.markFocused();(0,module$exports$Blockly$Touch.clearTouchIdentifier)();this.cleanUp_();if((0,module$exports$Blockly$browserEvents.isRightButton)(a))a.stopPropagation();else{var b=(0,module$exports$Blockly$browserEvents.mouseToSvg)(a,this.workspace_.getParentSvg(),this.workspace_.getInverseScreenCTM());b=this.horizontal_?b.x:b.y;var c=(0,module$exports$Blockly$utils$svgMath.getInjectionDivXY)(this.svgHandle_); c=this.horizontal_?c.x:c.y;var d=this.handlePosition_,e=.95*this.handleLength_;b<=c?d-=e:b>=c+this.handleLength_&&(d+=e);this.setHandlePosition(this.constrainHandlePosition_(d));this.updateMetrics_();a.stopPropagation();a.preventDefault()}}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.onMouseDownHandle_=function(a){this.workspace_.markFocused();this.cleanUp_();(0,module$exports$Blockly$browserEvents.isRightButton)(a)?a.stopPropagation():(this.startDragHandle=this.handlePosition_,this.workspace_.setupDragSurface(),this.startDragMouse_=this.horizontal_?a.clientX:a.clientY,module$exports$Blockly$Scrollbar.Scrollbar.onMouseUpWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(document,"mouseup",this,this.onMouseUpHandle_), module$exports$Blockly$Scrollbar.Scrollbar.onMouseMoveWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(document,"mousemove",this,this.onMouseMoveHandle_),a.stopPropagation(),a.preventDefault())};module$exports$Blockly$Scrollbar.Scrollbar.prototype.onMouseMoveHandle_=function(a){this.setHandlePosition(this.constrainHandlePosition_(this.startDragHandle+((this.horizontal_?a.clientX:a.clientY)-this.startDragMouse_)));this.updateMetrics_()}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.onMouseUpHandle_=function(){this.workspace_.resetDragSurface();(0,module$exports$Blockly$Touch.clearTouchIdentifier)();this.cleanUp_()}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.cleanUp_=function(){this.workspace_.hideChaff(!0);module$exports$Blockly$Scrollbar.Scrollbar.onMouseUpWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(module$exports$Blockly$Scrollbar.Scrollbar.onMouseUpWrapper_),module$exports$Blockly$Scrollbar.Scrollbar.onMouseUpWrapper_=null);module$exports$Blockly$Scrollbar.Scrollbar.onMouseMoveWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(module$exports$Blockly$Scrollbar.Scrollbar.onMouseMoveWrapper_), module$exports$Blockly$Scrollbar.Scrollbar.onMouseMoveWrapper_=null)};module$exports$Blockly$Scrollbar.Scrollbar.prototype.getRatio_=function(){var a=this.handlePosition_/(this.scrollbarLength_-this.handleLength_);isNaN(a)&&(a=0);return a};module$exports$Blockly$Scrollbar.Scrollbar.prototype.updateMetrics_=function(){var a=this.getRatio_(),b={};this.horizontal_?b.x=a:b.y=a;this.workspace_.setMetrics(b)}; module$exports$Blockly$Scrollbar.Scrollbar.prototype.set=function(a,b){this.setHandlePosition(this.constrainHandlePosition_(a*this.ratio));(b||void 0===b)&&this.updateMetrics_()};module$exports$Blockly$Scrollbar.Scrollbar.prototype.setOrigin=function(a,b){this.origin_=new module$exports$Blockly$utils$Coordinate.Coordinate(a,b)}; module$exports$Blockly$Scrollbar.Scrollbar.metricsAreEquivalent_=function(a,b){return a.viewWidth===b.viewWidth&&a.viewHeight===b.viewHeight&&a.viewLeft===b.viewLeft&&a.viewTop===b.viewTop&&a.absoluteTop===b.absoluteTop&&a.absoluteLeft===b.absoluteLeft&&a.scrollWidth===b.scrollWidth&&a.scrollHeight===b.scrollHeight&&a.scrollLeft===b.scrollLeft&&a.scrollTop===b.scrollTop};module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness=15; module$exports$Blockly$Touch.TOUCH_ENABLED&&(module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness=25);module$exports$Blockly$Scrollbar.Scrollbar.DEFAULT_SCROLLBAR_MARGIN=.5;var module$exports$Blockly$ScrollbarPair={ScrollbarPair:function(a,b,c,d,e){this.workspace_=a;b=void 0===b?!0:b;c=void 0===c?!0:c;var f=b&&c;b&&(this.hScroll=new module$exports$Blockly$Scrollbar.Scrollbar(a,!0,f,d,e));c&&(this.vScroll=new module$exports$Blockly$Scrollbar.Scrollbar(a,!1,f,d,e));f&&(this.corner_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{height:module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness,width:module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness, "class":"blocklyScrollbarBackground"},null),(0,module$exports$Blockly$utils$dom.insertAfter)(this.corner_,a.getBubbleCanvas()));this.oldHostMetrics_=null}};module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.dispose=function(){(0,module$exports$Blockly$utils$dom.removeNode)(this.corner_);this.oldHostMetrics_=this.workspace_=this.corner_=null;this.hScroll&&(this.hScroll.dispose(),this.hScroll=null);this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}; module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.resize=function(){var a=this.workspace_.getMetrics();if(a){var b=!1,c=!1;this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth===a.viewWidth&&this.oldHostMetrics_.viewHeight===a.viewHeight&&this.oldHostMetrics_.absoluteTop===a.absoluteTop&&this.oldHostMetrics_.absoluteLeft===a.absoluteLeft?(this.oldHostMetrics_&&this.oldHostMetrics_.scrollWidth===a.scrollWidth&&this.oldHostMetrics_.viewLeft===a.viewLeft&&this.oldHostMetrics_.scrollLeft=== a.scrollLeft||(b=!0),this.oldHostMetrics_&&this.oldHostMetrics_.scrollHeight===a.scrollHeight&&this.oldHostMetrics_.viewTop===a.viewTop&&this.oldHostMetrics_.scrollTop===a.scrollTop||(c=!0)):c=b=!0;if(b||c){try{(0,module$exports$Blockly$Events$utils.disable)(),this.hScroll&&b&&this.hScroll.resize(a),this.vScroll&&c&&this.vScroll.resize(a)}finally{(0,module$exports$Blockly$Events$utils.enable)()}this.workspace_.maybeFireViewportChangeEvent()}this.hScroll&&this.vScroll&&(this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth=== a.viewWidth&&this.oldHostMetrics_.absoluteLeft===a.absoluteLeft||this.corner_.setAttribute("x",this.vScroll.position.x),this.oldHostMetrics_&&this.oldHostMetrics_.viewHeight===a.viewHeight&&this.oldHostMetrics_.absoluteTop===a.absoluteTop||this.corner_.setAttribute("y",this.hScroll.position.y));this.oldHostMetrics_=a}};module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.canScrollHorizontally=function(){return!!this.hScroll}; module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.canScrollVertically=function(){return!!this.vScroll};module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.setOrigin=function(a,b){this.hScroll&&this.hScroll.setOrigin(a,b);this.vScroll&&this.vScroll.setOrigin(a,b)}; module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.set=function(a,b,c){this.hScroll&&this.hScroll.set(a,!1);this.vScroll&&this.vScroll.set(b,!1);if(c||void 0===c)a={},this.hScroll&&(a.x=this.hScroll.getRatio_()),this.vScroll&&(a.y=this.vScroll.getRatio_()),this.workspace_.setMetrics(a)};module$exports$Blockly$ScrollbarPair.ScrollbarPair.prototype.setX=function(a){this.hScroll&&this.hScroll.set(a,!0)}; 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}; 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, 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, 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}; 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}; 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]}; 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(-1b.indexOf(d))throw Error(d+" is not a valid modifier key.");}; 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)-1a?this.menuItems_.length:a,-1)};module$exports$Blockly$Menu.Menu.prototype.highlightFirst_=function(){this.highlightHelper_(-1,1)}; module$exports$Blockly$Menu.Menu.prototype.highlightLast_=function(){this.highlightHelper_(this.menuItems_.length,-1)};module$exports$Blockly$Menu.Menu.prototype.highlightHelper_=function(a,b){a+=b;for(var c;c=this.menuItems_[a];){if(c.isEnabled()){this.setHighlighted(c);break}a+=b}};module$exports$Blockly$Menu.Menu.prototype.handleMouseOver_=function(a){(a=this.getMenuItem_(a.target))&&(a.isEnabled()?this.highlightedItem_!==a&&this.setHighlighted(a):this.setHighlighted(null))}; module$exports$Blockly$Menu.Menu.prototype.handleClick_=function(a){var b=this.openingCoords;this.openingCoords=null;if(b&&"number"===typeof a.clientX){var c=new module$exports$Blockly$utils$Coordinate.Coordinate(a.clientX,a.clientY);if(1>module$exports$Blockly$utils$Coordinate.Coordinate.distance(b,c))return}(a=this.getMenuItem_(a.target))&&a.performAction()};module$exports$Blockly$Menu.Menu.prototype.handleMouseEnter_=function(a){this.focus()}; module$exports$Blockly$Menu.Menu.prototype.handleMouseLeave_=function(a){this.getElement()&&(this.blur_(),this.setHighlighted(null))}; module$exports$Blockly$Menu.Menu.prototype.handleKeyEvent_=function(a){if(this.menuItems_.length&&!(a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)){var b=this.highlightedItem_;switch(a.keyCode){case module$exports$Blockly$utils$KeyCodes.KeyCodes.ENTER:case module$exports$Blockly$utils$KeyCodes.KeyCodes.SPACE:b&&b.performAction();break;case module$exports$Blockly$utils$KeyCodes.KeyCodes.UP:this.highlightPrevious();break;case module$exports$Blockly$utils$KeyCodes.KeyCodes.DOWN:this.highlightNext();break; case module$exports$Blockly$utils$KeyCodes.KeyCodes.PAGE_UP:case module$exports$Blockly$utils$KeyCodes.KeyCodes.HOME:this.highlightFirst_();break;case module$exports$Blockly$utils$KeyCodes.KeyCodes.PAGE_DOWN:case module$exports$Blockly$utils$KeyCodes.KeyCodes.END:this.highlightLast_();break;default:return}a.preventDefault();a.stopPropagation()}}; module$exports$Blockly$Menu.Menu.prototype.getSize=function(){var a=this.getElement(),b=(0,module$exports$Blockly$utils$style.getSize)(a);b.height=a.scrollHeight;return b};var module$exports$Blockly$serialization$priorities={VARIABLES:100,BLOCKS:50};var module$exports$Blockly$serialization$registry={register:function(a,b){(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.SERIALIZER,a,b)},unregister:function(a){(0,module$exports$Blockly$registry.unregister)(module$exports$Blockly$registry.Type.SERIALIZER,a)}};var module$exports$Blockly$serialization$exceptions={DeserializationError:function(){var a=Error.apply(this,arguments);this.message=a.message;"stack"in a&&(this.stack=a.stack)}};$.$jscomp.inherits(module$exports$Blockly$serialization$exceptions.DeserializationError,Error); module$exports$Blockly$serialization$exceptions.MissingBlockType=function(a){module$exports$Blockly$serialization$exceptions.DeserializationError.call(this,"Expected to find a 'type' property, defining the block type");this.state=a};$.$jscomp.inherits(module$exports$Blockly$serialization$exceptions.MissingBlockType,module$exports$Blockly$serialization$exceptions.DeserializationError); module$exports$Blockly$serialization$exceptions.MissingConnection=function(a,b,c){module$exports$Blockly$serialization$exceptions.DeserializationError.call(this,"The block "+b.toDevString()+" is missing a(n) "+a+"\nconnection");this.block=b;this.state=c};$.$jscomp.inherits(module$exports$Blockly$serialization$exceptions.MissingConnection,module$exports$Blockly$serialization$exceptions.DeserializationError); module$exports$Blockly$serialization$exceptions.BadConnectionCheck=function(a,b,c,d){module$exports$Blockly$serialization$exceptions.DeserializationError.call(this,"The block "+c.toDevString()+" could not connect its\n"+b+" to its parent, because: "+a);this.childBlock=c;this.childState=d};$.$jscomp.inherits(module$exports$Blockly$serialization$exceptions.BadConnectionCheck,module$exports$Blockly$serialization$exceptions.DeserializationError); module$exports$Blockly$serialization$exceptions.RealChildOfShadow=function(a){module$exports$Blockly$serialization$exceptions.DeserializationError.call(this,"Encountered a real block which is defined as a child of a shadow\nblock. It is an invariant of Blockly that shadow blocks only have shadow\nchildren");this.state=a};$.$jscomp.inherits(module$exports$Blockly$serialization$exceptions.RealChildOfShadow,module$exports$Blockly$serialization$exceptions.DeserializationError);var module$exports$Blockly$serialization$ISerializer={ISerializer:function(){}};module$exports$Blockly$serialization$ISerializer.ISerializer.prototype.save=function(a){};module$exports$Blockly$serialization$ISerializer.ISerializer.prototype.load=function(a,b){};module$exports$Blockly$serialization$ISerializer.ISerializer.prototype.clear=function(a){};var module$exports$Blockly$serialization$blocks={save:function(a,b){var c=void 0===b?{}:b;b=void 0===c.addCoordinates?!1:c.addCoordinates;var d=void 0===c.addInputBlocks?!0:c.addInputBlocks,e=void 0===c.addNextBlocks?!0:c.addNextBlocks;c=void 0===c.doFullSerialization?!0:c.doFullSerialization;if(a.isInsertionMarker())return null;var f={type:a.type,id:a.id};b&&module$contents$Blockly$serialization$blocks_saveCoords(a,f);module$contents$Blockly$serialization$blocks_saveAttributes(a,f);module$contents$Blockly$serialization$blocks_saveExtraState(a, f);module$contents$Blockly$serialization$blocks_saveIcons(a,f);module$contents$Blockly$serialization$blocks_saveFields(a,f,c);d&&module$contents$Blockly$serialization$blocks_saveInputBlocks(a,f,c);e&&module$contents$Blockly$serialization$blocks_saveNextBlocks(a,f,c);return f}},module$contents$Blockly$serialization$blocks_saveAttributes=function(a,b){a.isCollapsed()&&(b.collapsed=!0);a.isEnabled()||(b.enabled=!1);void 0!==a.inputsInline&&a.inputsInline!==a.inputsInlineDefault&&(b.inline=a.inputsInline); a.data&&(b.data=a.data)},module$contents$Blockly$serialization$blocks_saveCoords=function(a,b){var c=a.workspace;a=a.getRelativeToSurfaceXY();b.x=Math.round(c.RTL?c.getWidth()-a.x:a.x);b.y=Math.round(a.y)},module$contents$Blockly$serialization$blocks_saveExtraState=function(a,b){a.saveExtraState?(a=a.saveExtraState(),null!==a&&(b.extraState=a)):a.mutationToDom&&(a=a.mutationToDom(),null!==a&&(b.extraState=(0,$.module$exports$Blockly$Xml.domToText)(a).replace(' xmlns="https://developers.google.com/blockly/xml"', "")))},module$contents$Blockly$serialization$blocks_saveIcons=function(a,b){a.getCommentText()&&(b.icons={comment:{text:a.getCommentText(),pinned:a.commentModel.pinned,height:Math.round(a.commentModel.size.height),width:Math.round(a.commentModel.size.width)}})},module$contents$Blockly$serialization$blocks_saveFields=function(a,b,c){for(var d=Object.create(null),e=0;ea&&0<=b&&256>b&&0<=c&&256>c)? (0,module$exports$Blockly$utils$colour.rgbToHex)(a,b,c):null};module$exports$Blockly$utils$colour.rgbToHex=function(a,b,c){b=a<<16|b<<8|c;return 16>a?"#"+(16777216|b).toString(16).substr(1):"#"+b.toString(16)};module$exports$Blockly$utils$colour.hexToRgb=function(a){a=(0,module$exports$Blockly$utils$colour.parse)(a);if(!a)return[0,0,0];a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; module$exports$Blockly$utils$colour.hsvToHex=function(a,b,c){var d=0,e=0,f=0;if(0===b)f=e=d=c;else{var g=Math.floor(a/60),h=a/60-g;a=c*(1-b);var k=c*(1-b*h);b=c*(1-b*(1-h));switch(g){case 1:d=k;e=c;f=a;break;case 2:d=a;e=c;f=b;break;case 3:d=a;e=k;f=c;break;case 4:d=b;e=a;f=c;break;case 5:d=c;e=a;f=k;break;case 6:case 0:d=c,e=b,f=a}}return(0,module$exports$Blockly$utils$colour.rgbToHex)(Math.floor(d),Math.floor(e),Math.floor(f))}; module$exports$Blockly$utils$colour.blend=function(a,b,c){a=(0,module$exports$Blockly$utils$colour.parse)(a);if(!a)return null;b=(0,module$exports$Blockly$utils$colour.parse)(b);if(!b)return null;a=(0,module$exports$Blockly$utils$colour.hexToRgb)(a);b=(0,module$exports$Blockly$utils$colour.hexToRgb)(b);return(0,module$exports$Blockly$utils$colour.rgbToHex)(Math.round(b[0]+c*(a[0]-b[0])),Math.round(b[1]+c*(a[1]-b[1])),Math.round(b[2]+c*(a[2]-b[2])))}; module$exports$Blockly$utils$colour.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"};module$exports$Blockly$utils$colour.hueToHex=function(a){return(0,module$exports$Blockly$utils$colour.hsvToHex)(a,module$contents$Blockly$utils$colour_hsvSaturation,255*module$contents$Blockly$utils$colour_hsvValue)};var module$exports$Blockly$utils$svgPaths={point:function(a,b){return" "+a+","+b+" "},curve:function(a,b){return" "+a+b.join("")},moveTo:function(a,b){return" M "+a+","+b+" "},moveBy:function(a,b){return" m "+a+","+b+" "},lineTo:function(a,b){return" l "+a+","+b+" "},line:function(a){return" l"+a.join("")},lineOnAxis:function(a,b){return" "+a+" "+b+" "},arc:function(a,b,c,d){return a+" "+c+" "+c+" "+b+d}};var module$exports$Blockly$utils$parsing={},module$contents$Blockly$utils$parsing_tokenizeInterpolationInternal=function(a,b){var c=[],d=a.split("");d.push("");var e=0;a=[];for(var f=null,g=0;g=h?(e=2,f=h,(h=a.join(""))&&c.push(h),a.length=0):"{"===h?e=3:(a.push("%",h),e=0):2===e?"0"<=h&&"9">=h?f+=h:(c.push(parseInt(f,10)),g--,e=0):3===e&&(""===h?(a.splice(0,0, "%{"),g--,e=0):"}"!==h?a.push(h):(e=a.join(""),/[A-Z]\w*/i.test(e)?(h=e.toUpperCase(),(h=(0,$.module$exports$Blockly$utils$string.startsWith)(h,"BKY_")?h.substring(4):null)&&h in $.module$exports$Blockly$Msg.Msg?(e=$.module$exports$Blockly$Msg.Msg[h],"string"===typeof e?Array.prototype.push.apply(c,module$contents$Blockly$utils$parsing_tokenizeInterpolationInternal(e,b)):b?c.push(String(e)):c.push(e)):c.push("%{"+e+"}")):c.push("%{"+e+"}"),e=a.length=0))}(b=a.join(""))&&c.push(b);d=[];for(f=a.length= 0;f=c)return{hue:c,hex:(0,module$exports$Blockly$utils$colour.hsvToHex)(c,(0,module$exports$Blockly$utils$colour.getHsvSaturation)(),255*(0,module$exports$Blockly$utils$colour.getHsvValue)())};if(c=(0,module$exports$Blockly$utils$colour.parse)(b))return{hue:null,hex:c};c='Invalid colour: "'+b+'"';a!==b&& (c+=' (from "'+a+'")');throw Error(c);};var module$exports$Blockly$blockRendering$ConstantProvider={ConstantProvider:function(){this.NO_PADDING=0;this.SMALL_PADDING=3;this.MEDIUM_PADDING=5;this.MEDIUM_LARGE_PADDING=8;this.LARGE_PADDING=10;this.TALL_INPUT_FIELD_OFFSET_Y=this.MEDIUM_PADDING;this.TAB_HEIGHT=15;this.TAB_OFFSET_FROM_TOP=5;this.TAB_VERTICAL_OVERLAP=2.5;this.TAB_WIDTH=8;this.NOTCH_WIDTH=15;this.NOTCH_HEIGHT=4;this.MIN_BLOCK_WIDTH=12;this.EMPTY_BLOCK_SPACER_HEIGHT=16;this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=this.DUMMY_INPUT_MIN_HEIGHT= this.TAB_HEIGHT;this.CORNER_RADIUS=8;this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=15;this.STATEMENT_BOTTOM_SPACER=0;this.STATEMENT_INPUT_PADDING_LEFT=20;this.BETWEEN_STATEMENT_PADDING_Y=4;this.TOP_ROW_MIN_HEIGHT=this.MEDIUM_PADDING;this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING;this.BOTTOM_ROW_MIN_HEIGHT=this.MEDIUM_PADDING;this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING;this.ADD_START_HATS=!1;this.START_HAT_HEIGHT=15;this.START_HAT_WIDTH=100;this.SPACER_DEFAULT_HEIGHT= 15;this.MIN_BLOCK_HEIGHT=24;this.EMPTY_INLINE_INPUT_PADDING=14.5;this.EMPTY_INLINE_INPUT_HEIGHT=this.TAB_HEIGHT+11;this.EXTERNAL_VALUE_INPUT_PADDING=2;this.EMPTY_STATEMENT_INPUT_HEIGHT=this.MIN_BLOCK_HEIGHT;this.START_POINT=(0,module$exports$Blockly$utils$svgPaths.moveBy)(0,0);this.JAGGED_TEETH_HEIGHT=12;this.JAGGED_TEETH_WIDTH=6;this.FIELD_TEXT_FONTSIZE=11;this.FIELD_TEXT_FONTWEIGHT="normal";this.FIELD_TEXT_FONTFAMILY="sans-serif";this.FIELD_TEXT_BASELINE=this.FIELD_TEXT_HEIGHT=-1;this.FIELD_BORDER_RECT_RADIUS= 4;this.FIELD_BORDER_RECT_HEIGHT=16;this.FIELD_BORDER_RECT_X_PADDING=5;this.FIELD_BORDER_RECT_Y_PADDING=3;this.FIELD_BORDER_RECT_COLOUR="#fff";this.FIELD_TEXT_BASELINE_CENTER=!module$exports$Blockly$utils$userAgent.IE&&!module$exports$Blockly$utils$userAgent.EDGE;this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT;this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!1;this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING; this.FIELD_DROPDOWN_SVG_ARROW_SIZE=12;this.FIELD_DROPDOWN_SVG_ARROW_DATAURI="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4="; this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=!1;this.FIELD_COLOUR_DEFAULT_WIDTH=26;this.FIELD_COLOUR_DEFAULT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT;this.FIELD_CHECKBOX_X_OFFSET=this.FIELD_BORDER_RECT_X_PADDING-3;this.randomIdentifier=String(Math.random()).substring(2);this.defs_=null;this.embossFilterId="";this.embossFilter_=null;this.disabledPatternId="";this.disabledPattern_=null;this.debugFilterId="";this.cssNode_=this.debugFilter_=null;this.CURSOR_COLOUR="#cc0a0a";this.MARKER_COLOUR= "#4286f4";this.CURSOR_WS_WIDTH=100;this.WS_CURSOR_HEIGHT=5;this.CURSOR_STACK_PADDING=10;this.CURSOR_BLOCK_PADDING=2;this.CURSOR_STROKE_WIDTH=4;this.FULL_BLOCK_FIELDS=!1;this.INSERTION_MARKER_COLOUR="#000000";this.INSERTION_MARKER_OPACITY=.2;this.SHAPES={PUZZLE:1,NOTCH:2}}}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.init=function(){this.JAGGED_TEETH=this.makeJaggedTeeth();this.NOTCH=this.makeNotch();this.START_HAT=this.makeStartHat();this.PUZZLE_TAB=this.makePuzzleTab();this.INSIDE_CORNERS=this.makeInsideCorners();this.OUTSIDE_CORNERS=this.makeOutsideCorners()}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.setTheme=function(a){this.blockStyles=Object.create(null);var b=a.blockStyles,c;for(c in b)this.blockStyles[c]=this.validatedBlockStyle_(b[c]);this.setDynamicProperties_(a)};module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.setDynamicProperties_=function(a){this.setFontConstants_(a);this.setComponentConstants_(a);this.ADD_START_HATS=null!==a.startHats?a.startHats:this.ADD_START_HATS}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.setFontConstants_=function(a){a.fontStyle&&a.fontStyle.family&&(this.FIELD_TEXT_FONTFAMILY=a.fontStyle.family);a.fontStyle&&a.fontStyle.weight&&(this.FIELD_TEXT_FONTWEIGHT=a.fontStyle.weight);a.fontStyle&&a.fontStyle.size&&(this.FIELD_TEXT_FONTSIZE=a.fontStyle.size);a=(0,module$exports$Blockly$utils$dom.measureFontMetrics)("Hg",this.FIELD_TEXT_FONTSIZE+"pt",this.FIELD_TEXT_FONTWEIGHT,this.FIELD_TEXT_FONTFAMILY);this.FIELD_TEXT_HEIGHT= a.height;this.FIELD_TEXT_BASELINE=a.baseline}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.setComponentConstants_=function(a){this.CURSOR_COLOUR=a.getComponentStyle("cursorColour")||this.CURSOR_COLOUR;this.MARKER_COLOUR=a.getComponentStyle("markerColour")||this.MARKER_COLOUR;this.INSERTION_MARKER_COLOUR=a.getComponentStyle("insertionMarkerColour")||this.INSERTION_MARKER_COLOUR;this.INSERTION_MARKER_OPACITY=Number(a.getComponentStyle("insertionMarkerOpacity"))||this.INSERTION_MARKER_OPACITY}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.getBlockStyleForColour=function(a){var b="auto_"+a;this.blockStyles[b]||(this.blockStyles[b]=this.createBlockStyle_(a));return{style:this.blockStyles[b],name:b}};module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.getBlockStyle=function(a){return this.blockStyles[a||""]||(a&&0===a.indexOf("auto_")?this.getBlockStyleForColour(a.substring(5)).style:this.createBlockStyle_("#000000"))}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.createBlockStyle_=function(a){return this.validatedBlockStyle_({colourPrimary:a})}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.validatedBlockStyle_=function(a){var b={};a&&(0,$.module$exports$Blockly$utils$object.mixin)(b,a);a=(0,module$exports$Blockly$utils$parsing.parseBlockColour)(b.colourPrimary||"#000");b.colourPrimary=a.hex;b.colourSecondary=b.colourSecondary?(0,module$exports$Blockly$utils$parsing.parseBlockColour)(b.colourSecondary).hex:this.generateSecondaryColour_(b.colourPrimary);b.colourTertiary=b.colourTertiary?(0,module$exports$Blockly$utils$parsing.parseBlockColour)(b.colourTertiary).hex: this.generateTertiaryColour_(b.colourPrimary);b.hat=b.hat||"";return b};module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.generateSecondaryColour_=function(a){return(0,module$exports$Blockly$utils$colour.blend)("#fff",a,.6)||a};module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.generateTertiaryColour_=function(a){return(0,module$exports$Blockly$utils$colour.blend)("#fff",a,.3)||a}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.dispose=function(){this.embossFilter_&&(0,module$exports$Blockly$utils$dom.removeNode)(this.embossFilter_);this.disabledPattern_&&(0,module$exports$Blockly$utils$dom.removeNode)(this.disabledPattern_);this.debugFilter_&&(0,module$exports$Blockly$utils$dom.removeNode)(this.debugFilter_);this.cssNode_=null}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.makeJaggedTeeth=function(){var a=this.JAGGED_TEETH_HEIGHT,b=this.JAGGED_TEETH_WIDTH,c=(0,module$exports$Blockly$utils$svgPaths.line)([(0,module$exports$Blockly$utils$svgPaths.point)(b,a/4),(0,module$exports$Blockly$utils$svgPaths.point)(2*-b,a/2),(0,module$exports$Blockly$utils$svgPaths.point)(b,a/4)]);return{height:a,width:b,path:c}}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.makeStartHat=function(){var a=this.START_HAT_HEIGHT,b=this.START_HAT_WIDTH,c=(0,module$exports$Blockly$utils$svgPaths.curve)("c",[(0,module$exports$Blockly$utils$svgPaths.point)(30,-a),(0,module$exports$Blockly$utils$svgPaths.point)(70,-a),(0,module$exports$Blockly$utils$svgPaths.point)(b,0)]);return{height:a,width:b,path:c}}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.makePuzzleTab=function(){function a(f){f=f?-1:1;var g=-f,h=c/2,k=h+2.5,l=h+.5,m=(0,module$exports$Blockly$utils$svgPaths.point)(-b,f*h);h=(0,module$exports$Blockly$utils$svgPaths.point)(b,f*h);return(0,module$exports$Blockly$utils$svgPaths.curve)("c",[(0,module$exports$Blockly$utils$svgPaths.point)(0,f*k),(0,module$exports$Blockly$utils$svgPaths.point)(-b,g*l),m])+(0,module$exports$Blockly$utils$svgPaths.curve)("s", [(0,module$exports$Blockly$utils$svgPaths.point)(b,2.5*g),h])}var b=this.TAB_WIDTH,c=this.TAB_HEIGHT,d=a(!0),e=a(!1);return{type:this.SHAPES.PUZZLE,width:b,height:c,pathDown:e,pathUp:d}}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.makeNotch=function(){function a(g){return(0,module$exports$Blockly$utils$svgPaths.line)([(0,module$exports$Blockly$utils$svgPaths.point)(g*d,c),(0,module$exports$Blockly$utils$svgPaths.point)(3*g,0),(0,module$exports$Blockly$utils$svgPaths.point)(g*d,-c)])}var b=this.NOTCH_WIDTH,c=this.NOTCH_HEIGHT,d=(b-3)/2,e=a(1),f=a(-1);return{type:this.SHAPES.NOTCH,width:b,height:c,pathLeft:e,pathRight:f}}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.makeInsideCorners=function(){var a=this.CORNER_RADIUS,b=(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,0",a,(0,module$exports$Blockly$utils$svgPaths.point)(-a,a)),c=(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,0",a,(0,module$exports$Blockly$utils$svgPaths.point)(a,a));return{width:a,height:a,pathTop:b,pathBottom:c}}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.makeOutsideCorners=function(){var a=this.CORNER_RADIUS,b=(0,module$exports$Blockly$utils$svgPaths.moveBy)(0,a)+(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",a,(0,module$exports$Blockly$utils$svgPaths.point)(a,-a)),c=(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",a,(0,module$exports$Blockly$utils$svgPaths.point)(a,a)),d=(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",a,(0,module$exports$Blockly$utils$svgPaths.point)(-a, -a)),e=(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",a,(0,module$exports$Blockly$utils$svgPaths.point)(-a,a));return{topLeft:b,topRight:c,bottomRight:e,bottomLeft:d,rightHeight:a}}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.shapeFor=function(a){switch(a.type){case $.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE:case $.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE:return this.PUZZLE_TAB;case $.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT:case $.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown connection type"); }}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.createDom=function(a,b,c){this.injectCSS_(b,c);this.defs_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.DEFS,{},a);a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FILTER,{id:"blocklyEmbossFilter"+this.randomIdentifier},this.defs_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEGAUSSIANBLUR,{"in":"SourceAlpha", stdDeviation:1,result:"blur"},a);b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FESPECULARLIGHTING,{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEPOINTLIGHT,{x:-5E3,y:-1E4,z:2E4},b);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FECOMPOSITE,{"in":"specOut", in2:"SourceAlpha",operator:"in",result:"specOut"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FECOMPOSITE,{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},a);this.embossFilterId=a.id;this.embossFilter_=a;a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATTERN,{id:"blocklyDisabledPattern"+this.randomIdentifier,patternUnits:"userSpaceOnUse",width:10,height:10},this.defs_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT, {width:10,height:10,fill:"#aaa"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},a);this.disabledPatternId=a.id;this.disabledPattern_=a;this.createDebugFilter()}; module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.createDebugFilter=function(){if(!this.debugFilter_){var a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FILTER,{id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},this.defs_),b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEFUNCA, {type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEFLOOD,{"flood-color":"#ff0000","flood-opacity":.5,result:"outColor"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FECOMPOSITE,{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a);this.debugFilterId=a.id;this.debugFilter_=a}}; 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)}; 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 {", "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 {", "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."), 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}; 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}; 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())}; 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}; 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); 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}; 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}; 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); break;case "mutation":var c=module$exports$Blockly$Events$BlockChange.BlockChange.getExtraBlockState_(b);b.loadExtraState?b.loadExtraState(JSON.parse(a||"{}")):b.domToMutation&&b.domToMutation((0,$.module$exports$Blockly$Xml.textToDom)(a||""));(0,module$exports$Blockly$Events$utils.fire)(new module$exports$Blockly$Events$BlockChange.BlockChange(b,"mutation",null,c,a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+ this.blockId)};module$exports$Blockly$Events$BlockChange.BlockChange.getExtraBlockState_=function(a){return a.saveExtraState?(a=a.saveExtraState())?JSON.stringify(a):"":a.mutationToDom?(a=a.mutationToDom())?(0,$.module$exports$Blockly$Xml.domToText)(a):"":""};(0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.EVENT,module$exports$Blockly$Events$utils.CHANGE,module$exports$Blockly$Events$BlockChange.BlockChange);var module$exports$Blockly$blockAnimations={},module$contents$Blockly$blockAnimations_disconnectPid=0,module$contents$Blockly$blockAnimations_disconnectGroup=null; module$exports$Blockly$blockAnimations.disposeUiEffect=function(a){var b=a.workspace,c=a.getSvgRoot();b.getAudioManager().play("delete");a=b.getSvgXY(c);c=c.cloneNode(!0);c.translateX_=a.x;c.translateY_=a.y;c.setAttribute("transform","translate("+a.x+","+a.y+")");b.getParentSvg().appendChild(c);c.bBox_=c.getBBox();module$contents$Blockly$blockAnimations_disposeUiStep(c,b.RTL,new Date,b.scale)}; var module$contents$Blockly$blockAnimations_disposeUiStep=function(a,b,c,d){var e=(new Date-c)/150;1c)){var d=b.getSvgXY(a.getSvgRoot());a.outputConnection?(d.x+=(a.RTL?3:-3)*c,d.y+=13*c):a.previousConnection&&(d.x+=(a.RTL?-23:23)*c,d.y+=3*c);a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CIRCLE,{cx:d.x,cy:d.y,r:0,fill:"none",stroke:"#888","stroke-width":10},b.getParentSvg());module$contents$Blockly$blockAnimations_connectionUiStep(a, new Date,c)}};var module$contents$Blockly$blockAnimations_connectionUiStep=function(a,b,c){var d=(new Date-b)/150;1a.workspace.scale)){var b=a.getHeightWidth().height;b=Math.atan(10/b)/Math.PI*180;a.RTL||(b*=-1);module$contents$Blockly$blockAnimations_disconnectUiStep(a.getSvgRoot(),b,new Date)}}; var module$contents$Blockly$blockAnimations_disconnectUiStep=function(a,b,c){var d=(new Date-c)/200;11'),d.appendChild(c),b.push(d));if(module$exports$Blockly$blocks.Blocks.variables_get)for(a.sort(module$exports$Blockly$VariableModel.VariableModel.compareByName), c=0;d=a[c];c++){var e=(0,$.module$exports$Blockly$utils$xml.createElement)("block");e.setAttribute("type","variables_get");e.setAttribute("gap",8);e.appendChild((0,$.module$exports$Blockly$Variables.generateVariableFieldDom)(d));b.push(e)}}return b};$.module$exports$Blockly$Variables.VAR_LETTER_OPTIONS="ijkmnopqrstuvwxyzabcdefgh"; $.module$exports$Blockly$Variables.generateUniqueName=function(a){return(0,$.module$exports$Blockly$Variables.generateUniqueNameFromOptions)($.module$exports$Blockly$Variables.VAR_LETTER_OPTIONS.charAt(0),a.getAllVariableNames())}; $.module$exports$Blockly$Variables.generateUniqueNameFromOptions=function(a,b){if(!b.length)return a;for(var c=$.module$exports$Blockly$Variables.VAR_LETTER_OPTIONS,d="",e=c.indexOf(a);;){for(var f=!1,g=0;gc||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()&& !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}; 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); 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= 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}; 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)}; 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.");}; module$exports$Blockly$Workspace.Workspace.prototype.getTopBlocks=function(a){var b=[].concat(this.topBlocks_);a&&1this.remainingCapacityOfType(c))return!1;b+=a[c]}return b>this.remainingCapacity()?!1:!0};module$exports$Blockly$Workspace.Workspace.prototype.hasBlockLimits=function(){return Infinity!==this.options.maxBlocks||!!this.options.maxInstances};module$exports$Blockly$Workspace.Workspace.prototype.getUndoStack=function(){return this.undoStack_}; module$exports$Blockly$Workspace.Workspace.prototype.getRedoStack=function(){return this.redoStack_}; module$exports$Blockly$Workspace.Workspace.prototype.undo=function(a){var b=a?this.redoStack_:this.undoStack_,c=a?this.undoStack_:this.redoStack_,d=b.pop();if(d){for(var e=[d];b.length&&d.group&&d.group===b[b.length-1].group;)e.push(b.pop());for(b=0;bthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(var b=0;ba.width)return b;if(this.workspace_.RTL){var c=this.anchorXY_.x-b,d=a.left+a.width;a=a.left+module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness/this.workspace_.scale;c-this.width_d&&(b=-(d-this.anchorXY_.x))}else{c=b+this.anchorXY_.x;d=c+this.width_;var e=a.left;a=a.left+a.width-module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness/ this.workspace_.scale;ca&&(b=a-this.anchorXY_.x-this.width_)}return b};module$exports$Blockly$Bubble.Bubble.prototype.getOptimalRelativeTop_=function(a){var b=-this.height_/4;if(this.height_>a.height)return b;var c=this.anchorXY_.y+b,d=c+this.height_,e=a.top;a=a.top+a.height-module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness/this.workspace_.scale;var f=this.anchorXY_.y;ca&&(b=a-f-this.height_);return b}; module$exports$Blockly$Bubble.Bubble.prototype.positionBubble_=function(){var a=this.anchorXY_.x;a=this.workspace_.RTL?a-(this.relativeLeft_+this.width_):a+this.relativeLeft_;this.moveTo(a,this.relativeTop_+this.anchorXY_.y)};module$exports$Blockly$Bubble.Bubble.prototype.moveTo=function(a,b){this.bubbleGroup_.setAttribute("transform","translate("+a+","+b+")")};module$exports$Blockly$Bubble.Bubble.prototype.setDragging=function(a){!a&&this.moveCallback_&&this.moveCallback_()}; module$exports$Blockly$Bubble.Bubble.prototype.getBubbleSize=function(){return new module$exports$Blockly$utils$Size.Size(this.width_,this.height_)}; module$exports$Blockly$Bubble.Bubble.prototype.setBubbleSize=function(a,b){var c=2*module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH;a=Math.max(a,c+45);b=Math.max(b,c+20);this.width_=a;this.height_=b;this.bubbleBack_.setAttribute("width",a);this.bubbleBack_.setAttribute("height",b);this.resizeGroup_&&(this.workspace_.RTL?this.resizeGroup_.setAttribute("transform","translate("+2*module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH+","+(b-c)+") scale(-1 1)"):this.resizeGroup_.setAttribute("transform", "translate("+(a-c)+","+(b-c)+")"));this.autoLayout_&&this.layoutBubble_();this.positionBubble_();this.renderArrow_();this.resizeCallback_&&this.resizeCallback_()}; module$exports$Blockly$Bubble.Bubble.prototype.renderArrow_=function(){var a=[],b=this.width_/2,c=this.height_/2,d=-this.relativeLeft_,e=-this.relativeTop_;if(b===d&&c===e)a.push("M "+b+","+c);else{e-=c;d-=b;this.workspace_.RTL&&(d*=-1);var f=Math.sqrt(e*e+d*d),g=Math.acos(d/f);0>e&&(g=2*Math.PI-g);var h=g+Math.PI/2;h>2*Math.PI&&(h-=2*Math.PI);var k=Math.sin(h),l=Math.cos(h),m=this.getBubbleSize();h=(m.width+m.height)/module$exports$Blockly$Bubble.Bubble.ARROW_THICKNESS;h=Math.min(h,m.width,m.height)/ 4;m=1-module$exports$Blockly$Bubble.Bubble.ANCHOR_RADIUS/f;d=b+m*d;e=c+m*e;m=b+h*l;var n=c+h*k;b-=h*l;c-=h*k;k=g+this.arrow_radians_;k>2*Math.PI&&(k-=2*Math.PI);g=Math.sin(k)*f/module$exports$Blockly$Bubble.Bubble.ARROW_BEND;f=Math.cos(k)*f/module$exports$Blockly$Bubble.Bubble.ARROW_BEND;a.push("M"+m+","+n);a.push("C"+(m+f)+","+(n+g)+" "+d+","+e+" "+d+","+e);a.push("C"+d+","+e+" "+(b+f)+","+(c+g)+" "+b+","+c)}a.push("z");this.bubbleArrow_.setAttribute("d",a.join(" "))}; module$exports$Blockly$Bubble.Bubble.prototype.setColour=function(a){this.bubbleBack_.setAttribute("fill",a);this.bubbleArrow_.setAttribute("fill",a)}; module$exports$Blockly$Bubble.Bubble.prototype.dispose=function(){this.onMouseDownBubbleWrapper_&&(0,module$exports$Blockly$browserEvents.unbind)(this.onMouseDownBubbleWrapper_);this.onMouseDownResizeWrapper_&&(0,module$exports$Blockly$browserEvents.unbind)(this.onMouseDownResizeWrapper_);module$exports$Blockly$Bubble.Bubble.unbindDragEvents_();(0,module$exports$Blockly$utils$dom.removeNode)(this.bubbleGroup_);this.disposed=!0}; module$exports$Blockly$Bubble.Bubble.prototype.moveDuringDrag=function(a,b){a?a.translateSurface(b.x,b.y):this.moveTo(b.x,b.y);this.relativeLeft_=this.workspace_.RTL?this.anchorXY_.x-b.x-this.width_:b.x-this.anchorXY_.x;this.relativeTop_=b.y-this.anchorXY_.y;this.renderArrow_()}; module$exports$Blockly$Bubble.Bubble.prototype.getRelativeToSurfaceXY=function(){return new module$exports$Blockly$utils$Coordinate.Coordinate(this.workspace_.RTL?-this.relativeLeft_+this.anchorXY_.x-this.width_:this.anchorXY_.x+this.relativeLeft_,this.anchorXY_.y+this.relativeTop_)};module$exports$Blockly$Bubble.Bubble.prototype.setAutoLayout=function(a){this.autoLayout_=a}; module$exports$Blockly$Bubble.Bubble.unbindDragEvents_=function(){module$exports$Blockly$Bubble.Bubble.onMouseUpWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(module$exports$Blockly$Bubble.Bubble.onMouseUpWrapper_),module$exports$Blockly$Bubble.Bubble.onMouseUpWrapper_=null);module$exports$Blockly$Bubble.Bubble.onMouseMoveWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(module$exports$Blockly$Bubble.Bubble.onMouseMoveWrapper_),module$exports$Blockly$Bubble.Bubble.onMouseMoveWrapper_= null)};module$exports$Blockly$Bubble.Bubble.bubbleMouseUp_=function(a){(0,module$exports$Blockly$Touch.clearTouchIdentifier)();module$exports$Blockly$Bubble.Bubble.unbindDragEvents_()}; module$exports$Blockly$Bubble.Bubble.textToDom=function(a){var b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.TEXT,{"class":"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH},null);a=a.split("\n");for(var c=0;cb-$.module$exports$Blockly$config.config.currentConnectionPreference)}if(this.localConnection_|| this.closestConnection_)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!this.localConnection_||!this.closestConnection_);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0}; module$exports$Blockly$InsertionMarkerManager.InsertionMarkerManager.prototype.getCandidate_=function(a){var b=this.getStartRadius_(),c=null,d=null;this.markerConnection_&&this.markerConnection_.isConnected()||this.updateAvailableConnections();for(var e=0;e(this.flyout_?$.module$exports$Blockly$config.config.flyoutDragRadius:$.module$exports$Blockly$config.config.dragRadius)}; module$exports$Blockly$Gesture.Gesture.prototype.updateIsDraggingFromFlyout_=function(){return this.targetBlock_&&this.flyout_.isBlockCreatable_(this.targetBlock_)?!this.flyout_.isScrollable()||this.flyout_.isDragTowardWorkspace(this.currentDragDeltaXY_)?(this.startWorkspace_=this.flyout_.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),(0,module$exports$Blockly$Events$utils.getGroup)()||(0,module$exports$Blockly$Events$utils.setGroup)(!0),this.startBlock_=null,this.targetBlock_= this.flyout_.createBlock(this.targetBlock_),this.targetBlock_.select(),!0):!1:!1};module$exports$Blockly$Gesture.Gesture.prototype.updateIsDraggingBubble_=function(){if(!this.startBubble_)return!1;this.isDraggingBubble_=!0;this.startDraggingBubble_();return!0}; module$exports$Blockly$Gesture.Gesture.prototype.updateIsDraggingBlock_=function(){if(!this.targetBlock_)return!1;this.flyout_?this.isDraggingBlock_=this.updateIsDraggingFromFlyout_():this.targetBlock_.isMovable()&&(this.isDraggingBlock_=!0);return this.isDraggingBlock_?(this.startDraggingBlock_(),!0):!1}; module$exports$Blockly$Gesture.Gesture.prototype.updateIsDraggingWorkspace_=function(){if(this.flyout_?this.flyout_.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())this.workspaceDragger_=new module$exports$Blockly$WorkspaceDragger.WorkspaceDragger(this.startWorkspace_),this.isDraggingWorkspace_=!0,this.workspaceDragger_.startDrag()}; module$exports$Blockly$Gesture.Gesture.prototype.updateIsDragging_=function(){if(this.calledUpdateIsDragging_)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging_=!0;this.updateIsDraggingBubble_()||this.updateIsDraggingBlock_()||this.updateIsDraggingWorkspace_()}; module$exports$Blockly$Gesture.Gesture.prototype.startDraggingBlock_=function(){this.blockDragger_=new ((0,module$exports$Blockly$registry.getClassFromOptions)(module$exports$Blockly$registry.Type.BLOCK_DRAGGER,this.creatorWorkspace_.options,!0))(this.targetBlock_,this.startWorkspace_);this.blockDragger_.startDrag(this.currentDragDeltaXY_,this.healStack_);this.blockDragger_.drag(this.mostRecentEvent_,this.currentDragDeltaXY_)}; module$exports$Blockly$Gesture.Gesture.prototype.startDraggingBubble_=function(){this.bubbleDragger_=new module$exports$Blockly$BubbleDragger.BubbleDragger(this.startBubble_,this.startWorkspace_);this.bubbleDragger_.startBubbleDrag();this.bubbleDragger_.dragBubble(this.mostRecentEvent_,this.currentDragDeltaXY_)}; module$exports$Blockly$Gesture.Gesture.prototype.doStart=function(a){(0,module$exports$Blockly$browserEvents.isTargetInput)(a)?this.cancel():(this.hasStarted_=!0,(0,module$exports$Blockly$blockAnimations.disconnectUiStop)(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.startWorkspace_.hideChaff(!!this.flyout_),this.startWorkspace_.markFocused(),this.mostRecentEvent_=a,(0,module$exports$Blockly$Tooltip.block)(),this.targetBlock_&& this.targetBlock_.select(),(0,module$exports$Blockly$browserEvents.isRightButton)(a)?this.handleRightClick(a):("touchstart"!==a.type.toLowerCase()&&"pointerdown"!==a.type.toLowerCase()||"mouse"===a.pointerType||(0,module$exports$Blockly$Touch.longStart)(a,this),this.mouseDownXY_=new module$exports$Blockly$utils$Coordinate.Coordinate(a.clientX,a.clientY),this.healStack_=a.altKey||a.ctrlKey||a.metaKey,this.bindMouseEvents(a)))}; module$exports$Blockly$Gesture.Gesture.prototype.bindMouseEvents=function(a){this.onMoveWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(document,"mousemove",null,this.handleMove.bind(this));this.onUpWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(document,"mouseup",null,this.handleUp.bind(this));a.preventDefault();a.stopPropagation()}; module$exports$Blockly$Gesture.Gesture.prototype.handleMove=function(a){this.updateFromEvent_(a);this.isDraggingWorkspace_?this.workspaceDragger_.drag(this.currentDragDeltaXY_):this.isDraggingBlock_?this.blockDragger_.drag(this.mostRecentEvent_,this.currentDragDeltaXY_):this.isDraggingBubble_&&this.bubbleDragger_.dragBubble(this.mostRecentEvent_,this.currentDragDeltaXY_);a.preventDefault();a.stopPropagation()}; module$exports$Blockly$Gesture.Gesture.prototype.handleUp=function(a){this.updateFromEvent_(a);(0,module$exports$Blockly$Touch.longStop)();this.isEnding_?console.log("Trying to end a gesture recursively."):(this.isEnding_=!0,this.isDraggingBubble_?this.bubbleDragger_.endBubbleDrag(a,this.currentDragDeltaXY_):this.isDraggingBlock_?this.blockDragger_.endDrag(a,this.currentDragDeltaXY_):this.isDraggingWorkspace_?this.workspaceDragger_.endDrag(this.currentDragDeltaXY_):this.isBubbleClick_()?this.doBubbleClick_(): this.isFieldClick_()?this.doFieldClick_():this.isBlockClick_()?this.doBlockClick_():this.isWorkspaceClick_()&&this.doWorkspaceClick_(a),a.preventDefault(),a.stopPropagation(),this.dispose())}; module$exports$Blockly$Gesture.Gesture.prototype.cancel=function(){this.isEnding_||((0,module$exports$Blockly$Touch.longStop)(),this.isDraggingBubble_?this.bubbleDragger_.endBubbleDrag(this.mostRecentEvent_,this.currentDragDeltaXY_):this.isDraggingBlock_?this.blockDragger_.endDrag(this.mostRecentEvent_,this.currentDragDeltaXY_):this.isDraggingWorkspace_&&this.workspaceDragger_.endDrag(this.currentDragDeltaXY_),this.dispose())}; module$exports$Blockly$Gesture.Gesture.prototype.handleRightClick=function(a){this.targetBlock_?(this.bringBlockToFront_(),this.targetBlock_.workspace.hideChaff(!!this.flyout_),this.targetBlock_.showContextMenu(a)):this.startBubble_?this.startBubble_.showContextMenu(a):this.startWorkspace_&&!this.flyout_&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(a));a.preventDefault();a.stopPropagation();this.dispose()}; module$exports$Blockly$Gesture.Gesture.prototype.handleWsStart=function(a,b){if(this.hasStarted_)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace_(b);this.mostRecentEvent_=a;this.doStart(a)};module$exports$Blockly$Gesture.Gesture.prototype.fireWorkspaceClick_=function(a){(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CLICK))(null,a.id,"workspace"))}; module$exports$Blockly$Gesture.Gesture.prototype.handleFlyoutStart=function(a,b){if(this.hasStarted_)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout_(b);this.handleWsStart(a,b.getWorkspace())}; module$exports$Blockly$Gesture.Gesture.prototype.handleBlockStart=function(a,b){if(this.hasStarted_)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(b);this.mostRecentEvent_=a};module$exports$Blockly$Gesture.Gesture.prototype.handleBubbleStart=function(a,b){if(this.hasStarted_)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(b);this.mostRecentEvent_=a}; module$exports$Blockly$Gesture.Gesture.prototype.doBubbleClick_=function(){this.startBubble_.setFocus&&this.startBubble_.setFocus();this.startBubble_.select&&this.startBubble_.select()};module$exports$Blockly$Gesture.Gesture.prototype.doFieldClick_=function(){this.startField_.showEditor(this.mostRecentEvent_);this.bringBlockToFront_()}; module$exports$Blockly$Gesture.Gesture.prototype.doBlockClick_=function(){if(this.flyout_&&this.flyout_.autoClose)this.targetBlock_.isEnabled()&&((0,module$exports$Blockly$Events$utils.getGroup)()||(0,module$exports$Blockly$Events$utils.setGroup)(!0),this.flyout_.createBlock(this.targetBlock_).scheduleSnapAndBump());else{var a=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CLICK))(this.startBlock_,this.startWorkspace_.id,"block");(0,module$exports$Blockly$Events$utils.fire)(a)}this.bringBlockToFront_(); (0,module$exports$Blockly$Events$utils.setGroup)(!1)};module$exports$Blockly$Gesture.Gesture.prototype.doWorkspaceClick_=function(a){a=this.creatorWorkspace_;(0,$.module$exports$Blockly$common.getSelected)()&&(0,$.module$exports$Blockly$common.getSelected)().unselect();this.fireWorkspaceClick_(this.startWorkspace_||a)};module$exports$Blockly$Gesture.Gesture.prototype.bringBlockToFront_=function(){this.targetBlock_&&!this.flyout_&&this.targetBlock_.bringToFront()}; module$exports$Blockly$Gesture.Gesture.prototype.setStartField=function(a){if(this.hasStarted_)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField_||(this.startField_=a)};module$exports$Blockly$Gesture.Gesture.prototype.setStartBubble=function(a){this.startBubble_||(this.startBubble_=a)}; module$exports$Blockly$Gesture.Gesture.prototype.setStartBlock=function(a){this.startBlock_||this.startBubble_||(this.startBlock_=a,a.isInFlyout&&a!==a.getRootBlock()?this.setTargetBlock_(a.getRootBlock()):this.setTargetBlock_(a))};module$exports$Blockly$Gesture.Gesture.prototype.setTargetBlock_=function(a){a.isShadow()?this.setTargetBlock_(a.getParent()):this.targetBlock_=a}; 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_()}; 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_}; 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():[]}; 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= 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)}; 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_}; 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())}; module$exports$Blockly$Field.Field.prototype.initView=function(){this.createBorderRect_();this.createTextElement_()};module$exports$Blockly$Field.Field.prototype.initModel=function(){}; module$exports$Blockly$Field.Field.prototype.createBorderRect_=function(){this.borderRect_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,"class":"blocklyFieldRect"},this.fieldGroup_)}; module$exports$Blockly$Field.Field.prototype.createTextElement_=function(){this.textElement_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.TEXT,{"class":"blocklyText"},this.fieldGroup_);this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central");this.textContent_=document.createTextNode("");this.textElement_.appendChild(this.textContent_)}; module$exports$Blockly$Field.Field.prototype.bindEvents_=function(){(0,module$exports$Blockly$Tooltip.bindMouseEvents)(this.getClickTarget_());this.mouseDownWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(this.getClickTarget_(),"mousedown",this,this.onMouseDown_)};module$exports$Blockly$Field.Field.prototype.fromXml=function(a){this.setValue(a.textContent)};module$exports$Blockly$Field.Field.prototype.toXml=function(a){a.textContent=this.getValue();return a}; 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)}; 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}; 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}; 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}; 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=""))}; 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_}; 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}; 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_}; 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){}; 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, 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)}}; 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))}; 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_}; 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|| (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}; 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}; module$exports$Blockly$Field.Field.prototype.forceRerender=function(){this.isDirty_=!0;this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours(),this.updateMarkers_())}; 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, "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}; 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)}; 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_})}; 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(){}; module$exports$Blockly$Field.Field.prototype.getParentInput=function(){for(var a=null,b=this.sourceBlock_,c=b.inputList,d=0;da.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"}, this.svgRoot_))}}; 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", "stroke-width":"1px"},this.svgRoot_))}}; 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)&& 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 module$exports$Blockly$blockRendering$InputConnection.InputConnection&&module$exports$Blockly$blockRendering$Debug.Debug.config.connections&&this.drawConnection(a.connectionModel)}; 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&& (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_))}}; 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)|| 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_)))}; module$exports$Blockly$blockRendering$Debug.Debug.prototype.drawRowWithElements=function(a,b,c){for(var d=0;da||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&& (a=this.insertFieldAt(a,b.suffixField));this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours());return a}; $.module$exports$Blockly$Input.Input.prototype.removeField=function(a,b){for(var c=0,d;d=this.fieldRow[c];c++)if(d.name===a)return d.dispose(),this.fieldRow.splice(c,1),this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours()),!0;if(b)return!1;throw Error('Field "'+a+'" not found.');};$.module$exports$Blockly$Input.Input.prototype.isVisible=function(){return this.visible_}; $.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()}; $.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}; $.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;aa.length)){b=[];for(c=0;ca&&(e=e.substring(0,a-3)+"...");return e};module$exports$Blockly$Block.Block.prototype.appendValueInput=function(a){return this.appendInput_($.module$exports$Blockly$inputTypes.inputTypes.VALUE,a)}; module$exports$Blockly$Block.Block.prototype.appendStatementInput=function(a){return this.appendInput_($.module$exports$Blockly$inputTypes.inputTypes.STATEMENT,a)};module$exports$Blockly$Block.Block.prototype.appendDummyInput=function(a){return this.appendInput_($.module$exports$Blockly$inputTypes.inputTypes.DUMMY,a||"")}; module$exports$Blockly$Block.Block.prototype.jsonInit=function(a){var b=a.type?'Block "'+a.type+'": ':"";if(a.output&&a.previousStatement)throw Error(b+"Must not have both an output and a previousStatement.");a.style&&a.style.hat&&(this.hat=a.style.hat,a.style=null);if(a.style&&a.colour)throw Error(b+"Must not have both a colour and a style.");a.style?this.jsonInitStyle_(a,b):this.jsonInitColour_(a,b);for(var c=0;void 0!==a["message"+c];)this.interpolate_(a["message"+c],a["args"+c]||[],a["lastDummyAlign"+ c],b),c++;void 0!==a.inputsInline&&this.setInputsInline(a.inputsInline);void 0!==a.output&&this.setOutput(!0,a.output);void 0!==a.outputShape&&this.setOutputShape(a.outputShape);void 0!==a.previousStatement&&this.setPreviousStatement(!0,a.previousStatement);void 0!==a.nextStatement&&this.setNextStatement(!0,a.nextStatement);void 0!==a.tooltip&&(c=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.tooltip),this.setTooltip(c));void 0!==a.enableContextMenu&&(this.contextMenu=!!a.enableContextMenu); void 0!==a.suppressPrefixSuffix&&(this.suppressPrefixSuffix=!!a.suppressPrefixSuffix);void 0!==a.helpUrl&&(c=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(a.helpUrl),this.setHelpUrl(c));"string"===typeof a.extensions&&(console.warn(b+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+a.type+"' block."),a.extensions=[a.extensions]);void 0!==a.mutator&&(0,$.module$exports$Blockly$Extensions.apply)(a.mutator,this,!0);a=a.extensions;if(Array.isArray(a))for(b= 0;bf||f>b)throw Error('Block "'+this.type+'": Message index %'+f+" out of range.");if(c[f])throw Error('Block "'+this.type+'": Message index %'+f+" duplicated.");c[f]=!0;d++}}if(d!==b)throw Error('Block "'+this.type+'": Message does not reference all '+b+" arg(s).");}; module$exports$Blockly$Block.Block.prototype.interpolateArguments_=function(a,b,c){for(var d=[],e=0;e=this.inputList.length)throw RangeError("Input index "+a+" out of bounds.");if(b>this.inputList.length)throw RangeError("Reference input "+b+" out of bounds.");var c=this.inputList[a];this.inputList.splice(a,1);a=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;da)c=d;else{b=d;break}}return b}; 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)}; module$exports$Blockly$ConnectionDB.ConnectionDB.prototype.getNeighbours=function(a,b){function c(l){var m=e-d[l].x,n=f-d[l].y;Math.sqrt(m*m+n*n)<=b&&k.push(d[l]);return nthis.previousScale_){var c=b-this.previousScale_;c=0Object.keys(this.cachedPoints_).length&&(this.cachedPoints_=Object.create(null),this.previousScale_=0)}; module$exports$Blockly$TouchGesture.TouchGesture.prototype.getTouchPoint=function(a){return this.startWorkspace_?new module$exports$Blockly$utils$Coordinate.Coordinate(a.changedTouches?a.changedTouches[0].pageX:a.pageX,a.changedTouches?a.changedTouches[0].pageY:a.pageY):null};var module$exports$Blockly$WorkspaceAudio={},module$contents$Blockly$WorkspaceAudio_SOUND_LIMIT=100;module$exports$Blockly$WorkspaceAudio.WorkspaceAudio=function(a){this.parentWorkspace_=a;this.SOUNDS_=Object.create(null);this.lastSound_=null};module$exports$Blockly$WorkspaceAudio.WorkspaceAudio.prototype.dispose=function(){this.SOUNDS_=this.parentWorkspace_=null}; module$exports$Blockly$WorkspaceAudio.WorkspaceAudio.prototype.load=function(a,b){if(a.length){try{var c=new $.module$exports$Blockly$utils$global.globalThis.Audio}catch(h){return}for(var d,e=0;eMath.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)}}}; 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()}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.resetDragSurface=function(){if(this.useWorkspaceDragSurface_){this.isDragSurfaceActive_=!1;var a=this.workspaceDragSurface_.getSurfaceTranslation();this.workspaceDragSurface_.clearAndHide(this.svgGroup_);a="translate("+a.x+","+a.y+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",a);this.svgBubbleCanvas_.setAttribute("transform",a)}}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.setupDragSurface=function(){if(this.useWorkspaceDragSurface_&&!this.isDragSurfaceActive_){this.isDragSurfaceActive_=!0;var a=this.svgBlockCanvas_.previousSibling,b=parseInt(this.getParentSvg().getAttribute("width"),10),c=parseInt(this.getParentSvg().getAttribute("height"),10),d=(0,module$exports$Blockly$utils$svgMath.getRelativeXY)(this.getCanvas());this.workspaceDragSurface_.setContentsAndShow(this.getCanvas(),this.getBubbleCanvas(),a,b, c,this.scale);this.workspaceDragSurface_.translateSurface(d.x,d.y)}};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getBlockDragSurface=function(){return this.blockDragSurface_};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getWidth=function(){var a=this.getMetrics();return a?a.viewWidth/this.scale:0}; 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)}; 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=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); 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}; 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); 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()}; 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}; 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()}; 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})}}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getDragTarget=function(a){for(var b=0,c;c=this.dragTargetAreas_[b];b++)if(c.clientRect.contains(a.clientX,a.clientY))return c.component;return null};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.onMouseDown_=function(a){var b=this.getGesture(a);b&&b.handleWsStart(a,this)}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.startDrag=function(a,b){a=(0,module$exports$Blockly$browserEvents.mouseToSvg)(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;this.dragDeltaXY_=module$exports$Blockly$utils$Coordinate.Coordinate.difference(b,a)}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.moveDrag=function(a){a=(0,module$exports$Blockly$browserEvents.mouseToSvg)(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;return module$exports$Blockly$utils$Coordinate.Coordinate.sum(this.dragDeltaXY_,a)};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.isDragging=function(){return null!==this.currentGesture_&&this.currentGesture_.isDragging()}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.isDraggable=function(){return this.options.moveOptions&&this.options.moveOptions.drag};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.isMovable=function(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.isMovableHorizontally=function(){var a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollHorizontally())};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.isMovableVertically=function(){var a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollVertically())}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.onMouseWheel_=function(a){if(module$exports$Blockly$Gesture.Gesture.inProgress())a.preventDefault(),a.stopPropagation();else{var b=this.options.zoomOptions&&this.options.zoomOptions.wheel,c=this.options.moveOptions&&this.options.moveOptions.wheel;if(b||c){var d=(0,module$exports$Blockly$browserEvents.getScrollDeltaPixels)(a);if(module$exports$Blockly$utils$userAgent.MAC)var e=a.metaKey;b&&(a.ctrlKey||e||!c)?(d=-d.y/50,b=(0,module$exports$Blockly$browserEvents.mouseToSvg)(a, this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(b.x,b.y,d)):(b=this.scrollX-d.x,c=this.scrollY-d.y,a.shiftKey&&!d.x&&(b=this.scrollX-d.y,c=this.scrollY),this.scroll(b,c));a.preventDefault()}}}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.getBlocksBoundingBox=function(){var a=this.getTopBoundedElements();if(!a.length)return new module$exports$Blockly$utils$Rect.Rect(0,0,0,0);for(var b=a[0].getBoundingRectangle(),c=1;cb.bottom&&(b.bottom=d.bottom),d.leftb.right&&(b.right=d.right))}return b}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.cleanUp=function(){this.setResizesEnabled(!1);(0,module$exports$Blockly$Events$utils.setGroup)(!0);for(var a=this.getTopBlocks(!0),b=0,c=0,d;d=a[c];c++)if(d.isMovable()){var e=d.getRelativeToSurfaceXY();d.moveBy(-e.x,b-e.y);d.snapToGrid();b=d.getRelativeToSurfaceXY().y+d.getHeightWidth().height+this.renderer_.getConstants().MIN_BLOCK_HEIGHT}(0,module$exports$Blockly$Events$utils.setGroup)(!1);this.setResizesEnabled(!0)}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.showContextMenu=function(a){if(!this.options.readOnly&&!this.isFlyout){var b=module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.registry.getContextMenuOptions(module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(b,a);(0,$.module$exports$Blockly$ContextMenu.show)(a,b,this.RTL)}}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.updateToolbox=function(a){if(a=(0,module$exports$Blockly$utils$toolbox.convertToolboxDefToJson)(a)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if((0,module$exports$Blockly$utils$toolbox.hasCategories)(a)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=a;this.toolbox_.render(a)}else{if(!this.flyout_)throw Error("Existing toolbox has categories. Can't change mode."); this.options.languageTree=a;this.flyout_.show(a)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.");};module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.markFocused=function(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():((0,$.module$exports$Blockly$common.setMainWorkspace)(this),this.setBrowserFocus())}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.setBrowserFocus=function(){document.activeElement&&document.activeElement.blur&&document.activeElement.blur();try{this.getParentSvg().focus({preventScroll:!0})}catch(a){try{this.getParentSvg().parentNode.setActive()}catch(b){this.getParentSvg().parentNode.focus({preventScroll:!0})}}}; module$exports$Blockly$WorkspaceSvg.WorkspaceSvg.prototype.zoom=function(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,c);var d=this.scale*c;if(this.scale!==d){d>this.options.zoomOptions.maxScale?c=this.options.zoomOptions.maxScale/this.scale:dthis.options.zoomOptions.maxScale?a=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&a-b||a<-180+b||a>180-b?!0:!1}; 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)}; 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= 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()|| 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}; 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}; 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); module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.init=function(){this.parseCategoryDef_(this.toolboxItemDef_);this.parseContents_(this.toolboxItemDef_);this.createDom_();"true"===this.toolboxItemDef_.hidden&&this.hide()}; 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"}}; 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>>/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("<<>>/handdelete.cur"), auto;\n}\n\n.blocklyTreeSelected .blocklyTreeLabel {\n color: #fff;\n}\n'); (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_()}; 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_)}; 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'); (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); module$exports$Blockly$CollapsibleToolboxCategory.CollapsibleToolboxCategory.prototype.makeDefaultCssConfig_=function(){var a=module$exports$Blockly$ToolboxCategory.ToolboxCategory.prototype.makeDefaultCssConfig_.call(this);a.contents="blocklyToolboxContents";return a}; 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>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolboxDiv {\n background-color: #ddd;\n overflow-x: visible;\n overflow-y: auto;\n padding: 4px 0 4px 0;\n position: absolute;\n z-index: 70; /* so blocks go under toolbox when dragging */\n -webkit-tap-highlight-color: transparent; /* issue #1345 */\n}\n\n.blocklyToolboxContents {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxContents:focus {\n outline: none;\n}\n'); (0,module$exports$Blockly$registry.register)(module$exports$Blockly$registry.Type.TOOLBOX,module$exports$Blockly$registry.DEFAULT,module$exports$Blockly$Toolbox.Toolbox);var module$exports$Blockly$HorizontalFlyout={HorizontalFlyout:function(a){module$exports$Blockly$Flyout.Flyout.call(this,a);this.horizontalLayout=!0}};$.$jscomp.inherits(module$exports$Blockly$HorizontalFlyout.HorizontalFlyout,module$exports$Blockly$Flyout.Flyout); module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.setMetrics_=function(a){if(this.isVisible()){var b=this.workspace_.getMetricsManager(),c=b.getScrollMetrics(),d=b.getViewMetrics();b=b.getAbsoluteMetrics();"number"===typeof a.x&&(this.workspace_.scrollX=-(c.left+(c.width-d.width)*a.x));this.workspace_.translate(this.workspace_.scrollX+b.left,this.workspace_.scrollY+b.top)}};module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.getX=function(){return 0}; module$exports$Blockly$HorizontalFlyout.HorizontalFlyout.prototype.getY=function(){if(!this.isVisible())return 0;var a=this.targetWorkspace.getMetricsManager(),b=a.getAbsoluteMetrics(),c=a.getViewMetrics();a=a.getToolboxMetrics();var d=this.toolboxPosition_===module$exports$Blockly$utils$toolbox.Position.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?d?a.height:c.height-this.height_:d?0:c.height:d?0:c.height+b.top-this.height_}; 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)}}; 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, 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)}; 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()}; 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, 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}; 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)}; 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), 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}}; $.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&& !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)}; $.module$exports$Blockly$Generator.Generator.prototype.allNestedComments=function(a){var b=[];a=a.getDescendants(!0);for(var c=0;c=a&&this.sourceBlock_.outputConnection&&!b}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_();this.createTextElement_()}; $.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.doClassValidation_=function(a){return null===a||void 0===a?null:String(a)}; $.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_)))}; $.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))}; $.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, 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_))}; $.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)}; $.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))}; $.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())}; $.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= 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= 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}; $.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")}; $.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_)}; $.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)}; $.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=== 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_())}; $.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.setEditorValue_=function(a){this.isDirty_=!0;this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(a));this.setValue(a)}; $.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}; $.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}; $.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); 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())}; 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())}; 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())}; 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_}; 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}; module$exports$Blockly$FieldNumber.FieldNumber.prototype.widgetCreate_=function(){var a=$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.widgetCreate_.call(this);-Infinitythis.max_&&(0,module$exports$Blockly$utils$aria.setState)(a,module$exports$Blockly$utils$aria.State.VALUEMAX,this.max_);return a}; 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); 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}; 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()}; 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_)}; module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.getDisplayText_=function(){var a=this.getText();if(!a)return module$exports$Blockly$Field.Field.NBSP;var b=a.split("\n");a="";for(var c=this.isOverflowedY_?this.maxLines_:b.length,d=0;dthis.maxDisplayLength?e=e.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&d===c-1&&(e=e.substring(0,e.length-3)+"...");e=e.replace(/\s/g,module$exports$Blockly$Field.Field.NBSP);a+=e;d!==c-1&&(a+="\n")}this.sourceBlock_.RTL&& (a+="\u200f");return a};module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.doValueUpdate_=function(a){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.doValueUpdate_.call(this,a);this.isOverflowedY_=this.value_.split("\n").length>this.maxLines_}; module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.render_=function(){for(var a;a=this.textGroup_.firstChild;)this.textGroup_.removeChild(a);a=this.getDisplayText_().split("\n");for(var b=0,c=0;cb&&(b=e);c+=this.getConstants().FIELD_TEXT_HEIGHT+(0this.maxDisplayLength&&(a[h]=a[h].substring(0,this.maxDisplayLength));d.textContent=a[h];var k=(0,module$exports$Blockly$utils$dom.getFastTextWidth)(d,e,f,g);k>b&&(b=k)}b+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&(c+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,b+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING, this.borderRect_.setAttribute("width",b),this.borderRect_.setAttribute("height",c));this.size_.width=b;this.size_.height=c;this.positionBorderRect_()};module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.showEditor_=function(a,b){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.showEditor_.call(this,a,b);this.forceRerender()}; module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.widgetCreate_=function(){var a=(0,module$exports$Blockly$WidgetDiv.getDiv)(),b=this.workspace_.getScale(),c=document.createElement("textarea");c.className="blocklyHtmlInput blocklyHtmlTextAreaInput";c.setAttribute("spellcheck",this.spellcheck_);var d=this.getConstants().FIELD_TEXT_FONTSIZE*b+"pt";a.style.fontSize=d;c.style.fontSize=d;c.style.borderRadius=$.module$exports$Blockly$FieldTextInput.FieldTextInput.BORDERRADIUS*b+"px"; 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_(); this.bindInputEvents_(c);return c};module$exports$Blockly$FieldMultilineInput.FieldMultilineInput.prototype.setMaxLines=function(a){"number"===typeof a&&0a?0>e&&0e&&(e=0):0d-1&&fd-1&&e--:0>b?0>f&&(f=0):0Math.floor(c.length/d)-1&&(f=Math.floor(c.length/d)-1);this.setHighlightedCell_(this.picker_.childNodes[f].childNodes[e], 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})}; 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}; module$exports$Blockly$FieldColour.FieldColour.prototype.setHighlightedCell_=function(a,b){var c=this.getHighlighted_();c&&(0,module$exports$Blockly$utils$dom.removeClass)(c,"blocklyColourHighlighted");(0,module$exports$Blockly$utils$dom.addClass)(a,"blocklyColourHighlighted");this.highlightedIndex_=b;(0,module$exports$Blockly$utils$aria.setState)(this.picker_,module$exports$Blockly$utils$aria.State.ACTIVEDESCENDANT,a.getAttribute("id"))}; module$exports$Blockly$FieldColour.FieldColour.prototype.dropdownCreate_=function(){var a=this.columns_||module$exports$Blockly$FieldColour.FieldColour.COLUMNS,b=this.colours_||module$exports$Blockly$FieldColour.FieldColour.COLOURS,c=this.titles_||module$exports$Blockly$FieldColour.FieldColour.TITLES,d=this.getValue(),e=document.createElement("table");e.className="blocklyColourTable";e.tabIndex=0;e.dir="ltr";(0,module$exports$Blockly$utils$aria.setRole)(e,module$exports$Blockly$utils$aria.Role.GRID); (0,module$exports$Blockly$utils$aria.setState)(e,module$exports$Blockly$utils$aria.State.EXPANDED,!0);(0,module$exports$Blockly$utils$aria.setState)(e,module$exports$Blockly$utils$aria.State.ROWCOUNT,Math.floor(b.length/a));(0,module$exports$Blockly$utils$aria.setState)(e,module$exports$Blockly$utils$aria.State.COLCOUNT,a);for(var f,g=0;gtr>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"); (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); $.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()}; $.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)}; $.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_)}; $.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"}; $.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)}; $.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_= 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); 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), 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_)}; module$exports$Blockly$FieldAngle.FieldAngle.prototype.render_=function(){$.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.render_.call(this);this.updateGraph_()}; 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); (0,module$exports$Blockly$dropDownDiv.showPositionedByField)(this,this.dropdownDispose_.bind(this));this.updateGraph_()}; 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"}, 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, {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- (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, "mousemove",this,this.onMouseMove_,!0,!0);this.editor_=a}; 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}; module$exports$Blockly$FieldAngle.FieldAngle.prototype.hide_=function(){(0,module$exports$Blockly$dropDownDiv.hideIfOwner)(this);(0,module$exports$Blockly$WidgetDiv.hide)()}; 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:0a&&(a+=360);a>this.wrap_&&(a-=360);return a}; 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; 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"); (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}; 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= 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; 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, 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= 1.625*this.GRID_UNIT;this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT;this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT;this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0;this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING;this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=!0;this.FIELD_COLOUR_DEFAULT_WIDTH=2*this.GRID_UNIT;this.FIELD_COLOUR_DEFAULT_HEIGHT=4*this.GRID_UNIT;this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT; this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT;this.SELECTED_GLOW_COLOUR="#fff200";this.SELECTED_GLOW_SIZE=.5;this.REPLACEMENT_GLOW_COLOUR="#fff200";this.REPLACEMENT_GLOW_SIZE=2;this.selectedGlowFilterId="";this.selectedGlowFilter_=null;this.replacementGlowFilterId="";this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter_=null}};$.$jscomp.inherits(module$exports$Blockly$zelos$ConstantProvider.ConstantProvider,module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider); module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.setFontConstants_=function(a){module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.setFontConstants_.call(this,a);this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.init=function(){module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.init.call(this);this.HEXAGONAL=this.makeHexagonal();this.ROUNDED=this.makeRounded();this.SQUARED=this.makeSquared();this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.setDynamicProperties_=function(a){module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.setDynamicProperties_.call(this,a);this.SELECTED_GLOW_COLOUR=a.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;var b=Number(a.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=b&&!isNaN(b)?b:this.SELECTED_GLOW_SIZE;this.REPLACEMENT_GLOW_COLOUR=a.getComponentStyle("replacementGlowColour")|| this.REPLACEMENT_GLOW_COLOUR;this.REPLACEMENT_GLOW_SIZE=(a=Number(a.getComponentStyle("replacementGlowSize")))&&!isNaN(a)?a:this.REPLACEMENT_GLOW_SIZE};module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.dispose=function(){module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.dispose.call(this);this.selectedGlowFilter_&&(0,module$exports$Blockly$utils$dom.removeNode)(this.selectedGlowFilter_);this.replacementGlowFilter_&&(0,module$exports$Blockly$utils$dom.removeNode)(this.replacementGlowFilter_)}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.makeStartHat=function(){var a=this.START_HAT_HEIGHT,b=this.START_HAT_WIDTH,c=(0,module$exports$Blockly$utils$svgPaths.curve)("c",[(0,module$exports$Blockly$utils$svgPaths.point)(25,-a),(0,module$exports$Blockly$utils$svgPaths.point)(71,-a),(0,module$exports$Blockly$utils$svgPaths.point)(b,0)]);return{height:a,width:b,path:c}}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.makeHexagonal=function(){function a(c,d,e){var f=c/2;f=f>b?b:f;e=e?-1:1;c=(d?-1:1)*c/2;return(0,module$exports$Blockly$utils$svgPaths.lineTo)(-e*f,c)+(0,module$exports$Blockly$utils$svgPaths.lineTo)(e*f,c)}var b=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width:function(c){c/=2;return c>b?b:c},height:function(c){return c},connectionOffsetY:function(c){return c/2},connectionOffsetX:function(c){return-c}, pathDown:function(c){return a(c,!1,!1)},pathUp:function(c){return a(c,!0,!1)},pathRightDown:function(c){return a(c,!1,!0)},pathRightUp:function(c){return a(c,!1,!0)}}}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.makeRounded=function(){function a(d,e,f){var g=d>c?d-c:0;d=(d>c?c:d)/2;return(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",d,(0,module$exports$Blockly$utils$svgPaths.point)((e?-1:1)*d,(e?-1:1)*d))+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",(f?1:-1)*g)+(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",d,(0,module$exports$Blockly$utils$svgPaths.point)((e?1:-1)*d,(e?-1:1)*d))}var b=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH, c=2*b;return{type:this.SHAPES.ROUND,isDynamic:!0,width:function(d){d/=2;return d>b?b:d},height:function(d){return d},connectionOffsetY:function(d){return d/2},connectionOffsetX:function(d){return-d},pathDown:function(d){return a(d,!1,!1)},pathUp:function(d){return a(d,!0,!1)},pathRightDown:function(d){return a(d,!1,!0)},pathRightUp:function(d){return a(d,!1,!0)}}}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.makeSquared=function(){function a(c,d,e){c-=2*b;return(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",b,(0,module$exports$Blockly$utils$svgPaths.point)((d?-1:1)*b,(d?-1:1)*b))+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",(e?1:-1)*c)+(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",b,(0,module$exports$Blockly$utils$svgPaths.point)((d?1:-1)*b,(d?-1:1)*b))}var b=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE, isDynamic:!0,width:function(c){return b},height:function(c){return c},connectionOffsetY:function(c){return c/2},connectionOffsetX:function(c){return-c},pathDown:function(c){return a(c,!1,!1)},pathUp:function(c){return a(c,!0,!1)},pathRightDown:function(c){return a(c,!1,!0)},pathRightUp:function(c){return a(c,!1,!0)}}}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.shapeFor=function(a){var b=a.getCheck();!b&&a.targetConnection&&(b=a.targetConnection.getCheck());switch(a.type){case $.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE:case $.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE:a=a.getSourceBlock().getOutputShape();if(null!==a)switch(a){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}if(b&& -1!==b.indexOf("Boolean"))return this.HEXAGONAL;if(b&&-1!==b.indexOf("Number"))return this.ROUNDED;b&&b.indexOf("String");return this.ROUNDED;case $.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT:case $.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type");}}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.makeNotch=function(){function a(l){return(0,module$exports$Blockly$utils$svgPaths.curve)("c",[(0,module$exports$Blockly$utils$svgPaths.point)(l*e/2,0),(0,module$exports$Blockly$utils$svgPaths.point)(l*e*3/4,g/2),(0,module$exports$Blockly$utils$svgPaths.point)(l*e,g)])+(0,module$exports$Blockly$utils$svgPaths.line)([(0,module$exports$Blockly$utils$svgPaths.point)(l*e,f)])+(0,module$exports$Blockly$utils$svgPaths.curve)("c",[(0,module$exports$Blockly$utils$svgPaths.point)(l* e/4,g/2),(0,module$exports$Blockly$utils$svgPaths.point)(l*e/2,g),(0,module$exports$Blockly$utils$svgPaths.point)(l*e,g)])+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",l*d)+(0,module$exports$Blockly$utils$svgPaths.curve)("c",[(0,module$exports$Blockly$utils$svgPaths.point)(l*e/2,0),(0,module$exports$Blockly$utils$svgPaths.point)(l*e*3/4,-(g/2)),(0,module$exports$Blockly$utils$svgPaths.point)(l*e,-g)])+(0,module$exports$Blockly$utils$svgPaths.line)([(0,module$exports$Blockly$utils$svgPaths.point)(l* e,-f)])+(0,module$exports$Blockly$utils$svgPaths.curve)("c",[(0,module$exports$Blockly$utils$svgPaths.point)(l*e/4,-(g/2)),(0,module$exports$Blockly$utils$svgPaths.point)(l*e/2,-g),(0,module$exports$Blockly$utils$svgPaths.point)(l*e,-g)])}var b=this.NOTCH_WIDTH,c=this.NOTCH_HEIGHT,d=b/3,e=d/3,f=c/2,g=f/2,h=a(1),k=a(-1);return{type:this.SHAPES.NOTCH,width:b,height:c,pathLeft:h,pathRight:k}}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.makeInsideCorners=function(){var a=this.CORNER_RADIUS,b=(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,0",a,(0,module$exports$Blockly$utils$svgPaths.point)(-a,a)),c=(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",a,(0,module$exports$Blockly$utils$svgPaths.point)(-a,a)),d=(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,0",a,(0,module$exports$Blockly$utils$svgPaths.point)(a,a)),e=(0,module$exports$Blockly$utils$svgPaths.arc)("a", "0 0,1",a,(0,module$exports$Blockly$utils$svgPaths.point)(a,a));return{width:a,height:a,pathTop:b,pathBottom:d,rightWidth:a,rightHeight:a,pathTopRight:c,pathBottomRight:e}};module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.generateSecondaryColour_=function(a){return(0,module$exports$Blockly$utils$colour.blend)("#000",a,.15)||a}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.generateTertiaryColour_=function(a){return(0,module$exports$Blockly$utils$colour.blend)("#000",a,.25)||a}; module$exports$Blockly$zelos$ConstantProvider.ConstantProvider.prototype.createDom=function(a,b,c){module$exports$Blockly$blockRendering$ConstantProvider.ConstantProvider.prototype.createDom.call(this,a,b,c);a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.DEFS,{},a);b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%", x:"-40%"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEGAUSSIANBLUR,{"in":"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},b);c=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},b);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},c);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEFLOOD, {"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},b);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FECOMPOSITE,{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},b);this.selectedGlowFilterId=b.id;this.selectedGlowFilter_=b;a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%", x:"-40%"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEGAUSSIANBLUR,{"in":"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},a);b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FEFLOOD, {"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FECOMPOSITE,{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FECOMPOSITE,{"in":"SourceGraphic",in2:"outGlow",operator:"over"},a);this.replacementGlowFilterId=a.id;this.replacementGlowFilter_=a}; module$exports$Blockly$zelos$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:not(.blocklyDropdownRect),",a+" .blocklyEditableText>rect:not(.blocklyDropdownRect) {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","}",a+" .blocklyNonEditableText>text,",a+" .blocklyEditableText>text,", 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+ ";","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+ ")","}",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); 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); 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)}; 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)}; 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=c||0>=b)throw Error("Height and width values of an image field must be greater than 0."); 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)))}}; $.$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)||""}; $.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")}; $.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_))}; $.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)}; $.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; (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}; 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=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+ 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;gc?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)&& 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? 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}; module$exports$Blockly$zelos$RenderInfo.RenderInfo.prototype.finalizeVerticalAlignment_=function(){if(!this.outputConnection)for(var a=2;a=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|| 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.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; 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_}; 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)? this.steps_+=this.notchPaths_.pathLeft:module$exports$Blockly$blockRendering$Types.Types.isHat(c)?this.steps_+=this.startPaths_.path(this.RTL_):module$exports$Blockly$blockRendering$Types.Types.isSpacer(c)&&0!==c.width&&(this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",c.xPos+c.width-this.highlightOffset_));this.steps_+=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("H",a.xPos+a.width-this.highlightOffset_)}; module$exports$Blockly$geras$Highlighter.Highlighter.prototype.drawJaggedEdge_=function(a){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",a.height-this.jaggedTeethPaths_.height-this.highlightOffset_))}; 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_)}; 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_+= (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)}; 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- this.highlightOffset_)))}; 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_+= (0,module$exports$Blockly$utils$svgPaths.moveTo)(a.xPos,a.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}; 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_)); 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_))}; 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", 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); 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_()}; 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)}; 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)}; 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)}; 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)}; 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)}}; 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)}}; 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)}}; module$exports$Blockly$geras$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)+this.constants_.DARK_PATH_OFFSET/2,a.baseline+this.constants_.DARK_PATH_OFFSET)}};var module$exports$Blockly$geras$HighlightConstantProvider={HighlightConstantProvider:function(a){this.constantProvider=a;this.OFFSET=.5;this.START_POINT=(0,module$exports$Blockly$utils$svgPaths.moveBy)(this.OFFSET,this.OFFSET)}}; module$exports$Blockly$geras$HighlightConstantProvider.HighlightConstantProvider.prototype.init=function(){this.INSIDE_CORNER=this.makeInsideCorner();this.OUTSIDE_CORNER=this.makeOutsideCorner();this.PUZZLE_TAB=this.makePuzzleTab();this.NOTCH=this.makeNotch();this.JAGGED_TEETH=this.makeJaggedTeeth();this.START_HAT=this.makeStartHat()}; module$exports$Blockly$geras$HighlightConstantProvider.HighlightConstantProvider.prototype.makeInsideCorner=function(){var a=this.constantProvider.CORNER_RADIUS,b=this.OFFSET,c=(1-Math.SQRT1_2)*(a+b)-b,d=(0,module$exports$Blockly$utils$svgPaths.moveBy)(c,c)+(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,0",a,(0,module$exports$Blockly$utils$svgPaths.point)(-c-b,a-c)),e=(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,0",a+b,(0,module$exports$Blockly$utils$svgPaths.point)(a+b,a+b)),f= (0,module$exports$Blockly$utils$svgPaths.moveBy)(c,-c)+(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,0",a+b,(0,module$exports$Blockly$utils$svgPaths.point)(a-c,c+b));return{width:a+b,height:a,pathTop:function(g){return g?d:""},pathBottom:function(g){return g?e:f}}}; module$exports$Blockly$geras$HighlightConstantProvider.HighlightConstantProvider.prototype.makeOutsideCorner=function(){var a=this.constantProvider.CORNER_RADIUS,b=this.OFFSET,c=(1-Math.SQRT1_2)*(a-b)+b,d=(0,module$exports$Blockly$utils$svgPaths.moveBy)(c,c)+(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",a-b,(0,module$exports$Blockly$utils$svgPaths.point)(a-c,-c+b)),e=(0,module$exports$Blockly$utils$svgPaths.moveBy)(b,a)+(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",a-b,(0,module$exports$Blockly$utils$svgPaths.point)(a, -a+b)),f=-c,g=(0,module$exports$Blockly$utils$svgPaths.moveBy)(c,f)+(0,module$exports$Blockly$utils$svgPaths.arc)("a","0 0,1",a-b,(0,module$exports$Blockly$utils$svgPaths.point)(-c+b,-f-a));return{height:a,topLeft:function(h){return h?d:e},bottomLeft:function(){return g}}}; module$exports$Blockly$geras$HighlightConstantProvider.HighlightConstantProvider.prototype.makePuzzleTab=function(){var a=this.constantProvider.TAB_WIDTH,b=this.constantProvider.TAB_HEIGHT,c=(0,module$exports$Blockly$utils$svgPaths.moveBy)(-2,-b+3.4)+(0,module$exports$Blockly$utils$svgPaths.lineTo)(-.45*a,-2.1),d=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",2.5)+(0,module$exports$Blockly$utils$svgPaths.moveBy)(.97*-a,2.5)+(0,module$exports$Blockly$utils$svgPaths.curve)("q",[(0,module$exports$Blockly$utils$svgPaths.point)(.05* -a,10),(0,module$exports$Blockly$utils$svgPaths.point)(.3*a,9.5)])+(0,module$exports$Blockly$utils$svgPaths.moveBy)(.67*a,-1.9)+(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",2.5),e=(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("v",-1.5)+(0,module$exports$Blockly$utils$svgPaths.moveBy)(-.92*a,-.5)+(0,module$exports$Blockly$utils$svgPaths.curve)("q",[(0,module$exports$Blockly$utils$svgPaths.point)(-.19*a,-5.5),(0,module$exports$Blockly$utils$svgPaths.point)(0,-11)])+(0,module$exports$Blockly$utils$svgPaths.moveBy)(.92* a,1),f=(0,module$exports$Blockly$utils$svgPaths.moveBy)(-5,b-.7)+(0,module$exports$Blockly$utils$svgPaths.lineTo)(.46*a,-2.1);return{width:a,height:b,pathUp:function(g){return g?c:e},pathDown:function(g){return g?d:f}}};module$exports$Blockly$geras$HighlightConstantProvider.HighlightConstantProvider.prototype.makeNotch=function(){return{pathLeft:(0,module$exports$Blockly$utils$svgPaths.lineOnAxis)("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}; module$exports$Blockly$geras$HighlightConstantProvider.HighlightConstantProvider.prototype.makeJaggedTeeth=function(){return{pathLeft:(0,module$exports$Blockly$utils$svgPaths.lineTo)(5.1,2.6)+(0,module$exports$Blockly$utils$svgPaths.moveBy)(-10.2,6.8)+(0,module$exports$Blockly$utils$svgPaths.lineTo)(5.1,2.6),height:12,width:10.2}}; module$exports$Blockly$geras$HighlightConstantProvider.HighlightConstantProvider.prototype.makeStartHat=function(){var a=this.constantProvider.START_HAT.height,b=(0,module$exports$Blockly$utils$svgPaths.moveBy)(25,-8.7)+(0,module$exports$Blockly$utils$svgPaths.curve)("c",[(0,module$exports$Blockly$utils$svgPaths.point)(29.7,-6.2),(0,module$exports$Blockly$utils$svgPaths.point)(57.2,-.5),(0,module$exports$Blockly$utils$svgPaths.point)(75,8.7)]),c=(0,module$exports$Blockly$utils$svgPaths.curve)("c", [(0,module$exports$Blockly$utils$svgPaths.point)(17.8,-9.2),(0,module$exports$Blockly$utils$svgPaths.point)(45.3,-14.9),(0,module$exports$Blockly$utils$svgPaths.point)(75,-8.7)])+(0,module$exports$Blockly$utils$svgPaths.moveTo)(100.5,a+.5);return{path:function(d){return d?b:c}}};var module$exports$Blockly$geras$RenderInfo={RenderInfo:function(a,b){module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.call(this,a,b)}};$.$jscomp.inherits(module$exports$Blockly$geras$RenderInfo.RenderInfo,module$exports$Blockly$blockRendering$RenderInfo.RenderInfo);module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.getRenderer=function(){return this.renderer_}; module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.populateBottomRow_=function(){module$exports$Blockly$blockRendering$RenderInfo.RenderInfo.prototype.populateBottomRow_.call(this);this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1].type===$.module$exports$Blockly$inputTypes.inputTypes.STATEMENT||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}; module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.addInput_=function(a,b){this.isInline&&a.type===$.module$exports$Blockly$inputTypes.inputTypes.VALUE?(b.elements.push(new module$exports$Blockly$geras$InlineInput.InlineInput(this.constants_,a)),b.hasInlineInput=!0):a.type===$.module$exports$Blockly$inputTypes.inputTypes.STATEMENT?(b.elements.push(new module$exports$Blockly$geras$StatementInput.StatementInput(this.constants_,a)),b.hasStatement=!0):a.type===$.module$exports$Blockly$inputTypes.inputTypes.VALUE? (b.elements.push(new module$exports$Blockly$blockRendering$ExternalValueInput.ExternalValueInput(this.constants_,a)),b.hasExternalInput=!0):a.type===$.module$exports$Blockly$inputTypes.inputTypes.DUMMY&&(b.minHeight=Math.max(b.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),b.hasDummyInput=!0);this.isInline||null!==b.align||(b.align=a.align)}; module$exports$Blockly$geras$RenderInfo.RenderInfo.prototype.addElemSpacing_=function(){for(var a=!1,b=0,c;c=this.rows[b];b++)c.hasExternalInput&&(a=!0);for(b=0;c=this.rows[b];b++){var d=c.elements;c.elements=[];c.startsWithElemSpacer()&&c.elements.push(new module$exports$Blockly$blockRendering$InRowSpacer.InRowSpacer(this.constants_,this.getInRowSpacing_(null,d[0])));if(d.length){for(var e=0;eb.length?module$contents$Blockly$ContextMenuItems_deleteNext_(b,c):(0,module$exports$Blockly$dialog.confirm)($.module$exports$Blockly$Msg.Msg.DELETE_ALL_BLOCKS.replace("%1",String(b.length)),function(d){d&&module$contents$Blockly$ContextMenuItems_deleteNext_(b,c)})}},scopeType:module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.ScopeType.WORKSPACE, id:"workspaceDelete",weight:6})};var module$contents$Blockly$ContextMenuItems_registerWorkspaceOptions_=function(){(0,module$exports$Blockly$ContextMenuItems.registerUndo)();(0,module$exports$Blockly$ContextMenuItems.registerRedo)();(0,module$exports$Blockly$ContextMenuItems.registerCleanup)();(0,module$exports$Blockly$ContextMenuItems.registerCollapse)();(0,module$exports$Blockly$ContextMenuItems.registerExpand)();(0,module$exports$Blockly$ContextMenuItems.registerDeleteAll)()}; module$exports$Blockly$ContextMenuItems.registerDuplicate=function(){module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.registry.register({displayText:function(){return $.module$exports$Blockly$Msg.Msg.DUPLICATE_BLOCK},preconditionFn:function(a){a=a.block;return!a.isInFlyout&&a.isDeletable()&&a.isMovable()?a.isDuplicatable()?"enabled":"disabled":"hidden"},callback:function(a){a.block&&(0,module$exports$Blockly$clipboard.duplicate)(a.block)},scopeType:module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.ScopeType.BLOCK, id:"blockDuplicate",weight:1})}; module$exports$Blockly$ContextMenuItems.registerComment=function(){module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.registry.register({displayText:function(a){return a.block.getCommentIcon()?$.module$exports$Blockly$Msg.Msg.REMOVE_COMMENT:$.module$exports$Blockly$Msg.Msg.ADD_COMMENT},preconditionFn:function(a){a=a.block;return module$exports$Blockly$utils$userAgent.IE||a.isInFlyout||!a.workspace.options.comments||a.isCollapsed()||!a.isEditable()?"hidden":"enabled"},callback:function(a){a= a.block;a.getCommentIcon()?a.setCommentText(null):a.setCommentText("")},scopeType:module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.ScopeType.BLOCK,id:"blockComment",weight:2})}; module$exports$Blockly$ContextMenuItems.registerInline=function(){module$exports$Blockly$ContextMenuRegistry.ContextMenuRegistry.registry.register({displayText:function(a){return a.block.getInputsInline()?$.module$exports$Blockly$Msg.Msg.EXTERNAL_INPUTS:$.module$exports$Blockly$Msg.Msg.INLINE_INPUTS},preconditionFn:function(a){a=a.block;if(!a.isInFlyout&&a.isMovable()&&!a.isCollapsed())for(var b=1;ba||Math.abs(this.workspaceHeight_-d)>a)this.workspaceWidth_=c,this.workspaceHeight_=d,this.bubble_.setBubbleSize(c+ 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()}; $.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)); 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); 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_), 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_()}; $.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); 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)(); 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)}; $.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())}}; $.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); 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, {"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_())}; 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}; module$exports$Blockly$Warning.Warning.prototype.setText=function(a,b){this.text_[b]!==a&&(a?this.text_[b]=a:delete this.text_[b],this.isVisible()&&(this.setVisible(!1),this.setVisible(!0)))};module$exports$Blockly$Warning.Warning.prototype.getText=function(){var a=[],b;for(b in this.text_)a.push(this.text_[b]);return a.join("\n")};module$exports$Blockly$Warning.Warning.prototype.dispose=function(){this.block_.warning=null;module$exports$Blockly$Icon.Icon.prototype.dispose.call(this)};var module$exports$Blockly$Comment={Comment:function(a){module$exports$Blockly$Icon.Icon.call(this,a);this.model_=a.commentModel;this.model_.text=this.model_.text||"";this.cachedText_="";this.paragraphElement_=this.textarea_=this.foreignObject_=this.onInputWrapper_=this.onChangeWrapper_=this.onWheelWrapper_=this.onMouseUpWrapper_=null;this.createIcon()}};$.$jscomp.inherits(module$exports$Blockly$Comment.Comment,module$exports$Blockly$Icon.Icon); module$exports$Blockly$Comment.Comment.prototype.drawIcon_=function(a){(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CIRCLE,{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.PATH,{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"}, a);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},a)}; module$exports$Blockly$Comment.Comment.prototype.createEditor_=function(){this.foreignObject_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FOREIGNOBJECT,{x:module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH,y:module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH},null);var a=document.createElementNS(module$exports$Blockly$utils$dom.HTML_NS,"body");a.setAttribute("xmlns",module$exports$Blockly$utils$dom.HTML_NS);a.className="blocklyMinimalBody";var b=this.textarea_= document.createElementNS(module$exports$Blockly$utils$dom.HTML_NS,"textarea");b.className="blocklyCommentTextarea";b.setAttribute("dir",this.block_.RTL?"RTL":"LTR");b.value=this.model_.text;this.resizeTextarea_();a.appendChild(b);this.foreignObject_.appendChild(a);this.onMouseUpWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(b,"mouseup",this,this.startEdit_,!0,!0);this.onWheelWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(b,"wheel",this,function(c){c.stopPropagation()}); this.onChangeWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(b,"change",this,function(c){this.cachedText_!==this.model_.text&&(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.CHANGE))(this.block_,"comment",null,this.cachedText_,this.model_.text))});this.onInputWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(b,"input",this,function(c){this.model_.text=b.value});setTimeout(b.focus.bind(b), 0);return this.foreignObject_};module$exports$Blockly$Comment.Comment.prototype.updateEditable=function(){module$exports$Blockly$Icon.Icon.prototype.updateEditable.call(this);this.isVisible()&&(this.disposeBubble_(),this.createBubble_())};module$exports$Blockly$Comment.Comment.prototype.onBubbleResize_=function(){this.isVisible()&&(this.model_.size=this.bubble_.getBubbleSize(),this.resizeTextarea_())}; module$exports$Blockly$Comment.Comment.prototype.resizeTextarea_=function(){var a=this.model_.size,b=2*module$exports$Blockly$Bubble.Bubble.BORDER_WIDTH,c=a.width-b;a=a.height-b;this.foreignObject_.setAttribute("width",c);this.foreignObject_.setAttribute("height",a);this.textarea_.style.width=c-4+"px";this.textarea_.style.height=a-4+"px"}; module$exports$Blockly$Comment.Comment.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,"comment")),(this.model_.pinned=a)?this.createBubble_():this.disposeBubble_())}; module$exports$Blockly$Comment.Comment.prototype.createBubble_=function(){!this.block_.isEditable()||module$exports$Blockly$utils$userAgent.IE?this.createNonEditableBubble_():this.createEditableBubble_()}; module$exports$Blockly$Comment.Comment.prototype.createEditableBubble_=function(){this.bubble_=new module$exports$Blockly$Bubble.Bubble(this.block_.workspace,this.createEditor_(),this.block_.pathObject.svgPath,this.iconXY_,this.model_.size.width,this.model_.size.height);this.bubble_.setSvgId(this.block_.id);this.bubble_.registerResizeEvent(this.onBubbleResize_.bind(this));this.applyColour()}; module$exports$Blockly$Comment.Comment.prototype.createNonEditableBubble_=function(){this.paragraphElement_=module$exports$Blockly$Bubble.Bubble.textToDom(this.block_.getCommentText());this.bubble_=module$exports$Blockly$Bubble.Bubble.createNonEditableBubble(this.paragraphElement_,this.block_,this.iconXY_);this.applyColour()}; module$exports$Blockly$Comment.Comment.prototype.disposeBubble_=function(){this.onMouseUpWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null);this.onWheelWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onWheelWrapper_),this.onWheelWrapper_=null);this.onChangeWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onChangeWrapper_),this.onChangeWrapper_=null);this.onInputWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onInputWrapper_), this.onInputWrapper_=null);this.bubble_.dispose();this.paragraphElement_=this.foreignObject_=this.textarea_=this.bubble_=null};module$exports$Blockly$Comment.Comment.prototype.startEdit_=function(a){this.bubble_.promote()&&this.textarea_.focus();this.cachedText_=this.model_.text};module$exports$Blockly$Comment.Comment.prototype.getBubbleSize=function(){return this.model_.size}; module$exports$Blockly$Comment.Comment.prototype.setBubbleSize=function(a,b){this.bubble_?this.bubble_.setBubbleSize(a,b):(this.model_.size.width=a,this.model_.size.height=b)};module$exports$Blockly$Comment.Comment.prototype.updateText=function(){this.textarea_?this.textarea_.value=this.model_.text:this.paragraphElement_&&(this.paragraphElement_.firstChild.textContent=this.model_.text)};module$exports$Blockly$Comment.Comment.prototype.dispose=function(){this.block_.comment=null;module$exports$Blockly$Icon.Icon.prototype.dispose.call(this)}; (0,module$exports$Blockly$Css.register)("\n.blocklyCommentTextarea {\n background-color: #fef49c;\n border: 0;\n display: block;\n margin: 0;\n outline: 0;\n padding: 3px;\n resize: none;\n text-overflow: hidden;\n}\n");var module$exports$Blockly$sprite={SPRITE:{width:96,height:124,url:"sprites.png"}};var module$exports$Blockly$uiPosition={verticalPosition:{TOP:0,BOTTOM:1},horizontalPosition:{LEFT:0,RIGHT:1},bumpDirection:{UP:0,DOWN:1},getStartPositionRect:function(a,b,c,d,e,f){var g=f.scrollbar&&f.scrollbar.canScrollVertically();a.horizontal===module$exports$Blockly$uiPosition.horizontalPosition.LEFT?(c=e.absoluteMetrics.left+c,g&&f.RTL&&(c+=module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness)):(c=e.absoluteMetrics.left+e.viewMetrics.width-b.width-c,g&&!f.RTL&&(c-=module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness)); a.vertical===module$exports$Blockly$uiPosition.verticalPosition.TOP?a=e.absoluteMetrics.top+d:(a=e.absoluteMetrics.top+e.viewMetrics.height-b.height-d,f.scrollbar&&f.scrollbar.canScrollHorizontally()&&(a-=module$exports$Blockly$Scrollbar.Scrollbar.scrollbarThickness));return new module$exports$Blockly$utils$Rect.Rect(a,a+b.height,c,c+b.width)},getCornerOppositeToolbox:function(a,b){return{horizontal:b.toolboxMetrics.position===module$exports$Blockly$utils$toolbox.Position.LEFT||a.horizontalLayout&& !a.RTL?module$exports$Blockly$uiPosition.horizontalPosition.RIGHT:module$exports$Blockly$uiPosition.horizontalPosition.LEFT,vertical:b.toolboxMetrics.position===module$exports$Blockly$utils$toolbox.Position.BOTTOM?module$exports$Blockly$uiPosition.verticalPosition.TOP:module$exports$Blockly$uiPosition.verticalPosition.BOTTOM}},bumpPositionRect:function(a,b,c,d){for(var e=a.left,f=a.right-a.left,g=a.bottom-a.top,h=0;himage, .blocklyZoom>svg>image {\n opacity: .4;\n}\n\n.blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {\n opacity: .6;\n}\n\n.blocklyZoom>image:active, .blocklyZoom>svg>image:active {\n opacity: .8;\n}\n");var module$exports$Blockly$WorkspaceComment={WorkspaceComment:function(a,b,c,d,e){this.id=e&&!a.getCommentById(e)?e:(0,module$exports$Blockly$utils$idGenerator.genUid)();a.addTopComment(this);this.xy_=new module$exports$Blockly$utils$Coordinate.Coordinate(0,0);this.height_=c;this.width_=d;this.workspace=a;this.RTL=a.RTL;this.editable_=this.movable_=this.deletable_=!0;this.content_=b;this.disposed_=!1;this.isComment=!0;module$exports$Blockly$WorkspaceComment.WorkspaceComment.fireCreateEvent(this)}}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.dispose=function(){this.disposed_||((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.COMMENT_DELETE))(this)),this.workspace.removeTopComment(this),this.disposed_=!0)};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.getHeight=function(){return this.height_}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.setHeight=function(a){this.height_=a};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.getWidth=function(){return this.width_};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.setWidth=function(a){this.width_=a};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.getXY=function(){return new module$exports$Blockly$utils$Coordinate.Coordinate(this.xy_.x,this.xy_.y)}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.moveBy=function(a,b){var c=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.COMMENT_MOVE))(this);this.xy_.translate(a,b);c.recordNew();(0,module$exports$Blockly$Events$utils.fire)(c)};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.isDeletable=function(){return this.deletable_&&!(this.workspace&&this.workspace.options.readOnly)}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.setDeletable=function(a){this.deletable_=a};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.isMovable=function(){return this.movable_&&!(this.workspace&&this.workspace.options.readOnly)};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.setMovable=function(a){this.movable_=a}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.isEditable=function(){return this.editable_&&!(this.workspace&&this.workspace.options.readOnly)};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.setEditable=function(a){this.editable_=a};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.getContent=function(){return this.content_}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.setContent=function(a){this.content_!==a&&((0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.COMMENT_CHANGE))(this,this.content_,a)),this.content_=a)}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.toXmlWithXY=function(a){a=this.toXml(a);a.setAttribute("x",Math.round(this.xy_.x));a.setAttribute("y",Math.round(this.xy_.y));a.setAttribute("h",this.height_);a.setAttribute("w",this.width_);return a};module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.toXml=function(a){var b=(0,$.module$exports$Blockly$utils$xml.createElement)("comment");a||(b.id=this.id);b.textContent=this.getContent();return b}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.fireCreateEvent=function(a){if((0,module$exports$Blockly$Events$utils.isEnabled)()){var b=(0,module$exports$Blockly$Events$utils.getGroup)();b||(0,module$exports$Blockly$Events$utils.setGroup)(!0);try{(0,module$exports$Blockly$Events$utils.fire)(new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.COMMENT_CREATE))(a))}finally{b||(0,module$exports$Blockly$Events$utils.setGroup)(!1)}}}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.fromXml=function(a,b){var c=module$exports$Blockly$WorkspaceComment.WorkspaceComment.parseAttributes(a);b=new module$exports$Blockly$WorkspaceComment.WorkspaceComment(b,c.content,c.h,c.w,c.id);c=parseInt(a.getAttribute("x"),10);a=parseInt(a.getAttribute("y"),10);isNaN(c)||isNaN(a)||b.moveBy(c,a);module$exports$Blockly$WorkspaceComment.WorkspaceComment.fireCreateEvent(b);return b}; module$exports$Blockly$WorkspaceComment.WorkspaceComment.parseAttributes=function(a){var b=a.getAttribute("h"),c=a.getAttribute("w");return{id:a.getAttribute("id"),h:b?parseInt(b,10):100,w:c?parseInt(c,10):100,x:parseInt(a.getAttribute("x"),10),y:parseInt(a.getAttribute("y"),10),content:a.textContent}};var module$exports$Blockly$WorkspaceCommentSvg={},module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE=8,module$contents$Blockly$WorkspaceCommentSvg_BORDER_RADIUS=3,module$contents$Blockly$WorkspaceCommentSvg_TEXTAREA_OFFSET=2; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg=function(a,b,c,d,e){module$exports$Blockly$WorkspaceComment.WorkspaceComment.call(this,a,b,c,d,e);this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null;this.eventsInit_=!1;this.deleteIconBorder_=this.deleteGroup_=this.resizeGroup_=this.foreignObject_=this.svgHandleTarget_=this.svgRectTarget_=this.textarea_=null;this.autoLayout_=this.focused_=!1;this.svgGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G, {"class":"blocklyComment"},null);this.svgGroup_.translate_="";this.svgRect_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyCommentRect",x:0,y:0,rx:module$contents$Blockly$WorkspaceCommentSvg_BORDER_RADIUS,ry:module$contents$Blockly$WorkspaceCommentSvg_BORDER_RADIUS});this.svgGroup_.appendChild(this.svgRect_);this.rendered_=!1;this.useDragSurface_=(0,module$exports$Blockly$utils$svgMath.is3dSupported)()&&!!a.getBlockDragSurface();this.render()}; $.$jscomp.inherits(module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg,module$exports$Blockly$WorkspaceComment.WorkspaceComment); module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.dispose=function(){this.disposed_||((0,$.module$exports$Blockly$common.getSelected)()===this&&(this.unselect(),this.workspace.cancelCurrentGesture()),(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.COMMENT_DELETE))(this)),(0,module$exports$Blockly$utils$dom.removeNode)(this.svgGroup_),this.disposeInternal_(), (0,module$exports$Blockly$Events$utils.disable)(),module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.dispose.call(this),(0,module$exports$Blockly$Events$utils.enable)())}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.initSvg=function(a){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");this.workspace.options.readOnly||this.eventsInit_||((0,module$exports$Blockly$browserEvents.conditionalBind)(this.svgRectTarget_,"mousedown",this,this.pathMouseDown_),(0,module$exports$Blockly$browserEvents.conditionalBind)(this.svgHandleTarget_,"mousedown",this,this.pathMouseDown_));this.eventsInit_=!0;this.updateMovable();this.getSvgRoot().parentNode|| this.workspace.getBubbleCanvas().appendChild(this.getSvgRoot());!a&&this.textarea_&&this.textarea_.select()};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.pathMouseDown_=function(a){var b=this.workspace.getGesture(a);b&&b.handleBubbleStart(a,this)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.showContextMenu=function(a){if(!this.workspace.options.readOnly){var b=[];this.isDeletable()&&this.isMovable()&&(b.push((0,$.module$exports$Blockly$ContextMenu.commentDuplicateOption)(this)),b.push((0,$.module$exports$Blockly$ContextMenu.commentDeleteOption)(this)));(0,$.module$exports$Blockly$ContextMenu.show)(a,b,this.RTL)}}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.select=function(){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, this.id,this.workspace.id);(0,module$exports$Blockly$Events$utils.fire)(a);(0,$.module$exports$Blockly$common.setSelected)(this);this.addSelect()}}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.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);(0,module$exports$Blockly$Events$utils.fire)(a);(0,$.module$exports$Blockly$common.setSelected)(null);this.removeSelect();this.blurFocus()}}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.addSelect=function(){(0,module$exports$Blockly$utils$dom.addClass)(this.svgGroup_,"blocklySelected");this.setFocus()};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.removeSelect=function(){(0,module$exports$Blockly$utils$dom.removeClass)(this.svgGroup_,"blocklySelected");this.blurFocus()}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.addFocus=function(){(0,module$exports$Blockly$utils$dom.addClass)(this.svgGroup_,"blocklyFocused")};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.removeFocus=function(){(0,module$exports$Blockly$utils$dom.removeClass)(this.svgGroup_,"blocklyFocused")}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.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.getBubbleCanvas()&& d!==c)}return this.xy_=new module$exports$Blockly$utils$Coordinate.Coordinate(a,b)};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.moveBy=function(a,b){var c=new ((0,module$exports$Blockly$Events$utils.get)(module$exports$Blockly$Events$utils.COMMENT_MOVE))(this),d=this.getRelativeToSurfaceXY();this.translate(d.x+a,d.y+b);this.xy_=new module$exports$Blockly$utils$Coordinate.Coordinate(d.x+a,d.y+b);c.recordNew();(0,module$exports$Blockly$Events$utils.fire)(c);this.workspace.resizeContents()}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.translate=function(a,b){this.xy_=new module$exports$Blockly$utils$Coordinate.Coordinate(a,b);this.getSvgRoot().setAttribute("transform","translate("+a+","+b+")")};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.moveToDragSurface=function(){if(this.useDragSurface_){var a=this.getRelativeToSurfaceXY();this.clearTransformAttributes_();this.workspace.getBlockDragSurface().translateSurface(a.x,a.y);this.workspace.getBlockDragSurface().setBlocksAndShow(this.getSvgRoot())}}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.moveDuringDrag=function(a,b){a?a.translateSurface(b.x,b.y):(this.svgGroup_.translate_="translate("+b.x+","+b.y+")",this.svgGroup_.setAttribute("transform",this.svgGroup_.translate_+this.svgGroup_.skew_))};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.moveTo=function(a,b){this.translate(a,b)};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.clearTransformAttributes_=function(){this.getSvgRoot().removeAttribute("transform")}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.getBoundingRectangle=function(){var a=this.getRelativeToSurfaceXY(),b=this.getHeightWidth(),c=a.y,d=a.y+b.height;if(this.RTL){var e=a.x-b.width;a=a.x}else e=a.x,a=a.x+b.width;return new module$exports$Blockly$utils$Rect.Rect(c,d,e,a)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.updateMovable=function(){this.isMovable()?(0,module$exports$Blockly$utils$dom.addClass)(this.svgGroup_,"blocklyDraggable"):(0,module$exports$Blockly$utils$dom.removeClass)(this.svgGroup_,"blocklyDraggable")};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.setMovable=function(a){module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.setMovable.call(this,a);this.updateMovable()}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.setEditable=function(a){module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.setEditable.call(this,a);this.textarea_&&(this.textarea_.readOnly=!a)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.setDragging=function(a){a?(a=this.getSvgRoot(),a.translate_="",a.skew_="",(0,module$exports$Blockly$utils$dom.addClass)(this.svgGroup_,"blocklyDragging")):(0,module$exports$Blockly$utils$dom.removeClass)(this.svgGroup_,"blocklyDragging")};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.getSvgRoot=function(){return this.svgGroup_}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.getContent=function(){return this.textarea_?this.textarea_.value:this.content_};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.setContent=function(a){module$exports$Blockly$WorkspaceComment.WorkspaceComment.prototype.setContent.call(this,a);this.textarea_&&(this.textarea_.value=a)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.setDeleteStyle=function(a){a?(0,module$exports$Blockly$utils$dom.addClass)(this.svgGroup_,"blocklyDraggingDelete"):(0,module$exports$Blockly$utils$dom.removeClass)(this.svgGroup_,"blocklyDraggingDelete")};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.setAutoLayout=function(a){}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.toXmlWithXY=function(a){var b;this.workspace.RTL&&(b=this.workspace.getWidth());a=this.toXml(a);var c=this.getRelativeToSurfaceXY();a.setAttribute("x",Math.round(this.workspace.RTL?b-c.x:c.x));a.setAttribute("y",Math.round(c.y));a.setAttribute("h",this.getHeight());a.setAttribute("w",this.getWidth());return a}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.toCopyData=function(){return{saveInfo:this.toXmlWithXY(),source:this.workspace,typeCounts:null}};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.getHeightWidth=function(){return{width:this.getWidth(),height:this.getHeight()}}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.render=function(){if(!this.rendered_){var a=this.getHeightWidth();this.createEditor_();this.svgGroup_.appendChild(this.foreignObject_);this.svgHandleTarget_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyCommentHandleTarget",x:0,y:0});this.svgGroup_.appendChild(this.svgHandleTarget_);this.svgRectTarget_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT, {"class":"blocklyCommentTarget",x:0,y:0,rx:module$contents$Blockly$WorkspaceCommentSvg_BORDER_RADIUS,ry:module$contents$Blockly$WorkspaceCommentSvg_BORDER_RADIUS});this.svgGroup_.appendChild(this.svgRectTarget_);this.addResizeDom_();this.isDeletable()&&this.addDeleteDom_();this.setSize_(a.width,a.height);this.textarea_.value=this.content_;this.rendered_=!0;this.resizeGroup_&&(0,module$exports$Blockly$browserEvents.conditionalBind)(this.resizeGroup_,"mousedown",this,this.resizeMouseDown_);this.isDeletable()&& ((0,module$exports$Blockly$browserEvents.conditionalBind)(this.deleteGroup_,"mousedown",this,this.deleteMouseDown_),(0,module$exports$Blockly$browserEvents.conditionalBind)(this.deleteGroup_,"mouseout",this,this.deleteMouseOut_),(0,module$exports$Blockly$browserEvents.conditionalBind)(this.deleteGroup_,"mouseup",this,this.deleteMouseUp_))}}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.createEditor_=function(){this.foreignObject_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.FOREIGNOBJECT,{x:0,y:module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.TOP_OFFSET,"class":"blocklyCommentForeignObject"},null);var a=document.createElementNS(module$exports$Blockly$utils$dom.HTML_NS,"body");a.setAttribute("xmlns",module$exports$Blockly$utils$dom.HTML_NS);a.className= "blocklyMinimalBody";var b=document.createElementNS(module$exports$Blockly$utils$dom.HTML_NS,"textarea");b.className="blocklyCommentTextarea";b.setAttribute("dir",this.RTL?"RTL":"LTR");b.readOnly=!this.isEditable();a.appendChild(b);this.textarea_=b;this.foreignObject_.appendChild(a);(0,module$exports$Blockly$browserEvents.conditionalBind)(b,"wheel",this,function(c){c.stopPropagation()});(0,module$exports$Blockly$browserEvents.conditionalBind)(b,"change",this,function(c){this.setContent(b.value)}); return this.foreignObject_}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.addResizeDom_=function(){this.resizeGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{"class":this.RTL?"blocklyResizeSW":"blocklyResizeSE"},this.svgGroup_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.POLYGON,{points:"0,x x,x x,0".replace(/x/g,module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE.toString())},this.resizeGroup_); (0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.LINE,{"class":"blocklyResizeLine",x1:module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE/3,y1:module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE-1,x2:module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE-1,y2:module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE/3},this.resizeGroup_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.LINE,{"class":"blocklyResizeLine", x1:2*module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE/3,y1:module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE-1,x2:module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE-1,y2:2*module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE/3},this.resizeGroup_)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.addDeleteDom_=function(){this.deleteGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{"class":"blocklyCommentDeleteIcon"},this.svgGroup_);this.deleteIconBorder_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CIRCLE,{"class":"blocklyDeleteIconShape",r:"7",cx:"7.5",cy:"7.5"},this.deleteGroup_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.LINE, {x1:"5",y1:"10",x2:"10",y2:"5",stroke:"#fff","stroke-width":"2"},this.deleteGroup_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.LINE,{x1:"5",y1:"5",x2:"10",y2:"10",stroke:"#fff","stroke-width":"2"},this.deleteGroup_)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.resizeMouseDown_=function(a){this.unbindDragEvents_();(0,module$exports$Blockly$browserEvents.isRightButton)(a)||(this.workspace.startDrag(a,new module$exports$Blockly$utils$Coordinate.Coordinate(this.workspace.RTL?-this.width_:this.width_,this.height_)),this.onMouseUpWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(document,"mouseup",this,this.resizeMouseUp_),this.onMouseMoveWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(document, "mousemove",this,this.resizeMouseMove_),this.workspace.hideChaff());a.stopPropagation()};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.deleteMouseDown_=function(a){(0,module$exports$Blockly$utils$dom.addClass)(this.deleteIconBorder_,"blocklyDeleteIconHighlighted");a.stopPropagation()};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.deleteMouseOut_=function(a){(0,module$exports$Blockly$utils$dom.removeClass)(this.deleteIconBorder_,"blocklyDeleteIconHighlighted")}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.deleteMouseUp_=function(a){this.dispose();a.stopPropagation()};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.unbindDragEvents_=function(){this.onMouseUpWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null);this.onMouseMoveWrapper_&&((0,module$exports$Blockly$browserEvents.unbind)(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.resizeMouseUp_=function(a){(0,module$exports$Blockly$Touch.clearTouchIdentifier)();this.unbindDragEvents_()};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.resizeMouseMove_=function(a){this.autoLayout_=!1;a=this.workspace.moveDrag(a);this.setSize_(this.RTL?-a.x:a.x,a.y)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.resizeComment_=function(){var a=this.getHeightWidth(),b=module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.TOP_OFFSET,c=2*module$contents$Blockly$WorkspaceCommentSvg_TEXTAREA_OFFSET;this.foreignObject_.setAttribute("width",a.width);this.foreignObject_.setAttribute("height",a.height-b);this.RTL&&this.foreignObject_.setAttribute("x",-a.width);this.textarea_.style.width=a.width-c+"px";this.textarea_.style.height=a.height- c-b+"px"}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.setSize_=function(a,b){a=Math.max(a,45);b=Math.max(b,20+module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.TOP_OFFSET);this.width_=a;this.height_=b;this.svgRect_.setAttribute("width",a);this.svgRect_.setAttribute("height",b);this.svgRectTarget_.setAttribute("width",a);this.svgRectTarget_.setAttribute("height",b);this.svgHandleTarget_.setAttribute("width",a);this.svgHandleTarget_.setAttribute("height",module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.TOP_OFFSET);this.RTL&& (this.svgRect_.setAttribute("transform","scale(-1 1)"),this.svgRectTarget_.setAttribute("transform","scale(-1 1)"));this.resizeGroup_&&(this.RTL?(this.resizeGroup_.setAttribute("transform","translate("+(-a+module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE)+","+(b-module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE)+") scale(-1 1)"),this.deleteGroup_.setAttribute("transform","translate("+(-a+module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE)+","+-module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE+ ") scale(-1 1)")):(this.resizeGroup_.setAttribute("transform","translate("+(a-module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE)+","+(b-module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE)+")"),this.deleteGroup_.setAttribute("transform","translate("+(a-module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE)+","+-module$contents$Blockly$WorkspaceCommentSvg_RESIZE_SIZE+")")));this.resizeComment_()}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.disposeInternal_=function(){this.svgHandleTarget_=this.svgRectTarget_=this.foreignObject_=this.textarea_=null;this.disposed_=!0}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.setFocus=function(){var a=this;this.focused_=!0;setTimeout(function(){a.disposed_||(a.textarea_.focus(),a.addFocus(),(0,module$exports$Blockly$utils$dom.addClass)(a.svgRectTarget_,"blocklyCommentTargetFocused"),(0,module$exports$Blockly$utils$dom.addClass)(a.svgHandleTarget_,"blocklyCommentHandleTargetFocused"))},0)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.prototype.blurFocus=function(){var a=this;this.focused_=!1;setTimeout(function(){a.disposed_||(a.textarea_.blur(),a.removeFocus(),(0,module$exports$Blockly$utils$dom.removeClass)(a.svgRectTarget_,"blocklyCommentTargetFocused"),(0,module$exports$Blockly$utils$dom.removeClass)(a.svgHandleTarget_,"blocklyCommentHandleTargetFocused"))},0)}; module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.fromXmlRendered=function(a,b,c){(0,module$exports$Blockly$Events$utils.disable)();try{var d=module$exports$Blockly$WorkspaceComment.WorkspaceComment.parseAttributes(a);var e=new module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg(b,d.content,d.h,d.w,d.id);b.rendered&&(e.initSvg(!0),e.render());if(!isNaN(d.x)&&!isNaN(d.y))if(b.RTL){var f=c||b.getWidth();e.moveBy(f-d.x,d.y)}else e.moveBy(d.x,d.y)}finally{(0,module$exports$Blockly$Events$utils.enable)()}module$exports$Blockly$WorkspaceComment.WorkspaceComment.fireCreateEvent(e); return e};module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.DEFAULT_SIZE=100;module$exports$Blockly$WorkspaceCommentSvg.WorkspaceCommentSvg.TOP_OFFSET=10;(0,module$exports$Blockly$Css.register)("\n.blocklyCommentForeignObject {\n position: relative;\n z-index: 0;\n}\n\n.blocklyCommentRect {\n fill: #E7DE8E;\n stroke: #bcA903;\n stroke-width: 1px;\n}\n\n.blocklyCommentTarget {\n fill: transparent;\n stroke: #bcA903;\n}\n\n.blocklyCommentTargetFocused {\n fill: none;\n}\n\n.blocklyCommentHandleTarget {\n fill: none;\n}\n\n.blocklyCommentHandleTargetFocused {\n fill: transparent;\n}\n\n.blocklyFocused>.blocklyCommentRect {\n fill: #B9B272;\n stroke: #B9B272;\n}\n\n.blocklySelected>.blocklyCommentTarget {\n stroke: #fc3;\n stroke-width: 3px;\n}\n\n.blocklyCommentDeleteIcon {\n cursor: pointer;\n fill: #000;\n display: none;\n}\n\n.blocklySelected > .blocklyCommentDeleteIcon {\n display: block;\n}\n\n.blocklyDeleteIconShape {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n}\n\n.blocklyDeleteIconShape.blocklyDeleteIconHighlighted {\n stroke: #fc3;\n}\n");var module$exports$Blockly$Trashcan={Trashcan:function(a){module$exports$Blockly$DeleteArea.DeleteArea.call(this);this.workspace_=a;this.id="trashcan";this.contents_=[];this.flyout=null;0>=this.workspace_.options.maxTrashcanContents||(this.isLidOpen=!1,this.minOpenness_=0,this.svgLid_=this.svgGroup_=null,this.top_=this.left_=this.lidOpen_=this.lidTask_=0,this.initialized_=!1,a=new module$exports$Blockly$Options.Options({scrollbars:!0,parentWorkspace:this.workspace_,rtl:this.workspace_.RTL,oneBasedIndex:this.workspace_.options.oneBasedIndex, renderer:this.workspace_.options.renderer,rendererOverrides:this.workspace_.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace_.horizontalLayout?(a.toolboxPosition=this.workspace_.toolboxPosition===module$exports$Blockly$utils$toolbox.Position.TOP?module$exports$Blockly$utils$toolbox.Position.BOTTOM:module$exports$Blockly$utils$toolbox.Position.TOP,this.flyout=new ((0,module$exports$Blockly$registry.getClassFromOptions)(module$exports$Blockly$registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX, this.workspace_.options,!0))(a)):(a.toolboxPosition=this.workspace_.toolboxPosition===module$exports$Blockly$utils$toolbox.Position.RIGHT?module$exports$Blockly$utils$toolbox.Position.LEFT:module$exports$Blockly$utils$toolbox.Position.RIGHT,this.flyout=new ((0,module$exports$Blockly$registry.getClassFromOptions)(module$exports$Blockly$registry.Type.FLYOUTS_VERTICAL_TOOLBOX,this.workspace_.options,!0))(a)),this.workspace_.addChangeListener(this.onDelete_.bind(this)))}}; $.$jscomp.inherits(module$exports$Blockly$Trashcan.Trashcan,module$exports$Blockly$DeleteArea.DeleteArea); module$exports$Blockly$Trashcan.Trashcan.prototype.createDom=function(){this.svgGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CLIPPATH,{id:"blocklyTrashBodyClipPath"+a},this.svgGroup_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT, {width:module$contents$Blockly$Trashcan_WIDTH,height:module$contents$Blockly$Trashcan_BODY_HEIGHT,y:module$contents$Blockly$Trashcan_LID_HEIGHT},b);var c=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.IMAGE,{width:module$exports$Blockly$sprite.SPRITE.width,x:-module$contents$Blockly$Trashcan_SPRITE_LEFT,height:module$exports$Blockly$sprite.SPRITE.height,y:-module$contents$Blockly$Trashcan_SPRITE_TOP,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.svgGroup_); c.setAttributeNS(module$exports$Blockly$utils$dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+module$exports$Blockly$sprite.SPRITE.url);b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.CLIPPATH,{id:"blocklyTrashLidClipPath"+a},this.svgGroup_);(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{width:module$contents$Blockly$Trashcan_WIDTH,height:module$contents$Blockly$Trashcan_LID_HEIGHT},b);this.svgLid_= (0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.IMAGE,{width:module$exports$Blockly$sprite.SPRITE.width,x:-module$contents$Blockly$Trashcan_SPRITE_LEFT,height:module$exports$Blockly$sprite.SPRITE.height,y:-module$contents$Blockly$Trashcan_SPRITE_TOP,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.svgGroup_);this.svgLid_.setAttributeNS(module$exports$Blockly$utils$dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+module$exports$Blockly$sprite.SPRITE.url); (0,module$exports$Blockly$browserEvents.bind)(this.svgGroup_,"mousedown",this,this.blockMouseDownWhenOpenable_);(0,module$exports$Blockly$browserEvents.bind)(this.svgGroup_,"mouseup",this,this.click);(0,module$exports$Blockly$browserEvents.bind)(c,"mouseover",this,this.mouseOver_);(0,module$exports$Blockly$browserEvents.bind)(c,"mouseout",this,this.mouseOut_);this.animateLid_();return this.svgGroup_}; module$exports$Blockly$Trashcan.Trashcan.prototype.init=function(){0this.minOpenness_&&1>this.lidOpen_&&(this.lidTask_=setTimeout(this.animateLid_.bind(this),module$contents$Blockly$Trashcan_ANIMATION_LENGTH/a))}; module$exports$Blockly$Trashcan.Trashcan.prototype.setLidAngle_=function(a){var b=this.workspace_.toolboxPosition===module$exports$Blockly$utils$toolbox.Position.RIGHT||this.workspace_.horizontalLayout&&this.workspace_.RTL;this.svgLid_.setAttribute("transform","rotate("+(b?-a:a)+","+(b?4:module$contents$Blockly$Trashcan_WIDTH-4)+","+(module$contents$Blockly$Trashcan_LID_HEIGHT-2)+")")}; 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()}; 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()}; module$exports$Blockly$Trashcan.Trashcan.prototype.mouseOver_=function(){this.hasContents_()&&this.setLidOpen(!0)};module$exports$Blockly$Trashcan.Trashcan.prototype.mouseOut_=function(){this.setLidOpen(!1)}; 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)}}; 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)}; 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, 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}}; module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.createDom=function(){var a=this.isLabel_?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass_&&(a+=" "+this.cssClass_);this.svgGroup_=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.G,{"class":a},this.workspace_.getCanvas());var b;this.isLabel_||(b=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1, y:1},this.svgGroup_));a=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.RECT,{"class":this.isLabel_?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:4,ry:4},this.svgGroup_);var c=(0,module$exports$Blockly$utils$dom.createSvgElement)(module$exports$Blockly$utils$Svg.Svg.TEXT,{"class":this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_),d=(0,module$exports$Blockly$utils$parsing.replaceMessageReferences)(this.text_); this.workspace_.RTL&&(d+="\u200f");c.textContent=d;this.isLabel_&&(this.svgText_=c,this.workspace_.getThemeManager().subscribe(this.svgText_,"flyoutForegroundColour","fill"));var e=(0,module$exports$Blockly$utils$style.getComputedStyle)(c,"fontSize"),f=(0,module$exports$Blockly$utils$style.getComputedStyle)(c,"fontWeight"),g=(0,module$exports$Blockly$utils$style.getComputedStyle)(c,"fontFamily");this.width=(0,module$exports$Blockly$utils$dom.getFastTextWidthWithSizeString)(c,e,f,g);d=(0,module$exports$Blockly$utils$dom.measureFontMetrics)(d, e,f,g);this.height=d.height;this.isLabel_||(this.width+=2*module$exports$Blockly$FlyoutButton.FlyoutButton.TEXT_MARGIN_X,this.height+=2*module$exports$Blockly$FlyoutButton.FlyoutButton.TEXT_MARGIN_Y,b.setAttribute("width",this.width),b.setAttribute("height",this.height));a.setAttribute("width",this.width);a.setAttribute("height",this.height);c.setAttribute("x",this.width/2);c.setAttribute("y",this.height/2-d.height/2+d.baseline);this.updateTransform_();this.onMouseUpWrapper_=(0,module$exports$Blockly$browserEvents.conditionalBind)(this.svgGroup_, "mouseup",this,this.onMouseUp_);return this.svgGroup_};module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.show=function(){this.updateTransform_();this.svgGroup_.setAttribute("display","block")};module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.updateTransform_=function(){this.svgGroup_.setAttribute("transform","translate("+this.position_.x+","+this.position_.y+")")}; module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.moveTo=function(a,b){this.position_.x=a;this.position_.y=b;this.updateTransform_()};module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.isLabel=function(){return this.isLabel_};module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.getPosition=function(){return this.position_};module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.getButtonText=function(){return this.text_}; module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_};module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&(0,module$exports$Blockly$browserEvents.unbind)(this.onMouseUpWrapper_);this.svgGroup_&&(0,module$exports$Blockly$utils$dom.removeNode)(this.svgGroup_);this.svgText_&&this.workspace_.getThemeManager().unsubscribe(this.svgText_)}; module$exports$Blockly$FlyoutButton.FlyoutButton.prototype.onMouseUp_=function(a){(a=this.targetWorkspace_.getGesture(a))&&a.cancel();this.isLabel_&&this.callbackKey_?console.warn("Labels should not have callbacks. Label text: "+this.text_):this.isLabel_||this.callbackKey_&&this.targetWorkspace_.getButtonCallback(this.callbackKey_)?this.isLabel_||this.targetWorkspace_.getButtonCallback(this.callbackKey_)(this):console.warn("Buttons should have callbacks. Button text: "+this.text_)}; module$exports$Blockly$FlyoutButton.FlyoutButton.TEXT_MARGIN_X=5;module$exports$Blockly$FlyoutButton.FlyoutButton.TEXT_MARGIN_Y=2;(0,module$exports$Blockly$Css.register)("\n.blocklyFlyoutButton {\n fill: #888;\n cursor: default;\n}\n\n.blocklyFlyoutButtonShadow {\n fill: #666;\n}\n\n.blocklyFlyoutButton:hover {\n fill: #aaa;\n}\n\n.blocklyFlyoutLabel {\n cursor: default;\n}\n\n.blocklyFlyoutLabelBackground {\n opacity: 0;\n}\n");var module$exports$Blockly$BlocklyOptions={BlocklyOptions:function(){}};var module$exports$Blockly$VariablesDynamic={CATEGORY_NAME:"VARIABLE_DYNAMIC",onCreateVariableButtonClick_String:function(a){(0,$.module$exports$Blockly$Variables.createVariableButtonHandler)(a.getTargetWorkspace(),void 0,"String")},onCreateVariableButtonClick_Number:function(a){(0,$.module$exports$Blockly$Variables.createVariableButtonHandler)(a.getTargetWorkspace(),void 0,"Number")},onCreateVariableButtonClick_Colour:function(a){(0,$.module$exports$Blockly$Variables.createVariableButtonHandler)(a.getTargetWorkspace(), void 0,"Colour")},flyoutCategory:function(a){var b=[],c=document.createElement("button");c.setAttribute("text",$.module$exports$Blockly$Msg.Msg.NEW_STRING_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_STRING");b.push(c);c=document.createElement("button");c.setAttribute("text",$.module$exports$Blockly$Msg.Msg.NEW_NUMBER_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER");b.push(c);c=document.createElement("button");c.setAttribute("text",$.module$exports$Blockly$Msg.Msg.NEW_COLOUR_VARIABLE); c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR");b.push(c);a.registerButtonCallback("CREATE_VARIABLE_STRING",module$exports$Blockly$VariablesDynamic.onCreateVariableButtonClick_String);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",module$exports$Blockly$VariablesDynamic.onCreateVariableButtonClick_Number);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",module$exports$Blockly$VariablesDynamic.onCreateVariableButtonClick_Colour);a=(0,module$exports$Blockly$VariablesDynamic.flyoutCategoryBlocks)(a); return b=b.concat(a)},flyoutCategoryBlocks:function(a){a=a.getAllVariables();var b=[];if(0