diff --git a/catroid/src/main/assets/catblocks/CatBlocks.js b/catroid/src/main/assets/catblocks/CatBlocks.js index 9cf2e5c171a..7700bdd42c0 100644 --- a/catroid/src/main/assets/catblocks/CatBlocks.js +++ b/catroid/src/main/assets/catblocks/CatBlocks.js @@ -1,2 +1,2 @@ /*! For license information please see CatBlocks.js.LICENSE.txt */ -var CatBlocks;(()=>{var __webpack_modules__={7983:(t,e,o)=>{"use strict";o.r(e),o.d(e,{CatBlocks:()=>Z}),o(3948),o(8674),o(7852),o(3157),o(4916),o(5306);var n=o(3595),i=o.n(n),r=o(9755),s=o.n(r);o(5577),o(8702),o(4723),o(7207),o(2023);const l=JSON.parse('{"af":{"DROPDOWN_NAME":"Afrikaans"},"ar":{"DROPDOWN_NAME":"Arabic"},"az":{"DROPDOWN_NAME":"Azeri (Latin)"},"bg":{"DROPDOWN_NAME":"Bulgarian"},"bn":{"DROPDOWN_NAME":"bn"},"bs":{"DROPDOWN_NAME":"bs"},"ca":{"DROPDOWN_NAME":"Catalan"},"chr":{"DROPDOWN_NAME":"chr"},"cs":{"DROPDOWN_NAME":"Czech"},"da":{"DROPDOWN_NAME":"Danish"},"de":{"DROPDOWN_NAME":"German"},"el":{"DROPDOWN_NAME":"Greek"},"en":{"DROPDOWN_NAME":"English"},"en_AU":{"DROPDOWN_NAME":"English (Australia)"},"en_CA":{"DROPDOWN_NAME":"English (Canada)"},"en_GB":{"DROPDOWN_NAME":"English (United Kingdom)"},"es":{"DROPDOWN_NAME":"Spanish"},"eu_ES":{"DROPDOWN_NAME":"Basque (Spain)"},"fa":{"DROPDOWN_NAME":"Farsi"},"fa_IR":{"DROPDOWN_NAME":"Farsi (Iran)"},"fi":{"DROPDOWN_NAME":"Finnish"},"fr":{"DROPDOWN_NAME":"French"},"gl":{"DROPDOWN_NAME":"Galician"},"gu":{"DROPDOWN_NAME":"Gujarati"},"ha":{"DROPDOWN_NAME":"ha"},"hi":{"DROPDOWN_NAME":"Hindi"},"hr":{"DROPDOWN_NAME":"Croatian"},"hu":{"DROPDOWN_NAME":"Hungarian"},"ig":{"DROPDOWN_NAME":"ig"},"in":{"DROPDOWN_NAME":"in"},"it":{"DROPDOWN_NAME":"Italian"},"iw":{"DROPDOWN_NAME":"iw"},"ja":{"DROPDOWN_NAME":"Japanese"},"ka":{"DROPDOWN_NAME":"Georgian"},"kab":{"DROPDOWN_NAME":"kab"},"kk":{"DROPDOWN_NAME":"Kazakh"},"kn":{"DROPDOWN_NAME":"Kannada"},"ko":{"DROPDOWN_NAME":"Korean"},"lt":{"DROPDOWN_NAME":"Lithuanian"},"mk":{"DROPDOWN_NAME":"FYRO Macedonian"},"ml":{"DROPDOWN_NAME":"ml"},"ml_IN":{"DROPDOWN_NAME":"Malayalam"},"ms":{"DROPDOWN_NAME":"Malay"},"nl":{"DROPDOWN_NAME":"Dutch"},"no":{"DROPDOWN_NAME":"no"},"pa_IN":{"DROPDOWN_NAME":"Punjabi (India)"},"pl":{"DROPDOWN_NAME":"Polish"},"ps":{"DROPDOWN_NAME":"Pashto"},"pt":{"DROPDOWN_NAME":"Portuguese"},"pt_BR":{"DROPDOWN_NAME":"Portuguese (Brazil)"},"ro":{"DROPDOWN_NAME":"Romanian"},"ru":{"DROPDOWN_NAME":"Russian"},"sd":{"DROPDOWN_NAME":"sd"},"si":{"DROPDOWN_NAME":"si"},"sk":{"DROPDOWN_NAME":"Slovak"},"sl":{"DROPDOWN_NAME":"Slovenian"},"sq":{"DROPDOWN_NAME":"Albanian"},"sr":{"DROPDOWN_NAME":"sr"},"sr_CS":{"DROPDOWN_NAME":"Serbian (Latin)"},"sr_SP":{"DROPDOWN_NAME":"Serbian (Cyrillic) (Serbia and Montenegro)"},"sv":{"DROPDOWN_NAME":"Swedish"},"sw":{"DROPDOWN_NAME":"Swahili"},"ta":{"DROPDOWN_NAME":"Tamil"},"te":{"DROPDOWN_NAME":"Telugu"},"th":{"DROPDOWN_NAME":"Thai"},"tl":{"DROPDOWN_NAME":"Tagalog"},"tr":{"DROPDOWN_NAME":"Turkish"},"tw":{"DROPDOWN_NAME":"tw"},"uk":{"DROPDOWN_NAME":"Ukrainian"},"ur":{"DROPDOWN_NAME":"Urdu"},"uz":{"DROPDOWN_NAME":"Uzbek (Latin)"},"vi":{"DROPDOWN_NAME":"Vietnamese"},"zh_CN":{"DROPDOWN_NAME":"Chinese (S)"},"zh_TW":{"DROPDOWN_NAME":"Chinese (T)"}}');function a(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class c{static getLocales(){return l}static hasLocale(t){return Object.keys(c.getLocales()).includes(t)}static async setLocale(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!c.hasLocale(t)){const o=t.substring(0,t.indexOf("_"));return t!==o?c.setLocale(o,e):(console.log("Fallback to default language and ignoring unrecognized locale: "+t),c.setLocale(c.fallbackLocale,e))}1===Object.keys(c.getLocales()[t]).length?(await c.loadNewLocale(t,e),c.currentLocale=t,i().setLocale(c.getLocales()[t])):(c.currentLocale=t,i().setLocale(c.getLocales()[t]))}static reloadCurrentLocale(){return c.setLocale(c.currentLocale)}static getCurrentLocale(){return c.currentLocale}static getCurrentLocaleValues(){return c.getLocales()[c.getCurrentLocale()]}static async loadNewLocale(t,e){let o=[],n=window.location.origin+"/i18n/"+t+".json";null!=e&&(n=e+t+".json"),window.CatBlocks&&window.CatBlocks.config&&window.CatBlocks.config.i18n&&(n=window.CatBlocks.config.i18n+t+".json"),o=await s().getJSON(n);for(const e in o)if(Object.hasOwnProperty.call(o,e)&&"DROPDOWN_NAME"!==e){const n=o[e];c.getLocales()[t][e]=n}}}a(c,"msgs",{}),a(c,"currentLocale","en"),a(c,"fallbackLocale","en");class u{constructor(){this.value="",this.operator="",this.left=null,this.right=null,this.mid=null}setLeft(t){null===this.left?this.left=t:this.left.setLeft(t)}setRight(t){null===this.right?this.right=t:this.right.setRight(t)}setMid(t){null===this.mid?this.mid=t:this.mid.setMid(t)}static getAllLayouts(){return{BRACKET:"(%l%r)",USER_LIST:"*%v*",STRING:"'%v'",USER_VARIABLE:'"%v"',SIN:"%v(%l)",COS:"%v(%l)",TAN:"%v(%l)",LN:"%v(%l)",LOG:"%v(%l)",ABS:"%v(%l)",ROUND:"%v(%l)",ARCSIN:"%v(%l)",ARCCOS:"%v(%l)",ARCTAN:"%v(%l)",FLOOR:"%v(%l)",CEIL:"%v(%l)",EXP:"%v(%l)",SQRT:"%v(%l)",MULTI_FINGER_X:"%v(%l)",MULTI_FINGER_Y:"%v(%l)",MULTI_FINGER_TOUCHED:"%v(%l)",TEXT_BLOCK_X:"%v(%l)",TEXT_BLOCK_Y:"%v(%l)",TEXT_BLOCK_SIZE:"%v(%l)",TEXT_BLOCK_LANGUAGE_FROM_CAMERA:"%v(%l)",ARDUINOANALOG:"%v(%l)",ARDUINODIGITAL:"%v(%l)",ARCTAN2:"%v(%l, %r)",POWER:"%v(%l, %r)",RASPIDIGITAL:"%v(%l)",MOD:"%v(%l, %r)",RAND:"%v(%l, %r)",MAX:"%v(%l, %r)",MIN:"%v(%l, %r)",IF_THEN_ELSE:"%v(%l,%r,%m)",LENGTH:"%v(%l)",LETTER:"%v(%l, %r)",JOIN:"%v(%l, %r)",JOIN3:"%v(%l,%r,%m)",FLATTEN:"%v(%l)",INDEX_OF_ITEM:"%v(%l, %r)",INDEX_CURRENT_TOUCH:"%v(%l)",COLOR_AT_XY:"%v(%l, %r)",COLOR_TOUCHES_COLOR:"%v(%l, %r)",COLOR_EQUALS_COLOR:"%v(%l, %r)",COLLIDES_WITH_COLOR:"%v(%l)",REGEX:"%v(%l, %r)",CONTAINS:"%v(%l, %r)",NUMBER_OF_ITEMS:"%v(%l)",LIST_ITEM:"%v(%l, %r)",DEFAULT:"%l %v %r"}}static getOpLayout(t){if(t){const e=u.getAllLayouts()[t];if(e)return e}return u.getAllLayouts().DEFAULT}static packValue(t,e,o){if(["%v","%l","%r","%m"].includes(e)){if(o.length>0){const n=o.replace(/(\.[0-9]*[1-9])0+$|\.0*$/,"$1");return t.replace(e,`${n}`)}return t.replace(e,"")}return t}static packLayout(t,e,o,n,i){let r=u.getOpLayout(t);return r=u.packValue(r,"%v",e),r=u.packValue(r,"%l",o),r=u.packValue(r,"%r",n),r=u.packValue(r,"%m",i),r}static stringify(t){const e=t.left?u.stringify(t.left):"",o=t.right?u.stringify(t.right):"",n=t.mid?u.stringify(t.mid):"";return u.packLayout(t.operator,t.value,e,o,n)}}class p{constructor(t){this.name=t,this.objectList=[]}}class h{constructor(t){this.name=t,this.lookList=[],this.soundList=[],this.scriptList=[],this.userBricks=null}}class d{constructor(t,e){this.name=t,this.fileName=e}}class _{constructor(t,e,o,n,i){this.name=t,this.brickList=[],this.posX=o,this.posY=n,this.id=e,this.commentedOut=i,this.formValues=new Map}}class g{constructor(t,e){this.name=t,e&&(this.id=e),this.loopOrIfBrickList=[],this.elseBrickList=[],this.formValues=new Map,this.colorVariation=0,this.userBrickId=void 0,this.commentedOut=!1,this.endBrickList=[]}}class f{constructor(t){this.id=t,this.inputTypes=[],this.msg=""}getArgs(t){const e=[];for(let o=0;o1&&void 0!==arguments[1]&&arguments[1];e&&console.log(t)};function k(t){const e=t.getElementsByTagName("catrobatLanguageVersion");return void 0===e||e.length<1?(console.warn("Unsupported program version found, please upgrade programm to newer version via reupload."),!1):!(e[0].innerHTML1&&void 0!==arguments[1]?arguments[1]:y;const o=t.getAttribute("reference");return o?e.evaluate(o,t,null,XPathResult.ANY_TYPE,null).iterateNext():t}function C(t){return(t||"").replace(/[&]/,"")}function O(t){v(t);const e=C(t.getElementsByTagName("name")[0].childNodes[0].nodeValue),o=new p(e),n=t.getElementsByTagName("objectList")[0].children;for(let t=0;t0&&void 0!==o[0]&&(e=o[0].textContent)}let i=n[t].getAttribute("fileName");if(null==i){const e=n[t].getElementsByTagName("fileName");e.length>0&&void 0!==e[0]&&(i=e[0].textContent)}const r=new d(e,i);o.lookList.push(r)}for(let t=0;t0&&void 0!==o[0]&&(e=o[0].textContent)}let n=i[t].getAttribute("fileName");if(null==n){const e=i[t].getElementsByTagName("fileName");e.length>0&&void 0!==e[0]&&(n=e[0].textContent)}const r=new d(e,n);o.soundList.push(r)}for(let t=0;t0&&(r=i[0].innerHTML);let s=!1;const l=t.getElementsByTagName("commentedOut");l.length>0&&(s="true"==l[0].innerHTML);const a=new _(e,r,o,n,s),c=t.getElementsByTagName("brickList")[0].children;for(let e=0;e5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=n;"RepeatBrick"===o?(r="LoopEndBrick",s=null):"IfLogicBeginBrick"===o?(r="IfLogicEndBrick",s="IfLogicElseBrick"):"IfThenLogicBeginBrick"===o&&(r="IfThenLogicEndBrick",s="IfThenLogicElseBrick"),a&&e.brickList.push(A(t[c]));let u,p=0;0!=++i&&(p=i-1),c++,u=null===l?e.brickList[p]:l;let h=0,d=null;for(;t[c].attributes[0].value!==r;){if(t[c].attributes[0].value===s&&null!==s){c++;break}"IfLogicBeginBrick"===t[c].attributes[0].value?(u.loopOrIfBrickList.push(A(t[c])),h=u.loopOrIfBrickList.length-1,d=u.loopOrIfBrickList[h],c=D(t,e,"IfLogicBeginBrick",c,i,d)+1):"IfThenLogicBeginBrick"===t[c].attributes[0].value?(u.loopOrIfBrickList.push(A(t[c])),h=u.loopOrIfBrickList.length-1,d=u.loopOrIfBrickList[h],c=D(t,e,"IfThenLogicBeginBrick",c,i,d)+1):"RepeatBrick"===t[c].attributes[0].value?(u.loopOrIfBrickList.push(A(t[c])),h=u.loopOrIfBrickList.length-1,d=u.loopOrIfBrickList[h],c=D(t,e,"RepeatBrick",c,i,d)+1):(u.loopOrIfBrickList.push(A(t[c])),c++)}if(null!==s)for(;t[c].attributes[0].value!==r;)"IfLogicBeginBrick"===t[c].attributes[0].value?(u.elseBrickList.push(A(t[c])),h=u.elseBrickList.length-1,d=u.elseBrickList[h],c=D(t,e,"IfLogicBeginBrick",c,i,d)+1):"IfThenLogicBeginBrick"===t[c].attributes[0].value?(u.elseBrickList.push(A(t[c])),h=u.elseBrickList.length-1,d=u.elseBrickList[h],c=D(t,e,"IfThenLogicBeginBrick",c,i,d)+1):"RepeatBrick"===t[c].attributes[0].value?(u.elseBrickList.push(A(t[c])),h=u.elseBrickList.length-1,d=u.elseBrickList[h],c=D(t,e,"RepeatBrick",c,i,d)+1):(u.elseBrickList.push(A(t[c])),c++);return c}function A(t){v(t);const e=(t.getAttribute("type")||"emptyBlockName").match(/[a-zA-Z0-9]+/)[0];let o=null;const n=t.getElementsByTagName("brickId");n&&n.length>=1&&(o=n[0].innerHTML,o&&(o=o.trim()));const i=new g(e,o);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:"";if(void 0===t)return e;const o=E[t];return o||e},w=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return void 0===t||void 0===t.nodeValue?e:t.nodeValue};function M(t,e){switch(t.nodeName){case"broadcastMessage":case"spriteToBounceOffName":case"receivedMessage":case"sceneToStart":case"tone":case"eye":case"sceneForTransition":case"sensorSpinnerPosition":e.formValues.set("DROPDOWN",w(t.childNodes[0]));break;case"pointedObject":{const o=t.getAttribute("name");e.formValues.set("DROPDOWN",o);break}case"objectToClone":null!=t.children[0]&&t.children[0].children[0]?e.formValues.set("SPINNER",t.children[0].children[0].attributes.name.value):e.formValues.set("SPINNER",w(t.childNodes[0]));break;case"spinnerSelectionFRONT":"true"==w(t.childNodes[0])?e.formValues.set("SPINNER",x("CAMCHOOSESPINNER_1")):e.formValues.set("SPINNER",x("CAMCHOOSESPINNER_0"));break;case"spinnerSelectionON":"true"==w(t.childNodes[0])?e.formValues.set("SPINNER",x("CAMSPINNER_1")):e.formValues.set("SPINNER",x("CAMSPINNER_0"));break;case"ledStatus":case"soundName":case"motor":e.formValues.set("DROPDOWN",x(t.childNodes[0].nodeValue));break;case"eventValue":{const o=w(t.childNodes[0]);"RaspiInterruptScript"===t.parentElement.getAttribute("type")?"pressed"===o?e.formValues.set("eventValue",x("RASPI_PRESSED")):"released"===o&&e.formValues.set("eventValue",x("RASPI_RELEASED")):e.formValues.set("eventValue",w(o));break}case"pin":e.formValues.set("pin",w(t.childNodes[0]));break;case"spinnerSelectionID":{const o=t.parentElement.getAttribute("type"),n=w(t.childNodes[0]);"CameraBrick"===o?e.formValues.set("SPINNER",x(`CAMSPINNER_${n}`,n)):"ReadVariableFromFileBrick"===o?e.formValues.set("SPINNER",x(`READ_VARIABLE_${n}`,n)):e.formValues.set("SPINNER",x(`FLASHSPINNER_${n}`,n));break}case"fadeSpinnerSelectionId":{const o=t.parentElement.getAttribute("type"),n=w(t.childNodes[0]);"FadeParticleEffectBrick"===o?e.formValues.set("brick_fade_particle_effect_spinner",x(`FADESPINNER_${n}`,n)):"ParticleEffectAdditivityBrick"===o&&e.formValues.set("brick_additive_particle_effect_spinner",x(`PARTICLESPINNER_${n}`,n));break}case"type":{const o=w(t.childNodes[0]);e.formValues.set("DROPDOWN",x(`GRAVITY_${o}`,o));break}case"spinnerSelection":{const o=w(t.childNodes[0]);if("GoToBrick"===t.parentElement.getAttribute("type")){if("80"===o)e.formValues.set("SPINNER",x("GO_TO_TOUCH_POSITION",o));else if("81"===o)e.formValues.set("SPINNER",x("GO_TO_RANDOM_POSITION",o));else if("82"===o){const o=t.parentElement.childNodes;for(let t=0;t{for(let r=0;r0&&(void 0!==e[r].userBrickId?U(s,e[r].brickList.reverse(),P.userBrickList,n):U(s,e[r].brickList.reverse(),P.brickList,n)),void 0!==e[r].elseBrickList&&e[r].elseBrickList.length>0&&U(s,e[r].elseBrickList.reverse(),P.elseBrickList,n),void 0!==e[r].loopOrIfBrickList&&e[r].loopOrIfBrickList.length>0&&U(s,e[r].loopOrIfBrickList.reverse(),P.loopOrIfBrickList,n)}},H=(t,e,o,n)=>{let r;if(r=e.id?n.newBlock(e.name,e.id):n.newBlock(e.name),void 0!==e.formValues&&void 0!==e.formValues.size&&e.formValues.size>0&&e.formValues.forEach((function(t,e){for(let o=0;o0){const o=r.inputList[t].fieldRow[e-1].getValue();o&&o.length{W(o)}))}return r.initSvg(),"UserDefinedScript"===r.type&&r.setDeletable(!1),r.pathObject&&r.pathObject.svgRoot&&("EmptyScript"==e.name?i().utils.dom.addClass(r.pathObject.svgRoot,"catblockls-blockly-invisible"):e.commentedOut&&i().utils.dom.addClass(r.pathObject.svgRoot,"catblocks-blockly-disabled")),o===P.brickList||o===P.userBrickList?t.nextConnection.connect(r.previousConnection):o===P.elseBrickList?t.inputList[3].connection.connect(r.previousConnection):o!==P.loopOrIfBrickList&&o!=P.userBrickDefinition||(o==P.userBrickDefinition&&(r.setMovable(!1),r.setDeletable(!1)),t.inputList[1].connection.connect(r.previousConnection)),r},G=t=>{const e=[];if(!t.userBricks)return e;for(let o=0;o{if(t.length>=i().Tooltip.LIMIT){s()("#formulaPopupClose").text(c.getCurrentLocaleValues().CLOSE);const e=t.replaceAll("\n","
");s()("#formulaPopupContent").html(e),s()("#formulaPopup").modal("show")}};class V{constructor(){this.config={},this.workspace=void 0,this.all_blocks=new Map,this.scene=null,this.object=null}async init(t){var e,o;this.config=(e=t,o=F,Object.assign({},o,e)),this.createModifiableWorkspace(),s()("body").append('\n '),s()("body").append('\n '),window.CatBlocks&&this.insertRightMediaURI(),this.config.rtl&&(document.documentElement.style.direction="rtl"),await c.setLocale(this.config.language,this.config.i18n);const n={displayText:c.getCurrentLocaleValues().SWITCH_TO_1D,preconditionFn:function(t){const e=t.block;return e&&e.type&&e.type.endsWith("_UDB_CATBLOCKS_DEF")?"hidden":"enabled"},callback:function(t){if(t&&t.block&&t.block.id)try{Android.switchTo1D(t.block.id)}finally{}},scopeType:i().ContextMenuRegistry.ScopeType.BLOCK,id:"catblocks-switch-to-1d",weight:-5};i().ContextMenuRegistry.registry.register(n),i().ContextMenuRegistry.registry.unregister("collapseWorkspace"),i().ContextMenuRegistry.registry.unregister("blockCollapseExpand");const r=this;i().ContextMenuRegistry.registry.getItem("blockDuplicate").callback=function(t){const e=Android.duplicateBrick(t.block.id),o=Android.getCurrentProject(),n=$.convertObjectToJSON(o,r.scene,r.object).scriptList.filter((t=>t.id.toLowerCase()==e.toLowerCase()));if(n&&n.length){const o=r.workspace;r.domToSvgModifiable(n[0],o);const i=t.block.getRelativeToSurfaceXY(),s=o.getBlockById(e);if(s){const o=i.x+t.block.width,n=i.y;s.moveBy(o,n),Android.updateScriptPosition(e,o,n)}}},i().ContextMenuRegistry.registry.getItem("blockDuplicate").preconditionFn=function(t){const e=t.block;return e.type&&e.type.endsWith("_UDB_CATBLOCKS_DEF")||"UserDefinedScript"===e.type?"hidden":!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"}}createModifiableWorkspace(){let t=`${this.config.shareRoot}${this.config.media}`;(this.config.media.startsWith("http")||this.config.media.startsWith("/"))&&(t=this.config.media),this.workspace=i().inject(this.config.container,{readOnly:!1,media:t,zoom:{controls:!1,wheel:!1,pinch:!0,startScale:this.config.renderSize},move:{scrollbars:!0,drag:!0,wheel:!1},collapse:!1,renderer:"zelos",rtl:this.config.rtl,sounds:!1}),i().svgResize(this.workspace)}renderObjectScripts(t){if(!this.workspace)throw Error("Workspace not initialized. Did you call init?");const e=G(t);e&&e.forEach((t=>{this.fixBrickMediaURI(t)}));for(let e=0;et.id==n.id));if(i&&(i.setMovable(!0),void 0!==n.posX&&void 0!==n.posY&&(0!=n.posX||0!=n.posY))){const t=i.getRelativeToSurfaceXY();i.moveBy(Math.round(n.posX-t.x),Math.round(n.posY-t.y))}}this.scrollToFocusBrick(),this.workspace.addChangeListener((t=>{if(t.type!=i().Events.BLOCK_DRAG||t.isStart)t.type==i().Events.DELETE&&Android.removeBricks(t.ids);else{const e=this.workspace.getBlockById(t.blockId),o=void 0!==e.hat,n=e.getRelativeToSurfaceXY();if(o)Android.updateScriptPosition(t.blockId,n.x,n.y);else{const o=[];for(let e=0;e0){const e=t.getParent().inputList.filter((t=>3==t.type));for(let o=0;o{const o=[];o.push(t),U(null,o,P.noBrickList,e),e.render(!1);let n=0;const i=e.getAllBlocks();i.forEach((t=>{const e=t.getSvgRoot().getBBox().width;e>n&&(n=e)})),e.RTL&&((t,e,o)=>{t.svgGroup_.querySelectorAll(".blocklyText").forEach((t=>{const o=parseFloat(t.getAttribute("x"))*e.scale,n=t.getBoundingClientRect().width/e.scale+o;t.setAttribute("x",n.toString())}));const n=o;let i=0;null!==t.nextConnection&&(i=t.nextConnection.y-t.nextConnection.offsetInBlock_.y),t.moveBy(n,i)})(i[0],e,n)})(t,this.workspace),this.workspace.getAllBlocks().forEach((t=>{if(!(t.id in this.all_blocks)){const e=[];try{t.inputList[0].fieldRow.forEach((t=>{e.push(t.value_)}))}catch(t){console.log("Cannot load input of block!")}this.all_blocks[t.id]=e}})),!0}catch(t){console.error(t.message),console.error("Failed to generate SVG from workspace, properly due to unknown bricks")}return!1}removeEmptyScriptBricks(){try{const t=Android.removeEmptyScriptBricks(),e=JSON.parse(t);if(e)for(let t=0;tt.id.toLowerCase()==e));if(n&&n.length){this.domToSvgModifiable(n[0],this.workspace);const o=this.workspace.getBlockById(e);if(o){const e=this.workspace.getMetrics(),n=new(i().utils.Coordinate)(e.viewLeft,e.viewTop).scale(1/this.workspace.scale);o.setMovable(!0),o.moveBy(n.x,n.y);const r=new(i().utils.Coordinate)(e.viewWidth,e.viewHeight).scale(1/this.workspace.scale);o.moveBy(r.x/2,r.y/2);const s=o.getRelativeToSurfaceXY();Android.updateScriptPosition(t[0].brickId,s.x,s.y)}}}insertRightMediaURI(){if(this.config.media)for(const t in i().Bricks)this.fixBrickMediaURI(t)}fixBrickMediaURI(t){if(Object.prototype.hasOwnProperty.call(i().Bricks,t)){const e=i().Bricks[t];for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("args")){const o=e[t];for(const t of o)t.src&&(t.src=t.src.replace(`${document.location.pathname}media/`,this.config.media))}}}getBrickAtTopOfScreen(){const t=this.workspace.getAllBlocks(!0),e=this.workspace.getMetrics(),o=new(i().utils.Coordinate)(e.viewLeft,e.viewTop).scale(1/this.workspace.scale);for(const e in t)if(t[e].getRelativeToSurfaceXY().y>=o.y){if(t[e].type.endsWith("_UDB_CATBLOCKS_DEF"))continue;return t[e].id}return""}}const Y={arduino:{RaspiSendDigitalValueBrick:{message0:"%{BKY_RASPI_SENDDIGITALVALUE}",args0:[{type:"field_input",name:"RASPI_DIGITAL_PIN_NUMBER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"RASPI_DIGITAL_PIN_NUMBER_INFO"},{type:"field_input",name:"RASPI_DIGITAL_PIN_VALUE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"RASPI_DIGITAL_PIN_VALUE_INFO"}]},RaspiPwmBrick:{message0:"%{BKY_RASPI_PWM}",args0:[{type:"field_input",name:"RASPI_DIGITAL_PIN_NUMBER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"RASPI_DIGITAL_PIN_NUMBER_INFO"},{type:"field_input",name:"RASPI_PWM_PERCENTAGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"RASPI_PWM_PERCENTAGE_INFO"},{type:"field_input",name:"RASPI_PWM_FREQUENCY",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"RASPI_PWM_FREQUENCY_INFO"}]},ArduinoSendDigitalValueBrick:{message0:"%{BKY_ARDUINO_SENDDIGITALVALUE}",args0:[{type:"field_input",name:"ARDUINO_DIGITAL_PIN_NUMBER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ARDUINO_DIGITAL_PIN_NUMBER_INFO"},{type:"field_input",name:"ARDUINO_DIGITAL_PIN_VALUE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ARDUINO_DIGITAL_PIN_VALUE_INFO"}]},ArduinoSendPWMValueBrick:{message0:"%{BKY_ARDUINO_SENDPWMALVALUE}",args0:[{type:"field_input",name:"ARDUINO_ANALOG_PIN_NUMBER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ARDUINO_ANALOG_PIN_NUMBER_INFO"},{type:"field_input",name:"ARDUINO_ANALOG_PIN_VALUE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ARDUINO_ANALOG_PIN_VALUE_INFO"}]}},control:{ForeverBrick:{message0:"%{BKY_CONTROL_FOREVER}",message1:"%1",message2:"%1",lastDummyAlign2:"RIGHT",args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_image",src:`${document.location.pathname}media/repeat.svg`,height:24,width:24,alt:"*",flip_rtl:!0}]},WaitBrick:{message0:"%{BKY_CONTROL_WAIT}",args0:[{type:"field_input",name:"TIME_TO_WAIT_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"TIME_TO_WAIT_IN_SECONDS_CATBLOCKS_INFO"}]},NoteBrick:{message0:"%{BKY_CONTROL_NOTE}",args0:[{type:"field_input",name:"NOTE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"NOTE_INFO"}]},IfLogicBeginBrick:{type:"IfThenLogicBeginBrick",message0:"%{BKY_CONTROL_IFISTRUEELSEIF}",message1:"%1",message2:"%{BKY_CONTROL_IFISTRUEELSEELSE}",message3:"%1",args0:[{type:"field_input",name:"IF_CONDITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"IF_CONDITION_INFO"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args3:[{type:"input_statement",name:"SUBSTACK2"}]},IfThenLogicBeginBrick:{type:"IfLogicBeginBrick",message0:"%{BKY_CONTROL_IFISTRUEELSEIF}",message1:"%1",args0:[{type:"field_input",name:"IF_CONDITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"IF_CONDITION_INFO"}],args1:[{type:"input_statement",name:"SUBSTACK"}]},WaitUntilBrick:{message0:"%{BKY_CONTROL_WAITUNTILTRUE}",args0:[{type:"field_input",name:"IF_CONDITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"IF_CONDITION_INFO"}]},RepeatBrick:{message0:"%{BKY_CONTROL_REPEATTIMES}",message1:"%1",message2:"%1",lastDummyAlign2:"RIGHT",args0:[{type:"field_input",name:"TIMES_TO_REPEAT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"TIMES_TO_REPEAT_INFO"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_image",src:`${document.location.pathname}media/repeat.svg`,height:24,width:24,alt:"*",flip_rtl:!0}]},RepeatUntilBrick:{message0:"%{BKY_CONTROL_REPEATUNTILISTRUE}",message1:"%1",message2:"%1",lastDummyAlign2:"RIGHT",args0:[{type:"field_input",name:"REPEAT_UNTIL_CONDITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"REPEAT_UNTIL_CONDITION_INFO"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_image",src:`${document.location.pathname}media/repeat.svg`,height:24,width:24,alt:"*",flip_rtl:!0}]},SceneTransitionBrick:{message0:"%{BKY_CONTROL_CONTINUESCENE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},SceneStartBrick:{message0:"%{BKY_CONTROL_STARTSCENE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},StopScriptBrick:{message0:"%{BKY_CONTROL_STOPCAT}",args0:[{type:"field_input",name:"SPINNER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SPINNER_INFO"}]},CloneBrick:{message0:"%{BKY_CONTROL_CREATECLONEOFCAT}",args0:[{type:"field_input",name:"SPINNER",text:"%{BKY_CONTROL_OFYOURSELF}"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},DeleteThisCloneBrick:{message0:"%{BKY_CONTROL_DELETETHISCLONE}"},WaitTillIdleBrick:{message0:"%{BKY_ASSERTION_WAIT_TILL_IDLE}"},ExitStageBrick:{message0:"%{BKY_CONTROL_EXIT_STAGE}"},ForVariableFromToBrick:{message0:"%{BKY_CONTROL_FOR_VARIABLE_FROM_TO}",message1:"%1",message2:"%1",lastDummyAlign2:"RIGHT",args0:[{type:"field_input",name:"FOR_LOOP_FROM",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"FOR_LOOP_FROM_INFO"},{type:"field_input",name:"FOR_LOOP_TO",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"FOR_LOOP_TO_INFO"},{type:"field_input",name:"DROPDOWN",text:"new..."},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_image",src:`${document.location.pathname}media/repeat.svg`,height:24,width:24,alt:"*",flip_rtl:!0}]},ForItemInUserListBrick:{message0:"%{BKY_CONTROL_FOR_VARIABLE_IN_USER_LIST}",message1:"%1",message2:"%1",lastDummyAlign2:"RIGHT",args0:[{type:"field_input",name:"FOR_ITEM_IN_USERLIST_LIST",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"FOR_ITEM_IN_USERLIST_LIST_INFO"},{type:"field_input",name:"FOR_ITEM_IN_USERLIST_VARIABLE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"FOR_ITEM_IN_USERLIST_VARIABLE_INFO"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_image",src:`${document.location.pathname}media/repeat.svg`,height:24,width:24,alt:"*",flip_rtl:!0}]},BroadcastBrick:{message0:"%{BKY_EVENT_BROADCAST_CB}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},BroadcastWaitBrick:{message0:"%{BKY_EVENT_BROADCASTANDWAIT_CB}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},RaspiIfLogicBeginBrick:{type:"IfThenLogicBeginBrick",message0:"%{BKY_RASPI_IFLOGICBEGINIF}",message1:"%1",message2:"%{BKY_RASPI_IFLOGICBEGINELSE}",message3:"%1",message4:"%{BKY_CONTROL_IFENDIF}",args0:[{type:"field_input",name:"IF_CONDITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"IF_CONDITION_INFO"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args3:[{type:"input_statement",name:"SUBSTACK2"}]},PhiroIfLogicBeginBrick:{type:"IfThenLogicBeginBrick",message0:"%{BKY_PHIRO_IFLOGICBEGINIF}",message1:"%1",message2:"%{BKY_PHIRO_IFLOGICBEGINELSE}",message3:"%1",message4:"%{BKY_CONTROL_IFENDIF}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args3:[{type:"input_statement",name:"SUBSTACK2"}]}},device:{WhenNfcBrick:{message0:"%{BKY_EVENT_WHENNFC}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},SetNfcTagBrick:{message0:"%{BKY_CONTROL_SETNFCTAG}",args0:[{type:"field_input",name:"NFC_NDEF_MESSAGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"NFC_NDEF_MESSAGE_INFO"},{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},TapAtBrick:{message0:"%{BKY_ASSERTION_TAP_AT}",args0:[{type:"field_input",name:"X_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_POSITION_INFO"},{type:"field_input",name:"Y_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_POSITION_INFO"}]},TapForBrick:{message0:"%{BKY_ASSERTION_TAP_FOR}",args0:[{type:"field_input",name:"X_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_POSITION_INFO"},{type:"field_input",name:"Y_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_POSITION_INFO"},{type:"field_input",name:"DURATION_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DURATION_IN_SECONDS_INFO"}]},ResetTimerBrick:{message0:"%{BKY_DEVICE_RESET_TIMER}"},TouchAndSlideBrick:{message0:"%{BKY_CONTROL_TOUCH_AND_SLIDE}",args0:[{type:"field_input",name:"X_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_POSITION_INFO"},{type:"field_input",name:"Y_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_POSITION_INFO"},{type:"field_input",name:"X_POSITION_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_POSITION_CHANGE_INFO"},{type:"field_input",name:"Y_POSITION_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_POSITION_CHANGE_INFO"},{type:"field_input",name:"DURATION_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DURATION_IN_SECONDS_INFO"}]},OpenUrlBrick:{message0:"%{BKY_CONTROL_OPEN_URL}",args0:[{type:"field_input",name:"OPEN_URL",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"OPEN_URL_INFO"}]}},dummy:{EmptyScript:{message0:" "}},embroidery:{StitchBrick:{message0:"%{BKY_STITCH}"},RunningStitchBrick:{message0:"%{BKY_STITCH_RUNNING}",args0:[{type:"field_input",name:"EMBROIDERY_LENGTH",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"EMBROIDERY_LENGTH_INFO"}]},ZigZagStitchBrick:{message0:"%{BKY_STITCH_ZIGZAG}",args0:[{type:"field_input",name:"ZIGZAG_EMBROIDERY_LENGTH",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ZIGZAG_EMBROIDERY_LENGTH_INFO"},{type:"field_input",name:"ZIGZAG_EMBROIDERY_WIDTH",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ZIGZAG_EMBROIDERY_WIDTH_INFO"}]},TripleStitchBrick:{message0:"%{BKY_STITCH_TRIPLE}",args0:[{type:"field_input",name:"EMBROIDERY_LENGTH",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"EMBROIDERY_LENGTH_INFO"}]},StopRunningStitchBrick:{message0:"%{BKY_STITCH_STOP}"},SewUpBrick:{message0:"%{BKY_EMBRIODERY_SEW_UP}"},WriteEmbroideryToFileBrick:{message0:"%{BKY_DATA_WRITE_EMBROIDERY_TO_FILE}",args0:[{type:"field_input",name:"WRITE_FILENAME",text:"%{BKY_DATA_WRITE_EMBROIDERY_TO_FILE_DEFAULT}"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"WRITE_FILENAME_INFO"}]},SetThreadColorBrick:{message0:"%{BKY_EMBRIODERY_SET_THREAD_COLOR}",args0:[{type:"field_input",name:"THREAD_COLOR",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"THREAD_COLOR_INFO"}]}},event:{StartScript:{message0:"%{BKY_EVENT_WHENSCENESTARTS}"},WhenScript:{message0:"%{BKY_EVENT_WHENTAPPED}"},WhenTouchDownScript:{message0:"%{BKY_EVENT_WHENSTAGEISTAPPED}"},WhenClonedScript:{message0:"%{BKY_CONTROL_WHENYOUSTARTASACLONE}"},BroadcastScript:{message0:"%{BKY_EVENT_WHENYOURECEIVE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},WhenConditionScript:{message0:"%{BKY_EVENT_WHENBECOMESTRUE}",args0:[{type:"field_input",name:"IF_CONDITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"IF_CONDITION_INFO"}]},WhenBackgroundChangesScript:{message0:"%{BKY_EVENT_WHENBACKGROUNDCHANGES}",args0:[{type:"field_input",name:"look",text:"new..."},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"look_INFO"}]},RaspiInterruptScript:{message0:"%{BKY_EVENT_RASPI_INTERRUPT_SCRIPT}",args0:[{type:"field_input",name:"pin",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"pin_INFO"},{type:"field_input",name:"eventValue",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"eventValue_INFO"}]}},lego:{LegoEv3MotorTurnAngleBrick:{message0:"%{BKY_LEGOEV3_MOTORTURNANGLE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"LEGO_EV3_DEGREES",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LEGO_EV3_DEGREES_INFO"}]},LegoEv3MotorMoveBrick:{message0:"%{BKY_LEGOEV3_MOTORMOVE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"LEGO_EV3_SPEED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LEGO_EV3_SPEED_INFO"}]},LegoEv3MotorStopBrick:{message0:"%{BKY_LEGOEV3_MOTORSTOP}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},LegoEv3PlayToneBrick:{message0:"%{BKY_LEGOEV3_PLAYTONE}",args0:[{type:"field_input",name:"LEGO_EV3_DURATION_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LEGO_EV3_DURATION_IN_SECONDS_INFO"},{type:"field_input",name:"LEGO_EV3_FREQUENCY",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LEGO_EV3_FREQUENCY_INFO"},{type:"field_input",name:"LEGO_EV3_VOLUME",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LEGO_EV3_VOLUME_INFO"}]},LegoEv3SetLedBrick:{message0:"%{BKY_LEGOEV3_SETLED}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},LegoNxtMotorTurnAngleBrick:{message0:"%{BKY_LEGONXT_MOTORTURNANGLE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"LEGO_NXT_DEGREES",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LEGO_NXT_DEGREES_INFO"}]},LegoNxtMotorStopBrick:{message0:"%{BKY_LEGONXT_MOTORSTOP}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},LegoNxtMotorMoveBrick:{message0:"%{BKY_LEGONXT_MOTORMOVE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"LEGO_NXT_SPEED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LEGO_NXT_SPEED_INFO"}]},LegoNxtPlayToneBrick:{message0:"%{BKY_LEGONXT_PLAYTONE}",args0:[{type:"field_input",name:"LEGO_NXT_DURATION_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LEGO_NXT_DURATION_IN_SECONDS_INFO"},{type:"field_input",name:"LEGO_NXT_FREQUENCY",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LEGO_NXT_FREQUENCY_INFO"}]}},look:{SetLookBrick:{message0:"%{BKY_LOOKS_SWITCHTOLOOK}",args0:[{type:"field_input",name:"look",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"look_INFO"}]},SetLookByIndexBrick:{message0:"%{BKY_LOOKS_SWITCHTOLOOKWITHNUMBER}",args0:[{type:"field_input",name:"LOOK_INDEX",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LOOK_INDEX_INFO"}]},NextLookBrick:{message0:"%{BKY_LOOKS_NEXTLOOK}"},PreviousLookBrick:{message0:"%{BKY_LOOKS_PREVIOUSLOOK}"},SetSizeToBrick:{message0:"%{BKY_LOOKS_SETSIZETO}",args0:[{type:"field_input",name:"SIZE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SIZE_INFO"}]},HideBrick:{message0:"%{BKY_LOOKS_HIDE}"},ShowBrick:{message0:"%{BKY_LOOKS_SHOW}"},AskBrick:{message0:"%{BKY_LOOKS_ASKANDSTOREWRITTENANSWERIN}",args0:[{type:"field_input",name:"ASK_QUESTION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ASK_QUESTION_INFO"},{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},SayBubbleBrick:{message0:"%{BKY_LOOKS_SAY_CAT}",args0:[{type:"field_input",name:"STRING",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"STRING_INFO"}]},SayForBubbleBrick:{message0:"%{BKY_LOOKS_SAYFORSECOND}",args0:[{type:"field_input",name:"STRING",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"STRING_INFO"},{type:"field_input",name:"DURATION_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DURATION_IN_SECONDS_INFO"}]},ThinkBubbleBrick:{message0:"%{BKY_LOOKS_THINK_CAT}",args0:[{type:"field_input",name:"STRING",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"STRING_INFO"}]},ThinkForBubbleBrick:{message0:"%{BKY_LOOKS_THINKFORSECONDS}",args0:[{type:"field_input",name:"STRING",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"STRING_INFO"},{type:"field_input",name:"DURATION_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DURATION_IN_SECONDS_INFO"}]},SetTransparencyBrick:{message0:"%{BKY_LOOKS_SETTRANSPARENCYTO}",args0:[{type:"field_input",name:"TRANSPARENCY",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"TRANSPARENCY_INFO"}]},ChangeSizeByNBrick:{message0:"%{BKY_LOOKS_CHANGESIZEBY}",args0:[{type:"field_input",name:"SIZE_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SIZE_CHANGE_INFO"}]},ChangeTransparencyByNBrick:{message0:"%{BKY_LOOKS_CHANGETRANSPARENCYBY}",args0:[{type:"field_input",name:"TRANSPARENCY_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"TRANSPARENCY_CHANGE_INFO"}]},SetBrightnessBrick:{message0:"%{BKY_LOOKS_SETBRIGHTHNESSTO}",args0:[{type:"field_input",name:"BRIGHTNESS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"BRIGHTNESS_INFO"}]},ChangeBrightnessByNBrick:{message0:"%{BKY_LOOKS_CHANGEBRIGHTHNESSBY}",args0:[{type:"field_input",name:"BRIGHTNESS_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"BRIGHTNESS_CHANGE_INFO"}]},SetColorBrick:{message0:"%{BKY_LOOKS_SETCOLORTO}",args0:[{type:"field_input",name:"COLOR",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"COLOR_INFO"}]},ChangeColorByNBrick:{message0:"%{BKY_LOOKS_CHANGECOLORBY}",args0:[{type:"field_input",name:"COLOR_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"COLOR_CHANGE_INFO"}]},ClearGraphicEffectBrick:{message0:"%{BKY_LOOKS_CLEARGRAPHICEFFECTS_CAT}"},SetBackgroundBrick:{message0:"%{BKY_LOOKS_SETBACKGROUND}",args0:[{type:"field_input",name:"look",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"look_INFO"}]},SetBackgroundByIndexBrick:{message0:"%{BKY_LOOKS_SETBACKGROUNDTONUMBER}",args0:[{type:"field_input",name:"BACKGROUND_INDEX",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"BACKGROUND_INDEX_INFO"}]},SetBackgroundAndWaitBrick:{message0:"%{BKY_LOOKS_SETBACKGROUNDANDWAIT}",args0:[{type:"field_input",name:"look",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"look_INFO"}]},SetBackgroundByIndexAndWaitBrick:{message0:"%{BKY_LOOKS_SETBACKGROUNDTONUMBERANDWAIT}",args0:[{type:"field_input",name:"BACKGROUND_WAIT_INDEX",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"BACKGROUND_WAIT_INDEX_INFO"}]},CameraBrick:{message0:"%{BKY_LOOKS_TURNCAMERA}",args0:[{type:"field_input",name:"SPINNER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SPINNER_INFO"}]},ChooseCameraBrick:{message0:"%{BKY_LOOKS_USECAMERA}",args0:[{type:"field_input",name:"SPINNER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SPINNER_INFO"}]},FlashBrick:{message0:"%{BKY_LOOKS_TURNFLASHLIGHT}",args0:[{type:"field_input",name:"SPINNER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SPINNER_INFO"}]},BackgroundRequestBrick:{message0:"%{BKY_LOOKS_BACKGROUNDREQUEST}",args0:[{type:"field_input",name:"BACKGROUND_REQUEST",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"BACKGROUND_REQUEST_INFO"}]},LookRequestBrick:{message0:"%{BKY_LOOKS_LOOKREQUEST}",args0:[{type:"field_input",name:"LOOK_REQUEST",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LOOK_REQUEST_INFO"}]},CopyLookBrick:{message0:"%{BKY_LOOKS_COPY_LOOK}",args0:[{type:"field_input",name:"LOOK_COPY",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LOOK_COPY_INFO"}]},DeleteLookBrick:{message0:"%{BKY_LOOKS_DELETE_LOOK}"},PaintNewLookBrick:{message0:"%{BKY_LOOKS_PAINT_NEW_LOOK}",args0:[{type:"field_input",name:"LOOK_NEW",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LOOK_NEW_INFO"}]},EditLookBrick:{message0:"%{BKY_LOOKS_EDIT_LOOK}"},DroneSwitchCameraBrick:{message0:"%{BKY_DRONE_SWITCHCAMERA}"},PhiroRGBLightBrick:{message0:"%{BKY_PHIRO_RGBLIGHT}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"PHIRO_LIGHT_RED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHIRO_LIGHT_RED_INFO"},{type:"field_input",name:"PHIRO_LIGHT_GREEN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHIRO_LIGHT_GREEN_INFO"},{type:"field_input",name:"PHIRO_LIGHT_BLUE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHIRO_LIGHT_BLUE_INFO"}]},FadeParticleEffectBrick:{message0:"%{BKY_FADE_PARTICLE_EFFECT}",args0:[{type:"field_input",name:"brick_fade_particle_effect_spinner",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"brick_fade_particle_effect_spinner_INFO"}]},ParticleEffectAdditivityBrick:{message0:"%{BKY_ADDITIVE_PARTICLE_EFFECT}",args0:[{type:"field_input",name:"brick_additive_particle_effect_spinner",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"brick_additive_particle_effect_spinner_INFO"}]},SetCameraFocusPointBrick:{message0:"%{BKY_SET_CAMERA_FOCUS}",args0:[{type:"field_input",name:"HORIZONTAL_FLEXIBILITY",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"HORIZONTAL_FLEXIBILITY_INFO"},{type:"field_input",name:"VERTICAL_FLEXIBILITY",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"VERTICAL_FLEXIBILITY_INFO"}]},SetParticleColorBrick:{message0:"%{BKY_SET_PARTICLE_COLOR}",args0:[{type:"field_input",name:"COLOR",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"brick_set_particle_color_INFO"}]}},motion:{PlaceAtBrick:{message0:"%{BKY_MOTION_PLACEATXY}",args0:[{type:"field_input",name:"X_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_POSITION_INFO"},{type:"field_input",name:"Y_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_POSITION_INFO"}]},SetXBrick:{message0:"%{BKY_MOTION_SETXTO}",args0:[{type:"field_input",name:"X_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_POSITION_INFO"}]},SetYBrick:{message0:"%{BKY_MOTION_SETYTO}",args0:[{type:"field_input",name:"Y_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_POSITION_INFO"}]},ChangeXByNBrick:{message0:"%{BKY_MOTION_CHANGEXBY}",args0:[{type:"field_input",name:"X_POSITION_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_POSITION_CHANGE_INFO"}]},ChangeYByNBrick:{message0:"%{BKY_MOTION_CHANGEYBY}",args0:[{type:"field_input",name:"Y_POSITION_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_POSITION_CHANGE_INFO"}]},GoToBrick:{message0:"%{BKY_MOTION_GOTO}",args0:[{type:"field_input",name:"SPINNER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SPINNER_INFO"}]},IfOnEdgeBounceBrick:{message0:"%{BKY_MOTION_IFONEDGEBOUNCE}"},MoveNStepsBrick:{message0:"%{BKY_MOTION_MOVESTEPS}",args0:[{type:"field_input",name:"STEPS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"STEPS_INFO"}]},TurnRightBrick:{message0:"%{BKY_MOTION_TURNRIGHTDEGREES}",args0:[{type:"field_input",name:"TURN_RIGHT_DEGREES",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"TURN_RIGHT_DEGREES_INFO"}]},TurnLeftBrick:{message0:"%{BKY_MOTION_TURNLEFTDEGREES}",args0:[{type:"field_input",name:"TURN_LEFT_DEGREES",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"TURN_LEFT_DEGREES_INFO"}]},PointInDirectionBrick:{message0:"%{BKY_MOTION_POINTINDIRECTIONDEGREES}",args0:[{type:"field_input",name:"DEGREES",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DEGREES_INFO"}]},PointToBrick:{message0:"%{BKY_MOTION_POINTTOWARDS}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},SetRotationStyleBrick:{message0:"%{BKY_MOTION_SETROTATIONSTYLE}",args0:[{type:"field_input",name:"SPINNER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SPINNER_INFO"}]},GlideToBrick:{message0:"%{BKY_MOTION_GLIDESECONDTOXY}",args0:[{type:"field_input",name:"DURATION_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DURATION_IN_SECONDS_INFO"},{type:"field_input",name:"X_DESTINATION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_DESTINATION_INFO"},{type:"field_input",name:"Y_DESTINATION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_DESTINATION_INFO"}]},GoNStepsBackBrick:{message0:"%{BKY_MOTION_GOBACKLAYER}",args0:[{type:"field_input",name:"STEPS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"STEPS_INFO"}]},ComeToFrontBrick:{message0:"%{BKY_MOTION_GOTOFRONT}"},VibrationBrick:{message0:"%{BKY_MOTION_VIBRATEFORSECOND}",args0:[{type:"field_input",name:"VIBRATE_DURATION_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"VIBRATE_DURATION_IN_SECONDS_INFO"}]},SetPhysicsObjectTypeBrick:{message0:"%{BKY_MOTION_SETYOURMOTIONTYPETO}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},SetVelocityBrick:{message0:"%{BKY_MOTION_SETVELOCITYTO}",args0:[{type:"field_input",name:"PHYSICS_VELOCITY_X",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHYSICS_VELOCITY_X_INFO"},{type:"field_input",name:"PHYSICS_VELOCITY_Y",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHYSICS_VELOCITY_Y_INFO"}]},TurnLeftSpeedBrick:{message0:"%{BKY_MOTION_SPINLEFTDEGREESSECOND}",args0:[{type:"field_input",name:"PHYSICS_TURN_LEFT_SPEED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHYSICS_TURN_LEFT_SPEED_INFO"}]},TurnRightSpeedBrick:{message0:"%{BKY_MOTION_SPINRIGHTDEGREESSECOND}",args0:[{type:"field_input",name:"PHYSICS_TURN_RIGHT_SPEED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHYSICS_TURN_RIGHT_SPEED_INFO"}]},SetGravityBrick:{message0:"%{BKY_MOTION_SETGRAVITYFORALLACTORSANDOBJECTSTO}",args0:[{type:"field_input",name:"PHYSICS_GRAVITY_X",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHYSICS_GRAVITY_X_INFO"},{type:"field_input",name:"PHYSICS_GRAVITY_Y",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHYSICS_GRAVITY_Y_INFO"}]},SetMassBrick:{message0:"%{BKY_MOTION_SETMASSTOKILOGRAM}",args0:[{type:"field_input",name:"PHYSICS_MASS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHYSICS_MASS_INFO"}]},SetBounceBrick:{message0:"%{BKY_MOTION_SETBOUNCEFACTORTO}",args0:[{type:"field_input",name:"PHYSICS_BOUNCE_FACTOR",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHYSICS_BOUNCE_FACTOR_INFO"}]},SetFrictionBrick:{message0:"%{BKY_MOTION_SETFRICTIONTO}",args0:[{type:"field_input",name:"PHYSICS_FRICTION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHYSICS_FRICTION_INFO"}]},DroneTakeOffLandBrick:{message0:"%{BKY_DRONE_TAKEOFFLAND}"},DroneEmergencyBrick:{message0:"%{BKY_DRONE_EMERGENCY}"},DroneMoveUpBrick:{message0:"%{BKY_DRONE_MOVEUP}",args0:[{type:"field_input",name:"DRONE_TIME_TO_FLY_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_TIME_TO_FLY_IN_SECONDS_INFO"},{type:"field_input",name:"DRONE_POWER_IN_PERCENT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_POWER_IN_PERCENT_INFO"}]},DroneMoveDownBrick:{message0:"%{BKY_DRONE_MOVEDOWN}",args0:[{type:"field_input",name:"DRONE_TIME_TO_FLY_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_TIME_TO_FLY_IN_SECONDS_INFO"},{type:"field_input",name:"DRONE_POWER_IN_PERCENT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_POWER_IN_PERCENT_INFO"}]},DroneMoveLeftBrick:{message0:"%{BKY_DRONE_MOVELEFT}",args0:[{type:"field_input",name:"DRONE_TIME_TO_FLY_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_TIME_TO_FLY_IN_SECONDS_INFO"},{type:"field_input",name:"DRONE_POWER_IN_PERCENT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_POWER_IN_PERCENT_INFO"}]},DroneMoveRightBrick:{message0:"%{BKY_DRONE_MOVERIGHT}",args0:[{type:"field_input",name:"DRONE_TIME_TO_FLY_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_TIME_TO_FLY_IN_SECONDS_INFO"},{type:"field_input",name:"DRONE_POWER_IN_PERCENT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_POWER_IN_PERCENT_INFO"}]},DroneMoveForwardBrick:{message0:"%{BKY_DRONE_MOVEFORWARD}",args0:[{type:"field_input",name:"DRONE_TIME_TO_FLY_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_TIME_TO_FLY_IN_SECONDS_INFO"},{type:"field_input",name:"DRONE_POWER_IN_PERCENT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_POWER_IN_PERCENT_INFO"}]},DroneMoveBackwardBrick:{message0:"%{BKY_DRONE_MOVEBACKWARD}",args0:[{type:"field_input",name:"DRONE_TIME_TO_FLY_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_TIME_TO_FLY_IN_SECONDS_INFO"},{type:"field_input",name:"DRONE_POWER_IN_PERCENT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_POWER_IN_PERCENT_INFO"}]},DroneTurnLeftBrick:{message0:"%{BKY_DRONE_TURNLEFT}",args0:[{type:"field_input",name:"DRONE_TIME_TO_FLY_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_TIME_TO_FLY_IN_SECONDS_INFO"},{type:"field_input",name:"DRONE_POWER_IN_PERCENT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_POWER_IN_PERCENT_INFO"}]},DroneTurnRightBrick:{message0:"%{BKY_DRONE_TURNRIGHT}",args0:[{type:"field_input",name:"DRONE_TIME_TO_FLY_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_TIME_TO_FLY_IN_SECONDS_INFO"},{type:"field_input",name:"DRONE_POWER_IN_PERCENT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DRONE_POWER_IN_PERCENT_INFO"}]},DroneFlipBrick:{message0:"%{BKY_DRONE_FLIP}"},DronePlayLedAnimationBrick:{message0:"%{BKY_DRONE_PLAYLEDANIMATION}",args0:[{type:"field_input",name:"ADRONEANIMATION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ADRONEANIMATION_INFO"}]},JumpingSumoAnimationsBrick:{message0:"%{BKY_SUMO_ANIMATION}",args0:[{type:"field_input",name:"ANIMATION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ANIMATION_INFO"}]},JumpingSumoJumpHighBrick:{message0:"%{BKY_SUMO_JUMPHIGH}"},JumpingSumoJumpLongBrick:{message0:"%{BKY_SUMO_JUMPLONG}"},JumpingSumoMoveBackwardBrick:{message0:"%{BKY_SUMO_MOVEBACKWARD}",args0:[{type:"field_input",name:"JUMPING_SUMO_TIME_TO_DRIVE_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"JUMPING_SUMO_TIME_TO_DRIVE_IN_SECONDS_INFO"},{type:"field_input",name:"JUMPING_SUMO_SPEED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"JUMPING_SUMO_SPEED_INFO"}]},JumpingSumoMoveForwardBrick:{message0:"%{BKY_SUMO_MOVEFORWARD}",args0:[{type:"field_input",name:"JUMPING_SUMO_TIME_TO_DRIVE_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"JUMPING_SUMO_TIME_TO_DRIVE_IN_SECONDS_INFO"},{type:"field_input",name:"JUMPING_SUMO_SPEED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"JUMPING_SUMO_SPEED_INFO"}]},JumpingSumoRotateLeftBrick:{message0:"%{BKY_SUMO_ROTATELEFT}",args0:[{type:"field_input",name:"JUMPING_SUMO_ROTATE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"JUMPING_SUMO_ROTATE_INFO"}]},JumpingSumoRotateRightBrick:{message0:"%{BKY_SUMO_ROTATERIGHT}",args0:[{type:"field_input",name:"JUMPING_SUMO_ROTATE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"JUMPING_SUMO_ROTATE_INFO"}]},JumpingSumoTurnBrick:{message0:"%{BKY_SUMO_TURN}"},JumpingSumoTakingPictureBrick:{message0:"%{BKY_SUMO_TAKINGPICTURE}"},WhenBounceOffScript:{message0:"%{BKY_EVENT_WHENYOUBOUNCEOFF}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]}},pen:{PenDownBrick:{message0:"%{BKY_PEN_PENDOWN}"},PenUpBrick:{message0:"%{BKY_PEN_PENUP}"},SetPenSizeBrick:{message0:"%{BKY_PEN_SETPENSIZETO}",args0:[{type:"field_input",name:"PEN_SIZE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PEN_SIZE_INFO"}]},SetPenColorBrick:{message0:"%{BKY_PEN_SETPENCOLORTO}",args0:[{type:"field_input",name:"PEN_COLOR_RED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PEN_COLOR_RED_INFO"},{type:"field_input",name:"PEN_COLOR_GREEN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PEN_COLOR_GREEN_INFO"},{type:"field_input",name:"PEN_COLOR_BLUE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PEN_COLOR_BLUE_INFO"}]},StampBrick:{message0:"%{BKY_PEN_STAMP}"},ClearBackgroundBrick:{message0:"%{BKY_PEN_CLEAR}"}},phiro:{PhiroMotorMoveForwardBrick:{message0:"%{BKY_PHIRO_MOTORMOVEFORWARD}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"PHIRO_SPEED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHIRO_SPEED_INFO"}]},PhiroMotorMoveBackwardBrick:{message0:"%{BKY_PHIRO_MOTORMOVEBACKWARD}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"PHIRO_SPEED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHIRO_SPEED_INFO"}]},PhiroMotorStopBrick:{message0:"%{BKY_PHIRO_MOTORSTOP}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]}},report:{ReportBrick:{message0:"%{BKY_USER_BRICK_REPORT}",args0:[{type:"field_input",name:"REPORT_BRICK",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"REPORT_BRICK_INFO"}]}},script:{WhenGamepadButtonBrick:{message0:"%{BKY_CAST_WHEN_GAMEPAD_BUTTON}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},WhenRaspiPinChangedBrick:{message0:"%{BKY_RASPI_WHENPINCHANGED}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"DROPDOWN2",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN2_INFO"}]}},sound:{PlaySoundBrick:{message0:"%{BKY_SOUND_STARTSOUND}",args0:[{type:"field_input",name:"sound",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"sound_INFO"}]},PlaySoundAndWaitBrick:{message0:"%{BKY_SOUND_STARTSOUNDANDWAIT}",args0:[{type:"field_input",name:"sound",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"sound_INFO"}]},StopAllSoundsBrick:{message0:"%{BKY_SOUND_STOPALLSOUNDS}"},SetVolumeToBrick:{message0:"%{BKY_SOUND_SETVOLUMETO}",args0:[{type:"field_input",name:"VOLUME",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"VOLUME_INFO"}]},ChangeVolumeByNBrick:{message0:"%{BKY_SOUND_CHANGEVOLUMEBY}",args0:[{type:"field_input",name:"VOLUME_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"VOLUME_CHANGE_INFO"}]},SpeakBrick:{message0:"%{BKY_SOUND_SPEAK}",args0:[{type:"field_input",name:"SPEAK",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SPEAK_INFO"}]},SpeakAndWaitBrick:{message0:"%{BKY_SOUND_SPEAKANDWAIT}",args0:[{type:"field_input",name:"SPEAK",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SPEAK_INFO"}]},AskSpeechBrick:{message0:"%{BKY_SOUND_ASKANDSTORESPOKENANSWERIN}",args0:[{type:"field_input",name:"ASK_SPEECH_QUESTION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ASK_SPEECH_QUESTION_INFO"},{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},StopSoundBrick:{message0:"%{BKY_SOUND_STOP_SOUND}",args0:[{type:"field_input",name:"sound",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"sound_INFO"}]},StartListeningBrick:{message0:"%{BKY_SOUND_START_LISTENING}",args0:[{type:"field_input",name:"LISTEN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LISTEN_INFO"}]},SetInstrumentBrick:{message0:"%{BKY_SOUND_SET_INSTRUMENT}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},PauseForBeatsBrick:{message0:"%{BKY_SOUND_PAUSE_FOR_BEATS}",args0:[{type:"field_input",name:"BEATS_TO_PAUSE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"BEATS_TO_PAUSE_INFO"}]},SetListeningLanguageBrick:{message0:"%{BKY_SOUND_SET_LISTENING_LANGUAGE}",args0:[{type:"field_input",name:"brick_set_listening_language_spinner",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"brick_set_listening_language_spinner_INFO"}]},SetTempoBrick:{message0:"%{BKY_SOUND_SET_TEMPO}",args0:[{type:"field_input",name:"TEMPO",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"TEMPO_INFO"}]},ChangeTempoByNBrick:{message0:"%{BKY_SOUND_CHANGE_TEMPO_BY}",args0:[{type:"field_input",name:"TEMPO_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"TEMPO_CHANGE_INFO"}]},PlayDrumForBeatsBrick:{message0:"%{BKY_SOUND_PLAY_DRUM_FOR_BEATS}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"PLAY_DRUM",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PLAY_DRUM_INFO"}]},PlayNoteForBeatsBrick:{message0:"%{BKY_SOUND_PLAY_NOTE_FOR_BEATS}",args0:[{type:"field_input",name:"NOTE_TO_PLAY",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"NOTE_TO_PLAY_INFO"},{type:"field_input",name:"BEATS_TO_PLAY_NOTE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"BEATS_TO_PLAY_NOTE_INFO"}]},JumpingSumoSoundBrick:{message0:"%{BKY_SUMO_SOUND}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"JUMPING_SUMO_VOLUME",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"JUMPING_SUMO_VOLUME_INFO"}]},JumpingSumoNoSoundBrick:{message0:"%{BKY_SUMO_NOSOUND}"},PhiroPlayToneBrick:{message0:"%{BKY_PHIRO_PLAYTONE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"PHIRO_DURATION_IN_SECONDS",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"PHIRO_DURATION_IN_SECONDS_INFO"}]}},test:{FinishStageBrick:{message0:"%{BKY_ASSERTION_FINISH_TESTS}"},AssertEqualsBrick:{message0:"%{BKY_ASSERTION_ASSERT_EQUALS}",args0:[{type:"field_input",name:"ASSERT_EQUALS_ACTUAL",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ASSERT_EQUALS_ACTUAL_INFO"},{type:"field_input",name:"ASSERT_EQUALS_EXPECTED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ASSERT_EQUALS_EXPECTED_INFO"}]},AssertUserListsBrick:{message0:"%{BKY_ASSERTION_ASSERT_USER_LISTS}",args0:[{type:"field_input",name:"ASSERT_LISTS_ACTUAL",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ASSERT_LISTS_ACTUAL_INFO"},{type:"field_input",name:"ASSERT_LISTS_EXPECTED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ASSERT_LISTS_EXPECTED_INFO"}]},ParameterizedBrick:{message0:"%{BKY_ASSERTION_PARAMETERIZED_HEAD}",message1:"%1",message2:"%{BKY_ASSERTION_PARAMETERIZED_BOTTOM}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_input",name:"ASSERT_LOOP_ACTUAL",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ASSERT_LOOP_ACTUAL_INFO"},{type:"field_input",name:"LIST_SELECTED",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LIST_SELECTED_INFO"}]}},user:{UserDefinedScript:{message0:"%{BKY_USER_DEFINED_SCRIPT_DEFINE}",message1:"%1",message2:"%{BKY_USER_DEFINED_SCRIPT_SCREEN_REFRESH_AS}",args1:[{type:"input_statement",name:"TEMPLATE_BRICK",check:"UserDefinedReadOnly"}],args2:[{type:"field_image",src:`${document.location.pathname}media/empty_icon.svg`,height:42,width:1,alt:"",name:"dummy_icon"},{type:"field_input",name:"UDB_SCREEN_REFRESH",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"UDB_SCREEN_REFRESH_INFO"}]}},userlist:{ReadListFromDeviceBrick:{message0:"%{BKY_DATA_READLISTFROMDEVICE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},WriteListOnDeviceBrick:{message0:"%{BKY_DATA_WRITELISTONDEVICE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]}},uservariables:{SetVariableBrick:{message0:"%{BKY_DATA_SETVARIABLETOCAT}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"VARIABLE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"VARIABLE_INFO"}]},ChangeVariableBrick:{message0:"%{BKY_DATA_CHANGEVARIABLEBY}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"VARIABLE_CHANGE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"VARIABLE_CHANGE_INFO"}]},ShowTextBrick:{message0:"%{BKY_DATA_SHOWVARIABLEAT}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"X_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_POSITION_INFO"},{type:"field_input",name:"Y_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_POSITION_INFO"}]},ShowTextColorSizeAlignmentBrick:{message0:"%{BKY_DATA_SHOWVARIABLEATSIZECOLORALIGNED}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"X_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"X_POSITION_INFO"},{type:"field_input",name:"Y_POSITION",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"Y_POSITION_INFO"},{type:"field_input",name:"SIZE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SIZE_INFO"},{type:"field_input",name:"COLOR",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"COLOR_INFO"},{type:"field_input",name:"ALIGNMENT",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"ALIGNMENT_INFO"}]},DeleteItemOfUserListBrick:{message0:"%{BKY_DATA_DELETEITEMFROMLIST}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"LIST_DELETE_ITEM",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LIST_DELETE_ITEM_INFO"}]},AddItemToUserListBrick:{message0:"%{BKY_DATA_ADDTOLIST}",args0:[{type:"field_input",name:"LIST_ADD_ITEM",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"LIST_ADD_ITEM_INFO"},{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},InsertItemIntoUserListBrick:{message0:"%{BKY_DATA_INSERTINTOLIST}",args0:[{type:"field_input",name:"INSERT_ITEM_INTO_USERLIST_VALUE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"INSERT_ITEM_INTO_USERLIST_VALUE_INFO"},{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"INSERT_ITEM_INTO_USERLIST_INDEX",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"INSERT_ITEM_INTO_USERLIST_INDEX_INFO"}]},ReplaceItemInUserListBrick:{message0:"%{BKY_DATA_REPLACEITEMINLIST}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"REPLACE_ITEM_IN_USERLIST_INDEX",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"REPLACE_ITEM_IN_USERLIST_INDEX_INFO"},{type:"field_input",name:"REPLACE_ITEM_IN_USERLIST_VALUE",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"REPLACE_ITEM_IN_USERLIST_VALUE_INFO"}]},HideTextBrick:{message0:"%{BKY_DATA_HIDEVARIABLE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},ReadVariableFromDeviceBrick:{message0:"%{BKY_DATA_READVARIABLE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},WriteVariableOnDeviceBrick:{message0:"%{BKY_DATA_WRITEVARIABLE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},StoreCSVIntoUserListBrick:{message0:"%{BKY_DATA_STORECSVINTOUSERLIST}",args0:[{type:"field_input",name:"STORE_CSV_INTO_USERLIST_COLUMN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"STORE_CSV_INTO_USERLIST_COLUMN_INFO"},{type:"field_input",name:"STORE_CSV_INTO_USERLIST_CSV",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"STORE_CSV_INTO_USERLIST_CSV_INFO"},{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},ClearUserListBrick:{message0:"%{BKY_DATA_CLEARUSERLIST}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},WebRequestBrick:{message0:"%{BKY_DATA_WEBREQUEST}",args0:[{type:"field_input",name:"WEB_REQUEST",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"WEB_REQUEST_INFO"},{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"}]},ReadVariableFromFileBrick:{message0:"%{BKY_DATA_READ_VARIABLE_FROM_FILE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"READ_FILENAME",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"READ_FILENAME_INFO"},{type:"field_input",name:"SPINNER",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"SPINNER_INFO"}]},WriteVariableToFileBrick:{message0:"%{BKY_DATA_WRITE_VARIABLE_TO_FILE}",args0:[{type:"field_input",name:"DROPDOWN",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"DROPDOWN_INFO"},{type:"field_input",name:"WRITE_FILENAME",text:"unset"},{type:"field_image",src:`${document.location.pathname}media/info_icon.svg`,height:24,width:24,alt:"(i)",flip_rtl:!0,name:"WRITE_FILENAME_INFO"}]}}},X=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();["Blocks","Bricks","Categories"].forEach((e=>{t[e]?Object.keys(t[e]).forEach((o=>{delete t[e][o]})):t[e]={}}))},K=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i();e.Extensions.register("shapeBrick",(function(){const t=this.type;["WhenClonedScript","StartScript","WhenScript","WhenTouchDownScript","BroadcastScript","WhenConditionScript","WhenBounceOffScript","WhenBackgroundChangesScript","WhenRaspiPinChangedBrick","UserDefinedScript","EmptyScript","RaspiInterruptScript"].includes(t)?this.hat="cap":this.setPreviousStatement(!0,"CatBlocksBrick"),this.setNextStatement(!0,"CatBlocksBrick")}));for(const o in t){const n=t[o];e.Categories[o]=[];for(const t in n){const i=n[t];i.category=o,Array.isArray(i.extensions)?i.extensions=i.extensions.concat(["shapeBrick"]):i.extensions=["shapeBrick"],e.Bricks[t]=i,e.Categories[o].push(t),e.Blocks[t]={init:function(){this.jsonInit(e.Bricks[t])}}}}};!function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i();X(t),K(Y,t)}();const j={arduino:{colourPrimary:"#26a6ae",colourSecondary:"#218C94",colourTertiary:"#18686E"},control:{colourPrimary:"#F99761",colourSecondary:"#BA7049",colourTertiary:"#7A4A30"},device:{colourPrimary:"#95750C",colourSecondary:"#7A600A",colourTertiary:"#544207"},dummy:{colourPrimary:"#ffffff",colourSecondary:"#ffffff",colourTertiary:"#ffffff"},embroidery:{colourPrimary:"#CC73A1",colourSecondary:"#8C4F6E",colourTertiary:"#4D2B3C"},event:{colourPrimary:"#CF5717",colourSecondary:"#8F3C10",colourTertiary:"#4F2109"},lego:{colourPrimary:"#FECC47",colourSecondary:"#BF9B36",colourTertiary:"#806724"},look:{colourPrimary:"#6B9C49",colourSecondary:"#5A823D",colourTertiary:"#3F5C2B"},motion:{colourPrimary:"#408AC5",colourSecondary:"#2A5C85",colourTertiary:"#163045"},pen:{colourPrimary:"#2F5415",colourSecondary:"#376118",colourTertiary:"#213B0F"},phiro:{colourPrimary:"#26a6ae",colourSecondary:"#218C94",colourTertiary:"#18686E"},report:{colourPrimary:"#999999",colourSecondary:"#808080",colourTertiary:"#595959"},script:{colourPrimary:"#F99761",colourSecondary:"#BA7049",colourTertiary:"#7A4A30"},sound:{colourPrimary:"#8F4CBA",colourSecondary:"#5F327A",colourTertiary:"#2D183B"},test:{colourPrimary:"#26a6ae",colourSecondary:"#218C94",colourTertiary:"#18686E"},user:{colourPrimary:"#999999",colourSecondary:"#808080",colourTertiary:"#595959"},userlist:{colourPrimary:"#F14E50",colourSecondary:"#B3393B",colourTertiary:"#732526"},uservariables:{colourPrimary:"#F14E50",colourSecondary:"#B3393B",colourTertiary:"#732526"}};function J(t,e){return e.startsWith("http")?e:e.startsWith("/")?window.location.origin+e:t.config.shareRoot.startsWith("http")?t.config.shareRoot+e:window.location.origin+"/"+t.config.shareRoot+e}function z(t){return t?t.endsWith("/")?t:t+"/":""}let q;!function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i();if(t)if(e.Colours={},Object.keys(e.Categories).length>0)for(const o in e.Categories){const n=t[o]?o:"default";e.Colours[o]=t[n];for(const i of e.Categories[o])e.Bricks[i].colour=t[n].colourPrimary,e.Bricks[i].colourSecondary=t[n].colourSecondary,e.Bricks[i].colourTertiary=t[n].colourTertiary}else console.warn("No categories registerd, maybe you have missed to load some bricks");else console.error("Failed to initiate colours, because undefined or null options passed in params")}(j,i());class Z{constructor(t){return q||(this.config=t,this.share=void 0,q=this),q}static init(t){if(!t)throw new Error("No configuration given");return q=new Z(t),function(t){t.config.shareRoot=z(t.config.shareRoot),t.config.shareRoot=t.config.shareRoot.replace(/^\//,""),t.config.media=z(t.config.media),t.config.i18n=z(t.config.i18n),t.config.media=J(t,t.config.media),t.config.i18n=J(t,t.config.i18n),t.config.shareRoot.startsWith("http")||(t.config.shareRoot="/"+t.config.shareRoot)}(q),q.share=new V,q.share.init(t)}static render(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;s()("#spinnerModal").one("shown.bs.modal",(()=>{try{const i=$.convertObjectToJSON(t,e,o);q.share.scene=e,q.share.object=o,q.share.brickIDToFocus=n,q.share.renderObjectScripts(i)}finally{s()("#spinnerModal").modal("hide")}})),s()("#spinnerModal").modal("show")}static reorderCurrentScripts(){q.share.reorderCurrentScripts()}static addBricks(t){q.share.addBricks(t)}static getBrickAtTopOfScreen(){return q.share.getBrickAtTopOfScreen()}}},2180:(t,e,o)=>{const n=o(7983);t.exports=n.CatBlocks},4097:function(t,e,o){var n,i,r;i=[o(1334)],void 0===(r="function"==typeof(n=function(t){return t})?n.apply(e,i):n)||(t.exports=r)},1334:function(t,e,o){var n,i,r,s;s=function(){const t={};var e=e||{};e.scope={},e.createTemplateTagFirstArg=function(t){return t.raw=t},e.createTemplateTagFirstArgWithRaw=function(t,e){return t.raw=e,t},e.arrayIteratorImpl=function(t){var e=0;return function(){return e>>0,e.propertyToPolyfillSymbol[r]=e.IS_SYMBOL_NATIVE?e.global.Symbol(r):e.POLYFILL_PREFIX+n+"$"+r),e.defineProperty(i,e.propertyToPolyfillSymbol[r],{configurable:!0,writable:!0,value:o})))},e.assign=e.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Object.assign:function(t,o){for(var n=1;n=r}}),"es6","es3"),e.initSymbol=function(){},e.polyfill("Symbol",(function(t){if(t)return t;var o=function(t,o){this.$jscomp$symbol$id_=t,e.defineProperty(this,"description",{configurable:!0,writable:!0,value:o})};o.prototype.toString=function(){return this.$jscomp$symbol$id_};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0,r=function(t){if(this instanceof r)throw new TypeError("Symbol is not a constructor");return new o(n+(t||"")+"_"+i++,t)};return r}),"es6","es3"),e.polyfill("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var o="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;ne&&(e=Math.max(0,n+e)),(null==o||o>n)&&(o=n),0>(o=Number(o))&&(o=Math.max(0,n+o)),e=Number(e||0);e(e=e||0)&&(e=Math.max(e+n,0));e>>/g,t),c.content="",(t=document.createElement("style")).id="blockly-common-style",e=document.createTextNode(e),t.appendChild(e),document.head.insertBefore(t,document.head.firstChild)))},c.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',t.module$exports$Blockly$utils$string={startsWith:function(t,e){return 0===t.lastIndexOf(e,0)},shortestStringLength:function(t){return t.length?t.reduce((function(t,e){return t.lengthe&&(e=o[n].length);var i=-1/0,a=1;do{n=i;var c=t;t=[],i=o.length/a;for(var u=1,p=0;pn);return c},r=function(t,e,o){for(var n=[0],i=[],r=0;ri&&(i=c,n=a)}return n?s(t,n,o):e},l=function(t,e){for(var o=[],n=0;nE.RADIUS_OK&&(0,E.hide)()}else R!==O&&(clearTimeout(b),I=t.pageX,C=t.pageY,b=setTimeout(w,E.HOVER_MS))};E.dispose=function(){R=O=null,(0,E.hide)()},E.hide=function(){v&&(v=!1,B&&(B.style.display="none")),b&&clearTimeout(b)},E.block=function(){(0,E.hide)(),k=!0},E.unblock=function(){k=!1};var w=function(){if(!k&&(R=O,B)){B.textContent="";var e=(0,E.getTooltipOfObject)(O);e=(e=(0,t.module$exports$Blockly$utils$string.wrap)(e,E.LIMIT)).split("\n");for(var o=0;on+window.scrollY&&(r-=B.offsetHeight+2*E.OFFSET_Y),e?i=Math.max(E.MARGINS-window.scrollX,i):i+B.offsetWidth>o+window.scrollX-2*E.MARGINS&&(i=o-B.offsetWidth-2*E.MARGINS),B.style.top=r+"px",B.style.left=i+"px"}},M={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}},L=null,$=0,P=null;M.createSvgElement=function(t,e,o){for(var n in t=document.createElementNS(M.SVG_NS,String(t)),e)t.setAttribute(n,e[n]);return document.body.runtimeStyle&&(t.runtimeStyle=t.currentStyle=t.style),o&&o.appendChild(t),t},M.addClass=function(t,e){var o=t.getAttribute("class")||"";return-1===(" "+o+" ").indexOf(" "+e+" ")&&(o&&(o+=" "),t.setAttribute("class",o+e),!0)},M.removeClasses=function(t,e){e=e.split(" ");for(var o=0;oi?Y(t,0,o.height+i):Y(t,i,o.height)};var X=function(t,e,o,n){return n?Math.min(Math.max(e.right-o.width,t.left),t.right-o.width):Math.max(Math.min(e.left,t.right-o.width),t.left)},K=function(t,e,o){return e.bottom+o.height>=t.bottom?e.top-o.height:e.bottom},j={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"},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"},setRole:function(t,e){t.setAttribute("role",e)},setState:function(t,e,o){Array.isArray(o)&&(o=o.join(" ")),t.setAttribute("aria-"+e,o)}},J={TEST_ONLY:{}},z=0;J.getNextUniqueId=function(){return"blockly-"+(z++).toString(36)};var q="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";J.TEST_ONLY.genUid=function(){for(var t=q.length,e=[],o=0;20>o;o++)e[o]=q.charAt(Math.random()*t);return e.join("")},J.genUid=function(){return J.TEST_ONLY.genUid()};var Z={},Q=Object.create(null);Z.TEST_ONLY={typeMap:Q};var tt=Object.create(null);Z.DEFAULT="default",Z.Type=function(t){this.name_=t},Z.Type.prototype.toString=function(){return this.name_},Z.Type.CONNECTION_CHECKER=new Z.Type("connectionChecker"),Z.Type.CURSOR=new Z.Type("cursor"),Z.Type.EVENT=new Z.Type("event"),Z.Type.FIELD=new Z.Type("field"),Z.Type.RENDERER=new Z.Type("renderer"),Z.Type.TOOLBOX=new Z.Type("toolbox"),Z.Type.THEME=new Z.Type("theme"),Z.Type.TOOLBOX_ITEM=new Z.Type("toolboxItem"),Z.Type.FLYOUTS_VERTICAL_TOOLBOX=new Z.Type("flyoutsVerticalToolbox"),Z.Type.FLYOUTS_HORIZONTAL_TOOLBOX=new Z.Type("flyoutsHorizontalToolbox"),Z.Type.METRICS_MANAGER=new Z.Type("metricsManager"),Z.Type.BLOCK_DRAGGER=new Z.Type("blockDragger"),Z.Type.SERIALIZER=new Z.Type("serializer"),Z.register=function(t,e,o,n){if(!(t instanceof Z.Type)&&"string"!=typeof t||""===String(t).trim())throw Error('Invalid type "'+t+'". The type must be a non-empty string or a Blockly.registry.Type.');if(t=String(t).toLowerCase(),"string"!=typeof e||""===e.trim())throw Error('Invalid name "'+e+'". The name must be a non-empty string.');var i=e.toLowerCase();if(!o)throw Error("Can not register a null value");var r=Q[t],s=tt[t];if(r||(r=Q[t]=Object.create(null),s=tt[t]=Object.create(null)),et(t,o),!n&&r[i])throw Error('Name "'+i+'" with type "'+t+'" already registered.');r[i]=o,s[i]=e};var et=function(t,e){if(t===String(Z.Type.FIELD)&&"function"!=typeof e.fromJson)throw Error('Type "'+t+'" must have a fromJson function')};Z.unregister=function(t,e){t=String(t).toLowerCase(),e=e.toLowerCase();var o=Q[t];o&&o[e]?(delete Q[t][e],delete tt[t][e]):console.warn("Unable to unregister ["+e+"]["+t+"] from the registry.")};var ot=function(t,e,o){t=String(t).toLowerCase(),e=e.toLowerCase();var n=Q[t];if(!n||!n[e]){if(e="Unable to find ["+e+"]["+t+"] in the registry.",o)throw Error(e+" You must require or register a "+t+" plugin.");return console.warn(e),null}return n[e]};Z.hasItem=function(t,e){return t=String(t).toLowerCase(),e=e.toLowerCase(),!!(t=Q[t])&&!!t[e]},Z.getClass=function(t,e,o){return ot(t,e,o)},Z.getObject=function(t,e,o){return ot(t,e,o)},Z.getAllItems=function(t,e,o){t=String(t).toLowerCase();var n=Q[t];if(!n){if(n="Unable to find ["+t+"] in the registry.",o)throw Error(n+" You must require or register a "+t+" plugin.");return console.warn(n),null}if(!e)return n;t=tt[t],o=Object.create(null),e=Object.keys(n);for(var i=0;ie.oldScale&&(0,ut.bumpTopObjectsIntoBounds)(t)}}},pt=function(t,e){var o=null;switch(e.type){case nt.CREATE:case nt.MOVE:(o=t.getBlockById(e.blockId))&&(o=o.getRootBlock());break;case nt.COMMENT_CREATE:case nt.COMMENT_MOVE:o=t.getCommentById(e.commentId)}return o};ut.bumpTopObjectsIntoBounds=function(t){var e=t.getMetricsManager();if(e.hasFixedEdges()&&!t.isDragging()){e=e.getScrollMetrics(!0);for(var o,n=t.getTopBoundedElements(),i=0;o=n[i];i++)(0,ut.bumpIntoBounds)(t,e,o)}};var ht={Coordinate:function(t,e){this.x=t,this.y=e}};ht.Coordinate.equals=function(t,e){return t===e||!(!t||!e)&&t.x===e.x&&t.y===e.y},ht.Coordinate.distance=function(t,e){var o=t.x-e.x;return t=t.y-e.y,Math.sqrt(o*o+t*t)},ht.Coordinate.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},ht.Coordinate.difference=function(t,e){return new ht.Coordinate(t.x-e.x,t.y-e.y)},ht.Coordinate.sum=function(t,e){return new ht.Coordinate(t.x+e.x,t.y+e.y)},ht.Coordinate.prototype.clone=function(){return new ht.Coordinate(this.x,this.y)},ht.Coordinate.prototype.scale=function(t){return this.x*=t,this.y*=t,this},ht.Coordinate.prototype.translate=function(t,e){return this.x+=t,this.y+=e,this};var dt={Size:function(t,e){this.width=t,this.height=e}};dt.Size.equals=function(t,e){return t===e||!(!t||!e)&&t.width===e.width&&t.height===e.height};var _t={getSize:function(t){if("none"!==ft(t,"display"))return gt(t);var e=t.style,o=e.display,n=e.visibility,i=e.position;e.visibility="hidden",e.position="absolute",e.display="inline";var r=t.offsetWidth;return t=t.offsetHeight,e.display=o,e.position=i,e.visibility=n,new dt.Size(r,t)}},gt=function(t){return new dt.Size(t.offsetWidth,t.offsetHeight)},ft=function(t,e){return(0,_t.getComputedStyle)(t,e)||(0,_t.getCascadedStyle)(t,e)||t.style&&t.style[e]};_t.getComputedStyle=function(t,e){return document.defaultView&&document.defaultView.getComputedStyle&&(t=document.defaultView.getComputedStyle(t,null))&&(t[e]||t.getPropertyValue(e))||""},_t.getCascadedStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:null},_t.getPageOffset=function(t){var e=new ht.Coordinate(0,0);t=t.getBoundingClientRect();var o=document.documentElement;return o=new ht.Coordinate(window.pageXOffset||o.scrollLeft,window.pageYOffset||o.scrollTop),e.x=t.left+o.x,e.y=t.top+o.y,e},_t.getViewportPageOffset=function(){var t=document.body,e=document.documentElement;return new ht.Coordinate(t.scrollLeft||e.scrollLeft,t.scrollTop||e.scrollTop)},_t.setElementShown=function(t,e){t.style.display=e?"":"none"},_t.isRightToLeft=function(t){return"rtl"===ft(t,"direction")},_t.getBorderBox=function(t){var e=(0,_t.getComputedStyle)(t,"borderLeftWidth"),o=(0,_t.getComputedStyle)(t,"borderRightWidth"),n=(0,_t.getComputedStyle)(t,"borderTopWidth");return t=(0,_t.getComputedStyle)(t,"borderBottomWidth"),{top:parseFloat(n),right:parseFloat(o),bottom:parseFloat(t),left:parseFloat(e)}},_t.scrollIntoContainerView=function(t,e,o){t=(0,_t.getContainerOffsetToScrollInto)(t,e,o),e.scrollLeft=t.x,e.scrollTop=t.y},_t.getContainerOffsetToScrollInto=function(t,e,o){var n=(0,_t.getPageOffset)(t),i=(0,_t.getPageOffset)(e),r=(0,_t.getBorderBox)(e),s=n.x-i.x-r.left;return n=n.y-i.y-r.top,i=gt(t),t=e.clientWidth-i.width,i=e.clientHeight-i.height,r=e.scrollLeft,e=e.scrollTop,o?(r+=s-t/2,e+=n-i/2):(r+=Math.min(s,Math.max(s-t,0)),e+=Math.min(n,Math.max(n-i,0))),new ht.Coordinate(r,e)};var mt={Rect:function(t,e,o,n){this.top=t,this.bottom=e,this.left=o,this.right=n}};mt.Rect.prototype.contains=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},mt.Rect.prototype.intersects=function(t){return!(this.left>t.right||this.rightt.bottom||this.bottomi.top?Bt(o,n,i,r):e+r.heightdocument.documentElement.clientTop?Bt(o,n,i,r):Nt(t,i,r)};var Rt=function(t,e,o,n){return{initialX:(t=St.DropDownDiv.getPositionX(t,o.left,o.right,n.width)).divX,initialY:e,finalX:t.divX,finalY:e+St.DropDownDiv.PADDING_Y,arrowX:t.arrowX,arrowY:-(St.DropDownDiv.ARROW_SIZE/2+St.DropDownDiv.BORDER_SIZE),arrowAtTop:!0,arrowVisible:!0}},Bt=function(t,e,o,n){return{initialX:(t=St.DropDownDiv.getPositionX(t,o.left,o.right,n.width)).divX,initialY:e-n.height,finalX:t.divX,finalY:e-n.height-St.DropDownDiv.PADDING_Y,arrowX:t.arrowX,arrowY:n.height-2*St.DropDownDiv.BORDER_SIZE-St.DropDownDiv.ARROW_SIZE/2,arrowAtTop:!1,arrowVisible:!0}},Nt=function(t,e,o){return{initialX:(t=St.DropDownDiv.getPositionX(t,e.left,e.right,o.width)).divX,initialY:0,finalX:t.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}};St.DropDownDiv.getPositionX=function(t,e,o,n){return e=(0,ct.clamp)(e,t-n/2,o-n),t=t-St.DropDownDiv.ARROW_SIZE/2-e,o=St.DropDownDiv.ARROW_HORIZONTAL_PADDING,{arrowX:t=(0,ct.clamp)(o,t,n-o-St.DropDownDiv.ARROW_SIZE),divX:e}},St.DropDownDiv.isVisible=function(){return!!St.DropDownDiv.owner_},St.DropDownDiv.hideIfOwner=function(t,e){return St.DropDownDiv.owner_===t&&(e?St.DropDownDiv.hideWithoutAnimation():St.DropDownDiv.hide(),!0)},St.DropDownDiv.hide=function(){St.DropDownDiv.DIV_.style.transform="translate(0, 0)",St.DropDownDiv.DIV_.style.opacity=0,St.DropDownDiv.animateOutTimer_=setTimeout((function(){St.DropDownDiv.hideWithoutAnimation()}),1e3*St.DropDownDiv.ANIMATION_TIME),St.DropDownDiv.onHide_&&(St.DropDownDiv.onHide_(),St.DropDownDiv.onHide_=null)},St.DropDownDiv.hideWithoutAnimation=function(){if(St.DropDownDiv.isVisible()){St.DropDownDiv.animateOutTimer_&&clearTimeout(St.DropDownDiv.animateOutTimer_);var e=St.DropDownDiv.DIV_;e.style.transform="",e.style.left="",e.style.top="",e.style.opacity=0,e.style.display="none",e.style.backgroundColor="",e.style.borderColor="",St.DropDownDiv.onHide_&&(St.DropDownDiv.onHide_(),St.DropDownDiv.onHide_=null),St.DropDownDiv.clearContent(),St.DropDownDiv.owner_=null,St.DropDownDiv.rendererClassName_&&((0,M.removeClass)(e,St.DropDownDiv.rendererClassName_),St.DropDownDiv.rendererClassName_=""),St.DropDownDiv.themeClassName_&&((0,M.removeClass)(e,St.DropDownDiv.themeClassName_),St.DropDownDiv.themeClassName_=""),(0,t.module$exports$Blockly$common.getMainWorkspace)().markFocused()}};var Dt=function(t,e,o,n){(t=bt.getPositionMetrics(t,e,o,n)).arrowVisible?(St.DropDownDiv.arrow_.style.display="",St.DropDownDiv.arrow_.style.transform="translate("+t.arrowX+"px,"+t.arrowY+"px) rotate(45deg)",St.DropDownDiv.arrow_.setAttribute("class",t.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):St.DropDownDiv.arrow_.style.display="none",e=Math.floor(t.initialX),o=Math.floor(t.initialY),n=Math.floor(t.finalX);var i=Math.floor(t.finalY),r=St.DropDownDiv.DIV_;return r.style.left=e+"px",r.style.top=o+"px",r.style.display="block",r.style.opacity=1,r.style.transform="translate("+(n-e)+"px,"+(i-o)+"px)",!!t.arrowAtTop};St.DropDownDiv.repositionForWindowResize=function(){if(St.DropDownDiv.owner_){var t=St.DropDownDiv.owner_,e=t.getSourceBlock();e=(t=St.DropDownDiv.positionToField_?Ct(t):It(e)).left+(t.right-t.left)/2,Dt(e,t.bottom,e,t.top)}else St.DropDownDiv.hide()},St.DropDownDiv.TEST_ONLY=bt;var At,xt,wt,Mt={Grid:function(t,e){this.gridPattern_=t,this.spacing_=e.spacing,this.length_=e.length,this.line2_=(this.line1_=t.firstChild)&&this.line1_.nextSibling,this.snapToGrid_=e.snap}};Mt.Grid.prototype.scale_=1,Mt.Grid.prototype.dispose=function(){this.gridPattern_=null},Mt.Grid.prototype.shouldSnap=function(){return this.snapToGrid_},Mt.Grid.prototype.getSpacing=function(){return this.spacing_},Mt.Grid.prototype.getPatternId=function(){return this.gridPattern_.id},Mt.Grid.prototype.update=function(t){this.scale_=t;var e=this.spacing_*t||100;this.gridPattern_.setAttribute("width",e),this.gridPattern_.setAttribute("height",e);var o=(e=Math.floor(this.spacing_/2)+.5)-this.length_/2,n=e+this.length_/2;e*=t,o*=t,n*=t,this.setLineAttributes_(this.line1_,t,o,n,e,e),this.setLineAttributes_(this.line2_,t,e,e,o,n)},Mt.Grid.prototype.setLineAttributes_=function(t,e,o,n,i,r){t&&(t.setAttribute("stroke-width",e),t.setAttribute("x1",o),t.setAttribute("y1",i),t.setAttribute("x2",n),t.setAttribute("y2",r))},Mt.Grid.prototype.moveTo=function(t,e){this.gridPattern_.setAttribute("x",t),this.gridPattern_.setAttribute("y",e),(_.IE||_.EDGE)&&this.update(this.scale_)},Mt.Grid.createDom=function(t,e,o){return t=(0,M.createSvgElement)(vt.Svg.PATTERN,{id:"blocklyGridPattern"+t,patternUnits:"userSpaceOnUse"},o),0/g,"<$1$2>")},t.module$exports$Blockly$Xml.domToPrettyText=function(e){e=(0,t.module$exports$Blockly$Xml.domToText)(e).split("<");for(var o="",n=1;n"!==i.slice(-2)&&(o+=" ")}return(e=(e=e.join("\n")).replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1")).replace(/^\n/,"")},t.module$exports$Blockly$Xml.textToDom=function(e){var o=(0,t.module$exports$Blockly$utils$xml.textToDomDocument)(e);if(!o||!o.documentElement||o.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+e);return o.documentElement},t.module$exports$Blockly$Xml.clearWorkspaceAndLoadFromXml=function(e,o){return o.setResizesEnabled(!1),o.clear(),e=(0,t.module$exports$Blockly$Xml.domToWorkspace)(e,o),o.setResizesEnabled(!0),e},t.module$exports$Blockly$Xml.domToWorkspace=function(e,o){if(e instanceof No.Workspace){var n=e;e=o,o=n,console.warn("Deprecated call to domToWorkspace, swap the arguments.")}var i;o.RTL&&(i=o.getWidth()),n=[],(0,M.startTextWidthCache)();var r=(0,nt.getGroup)();r||(0,nt.setGroup)(!0),o.setResizesEnabled&&o.setResizesEnabled(!1);var s=!0;try{for(var l=0,a=void 0;a=e.childNodes[l];l++){var c=a.nodeName.toLowerCase(),u=a;if("block"===c||"shadow"===c&&!(0,nt.getRecordUndo)()){var p=(0,t.module$exports$Blockly$Xml.domToBlock)(u,o);n.push(p.id);var h=u.hasAttribute("x")?parseInt(u.getAttribute("x"),10):10,d=u.hasAttribute("y")?parseInt(u.getAttribute("y"),10):10;isNaN(h)||isNaN(d)||p.moveBy(o.RTL?i-h:h,d),s=!1}else{if("shadow"===c)throw TypeError("Shadow block cannot be a top-level block.");if("comment"===c)if(o.rendered){var _=fr.WorkspaceCommentSvg;_?_.fromXml(u,o,i):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment.")}else{var g=gr.WorkspaceComment;g?g.fromXml(u,o):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.")}else if("variables"===c){if(!s)throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");(0,t.module$exports$Blockly$Xml.domToVariables)(u,o),s=!1}}}}finally{r||(0,nt.setGroup)(!1),(0,M.stopTextWidthCache)()}return o.setResizesEnabled&&o.setResizesEnabled(!0),(0,nt.fire)(new((0,nt.get)(nt.FINISHED_LOADING))(o)),n},t.module$exports$Blockly$Xml.appendDomToWorkspace=function(e,o){var n;if(Object.prototype.hasOwnProperty.call(o,"scale")&&(n=o.getBlocksBoundingBox()),e=(0,t.module$exports$Blockly$Xml.domToWorkspace)(e,o),n&&n.top!==n.bottom){var i=n.bottom;n=o.RTL?n.right:n.left;for(var r=1/0,s=-1/0,l=1/0,a=0;as&&(s=c.x)}for(i=i-l+10,n=o.RTL?n-s:n-r,r=0;r document.")}else e=null;return e},t.module$exports$Blockly$utils$object={inherits:function(t,e){t.superClass_=e.prototype,Object.setPrototypeOf(t,e),t.prototype=Object.create(e.prototype),t.prototype.constructor=t},mixin:function(t,e){for(var o in e)t[o]=e[o]},deepMerge:function(e,o){for(var n in o)e[n]=null!==o[n]&&"object"==typeof o[n]?(0,t.module$exports$Blockly$utils$object.deepMerge)(e[n]||Object.create(null),o[n]):o[n];return e},values:function(t){return Object.values?Object.values(t):Object.keys(t).map((function(e){return t[e]}))}};var Xt={Theme:function(t,e,o,n){this.name=t,this.blockStyles=e||Object.create(null),this.categoryStyles=o||Object.create(null),this.componentStyles=n||Object.create(null),this.fontStyle=Object.create(null),this.startHats=null,(0,Z.register)(Z.Type.THEME,t,this)}};Xt.Theme.prototype.getClassName=function(){return this.name+"-theme"},Xt.Theme.prototype.setBlockStyle=function(t,e){this.blockStyles[t]=e},Xt.Theme.prototype.setCategoryStyle=function(t,e){this.categoryStyles[t]=e},Xt.Theme.prototype.getComponentStyle=function(t){return(t=this.componentStyles[t])&&"string"==typeof t&&this.getComponentStyle(t)?this.getComponentStyle(t):t?String(t):null},Xt.Theme.prototype.setComponentStyle=function(t,e){this.componentStyles[t]=e},Xt.Theme.prototype.setFontStyle=function(t){this.fontStyle=t},Xt.Theme.prototype.setStartHats=function(t){this.startHats=t},Xt.Theme.defineTheme=function(e,o){var n=new Xt.Theme(e),i=o.base;return i&&("string"==typeof i&&(i=(0,Z.getObject)(Z.Type.THEME,i)),i instanceof Xt.Theme&&((0,t.module$exports$Blockly$utils$object.deepMerge)(n,i),n.name=e)),(0,t.module$exports$Blockly$utils$object.deepMerge)(n.blockStyles,o.blockStyles),(0,t.module$exports$Blockly$utils$object.deepMerge)(n.categoryStyles,o.categoryStyles),(0,t.module$exports$Blockly$utils$object.deepMerge)(n.componentStyles,o.componentStyles),(0,t.module$exports$Blockly$utils$object.deepMerge)(n.fontStyle,o.fontStyle),null!==o.startHats&&(n.startHats=o.startHats),n};var Kt={};Kt.Classic=new Xt.Theme("classic",{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"}},{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"}});var jt={Options:function(t){var e=null,o=!1,n=!1,i=!1,r=!1,s=!1,l=!1,a=!!t.readOnly;a||(e=(0,Ut.convertToolboxDefToJson)(t.toolbox),o=(0,Ut.hasCategories)(e),void 0===(n=t.trashcan)&&(n=o),void 0===(i=t.collapse)&&(i=o),void 0===(r=t.comments)&&(r=o),void 0===(s=t.disable)&&(s=o),void 0===(l=t.sounds)&&(l=!0));var c=t.maxTrashcanContents;n?void 0===c&&(c=32):c=0;var u=!!t.rtl,p=t.horizontalLayout;void 0===p&&(p=!1);var h=t.toolboxPosition;h="end"!==h,h=p?h?Ut.Position.TOP:Ut.Position.BOTTOM:h===u?Ut.Position.RIGHT:Ut.Position.LEFT;var d=t.css;void 0===d&&(d=!0);var _="https://blockly-demo.appspot.com/static/media/";t.media?_=t.media:t.path&&(_=t.path+"media/");var g=void 0===t.oneBasedIndex||!!t.oneBasedIndex,f=t.renderer||"geras",m=t.plugins||{};this.RTL=u,this.oneBasedIndex=g,this.collapse=i,this.comments=r,this.disable=s,this.readOnly=a,this.maxBlocks=t.maxBlocks||1/0,this.maxInstances=t.maxInstances,this.pathToMedia=_,this.hasCategories=o,this.moveOptions=jt.Options.parseMoveOptions_(t,o),this.hasScrollbars=!!this.moveOptions.scrollbars,this.hasTrashcan=n,this.maxTrashcanContents=c,this.hasSounds=l,this.hasCss=d,this.horizontalLayout=p,this.languageTree=e,this.gridOptions=jt.Options.parseGridOptions_(t),this.zoomOptions=jt.Options.parseZoomOptions_(t),this.toolboxPosition=h,this.theme=jt.Options.parseThemeOptions_(t),this.renderer=f,this.rendererOverrides=t.rendererOverrides,this.gridPattern=null,this.parentWorkspace=t.parentWorkspace,this.plugins=m}};jt.Options.parseMoveOptions_=function(t,e){var o=t.move||{},n={};return void 0===o.scrollbars&&void 0===t.scrollbars?n.scrollbars=e:"object"==typeof o.scrollbars?(n.scrollbars={},n.scrollbars.horizontal=!!o.scrollbars.horizontal,n.scrollbars.vertical=!!o.scrollbars.vertical,n.scrollbars.horizontal&&n.scrollbars.vertical?n.scrollbars=!0:n.scrollbars.horizontal||n.scrollbars.vertical||(n.scrollbars=!1)):n.scrollbars=!!o.scrollbars||!!t.scrollbars,n.wheel=n.scrollbars&&void 0!==o.wheel?!!o.wheel:"object"==typeof n.scrollbars,n.drag=!(!n.scrollbars||void 0!==o.drag&&!o.drag),n},jt.Options.parseZoomOptions_=function(t){t=t.zoom||{};var e={};return e.controls=void 0!==t.controls&&!!t.controls,e.wheel=void 0!==t.wheel&&!!t.wheel,e.startScale=void 0===t.startScale?1:Number(t.startScale),e.maxScale=void 0===t.maxScale?3:Number(t.maxScale),e.minScale=void 0===t.minScale?.3:Number(t.minScale),e.scaleSpeed=void 0===t.scaleSpeed?1.2:Number(t.scaleSpeed),e.pinch=void 0===t.pinch?e.wheel||e.controls:!!t.pinch,e},jt.Options.parseGridOptions_=function(t){t=t.grid||{};var e={};return e.spacing=Number(t.spacing)||0,e.colour=t.colour||"#888",e.length=void 0===t.length?1:Number(t.length),e.snap=0=t||isNaN(t)?0:Math.min(t,this.scrollbarLength_)},Jt.Scrollbar.prototype.setHandleLength_=function(t){this.handleLength_=t,this.svgHandle_.setAttribute(this.lengthAttribute_,this.handleLength_)},Jt.Scrollbar.prototype.constrainHandlePosition_=function(t){return 0>=t||isNaN(t)?0:Math.min(t,this.scrollbarLength_-this.handleLength_)},Jt.Scrollbar.prototype.setHandlePosition=function(t){this.handlePosition_=t,this.svgHandle_.setAttribute(this.positionAttribute_,this.handlePosition_)},Jt.Scrollbar.prototype.setScrollbarLength_=function(t){this.scrollbarLength_=t,this.outerSvg_.setAttribute(this.lengthAttribute_,this.scrollbarLength_),this.svgBackground_.setAttribute(this.lengthAttribute_,this.scrollbarLength_)},Jt.Scrollbar.prototype.setPosition=function(t,e){this.position.x=t,this.position.y=e,(0,M.setCssTransform)(this.outerSvg_,"translate("+(this.position.x+this.origin_.x)+"px,"+(this.position.y+this.origin_.y)+"px)")},Jt.Scrollbar.prototype.resize=function(t){(t||(t=this.workspace_.getMetrics()))&&(this.oldHostMetrics_&&Jt.Scrollbar.metricsAreEquivalent_(t,this.oldHostMetrics_)||(this.horizontal_?this.resizeHorizontal_(t):this.resizeVertical_(t),this.oldHostMetrics_=t,this.updateMetrics_()))},Jt.Scrollbar.prototype.requiresViewResize_=function(t){return!this.oldHostMetrics_||this.oldHostMetrics_.viewWidth!==t.viewWidth||this.oldHostMetrics_.viewHeight!==t.viewHeight||this.oldHostMetrics_.absoluteLeft!==t.absoluteLeft||this.oldHostMetrics_.absoluteTop!==t.absoluteTop},Jt.Scrollbar.prototype.resizeHorizontal_=function(t){this.requiresViewResize_(t)?this.resizeViewHorizontal(t):this.resizeContentHorizontal(t)},Jt.Scrollbar.prototype.resizeViewHorizontal=function(t){var e=t.viewWidth-2*this.margin_;this.pair_&&(e-=Jt.Scrollbar.scrollbarThickness),this.setScrollbarLength_(Math.max(0,e)),e=t.absoluteLeft+this.margin_,this.pair_&&this.workspace_.RTL&&(e+=Jt.Scrollbar.scrollbarThickness),this.setPosition(e,t.absoluteTop+t.viewHeight-Jt.Scrollbar.scrollbarThickness-this.margin_),this.resizeContentHorizontal(t)},Jt.Scrollbar.prototype.resizeContentHorizontal=function(t){if(t.viewWidth>=t.scrollWidth)this.setHandleLength_(this.scrollbarLength_),this.setHandlePosition(0),this.pair_||this.setVisible(!1);else{this.pair_||this.setVisible(!0);var e=this.scrollbarLength_*t.viewWidth/t.scrollWidth;e=this.constrainHandleLength_(e),this.setHandleLength_(e),e=t.scrollWidth-t.viewWidth;var o=this.scrollbarLength_-this.handleLength_;t=(t.viewLeft-t.scrollLeft)/e*o,t=this.constrainHandlePosition_(t),this.setHandlePosition(t),this.ratio=o/e}},Jt.Scrollbar.prototype.resizeVertical_=function(t){this.requiresViewResize_(t)?this.resizeViewVertical(t):this.resizeContentVertical(t)},Jt.Scrollbar.prototype.resizeViewVertical=function(t){var e=t.viewHeight-2*this.margin_;this.pair_&&(e-=Jt.Scrollbar.scrollbarThickness),this.setScrollbarLength_(Math.max(0,e)),this.setPosition(this.workspace_.RTL?t.absoluteLeft+this.margin_:t.absoluteLeft+t.viewWidth-Jt.Scrollbar.scrollbarThickness-this.margin_,t.absoluteTop+this.margin_),this.resizeContentVertical(t)},Jt.Scrollbar.prototype.resizeContentVertical=function(t){if(t.viewHeight>=t.scrollHeight)this.setHandleLength_(this.scrollbarLength_),this.setHandlePosition(0),this.pair_||this.setVisible(!1);else{this.pair_||this.setVisible(!0);var e=this.scrollbarLength_*t.viewHeight/t.scrollHeight;e=this.constrainHandleLength_(e),this.setHandleLength_(e),e=t.scrollHeight-t.viewHeight;var o=this.scrollbarLength_-this.handleLength_;t=(t.viewTop-t.scrollTop)/e*o,t=this.constrainHandlePosition_(t),this.setHandlePosition(t),this.ratio=o/e}},Jt.Scrollbar.prototype.createDom_=function(t){var e="blocklyScrollbar"+(this.horizontal_?"Horizontal":"Vertical");t&&(e+=" "+t),this.outerSvg_=(0,M.createSvgElement)(vt.Svg.SVG,{class:e},null),this.svgGroup_=(0,M.createSvgElement)(vt.Svg.G,{},this.outerSvg_),this.svgBackground_=(0,M.createSvgElement)(vt.Svg.RECT,{class:"blocklyScrollbarBackground"},this.svgGroup_),t=Math.floor((Jt.Scrollbar.scrollbarThickness-5)/2),this.svgHandle_=(0,M.createSvgElement)(vt.Svg.RECT,{class:"blocklyScrollbarHandle",rx:t,ry:t},this.svgGroup_),this.workspace_.getThemeManager().subscribe(this.svgHandle_,"scrollbarColour","fill"),this.workspace_.getThemeManager().subscribe(this.svgHandle_,"scrollbarOpacity","fill-opacity"),(0,M.insertAfter)(this.outerSvg_,this.workspace_.getParentSvg())},Jt.Scrollbar.prototype.isVisible=function(){return this.isVisible_},Jt.Scrollbar.prototype.setContainerVisible=function(t){var e=t!==this.containerVisible_;this.containerVisible_=t,e&&this.updateDisplay_()},Jt.Scrollbar.prototype.setVisible=function(t){var e=t!==this.isVisible();if(this.pair_)throw Error("Unable to toggle visibility of paired scrollbars.");this.isVisible_=t,e&&this.updateDisplay_()},Jt.Scrollbar.prototype.updateDisplay_=function(){this.containerVisible_&&this.isVisible()?this.outerSvg_.setAttribute("display","block"):this.outerSvg_.setAttribute("display","none")},Jt.Scrollbar.prototype.onMouseDownBar_=function(t){if(this.workspace_.markFocused(),(0,p.clearTouchIdentifier)(),this.cleanUp_(),(0,f.isRightButton)(t))t.stopPropagation();else{var e=(0,f.mouseToSvg)(t,this.workspace_.getParentSvg(),this.workspace_.getInverseScreenCTM());e=this.horizontal_?e.x:e.y;var o=(0,yt.getInjectionDivXY)(this.svgHandle_);o=this.horizontal_?o.x:o.y;var n=this.handlePosition_,i=.95*this.handleLength_;e<=o?n-=i:e>=o+this.handleLength_&&(n+=i),this.setHandlePosition(this.constrainHandlePosition_(n)),this.updateMetrics_(),t.stopPropagation(),t.preventDefault()}},Jt.Scrollbar.prototype.onMouseDownHandle_=function(t){this.workspace_.markFocused(),this.cleanUp_(),(0,f.isRightButton)(t)?t.stopPropagation():(this.startDragHandle=this.handlePosition_,this.workspace_.setupDragSurface(),this.startDragMouse_=this.horizontal_?t.clientX:t.clientY,Jt.Scrollbar.onMouseUpWrapper_=(0,f.conditionalBind)(document,"mouseup",this,this.onMouseUpHandle_),Jt.Scrollbar.onMouseMoveWrapper_=(0,f.conditionalBind)(document,"mousemove",this,this.onMouseMoveHandle_),t.stopPropagation(),t.preventDefault())},Jt.Scrollbar.prototype.onMouseMoveHandle_=function(t){this.setHandlePosition(this.constrainHandlePosition_(this.startDragHandle+((this.horizontal_?t.clientX:t.clientY)-this.startDragMouse_))),this.updateMetrics_()},Jt.Scrollbar.prototype.onMouseUpHandle_=function(){this.workspace_.resetDragSurface(),(0,p.clearTouchIdentifier)(),this.cleanUp_()},Jt.Scrollbar.prototype.cleanUp_=function(){this.workspace_.hideChaff(!0),Jt.Scrollbar.onMouseUpWrapper_&&((0,f.unbind)(Jt.Scrollbar.onMouseUpWrapper_),Jt.Scrollbar.onMouseUpWrapper_=null),Jt.Scrollbar.onMouseMoveWrapper_&&((0,f.unbind)(Jt.Scrollbar.onMouseMoveWrapper_),Jt.Scrollbar.onMouseMoveWrapper_=null)},Jt.Scrollbar.prototype.getRatio_=function(){var t=this.handlePosition_/(this.scrollbarLength_-this.handleLength_);return isNaN(t)&&(t=0),t},Jt.Scrollbar.prototype.updateMetrics_=function(){var t=this.getRatio_(),e={};this.horizontal_?e.x=t:e.y=t,this.workspace_.setMetrics(e)},Jt.Scrollbar.prototype.set=function(t,e){this.setHandlePosition(this.constrainHandlePosition_(t*this.ratio)),(e||void 0===e)&&this.updateMetrics_()},Jt.Scrollbar.prototype.setOrigin=function(t,e){this.origin_=new ht.Coordinate(t,e)};var zt={ScrollbarPair:function(t,e,o,n,i){this.workspace_=t,o=void 0===o||o;var r=(e=void 0===e||e)&&o;e&&(this.hScroll=new Jt.Scrollbar(t,!0,r,n,i)),o&&(this.vScroll=new Jt.Scrollbar(t,!1,r,n,i)),r&&(this.corner_=(0,M.createSvgElement)(vt.Svg.RECT,{height:Jt.Scrollbar.scrollbarThickness,width:Jt.Scrollbar.scrollbarThickness,class:"blocklyScrollbarBackground"},null),(0,M.insertAfter)(this.corner_,t.getBubbleCanvas())),this.oldHostMetrics_=null}};zt.ScrollbarPair.prototype.dispose=function(){(0,M.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)},zt.ScrollbarPair.prototype.resize=function(){var t=this.workspace_.getMetrics();if(t){var e=!1,o=!1;if(this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth===t.viewWidth&&this.oldHostMetrics_.viewHeight===t.viewHeight&&this.oldHostMetrics_.absoluteTop===t.absoluteTop&&this.oldHostMetrics_.absoluteLeft===t.absoluteLeft?(this.oldHostMetrics_&&this.oldHostMetrics_.scrollWidth===t.scrollWidth&&this.oldHostMetrics_.viewLeft===t.viewLeft&&this.oldHostMetrics_.scrollLeft===t.scrollLeft||(e=!0),this.oldHostMetrics_&&this.oldHostMetrics_.scrollHeight===t.scrollHeight&&this.oldHostMetrics_.viewTop===t.viewTop&&this.oldHostMetrics_.scrollTop===t.scrollTop||(o=!0)):o=e=!0,e||o){try{(0,nt.disable)(),this.hScroll&&e&&this.hScroll.resize(t),this.vScroll&&o&&this.vScroll.resize(t)}finally{(0,nt.enable)()}this.workspace_.maybeFireViewportChangeEvent()}this.hScroll&&this.vScroll&&(this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth===t.viewWidth&&this.oldHostMetrics_.absoluteLeft===t.absoluteLeft||this.corner_.setAttribute("x",this.vScroll.position.x),this.oldHostMetrics_&&this.oldHostMetrics_.viewHeight===t.viewHeight&&this.oldHostMetrics_.absoluteTop===t.absoluteTop||this.corner_.setAttribute("y",this.hScroll.position.y)),this.oldHostMetrics_=t}},zt.ScrollbarPair.prototype.canScrollHorizontally=function(){return!!this.hScroll},zt.ScrollbarPair.prototype.canScrollVertically=function(){return!!this.vScroll},zt.ScrollbarPair.prototype.setOrigin=function(t,e){this.hScroll&&this.hScroll.setOrigin(t,e),this.vScroll&&this.vScroll.setOrigin(t,e)},zt.ScrollbarPair.prototype.set=function(t,e,o){this.hScroll&&this.hScroll.set(t,!1),this.vScroll&&this.vScroll.set(e,!1),(o||void 0===o)&&(t={},this.hScroll&&(t.x=this.hScroll.getRatio_()),this.vScroll&&(t.y=this.vScroll.getRatio_()),this.workspace_.setMetrics(t))},zt.ScrollbarPair.prototype.setX=function(t){this.hScroll&&this.hScroll.set(t,!0)},zt.ScrollbarPair.prototype.setY=function(t){this.vScroll&&this.vScroll.set(t,!0)},zt.ScrollbarPair.prototype.setContainerVisible=function(t){this.hScroll&&this.hScroll.setContainerVisible(t),this.vScroll&&this.vScroll.setContainerVisible(t)},zt.ScrollbarPair.prototype.isVisible=function(){var t=!1;return this.hScroll&&(t=this.hScroll.isVisible()),this.vScroll&&(t=t||this.vScroll.isVisible()),t},zt.ScrollbarPair.prototype.resizeContent=function(t){this.hScroll&&this.hScroll.resizeContentHorizontal(t),this.vScroll&&this.vScroll.resizeContentVertical(t)},zt.ScrollbarPair.prototype.resizeView=function(t){this.hScroll&&this.hScroll.resizeViewHorizontal(t),this.vScroll&&this.vScroll.resizeViewVertical(t)};var qt={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},Zt={ShortcutRegistry:function(){Zt.ShortcutRegistry.registry=this,this.registry_=Object.create(null),this.keyMap_=Object.create(null)}};Zt.ShortcutRegistry.modifierKeys={Shift:qt.SHIFT,Control:qt.CTRL,Alt:qt.ALT,Meta:qt.META},Zt.ShortcutRegistry.prototype.register=function(t,e){if(this.registry_[t.name]&&!e)throw Error('Shortcut with name "'+t.name+'" already exists.');this.registry_[t.name]=t},Zt.ShortcutRegistry.prototype.unregister=function(t){return this.registry_[t]?(this.removeAllKeyMappings(t),delete this.registry_[t],!0):(console.warn('Keyboard shortcut with name "'+t+'" not found.'),!1)},Zt.ShortcutRegistry.prototype.addKeyMapping=function(t,e,o){t=String(t);var n=this.keyMap_[t];if(n&&!o)throw Error('Shortcut with name "'+e+'" collides with shortcuts '+n.toString());n&&o?n.unshift(e):this.keyMap_[t]=[e]},Zt.ShortcutRegistry.prototype.removeKeyMapping=function(t,e,o){var n=this.keyMap_[t];if(!n&&!o)return console.warn('No keyboard shortcut with name "'+e+'" registered with key code "'+t+'"'),!1;var i=n.indexOf(e);return-1n.indexOf(o))throw Error(o+" is not a valid modifier key.")},Zt.ShortcutRegistry.prototype.createSerializedKey=function(t,e){var o="";if(e)for(var n in this.checkModifiers_(e),Zt.ShortcutRegistry.modifierKeys)-1t?this.menuItems_.length:t,-1)},ne.Menu.prototype.highlightFirst_=function(){this.highlightHelper_(-1,1)},ne.Menu.prototype.highlightLast_=function(){this.highlightHelper_(this.menuItems_.length,-1)},ne.Menu.prototype.highlightHelper_=function(t,e){t+=e;for(var o;o=this.menuItems_[t];){if(o.isEnabled()){this.setHighlighted(o);break}t+=e}},ne.Menu.prototype.handleMouseOver_=function(t){(t=this.getMenuItem_(t.target))&&(t.isEnabled()?this.highlightedItem_!==t&&this.setHighlighted(t):this.setHighlighted(null))},ne.Menu.prototype.handleClick_=function(t){var e=this.openingCoords;if(this.openingCoords=null,e&&"number"==typeof t.clientX){var o=new ht.Coordinate(t.clientX,t.clientY);if(1>ht.Coordinate.distance(e,o))return}(t=this.getMenuItem_(t.target))&&t.performAction()},ne.Menu.prototype.handleMouseEnter_=function(t){this.focus()},ne.Menu.prototype.handleMouseLeave_=function(t){this.getElement()&&(this.blur_(),this.setHighlighted(null))},ne.Menu.prototype.handleKeyEvent_=function(t){if(this.menuItems_.length&&!(t.shiftKey||t.ctrlKey||t.metaKey||t.altKey)){var e=this.highlightedItem_;switch(t.keyCode){case qt.ENTER:case qt.SPACE:e&&e.performAction();break;case qt.UP:this.highlightPrevious();break;case qt.DOWN:this.highlightNext();break;case qt.PAGE_UP:case qt.HOME:this.highlightFirst_();break;case qt.PAGE_DOWN:case qt.END:this.highlightLast_();break;default:return}t.preventDefault(),t.stopPropagation()}},ne.Menu.prototype.getSize=function(){var t=this.getElement(),e=(0,_t.getSize)(t);return e.height=t.scrollHeight,e};var ie={VARIABLES:100,BLOCKS:50},re={register:function(t,e){(0,Z.register)(Z.Type.SERIALIZER,t,e)},unregister:function(t){(0,Z.unregister)(Z.Type.SERIALIZER,t)}},se={DeserializationError:function(){var t=Error.apply(this,arguments);this.message=t.message,"stack"in t&&(this.stack=t.stack)}};e.inherits(se.DeserializationError,Error),se.MissingBlockType=function(t){se.DeserializationError.call(this,"Expected to find a 'type' property, defining the block type"),this.state=t},e.inherits(se.MissingBlockType,se.DeserializationError),se.MissingConnection=function(t,e,o){se.DeserializationError.call(this,"The block "+e.toDevString()+" is missing a(n) "+t+"\nconnection"),this.block=e,this.state=o},e.inherits(se.MissingConnection,se.DeserializationError),se.BadConnectionCheck=function(t,e,o,n){se.DeserializationError.call(this,"The block "+o.toDevString()+" could not connect its\n"+e+" to its parent, because: "+t),this.childBlock=o,this.childState=n},e.inherits(se.BadConnectionCheck,se.DeserializationError),se.RealChildOfShadow=function(t){se.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=t},e.inherits(se.RealChildOfShadow,se.DeserializationError);var le={ISerializer:function(){}};le.ISerializer.prototype.save=function(t){},le.ISerializer.prototype.load=function(t,e){},le.ISerializer.prototype.clear=function(t){};var ae={save:function(t,e){var o=void 0===e?{}:e;e=void 0!==o.addCoordinates&&o.addCoordinates;var n=void 0===o.addInputBlocks||o.addInputBlocks,i=void 0===o.addNextBlocks||o.addNextBlocks;if(o=void 0===o.doFullSerialization||o.doFullSerialization,t.isInsertionMarker())return null;var r={type:t.type,id:t.id};return e&&ue(t,r),ce(t,r),pe(t,r),he(t,r),de(t,r,o),n&&_e(t,r,o),i&&ge(t,r,o),r}},ce=function(t,e){t.isCollapsed()&&(e.collapsed=!0),t.isEnabled()||(e.enabled=!1),void 0!==t.inputsInline&&t.inputsInline!==t.inputsInlineDefault&&(e.inline=t.inputsInline),t.data&&(e.data=t.data)},ue=function(t,e){var o=t.workspace;t=t.getRelativeToSurfaceXY(),e.x=Math.round(o.RTL?o.getWidth()-t.x:t.x),e.y=Math.round(t.y)},pe=function(e,o){e.saveExtraState?null!==(e=e.saveExtraState())&&(o.extraState=e):e.mutationToDom&&null!==(e=e.mutationToDom())&&(o.extraState=(0,t.module$exports$Blockly$Xml.domToText)(e).replace(' xmlns="https://developers.google.com/blockly/xml"',""))},he=function(t,e){t.getCommentText()&&(e.icons={comment:{text:t.getCommentText(),pinned:t.commentModel.pinned,height:Math.round(t.commentModel.size.height),width:Math.round(t.commentModel.size.width)}})},de=function(t,e,o){for(var n=Object.create(null),i=0;it&&0<=e&&256>e&&0<=o&&256>o)?(0,Ke.rgbToHex)(t,e,o):null},Ke.rgbToHex=function(t,e,o){return e=t<<16|e<<8|o,16>t?"#"+(16777216|e).toString(16).substr(1):"#"+e.toString(16)},Ke.hexToRgb=function(t){return(t=(0,Ke.parse)(t))?[(t=parseInt(t.substr(1),16))>>16,t>>8&255,255&t]:[0,0,0]},Ke.hsvToHex=function(t,e,o){var n=0,i=0,r=0;if(0===e)r=i=n=o;else{var s=Math.floor(t/60),l=t/60-s;t=o*(1-e);var a=o*(1-e*l);switch(e=o*(1-e*(1-l)),s){case 1:n=a,i=o,r=t;break;case 2:n=t,i=o,r=e;break;case 3:n=t,i=a,r=o;break;case 4:n=e,i=t,r=o;break;case 5:n=o,i=t,r=a;break;case 6:case 0:n=o,i=e,r=t}}return(0,Ke.rgbToHex)(Math.floor(n),Math.floor(i),Math.floor(r))},Ke.blend=function(t,e,o){return(t=(0,Ke.parse)(t))&&(e=(0,Ke.parse)(e))?(t=(0,Ke.hexToRgb)(t),e=(0,Ke.hexToRgb)(e),(0,Ke.rgbToHex)(Math.round(e[0]+o*(t[0]-e[0])),Math.round(e[1]+o*(t[1]-e[1])),Math.round(e[2]+o*(t[2]-e[2])))):null},Ke.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"},Ke.hueToHex=function(t){return(0,Ke.hsvToHex)(t,je,255*Je)};var ze={point:function(t,e){return" "+t+","+e+" "},curve:function(t,e){return" "+t+e.join("")},moveTo:function(t,e){return" M "+t+","+e+" "},moveBy:function(t,e){return" m "+t+","+e+" "},lineTo:function(t,e){return" l "+t+","+e+" "},line:function(t){return" l"+t.join("")},lineOnAxis:function(t,e){return" "+t+" "+e+" "},arc:function(t,e,o,n){return t+" "+o+" "+o+" "+e+n}},qe={},Ze=function(e,o){var n=[],i=e.split("");i.push("");var r=0;e=[];for(var s=null,l=0;l=a?(r=2,s=a,(a=e.join(""))&&n.push(a),e.length=0):"{"===a?r=3:(e.push("%",a),r=0):2===r?"0"<=a&&"9">=a?s+=a:(n.push(parseInt(s,10)),l--,r=0):3===r&&(""===a?(e.splice(0,0,"%{"),l--,r=0):"}"!==a?e.push(a):(r=e.join(""),/[A-Z]\w*/i.test(r)?(a=r.toUpperCase(),(a=(0,t.module$exports$Blockly$utils$string.startsWith)(a,"BKY_")?a.substring(4):null)&&a in t.module$exports$Blockly$Msg.Msg?"string"==typeof(r=t.module$exports$Blockly$Msg.Msg[a])?Array.prototype.push.apply(n,Ze(r,o)):o?n.push(String(r)):n.push(r):n.push("%{"+r+"}")):n.push("%{"+r+"}"),r=e.length=0))}for((o=e.join(""))&&n.push(o),i=[],s=e.length=0;s=o)return{hue:o,hex:(0,Ke.hsvToHex)(o,(0,Ke.getHsvSaturation)(),255*(0,Ke.getHsvValue)())};if(o=(0,Ke.parse)(e))return{hue:null,hex:o};throw o='Invalid colour: "'+e+'"',t!==e&&(o+=' (from "'+t+'")'),Error(o)};var Qe={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,ze.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=!_.IE&&!_.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}}};Qe.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()},Qe.ConstantProvider.prototype.setTheme=function(t){this.blockStyles=Object.create(null);var e,o=t.blockStyles;for(e in o)this.blockStyles[e]=this.validatedBlockStyle_(o[e]);this.setDynamicProperties_(t)},Qe.ConstantProvider.prototype.setDynamicProperties_=function(t){this.setFontConstants_(t),this.setComponentConstants_(t),this.ADD_START_HATS=null!==t.startHats?t.startHats:this.ADD_START_HATS},Qe.ConstantProvider.prototype.setFontConstants_=function(t){this.FIELD_TEXT_FONTFAMILY=t.fontStyle&&void 0!==t.fontStyle.family?t.fontStyle.family:this.FIELD_TEXT_FONTFAMILY,this.FIELD_TEXT_FONTWEIGHT=t.fontStyle&&void 0!==t.fontStyle.weight?t.fontStyle.weight:this.FIELD_TEXT_FONTWEIGHT,this.FIELD_TEXT_FONTSIZE=t.fontStyle&&void 0!==t.fontStyle.size?t.fontStyle.size:this.FIELD_TEXT_FONTSIZE,t=(0,M.measureFontMetrics)("Hg",this.FIELD_TEXT_FONTSIZE+"pt",this.FIELD_TEXT_FONTWEIGHT,this.FIELD_TEXT_FONTFAMILY),this.FIELD_TEXT_HEIGHT=t.height,this.FIELD_TEXT_BASELINE=t.baseline},Qe.ConstantProvider.prototype.setComponentConstants_=function(t){this.CURSOR_COLOUR=t.getComponentStyle("cursorColour")||this.CURSOR_COLOUR,this.MARKER_COLOUR=t.getComponentStyle("markerColour")||this.MARKER_COLOUR,this.INSERTION_MARKER_COLOUR=t.getComponentStyle("insertionMarkerColour")||this.INSERTION_MARKER_COLOUR,this.INSERTION_MARKER_OPACITY=Number(t.getComponentStyle("insertionMarkerOpacity"))||this.INSERTION_MARKER_OPACITY},Qe.ConstantProvider.prototype.getBlockStyleForColour=function(t){var e="auto_"+t;return this.blockStyles[e]||(this.blockStyles[e]=this.createBlockStyle_(t)),{style:this.blockStyles[e],name:e}},Qe.ConstantProvider.prototype.getBlockStyle=function(t){return this.blockStyles[t||""]||(t&&0===t.indexOf("auto_")?this.getBlockStyleForColour(t.substring(5)).style:this.createBlockStyle_("#000000"))},Qe.ConstantProvider.prototype.createBlockStyle_=function(t){return this.validatedBlockStyle_({colourPrimary:t})},Qe.ConstantProvider.prototype.validatedBlockStyle_=function(e){var o={};return e&&(0,t.module$exports$Blockly$utils$object.mixin)(o,e),e=(0,qe.parseBlockColour)(o.colourPrimary||"#000"),o.colourPrimary=e.hex,o.colourSecondary=o.colourSecondary?(0,qe.parseBlockColour)(o.colourSecondary).hex:this.generateSecondaryColour_(o.colourPrimary),o.colourTertiary=o.colourTertiary?(0,qe.parseBlockColour)(o.colourTertiary).hex:this.generateTertiaryColour_(o.colourPrimary),o.hat=o.hat||"",o},Qe.ConstantProvider.prototype.generateSecondaryColour_=function(t){return(0,Ke.blend)("#fff",t,.6)||t},Qe.ConstantProvider.prototype.generateTertiaryColour_=function(t){return(0,Ke.blend)("#fff",t,.3)||t},Qe.ConstantProvider.prototype.dispose=function(){this.embossFilter_&&(0,M.removeNode)(this.embossFilter_),this.disabledPattern_&&(0,M.removeNode)(this.disabledPattern_),this.debugFilter_&&(0,M.removeNode)(this.debugFilter_),this.cssNode_=null},Qe.ConstantProvider.prototype.makeJaggedTeeth=function(){var t=this.JAGGED_TEETH_HEIGHT,e=this.JAGGED_TEETH_WIDTH;return{height:t,width:e,path:(0,ze.line)([(0,ze.point)(e,t/4),(0,ze.point)(2*-e,t/2),(0,ze.point)(e,t/4)])}},Qe.ConstantProvider.prototype.makeStartHat=function(){var t=this.START_HAT_HEIGHT,e=this.START_HAT_WIDTH;return{height:t,width:e,path:(0,ze.curve)("c",[(0,ze.point)(30,-t),(0,ze.point)(70,-t),(0,ze.point)(e,0)])}},Qe.ConstantProvider.prototype.makePuzzleTab=function(){function t(t){var n=-(t=t?-1:1),i=o/2,r=i+2.5,s=i+.5,l=(0,ze.point)(-e,t*i);return i=(0,ze.point)(e,t*i),(0,ze.curve)("c",[(0,ze.point)(0,t*r),(0,ze.point)(-e,n*s),l])+(0,ze.curve)("s",[(0,ze.point)(e,2.5*n),i])}var e=this.TAB_WIDTH,o=this.TAB_HEIGHT,n=t(!0),i=t(!1);return{type:this.SHAPES.PUZZLE,width:e,height:o,pathDown:i,pathUp:n}},Qe.ConstantProvider.prototype.makeNotch=function(){function t(t){return(0,ze.line)([(0,ze.point)(t*n,o),(0,ze.point)(3*t,0),(0,ze.point)(t*n,-o)])}var e=this.NOTCH_WIDTH,o=this.NOTCH_HEIGHT,n=(e-3)/2,i=t(1),r=t(-1);return{type:this.SHAPES.NOTCH,width:e,height:o,pathLeft:i,pathRight:r}},Qe.ConstantProvider.prototype.makeInsideCorners=function(){var t=this.CORNER_RADIUS;return{width:t,height:t,pathTop:(0,ze.arc)("a","0 0,0",t,(0,ze.point)(-t,t)),pathBottom:(0,ze.arc)("a","0 0,0",t,(0,ze.point)(t,t))}},Qe.ConstantProvider.prototype.makeOutsideCorners=function(){var t=this.CORNER_RADIUS,e=(0,ze.moveBy)(0,t)+(0,ze.arc)("a","0 0,1",t,(0,ze.point)(t,-t)),o=(0,ze.arc)("a","0 0,1",t,(0,ze.point)(t,t)),n=(0,ze.arc)("a","0 0,1",t,(0,ze.point)(-t,-t));return{topLeft:e,topRight:o,bottomRight:(0,ze.arc)("a","0 0,1",t,(0,ze.point)(-t,t)),bottomLeft:n,rightHeight:t}},Qe.ConstantProvider.prototype.shapeFor=function(e){switch(e.type){case t.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE:case t.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE:return this.PUZZLE_TAB;case t.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT:case t.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown connection type")}},Qe.ConstantProvider.prototype.createDom=function(t,e,o){this.injectCSS_(e,o),this.defs_=(0,M.createSvgElement)(vt.Svg.DEFS,{},t),t=(0,M.createSvgElement)(vt.Svg.FILTER,{id:"blocklyEmbossFilter"+this.randomIdentifier},this.defs_),(0,M.createSvgElement)(vt.Svg.FEGAUSSIANBLUR,{in:"SourceAlpha",stdDeviation:1,result:"blur"},t),e=(0,M.createSvgElement)(vt.Svg.FESPECULARLIGHTING,{in:"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},t),(0,M.createSvgElement)(vt.Svg.FEPOINTLIGHT,{x:-5e3,y:-1e4,z:2e4},e),(0,M.createSvgElement)(vt.Svg.FECOMPOSITE,{in:"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},t),(0,M.createSvgElement)(vt.Svg.FECOMPOSITE,{in:"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},t),this.embossFilterId=t.id,this.embossFilter_=t,t=(0,M.createSvgElement)(vt.Svg.PATTERN,{id:"blocklyDisabledPattern"+this.randomIdentifier,patternUnits:"userSpaceOnUse",width:10,height:10},this.defs_),(0,M.createSvgElement)(vt.Svg.RECT,{width:10,height:10,fill:"#aaa"},t),(0,M.createSvgElement)(vt.Svg.PATH,{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},t),this.disabledPatternId=t.id,this.disabledPattern_=t,this.createDebugFilter()},Qe.ConstantProvider.prototype.createDebugFilter=function(){if(!this.debugFilter_){var t=(0,M.createSvgElement)(vt.Svg.FILTER,{id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},this.defs_),e=(0,M.createSvgElement)(vt.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},t);(0,M.createSvgElement)(vt.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},e),(0,M.createSvgElement)(vt.Svg.FEFLOOD,{"flood-color":"#ff0000","flood-opacity":.5,result:"outColor"},t),(0,M.createSvgElement)(vt.Svg.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.debugFilterId=t.id,this.debugFilter_=t}},Qe.ConstantProvider.prototype.injectCSS_=function(t,e){e=this.getCSS_(e),t="blockly-renderer-style-"+t,this.cssNode_=document.getElementById(t);var o=e.join("\n");this.cssNode_?this.cssNode_.firstChild.textContent=o:((e=document.createElement("style")).id=t,t=document.createTextNode(o),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild),this.cssNode_=e)},Qe.ConstantProvider.prototype.getCSS_=function(t){return[t+" .blocklyText, ",t+" .blocklyFlyoutLabelText {","font: "+this.FIELD_TEXT_FONTWEIGHT+" "+this.FIELD_TEXT_FONTSIZE+"pt "+this.FIELD_TEXT_FONTFAMILY+";","}",t+" .blocklyText {","fill: #fff;","}",t+" .blocklyNonEditableText>rect,",t+" .blocklyEditableText>rect {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","fill-opacity: .6;","stroke: none;","}",t+" .blocklyNonEditableText>text,",t+" .blocklyEditableText>text {","fill: #000;","}",t+" .blocklyFlyoutLabelText {","fill: #000;","}",t+" .blocklyText.blocklyBubbleText {","fill: #000;","}",t+" .blocklyEditableText:not(.editing):hover>rect {","stroke: #fff;","stroke-width: 2;","}",t+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",t+" .blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",t+" .blocklyHighlightedConnectionPath {","stroke: #fc3;","}",t+" .blocklyReplaceable .blocklyPath {","fill-opacity: .5;","}",t+" .blocklyReplaceable .blocklyPathLight,",t+" .blocklyReplaceable .blocklyPathDark {","display: none;","}",t+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"]};var to={register:function(t,e){(0,Z.register)(Z.Type.FIELD,t,e)},unregister:function(t){(0,Z.unregister)(Z.Type.FIELD,t)},fromJson:function(t){var e=(0,Z.getObject)(Z.Type.FIELD,t.type);return e?e.fromJson(t):(console.warn("Blockly could not create a field of type "+t.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)}},eo={MarkerManager:function(t){this.cursorSvg_=this.cursor_=null,this.markers_=Object.create(null),this.workspace_=t}};eo.MarkerManager.LOCAL_MARKER="local_marker_1",eo.MarkerManager.prototype.registerMarker=function(t,e){this.markers_[t]&&this.unregisterMarker(t),e.setDrawer(this.workspace_.getRenderer().makeMarkerDrawer(this.workspace_,e)),this.setMarkerSvg(e.getDrawer().createDom()),this.markers_[t]=e},eo.MarkerManager.prototype.unregisterMarker=function(t){var e=this.markers_[t];if(!e)throw Error("Marker with ID "+t+" does not exist. Can only unregister markers that exist.");e.dispose(),delete this.markers_[t]},eo.MarkerManager.prototype.getCursor=function(){return this.cursor_},eo.MarkerManager.prototype.getMarker=function(t){return this.markers_[t]||null},eo.MarkerManager.prototype.setCursor=function(t){this.cursor_&&this.cursor_.getDrawer()&&this.cursor_.getDrawer().dispose(),(this.cursor_=t)&&(t=this.workspace_.getRenderer().makeMarkerDrawer(this.workspace_,this.cursor_),this.cursor_.setDrawer(t),this.setCursorSvg(this.cursor_.getDrawer().createDom()))},eo.MarkerManager.prototype.setCursorSvg=function(t){t?(this.workspace_.getBlockCanvas().appendChild(t),this.cursorSvg_=t):this.cursorSvg_=null},eo.MarkerManager.prototype.setMarkerSvg=function(t){t?this.workspace_.getBlockCanvas()&&(this.cursorSvg_?this.workspace_.getBlockCanvas().insertBefore(t,this.cursorSvg_):this.workspace_.getBlockCanvas().appendChild(t)):this.markerSvg_=null},eo.MarkerManager.prototype.updateMarkers=function(){this.workspace_.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace_.getCursor().draw()},eo.MarkerManager.prototype.dispose=function(){for(var t,e=Object.keys(this.markers_),o=0;t=e[o];o++)this.unregisterMarker(t);this.markers_=null,this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)};var oo={BlockChange:function(t,e,o,n,i){oo.BlockChange.superClass_.constructor.call(this,t),t&&(this.element=void 0===e?"":e,this.name=void 0===o?"":o,this.oldValue=void 0===n?"":n,this.newValue=void 0===i?"":i)}};(0,t.module$exports$Blockly$utils$object.inherits)(oo.BlockChange,De.BlockBase),oo.BlockChange.prototype.type=nt.CHANGE,oo.BlockChange.prototype.toJson=function(){var t=oo.BlockChange.superClass_.toJson.call(this);return t.element=this.element,this.name&&(t.name=this.name),t.oldValue=this.oldValue,t.newValue=this.newValue,t},oo.BlockChange.prototype.fromJson=function(t){oo.BlockChange.superClass_.fromJson.call(this,t),this.element=t.element,this.name=t.name,this.oldValue=t.oldValue,this.newValue=t.newValue},oo.BlockChange.prototype.isNull=function(){return this.oldValue===this.newValue},oo.BlockChange.prototype.run=function(e){var o=this.getEventWorkspace_().getBlockById(this.blockId);if(o)switch(o.mutator&&o.mutator.setVisible(!1),e=e?this.newValue:this.oldValue,this.element){case"field":(o=o.getField(this.name))?o.setValue(e):console.warn("Can't set non-existent field: "+this.name);break;case"comment":o.setCommentText(e||null);break;case"collapsed":o.setCollapsed(!!e);break;case"disabled":o.setEnabled(!e);break;case"inline":o.setInputsInline(!!e);break;case"mutation":var n=oo.BlockChange.getExtraBlockState_(o);o.loadExtraState?o.loadExtraState(JSON.parse(e||"{}")):o.domToMutation&&o.domToMutation((0,t.module$exports$Blockly$Xml.textToDom)(e||"")),(0,nt.fire)(new oo.BlockChange(o,"mutation",null,n,e));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.blockId)},oo.BlockChange.getExtraBlockState_=function(e){return e.saveExtraState?(e=e.saveExtraState())?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?(0,t.module$exports$Blockly$Xml.domToText)(e):""},(0,Z.register)(Z.Type.EVENT,nt.CHANGE,oo.BlockChange);var no={},io=0,ro=null;no.disposeUiEffect=function(t){var e=t.workspace,o=t.getSvgRoot();e.getAudioManager().play("delete"),t=e.getSvgXY(o),(o=o.cloneNode(!0)).translateX_=t.x,o.translateY_=t.y,o.setAttribute("transform","translate("+t.x+","+t.y+")"),e.getParentSvg().appendChild(o),o.bBox_=o.getBBox(),so(o,e.RTL,new Date,e.scale)};var so=function(t,e,o,n){var i=(new Date-o)/150;1o)){var n=e.getSvgXY(t.getSvgRoot());t.outputConnection?(n.x+=(t.RTL?3:-3)*o,n.y+=13*o):t.previousConnection&&(n.x+=(t.RTL?-23:23)*o,n.y+=3*o),t=(0,M.createSvgElement)(vt.Svg.CIRCLE,{cx:n.x,cy:n.y,r:0,fill:"none",stroke:"#888","stroke-width":10},e.getParentSvg()),lo(t,new Date,o)}};var lo=function(t,e,o){var n=(new Date-e)/150;1t.workspace.scale)){var e=t.getHeightWidth().height;e=Math.atan(10/e)/Math.PI*180,t.RTL||(e*=-1),ao(t.getSvgRoot(),e,new Date)}};var ao=function(t,e,o){var n=(new Date-o)/200;11'),i.appendChild(n),o.push(i)),t.module$exports$Blockly$blocks.Blocks.variables_get)for(e.sort(yo.VariableModel.compareByName),n=0;i=e[n];n++){var r=(0,t.module$exports$Blockly$utils$xml.createElement)("block");r.setAttribute("type","variables_get"),r.setAttribute("gap",8),r.appendChild((0,t.module$exports$Blockly$Variables.generateVariableFieldDom)(i)),o.push(r)}}return o},t.module$exports$Blockly$Variables.VAR_LETTER_OPTIONS="ijkmnopqrstuvwxyzabcdefgh",t.module$exports$Blockly$Variables.generateUniqueName=function(e){return(0,t.module$exports$Blockly$Variables.generateUniqueNameFromOptions)(t.module$exports$Blockly$Variables.VAR_LETTER_OPTIONS.charAt(0),e.getAllVariableNames())},t.module$exports$Blockly$Variables.generateUniqueNameFromOptions=function(e,o){if(!o.length)return e;for(var n=t.module$exports$Blockly$Variables.VAR_LETTER_OPTIONS,i="",r=n.indexOf(e);;){for(var s=!1,l=0;ln||o.getSourceBlock().isInsertionMarker())return!1;switch(o.type){case t.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,o);case t.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE:if(o.isConnected()&&!o.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case t.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE:if(o.isConnected()&&!o.targetBlock().isMovable()&&!o.targetBlock().isShadow())return!1;break;case t.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT:if(o.isConnected()&&!e.getSourceBlock().nextConnection&&!o.targetBlock().isShadow()&&o.targetBlock().nextConnection)return!1;break;default:return!1}return-1===t.module$exports$Blockly$common.draggingConnections.indexOf(o)},Bo.ConnectionChecker.prototype.canConnectToPrevious_=function(e,o){return!(e.targetConnection||-1!==t.module$exports$Blockly$common.draggingConnections.indexOf(o)||o.targetConnection&&(!(e=o.targetBlock()).isInsertionMarker()||e.getPreviousBlock()))},(0,Z.register)(Z.Type.CONNECTION_CHECKER,Z.DEFAULT,Bo.ConnectionChecker);var No={},Do=Object.create(null);No.Workspace=function(t){this.id=(0,J.genUid)(),Do[this.id]=this,this.options=t||new jt.Options({}),this.RTL=!!this.options.RTL,this.horizontalLayout=!!this.options.horizontalLayout,this.toolboxPosition=this.options.toolboxPosition,this.connectionChecker=new((0,Z.getClassFromOptions)(Z.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 So.VariableMap(this),this.potentialVariableMap_=null},No.Workspace.prototype.rendered=!1,No.Workspace.prototype.isClearing=!1,No.Workspace.prototype.MAX_UNDO=1024,No.Workspace.prototype.connectionDBList=null,No.Workspace.prototype.dispose=function(){this.listeners_.length=0,this.clear(),delete Do[this.id]},No.Workspace.SCAN_ANGLE=3,No.Workspace.prototype.sortObjects_=function(t,e){return t=t.getRelativeToSurfaceXY(),e=e.getRelativeToSurfaceXY(),t.y+No.Workspace.prototype.sortObjects_.offset*t.x-(e.y+No.Workspace.prototype.sortObjects_.offset*e.x)},No.Workspace.prototype.addTopBlock=function(t){this.topBlocks_.push(t)},No.Workspace.prototype.removeTopBlock=function(t){if(!Fe(this.topBlocks_,t))throw Error("Block not present in workspace's list of top-most blocks.")},No.Workspace.prototype.getTopBlocks=function(t){var e=[].concat(this.topBlocks_);return t&&1this.remainingCapacityOfType(e))return!1;o+=t[e]}return!(o>this.remainingCapacity())},No.Workspace.prototype.hasBlockLimits=function(){return 1/0!==this.options.maxBlocks||!!this.options.maxInstances},No.Workspace.prototype.getUndoStack=function(){return this.undoStack_},No.Workspace.prototype.getRedoStack=function(){return this.redoStack_},No.Workspace.prototype.undo=function(t){var e=t?this.redoStack_:this.undoStack_,o=t?this.undoStack_:this.redoStack_,n=e.pop();if(n){for(var i=[n];e.length&&n.group&&n.group===e[e.length-1].group;)i.push(e.pop());for(e=0;ethis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(var e=0;et.width)return e;if(this.workspace_.RTL){var o=this.anchorXY_.x-e,n=t.left+t.width;t=t.left+Jt.Scrollbar.scrollbarThickness/this.workspace_.scale,o-this.width_n&&(e=-(n-this.anchorXY_.x))}else{n=(o=e+this.anchorXY_.x)+this.width_;var i=t.left;t=t.left+t.width-Jt.Scrollbar.scrollbarThickness/this.workspace_.scale,ot&&(e=t-this.anchorXY_.x-this.width_)}return e},Ao.Bubble.prototype.getOptimalRelativeTop_=function(t){var e=-this.height_/4;if(this.height_>t.height)return e;var o=this.anchorXY_.y+e,n=o+this.height_,i=t.top;t=t.top+t.height-Jt.Scrollbar.scrollbarThickness/this.workspace_.scale;var r=this.anchorXY_.y;return ot&&(e=t-r-this.height_),e},Ao.Bubble.prototype.positionBubble_=function(){var t=this.anchorXY_.x;t=this.workspace_.RTL?t-(this.relativeLeft_+this.width_):t+this.relativeLeft_,this.moveTo(t,this.relativeTop_+this.anchorXY_.y)},Ao.Bubble.prototype.moveTo=function(t,e){this.bubbleGroup_.setAttribute("transform","translate("+t+","+e+")")},Ao.Bubble.prototype.setDragging=function(t){!t&&this.moveCallback_&&this.moveCallback_()},Ao.Bubble.prototype.getBubbleSize=function(){return new dt.Size(this.width_,this.height_)},Ao.Bubble.prototype.setBubbleSize=function(t,e){var o=2*Ao.Bubble.BORDER_WIDTH;t=Math.max(t,o+45),e=Math.max(e,o+20),this.width_=t,this.height_=e,this.bubbleBack_.setAttribute("width",t),this.bubbleBack_.setAttribute("height",e),this.resizeGroup_&&(this.workspace_.RTL?this.resizeGroup_.setAttribute("transform","translate("+2*Ao.Bubble.BORDER_WIDTH+","+(e-o)+") scale(-1 1)"):this.resizeGroup_.setAttribute("transform","translate("+(t-o)+","+(e-o)+")")),this.autoLayout_&&this.layoutBubble_(),this.positionBubble_(),this.renderArrow_(),this.resizeCallback_&&this.resizeCallback_()},Ao.Bubble.prototype.renderArrow_=function(){var t=[],e=this.width_/2,o=this.height_/2,n=-this.relativeLeft_,i=-this.relativeTop_;if(e===n&&o===i)t.push("M "+e+","+o);else{i-=o,n-=e,this.workspace_.RTL&&(n*=-1);var r=Math.sqrt(i*i+n*n),s=Math.acos(n/r);0>i&&(s=2*Math.PI-s);var l=s+Math.PI/2;l>2*Math.PI&&(l-=2*Math.PI);var a=Math.sin(l),c=Math.cos(l),u=this.getBubbleSize();l=(u.width+u.height)/Ao.Bubble.ARROW_THICKNESS,l=Math.min(l,u.width,u.height)/4,n=e+(u=1-Ao.Bubble.ANCHOR_RADIUS/r)*n,i=o+u*i,u=e+l*c;var p=o+l*a;e-=l*c,o-=l*a,(a=s+this.arrow_radians_)>2*Math.PI&&(a-=2*Math.PI),s=Math.sin(a)*r/Ao.Bubble.ARROW_BEND,r=Math.cos(a)*r/Ao.Bubble.ARROW_BEND,t.push("M"+u+","+p),t.push("C"+(u+r)+","+(p+s)+" "+n+","+i+" "+n+","+i),t.push("C"+n+","+i+" "+(e+r)+","+(o+s)+" "+e+","+o)}t.push("z"),this.bubbleArrow_.setAttribute("d",t.join(" "))},Ao.Bubble.prototype.setColour=function(t){this.bubbleBack_.setAttribute("fill",t),this.bubbleArrow_.setAttribute("fill",t)},Ao.Bubble.prototype.dispose=function(){this.onMouseDownBubbleWrapper_&&(0,f.unbind)(this.onMouseDownBubbleWrapper_),this.onMouseDownResizeWrapper_&&(0,f.unbind)(this.onMouseDownResizeWrapper_),Ao.Bubble.unbindDragEvents_(),(0,M.removeNode)(this.bubbleGroup_),this.disposed=!0},Ao.Bubble.prototype.moveDuringDrag=function(t,e){t?t.translateSurface(e.x,e.y):this.moveTo(e.x,e.y),this.relativeLeft_=this.workspace_.RTL?this.anchorXY_.x-e.x-this.width_:e.x-this.anchorXY_.x,this.relativeTop_=e.y-this.anchorXY_.y,this.renderArrow_()},Ao.Bubble.prototype.getRelativeToSurfaceXY=function(){return new ht.Coordinate(this.workspace_.RTL?-this.relativeLeft_+this.anchorXY_.x-this.width_:this.anchorXY_.x+this.relativeLeft_,this.anchorXY_.y+this.relativeTop_)},Ao.Bubble.prototype.setAutoLayout=function(t){this.autoLayout_=t},Ao.Bubble.textToDom=function(t){var e=(0,M.createSvgElement)(vt.Svg.TEXT,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:Ao.Bubble.BORDER_WIDTH},null);t=t.split("\n");for(var o=0;oo-t.module$exports$Blockly$internalConstants.CURRENT_CONNECTION_PREFERENCE)):!this.localConnection_&&!this.closestConnection_||(console.error("Only one of localConnection_ and closestConnection_ was set."),console.error("Returning true from shouldUpdatePreviews, but it's not clear why."),!0):!(!this.localConnection_||!this.closestConnection_)},$o.InsertionMarkerManager.prototype.getCandidate_=function(t){for(var e=this.getStartRadius_(),o=null,n=null,i=0;i(this.flyout_?t.module$exports$Blockly$internalConstants.FLYOUT_DRAG_RADIUS:t.module$exports$Blockly$internalConstants.DRAG_RADIUS))},Wo.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,nt.getGroup)()||(0,nt.setGroup)(!0),this.startBlock_=null,this.targetBlock_=this.flyout_.createBlock(this.targetBlock_),this.targetBlock_.select(),0))},Wo.Gesture.prototype.updateIsDraggingBubble_=function(){return!!this.startBubble_&&(this.isDraggingBubble_=!0,this.startDraggingBubble_(),!0)},Wo.Gesture.prototype.updateIsDraggingBlock_=function(){return!!this.targetBlock_&&(this.flyout_?this.isDraggingBlock_=this.updateIsDraggingFromFlyout_():this.targetBlock_.isMovable()&&(this.isDraggingBlock_=!0),!!this.isDraggingBlock_&&(this.startDraggingBlock_(),!0))},Wo.Gesture.prototype.updateIsDraggingWorkspace_=function(){(this.flyout_?this.flyout_.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.workspaceDragger_=new Lo.WorkspaceDragger(this.startWorkspace_),this.isDraggingWorkspace_=!0,this.workspaceDragger_.startDrag())},Wo.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_()},Wo.Gesture.prototype.startDraggingBlock_=function(){this.blockDragger_=new((0,Z.getClassFromOptions)(Z.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_)},Wo.Gesture.prototype.startDraggingBubble_=function(){this.bubbleDragger_=new Mo.BubbleDragger(this.startBubble_,this.startWorkspace_),this.bubbleDragger_.startBubbleDrag(),this.bubbleDragger_.dragBubble(this.mostRecentEvent_,this.currentDragDeltaXY_)},Wo.Gesture.prototype.doStart=function(t){(0,f.isTargetInput)(t)?this.cancel():(this.hasStarted_=!0,(0,no.disconnectUiStop)(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.startWorkspace_.hideChaff(!!this.flyout_),this.startWorkspace_.markFocused(),this.mostRecentEvent_=t,(0,E.block)(),this.targetBlock_&&this.targetBlock_.select(),(0,f.isRightButton)(t)?this.handleRightClick(t):("touchstart"!==t.type.toLowerCase()&&"pointerdown"!==t.type.toLowerCase()||"mouse"===t.pointerType||(0,p.longStart)(t,this),this.mouseDownXY_=new ht.Coordinate(t.clientX,t.clientY),this.healStack_=t.altKey||t.ctrlKey||t.metaKey,this.bindMouseEvents(t)))},Wo.Gesture.prototype.bindMouseEvents=function(t){this.onMoveWrapper_=(0,f.conditionalBind)(document,"mousemove",null,this.handleMove.bind(this)),this.onUpWrapper_=(0,f.conditionalBind)(document,"mouseup",null,this.handleUp.bind(this)),t.preventDefault(),t.stopPropagation()},Wo.Gesture.prototype.handleMove=function(t){this.updateFromEvent_(t),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_),t.preventDefault(),t.stopPropagation()},Wo.Gesture.prototype.handleUp=function(t){this.updateFromEvent_(t),(0,p.longStop)(),this.isEnding_?console.log("Trying to end a gesture recursively."):(this.isEnding_=!0,this.isDraggingBubble_?this.bubbleDragger_.endBubbleDrag(t,this.currentDragDeltaXY_):this.isDraggingBlock_?this.blockDragger_.endDrag(t,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_(t),t.preventDefault(),t.stopPropagation(),this.dispose())},Wo.Gesture.prototype.cancel=function(){this.isEnding_||((0,p.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())},Wo.Gesture.prototype.handleRightClick=function(t){this.targetBlock_?(this.bringBlockToFront_(),this.targetBlock_.workspace.hideChaff(!!this.flyout_),this.targetBlock_.showContextMenu(t)):this.startBubble_?this.startBubble_.showContextMenu(t):this.startWorkspace_&&!this.flyout_&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(t)),t.preventDefault(),t.stopPropagation(),this.dispose()},Wo.Gesture.prototype.handleWsStart=function(t,e){if(this.hasStarted_)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace_(e),this.mostRecentEvent_=t,this.doStart(t)},Wo.Gesture.prototype.fireWorkspaceClick_=function(t){(0,nt.fire)(new((0,nt.get)(nt.CLICK))(null,t.id,"workspace"))},Wo.Gesture.prototype.handleFlyoutStart=function(t,e){if(this.hasStarted_)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout_(e),this.handleWsStart(t,e.getWorkspace())},Wo.Gesture.prototype.handleBlockStart=function(t,e){if(this.hasStarted_)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(e),this.mostRecentEvent_=t},Wo.Gesture.prototype.handleBubbleStart=function(t,e){if(this.hasStarted_)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(e),this.mostRecentEvent_=t},Wo.Gesture.prototype.doBubbleClick_=function(){this.startBubble_.setFocus&&this.startBubble_.setFocus(),this.startBubble_.select&&this.startBubble_.select()},Wo.Gesture.prototype.doFieldClick_=function(){this.startField_.showEditor(this.mostRecentEvent_),this.bringBlockToFront_()},Wo.Gesture.prototype.doBlockClick_=function(){if(this.flyout_&&this.flyout_.autoClose)this.targetBlock_.isEnabled()&&((0,nt.getGroup)()||(0,nt.setGroup)(!0),this.flyout_.createBlock(this.targetBlock_).scheduleSnapAndBump());else{var t=new((0,nt.get)(nt.CLICK))(this.startBlock_,this.startWorkspace_.id,"block");(0,nt.fire)(t)}this.bringBlockToFront_(),(0,nt.setGroup)(!1)},Wo.Gesture.prototype.doWorkspaceClick_=function(e){e=this.creatorWorkspace_,(0,t.module$exports$Blockly$common.getSelected)()&&(0,t.module$exports$Blockly$common.getSelected)().unselect(),this.fireWorkspaceClick_(this.startWorkspace_||e)},Wo.Gesture.prototype.bringBlockToFront_=function(){this.targetBlock_&&!this.flyout_&&this.targetBlock_.bringToFront()},Wo.Gesture.prototype.setStartField=function(t){if(this.hasStarted_)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField_||(this.startField_=t)},Wo.Gesture.prototype.setStartBubble=function(t){this.startBubble_||(this.startBubble_=t)},Wo.Gesture.prototype.setStartBlock=function(t){this.startBlock_||this.startBubble_||(this.startBlock_=t,t.isInFlyout&&t!==t.getRootBlock()?this.setTargetBlock_(t.getRootBlock()):this.setTargetBlock_(t))},Wo.Gesture.prototype.setTargetBlock_=function(t){t.isShadow()?this.setTargetBlock_(t.getParent()):this.targetBlock_=t},Wo.Gesture.prototype.setStartWorkspace_=function(t){this.startWorkspace_||(this.startWorkspace_=t)},Wo.Gesture.prototype.setStartFlyout_=function(t){this.flyout_||(this.flyout_=t)},Wo.Gesture.prototype.isBubbleClick_=function(){return!!this.startBubble_&&!this.hasExceededDragRadius_},Wo.Gesture.prototype.isBlockClick_=function(){return!!this.startBlock_&&!this.hasExceededDragRadius_&&!this.isFieldClick_()},Wo.Gesture.prototype.isFieldClick_=function(){return!!this.startField_&&this.startField_.isClickable()&&!this.hasExceededDragRadius_&&(!this.flyout_||!this.flyout_.autoClose)},Wo.Gesture.prototype.isWorkspaceClick_=function(){return!(this.startBlock_||this.startBubble_||this.startField_||this.hasExceededDragRadius_)},Wo.Gesture.prototype.isDragging=function(){return this.isDraggingWorkspace_||this.isDraggingBlock_||this.isDraggingBubble_},Wo.Gesture.prototype.hasStarted=function(){return this.hasStarted_},Wo.Gesture.prototype.getInsertionMarkers=function(){return this.blockDragger_?this.blockDragger_.getInsertionMarkers():[]},Wo.Gesture.prototype.getCurrentDragger=function(){return this.isDraggingBlock_?this.blockDragger_:this.isDraggingWorkspace_?this.workspaceDragger_:this.isDraggingBubble_?this.bubbleDragger_:null},Wo.Gesture.inProgress=function(){for(var t,e=No.Workspace.getAll(),o=0;t=e[o];o++)if(t.currentGesture_)return!0;return!1};var Vo={Field:function(t,e,o){this.value_=this.DEFAULT_VALUE,this.tooltip_=this.validator_=null,this.size_=new dt.Size(0,0),this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=null,o&&this.configure_(o),this.setValue(t),e&&this.setValidator(e)}};Vo.Field.prototype.DEFAULT_VALUE=null,Vo.Field.prototype.name=void 0,Vo.Field.prototype.disposed=!1,Vo.Field.prototype.maxDisplayLength=50,Vo.Field.prototype.sourceBlock_=null,Vo.Field.prototype.isDirty_=!0,Vo.Field.prototype.visible_=!0,Vo.Field.prototype.enabled_=!0,Vo.Field.prototype.clickTarget_=null,Vo.Field.NBSP=" ",Vo.Field.prototype.EDITABLE=!0,Vo.Field.prototype.SERIALIZABLE=!1,Vo.Field.prototype.configure_=function(t){var e=t.tooltip;"string"==typeof e&&(e=(0,qe.replaceMessageReferences)(t.tooltip)),e&&this.setTooltip(e)},Vo.Field.prototype.setSourceBlock=function(t){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=t},Vo.Field.prototype.getConstants=function(){return!this.constants_&&this.sourceBlock_&&this.sourceBlock_.workspace&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_},Vo.Field.prototype.getSourceBlock=function(){return this.sourceBlock_},Vo.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=(0,M.createSvgElement)(vt.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())},Vo.Field.prototype.initView=function(){this.createBorderRect_(),this.createTextElement_()},Vo.Field.prototype.initModel=function(){},Vo.Field.prototype.createBorderRect_=function(){this.borderRect_=(0,M.createSvgElement)(vt.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_)},Vo.Field.prototype.createTextElement_=function(){this.textElement_=(0,M.createSvgElement)(vt.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_)},Vo.Field.prototype.bindEvents_=function(){(0,E.bindMouseEvents)(this.getClickTarget_()),this.mouseDownWrapper_=(0,f.conditionalBind)(this.getClickTarget_(),"mousedown",this,this.onMouseDown_)},Vo.Field.prototype.fromXml=function(t){this.setValue(t.textContent)},Vo.Field.prototype.toXml=function(t){return t.textContent=this.getValue(),t},Vo.Field.prototype.saveState=function(t){return null!==(t=this.saveLegacyState(Vo.Field))?t:this.getValue()},Vo.Field.prototype.loadState=function(t){this.loadLegacyState(Vo.Field,t)||this.setValue(t)},Vo.Field.prototype.saveLegacyState=function(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?((e=(0,t.module$exports$Blockly$utils$xml.createElement)("field")).setAttribute("name",this.name||""),(0,t.module$exports$Blockly$Xml.domToText)(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null},Vo.Field.prototype.loadLegacyState=function(e,o){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml&&(this.fromXml((0,t.module$exports$Blockly$Xml.textToDom)(o)),!0)},Vo.Field.prototype.dispose=function(){St.DropDownDiv.hideIfOwner(this),(0,U.hideIfOwner)(this),(0,E.unbindMouseEvents)(this.getClickTarget_()),this.mouseDownWrapper_&&(0,f.unbind)(this.mouseDownWrapper_),(0,M.removeNode)(this.fieldGroup_),this.disposed=!0},Vo.Field.prototype.updateEditable=function(){var t=this.fieldGroup_;this.EDITABLE&&t&&(this.enabled_&&this.sourceBlock_.isEditable()?((0,M.addClass)(t,"blocklyEditableText"),(0,M.removeClass)(t,"blocklyNonEditableText"),t.style.cursor=this.CURSOR):((0,M.addClass)(t,"blocklyNonEditableText"),(0,M.removeClass)(t,"blocklyEditableText"),t.style.cursor=""))},Vo.Field.prototype.setEnabled=function(t){this.enabled_=t,this.updateEditable()},Vo.Field.prototype.isEnabled=function(){return this.enabled_},Vo.Field.prototype.isClickable=function(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&!!this.showEditor_&&"function"==typeof this.showEditor_},Vo.Field.prototype.isCurrentlyEditable=function(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()},Vo.Field.prototype.isSerializable=function(){var t=!1;return this.name&&(this.SERIALIZABLE?t=!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."),t=!0)),t},Vo.Field.prototype.isVisible=function(){return this.visible_},Vo.Field.prototype.setVisible=function(t){if(this.visible_!==t){this.visible_=t;var e=this.getSvgRoot();e&&(e.style.display=t?"block":"none")}},Vo.Field.prototype.setValidator=function(t){this.validator_=t},Vo.Field.prototype.getValidator=function(){return this.validator_},Vo.Field.prototype.getSvgRoot=function(){return this.fieldGroup_},Vo.Field.prototype.applyColour=function(){},Vo.Field.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()},Vo.Field.prototype.showEditor=function(t){this.isClickable()&&this.showEditor_(t)},Vo.Field.prototype.updateSize_=function(t){var e=this.getConstants(),o=2*(t=void 0!==t?t:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0),n=e.FIELD_TEXT_HEIGHT,i=0;this.textElement_&&(o+=i=(0,M.getFastTextWidth)(this.textElement_,e.FIELD_TEXT_FONTSIZE,e.FIELD_TEXT_FONTWEIGHT,e.FIELD_TEXT_FONTFAMILY)),this.borderRect_&&(n=Math.max(n,e.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=n,this.size_.width=o,this.positionTextElement_(t,i),this.positionBorderRect_()},Vo.Field.prototype.positionTextElement_=function(t,e){if(this.textElement_){var o=this.getConstants(),n=this.size_.height/2;this.textElement_.setAttribute("x",this.sourceBlock_.RTL?this.size_.width-e-t:t),this.textElement_.setAttribute("y",o.FIELD_TEXT_BASELINE_CENTER?n:n-o.FIELD_TEXT_HEIGHT/2+o.FIELD_TEXT_BASELINE)}},Vo.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))},Vo.Field.prototype.getSize=function(){return this.isVisible()?(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_()),this.size_):new dt.Size(0,0)},Vo.Field.prototype.getScaledBBox=function(){if(this.borderRect_)var t=this.borderRect_.getBoundingClientRect(),e=(0,_t.getPageOffset)(this.borderRect_),o=t.width,n=t.height;else n=this.sourceBlock_.getHeightWidth(),t=this.sourceBlock_.workspace.scale,e=this.getAbsoluteXY_(),o=n.width*t,n=n.height*t,_.GECKO?(e.x+=1.5*t,e.y+=1.5*t):_.EDGE||_.IE||(e.x-=.5*t,e.y-=.5*t),o+=1*t,n+=1*t;return new mt.Rect(e.y,e.y+n,e.x,e.x+o)},Vo.Field.prototype.getDisplayText_=function(){var t=this.getText();return t?(t.length>this.maxDisplayLength&&(t=t.substring(0,this.maxDisplayLength-2)+"…"),t=t.replace(/\s/g,Vo.Field.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(t+="‏"),t):Vo.Field.NBSP},Vo.Field.prototype.getText=function(){if(this.getText_){var t=this.getText_.call(this);if(null!==t)return String(t)}return String(this.getValue())},Vo.Field.prototype.markDirty=function(){this.isDirty_=!0,this.constants_=null},Vo.Field.prototype.forceRerender=function(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours(),this.updateMarkers_())},Vo.Field.prototype.setValue=function(t){if(null!==t){var e=this.doClassValidation_(t);if(!((t=this.processValidation_(t,e))instanceof Error)){if((e=this.getValidator())&&(e=e.call(this,t),(t=this.processValidation_(t,e))instanceof Error))return;if(!(e=this.sourceBlock_)||!e.disposed){var o=this.getValue();o===t?this.doValueUpdate_(t):(this.doValueUpdate_(t),e&&(0,nt.isEnabled)()&&(0,nt.fire)(new((0,nt.get)(nt.CHANGE))(e,"field",this.name||null,o,t)),this.isDirty_&&this.forceRerender())}}}},Vo.Field.prototype.processValidation_=function(t,e){return null===e?(this.doValueInvalid_(t),this.isDirty_&&this.forceRerender(),Error()):(void 0!==e&&(t=e),t)},Vo.Field.prototype.getValue=function(){return this.value_},Vo.Field.prototype.doClassValidation_=function(t){return null==t?null:t},Vo.Field.prototype.doValueUpdate_=function(t){this.value_=t,this.isDirty_=!0},Vo.Field.prototype.doValueInvalid_=function(t){},Vo.Field.prototype.onMouseDown_=function(t){this.sourceBlock_&&this.sourceBlock_.workspace&&(t=this.sourceBlock_.workspace.getGesture(t))&&t.setStartField(this)},Vo.Field.prototype.setTooltip=function(t){t||""===t||(t=this.sourceBlock_);var e=this.getClickTarget_();e?e.tooltip=t:this.tooltip_=t},Vo.Field.prototype.getTooltip=function(){var t=this.getClickTarget_();return t?(0,E.getTooltipOfObject)(t):(0,E.getTooltipOfObject)({tooltip:this.tooltip_})},Vo.Field.prototype.getClickTarget_=function(){return this.clickTarget_||this.getSvgRoot()},Vo.Field.prototype.getAbsoluteXY_=function(){return(0,_t.getPageOffset)(this.getClickTarget_())},Vo.Field.prototype.referencesVariables=function(){return!1},Vo.Field.prototype.getParentInput=function(){for(var t=null,e=this.sourceBlock_,o=e.inputList,n=0;nt.height;i&&(e-=n),this.debugElements_.push((0,M.createSvgElement)(vt.Svg.RECT,{class:"rowSpacerRect blockRenderDebug",x:o?-(t.xPos+t.width):t.xPos,y:e,width:t.width,height:n,stroke:i?"black":"blue",fill:"blue","fill-opacity":"0.5","stroke-width":"1px"},this.svgRoot_))}},Yo.Debug.prototype.drawSpacerElem=function(t,e,o){if(Yo.Debug.config.elemSpacers){e=Math.abs(t.width);var n=0>t.width,i=n?t.xPos-e:t.xPos;o&&(i=-(i+e)),this.debugElements_.push((0,M.createSvgElement)(vt.Svg.RECT,{class:"elemSpacerRect blockRenderDebug",x:i,y:t.centerline-t.height/2,width:e,height:t.height,stroke:"pink",fill:n?"black":"pink","fill-opacity":"0.5","stroke-width":"1px"},this.svgRoot_))}},Yo.Debug.prototype.drawRenderedElem=function(e,o){if(Yo.Debug.config.elems){var n=e.xPos;o&&(n=-(n+e.width)),o=e.centerline-e.height/2,this.debugElements_.push((0,M.createSvgElement)(vt.Svg.RECT,{class:"rowRenderingRect blockRenderDebug",x:n,y:o,width:e.width,height:e.height,stroke:"black",fill:"none","stroke-width":"1px"},this.svgRoot_)),Ge.Types.isField(e)&&e.field instanceof t.module$exports$Blockly$FieldLabel.FieldLabel&&this.debugElements_.push((0,M.createSvgElement)(vt.Svg.RECT,{class:"rowRenderingRect blockRenderDebug",x:n,y:o+this.constants_.FIELD_TEXT_BASELINE,width:e.width,height:"0.1px",stroke:"red",fill:"none","stroke-width":"0.5px"},this.svgRoot_))}Ge.Types.isInput(e)&&Yo.Debug.config.connections&&this.drawConnection(e.connectionModel)},Yo.Debug.prototype.drawConnection=function(e){if(Yo.Debug.config.connections){if(e.type===t.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE)var o=4,n="magenta",i="none";else e.type===t.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE?(o=2,i=n="magenta"):e.type===t.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT?(o=4,n="goldenrod",i="none"):e.type===t.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT&&(o=2,i=n="goldenrod");this.debugElements_.push((0,M.createSvgElement)(vt.Svg.CIRCLE,{class:"blockRenderDebug",cx:e.offsetInBlock_.x,cy:e.offsetInBlock_.y,r:o,fill:i,stroke:n},this.svgRoot_))}},Yo.Debug.prototype.drawRenderedRow=function(t,e,o){Yo.Debug.config.rows&&(this.debugElements_.push((0,M.createSvgElement)(vt.Svg.RECT,{class:"elemRenderingRect blockRenderDebug",x:o?-(t.xPos+t.width):t.xPos,y:t.yPos,width:t.width,height:t.height,stroke:"red",fill:"none","stroke-width":"1px"},this.svgRoot_)),Ge.Types.isTopOrBottomRow(t)||Yo.Debug.config.connectedBlockBounds&&this.debugElements_.push((0,M.createSvgElement)(vt.Svg.RECT,{class:"connectedBlockWidth blockRenderDebug",x:o?-(t.xPos+t.widthWithConnectedBlocks):t.xPos,y:t.yPos,width:t.widthWithConnectedBlocks,height:t.height,stroke:this.randomColour_,fill:"none","stroke-width":"1px","stroke-dasharray":"3,3"},this.svgRoot_)))},Yo.Debug.prototype.drawRowWithElements=function(t,e,o){for(var n=0;nt||t>this.fieldRow.length)throw Error("index "+t+" out of bounds.");return e||""===e&&o?("string"==typeof e&&(e=(0,to.fromJson)({type:"field_label",text:e})),e.setSourceBlock(this.sourceBlock_),this.sourceBlock_.rendered&&(e.init(),e.applyColour()),e.name=o,e.setVisible(this.isVisible()),e.prefixField&&(t=this.insertFieldAt(t,e.prefixField)),this.fieldRow.splice(t,0,e),t++,e.suffixField&&(t=this.insertFieldAt(t,e.suffixField)),this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours()),t):t},t.module$exports$Blockly$Input.Input.prototype.removeField=function(t,e){for(var o,n=0;o=this.fieldRow[n];n++)if(o.name===t)return o.dispose(),this.fieldRow.splice(n,1),this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours()),!0;if(e)return!1;throw Error('Field "'+t+'" not found.')},t.module$exports$Blockly$Input.Input.prototype.isVisible=function(){return this.visible_},t.module$exports$Blockly$Input.Input.prototype.setVisible=function(t){var e=[];if(this.visible_===t)return e;this.visible_=t;for(var o,n=0;o=this.fieldRow[n];n++)o.setVisible(t);return this.connection&&(this.connection=this.connection,t?e=this.connection.startTrackingAll():this.connection.stopTrackingAll(),n=this.connection.targetBlock())&&(n.getSvgRoot().style.display=t?"block":"none"),e},t.module$exports$Blockly$Input.Input.prototype.markDirty=function(){for(var t,e=0;t=this.fieldRow[e];e++)t.markDirty()},t.module$exports$Blockly$Input.Input.prototype.setCheck=function(t){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(t),this},t.module$exports$Blockly$Input.Input.prototype.setAlign=function(t){return this.align=t,this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render()),this},t.module$exports$Blockly$Input.Input.prototype.setShadowDom=function(t){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(t),this},t.module$exports$Blockly$Input.Input.prototype.getShadowDom=function(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()},t.module$exports$Blockly$Input.Input.prototype.init=function(){if(this.sourceBlock_.workspace.rendered)for(var t=0;tt&&(i=i.substring(0,t-3)+"..."),i},Bn.Block.prototype.appendValueInput=function(e){return this.appendInput_(t.module$exports$Blockly$inputTypes.inputTypes.VALUE,e)},Bn.Block.prototype.appendStatementInput=function(e){return this.appendInput_(t.module$exports$Blockly$inputTypes.inputTypes.STATEMENT,e)},Bn.Block.prototype.appendDummyInput=function(e){return this.appendInput_(t.module$exports$Blockly$inputTypes.inputTypes.DUMMY,e||"")},Bn.Block.prototype.jsonInit=function(e){var o=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(o+"Must not have both an output and a previousStatement.");if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(o+"Must not have both a colour and a style.");e.style?this.jsonInitStyle_(e,o):this.jsonInitColour_(e,o);for(var n=0;void 0!==e["message"+n];)this.interpolate_(e["message"+n],e["args"+n]||[],e["lastDummyAlign"+n],o),n++;if(void 0!==e.inputsInline&&this.setInputsInline(e.inputsInline),void 0!==e.output&&this.setOutput(!0,e.output),void 0!==e.outputShape&&this.setOutputShape(e.outputShape),void 0!==e.previousStatement&&this.setPreviousStatement(!0,e.previousStatement),void 0!==e.nextStatement&&this.setNextStatement(!0,e.nextStatement),void 0!==e.tooltip&&(n=(0,qe.replaceMessageReferences)(e.tooltip),this.setTooltip(n)),void 0!==e.enableContextMenu&&(this.contextMenu=!!e.enableContextMenu),void 0!==e.suppressPrefixSuffix&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),void 0!==e.helpUrl&&(n=(0,qe.replaceMessageReferences)(e.helpUrl),this.setHelpUrl(n)),"string"==typeof e.extensions&&(console.warn(o+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),void 0!==e.mutator&&(0,t.module$exports$Blockly$Extensions.apply)(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(o=0;or||r>e)throw Error('Block "'+this.type+'": Message index %'+r+" out of range.");if(o[r])throw Error('Block "'+this.type+'": Message index %'+r+" duplicated.");o[r]=!0,n++}}if(n!==e)throw Error('Block "'+this.type+'": Message does not reference all '+e+" arg(s).")},Bn.Block.prototype.interpolateArguments_=function(t,e,o){for(var n=[],i=0;i=this.inputList.length)throw RangeError("Input index "+t+" out of bounds.");if(e>this.inputList.length)throw RangeError("Reference input "+e+" out of bounds.");var o=this.inputList[t];this.inputList.splice(t,1),t=this.connections_.length)return-1;e=t.y;for(var n=o;0<=n&&this.connections_[n].y===e;){if(this.connections_[n]===t)return n;n--}for(n=o;nt)){e=n;break}o=n}}return e},Pn.ConnectionDB.prototype.removeConnection=function(t,e){if(-1===(t=this.findIndexOfConnection_(t,e)))throw Error("Unable to find connection in connectionDB.");this.connections_.splice(t,1)},Pn.ConnectionDB.prototype.getNeighbours=function(t,e){function o(t){var o=i-n[t].x,s=r-n[t].y;return Math.sqrt(o*o+s*s)<=e&&a.push(n[t]),sthis.previousScale_){var o=e-this.previousScale_;o=0Object.keys(this.cachedPoints_).length&&(this.cachedPoints_=Object.create(null),this.previousScale_=0)},Un.TouchGesture.prototype.getTouchPoint=function(t){return this.startWorkspace_?new ht.Coordinate(t.changedTouches?t.changedTouches[0].pageX:t.pageX,t.changedTouches?t.changedTouches[0].pageY:t.pageY):null};var Hn={WorkspaceAudio:function(t){this.parentWorkspace_=t,this.SOUNDS_=Object.create(null)}};Hn.WorkspaceAudio.prototype.lastSound_=null,Hn.WorkspaceAudio.prototype.dispose=function(){this.SOUNDS_=this.parentWorkspace_=null},Hn.WorkspaceAudio.prototype.load=function(e,o){if(e.length){try{var n=new t.module$exports$Blockly$utils$global.globalThis.Audio}catch(t){return}for(var i,r=0;rMath.abs(e-this.oldTop_)&&1>Math.abs(o-this.oldLeft_))){var n=new((0,nt.get)(nt.VIEWPORT_CHANGE))(e,o,t,this.id,this.oldScale_);this.oldScale_=t,this.oldTop_=e,this.oldLeft_=o,(0,nt.fire)(n)}}},Yn.WorkspaceSvg.prototype.translate=function(t,e){if(this.useWorkspaceDragSurface_&&this.isDragSurfaceActive_)this.workspaceDragSurface_.translateSurface(t,e);else{var o="translate("+t+","+e+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",o),this.svgBubbleCanvas_.setAttribute("transform",o)}this.blockDragSurface_&&this.blockDragSurface_.translateAndScaleGroup(t,e,this.scale),this.grid_&&this.grid_.moveTo(t,e),this.maybeFireViewportChangeEvent()},Yn.WorkspaceSvg.prototype.resetDragSurface=function(){if(this.useWorkspaceDragSurface_){this.isDragSurfaceActive_=!1;var t=this.workspaceDragSurface_.getSurfaceTranslation();this.workspaceDragSurface_.clearAndHide(this.svgGroup_),t="translate("+t.x+","+t.y+") scale("+this.scale+")",this.svgBlockCanvas_.setAttribute("transform",t),this.svgBubbleCanvas_.setAttribute("transform",t)}},Yn.WorkspaceSvg.prototype.setupDragSurface=function(){if(this.useWorkspaceDragSurface_&&!this.isDragSurfaceActive_){this.isDragSurfaceActive_=!0;var t=this.svgBlockCanvas_.previousSibling,e=parseInt(this.getParentSvg().getAttribute("width"),10),o=parseInt(this.getParentSvg().getAttribute("height"),10),n=(0,yt.getRelativeXY)(this.getCanvas());this.workspaceDragSurface_.setContentsAndShow(this.getCanvas(),this.getBubbleCanvas(),t,e,o,this.scale),this.workspaceDragSurface_.translateSurface(n.x,n.y)}},Yn.WorkspaceSvg.prototype.getBlockDragSurface=function(){return this.blockDragSurface_},Yn.WorkspaceSvg.prototype.getWidth=function(){var t=this.getMetrics();return t?t.viewWidth/this.scale:0},Yn.WorkspaceSvg.prototype.setVisible=function(t){if(this.isVisible_=t,this.svgGroup_)if(this.scrollbar&&this.scrollbar.setContainerVisible(t),this.getFlyout()&&this.getFlyout().setContainerVisible(t),this.getParentSvg().style.display=t?"block":"none",this.toolbox_&&this.toolbox_.setVisible(t),t){for(var e=(t=this.getAllBlocks(!1)).length-1;0<=e;e--)t[e].markDirty();this.render(),this.toolbox_&&this.toolbox_.position()}else this.hideChaff(!0)},Yn.WorkspaceSvg.prototype.render=function(){for(var t=this.getAllBlocks(!1),e=t.length-1;0<=e;e--)t[e].render(!1);if(this.currentGesture_)for(t=this.currentGesture_.getInsertionMarkers(),e=0;e=Math.abs(n-a.x)&&1>=Math.abs(i-a.y)){s=!0;break}}if(!s){var c=r.getConnections_(!1);for(e=0,o=void 0;o=c[e];e++)if(o.closest(t.module$exports$Blockly$internalConstants.SNAP_RADIUS,new ht.Coordinate(n,i)).connection){s=!0;break}}s&&(n=this.RTL?n-t.module$exports$Blockly$internalConstants.SNAP_RADIUS:n+t.module$exports$Blockly$internalConstants.SNAP_RADIUS,i+=2*t.module$exports$Blockly$internalConstants.SNAP_RADIUS)}while(s);r.moveTo(new ht.Coordinate(n,i))}}finally{(0,nt.enable)()}(0,nt.isEnabled)()&&!r.isShadow()&&(0,nt.fire)(new((0,nt.get)(nt.CREATE))(r)),r.select()},Yn.WorkspaceSvg.prototype.pasteWorkspaceComment_=function(t){(0,nt.disable)();try{var e=fr.fromXml(t,this),o=parseInt(t.getAttribute("x"),10),n=parseInt(t.getAttribute("y"),10);isNaN(o)||isNaN(n)||(this.RTL&&(o=-o),e.moveBy(o+50,n+50))}finally{(0,nt.enable)()}(0,nt.isEnabled)()&&gr.fireCreateEvent(e),e.select()},Yn.WorkspaceSvg.prototype.refreshToolboxSelection=function(){var t=this.isFlyout?this.targetWorkspace:this;t&&!t.currentGesture_&&t.toolbox_&&t.toolbox_.getFlyout()&&t.toolbox_.refreshSelection()},Yn.WorkspaceSvg.prototype.renameVariableById=function(t,e){Yn.WorkspaceSvg.superClass_.renameVariableById.call(this,t,e),this.refreshToolboxSelection()},Yn.WorkspaceSvg.prototype.deleteVariableById=function(t){Yn.WorkspaceSvg.superClass_.deleteVariableById.call(this,t),this.refreshToolboxSelection()},Yn.WorkspaceSvg.prototype.createVariable=function(t,e,o){return t=Yn.WorkspaceSvg.superClass_.createVariable.call(this,t,e,o),this.refreshToolboxSelection(),t},Yn.WorkspaceSvg.prototype.recordDeleteAreas=function(){On.deprecation.warn("WorkspaceSvg.prototype.recordDeleteAreas","June 2021","June 2022","WorkspaceSvg.prototype.recordDragTargets"),this.recordDragTargets()},Yn.WorkspaceSvg.prototype.recordDragTargets=function(){var t=this.componentManager_.getComponents(co.ComponentManager.Capability.DRAG_TARGET,!0);this.dragTargetAreas_=[];for(var e,o=0;e=t[o];o++){var n=e.getClientRect();n&&this.dragTargetAreas_.push({component:e,clientRect:n})}},Yn.WorkspaceSvg.prototype.getDragTarget=function(t){for(var e,o=0;e=this.dragTargetAreas_[o];o++)if(e.clientRect.contains(t.clientX,t.clientY))return e.component;return null},Yn.WorkspaceSvg.prototype.onMouseDown_=function(t){var e=this.getGesture(t);e&&e.handleWsStart(t,this)},Yn.WorkspaceSvg.prototype.startDrag=function(t,e){(t=(0,f.mouseToSvg)(t,this.getParentSvg(),this.getInverseScreenCTM())).x/=this.scale,t.y/=this.scale,this.dragDeltaXY_=ht.Coordinate.difference(e,t)},Yn.WorkspaceSvg.prototype.moveDrag=function(t){return(t=(0,f.mouseToSvg)(t,this.getParentSvg(),this.getInverseScreenCTM())).x/=this.scale,t.y/=this.scale,ht.Coordinate.sum(this.dragDeltaXY_,t)},Yn.WorkspaceSvg.prototype.isDragging=function(){return null!==this.currentGesture_&&this.currentGesture_.isDragging()},Yn.WorkspaceSvg.prototype.isDraggable=function(){return this.options.moveOptions&&this.options.moveOptions.drag},Yn.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},Yn.WorkspaceSvg.prototype.isMovableHorizontally=function(){var t=!!this.scrollbar;return this.isMovable()&&(!t||t&&this.scrollbar.canScrollHorizontally())},Yn.WorkspaceSvg.prototype.isMovableVertically=function(){var t=!!this.scrollbar;return this.isMovable()&&(!t||t&&this.scrollbar.canScrollVertically())},Yn.WorkspaceSvg.prototype.onMouseWheel_=function(t){if(Wo.Gesture.inProgress())t.preventDefault(),t.stopPropagation();else{var e=this.options.zoomOptions&&this.options.zoomOptions.wheel,o=this.options.moveOptions&&this.options.moveOptions.wheel;if(e||o){var n=(0,f.getScrollDeltaPixels)(t);if(_.MAC)var i=t.metaKey;e&&(t.ctrlKey||i||!o)?(n=-n.y/50,e=(0,f.mouseToSvg)(t,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(e.x,e.y,n)):(e=this.scrollX-n.x,o=this.scrollY-n.y,t.shiftKey&&!n.x&&(e=this.scrollX-n.y,o=this.scrollY),this.scroll(e,o)),t.preventDefault()}}},Yn.WorkspaceSvg.prototype.getBlocksBoundingBox=function(){var t=this.getTopBoundedElements();if(!t.length)return new mt.Rect(0,0,0,0);for(var e=t[0].getBoundingRectangle(),o=1;oe.bottom&&(e.bottom=n.bottom),n.lefte.right&&(e.right=n.right))}return e},Yn.WorkspaceSvg.prototype.cleanUp=function(){this.setResizesEnabled(!1),(0,nt.setGroup)(!0);for(var t,e=this.getTopBlocks(!0),o=0,n=0;t=e[n];n++)if(t.isMovable()){var i=t.getRelativeToSurfaceXY();t.moveBy(-i.x,o-i.y),t.snapToGrid(),o=t.getRelativeToSurfaceXY().y+t.getHeightWidth().height+this.renderer_.getConstants().MIN_BLOCK_HEIGHT}(0,nt.setGroup)(!1),this.setResizesEnabled(!0)},Yn.WorkspaceSvg.prototype.showContextMenu=function(e){if(!this.options.readOnly&&!this.isFlyout){var o=Nn.ContextMenuRegistry.registry.getContextMenuOptions(Nn.ContextMenuRegistry.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(o,e),(0,t.module$exports$Blockly$ContextMenu.show)(e,o,this.RTL)}},Yn.WorkspaceSvg.prototype.updateToolbox=function(t){if(t=(0,Ut.convertToolboxDefToJson)(t)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if((0,Ut.hasCategories)(t)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=t,this.toolbox_.render(t)}else{if(!this.flyout_)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=t,this.flyout_.show(t)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")},Yn.WorkspaceSvg.prototype.markFocused=function(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():((0,t.module$exports$Blockly$common.setMainWorkspace)(this),this.setBrowserFocus())},Yn.WorkspaceSvg.prototype.setBrowserFocus=function(){document.activeElement&&document.activeElement.blur&&document.activeElement.blur();try{this.getParentSvg().focus({preventScroll:!0})}catch(t){try{this.getParentSvg().parentNode.setActive()}catch(t){this.getParentSvg().parentNode.focus({preventScroll:!0})}}},Yn.WorkspaceSvg.prototype.zoom=function(t,e,o){o=Math.pow(this.options.zoomOptions.scaleSpeed,o);var n=this.scale*o;if(this.scale!==n){n>this.options.zoomOptions.maxScale?o=this.options.zoomOptions.maxScale/this.scale:nthis.options.zoomOptions.maxScale?t=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&t-e||t<-180+e||t>180-e},ni.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;var t=this.svgGroup_.getBoundingClientRect(),e=t.left;return this.toolboxPosition_===Ut.Position.LEFT?new mt.Rect(-1e9,1e9,-1e9,e+t.width):new mt.Rect(-1e9,1e9,e,1e9)},ni.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.getFlyoutScale();for(var t,e=0,o=this.workspace_.getTopBlocks(!1),n=0;t=o[n];n++){var i=t.getHeightWidth().width;t.outputConnection&&(i-=this.tabWidth_),e=Math.max(e,i)}for(n=0;t=this.buttons_[n];n++)e=Math.max(e,t.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=Jt.Scrollbar.scrollbarThickness,this.width_!==e){for(n=0;t=o[n];n++){if(this.RTL){i=t.getRelativeToSurfaceXY().x;var r=e/this.workspace_.scale-this.MARGIN;t.outputConnection||(r-=this.tabWidth_),t.moveBy(r-i,0)}t.flyoutRect_&&this.moveRectToBlock_(t.flyoutRect_,t)}if(this.RTL)for(o=0;n=this.buttons_[o];o++)t=n.getPosition().y,n.moveTo(e/this.workspace_.scale-n.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==Ut.Position.LEFT||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.recordDragTargets()}},(0,Z.register)(Z.Type.FLYOUTS_VERTICAL_TOOLBOX,Z.DEFAULT,ni.VerticalFlyout);var ii={ToolboxItem:function(t,e,o){this.id_=t.toolboxitemid||(0,J.getNextUniqueId)(),this.level_=(this.parent_=o||null)?this.parent_.getLevel()+1:0,this.toolboxItemDef_=t,this.parentToolbox_=e,this.workspace_=this.parentToolbox_.getWorkspace()}};ii.ToolboxItem.prototype.init=function(){},ii.ToolboxItem.prototype.getDiv=function(){return null},ii.ToolboxItem.prototype.getId=function(){return this.id_},ii.ToolboxItem.prototype.getParent=function(){return null},ii.ToolboxItem.prototype.getLevel=function(){return this.level_},ii.ToolboxItem.prototype.isSelectable=function(){return!1},ii.ToolboxItem.prototype.isCollapsible=function(){return!1},ii.ToolboxItem.prototype.dispose=function(){};var ri={ToolboxCategory:function(e,o,n){ri.ToolboxCategory.superClass_.constructor.call(this,e,o,n),this.name_=(0,qe.replaceMessageReferences)(e.name),this.colour_=this.getColour_(e),this.labelDom_=this.iconDom_=this.rowContents_=this.rowDiv_=this.htmlDiv_=null,this.cssConfig_=this.makeDefaultCssConfig_(),(0,t.module$exports$Blockly$utils$object.mixin)(this.cssConfig_,e.cssconfig||e.cssConfig),this.isDisabled_=this.isHidden_=!1,this.flyoutItems_=[],this.parseContents_(e)}};(0,t.module$exports$Blockly$utils$object.inherits)(ri.ToolboxCategory,ii.ToolboxItem),ri.ToolboxCategory.registrationName="category",ri.ToolboxCategory.nestedPadding=19,ri.ToolboxCategory.borderWidth=8,ri.ToolboxCategory.defaultBackgroundColour="#57e",ri.ToolboxCategory.prototype.makeDefaultCssConfig_=function(){return{container:"blocklyToolboxCategory",row:"blocklyTreeRow",rowcontentcontainer:"blocklyTreeRowContentContainer",icon:"blocklyTreeIcon",label:"blocklyTreeLabel",contents:"blocklyToolboxContents",selected:"blocklyTreeSelected",openicon:"blocklyTreeIconOpen",closedicon:"blocklyTreeIconClosed"}},ri.ToolboxCategory.prototype.parseContents_=function(t){var e=t.contents;if(t.custom)this.flyoutItems_=t.custom;else if(e)for(t=0;t>>/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,Z.register)(Z.Type.TOOLBOX_ITEM,ri.ToolboxCategory.registrationName,ri.ToolboxCategory);var si={ToolboxSeparator:function(e,o){si.ToolboxSeparator.superClass_.constructor.call(this,e,o),this.cssConfig_={container:"blocklyTreeSeparator"},(0,t.module$exports$Blockly$utils$object.mixin)(this.cssConfig_,e.cssconfig||e.cssConfig)}};(0,t.module$exports$Blockly$utils$object.inherits)(si.ToolboxSeparator,ii.ToolboxItem),si.ToolboxSeparator.registrationName="sep",si.ToolboxSeparator.prototype.init=function(){this.createDom_()},si.ToolboxSeparator.prototype.createDom_=function(){var t=document.createElement("div");return(0,M.addClass)(t,this.cssConfig_.container),this.htmlDiv_=t},si.ToolboxSeparator.prototype.getDiv=function(){return this.htmlDiv_},si.ToolboxSeparator.prototype.dispose=function(){(0,M.removeNode)(this.htmlDiv_)},(0,c.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,Z.register)(Z.Type.TOOLBOX_ITEM,si.ToolboxSeparator.registrationName,si.ToolboxSeparator);var li={CollapsibleToolboxCategory:function(t,e,o){this.subcategoriesDiv_=null,this.expanded_=!1,this.toolboxItems_=[],li.CollapsibleToolboxCategory.superClass_.constructor.call(this,t,e,o)}};(0,t.module$exports$Blockly$utils$object.inherits)(li.CollapsibleToolboxCategory,ri.ToolboxCategory),li.CollapsibleToolboxCategory.registrationName="collapsibleCategory",li.CollapsibleToolboxCategory.prototype.makeDefaultCssConfig_=function(){var t=li.CollapsibleToolboxCategory.superClass_.makeDefaultCssConfig_.call(this);return t.contents="blocklyToolboxContents",t},li.CollapsibleToolboxCategory.prototype.parseContents_=function(t){var e=t.contents,o=!0;if(t.custom)this.flyoutItems_=t.custom;else if(e)for(t=0;t>>/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,Z.register)(Z.Type.TOOLBOX,Z.DEFAULT,ci.Toolbox);var ui={HorizontalFlyout:function(t){ui.HorizontalFlyout.superClass_.constructor.call(this,t),this.horizontalLayout=!0}};(0,t.module$exports$Blockly$utils$object.inherits)(ui.HorizontalFlyout,oi.Flyout),ui.HorizontalFlyout.prototype.setMetrics_=function(t){if(this.isVisible()){var e=this.workspace_.getMetricsManager(),o=e.getScrollMetrics(),n=e.getViewMetrics();e=e.getAbsoluteMetrics(),"number"==typeof t.x&&(this.workspace_.scrollX=-(o.left+(o.width-n.width)*t.x)),this.workspace_.translate(this.workspace_.scrollX+e.left,this.workspace_.scrollY+e.top)}},ui.HorizontalFlyout.prototype.getX=function(){return 0},ui.HorizontalFlyout.prototype.getY=function(){if(!this.isVisible())return 0;var t=this.targetWorkspace.getMetricsManager(),e=t.getAbsoluteMetrics(),o=t.getViewMetrics();t=t.getToolboxMetrics();var n=this.toolboxPosition_===Ut.Position.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?n?t.height:o.height-this.height_:n?0:o.height:n?0:o.height+e.top-this.height_},ui.HorizontalFlyout.prototype.position=function(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var t=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=t.width,this.setBackgroundPath_(t.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),t=this.getX();var e=this.getY();this.positionAt_(this.width_,this.height_,t,e)}},ui.HorizontalFlyout.prototype.setBackgroundPath_=function(t,e){var o=this.toolboxPosition_===Ut.Position.TOP,n=["M 0,"+(o?0:this.CORNER_RADIUS)];o?(n.push("h",t+2*this.CORNER_RADIUS),n.push("v",e),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("h",-t),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),n.push("h",t),n.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),n.push("v",e),n.push("h",-t-2*this.CORNER_RADIUS)),n.push("z"),this.svgBackground_.setAttribute("d",n.join(" "))},ui.HorizontalFlyout.prototype.scrollToStart=function(){this.workspace_.scrollbar.setX(this.RTL?1/0:0)},ui.HorizontalFlyout.prototype.wheel_=function(t){var e=(0,f.getScrollDeltaPixels)(t);if(e=e.x||e.y){var o=this.workspace_.getMetricsManager(),n=o.getScrollMetrics();e=o.getViewMetrics().left-n.left+e,this.workspace_.scrollbar.setX(e),(0,U.hide)(),St.DropDownDiv.hideWithoutAnimation()}t.preventDefault(),t.stopPropagation()},ui.HorizontalFlyout.prototype.layout_=function(t,e){this.workspace_.scale=this.targetWorkspace.scale;var o=this.MARGIN,n=o+this.tabWidth_;this.RTL&&(t=t.reverse());for(var i,r=0;i=t[r];r++)if("block"===i.type){for(var s,l=(i=i.block).getDescendants(!1),a=0;s=l[a];a++)s.isInFlyout=!0;i.render(),l=i.getSvgRoot(),a=i.getHeightWidth(),s=i.outputConnection?this.tabWidth_:0,s=this.RTL?n+a.width:n-s,i.moveBy(s,o),s=this.createRect_(i,s,o,a,r),n+=a.width+e[r],this.addBlockListeners_(l,i,s)}else"button"===i.type&&(this.initFlyoutButton_(i.button,n,o),n+=i.button.width+e[r])},ui.HorizontalFlyout.prototype.isDragTowardWorkspace=function(t){t=Math.atan2(t.y,t.x)/Math.PI*180;var e=this.dragAngleRange_;return t<90+e&&t>90-e||t>-90-e&&t<-90+e},ui.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;var t=this.svgGroup_.getBoundingClientRect(),e=t.top;return this.toolboxPosition_===Ut.Position.TOP?new mt.Rect(-1e9,e+t.height,-1e9,1e9):new mt.Rect(e,1e9,-1e9,1e9)},ui.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.getFlyoutScale();for(var t,e=0,o=this.workspace_.getTopBlocks(!1),n=0;t=o[n];n++)e=Math.max(e,t.getHeightWidth().height);n=this.buttons_,t=0;for(var i;i=n[t];t++)e=Math.max(e,i.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=Jt.Scrollbar.scrollbarThickness,this.height_!==e){for(n=0;t=o[n];n++)t.flyoutRect_&&this.moveRectToBlock_(t.flyoutRect_,t);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==Ut.Position.TOP||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.recordDragTargets()}},(0,Z.register)(Z.Type.FLYOUTS_HORIZONTAL_TOOLBOX,Z.DEFAULT,ui.HorizontalFlyout),t.module$exports$Blockly$Generator={Generator:function(t){this.name_=t,this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")}},t.module$exports$Blockly$Generator.Generator.prototype.INFINITE_LOOP_TRAP=null,t.module$exports$Blockly$Generator.Generator.prototype.STATEMENT_PREFIX=null,t.module$exports$Blockly$Generator.Generator.prototype.STATEMENT_SUFFIX=null,t.module$exports$Blockly$Generator.Generator.prototype.INDENT=" ",t.module$exports$Blockly$Generator.Generator.prototype.COMMENT_WRAP=60,t.module$exports$Blockly$Generator.Generator.prototype.ORDER_OVERRIDES=[],t.module$exports$Blockly$Generator.Generator.prototype.isInitialized=null,t.module$exports$Blockly$Generator.Generator.prototype.workspaceToCode=function(e){e||(console.warn("No workspace specified in workspaceToCode call. Guessing."),e=(0,t.module$exports$Blockly$common.getMainWorkspace)());var o=[];this.init(e),e=e.getTopBlocks(!0);for(var n,i=0;n=e[i];i++){var r=this.blockToCode(n);Array.isArray(r)&&(r=r[0]),r&&(n.outputConnection&&(r=this.scrubNakedValue(r),this.STATEMENT_PREFIX&&!n.suppressPrefixSuffix&&(r=this.injectId(this.STATEMENT_PREFIX,n)+r),this.STATEMENT_SUFFIX&&!n.suppressPrefixSuffix&&(r+=this.injectId(this.STATEMENT_SUFFIX,n))),o.push(r))}return o=o.join("\n"),(o=(o=(o=this.finish(o)).replace(/^\s+\n/,"")).replace(/\n\s+$/,"\n")).replace(/[ \t]+\n/g,"\n")},t.module$exports$Blockly$Generator.Generator.prototype.prefixLines=function(t,e){return e+t.replace(/(?!\n$)\n/g,"\n"+e)},t.module$exports$Blockly$Generator.Generator.prototype.allNestedComments=function(t){var e=[];t=t.getDescendants(!0);for(var o=0;oe.length)){for(o=[],n=0;n=e&&this.sourceBlock_.outputConnection&&!o}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_(),this.createTextElement_()},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.doClassValidation_=function(t){return null==t?null:String(t)},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.doValueInvalid_=function(t){this.isBeingEdited_&&(this.isTextValid_=!1,t=this.value_,this.value_=this.htmlInput_.untypedDefaultValue_,this.sourceBlock_&&(0,nt.isEnabled)()&&(0,nt.fire)(new((0,nt.get)(nt.CHANGE))(this.sourceBlock_,"field",this.name||null,t,this.value_)))},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.doValueUpdate_=function(t){this.isTextValid_=!0,this.value_=t,this.isBeingEdited_||(this.isDirty_=!0)},t.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))},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.render_=function(){if(t.module$exports$Blockly$FieldTextInput.FieldTextInput.superClass_.render_.call(this),this.isBeingEdited_){this.resizeEditor_();var e=this.htmlInput_;this.isTextValid_?((0,M.removeClass)(e,"blocklyInvalidInput"),(0,j.setState)(e,j.State.INVALID,!1)):((0,M.addClass)(e,"blocklyInvalidInput"),(0,j.setState)(e,j.State.INVALID,!0))}},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.setSpellcheck=function(t){t!==this.spellcheck_&&(this.spellcheck_=t,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.showEditor_=function(t,e){this.workspace_=this.sourceBlock_.workspace,!(t=e||!1)&&(_.MOBILE||_.ANDROID||_.IPAD)?this.showPromptEditor_():this.showInlineEditor_(t)},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.showPromptEditor_=function(){(0,uo.prompt)(t.module$exports$Blockly$Msg.Msg.CHANGE_VALUE_TITLE,this.getText(),function(t){null!==t&&this.setValue(this.getValueFromEditorText_(t))}.bind(this))},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.showInlineEditor_=function(t){(0,U.show)(this,this.sourceBlock_.RTL,this.widgetDispose_.bind(this)),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,t||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.widgetCreate_=function(){(0,nt.setGroup)(!0);var e=(0,U.getDiv)();(0,M.addClass)(this.getClickTarget_(),"editing");var o=document.createElement("input");o.className="blocklyHtmlInput",o.setAttribute("spellcheck",this.spellcheck_);var n=this.workspace_.getScale(),i=this.getConstants().FIELD_TEXT_FONTSIZE*n+"pt";if(e.style.fontSize=i,o.style.fontSize=i,i=t.module$exports$Blockly$FieldTextInput.FieldTextInput.BORDERRADIUS*n+"px",this.fullBlockClickTarget_){i=((i=this.getScaledBBox()).bottom-i.top)/2+"px";var r=this.sourceBlock_.getParent()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;o.style.border=1*n+"px solid "+r,e.style.borderRadius=i,e.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(e.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*n+"px")}return o.style.borderRadius=i,e.appendChild(o),o.value=o.defaultValue=this.getEditorText_(this.value_),o.untypedDefaultValue_=this.value_,o.oldValue_=null,this.resizeEditor_(),this.bindInputEvents_(o),o},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.widgetDispose_=function(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_&&this.onFinishEditing_(this.value_),(0,nt.setGroup)(!1),this.unbindInputEvents_();var t=(0,U.getDiv)().style;t.width="auto",t.height="auto",t.fontSize="",t.transition="",t.boxShadow="",this.htmlInput_=null,(0,M.removeClass)(this.getClickTarget_(),"editing")},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.bindInputEvents_=function(t){this.onKeyDownWrapper_=(0,f.conditionalBind)(t,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=(0,f.conditionalBind)(t,"input",this,this.onHtmlInputChange_)},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.unbindInputEvents_=function(){this.onKeyDownWrapper_&&((0,f.unbind)(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&((0,f.unbind)(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.onHtmlInputKeyDown_=function(t){t.keyCode===qt.ENTER?((0,U.hide)(),St.DropDownDiv.hideWithoutAnimation()):t.keyCode===qt.ESC?(this.setValue(this.htmlInput_.untypedDefaultValue_),(0,U.hide)(),St.DropDownDiv.hideWithoutAnimation()):t.keyCode===qt.TAB&&((0,U.hide)(),St.DropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!t.shiftKey),t.preventDefault())},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.onHtmlInputChange_=function(t){(t=this.htmlInput_.value)!==this.htmlInput_.oldValue_&&(this.htmlInput_.oldValue_=t,t=this.getValueFromEditorText_(t),this.setValue(t),this.forceRerender(),this.resizeEditor_())},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.setEditorValue_=function(t){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(t)),this.setValue(t)},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.resizeEditor_=function(){var t=(0,U.getDiv)(),e=this.getScaledBBox();t.style.width=e.right-e.left+"px",t.style.height=e.bottom-e.top+"px",e=new ht.Coordinate(this.sourceBlock_.RTL?e.right-t.offsetWidth:e.left,e.top),t.style.left=e.x+"px",t.style.top=e.y+"px"},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.isTabNavigable=function(){return!0},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.getText_=function(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.getEditorText_=function(t){return String(t)},t.module$exports$Blockly$FieldTextInput.FieldTextInput.prototype.getValueFromEditorText_=function(t){return t},(0,to.register)("field_input",t.module$exports$Blockly$FieldTextInput.FieldTextInput);var di={FieldNumber:function(t,e,o,n,i,r){this.min_=-1/0,this.max_=1/0,this.precision_=0,this.decimalPlaces_=null,di.FieldNumber.superClass_.constructor.call(this,t,i,r),r||this.setConstraints(e,o,n)}};(0,t.module$exports$Blockly$utils$object.inherits)(di.FieldNumber,t.module$exports$Blockly$FieldTextInput.FieldTextInput),di.FieldNumber.prototype.DEFAULT_VALUE=0,di.FieldNumber.fromJson=function(t){return new this(t.value,void 0,void 0,void 0,void 0,t)},di.FieldNumber.prototype.SERIALIZABLE=!0,di.FieldNumber.prototype.configure_=function(t){di.FieldNumber.superClass_.configure_.call(this,t),this.setMinInternal_(t.min),this.setMaxInternal_(t.max),this.setPrecisionInternal_(t.precision)},di.FieldNumber.prototype.setConstraints=function(t,e,o){this.setMinInternal_(t),this.setMaxInternal_(e),this.setPrecisionInternal_(o),this.setValue(this.getValue())},di.FieldNumber.prototype.setMin=function(t){this.setMinInternal_(t),this.setValue(this.getValue())},di.FieldNumber.prototype.setMinInternal_=function(t){null==t?this.min_=-1/0:(t=Number(t),isNaN(t)||(this.min_=t))},di.FieldNumber.prototype.getMin=function(){return this.min_},di.FieldNumber.prototype.setMax=function(t){this.setMaxInternal_(t),this.setValue(this.getValue())},di.FieldNumber.prototype.setMaxInternal_=function(t){null==t?this.max_=1/0:(t=Number(t),isNaN(t)||(this.max_=t))},di.FieldNumber.prototype.getMax=function(){return this.max_},di.FieldNumber.prototype.setPrecision=function(t){this.setPrecisionInternal_(t),this.setValue(this.getValue())},di.FieldNumber.prototype.setPrecisionInternal_=function(t){this.precision_=Number(t)||0;var e=String(this.precision_);-1!==e.indexOf("e")&&(e=this.precision_.toLocaleString("en-US",{maximumFractionDigits:20}));var o=e.indexOf(".");this.decimalPlaces_=-1===o?t?0:null:e.length-o-1},di.FieldNumber.prototype.getPrecision=function(){return this.precision_},di.FieldNumber.prototype.doClassValidation_=function(t){return null===t?null:(t=(t=(t=(t=String(t)).replace(/O/gi,"0")).replace(/,/g,"")).replace(/infinity/i,"Infinity"),t=Number(t||0),isNaN(t)?null:(t=Math.min(Math.max(t,this.min_),this.max_),this.precision_&&isFinite(t)&&(t=Math.round(t/this.precision_)*this.precision_),null!==this.decimalPlaces_&&(t=Number(t.toFixed(this.decimalPlaces_))),t))},di.FieldNumber.prototype.widgetCreate_=function(){var t=di.FieldNumber.superClass_.widgetCreate_.call(this);return-1/0this.max_&&(0,j.setState)(t,j.State.VALUEMAX,this.max_),t},(0,to.register)("field_number",di.FieldNumber);var _i={FieldMultilineInput:function(t,e,o){_i.FieldMultilineInput.superClass_.constructor.call(this,t,e,o),this.textGroup_=null,this.maxLines_=1/0,this.isOverflowedY_=!1}};(0,t.module$exports$Blockly$utils$object.inherits)(_i.FieldMultilineInput,t.module$exports$Blockly$FieldTextInput.FieldTextInput),_i.FieldMultilineInput.prototype.configure_=function(t){_i.FieldMultilineInput.superClass_.configure_.call(this,t),t.maxLines&&this.setMaxLines(t.maxLines)},_i.FieldMultilineInput.fromJson=function(t){return new this((0,qe.replaceMessageReferences)(t.text),void 0,t)},_i.FieldMultilineInput.prototype.toXml=function(t){return t.textContent=this.getValue().replace(/\n/g," "),t},_i.FieldMultilineInput.prototype.fromXml=function(t){this.setValue(t.textContent.replace(/ /g,"\n"))},_i.FieldMultilineInput.prototype.saveState=function(){var t=this.saveLegacyState(_i.FieldMultilineInput);return null!==t?t:this.getValue()},_i.FieldMultilineInput.prototype.loadState=function(t){this.loadLegacyState(Vo.Field,t)||this.setValue(t)},_i.FieldMultilineInput.prototype.initView=function(){this.createBorderRect_(),this.textGroup_=(0,M.createSvgElement)(vt.Svg.G,{class:"blocklyEditableText"},this.fieldGroup_)},_i.FieldMultilineInput.prototype.getDisplayText_=function(){var t=this.getText();if(!t)return Vo.Field.NBSP;var e=t.split("\n");t="";for(var o=this.isOverflowedY_?this.maxLines_:e.length,n=0;nthis.maxDisplayLength?i=i.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&n===o-1&&(i=i.substring(0,i.length-3)+"..."),t+=i=i.replace(/\s/g,Vo.Field.NBSP),n!==o-1&&(t+="\n")}return this.sourceBlock_.RTL&&(t+="‏"),t},_i.FieldMultilineInput.prototype.doValueUpdate_=function(t){_i.FieldMultilineInput.superClass_.doValueUpdate_.call(this,t),this.isOverflowedY_=this.value_.split("\n").length>this.maxLines_},_i.FieldMultilineInput.prototype.render_=function(){for(var t;t=this.textGroup_.firstChild;)this.textGroup_.removeChild(t);t=this.getDisplayText_().split("\n");for(var e=0,o=0;oe&&(e=i),o+=this.getConstants().FIELD_TEXT_HEIGHT+(0this.maxDisplayLength&&(t[l]=t[l].substring(0,this.maxDisplayLength)),n.textContent=t[l];var a=(0,M.getFastTextWidth)(n,i,r,s);a>e&&(e=a)}e+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&(o+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,e+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",e),this.borderRect_.setAttribute("height",o)),this.size_.width=e,this.size_.height=o,this.positionBorderRect_()},_i.FieldMultilineInput.prototype.showEditor_=function(t,e){_i.FieldMultilineInput.superClass_.showEditor_.call(this,t,e),this.forceRerender()},_i.FieldMultilineInput.prototype.widgetCreate_=function(){var e=(0,U.getDiv)(),o=this.workspace_.getScale(),n=document.createElement("textarea");n.className="blocklyHtmlInput blocklyHtmlTextAreaInput",n.setAttribute("spellcheck",this.spellcheck_);var i=this.getConstants().FIELD_TEXT_FONTSIZE*o+"pt";e.style.fontSize=i,n.style.fontSize=i,n.style.borderRadius=t.module$exports$Blockly$FieldTextInput.FieldTextInput.BORDERRADIUS*o+"px",i=this.getConstants().FIELD_BORDER_RECT_X_PADDING*o;var r=this.getConstants().FIELD_BORDER_RECT_Y_PADDING*o/2;return n.style.padding=r+"px "+i+"px "+r+"px "+i+"px",i=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,n.style.lineHeight=i*o+"px",e.appendChild(n),n.value=n.defaultValue=this.getEditorText_(this.value_),n.untypedDefaultValue_=this.value_,n.oldValue_=null,_.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(n),n},_i.FieldMultilineInput.prototype.setMaxLines=function(t){"number"==typeof t&&0t?0>i&&0i&&(i=0):0n-1&&rn-1&&i--:0>e?0>r&&(r=0):0Math.floor(o.length/n)-1&&(r=Math.floor(o.length/n)-1),this.setHighlightedCell_(this.picker_.childNodes[r].childNodes[i],r*n+i)},fi.FieldColour.prototype.onMouseMove_=function(t){var e=(t=t.target)&&Number(t.getAttribute("data-index"));null!==e&&e!==this.highlightedIndex_&&this.setHighlightedCell_(t,e)},fi.FieldColour.prototype.onMouseEnter_=function(){this.picker_.focus({preventScroll:!0})},fi.FieldColour.prototype.onMouseLeave_=function(){this.picker_.blur();var t=this.getHighlighted_();t&&(0,M.removeClass)(t,"blocklyColourHighlighted")},fi.FieldColour.prototype.getHighlighted_=function(){var t=this.columns_||fi.FieldColour.COLUMNS,e=this.picker_.childNodes[Math.floor(this.highlightedIndex_/t)];return e?e.childNodes[this.highlightedIndex_%t]:null},fi.FieldColour.prototype.setHighlightedCell_=function(t,e){var o=this.getHighlighted_();o&&(0,M.removeClass)(o,"blocklyColourHighlighted"),(0,M.addClass)(t,"blocklyColourHighlighted"),this.highlightedIndex_=e,(0,j.setState)(this.picker_,j.State.ACTIVEDESCENDANT,t.getAttribute("id"))},fi.FieldColour.prototype.dropdownCreate_=function(){var t=this.columns_||fi.FieldColour.COLUMNS,e=this.colours_||fi.FieldColour.COLOURS,o=this.titles_||fi.FieldColour.TITLES,n=this.getValue(),i=document.createElement("table");i.className="blocklyColourTable",i.tabIndex=0,i.dir="ltr",(0,j.setRole)(i,j.Role.GRID),(0,j.setState)(i,j.State.EXPANDED,!0),(0,j.setState)(i,j.State.ROWCOUNT,Math.floor(e.length/t)),(0,j.setState)(i,j.State.COLCOUNT,t);for(var r,s=0;str>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,to.register)("field_colour",fi.FieldColour),t.module$exports$Blockly$FieldCheckbox={FieldCheckbox:function(e,o,n){this.checkChar_=null,t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.superClass_.constructor.call(this,e,o,n)}},(0,t.module$exports$Blockly$utils$object.inherits)(t.module$exports$Blockly$FieldCheckbox.FieldCheckbox,Vo.Field),t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.DEFAULT_VALUE=!1,t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.fromJson=function(t){return new this(t.checked,void 0,t)},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.CHECK_CHAR="✓",t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.SERIALIZABLE=!0,t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.CURSOR="default",t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.configure_=function(e){t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.superClass_.configure_.call(this,e),e.checkCharacter&&(this.checkChar_=e.checkCharacter)},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.saveState=function(){var e=this.saveLegacyState(t.module$exports$Blockly$FieldCheckbox.FieldCheckbox);return null!==e?e:this.getValueBoolean()},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.initView=function(){t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.superClass_.initView.call(this),(0,M.addClass)(this.textElement_,"blocklyCheckbox"),this.textElement_.style.display=this.value_?"block":"none"},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getDisplayText_=function(){return this.checkChar_||t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.CHECK_CHAR},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.setCheckCharacter=function(t){this.checkChar_=t,this.forceRerender()},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.showEditor_=function(){this.setValue(!this.value_)},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.doClassValidation_=function(t){return!0===t||"TRUE"===t?"TRUE":!1===t||"FALSE"===t?"FALSE":null},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.doValueUpdate_=function(t){this.value_=this.convertValueToBool_(t),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getValue=function(){return this.value_?"TRUE":"FALSE"},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getValueBoolean=function(){return this.value_},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.getText=function(){return String(this.convertValueToBool_(this.value_))},t.module$exports$Blockly$FieldCheckbox.FieldCheckbox.prototype.convertValueToBool_=function(t){return"string"==typeof t?"TRUE"===t:!!t},(0,to.register)("field_checkbox",t.module$exports$Blockly$FieldCheckbox.FieldCheckbox);var mi={FieldAngle:function(t,e,o){this.clockwise_=mi.FieldAngle.CLOCKWISE,this.offset_=mi.FieldAngle.OFFSET,this.wrap_=mi.FieldAngle.WRAP,this.round_=mi.FieldAngle.ROUND,mi.FieldAngle.superClass_.constructor.call(this,t,e,o),this.moveSurfaceWrapper_=this.clickSurfaceWrapper_=this.clickWrapper_=this.line_=this.gauge_=this.editor_=null}};(0,t.module$exports$Blockly$utils$object.inherits)(mi.FieldAngle,t.module$exports$Blockly$FieldTextInput.FieldTextInput),mi.FieldAngle.prototype.DEFAULT_VALUE=0,mi.FieldAngle.fromJson=function(t){return new this(t.angle,void 0,t)},mi.FieldAngle.prototype.SERIALIZABLE=!0,mi.FieldAngle.ROUND=15,mi.FieldAngle.HALF=50,mi.FieldAngle.CLOCKWISE=!1,mi.FieldAngle.OFFSET=0,mi.FieldAngle.WRAP=360,mi.FieldAngle.RADIUS=mi.FieldAngle.HALF-1,mi.FieldAngle.prototype.configure_=function(t){switch(mi.FieldAngle.superClass_.configure_.call(this,t),t.mode){case"compass":this.clockwise_=!0,this.offset_=90;break;case"protractor":this.clockwise_=!1,this.offset_=0}var e=t.clockwise;"boolean"==typeof e&&(this.clockwise_=e),null!==(e=t.offset)&&(e=Number(e),isNaN(e)||(this.offset_=e)),null!==(e=t.wrap)&&(e=Number(e),isNaN(e)||(this.wrap_=e)),null!==(t=t.round)&&(t=Number(t),isNaN(t)||(this.round_=t))},mi.FieldAngle.prototype.initView=function(){mi.FieldAngle.superClass_.initView.call(this),this.symbol_=(0,M.createSvgElement)(vt.Svg.TSPAN,{},null),this.symbol_.appendChild(document.createTextNode("°")),this.textElement_.appendChild(this.symbol_)},mi.FieldAngle.prototype.render_=function(){mi.FieldAngle.superClass_.render_.call(this),this.updateGraph_()},mi.FieldAngle.prototype.showEditor_=function(t){mi.FieldAngle.superClass_.showEditor_.call(this,t,_.MOBILE||_.ANDROID||_.IPAD),this.dropdownCreate_(),St.DropDownDiv.getContentDiv().appendChild(this.editor_),St.DropDownDiv.setColour(this.sourceBlock_.style.colourPrimary,this.sourceBlock_.style.colourTertiary),St.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this)),this.updateGraph_()},mi.FieldAngle.prototype.dropdownCreate_=function(){var t=(0,M.createSvgElement)(vt.Svg.SVG,{xmlns:M.SVG_NS,"xmlns:html":M.HTML_NS,"xmlns:xlink":M.XLINK_NS,version:"1.1",height:2*mi.FieldAngle.HALF+"px",width:2*mi.FieldAngle.HALF+"px",style:"touch-action: none"},null),e=(0,M.createSvgElement)(vt.Svg.CIRCLE,{cx:mi.FieldAngle.HALF,cy:mi.FieldAngle.HALF,r:mi.FieldAngle.RADIUS,class:"blocklyAngleCircle"},t);this.gauge_=(0,M.createSvgElement)(vt.Svg.PATH,{class:"blocklyAngleGauge"},t),this.line_=(0,M.createSvgElement)(vt.Svg.LINE,{x1:mi.FieldAngle.HALF,y1:mi.FieldAngle.HALF,class:"blocklyAngleLine"},t);for(var o=0;360>o;o+=15)(0,M.createSvgElement)(vt.Svg.LINE,{x1:mi.FieldAngle.HALF+mi.FieldAngle.RADIUS,y1:mi.FieldAngle.HALF,x2:mi.FieldAngle.HALF+mi.FieldAngle.RADIUS-(0==o%45?10:5),y2:mi.FieldAngle.HALF,class:"blocklyAngleMarks",transform:"rotate("+o+","+mi.FieldAngle.HALF+","+mi.FieldAngle.HALF+")"},t);this.clickWrapper_=(0,f.conditionalBind)(t,"click",this,this.hide_),this.clickSurfaceWrapper_=(0,f.conditionalBind)(e,"click",this,this.onMouseMove_,!0,!0),this.moveSurfaceWrapper_=(0,f.conditionalBind)(e,"mousemove",this,this.onMouseMove_,!0,!0),this.editor_=t},mi.FieldAngle.prototype.dropdownDispose_=function(){this.clickWrapper_&&((0,f.unbind)(this.clickWrapper_),this.clickWrapper_=null),this.clickSurfaceWrapper_&&((0,f.unbind)(this.clickSurfaceWrapper_),this.clickSurfaceWrapper_=null),this.moveSurfaceWrapper_&&((0,f.unbind)(this.moveSurfaceWrapper_),this.moveSurfaceWrapper_=null),this.line_=this.gauge_=null},mi.FieldAngle.prototype.hide_=function(){St.DropDownDiv.hideIfOwner(this),(0,U.hide)()},mi.FieldAngle.prototype.onMouseMove_=function(t){var e=this.gauge_.ownerSVGElement.getBoundingClientRect(),o=t.clientX-e.left-mi.FieldAngle.HALF;t=t.clientY-e.top-mi.FieldAngle.HALF,e=Math.atan(-t/o),isNaN(e)||(e=(0,ct.toDegrees)(e),0>o?e+=180:0(t%=360)&&(t+=360),t>this.wrap_&&(t-=360),t},(0,c.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,to.register)("field_angle",mi.FieldAngle);var yi={TopRow:function(t){yi.TopRow.superClass_.constructor.call(this,t)}};(0,t.module$exports$Blockly$utils$object.inherits)(yi.TopRow,gn.TopRow),yi.TopRow.prototype.endsWithElemSpacer=function(){return!1},yi.TopRow.prototype.hasLeftSquareCorner=function(t){var e=(t.hat?"cap"===t.hat:this.constants_.ADD_START_HATS)&&!t.outputConnection&&!t.previousConnection;return!!t.outputConnection||e},yi.TopRow.prototype.hasRightSquareCorner=function(t){return!!t.outputConnection&&!t.statementInputCount&&!t.nextConnection};var Ti={StatementInput:function(t,e){if(Ti.StatementInput.superClass_.constructor.call(this,t,e),this.connectedBlock){for(t=this.connectedBlock;e=t.getNextBlock();)t=e;t.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}};(0,t.module$exports$Blockly$utils$object.inherits)(Ti.StatementInput,_n.StatementInput);var Ei={RightConnectionShape:function(t){Ei.RightConnectionShape.superClass_.constructor.call(this,t),this.type|=Ge.Types.getType("RIGHT_CONNECTION"),this.width=this.height=0}};(0,t.module$exports$Blockly$utils$object.inherits)(Ei.RightConnectionShape,Ye);var vi={MarkerSvg:function(t,e,o){vi.MarkerSvg.superClass_.constructor.call(this,t,e,o)}};(0,t.module$exports$Blockly$utils$object.inherits)(vi.MarkerSvg,sn.MarkerSvg),vi.MarkerSvg.prototype.showWithInputOutput_=function(t){var e=t.getSourceBlock();t=t.getLocation().getOffsetInBlock(),this.positionCircle_(t.x,t.y),this.setParent_(e),this.showCurrent_()},vi.MarkerSvg.prototype.showWithOutput_=function(t){this.showWithInputOutput_(t)},vi.MarkerSvg.prototype.showWithInput_=function(t){this.showWithInputOutput_(t)},vi.MarkerSvg.prototype.showWithBlock_=function(t){var e=(t=t.getLocation()).getHeightWidth();this.positionRect_(0,0,e.width,e.height),this.setParent_(t),this.showCurrent_()},vi.MarkerSvg.prototype.positionCircle_=function(t,e){this.markerCircle_.setAttribute("cx",t),this.markerCircle_.setAttribute("cy",e),this.currentMarkerSvg=this.markerCircle_},vi.MarkerSvg.prototype.hide=function(){vi.MarkerSvg.superClass_.hide.call(this),this.markerCircle_.style.display="none"},vi.MarkerSvg.prototype.createDomInternal_=function(){if(vi.MarkerSvg.superClass_.createDomInternal_.call(this),this.markerCircle_=(0,M.createSvgElement)(vt.Svg.CIRCLE,{r:this.constants_.CURSOR_RADIUS,style:"display: none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_),this.isCursor()){var t=this.getBlinkProperties_();(0,M.createSvgElement)(vt.Svg.ANIMATE,t,this.markerCircle_)}return this.markerSvg_},vi.MarkerSvg.prototype.applyColour_=function(t){vi.MarkerSvg.superClass_.applyColour_.call(this,t),this.markerCircle_.setAttribute("fill",this.colour_),this.markerCircle_.setAttribute("stroke",this.colour_),this.isCursor()&&this.markerCircle_.firstChild.setAttribute("values",this.colour_+";transparent;transparent;")};var ki={ConstantProvider:function(){ki.ConstantProvider.superClass_.constructor.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.replacementGlowFilter_=null}};(0,t.module$exports$Blockly$utils$object.inherits)(ki.ConstantProvider,Qe.ConstantProvider),ki.ConstantProvider.prototype.setFontConstants_=function(t){ki.ConstantProvider.superClass_.setFontConstants_.call(this,t),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING},ki.ConstantProvider.prototype.init=function(){ki.ConstantProvider.superClass_.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},ki.ConstantProvider.prototype.setDynamicProperties_=function(t){ki.ConstantProvider.superClass_.setDynamicProperties_.call(this,t),this.SELECTED_GLOW_COLOUR=t.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;var e=Number(t.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=e&&!isNaN(e)?e:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=t.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(t=Number(t.getComponentStyle("replacementGlowSize")))&&!isNaN(t)?t:this.REPLACEMENT_GLOW_SIZE},ki.ConstantProvider.prototype.dispose=function(){ki.ConstantProvider.superClass_.dispose.call(this),this.selectedGlowFilter_&&(0,M.removeNode)(this.selectedGlowFilter_),this.replacementGlowFilter_&&(0,M.removeNode)(this.replacementGlowFilter_)},ki.ConstantProvider.prototype.makeStartHat=function(){var t=this.START_HAT_HEIGHT,e=this.START_HAT_WIDTH;return{height:t,width:e,path:(0,ze.curve)("c",[(0,ze.point)(25,-t),(0,ze.point)(71,-t),(0,ze.point)(e,0)])}},ki.ConstantProvider.prototype.makeHexagonal=function(){function t(t,o,n){var i=t/2;return(0,ze.lineTo)(-(n=n?-1:1)*(i=i>e?e:i),t=(o?-1:1)*t/2)+(0,ze.lineTo)(n*i,t)}var e=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width:function(t){return(t/=2)>e?e:t},height:function(t){return t},connectionOffsetY:function(t){return t/2},connectionOffsetX:function(t){return-t},pathDown:function(e){return t(e,!1,!1)},pathUp:function(e){return t(e,!0,!1)},pathRightDown:function(e){return t(e,!1,!0)},pathRightUp:function(e){return t(e,!1,!0)}}},ki.ConstantProvider.prototype.makeRounded=function(){function t(t,e,n){var i=t>o?t-o:0;return(0,ze.arc)("a","0 0,1",t=(t>o?o:t)/2,(0,ze.point)((e?-1:1)*t,(e?-1:1)*t))+(0,ze.lineOnAxis)("v",(n?1:-1)*i)+(0,ze.arc)("a","0 0,1",t,(0,ze.point)((e?1:-1)*t,(e?-1:1)*t))}var e=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,o=2*e;return{type:this.SHAPES.ROUND,isDynamic:!0,width:function(t){return(t/=2)>e?e:t},height:function(t){return t},connectionOffsetY:function(t){return t/2},connectionOffsetX:function(t){return-t},pathDown:function(e){return t(e,!1,!1)},pathUp:function(e){return t(e,!0,!1)},pathRightDown:function(e){return t(e,!1,!0)},pathRightUp:function(e){return t(e,!1,!0)}}},ki.ConstantProvider.prototype.makeSquared=function(){function t(t,o,n){return t-=2*e,(0,ze.arc)("a","0 0,1",e,(0,ze.point)((o?-1:1)*e,(o?-1:1)*e))+(0,ze.lineOnAxis)("v",(n?1:-1)*t)+(0,ze.arc)("a","0 0,1",e,(0,ze.point)((o?1:-1)*e,(o?-1:1)*e))}var e=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width:function(t){return e},height:function(t){return t},connectionOffsetY:function(t){return t/2},connectionOffsetX:function(t){return-t},pathDown:function(e){return t(e,!1,!1)},pathUp:function(e){return t(e,!0,!1)},pathRightDown:function(e){return t(e,!1,!0)},pathRightUp:function(e){return t(e,!1,!0)}}},ki.ConstantProvider.prototype.shapeFor=function(e){var o=e.getCheck();switch(!o&&e.targetConnection&&(o=e.targetConnection.getCheck()),e.type){case t.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE:case t.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE:if(null!==(e=e.getSourceBlock().getOutputShape()))switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return o&&-1!==o.indexOf("Boolean")?this.HEXAGONAL:(o&&-1!==o.indexOf("Number")||o&&o.indexOf("String"),this.ROUNDED);case t.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT:case t.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}},ki.ConstantProvider.prototype.makeNotch=function(){function t(t){return(0,ze.curve)("c",[(0,ze.point)(t*i/2,0),(0,ze.point)(t*i*3/4,s/2),(0,ze.point)(t*i,s)])+(0,ze.line)([(0,ze.point)(t*i,r)])+(0,ze.curve)("c",[(0,ze.point)(t*i/4,s/2),(0,ze.point)(t*i/2,s),(0,ze.point)(t*i,s)])+(0,ze.lineOnAxis)("h",t*n)+(0,ze.curve)("c",[(0,ze.point)(t*i/2,0),(0,ze.point)(t*i*3/4,-s/2),(0,ze.point)(t*i,-s)])+(0,ze.line)([(0,ze.point)(t*i,-r)])+(0,ze.curve)("c",[(0,ze.point)(t*i/4,-s/2),(0,ze.point)(t*i/2,-s),(0,ze.point)(t*i,-s)])}var e=this.NOTCH_WIDTH,o=this.NOTCH_HEIGHT,n=e/3,i=n/3,r=o/2,s=r/2,l=t(1),a=t(-1);return{type:this.SHAPES.NOTCH,width:e,height:o,pathLeft:l,pathRight:a}},ki.ConstantProvider.prototype.makeInsideCorners=function(){var t=this.CORNER_RADIUS,e=(0,ze.arc)("a","0 0,0",t,(0,ze.point)(-t,t)),o=(0,ze.arc)("a","0 0,1",t,(0,ze.point)(-t,t));return{width:t,height:t,pathTop:e,pathBottom:(0,ze.arc)("a","0 0,0",t,(0,ze.point)(t,t)),rightWidth:t,rightHeight:t,pathTopRight:o,pathBottomRight:(0,ze.arc)("a","0 0,1",t,(0,ze.point)(t,t))}},ki.ConstantProvider.prototype.generateSecondaryColour_=function(t){return(0,Ke.blend)("#000",t,.15)||t},ki.ConstantProvider.prototype.generateTertiaryColour_=function(t){return(0,Ke.blend)("#000",t,.25)||t},ki.ConstantProvider.prototype.createDom=function(t,e,o){ki.ConstantProvider.superClass_.createDom.call(this,t,e,o),t=(0,M.createSvgElement)(vt.Svg.DEFS,{},t),e=(0,M.createSvgElement)(vt.Svg.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},t),(0,M.createSvgElement)(vt.Svg.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},e),o=(0,M.createSvgElement)(vt.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},e),(0,M.createSvgElement)(vt.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},o),(0,M.createSvgElement)(vt.Svg.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),(0,M.createSvgElement)(vt.Svg.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),this.selectedGlowFilterId=e.id,this.selectedGlowFilter_=e,t=(0,M.createSvgElement)(vt.Svg.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},t),(0,M.createSvgElement)(vt.Svg.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},t),e=(0,M.createSvgElement)(vt.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},t),(0,M.createSvgElement)(vt.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},e),(0,M.createSvgElement)(vt.Svg.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),(0,M.createSvgElement)(vt.Svg.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),(0,M.createSvgElement)(vt.Svg.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},t),this.replacementGlowFilterId=t.id,this.replacementGlowFilter_=t},ki.ConstantProvider.prototype.getCSS_=function(t){return[t+" .blocklyText,",t+" .blocklyFlyoutLabelText {","font: "+this.FIELD_TEXT_FONTWEIGHT+" "+this.FIELD_TEXT_FONTSIZE+"pt "+this.FIELD_TEXT_FONTFAMILY+";","}",t+" .blocklyText {","fill: #fff;","}",t+" .blocklyNonEditableText>rect:not(.blocklyDropdownRect),",t+" .blocklyEditableText>rect:not(.blocklyDropdownRect) {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","}",t+" .blocklyNonEditableText>text,",t+" .blocklyEditableText>text,",t+" .blocklyNonEditableText>g>text,",t+" .blocklyEditableText>g>text {","fill: #575E75;","}",t+" .blocklyFlyoutLabelText {","fill: #575E75;","}",t+" .blocklyText.blocklyBubbleText {","fill: #575E75;","}",t+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>rect,",t+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",t+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","color: #575E75;","}",t+" .blocklyDropdownText {","fill: #fff !important;","}",t+".blocklyWidgetDiv .goog-menuitem,",t+".blocklyDropDownDiv .goog-menuitem {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","}",t+".blocklyDropDownDiv .goog-menuitem-content {","color: #fff;","}",t+" .blocklyHighlightedConnectionPath {","stroke: "+this.SELECTED_GLOW_COLOUR+";","}",t+" .blocklyDisabled > .blocklyOutlinePath {","fill: url(#blocklyDisabledPattern"+this.randomIdentifier+")","}",t+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"]};var Si={Drawer:function(t,e){Si.Drawer.superClass_.constructor.call(this,t,e)}};(0,t.module$exports$Blockly$utils$object.inherits)(Si.Drawer,Xo.Drawer),Si.Drawer.prototype.draw=function(){var t=this.block_.pathObject;t.beginDrawing(),this.hideHiddenIcons_(),this.drawOutline_(),this.drawInternals_(),t.setPath(this.outlinePath_+"\n"+this.inlinePath_),this.info_.RTL&&t.flipRTL(),(0,Ue.isDebuggerEnabled)()&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_),this.recordSizeOnBlock_(),this.info_.outputConnection&&(t.outputShapeType=this.info_.outputConnection.shape.type),t.endDrawing()},Si.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_()):Si.Drawer.superClass_.drawOutline_.call(this)},Si.Drawer.prototype.drawLeft_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():Si.Drawer.superClass_.drawLeft_.call(this)},Si.Drawer.prototype.drawRightSideRow_=function(t){if(!(0>=t.height))if(t.precedesStatement||t.followsStatement){var e=this.constants_.INSIDE_CORNERS.rightHeight;e=t.height-(t.precedesStatement?e:0),this.outlinePath_+=(t.followsStatement?this.constants_.INSIDE_CORNERS.pathBottomRight:"")+(0=n||0>=o)throw Error("Height and width values of an image field must be greater than 0.");this.flipRtl_=!1,this.altText_="",t.module$exports$Blockly$FieldImage.FieldImage.superClass_.constructor.call(this,e,null,l),l||(this.flipRtl_=!!s,this.altText_=(0,qe.replaceMessageReferences)(i)||""),this.size_=new dt.Size(o,n+t.module$exports$Blockly$FieldImage.FieldImage.Y_PADDING),this.imageHeight_=n,this.clickHandler_=null,"function"==typeof r&&(this.clickHandler_=r),this.imageElement_=null}},(0,t.module$exports$Blockly$utils$object.inherits)(t.module$exports$Blockly$FieldImage.FieldImage,Vo.Field),t.module$exports$Blockly$FieldImage.FieldImage.prototype.DEFAULT_VALUE="",t.module$exports$Blockly$FieldImage.FieldImage.fromJson=function(t){return new this(t.src,t.width,t.height,void 0,void 0,void 0,t)},t.module$exports$Blockly$FieldImage.FieldImage.Y_PADDING=1,t.module$exports$Blockly$FieldImage.FieldImage.prototype.EDITABLE=!1,t.module$exports$Blockly$FieldImage.FieldImage.prototype.isDirty_=!1,t.module$exports$Blockly$FieldImage.FieldImage.prototype.configure_=function(e){t.module$exports$Blockly$FieldImage.FieldImage.superClass_.configure_.call(this,e),this.flipRtl_=!!e.flipRtl,this.altText_=(0,qe.replaceMessageReferences)(e.alt)||""},t.module$exports$Blockly$FieldImage.FieldImage.prototype.initView=function(){this.imageElement_=(0,M.createSvgElement)(vt.Svg.IMAGE,{height:this.imageHeight_+"px",width:this.size_.width+"px",alt:this.altText_},this.fieldGroup_),this.imageElement_.setAttributeNS(M.XLINK_NS,"xlink:href",this.value_),this.clickHandler_&&(this.imageElement_.style.cursor="pointer")},t.module$exports$Blockly$FieldImage.FieldImage.prototype.updateSize_=function(){},t.module$exports$Blockly$FieldImage.FieldImage.prototype.doClassValidation_=function(t){return"string"!=typeof t?null:t},t.module$exports$Blockly$FieldImage.FieldImage.prototype.doValueUpdate_=function(t){this.value_=t,this.imageElement_&&this.imageElement_.setAttributeNS(M.XLINK_NS,"xlink:href",String(this.value_))},t.module$exports$Blockly$FieldImage.FieldImage.prototype.getFlipRtl=function(){return this.flipRtl_},t.module$exports$Blockly$FieldImage.FieldImage.prototype.setAlt=function(t){t!==this.altText_&&(this.altText_=t||"",this.imageElement_&&this.imageElement_.setAttribute("alt",this.altText_))},t.module$exports$Blockly$FieldImage.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.clickHandler_(this)},t.module$exports$Blockly$FieldImage.FieldImage.prototype.setOnClickHandler=function(t){this.clickHandler_=t},t.module$exports$Blockly$FieldImage.FieldImage.prototype.getText_=function(){return this.altText_},(0,to.register)("field_image",t.module$exports$Blockly$FieldImage.FieldImage);var Ci={RenderInfo:function(t,e){Ci.RenderInfo.superClass_.constructor.call(this,t,e),this.topRow=new yi.TopRow(this.constants_),this.bottomRow=new Ii.BottomRow(this.constants_),this.isInline=!0,this.isMultiRow=!e.getInputsInline()||e.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!s.precedesStatement,Ge.Types.isInputRow(r)&&r.hasStatement)r.measure(),o=r.width-r.getLastInput().width+e;else if(i&&(2===n||s)&&Ge.Types.isInputRow(r)&&!r.hasStatement){s=r.xPos,i=null;for(var l=0;ln?n:this.height/2)*(1-Math.sin(Math.acos((n-this.constants_.SMALL_PADDING)/n)))):0;if(Ge.Types.isInlineInput(e)){var r=e.connectedBlock;return e=r?r.pathObject.outputShapeType:e.shape.type,r&&r.outputConnection&&(r.statementInputCount||r.nextConnection)||n===i.SHAPES.HEXAGONAL&&n!==e?0:o-this.constants_.SHAPE_IN_SHAPE_PADDING[n][e]}return Ge.Types.isField(e)?n===i.SHAPES.ROUND&&e.field instanceof t.module$exports$Blockly$FieldTextInput.FieldTextInput?o-2.75*i.GRID_UNIT:o-this.constants_.SHAPE_IN_SHAPE_PADDING[n][0]:Ge.Types.isIcon(e)?this.constants_.SMALL_PADDING:0},Ci.RenderInfo.prototype.finalizeVerticalAlignment_=function(){if(!this.outputConnection)for(var e=2;e=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!i.precedesStatement;if(r?this.topRow.hasPreviousConnection:o.followsStatement){var l=3===n.elements.length&&(n.elements[1].field instanceof t.module$exports$Blockly$FieldLabel.FieldLabel||n.elements[1].field instanceof t.module$exports$Blockly$FieldImage.FieldImage);if(!r&&l)o.height-=this.constants_.SMALL_PADDING,i.height-=this.constants_.SMALL_PADDING,n.height-=this.constants_.MEDIUM_PADDING;else if(r||s){if(s){for(r=!1,s=0;s.blocklyPathLight,",t+" .blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"])};var Gi={Highlighter:function(t){this.info_=t,this.inlineSteps_=this.steps_="",this.RTL_=this.info_.RTL,t=t.getRenderer(),this.constants_=t.getConstants(),this.highlightConstants_=t.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}};Gi.Highlighter.prototype.getPath=function(){return this.steps_+"\n"+this.inlineSteps_},Gi.Highlighter.prototype.drawTopCorner=function(t){this.steps_+=(0,ze.moveBy)(t.xPos,this.info_.startY);for(var e,o=0;e=t.elements[o];o++)Ge.Types.isLeftSquareCorner(e)?this.steps_+=this.highlightConstants_.START_POINT:Ge.Types.isLeftRoundedCorner(e)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):Ge.Types.isPreviousConnection(e)?this.steps_+=this.notchPaths_.pathLeft:Ge.Types.isHat(e)?this.steps_+=this.startPaths_.path(this.RTL_):Ge.Types.isSpacer(e)&&0!==e.width&&(this.steps_+=(0,ze.lineOnAxis)("H",e.xPos+e.width-this.highlightOffset_));this.steps_+=(0,ze.lineOnAxis)("H",t.xPos+t.width-this.highlightOffset_)},Gi.Highlighter.prototype.drawJaggedEdge_=function(t){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+(0,ze.lineOnAxis)("v",t.height-this.jaggedTeethPaths_.height-this.highlightOffset_))},Gi.Highlighter.prototype.drawValueInput=function(t){var e=t.getLastInput();if(this.RTL_){var o=t.height-e.connectionHeight;this.steps_+=(0,ze.moveTo)(e.xPos+e.width-this.highlightOffset_,t.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+(0,ze.lineOnAxis)("v",o)}else this.steps_+=(0,ze.moveTo)(e.xPos+e.width,t.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)},Gi.Highlighter.prototype.drawStatementInput=function(t){var e=t.getLastInput();if(this.RTL_){var o=t.height-2*this.insideCornerPaths_.height;this.steps_+=(0,ze.moveTo)(e.xPos,t.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+(0,ze.lineOnAxis)("v",o)+this.insideCornerPaths_.pathBottom(this.RTL_)+(0,ze.lineTo)(t.width-e.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=(0,ze.moveTo)(e.xPos,t.yPos+t.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+(0,ze.lineTo)(t.width-e.xPos-this.insideCornerPaths_.width,0)},Gi.Highlighter.prototype.drawRightSideRow=function(t){var e=t.xPos+t.width-this.highlightOffset_;t.followsStatement&&(this.steps_+=(0,ze.lineOnAxis)("H",e)),this.RTL_&&(this.steps_+=(0,ze.lineOnAxis)("H",e),t.height>this.highlightOffset_&&(this.steps_+=(0,ze.lineOnAxis)("V",t.yPos+t.height-this.highlightOffset_)))},Gi.Highlighter.prototype.drawBottomRow=function(t){if(this.RTL_)this.steps_+=(0,ze.lineOnAxis)("V",t.baseline-this.highlightOffset_);else{var e=this.info_.bottomRow.elements[0];Ge.Types.isLeftSquareCorner(e)?this.steps_+=(0,ze.moveTo)(t.xPos+this.highlightOffset_,t.baseline-this.highlightOffset_):Ge.Types.isLeftRoundedCorner(e)&&(this.steps_+=(0,ze.moveTo)(t.xPos,t.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}},Gi.Highlighter.prototype.drawLeft=function(){var t=this.info_.outputConnection;t&&(t=t.connectionOffsetY+t.height,this.RTL_?this.steps_+=(0,ze.moveTo)(this.info_.startX,t):(this.steps_+=(0,ze.moveTo)(this.info_.startX+this.highlightOffset_,this.info_.bottomRow.baseline-this.highlightOffset_),this.steps_+=(0,ze.lineOnAxis)("V",t)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(t=this.info_.topRow,Ge.Types.isLeftRoundedCorner(t.elements[0])?this.steps_+=(0,ze.lineOnAxis)("V",this.outsideCornerPaths_.height):this.steps_+=(0,ze.lineOnAxis)("V",t.capline+this.highlightOffset_))},Gi.Highlighter.prototype.drawInlineInput=function(t){var e=this.highlightOffset_,o=t.xPos+t.connectionWidth,n=t.centerline-t.height/2,i=t.width-t.connectionWidth,r=n+e;this.RTL_?(n=t.connectionOffsetY-e,t=t.height-(t.connectionOffsetY+t.connectionHeight)+e,this.inlineSteps_+=(0,ze.moveTo)(o-e,r)+(0,ze.lineOnAxis)("v",n)+this.puzzleTabPaths_.pathDown(this.RTL_)+(0,ze.lineOnAxis)("v",t)+(0,ze.lineOnAxis)("h",i)):this.inlineSteps_+=(0,ze.moveTo)(t.xPos+t.width+e,r)+(0,ze.lineOnAxis)("v",t.height)+(0,ze.lineOnAxis)("h",-i)+(0,ze.moveTo)(o,n+t.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)};var Wi={Drawer:function(t,e){Wi.Drawer.superClass_.constructor.call(this,t,e),this.highlighter_=new Gi.Highlighter(e)}};(0,t.module$exports$Blockly$utils$object.inherits)(Wi.Drawer,Xo.Drawer),Wi.Drawer.prototype.draw=function(){this.hideHiddenIcons_(),this.drawOutline_(),this.drawInternals_();var t=this.block_.pathObject;t.setPath(this.outlinePath_+"\n"+this.inlinePath_),t.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&t.flipRTL(),(0,Ue.isDebuggerEnabled)()&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_),this.recordSizeOnBlock_()},Wi.Drawer.prototype.drawTop_=function(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),Wi.Drawer.superClass_.drawTop_.call(this)},Wi.Drawer.prototype.drawJaggedEdge_=function(t){this.highlighter_.drawJaggedEdge_(t),Wi.Drawer.superClass_.drawJaggedEdge_.call(this,t)},Wi.Drawer.prototype.drawValueInput_=function(t){this.highlighter_.drawValueInput(t),Wi.Drawer.superClass_.drawValueInput_.call(this,t)},Wi.Drawer.prototype.drawStatementInput_=function(t){this.highlighter_.drawStatementInput(t),Wi.Drawer.superClass_.drawStatementInput_.call(this,t)},Wi.Drawer.prototype.drawRightSideRow_=function(t){this.highlighter_.drawRightSideRow(t),this.outlinePath_+=(0,ze.lineOnAxis)("H",t.xPos+t.width)+(0,ze.lineOnAxis)("V",t.yPos+t.height)},Wi.Drawer.prototype.drawBottom_=function(){this.highlighter_.drawBottomRow(this.info_.bottomRow),Wi.Drawer.superClass_.drawBottom_.call(this)},Wi.Drawer.prototype.drawLeft_=function(){this.highlighter_.drawLeft(),Wi.Drawer.superClass_.drawLeft_.call(this)},Wi.Drawer.prototype.drawInlineInput_=function(t){this.highlighter_.drawInlineInput(t),Wi.Drawer.superClass_.drawInlineInput_.call(this,t)},Wi.Drawer.prototype.positionInlineInputConnection_=function(t){var e=t.centerline-t.height/2;if(t.connectionModel){var o=t.xPos+t.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),t.connectionModel.setOffsetInBlock(o,e+t.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}},Wi.Drawer.prototype.positionStatementInputConnection_=function(t){var e=t.getLastInput();if(e.connectionModel){var o=t.xPos+t.statementEdge+e.notchOffset;o=this.info_.RTL?-1*o:o+this.constants_.DARK_PATH_OFFSET,e.connectionModel.setOffsetInBlock(o,t.yPos+this.constants_.DARK_PATH_OFFSET)}},Wi.Drawer.prototype.positionExternalValueConnection_=function(t){var e=t.getLastInput();if(e.connectionModel){var o=t.xPos+t.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(o*=-1),e.connectionModel.setOffsetInBlock(o,t.yPos)}},Wi.Drawer.prototype.positionNextConnection_=function(){var t=this.info_.bottomRow;if(t.connection){var e=t.connection,o=e.xPos;e.connectionModel.setOffsetInBlock((this.info_.RTL?-o:o)+this.constants_.DARK_PATH_OFFSET/2,t.baseline+this.constants_.DARK_PATH_OFFSET)}};var Vi={HighlightConstantProvider:function(t){this.constantProvider=t,this.OFFSET=.5,this.START_POINT=(0,ze.moveBy)(this.OFFSET,this.OFFSET)}};Vi.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()},Vi.HighlightConstantProvider.prototype.makeInsideCorner=function(){var t=this.constantProvider.CORNER_RADIUS,e=this.OFFSET,o=(1-Math.SQRT1_2)*(t+e)-e,n=(0,ze.moveBy)(o,o)+(0,ze.arc)("a","0 0,0",t,(0,ze.point)(-o-e,t-o)),i=(0,ze.arc)("a","0 0,0",t+e,(0,ze.point)(t+e,t+e)),r=(0,ze.moveBy)(o,-o)+(0,ze.arc)("a","0 0,0",t+e,(0,ze.point)(t-o,o+e));return{width:t+e,height:t,pathTop:function(t){return t?n:""},pathBottom:function(t){return t?i:r}}},Vi.HighlightConstantProvider.prototype.makeOutsideCorner=function(){var t=this.constantProvider.CORNER_RADIUS,e=this.OFFSET,o=(1-Math.SQRT1_2)*(t-e)+e,n=(0,ze.moveBy)(o,o)+(0,ze.arc)("a","0 0,1",t-e,(0,ze.point)(t-o,-o+e)),i=(0,ze.moveBy)(e,t)+(0,ze.arc)("a","0 0,1",t-e,(0,ze.point)(t,-t+e)),r=-o,s=(0,ze.moveBy)(o,r)+(0,ze.arc)("a","0 0,1",t-e,(0,ze.point)(-o+e,-r-t));return{height:t,topLeft:function(t){return t?n:i},bottomLeft:function(){return s}}},Vi.HighlightConstantProvider.prototype.makePuzzleTab=function(){var t=this.constantProvider.TAB_WIDTH,e=this.constantProvider.TAB_HEIGHT,o=(0,ze.moveBy)(-2,3.4-e)+(0,ze.lineTo)(-.45*t,-2.1),n=(0,ze.lineOnAxis)("v",2.5)+(0,ze.moveBy)(.97*-t,2.5)+(0,ze.curve)("q",[(0,ze.point)(.05*-t,10),(0,ze.point)(.3*t,9.5)])+(0,ze.moveBy)(.67*t,-1.9)+(0,ze.lineOnAxis)("v",2.5),i=(0,ze.lineOnAxis)("v",-1.5)+(0,ze.moveBy)(-.92*t,-.5)+(0,ze.curve)("q",[(0,ze.point)(-.19*t,-5.5),(0,ze.point)(0,-11)])+(0,ze.moveBy)(.92*t,1),r=(0,ze.moveBy)(-5,e-.7)+(0,ze.lineTo)(.46*t,-2.1);return{width:t,height:e,pathUp:function(t){return t?o:i},pathDown:function(t){return t?n:r}}},Vi.HighlightConstantProvider.prototype.makeNotch=function(){return{pathLeft:(0,ze.lineOnAxis)("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}},Vi.HighlightConstantProvider.prototype.makeJaggedTeeth=function(){return{pathLeft:(0,ze.lineTo)(5.1,2.6)+(0,ze.moveBy)(-10.2,6.8)+(0,ze.lineTo)(5.1,2.6),height:12,width:10.2}},Vi.HighlightConstantProvider.prototype.makeStartHat=function(){var t=this.constantProvider.START_HAT.height,e=(0,ze.moveBy)(25,-8.7)+(0,ze.curve)("c",[(0,ze.point)(29.7,-6.2),(0,ze.point)(57.2,-.5),(0,ze.point)(75,8.7)]),o=(0,ze.curve)("c",[(0,ze.point)(17.8,-9.2),(0,ze.point)(45.3,-14.9),(0,ze.point)(75,-8.7)])+(0,ze.moveTo)(100.5,t+.5);return{path:function(t){return t?e:o}}};var Yi={InlineInput:function(t,e){Yi.InlineInput.superClass_.constructor.call(this,t,e),this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}};(0,t.module$exports$Blockly$utils$object.inherits)(Yi.InlineInput,Qo.InlineInput);var Xi={RenderInfo:function(t,e){Xi.RenderInfo.superClass_.constructor.call(this,t,e)}};(0,t.module$exports$Blockly$utils$object.inherits)(Xi.RenderInfo,fn.RenderInfo),Xi.RenderInfo.prototype.getRenderer=function(){return this.renderer_},Xi.RenderInfo.prototype.populateBottomRow_=function(){Xi.RenderInfo.superClass_.populateBottomRow_.call(this),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1].type===t.module$exports$Blockly$inputTypes.inputTypes.STATEMENT||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)},Xi.RenderInfo.prototype.addInput_=function(e,o){this.isInline&&e.type===t.module$exports$Blockly$inputTypes.inputTypes.VALUE?(o.elements.push(new Yi.InlineInput(this.constants_,e)),o.hasInlineInput=!0):e.type===t.module$exports$Blockly$inputTypes.inputTypes.STATEMENT?(o.elements.push(new Fi.StatementInput(this.constants_,e)),o.hasStatement=!0):e.type===t.module$exports$Blockly$inputTypes.inputTypes.VALUE?(o.elements.push(new jo.ExternalValueInput(this.constants_,e)),o.hasExternalInput=!0):e.type===t.module$exports$Blockly$inputTypes.inputTypes.DUMMY&&(o.minHeight=Math.max(o.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),o.hasDummyInput=!0),this.isInline||null!==o.align||(o.align=e.align)},Xi.RenderInfo.prototype.addElemSpacing_=function(){for(var t,e=!1,o=0;t=this.rows[o];o++)t.hasExternalInput&&(e=!0);for(o=0;t=this.rows[o];o++){var n=t.elements;if(t.elements=[],t.startsWithElemSpacer()&&t.elements.push(new Zo.InRowSpacer(this.constants_,this.getInRowSpacing_(null,n[0]))),n.length){for(var i=0;io.length?cr(o,n):(0,uo.confirm)(t.module$exports$Blockly$Msg.Msg.DELETE_ALL_BLOCKS.replace("%1",String(o.length)),(function(t){t&&cr(o,n)}))}},scopeType:Nn.ContextMenuRegistry.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},rr.registerDuplicate=function(){Nn.ContextMenuRegistry.registry.register({displayText:function(){return t.module$exports$Blockly$Msg.Msg.DUPLICATE_BLOCK},preconditionFn:function(t){return!(t=t.block).isInFlyout&&t.isDeletable()&&t.isMovable()?t.isDuplicatable()?"enabled":"disabled":"hidden"},callback:function(t){t.block&&(0,te.duplicate)(t.block)},scopeType:Nn.ContextMenuRegistry.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},rr.registerComment=function(){Nn.ContextMenuRegistry.registry.register({displayText:function(e){return e.block.getCommentIcon()?t.module$exports$Blockly$Msg.Msg.REMOVE_COMMENT:t.module$exports$Blockly$Msg.Msg.ADD_COMMENT},preconditionFn:function(t){return t=t.block,_.IE||t.isInFlyout||!t.workspace.options.comments||t.isCollapsed()||!t.isEditable()?"hidden":"enabled"},callback:function(t){(t=t.block).getCommentIcon()?t.setCommentText(null):t.setCommentText("")},scopeType:Nn.ContextMenuRegistry.ScopeType.BLOCK,id:"blockComment",weight:2})},rr.registerInline=function(){Nn.ContextMenuRegistry.registry.register({displayText:function(e){return e.block.getInputsInline()?t.module$exports$Blockly$Msg.Msg.EXTERNAL_INPUTS:t.module$exports$Blockly$Msg.Msg.INLINE_INPUTS},preconditionFn:function(e){if(!(e=e.block).isInFlyout&&e.isMovable()&&!e.isCollapsed())for(var o=1;oimage, .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 gr={WorkspaceComment:function(t,e,o,n,i){this.id=i&&!t.getCommentById(i)?i:(0,J.genUid)(),t.addTopComment(this),this.xy_=new ht.Coordinate(0,0),this.height_=o,this.width_=n,this.workspace=t,this.RTL=t.RTL,this.editable_=this.movable_=this.deletable_=!0,this.content_=e,this.disposed_=!1,this.isComment=!0,gr.WorkspaceComment.fireCreateEvent(this)}};gr.WorkspaceComment.prototype.dispose=function(){this.disposed_||((0,nt.isEnabled)()&&(0,nt.fire)(new((0,nt.get)(nt.COMMENT_DELETE))(this)),this.workspace.removeTopComment(this),this.disposed_=!0)},gr.WorkspaceComment.prototype.getHeight=function(){return this.height_},gr.WorkspaceComment.prototype.setHeight=function(t){this.height_=t},gr.WorkspaceComment.prototype.getWidth=function(){return this.width_},gr.WorkspaceComment.prototype.setWidth=function(t){this.width_=t},gr.WorkspaceComment.prototype.getXY=function(){return new ht.Coordinate(this.xy_.x,this.xy_.y)},gr.WorkspaceComment.prototype.moveBy=function(t,e){var o=new((0,nt.get)(nt.COMMENT_MOVE))(this);this.xy_.translate(t,e),o.recordNew(),(0,nt.fire)(o)},gr.WorkspaceComment.prototype.isDeletable=function(){return this.deletable_&&!(this.workspace&&this.workspace.options.readOnly)},gr.WorkspaceComment.prototype.setDeletable=function(t){this.deletable_=t},gr.WorkspaceComment.prototype.isMovable=function(){return this.movable_&&!(this.workspace&&this.workspace.options.readOnly)},gr.WorkspaceComment.prototype.setMovable=function(t){this.movable_=t},gr.WorkspaceComment.prototype.isEditable=function(){return this.editable_&&!(this.workspace&&this.workspace.options.readOnly)},gr.WorkspaceComment.prototype.setEditable=function(t){this.editable_=t},gr.WorkspaceComment.prototype.getContent=function(){return this.content_},gr.WorkspaceComment.prototype.setContent=function(t){this.content_!==t&&((0,nt.fire)(new((0,nt.get)(nt.COMMENT_CHANGE))(this,this.content_,t)),this.content_=t)},gr.WorkspaceComment.prototype.toXmlWithXY=function(t){return(t=this.toXml(t)).setAttribute("x",Math.round(this.xy_.x)),t.setAttribute("y",Math.round(this.xy_.y)),t.setAttribute("h",this.height_),t.setAttribute("w",this.width_),t},gr.WorkspaceComment.prototype.toXml=function(e){var o=(0,t.module$exports$Blockly$utils$xml.createElement)("comment");return e||(o.id=this.id),o.textContent=this.getContent(),o},gr.WorkspaceComment.fireCreateEvent=function(t){if((0,nt.isEnabled)()){var e=(0,nt.getGroup)();e||(0,nt.setGroup)(!0);try{(0,nt.fire)(new((0,nt.get)(nt.COMMENT_CREATE))(t))}finally{e||(0,nt.setGroup)(!1)}}},gr.WorkspaceComment.fromXml=function(t,e){var o=gr.WorkspaceComment.parseAttributes(t);return e=new gr.WorkspaceComment(e,o.content,o.h,o.w,o.id),o=parseInt(t.getAttribute("x"),10),t=parseInt(t.getAttribute("y"),10),isNaN(o)||isNaN(t)||e.moveBy(o,t),gr.WorkspaceComment.fireCreateEvent(e),e},gr.WorkspaceComment.parseAttributes=function(t){var e=t.getAttribute("h"),o=t.getAttribute("w");return{id:t.getAttribute("id"),h:e?parseInt(e,10):100,w:o?parseInt(o,10):100,x:parseInt(t.getAttribute("x"),10),y:parseInt(t.getAttribute("y"),10),content:t.textContent}};var fr={WorkspaceCommentSvg:function(t,e,o,n,i){this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.svgGroup_=(0,M.createSvgElement)(vt.Svg.G,{class:"blocklyComment"},null),this.svgGroup_.translate_="",this.svgRect_=(0,M.createSvgElement)(vt.Svg.RECT,{class:"blocklyCommentRect",x:0,y:0,rx:3,ry:3}),this.svgGroup_.appendChild(this.svgRect_),this.rendered_=!1,this.useDragSurface_=(0,yt.is3dSupported)()&&!!t.getBlockDragSurface(),fr.WorkspaceCommentSvg.superClass_.constructor.call(this,t,e,o,n,i),this.render()}};(0,t.module$exports$Blockly$utils$object.inherits)(fr.WorkspaceCommentSvg,gr.WorkspaceComment),fr.WorkspaceCommentSvg.DEFAULT_SIZE=100,fr.WorkspaceCommentSvg.TOP_OFFSET=10,fr.WorkspaceCommentSvg.prototype.dispose=function(){this.disposed_||((0,t.module$exports$Blockly$common.getSelected)()===this&&(this.unselect(),this.workspace.cancelCurrentGesture()),(0,nt.isEnabled)()&&(0,nt.fire)(new((0,nt.get)(nt.COMMENT_DELETE))(this)),(0,M.removeNode)(this.svgGroup_),this.disposeInternal_(),(0,nt.disable)(),fr.WorkspaceCommentSvg.superClass_.dispose.call(this),(0,nt.enable)())},fr.WorkspaceCommentSvg.prototype.initSvg=function(t){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");this.workspace.options.readOnly||this.eventsInit_||((0,f.conditionalBind)(this.svgRectTarget_,"mousedown",this,this.pathMouseDown_),(0,f.conditionalBind)(this.svgHandleTarget_,"mousedown",this,this.pathMouseDown_)),this.eventsInit_=!0,this.updateMovable(),this.getSvgRoot().parentNode||this.workspace.getBubbleCanvas().appendChild(this.getSvgRoot()),!t&&this.textarea_&&this.textarea_.select()},fr.WorkspaceCommentSvg.prototype.pathMouseDown_=function(t){var e=this.workspace.getGesture(t);e&&e.handleBubbleStart(t,this)},fr.WorkspaceCommentSvg.prototype.showContextMenu=function(e){if(!this.workspace.options.readOnly){var o=[];this.isDeletable()&&this.isMovable()&&(o.push((0,t.module$exports$Blockly$ContextMenu.commentDuplicateOption)(this)),o.push((0,t.module$exports$Blockly$ContextMenu.commentDeleteOption)(this))),(0,t.module$exports$Blockly$ContextMenu.show)(e,o,this.RTL)}},fr.WorkspaceCommentSvg.prototype.select=function(){if((0,t.module$exports$Blockly$common.getSelected)()!==this){var e=null;if((0,t.module$exports$Blockly$common.getSelected)()){e=(0,t.module$exports$Blockly$common.getSelected)().id,(0,nt.disable)();try{(0,t.module$exports$Blockly$common.getSelected)().unselect()}finally{(0,nt.enable)()}}e=new((0,nt.get)(nt.SELECTED))(e,this.id,this.workspace.id),(0,nt.fire)(e),(0,t.module$exports$Blockly$common.setSelected)(this),this.addSelect()}},fr.WorkspaceCommentSvg.prototype.unselect=function(){if((0,t.module$exports$Blockly$common.getSelected)()===this){var e=new((0,nt.get)(nt.SELECTED))(this.id,null,this.workspace.id);(0,nt.fire)(e),(0,t.module$exports$Blockly$common.setSelected)(null),this.removeSelect(),this.blurFocus()}},fr.WorkspaceCommentSvg.prototype.addSelect=function(){(0,M.addClass)(this.svgGroup_,"blocklySelected"),this.setFocus()},fr.WorkspaceCommentSvg.prototype.removeSelect=function(){(0,M.removeClass)(this.svgGroup_,"blocklySelected"),this.blurFocus()},fr.WorkspaceCommentSvg.prototype.addFocus=function(){(0,M.addClass)(this.svgGroup_,"blocklyFocused")},fr.WorkspaceCommentSvg.prototype.removeFocus=function(){(0,M.removeClass)(this.svgGroup_,"blocklyFocused")},fr.WorkspaceCommentSvg.prototype.getRelativeToSurfaceXY=function(){var t=0,e=0,o=this.useDragSurface_?this.workspace.getBlockDragSurface().getGroup():null,n=this.getSvgRoot();if(n)do{var i=(0,yt.getRelativeXY)(n);t+=i.x,e+=i.y,this.useDragSurface_&&this.workspace.getBlockDragSurface().getCurrentBlock()===n&&(t+=(i=this.workspace.getBlockDragSurface().getSurfaceTranslation()).x,e+=i.y),n=n.parentNode}while(n&&n!==this.workspace.getBubbleCanvas()&&n!==o);return this.xy_=new ht.Coordinate(t,e)},fr.WorkspaceCommentSvg.prototype.moveBy=function(t,e){var o=new((0,nt.get)(nt.COMMENT_MOVE))(this),n=this.getRelativeToSurfaceXY();this.translate(n.x+t,n.y+e),this.xy_=new ht.Coordinate(n.x+t,n.y+e),o.recordNew(),(0,nt.fire)(o),this.workspace.resizeContents()},fr.WorkspaceCommentSvg.prototype.translate=function(t,e){this.xy_=new ht.Coordinate(t,e),this.getSvgRoot().setAttribute("transform","translate("+t+","+e+")")},fr.WorkspaceCommentSvg.prototype.moveToDragSurface=function(){if(this.useDragSurface_){var t=this.getRelativeToSurfaceXY();this.clearTransformAttributes_(),this.workspace.getBlockDragSurface().translateSurface(t.x,t.y),this.workspace.getBlockDragSurface().setBlocksAndShow(this.getSvgRoot())}},fr.WorkspaceCommentSvg.prototype.moveDuringDrag=function(t,e){t?t.translateSurface(e.x,e.y):(this.svgGroup_.translate_="translate("+e.x+","+e.y+")",this.svgGroup_.setAttribute("transform",this.svgGroup_.translate_+this.svgGroup_.skew_))},fr.WorkspaceCommentSvg.prototype.moveTo=function(t,e){this.translate(t,e)},fr.WorkspaceCommentSvg.prototype.clearTransformAttributes_=function(){this.getSvgRoot().removeAttribute("transform")},fr.WorkspaceCommentSvg.prototype.getBoundingRectangle=function(){var t=this.getRelativeToSurfaceXY(),e=this.getHeightWidth(),o=t.y,n=t.y+e.height;if(this.RTL){var i=t.x-e.width;t=t.x}else i=t.x,t=t.x+e.width;return new mt.Rect(o,n,i,t)},fr.WorkspaceCommentSvg.prototype.updateMovable=function(){this.isMovable()?(0,M.addClass)(this.svgGroup_,"blocklyDraggable"):(0,M.removeClass)(this.svgGroup_,"blocklyDraggable")},fr.WorkspaceCommentSvg.prototype.setMovable=function(t){fr.WorkspaceCommentSvg.superClass_.setMovable.call(this,t),this.updateMovable()},fr.WorkspaceCommentSvg.prototype.setEditable=function(t){fr.WorkspaceCommentSvg.superClass_.setEditable.call(this,t),this.textarea_&&(this.textarea_.readOnly=!t)},fr.WorkspaceCommentSvg.prototype.setDragging=function(t){t?((t=this.getSvgRoot()).translate_="",t.skew_="",(0,M.addClass)(this.svgGroup_,"blocklyDragging")):(0,M.removeClass)(this.svgGroup_,"blocklyDragging")},fr.WorkspaceCommentSvg.prototype.getSvgRoot=function(){return this.svgGroup_},fr.WorkspaceCommentSvg.prototype.getContent=function(){return this.textarea_?this.textarea_.value:this.content_},fr.WorkspaceCommentSvg.prototype.setContent=function(t){fr.WorkspaceCommentSvg.superClass_.setContent.call(this,t),this.textarea_&&(this.textarea_.value=t)},fr.WorkspaceCommentSvg.prototype.setDeleteStyle=function(t){t?(0,M.addClass)(this.svgGroup_,"blocklyDraggingDelete"):(0,M.removeClass)(this.svgGroup_,"blocklyDraggingDelete")},fr.WorkspaceCommentSvg.prototype.setAutoLayout=function(t){},fr.WorkspaceCommentSvg.fromXml=function(t,e,o){(0,nt.disable)();try{var n=gr.WorkspaceComment.parseAttributes(t),i=new fr.WorkspaceCommentSvg(e,n.content,n.h,n.w,n.id);if(e.rendered&&(i.initSvg(!0),i.render()),!isNaN(n.x)&&!isNaN(n.y))if(e.RTL){var r=o||e.getWidth();i.moveBy(r-n.x,n.y)}else i.moveBy(n.x,n.y)}finally{(0,nt.enable)()}return gr.WorkspaceComment.fireCreateEvent(i),i},fr.WorkspaceCommentSvg.prototype.toXmlWithXY=function(t){var e;this.workspace.RTL&&(e=this.workspace.getWidth()),t=this.toXml(t);var o=this.getRelativeToSurfaceXY();return t.setAttribute("x",Math.round(this.workspace.RTL?e-o.x:o.x)),t.setAttribute("y",Math.round(o.y)),t.setAttribute("h",this.getHeight()),t.setAttribute("w",this.getWidth()),t},fr.WorkspaceCommentSvg.prototype.toCopyData=function(){return{saveInfo:this.toXmlWithXY(),source:this.workspace,typeCounts:null}},fr.WorkspaceCommentSvg.prototype.getHeightWidth=function(){return{width:this.getWidth(),height:this.getHeight()}},fr.WorkspaceCommentSvg.prototype.render=function(){if(!this.rendered_){var t=this.getHeightWidth();this.createEditor_(),this.svgGroup_.appendChild(this.foreignObject_),this.svgHandleTarget_=(0,M.createSvgElement)(vt.Svg.RECT,{class:"blocklyCommentHandleTarget",x:0,y:0}),this.svgGroup_.appendChild(this.svgHandleTarget_),this.svgRectTarget_=(0,M.createSvgElement)(vt.Svg.RECT,{class:"blocklyCommentTarget",x:0,y:0,rx:3,ry:3}),this.svgGroup_.appendChild(this.svgRectTarget_),this.addResizeDom_(),this.isDeletable()&&this.addDeleteDom_(),this.setSize_(t.width,t.height),this.textarea_.value=this.content_,this.rendered_=!0,this.resizeGroup_&&(0,f.conditionalBind)(this.resizeGroup_,"mousedown",this,this.resizeMouseDown_),this.isDeletable()&&((0,f.conditionalBind)(this.deleteGroup_,"mousedown",this,this.deleteMouseDown_),(0,f.conditionalBind)(this.deleteGroup_,"mouseout",this,this.deleteMouseOut_),(0,f.conditionalBind)(this.deleteGroup_,"mouseup",this,this.deleteMouseUp_))}},fr.WorkspaceCommentSvg.prototype.createEditor_=function(){this.foreignObject_=(0,M.createSvgElement)(vt.Svg.FOREIGNOBJECT,{x:0,y:fr.WorkspaceCommentSvg.TOP_OFFSET,class:"blocklyCommentForeignObject"},null);var t=document.createElementNS(M.HTML_NS,"body");t.setAttribute("xmlns",M.HTML_NS),t.className="blocklyMinimalBody";var e=document.createElementNS(M.HTML_NS,"textarea");return e.className="blocklyCommentTextarea",e.setAttribute("dir",this.RTL?"RTL":"LTR"),e.readOnly=!this.isEditable(),t.appendChild(e),this.textarea_=e,this.foreignObject_.appendChild(t),(0,f.conditionalBind)(e,"wheel",this,(function(t){t.stopPropagation()})),(0,f.conditionalBind)(e,"change",this,(function(t){this.setContent(e.value)})),this.foreignObject_},fr.WorkspaceCommentSvg.prototype.addResizeDom_=function(){this.resizeGroup_=(0,M.createSvgElement)(vt.Svg.G,{class:this.RTL?"blocklyResizeSW":"blocklyResizeSE"},this.svgGroup_),(0,M.createSvgElement)(vt.Svg.POLYGON,{points:"0,x x,x x,0".replace(/x/g,8..toString())},this.resizeGroup_),(0,M.createSvgElement)(vt.Svg.LINE,{class:"blocklyResizeLine",x1:8/3,y1:7,x2:7,y2:8/3},this.resizeGroup_),(0,M.createSvgElement)(vt.Svg.LINE,{class:"blocklyResizeLine",x1:16/3,y1:7,x2:7,y2:16/3},this.resizeGroup_)},fr.WorkspaceCommentSvg.prototype.addDeleteDom_=function(){this.deleteGroup_=(0,M.createSvgElement)(vt.Svg.G,{class:"blocklyCommentDeleteIcon"},this.svgGroup_),this.deleteIconBorder_=(0,M.createSvgElement)(vt.Svg.CIRCLE,{class:"blocklyDeleteIconShape",r:"7",cx:"7.5",cy:"7.5"},this.deleteGroup_),(0,M.createSvgElement)(vt.Svg.LINE,{x1:"5",y1:"10",x2:"10",y2:"5",stroke:"#fff","stroke-width":"2"},this.deleteGroup_),(0,M.createSvgElement)(vt.Svg.LINE,{x1:"5",y1:"5",x2:"10",y2:"10",stroke:"#fff","stroke-width":"2"},this.deleteGroup_)},fr.WorkspaceCommentSvg.prototype.resizeMouseDown_=function(t){this.unbindDragEvents_(),(0,f.isRightButton)(t)||(this.workspace.startDrag(t,new ht.Coordinate(this.workspace.RTL?-this.width_:this.width_,this.height_)),this.onMouseUpWrapper_=(0,f.conditionalBind)(document,"mouseup",this,this.resizeMouseUp_),this.onMouseMoveWrapper_=(0,f.conditionalBind)(document,"mousemove",this,this.resizeMouseMove_),this.workspace.hideChaff()),t.stopPropagation()},fr.WorkspaceCommentSvg.prototype.deleteMouseDown_=function(t){(0,M.addClass)(this.deleteIconBorder_,"blocklyDeleteIconHighlighted"),t.stopPropagation()},fr.WorkspaceCommentSvg.prototype.deleteMouseOut_=function(t){(0,M.removeClass)(this.deleteIconBorder_,"blocklyDeleteIconHighlighted")},fr.WorkspaceCommentSvg.prototype.deleteMouseUp_=function(t){this.dispose(),t.stopPropagation()},fr.WorkspaceCommentSvg.prototype.unbindDragEvents_=function(){this.onMouseUpWrapper_&&((0,f.unbind)(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&((0,f.unbind)(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)},fr.WorkspaceCommentSvg.prototype.resizeMouseUp_=function(t){(0,p.clearTouchIdentifier)(),this.unbindDragEvents_()},fr.WorkspaceCommentSvg.prototype.resizeMouseMove_=function(t){this.autoLayout_=!1,t=this.workspace.moveDrag(t),this.setSize_(this.RTL?-t.x:t.x,t.y)},fr.WorkspaceCommentSvg.prototype.resizeComment_=function(){var t=this.getHeightWidth(),e=fr.WorkspaceCommentSvg.TOP_OFFSET;this.foreignObject_.setAttribute("width",t.width),this.foreignObject_.setAttribute("height",t.height-e),this.RTL&&this.foreignObject_.setAttribute("x",-t.width),this.textarea_.style.width=t.width-4+"px",this.textarea_.style.height=t.height-4-e+"px"},fr.WorkspaceCommentSvg.prototype.setSize_=function(t,e){t=Math.max(t,45),e=Math.max(e,20+fr.WorkspaceCommentSvg.TOP_OFFSET),this.width_=t,this.height_=e,this.svgRect_.setAttribute("width",t),this.svgRect_.setAttribute("height",e),this.svgRectTarget_.setAttribute("width",t),this.svgRectTarget_.setAttribute("height",e),this.svgHandleTarget_.setAttribute("width",t),this.svgHandleTarget_.setAttribute("height",fr.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("+(8-t)+","+(e-8)+") scale(-1 1)"),this.deleteGroup_.setAttribute("transform","translate("+(8-t)+",-8) scale(-1 1)")):(this.resizeGroup_.setAttribute("transform","translate("+(t-8)+","+(e-8)+")"),this.deleteGroup_.setAttribute("transform","translate("+(t-8)+",-8)"))),this.resizeComment_()},fr.WorkspaceCommentSvg.prototype.disposeInternal_=function(){this.svgHandleTarget_=this.svgRectTarget_=this.foreignObject_=this.textarea_=null,this.disposed_=!0},fr.WorkspaceCommentSvg.prototype.setFocus=function(){var t=this;this.focused_=!0,setTimeout((function(){t.disposed_||(t.textarea_.focus(),t.addFocus(),(0,M.addClass)(t.svgRectTarget_,"blocklyCommentTargetFocused"),(0,M.addClass)(t.svgHandleTarget_,"blocklyCommentHandleTargetFocused"))}),0)},fr.WorkspaceCommentSvg.prototype.blurFocus=function(){var t=this;this.focused_=!1,setTimeout((function(){t.disposed_||(t.textarea_.blur(),t.removeFocus(),(0,M.removeClass)(t.svgRectTarget_,"blocklyCommentTargetFocused"),(0,M.removeClass)(t.svgHandleTarget_,"blocklyCommentHandleTargetFocused"))}),0)},(0,c.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 mr={Trashcan:function(t){mr.Trashcan.superClass_.constructor.call(this),this.workspace_=t,this.id="trashcan",this.contents_=[],this.flyout=null,0>=this.workspace_.options.maxTrashcanContents||(t=new jt.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?(t.toolboxPosition=this.workspace_.toolboxPosition===Ut.Position.TOP?Ut.Position.BOTTOM:Ut.Position.TOP,this.flyout=new((0,Z.getClassFromOptions)(Z.Type.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace_.options,!0))(t)):(t.toolboxPosition=this.workspace_.toolboxPosition===Ut.Position.RIGHT?Ut.Position.LEFT:Ut.Position.RIGHT,this.flyout=new((0,Z.getClassFromOptions)(Z.Type.FLYOUTS_VERTICAL_TOOLBOX,this.workspace_.options,!0))(t)),this.workspace_.addChangeListener(this.onDelete_.bind(this)))}};(0,t.module$exports$Blockly$utils$object.inherits)(mr.Trashcan,ti.DeleteArea);mr.Trashcan.prototype.isLidOpen=!1,mr.Trashcan.prototype.minOpenness_=0,mr.Trashcan.prototype.svgGroup_=null,mr.Trashcan.prototype.svgLid_=null,mr.Trashcan.prototype.lidTask_=0,mr.Trashcan.prototype.lidOpen_=0,mr.Trashcan.prototype.left_=0,mr.Trashcan.prototype.top_=0,mr.Trashcan.prototype.initialized_=!1,mr.Trashcan.prototype.createDom=function(){this.svgGroup_=(0,M.createSvgElement)(vt.Svg.G,{class:"blocklyTrash"},null);var e=String(Math.random()).substring(2),o=(0,M.createSvgElement)(vt.Svg.CLIPPATH,{id:"blocklyTrashBodyClipPath"+e},this.svgGroup_);(0,M.createSvgElement)(vt.Svg.RECT,{width:47,height:44,y:16},o);var n=(0,M.createSvgElement)(vt.Svg.IMAGE,{width:t.module$exports$Blockly$internalConstants.SPRITE.width,x:-0,height:t.module$exports$Blockly$internalConstants.SPRITE.height,y:-32,"clip-path":"url(#blocklyTrashBodyClipPath"+e+")"},this.svgGroup_);return n.setAttributeNS(M.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.module$exports$Blockly$internalConstants.SPRITE.url),o=(0,M.createSvgElement)(vt.Svg.CLIPPATH,{id:"blocklyTrashLidClipPath"+e},this.svgGroup_),(0,M.createSvgElement)(vt.Svg.RECT,{width:47,height:16},o),this.svgLid_=(0,M.createSvgElement)(vt.Svg.IMAGE,{width:t.module$exports$Blockly$internalConstants.SPRITE.width,x:-0,height:t.module$exports$Blockly$internalConstants.SPRITE.height,y:-32,"clip-path":"url(#blocklyTrashLidClipPath"+e+")"},this.svgGroup_),this.svgLid_.setAttributeNS(M.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.module$exports$Blockly$internalConstants.SPRITE.url),(0,f.bind)(this.svgGroup_,"mousedown",this,this.blockMouseDownWhenOpenable_),(0,f.bind)(this.svgGroup_,"mouseup",this,this.click),(0,f.bind)(n,"mouseover",this,this.mouseOver_),(0,f.bind)(n,"mouseout",this,this.mouseOut_),this.animateLid_(),this.svgGroup_},mr.Trashcan.prototype.init=function(){0this.minOpenness_&&1>this.lidOpen_&&(this.lidTask_=setTimeout(this.animateLid_.bind(this),20))},mr.Trashcan.prototype.setLidAngle_=function(t){var e=this.workspace_.toolboxPosition===Ut.Position.RIGHT||this.workspace_.horizontalLayout&&this.workspace_.RTL;this.svgLid_.setAttribute("transform","rotate("+(e?-t:t)+","+(e?4:43)+",14)")},mr.Trashcan.prototype.setMinOpenness_=function(t){this.minOpenness_=t,this.isLidOpen||this.setLidAngle_(45*t)},mr.Trashcan.prototype.closeLid=function(){this.setLidOpen(!1)},mr.Trashcan.prototype.click=function(){this.hasContents_()&&this.openFlyout()},mr.Trashcan.prototype.fireUiEvent_=function(t){t=new((0,nt.get)(nt.TRASHCAN_OPEN))(t,this.workspace_.id),(0,nt.fire)(t)},mr.Trashcan.prototype.blockMouseDownWhenOpenable_=function(t){!this.contentsIsOpen()&&this.hasContents_()&&t.stopPropagation()},mr.Trashcan.prototype.mouseOver_=function(){this.hasContents_()&&this.setLidOpen(!0)},mr.Trashcan.prototype.mouseOut_=function(){this.setLidOpen(!1)},mr.Trashcan.prototype.onDelete_=function(t){if(!(0>=this.workspace_.options.maxTrashcanContents||t.type!==nt.DELETE||t.wasShadow)&&(t=this.cleanBlockJson_(t.oldJson),-1===this.contents_.indexOf(t))){for(this.contents_.unshift(t);this.contents_.length>this.workspace_.options.maxTrashcanContents;)this.contents_.pop();this.setMinOpenness_(.1)}},mr.Trashcan.prototype.cleanBlockJson_=function(t){return function t(e){if(e){if(delete e.id,delete e.x,delete e.y,delete e.enabled,e.icons&&e.icons.comment){var o=e.icons.comment;delete o.height,delete o.width,delete o.pinned}for(var n in o=e.inputs){var i=o[n];t(i.block),t(i.shadow)}e.next&&(t((e=e.next).block),t(e.shadow))}}(t=JSON.parse(JSON.stringify(t))),t.kind="BLOCK",JSON.stringify(t)};var yr={FlyoutButton:function(t,e,o,n){this.workspace_=t,this.targetWorkspace_=e,this.text_=o.text,this.position_=new ht.Coordinate(0,0),this.isLabel_=n,this.callbackKey_=o.callbackKey||o.callbackkey,this.cssClass_=o["web-class"]||null,this.onMouseUpWrapper_=null,this.info=o}};yr.FlyoutButton.MARGIN_X=5,yr.FlyoutButton.MARGIN_Y=2,yr.FlyoutButton.prototype.width=0,yr.FlyoutButton.prototype.height=0,yr.FlyoutButton.prototype.createDom=function(){var t,e=this.isLabel_?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass_&&(e+=" "+this.cssClass_),this.svgGroup_=(0,M.createSvgElement)(vt.Svg.G,{class:e},this.workspace_.getCanvas()),this.isLabel_||(t=(0,M.createSvgElement)(vt.Svg.RECT,{class:"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.svgGroup_)),e=(0,M.createSvgElement)(vt.Svg.RECT,{class:this.isLabel_?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:4,ry:4},this.svgGroup_);var o=(0,M.createSvgElement)(vt.Svg.TEXT,{class:this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_),n=(0,qe.replaceMessageReferences)(this.text_);this.workspace_.RTL&&(n+="‏"),o.textContent=n,this.isLabel_&&(this.svgText_=o,this.workspace_.getThemeManager().subscribe(this.svgText_,"flyoutForegroundColour","fill"));var i=(0,_t.getComputedStyle)(o,"fontSize"),r=(0,_t.getComputedStyle)(o,"fontWeight"),s=(0,_t.getComputedStyle)(o,"fontFamily");return this.width=(0,M.getFastTextWidthWithSizeString)(o,i,r,s),n=(0,M.measureFontMetrics)(n,i,r,s),this.height=n.height,this.isLabel_||(this.width+=2*yr.FlyoutButton.MARGIN_X,this.height+=2*yr.FlyoutButton.MARGIN_Y,t.setAttribute("width",this.width),t.setAttribute("height",this.height)),e.setAttribute("width",this.width),e.setAttribute("height",this.height),o.setAttribute("x",this.width/2),o.setAttribute("y",this.height/2-n.height/2+n.baseline),this.updateTransform_(),this.onMouseUpWrapper_=(0,f.conditionalBind)(this.svgGroup_,"mouseup",this,this.onMouseUp_),this.svgGroup_},yr.FlyoutButton.prototype.show=function(){this.updateTransform_(),this.svgGroup_.setAttribute("display","block")},yr.FlyoutButton.prototype.updateTransform_=function(){this.svgGroup_.setAttribute("transform","translate("+this.position_.x+","+this.position_.y+")")},yr.FlyoutButton.prototype.moveTo=function(t,e){this.position_.x=t,this.position_.y=e,this.updateTransform_()},yr.FlyoutButton.prototype.isLabel=function(){return this.isLabel_},yr.FlyoutButton.prototype.getPosition=function(){return this.position_},yr.FlyoutButton.prototype.getButtonText=function(){return this.text_},yr.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_},yr.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&(0,f.unbind)(this.onMouseUpWrapper_),this.svgGroup_&&(0,M.removeNode)(this.svgGroup_),this.svgText_&&this.workspace_.getThemeManager().unsubscribe(this.svgText_)},yr.FlyoutButton.prototype.onMouseUp_=function(t){(t=this.targetWorkspace_.getGesture(t))&&t.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_)},(0,c.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 Tr,Er={CATEGORY_NAME:"VARIABLE_DYNAMIC",onCreateVariableButtonClick_String:function(e){(0,t.module$exports$Blockly$Variables.createVariableButtonHandler)(e.getTargetWorkspace(),void 0,"String")},onCreateVariableButtonClick_Number:function(e){(0,t.module$exports$Blockly$Variables.createVariableButtonHandler)(e.getTargetWorkspace(),void 0,"Number")},onCreateVariableButtonClick_Colour:function(e){(0,t.module$exports$Blockly$Variables.createVariableButtonHandler)(e.getTargetWorkspace(),void 0,"Colour")},flyoutCategory:function(e){var o=[],n=document.createElement("button");return n.setAttribute("text",t.module$exports$Blockly$Msg.Msg.NEW_STRING_VARIABLE),n.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),o.push(n),(n=document.createElement("button")).setAttribute("text",t.module$exports$Blockly$Msg.Msg.NEW_NUMBER_VARIABLE),n.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),o.push(n),(n=document.createElement("button")).setAttribute("text",t.module$exports$Blockly$Msg.Msg.NEW_COLOUR_VARIABLE),n.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),o.push(n),e.registerButtonCallback("CREATE_VARIABLE_STRING",Er.onCreateVariableButtonClick_String),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",Er.onCreateVariableButtonClick_Number),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",Er.onCreateVariableButtonClick_Colour),e=(0,Er.flyoutCategoryBlocks)(e),o.concat(e)},flyoutCategoryBlocks:function(e){var o=[];if(0<(e=e.getAllVariables()).length){if(t.module$exports$Blockly$blocks.Blocks.variables_set_dynamic){var n=e[e.length-1],i=(0,t.module$exports$Blockly$utils$xml.createElement)("block");i.setAttribute("type","variables_set_dynamic"),i.setAttribute("gap",24),i.appendChild((0,t.module$exports$Blockly$Variables.generateVariableFieldDom)(n)),o.push(i)}if(t.module$exports$Blockly$blocks.Blocks.variables_get_dynamic)for(e.sort(yo.VariableModel.compareByName),n=0;i=e[n];n++){var r=(0,t.module$exports$Blockly$utils$xml.createElement)("block");r.setAttribute("type","variables_get_dynamic"),r.setAttribute("gap",8),r.appendChild((0,t.module$exports$Blockly$Variables.generateVariableFieldDom)(i)),o.push(r)}}return o}};t.module$exports$Blockly$Procedures={CATEGORY_NAME:"PROCEDURE",DEFAULT_ARG:"x",allProcedures:function(t){var e=t.getBlocksByType("procedures_defnoreturn",!1).map((function(t){return t.getProcedureDef()}));return t=t.getBlocksByType("procedures_defreturn",!1).map((function(t){return t.getProcedureDef()})),e.sort(Tr),t.sort(Tr),[e,t]}},Tr=function(t,e){return t[0].localeCompare(e[0],void 0,{sensitivity:"base"})},t.module$exports$Blockly$Procedures.findLegalName=function(e,o){if(o.isInFlyout)return e;for(e=e||t.module$exports$Blockly$Msg.Msg.UNNAMED_KEY||"unnamed";!vr(e,o.workspace,o);){var n=e.match(/^(.*?)(\d+)$/);e=n?n[1]+(parseInt(n[2],10)+1):e+"2"}return e};var vr=function(e,o,n){return!(0,t.module$exports$Blockly$Procedures.isNameUsed)(e,o,n)};t.module$exports$Blockly$Procedures.isNameUsed=function(e,o,n){o=o.getAllBlocks(!1);for(var i=0;it||Math.abs(this.workspaceHeight_-n)>t)&&(this.workspaceWidth_=o,this.workspaceHeight_=n,this.bubble_.setBubbleSize(o+t,n+t),this.svgDialog_.setAttribute("width",this.workspaceWidth_),this.svgDialog_.setAttribute("height",this.workspaceHeight_),this.workspace_.setCachedParentSvgSize(this.workspaceWidth_,this.workspaceHeight_)),this.block_.RTL&&(t="translate("+this.workspaceWidth_+",0)",this.workspace_.getCanvas().setAttribute("transform",t)),this.workspace_.resize()},t.module$exports$Blockly$Mutator.Mutator.prototype.onBubbleMove_=function(){this.workspace_&&this.workspace_.recordDragTargets()},t.module$exports$Blockly$Mutator.Mutator.prototype.setVisible=function(t){if(t!==this.isVisible())if((0,nt.fire)(new((0,nt.get)(nt.BUBBLE_OPEN))(this.block_,t,"mutator")),t){this.bubble_=new Ao.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 e=this.workspace_.options.languageTree;t=this.workspace_.getFlyout(),e&&(t.init(this.workspace_),t.show(e)),this.rootBlock_=this.block_.decompose(this.workspace_),e=this.rootBlock_.getDescendants(!1);for(var o=0,n=void 0;n=e[o];o++)n.render();if(this.rootBlock_.setMovable(!1),this.rootBlock_.setDeletable(!1),t?(e=2*t.CORNER_RADIUS,t=this.rootBlock_.RTL?t.getWidth()+e:e):t=e=16,this.block_.RTL&&(t=-t),this.rootBlock_.moveBy(t,e),this.block_.saveConnections){var i=this,r=this.block_;r.saveConnections(this.rootBlock_),this.sourceListener_=function(){r.saveConnections(i.rootBlock_)},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)},t.module$exports$Blockly$Mutator.Mutator.prototype.workspaceChanged_=function(t){t.isUiEvent||t.type===nt.CHANGE&&"disabled"===t.element||t.type===nt.CREATE||this.updateWorkspace_()},t.module$exports$Blockly$Mutator.Mutator.prototype.updateWorkspace_=function(){if(!this.workspace_.isDragging())for(var e=this.workspace_.getTopBlocks(!1),o=0,n=void 0;n=e[o];o++){var i=n.getRelativeToSurfaceXY();if(20>i.y&&n.moveBy(0,20-i.y),n.RTL){var r=-20,s=this.workspace_.getFlyout();s&&(r-=s.getWidth()),i.x>r&&n.moveBy(r-i.x,0)}else 20>i.x&&n.moveBy(20-i.x,0)}if(this.rootBlock_.workspace===this.workspace_){(0,nt.setGroup)(!0);var l=this.block_;if(e=oo.BlockChange.getExtraBlockState_(l),o=l.rendered,l.rendered=!1,l.compose(this.rootBlock_),l.rendered=o,l.initSvg(),l.rendered&&l.render(),e!==(o=oo.BlockChange.getExtraBlockState_(l))){(0,nt.fire)(new((0,nt.get)(nt.CHANGE))(l,"mutation",null,e,o));var a=(0,nt.getGroup)();setTimeout((function(){(0,nt.setGroup)(a),l.bumpNeighbours(),(0,nt.setGroup)(!1)}),t.module$exports$Blockly$internalConstants.BUMP_DELAY)}this.workspace_.isDragging()||this.resizeBubble_(),(0,nt.setGroup)(!1)}},t.module$exports$Blockly$Mutator.Mutator.prototype.dispose=function(){this.block_.mutator=null,ur.Icon.prototype.dispose.call(this)},t.module$exports$Blockly$Mutator.Mutator.prototype.updateBlockStyle=function(){var t=this.workspace_;if(t&&t.getAllBlocks(!1)){for(var e,o=t.getAllBlocks(!1),n=0;e=o[n];n++)e.setStyle(e.getStyleName());if(t=t.getFlyout())for(t=t.workspace_.getAllBlocks(!1),o=0;n=t[o];o++)n.setStyle(n.getStyleName())}},t.module$exports$Blockly$Mutator.Mutator.reconnect=function(t,e,o){if(!t||!t.getSourceBlock().workspace)return!1;o=e.getInput(o).connection;var n=t.targetBlock();return!(n&&n!==e||o.targetConnection===t||(o.isConnected()&&o.disconnect(),o.connect(t),0))},t.module$exports$Blockly$Mutator.Mutator.findParentWs=function(t){var e=null;if(t&&t.options){var o=t.options.parentWorkspace;t.isFlyout?o&&o.options&&(e=o.options.parentWorkspace):o&&(e=o)}return e},t.Blockly={VERSION:"7.20211209.4"},t.Blockly.ALIGN_LEFT=t.module$exports$Blockly$Input.Align.LEFT,t.Blockly.ALIGN_CENTRE=t.module$exports$Blockly$Input.Align.CENTRE,t.Blockly.ALIGN_RIGHT=t.module$exports$Blockly$Input.Align.RIGHT,t.Blockly.INPUT_VALUE=t.module$exports$Blockly$ConnectionType.ConnectionType.INPUT_VALUE,t.Blockly.OUTPUT_VALUE=t.module$exports$Blockly$ConnectionType.ConnectionType.OUTPUT_VALUE,t.Blockly.NEXT_STATEMENT=t.module$exports$Blockly$ConnectionType.ConnectionType.NEXT_STATEMENT,t.Blockly.PREVIOUS_STATEMENT=t.module$exports$Blockly$ConnectionType.ConnectionType.PREVIOUS_STATEMENT,t.Blockly.DUMMY_INPUT=t.module$exports$Blockly$inputTypes.inputTypes.DUMMY,t.Blockly.TOOLBOX_AT_TOP=Ut.Position.TOP,t.Blockly.TOOLBOX_AT_BOTTOM=Ut.Position.BOTTOM,t.Blockly.TOOLBOX_AT_LEFT=Ut.Position.LEFT,t.Blockly.TOOLBOX_AT_RIGHT=Ut.Position.RIGHT,t.Blockly.svgResize=t.module$exports$Blockly$common.svgResize,t.Blockly.hideChaff=function(e){(0,t.module$exports$Blockly$common.getMainWorkspace)().hideChaff(e)},t.Blockly.getMainWorkspace=t.module$exports$Blockly$common.getMainWorkspace,t.Blockly.defineBlocksWithJsonArray=t.module$exports$Blockly$common.defineBlocksWithJsonArray,t.Blockly.setParentContainer=t.module$exports$Blockly$common.setParentContainer,Object.defineProperties(t.Blockly,{alert:{set:function(t){(0,a.warn)("Blockly.alert","December 2021","December 2022"),(0,uo.setAlert)(t)},get:function(){return(0,a.warn)("Blockly.alert","December 2021","December 2022","Blockly.dialog.alert()"),uo.alert}},confirm:{set:function(t){(0,a.warn)("Blockly.confirm","December 2021","December 2022"),(0,uo.setConfirm)(t)},get:function(){return(0,a.warn)("Blockly.confirm","December 2021","December 2022","Blockly.dialog.confirm()"),uo.confirm}},mainWorkspace:{set:function(e){(0,t.module$exports$Blockly$common.setMainWorkspace)(e)},get:function(){return(0,t.module$exports$Blockly$common.getMainWorkspace)()}},prompt:{set:function(t){(0,a.warn)("Blockly.prompt","December 2021","December 2022"),(0,uo.setPrompt)(t)},get:function(){return(0,a.warn)("Blockly.prompt","December 2021","December 2022","Blockly.dialog.prompt()"),uo.prompt}},selected:{get:function(){return(0,t.module$exports$Blockly$common.getSelected)()},set:function(e){(0,t.module$exports$Blockly$common.setSelected)(e)}},HSV_SATURATION:{get:function(){return On.colour.getHsvSaturation()},set:function(t){On.colour.setHsvSaturation(t)}},HSV_VALUE:{get:function(){return On.colour.getHsvValue()},set:function(t){On.colour.setHsvValue(t)}}}),t.Blockly.svgSize=yt.svgSize,t.Blockly.resizeSvgContents=function(t){(0,a.warn)("Blockly.resizeSvgContents","December 2021","December 2022","Blockly.WorkspaceSvg.resizeSvgContents"),(0,Yn.resizeSvgContents)(t)},t.Blockly.copy=function(t){(0,a.warn)("Blockly.copy","December 2021","December 2022","Blockly.clipboard.copy"),(0,te.copy)(t)},t.Blockly.paste=function(){return(0,a.warn)("Blockly.paste","December 2021","December 2022","Blockly.clipboard.paste"),(0,te.paste)()},t.Blockly.duplicate=function(t){(0,a.warn)("Blockly.duplicate","December 2021","December 2022","Blockly.clipboard.duplicate"),(0,te.duplicate)(t)},t.Blockly.isNumber=function(t){return(0,a.warn)("Blockly.isNumber","December 2021","December 2022","Blockly.utils.string.isNumber"),On.string.isNumber(t)},t.Blockly.hueToHex=function(t){return(0,a.warn)("Blockly.hueToHex","December 2021","December 2022","Blockly.utils.colour.hueToHex"),(0,Ke.hueToHex)(t)},t.Blockly.bindEvent_=function(t,e,o,n){return(0,a.warn)("Blockly.bindEvent_","December 2021","December 2022","Blockly.browserEvents.bind"),(0,f.bind)(t,e,o,n)},t.Blockly.unbindEvent_=function(t){return(0,a.warn)("Blockly.unbindEvent_","December 2021","December 2022","Blockly.browserEvents.unbind"),(0,f.unbind)(t)},t.Blockly.bindEventWithChecks_=function(t,e,o,n,i,r){return(0,a.warn)("Blockly.bindEventWithChecks_","December 2021","December 2022","Blockly.browserEvents.conditionalBind"),(0,f.conditionalBind)(t,e,o,n,i,r)},t.Blockly.LINE_MODE_MULTIPLIER=t.module$exports$Blockly$internalConstants.LINE_MODE_MULTIPLIER,t.Blockly.PAGE_MODE_MULTIPLIER=t.module$exports$Blockly$internalConstants.PAGE_MODE_MULTIPLIER,t.Blockly.DRAG_RADIUS=t.module$exports$Blockly$internalConstants.DRAG_RADIUS,t.Blockly.FLYOUT_DRAG_RADIUS=t.module$exports$Blockly$internalConstants.FLYOUT_DRAG_RADIUS,t.Blockly.SNAP_RADIUS=t.module$exports$Blockly$internalConstants.SNAP_RADIUS,t.Blockly.CONNECTING_SNAP_RADIUS=t.module$exports$Blockly$internalConstants.SNAP_RADIUS,t.Blockly.CURRENT_CONNECTION_PREFERENCE=t.module$exports$Blockly$internalConstants.CURRENT_CONNECTION_PREFERENCE,t.Blockly.BUMP_DELAY=t.module$exports$Blockly$internalConstants.BUMP_DELAY,t.Blockly.BUMP_RANDOMNESS=t.module$exports$Blockly$internalConstants.BUMP_RANDOMNESS,t.Blockly.COLLAPSE_CHARS=t.module$exports$Blockly$internalConstants.COLLAPSE_CHARS,t.Blockly.LONGPRESS=t.module$exports$Blockly$internalConstants.LONGPRESS,t.Blockly.SOUND_LIMIT=t.module$exports$Blockly$internalConstants.SOUND_LIMIT,t.Blockly.DRAG_STACK=t.module$exports$Blockly$internalConstants.DRAG_STACK,t.Blockly.SPRITE=t.module$exports$Blockly$internalConstants.SPRITE,t.Blockly.DRAG_NONE=t.module$exports$Blockly$internalConstants.DRAG_NONE,t.Blockly.DRAG_STICKY=t.module$exports$Blockly$internalConstants.DRAG_STICKY,t.Blockly.DRAG_BEGIN=t.module$exports$Blockly$internalConstants.DRAG_BEGIN,t.Blockly.DRAG_FREE=t.module$exports$Blockly$internalConstants.DRAG_FREE,t.Blockly.OPPOSITE_TYPE=t.module$exports$Blockly$internalConstants.OPPOSITE_TYPE,t.Blockly.RENAME_VARIABLE_ID=t.module$exports$Blockly$internalConstants.RENAME_VARIABLE_ID,t.Blockly.DELETE_VARIABLE_ID=t.module$exports$Blockly$internalConstants.DELETE_VARIABLE_ID,t.Blockly.COLLAPSED_INPUT_NAME=Io.COLLAPSED_INPUT_NAME,t.Blockly.COLLAPSED_FIELD_NAME=Io.COLLAPSED_FIELD_NAME,t.Blockly.VARIABLE_CATEGORY_NAME=t.module$exports$Blockly$Variables.CATEGORY_NAME,t.Blockly.VARIABLE_DYNAMIC_CATEGORY_NAME=Er.CATEGORY_NAME,t.Blockly.PROCEDURE_CATEGORY_NAME=t.module$exports$Blockly$Procedures.CATEGORY_NAME,t.Blockly.ASTNode=on.ASTNode,t.Blockly.BasicCursor=wn.BasicCursor,t.Blockly.Block=Bn.Block,t.Blockly.BlocklyOptions=function(){},t.Blockly.BlockDragger=Uo.BlockDragger,t.Blockly.BlockDragSurfaceSvg=kt.BlockDragSurfaceSvg,t.Blockly.BlockSvg=$n.BlockSvg,t.Blockly.Blocks=t.module$exports$Blockly$blocks.Blocks,t.Blockly.Bubble=Ao.Bubble,t.Blockly.BubbleDragger=Mo.BubbleDragger,t.Blockly.CollapsibleToolboxCategory=li.CollapsibleToolboxCategory,t.Blockly.Comment=hr.Comment,t.Blockly.ComponentManager=co.ComponentManager,t.Blockly.Connection=Co.Connection,t.Blockly.ConnectionType=t.module$exports$Blockly$ConnectionType.ConnectionType,t.Blockly.ConnectionChecker=Bo.ConnectionChecker,t.Blockly.ConnectionDB=Pn.ConnectionDB,t.Blockly.ContextMenu=t.module$exports$Blockly$ContextMenu,t.Blockly.ContextMenuItems=rr,t.Blockly.ContextMenuRegistry=Nn.ContextMenuRegistry,t.Blockly.Css=c,t.Blockly.Cursor=xn.Cursor,t.Blockly.DeleteArea=ti.DeleteArea,t.Blockly.DragTarget=Qn.DragTarget,t.Blockly.DropDownDiv=St.DropDownDiv,t.Blockly.Events=t.module$exports$Blockly$Events,t.Blockly.Extensions=t.module$exports$Blockly$Extensions,t.Blockly.Field=Vo.Field,t.Blockly.FieldAngle=mi.FieldAngle,t.Blockly.FieldCheckbox=t.module$exports$Blockly$FieldCheckbox.FieldCheckbox,t.Blockly.FieldColour=fi.FieldColour,t.Blockly.FieldDropdown=t.module$exports$Blockly$FieldDropdown.FieldDropdown,t.Blockly.FieldImage=t.module$exports$Blockly$FieldImage.FieldImage,t.Blockly.FieldLabel=t.module$exports$Blockly$FieldLabel.FieldLabel,t.Blockly.FieldLabelSerializable=gi.FieldLabelSerializable,t.Blockly.FieldMultilineInput=_i.FieldMultilineInput,t.Blockly.FieldNumber=di.FieldNumber,t.Blockly.FieldTextInput=t.module$exports$Blockly$FieldTextInput.FieldTextInput,t.Blockly.FieldVariable=hi.FieldVariable,t.Blockly.Flyout=oi.Flyout,t.Blockly.FlyoutButton=yr.FlyoutButton,t.Blockly.FlyoutMetricsManager=ei.FlyoutMetricsManager,t.Blockly.Generator=t.module$exports$Blockly$Generator.Generator,t.Blockly.Gesture=Wo.Gesture,t.Blockly.Grid=Mt.Grid,t.Blockly.HorizontalFlyout=ui.HorizontalFlyout,t.Blockly.IASTNodeLocation=function(){},t.Blockly.IASTNodeLocationSvg=function(){},t.Blockly.IASTNodeLocationWithBlock=function(){},t.Blockly.IAutoHideable=function(){},t.Blockly.IBlockDragger=function(){},t.Blockly.IBoundedElement=function(){},t.Blockly.IBubble=function(){},t.Blockly.ICollapsibleToolboxItem=function(){},t.Blockly.IComponent=function(){},t.Blockly.IConnectionChecker=function(){},t.Blockly.IContextMenu=function(){},t.Blockly.Icon=ur.Icon,t.Blockly.ICopyable=function(){},t.Blockly.IDeletable=function(){},t.Blockly.IDeleteArea=function(){},t.Blockly.IDragTarget=function(){},t.Blockly.IDraggable=function(){},t.Blockly.IFlyout=function(){},t.Blockly.IKeyboardAccessible=function(){},t.Blockly.IMetricsManager=function(){},t.Blockly.IMovable=function(){},t.Blockly.Input=t.module$exports$Blockly$Input.Input,t.Blockly.InsertionMarkerManager=$o.InsertionMarkerManager,t.Blockly.IPositionable=function(){},t.Blockly.IRegistrable=function(){},t.Blockly.IRegistrableField={},t.Blockly.ISelectable=function(){},t.Blockly.ISelectableToolboxItem=function(){},t.Blockly.IStyleable=function(){},t.Blockly.IToolbox=function(){},t.Blockly.IToolboxItem=function(){},t.Blockly.Marker=An.Marker,t.Blockly.MarkerManager=eo.MarkerManager,t.Blockly.Menu=ne.Menu,t.Blockly.MenuItem=oe.MenuItem,t.Blockly.MetricsManager=Vn.MetricsManager,t.Blockly.Mutator=t.module$exports$Blockly$Mutator.Mutator,t.Blockly.Msg=t.module$exports$Blockly$Msg.Msg,t.Blockly.Names=t.module$exports$Blockly$Names.Names,t.Blockly.Options=jt.Options,t.Blockly.Procedures=t.module$exports$Blockly$Procedures,t.Blockly.RenderedConnection=Dn.RenderedConnection,t.Blockly.Scrollbar=Jt.Scrollbar,t.Blockly.ScrollbarPair=zt.ScrollbarPair,t.Blockly.ShortcutItems=qi,t.Blockly.ShortcutRegistry=Zt.ShortcutRegistry,t.Blockly.TabNavigateCursor=Mn.TabNavigateCursor,t.Blockly.Theme=Xt.Theme,t.Blockly.Themes=zi,t.Blockly.ThemeManager=Fn.ThemeManager,t.Blockly.Toolbox=ci.Toolbox,t.Blockly.ToolboxCategory=ri.ToolboxCategory,t.Blockly.ToolboxItem=ii.ToolboxItem,t.Blockly.ToolboxSeparator=si.ToolboxSeparator,t.Blockly.Tooltip=E,t.Blockly.Touch=p,t.Blockly.TouchGesture=Un.TouchGesture,t.Blockly.Trashcan=mr.Trashcan,t.Blockly.VariableMap=So.VariableMap,t.Blockly.VariableModel=yo.VariableModel,t.Blockly.Variables=t.module$exports$Blockly$Variables,t.Blockly.VariablesDynamic=Er,t.Blockly.VerticalFlyout=ni.VerticalFlyout,t.Blockly.Warning=pr.Warning,t.Blockly.WidgetDiv=U,t.Blockly.Workspace=No.Workspace,t.Blockly.WorkspaceAudio=Hn.WorkspaceAudio,t.Blockly.WorkspaceComment=gr.WorkspaceComment,t.Blockly.WorkspaceCommentSvg=fr.WorkspaceCommentSvg,t.Blockly.WorkspaceDragSurfaceSvg=Qt.WorkspaceDragSurfaceSvg,t.Blockly.WorkspaceDragger=Lo.WorkspaceDragger,t.Blockly.WorkspaceSvg=Yn.WorkspaceSvg,t.Blockly.Xml=t.module$exports$Blockly$Xml,t.Blockly.ZoomControls=_r.ZoomControls,t.Blockly.blockAnimations=no,t.Blockly.blockRendering=Tn,t.Blockly.browserEvents=f,t.Blockly.bumpObjects=ut,t.Blockly.clipboard=te,t.Blockly.common=t.module$exports$Blockly$common,t.Blockly.connectionTypes=t.module$exports$Blockly$ConnectionType.ConnectionType,t.Blockly.constants=Io,t.Blockly.dialog=uo,t.Blockly.fieldRegistry=to,t.Blockly.geras=ji,t.Blockly.inject=function(e,o){if("string"==typeof e&&(e=document.getElementById(e)||document.querySelector(e)),!e||!(0,M.containsNode)(document,e))throw Error("Error: container is not in current document.");o=new jt.Options(o||{});var n=document.createElement("div");n.className="injectionDiv",n.tabIndex=0,(0,j.setState)(n,j.State.LABEL,t.module$exports$Blockly$Msg.Msg.WORKSPACE_ARIA_LABEL),e.appendChild(n),e=Xn(n,o);var i=new kt.BlockDragSurfaceSvg(n),r=new Qt.WorkspaceDragSurfaceSvg(n),s=Kn(e,o,i,r);return jn(s),(0,t.module$exports$Blockly$common.setMainWorkspace)(s),(0,t.module$exports$Blockly$common.svgResize)(s),n.addEventListener("focusin",(function(){(0,t.module$exports$Blockly$common.setMainWorkspace)(s)})),s},t.Blockly.inputTypes=t.module$exports$Blockly$inputTypes.inputTypes,t.Blockly.minimalist=Pi,t.Blockly.registry=Z,t.Blockly.serialization={blocks:ae,exceptions:se,priorities:ie,registry:re,variables:{},workspaces:Ai,ISerializer:le.ISerializer},t.Blockly.thrasos=Di,t.Blockly.uiPosition=dr,t.Blockly.utils=On,t.Blockly.zelos=Ri,"Blockly"in t.module$exports$Blockly$utils$global.globalThis||(t.module$exports$Blockly$utils$global.globalThis.Blockly={Msg:t.module$exports$Blockly$Msg.Msg}),t.Blockly.internal_=t,t.Blockly},i=[],void 0===(r="function"==typeof(n=s)?n.apply(e,i):n)||(t.exports=r)},1003:function(t,e,o){var n,i,r;i=[o(6904)],void 0===(r="function"==typeof(n=function(t){return t})?n.apply(e,i):n)||(t.exports=r)},6904:function(t,e,o){var n,i,r;i=[o(1334)],void 0===(r="function"==typeof(n=function(t){const e=t.internal_;(0,e.module$exports$Blockly$common.defineBlocksWithJsonArray)([{type:"variables_get_dynamic",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_dynamic_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableDynamicSetterGetter"]},{type:"variables_set_dynamic",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_dynamic_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableDynamicSetterGetter"]}]);var o={customContextMenu:function(t){if(this.isInFlyout)"variables_get_dynamic"!==this.type&&"variables_get_reporter_dynamic"!==this.type||(o={text:e.module$exports$Blockly$Msg.Msg.RENAME_VARIABLE,enabled:!0,callback:n(this)},l=this.getField("VAR").getText(),l={text:e.module$exports$Blockly$Msg.Msg.DELETE_VARIABLE.replace("%1",l),enabled:!0,callback:i(this)},t.unshift(o),t.unshift(l));else{var o=this.getFieldValue("VAR"),r=this.workspace.getVariableById(o).type;if("variables_get_dynamic"===this.type){o="variables_set_dynamic";var s=e.module$exports$Blockly$Msg.Msg.VARIABLES_GET_CREATE_SET}else o="variables_get_dynamic",s=e.module$exports$Blockly$Msg.Msg.VARIABLES_SET_CREATE_GET;var l={enabled:0","GT"],["‏≥","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]);(0,e.module$exports$Blockly$Extensions.register)("logic_op_tooltip",(0,e.module$exports$Blockly$Extensions.buildTooltipForDropdown)("OP",{EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"}));var T={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=(0,e.module$exports$Blockly$utils$xml.createElement)("mutation");return this.elseifCount_&&t.setAttribute("elseif",this.elseifCount_),this.elseCount_&&t.setAttribute("else",1),t},domToMutation:function(t){this.elseifCount_=parseInt(t.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(t.getAttribute("else"),10)||0,this.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var t=Object.create(null);return this.elseifCount_&&(t.elseIfCount=this.elseifCount_),this.elseCount_&&(t.hasElse=!0),t},loadExtraState:function(t){this.elseifCount_=t.elseIfCount||0,this.elseCount_=t.hasElse?1:0,this.updateShape_()},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var o=e.nextConnection,n=1;n<=this.elseifCount_;n++){var i=t.newBlock("controls_if_elseif");i.initSvg(),o.connect(i.previousConnection),o=i.nextConnection}return this.elseCount_&&((t=t.newBlock("controls_if_else")).initSvg(),o.connect(t.previousConnection)),e},compose:function(t){t=t.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;for(var e=[null],o=[null],n=null;t&&!t.isInsertionMarker();){switch(t.type){case"controls_if_elseif":this.elseifCount_++,e.push(t.valueConnection_),o.push(t.statementConnection_);break;case"controls_if_else":this.elseCount_++,n=t.statementConnection_;break;default:throw TypeError("Unknown block type: "+t.type)}t=t.nextConnection&&t.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(e,o,n)},saveConnections:function(t){t=t.nextConnection.targetBlock();for(var e=1;t;){switch(t.type){case"controls_if_elseif":var o=this.getInput("IF"+e),n=this.getInput("DO"+e);t.valueConnection_=o&&o.connection.targetConnection,t.statementConnection_=n&&n.connection.targetConnection,e++;break;case"controls_if_else":o=this.getInput("ELSE"),t.statementConnection_=o&&o.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+t.type)}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],o=null;this.getInput("ELSE")&&(o=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);n++){var i=this.getInput("IF"+n),r=this.getInput("DO"+n);t.push(i.connection.targetConnection),e.push(r.connection.targetConnection)}this.updateShape_(),this.reconnectChildBlocks_(t,e,o)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var t=1;this.getInput("IF"+t);t++)this.removeInput("IF"+t),this.removeInput("DO"+t);for(t=1;t<=this.elseifCount_;t++)this.appendValueInput("IF"+t).setCheck("Boolean").appendField(e.module$exports$Blockly$Msg.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+t).appendField(e.module$exports$Blockly$Msg.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(e.module$exports$Blockly$Msg.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(t,o,n){for(var i=1;i<=this.elseifCount_;i++)e.module$exports$Blockly$Mutator.Mutator.reconnect(t[i],this,"IF"+i),e.module$exports$Blockly$Mutator.Mutator.reconnect(o[i],this,"DO"+i);e.module$exports$Blockly$Mutator.Mutator.reconnect(n,this,"ELSE")}};(0,e.module$exports$Blockly$Extensions.registerMutator)("controls_if_mutator",T,null,["controls_if_elseif","controls_if_else"]);(0,e.module$exports$Blockly$Extensions.register)("controls_if_tooltip",(function(){this.setTooltip(function(){return this.elseifCount_||this.elseCount_?!this.elseifCount_&&this.elseCount_?e.module$exports$Blockly$Msg.Msg.CONTROLS_IF_TOOLTIP_2:this.elseifCount_&&!this.elseCount_?e.module$exports$Blockly$Msg.Msg.CONTROLS_IF_TOOLTIP_3:this.elseifCount_&&this.elseCount_?e.module$exports$Blockly$Msg.Msg.CONTROLS_IF_TOOLTIP_4:"":e.module$exports$Blockly$Msg.Msg.CONTROLS_IF_TOOLTIP_1}.bind(this))}));var E={onchange:function(t){this.prevBlocks_||(this.prevBlocks_=[null,null]);var o=this.getInputTargetBlock("A"),n=this.getInputTargetBlock("B");o&&n&&!this.workspace.connectionChecker.doTypeChecks(o.outputConnection,n.outputConnection)&&((0,e.module$exports$Blockly$Events.setGroup)(t.group),(t=this.prevBlocks_[0])!==o&&(o.unplug(),!t||t.isDisposed()||t.isShadow()||this.getInput("A").connection.connect(t.outputConnection)),(o=this.prevBlocks_[1])!==n&&(n.unplug(),!o||o.isDisposed()||o.isShadow()||this.getInput("B").connection.connect(o.outputConnection)),this.bumpNeighbours(),(0,e.module$exports$Blockly$Events.setGroup)(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}};(0,e.module$exports$Blockly$Extensions.register)("logic_compare",(function(){this.mixin(E)}));var v={prevParentConnection_:null,onchange:function(t){var o=this.getInputTargetBlock("THEN"),n=this.getInputTargetBlock("ELSE"),i=this.outputConnection.targetConnection;if((o||n)&&i)for(var r=0;2>r;r++){var s=1===r?o:n;s&&!s.workspace.connectionChecker.doTypeChecks(s.outputConnection,i)&&((0,e.module$exports$Blockly$Events.setGroup)(t.group),i===this.prevParentConnection_?(this.unplug(),i.getSourceBlock().bumpNeighbours()):(s.unplug(),s.bumpNeighbours()),(0,e.module$exports$Blockly$Events.setGroup)(!1))}this.prevParentConnection_=i}};return(0,e.module$exports$Blockly$Extensions.registerMixin)("logic_ternary",v),(0,e.module$exports$Blockly$common.defineBlocksWithJsonArray)([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]),e.module$exports$Blockly$blocks.Blocks.lists_create_with={init:function(){this.setHelpUrl(e.module$exports$Blockly$Msg.Msg.LISTS_CREATE_WITH_HELPURL),this.setStyle("list_blocks"),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new e.module$exports$Blockly$Mutator.Mutator(["lists_create_with_item"])),this.setTooltip(e.module$exports$Blockly$Msg.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var t=(0,e.module$exports$Blockly$utils$xml.createElement)("mutation");return t.setAttribute("items",this.itemCount_),t},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(t){this.itemCount_=t.itemCount,this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var o=e.getInput("STACK").connection,n=0;nn?a=l=this.ORDER_SUBTRACTION:i&&(a=l=this.ORDER_UNARY_NEGATION);return t=this.valueToCode(t,o,l)||s,(0,e.module$exports$Blockly$utils$string.isNumber)(t)?(t=Number(t)+n,i&&(t=-t)):(0n&&(t=t+" - "+-n),i&&(t=n?"-("+t+")":"-"+t),a=Math.floor(a),r=Math.floor(r),a&&r>=a&&(t="("+t+")")),t},e.Blockly.JavaScript=o,e.Blockly.JavaScript.variables_get=function(t){return[e.Blockly.JavaScript.nameDB_.getName(t.getFieldValue("VAR"),e.module$exports$Blockly$Names.NameType.VARIABLE),e.Blockly.JavaScript.ORDER_ATOMIC]},e.Blockly.JavaScript.variables_set=function(t){var o=e.Blockly.JavaScript.valueToCode(t,"VALUE",e.Blockly.JavaScript.ORDER_ASSIGNMENT)||"0";return e.Blockly.JavaScript.nameDB_.getName(t.getFieldValue("VAR"),e.module$exports$Blockly$Names.NameType.VARIABLE)+" = "+o+";\n"},e.Blockly.JavaScript.variables_get_dynamic=e.Blockly.JavaScript.variables_get,e.Blockly.JavaScript.variables_set_dynamic=e.Blockly.JavaScript.variables_set;var n=/^\s*'([^']|\\')*'\s*$/,i=function(t){return n.test(t)?[t,e.Blockly.JavaScript.ORDER_ATOMIC]:["String("+t+")",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},r=function(t,e,o){return"FIRST"===e?"0":"FROM_END"===e?t+".length - 1 - "+o:"LAST"===e?t+".length - 1":o};e.Blockly.JavaScript.text=function(t){return[e.Blockly.JavaScript.quote_(t.getFieldValue("TEXT")),e.Blockly.JavaScript.ORDER_ATOMIC]},e.Blockly.JavaScript.text_multiline=function(t){var o=-1!==(t=e.Blockly.JavaScript.multiline_quote_(t.getFieldValue("TEXT"))).indexOf("+")?e.Blockly.JavaScript.ORDER_ADDITION:e.Blockly.JavaScript.ORDER_ATOMIC;return[t,o]},e.Blockly.JavaScript.text_join=function(t){switch(t.itemCount_){case 0:return["''",e.Blockly.JavaScript.ORDER_ATOMIC];case 1:return t=e.Blockly.JavaScript.valueToCode(t,"ADD0",e.Blockly.JavaScript.ORDER_NONE)||"''",i(t);case 2:var o=e.Blockly.JavaScript.valueToCode(t,"ADD0",e.Blockly.JavaScript.ORDER_NONE)||"''";return t=e.Blockly.JavaScript.valueToCode(t,"ADD1",e.Blockly.JavaScript.ORDER_NONE)||"''",[i(o)[0]+" + "+i(t)[0],e.Blockly.JavaScript.ORDER_ADDITION];default:o=Array(t.itemCount_);for(var n=0;n 0";break;case"NEGATIVE":i=o+" < 0";break;case"DIVISIBLE_BY":i=o+" % "+(t=e.Blockly.JavaScript.valueToCode(t,"DIVISOR",e.Blockly.JavaScript.ORDER_MODULUS)||"0")+" === 0"}return[i,e.Blockly.JavaScript.ORDER_EQUALITY]},e.Blockly.JavaScript.math_change=function(t){var o=e.Blockly.JavaScript.valueToCode(t,"DELTA",e.Blockly.JavaScript.ORDER_ADDITION)||"0";return(t=e.Blockly.JavaScript.nameDB_.getName(t.getFieldValue("VAR"),e.module$exports$Blockly$Names.NameType.VARIABLE))+" = (typeof "+t+" === 'number' ? "+t+" : 0) + "+o+";\n"},e.Blockly.JavaScript.math_round=e.Blockly.JavaScript.math_single,e.Blockly.JavaScript.math_trig=e.Blockly.JavaScript.math_single,e.Blockly.JavaScript.math_on_list=function(t){var o=t.getFieldValue("OP");switch(o){case"SUM":t=e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_MEMBER)||"[]",t+=".reduce(function(x, y) {return x + y;})";break;case"MIN":t="Math.min.apply(null, "+(t=e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_NONE)||"[]")+")";break;case"MAX":t="Math.max.apply(null, "+(t=e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_NONE)||"[]")+")";break;case"AVERAGE":t=(o=e.Blockly.JavaScript.provideFunction_("mathMean",["function "+e.Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]))+"("+(t=e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_NONE)||"[]")+")";break;case"MEDIAN":t=(o=e.Blockly.JavaScript.provideFunction_("mathMedian",["function "+e.Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(myList) {"," var localList = myList.filter(function (x) {return typeof x === 'number';});"," if (!localList.length) return null;"," localList.sort(function(a, b) {return b - a;});"," if (localList.length % 2 === 0) {"," return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2;"," } else {"," return localList[(localList.length - 1) / 2];"," }","}"]))+"("+(t=e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_NONE)||"[]")+")";break;case"MODE":t=(o=e.Blockly.JavaScript.provideFunction_("mathModes",["function "+e.Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(values) {"," var modes = [];"," var counts = [];"," var maxCount = 0;"," for (var i = 0; i < values.length; i++) {"," var value = values[i];"," var found = false;"," var thisCount;"," for (var j = 0; j < counts.length; j++) {"," if (counts[j][0] === value) {"," thisCount = ++counts[j][1];"," found = true;"," break;"," }"," }"," if (!found) {"," counts.push([value, 1]);"," thisCount = 1;"," }"," maxCount = Math.max(thisCount, maxCount);"," }"," for (var j = 0; j < counts.length; j++) {"," if (counts[j][1] === maxCount) {"," modes.push(counts[j][0]);"," }"," }"," return modes;","}"]))+"("+(t=e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_NONE)||"[]")+")";break;case"STD_DEV":t=(o=e.Blockly.JavaScript.provideFunction_("mathStandardDeviation",["function "+e.Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(numbers) {"," var n = numbers.length;"," if (!n) return null;"," var mean = numbers.reduce(function(x, y) {return x + y;}) / n;"," var variance = 0;"," for (var j = 0; j < n; j++) {"," variance += Math.pow(numbers[j] - mean, 2);"," }"," variance = variance / n;"," return Math.sqrt(variance);","}"]))+"("+(t=e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_NONE)||"[]")+")";break;case"RANDOM":t=(o=e.Blockly.JavaScript.provideFunction_("mathRandomList",["function "+e.Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]))+"("+(t=e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_NONE)||"[]")+")";break;default:throw Error("Unknown operator: "+o)}return[t,e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript.math_modulo=function(t){return[(e.Blockly.JavaScript.valueToCode(t,"DIVIDEND",e.Blockly.JavaScript.ORDER_MODULUS)||"0")+" % "+(t=e.Blockly.JavaScript.valueToCode(t,"DIVISOR",e.Blockly.JavaScript.ORDER_MODULUS)||"0"),e.Blockly.JavaScript.ORDER_MODULUS]},e.Blockly.JavaScript.math_constrain=function(t){return["Math.min(Math.max("+(e.Blockly.JavaScript.valueToCode(t,"VALUE",e.Blockly.JavaScript.ORDER_NONE)||"0")+", "+(e.Blockly.JavaScript.valueToCode(t,"LOW",e.Blockly.JavaScript.ORDER_NONE)||"0")+"), "+(t=e.Blockly.JavaScript.valueToCode(t,"HIGH",e.Blockly.JavaScript.ORDER_NONE)||"Infinity")+")",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript.math_random_int=function(t){var o=e.Blockly.JavaScript.valueToCode(t,"FROM",e.Blockly.JavaScript.ORDER_NONE)||"0";return t=e.Blockly.JavaScript.valueToCode(t,"TO",e.Blockly.JavaScript.ORDER_NONE)||"0",[e.Blockly.JavaScript.provideFunction_("mathRandomInt",["function "+e.Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(a, b) {"," if (a > b) {"," // Swap a and b to ensure a is smaller."," var c = a;"," a = b;"," b = c;"," }"," return Math.floor(Math.random() * (b - a + 1) + a);","}"])+"("+o+", "+t+")",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript.math_random_float=function(t){return["Math.random()",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript.math_atan2=function(t){var o=e.Blockly.JavaScript.valueToCode(t,"X",e.Blockly.JavaScript.ORDER_NONE)||"0";return["Math.atan2("+(e.Blockly.JavaScript.valueToCode(t,"Y",e.Blockly.JavaScript.ORDER_NONE)||"0")+", "+o+") / Math.PI * 180",e.Blockly.JavaScript.ORDER_DIVISION]},e.Blockly.JavaScript.controls_repeat_ext=function(t){var o=t.getField("TIMES")?String(Number(t.getFieldValue("TIMES"))):e.Blockly.JavaScript.valueToCode(t,"TIMES",e.Blockly.JavaScript.ORDER_ASSIGNMENT)||"0",n=e.Blockly.JavaScript.statementToCode(t,"DO");n=e.Blockly.JavaScript.addLoopTrap(n,t),t="";var i=e.Blockly.JavaScript.nameDB_.getDistinctName("count",e.module$exports$Blockly$Names.NameType.VARIABLE),r=o;return o.match(/^\w+$/)||(0,e.module$exports$Blockly$utils$string.isNumber)(o)||(t+="var "+(r=e.Blockly.JavaScript.nameDB_.getDistinctName("repeat_end",e.module$exports$Blockly$Names.NameType.VARIABLE))+" = "+o+";\n"),t+"for (var "+i+" = 0; "+i+" < "+r+"; "+i+"++) {\n"+n+"}\n"},e.Blockly.JavaScript.controls_repeat=e.Blockly.JavaScript.controls_repeat_ext,e.Blockly.JavaScript.controls_whileUntil=function(t){var o="UNTIL"===t.getFieldValue("MODE"),n=e.Blockly.JavaScript.valueToCode(t,"BOOL",o?e.Blockly.JavaScript.ORDER_LOGICAL_NOT:e.Blockly.JavaScript.ORDER_NONE)||"false",i=e.Blockly.JavaScript.statementToCode(t,"DO");return o&&(n="!"+n),"while ("+n+") {\n"+(i=e.Blockly.JavaScript.addLoopTrap(i,t))+"}\n"},e.Blockly.JavaScript.controls_for=function(t){var o=e.Blockly.JavaScript.nameDB_.getName(t.getFieldValue("VAR"),e.module$exports$Blockly$Names.NameType.VARIABLE),n=e.Blockly.JavaScript.valueToCode(t,"FROM",e.Blockly.JavaScript.ORDER_ASSIGNMENT)||"0",i=e.Blockly.JavaScript.valueToCode(t,"TO",e.Blockly.JavaScript.ORDER_ASSIGNMENT)||"0",r=e.Blockly.JavaScript.valueToCode(t,"BY",e.Blockly.JavaScript.ORDER_ASSIGNMENT)||"1",s=e.Blockly.JavaScript.statementToCode(t,"DO");if(s=e.Blockly.JavaScript.addLoopTrap(s,t),(0,e.module$exports$Blockly$utils$string.isNumber)(n)&&(0,e.module$exports$Blockly$utils$string.isNumber)(i)&&(0,e.module$exports$Blockly$utils$string.isNumber)(r)){var l=Number(n)<=Number(i);t="for ("+o+" = "+n+"; "+o+(l?" <= ":" >= ")+i+"; "+o,t=(1===(o=Math.abs(Number(r)))?t+(l?"++":"--"):t+(l?" += ":" -= ")+o)+") {\n"+s+"}\n"}else t="",l=n,n.match(/^\w+$/)||(0,e.module$exports$Blockly$utils$string.isNumber)(n)||(t+="var "+(l=e.Blockly.JavaScript.nameDB_.getDistinctName(o+"_start",e.module$exports$Blockly$Names.NameType.VARIABLE))+" = "+n+";\n"),n=i,i.match(/^\w+$/)||(0,e.module$exports$Blockly$utils$string.isNumber)(i)||(t+="var "+(n=e.Blockly.JavaScript.nameDB_.getDistinctName(o+"_end",e.module$exports$Blockly$Names.NameType.VARIABLE))+" = "+i+";\n"),t+="var "+(i=e.Blockly.JavaScript.nameDB_.getDistinctName(o+"_inc",e.module$exports$Blockly$Names.NameType.VARIABLE))+" = ",t=(t=(0,e.module$exports$Blockly$utils$string.isNumber)(r)?t+(Math.abs(r)+";\n"):t+"Math.abs("+r+");\n")+"if ("+l+" > "+n+") {\n"+(e.Blockly.JavaScript.INDENT+i)+" = -"+i+";\n",t+="}\n",t+="for ("+o+" = "+l+"; "+i+" >= 0 ? "+o+" <= "+n+" : "+o+" >= "+n+"; "+o+" += "+i+") {\n"+s+"}\n";return t},e.Blockly.JavaScript.controls_forEach=function(t){var o=e.Blockly.JavaScript.nameDB_.getName(t.getFieldValue("VAR"),e.module$exports$Blockly$Names.NameType.VARIABLE),n=e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_ASSIGNMENT)||"[]",i=e.Blockly.JavaScript.statementToCode(t,"DO");i=e.Blockly.JavaScript.addLoopTrap(i,t),t="";var r=n;return n.match(/^\w+$/)||(t+="var "+(r=e.Blockly.JavaScript.nameDB_.getDistinctName(o+"_list",e.module$exports$Blockly$Names.NameType.VARIABLE))+" = "+n+";\n"),t+"for (var "+(n=e.Blockly.JavaScript.nameDB_.getDistinctName(o+"_index",e.module$exports$Blockly$Names.NameType.VARIABLE))+" in "+r+") {\n"+(i=e.Blockly.JavaScript.INDENT+o+" = "+r+"["+n+"];\n"+i)+"}\n"},e.Blockly.JavaScript.controls_flow_statements=function(t){var o="";if(e.Blockly.JavaScript.STATEMENT_PREFIX&&(o+=e.Blockly.JavaScript.injectId(e.Blockly.JavaScript.STATEMENT_PREFIX,t)),e.Blockly.JavaScript.STATEMENT_SUFFIX&&(o+=e.Blockly.JavaScript.injectId(e.Blockly.JavaScript.STATEMENT_SUFFIX,t)),e.Blockly.JavaScript.STATEMENT_PREFIX){var n=t.getSurroundLoop();n&&!n.suppressPrefixSuffix&&(o+=e.Blockly.JavaScript.injectId(e.Blockly.JavaScript.STATEMENT_PREFIX,n))}switch(t.getFieldValue("FLOW")){case"BREAK":return o+"break;\n";case"CONTINUE":return o+"continue;\n"}throw Error("Unknown flow statement.")},e.Blockly.JavaScript.controls_if=function(t){var o=0,n="";e.Blockly.JavaScript.STATEMENT_PREFIX&&(n+=e.Blockly.JavaScript.injectId(e.Blockly.JavaScript.STATEMENT_PREFIX,t));do{var i=e.Blockly.JavaScript.valueToCode(t,"IF"+o,e.Blockly.JavaScript.ORDER_NONE)||"false",r=e.Blockly.JavaScript.statementToCode(t,"DO"+o);e.Blockly.JavaScript.STATEMENT_SUFFIX&&(r=e.Blockly.JavaScript.prefixLines(e.Blockly.JavaScript.injectId(e.Blockly.JavaScript.STATEMENT_SUFFIX,t),e.Blockly.JavaScript.INDENT)+r),n+=(0",GTE:">="}[t.getFieldValue("OP")],n="=="===o||"!="===o?e.Blockly.JavaScript.ORDER_EQUALITY:e.Blockly.JavaScript.ORDER_RELATIONAL;return[(e.Blockly.JavaScript.valueToCode(t,"A",n)||"0")+" "+o+" "+(t=e.Blockly.JavaScript.valueToCode(t,"B",n)||"0"),n]},e.Blockly.JavaScript.logic_operation=function(t){var o="AND"===t.getFieldValue("OP")?"&&":"||",n="&&"===o?e.Blockly.JavaScript.ORDER_LOGICAL_AND:e.Blockly.JavaScript.ORDER_LOGICAL_OR,i=e.Blockly.JavaScript.valueToCode(t,"A",n);if(t=e.Blockly.JavaScript.valueToCode(t,"B",n),i||t){var r="&&"===o?"true":"false";i||(i=r),t||(t=r)}else t=i="false";return[i+" "+o+" "+t,n]},e.Blockly.JavaScript.logic_negate=function(t){var o=e.Blockly.JavaScript.ORDER_LOGICAL_NOT;return["!"+(e.Blockly.JavaScript.valueToCode(t,"BOOL",o)||"true"),o]},e.Blockly.JavaScript.logic_boolean=function(t){return["TRUE"===t.getFieldValue("BOOL")?"true":"false",e.Blockly.JavaScript.ORDER_ATOMIC]},e.Blockly.JavaScript.logic_null=function(t){return["null",e.Blockly.JavaScript.ORDER_ATOMIC]},e.Blockly.JavaScript.logic_ternary=function(t){return[(e.Blockly.JavaScript.valueToCode(t,"IF",e.Blockly.JavaScript.ORDER_CONDITIONAL)||"false")+" ? "+(e.Blockly.JavaScript.valueToCode(t,"THEN",e.Blockly.JavaScript.ORDER_CONDITIONAL)||"null")+" : "+(t=e.Blockly.JavaScript.valueToCode(t,"ELSE",e.Blockly.JavaScript.ORDER_CONDITIONAL)||"null"),e.Blockly.JavaScript.ORDER_CONDITIONAL]},e.Blockly.JavaScript.lists_create_empty=function(t){return["[]",e.Blockly.JavaScript.ORDER_ATOMIC]},e.Blockly.JavaScript.lists_create_with=function(t){for(var o=Array(t.itemCount_),n=0;n b.toString() ? 1 : -1; },",' "IGNORE_CASE": function(a, b) {'," return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },"," };"," var compare = compareFuncs[type];"," return function(a, b) { return compare(a, b) * direction; }","}"])+'("'+t+'", '+n+"))",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript.lists_split=function(t){var o=e.Blockly.JavaScript.valueToCode(t,"INPUT",e.Blockly.JavaScript.ORDER_MEMBER),n=e.Blockly.JavaScript.valueToCode(t,"DELIM",e.Blockly.JavaScript.ORDER_NONE)||"''";if("SPLIT"===(t=t.getFieldValue("MODE")))o||(o="''"),t="split";else{if("JOIN"!==t)throw Error("Unknown mode: "+t);o||(o="[]"),t="join"}return[o+"."+t+"("+n+")",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript.lists_reverse=function(t){return[(e.Blockly.JavaScript.valueToCode(t,"LIST",e.Blockly.JavaScript.ORDER_FUNCTION_CALL)||"[]")+".slice().reverse()",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript.colour_picker=function(t){return[e.Blockly.JavaScript.quote_(t.getFieldValue("COLOUR")),e.Blockly.JavaScript.ORDER_ATOMIC]},e.Blockly.JavaScript.colour_random=function(t){return[e.Blockly.JavaScript.provideFunction_("colourRandom",["function "+e.Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"() {"," var num = Math.floor(Math.random() * Math.pow(2, 24));"," return '#' + ('00000' + num.toString(16)).substr(-6);","}"])+"()",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript.colour_rgb=function(t){var o=e.Blockly.JavaScript.valueToCode(t,"RED",e.Blockly.JavaScript.ORDER_NONE)||0,n=e.Blockly.JavaScript.valueToCode(t,"GREEN",e.Blockly.JavaScript.ORDER_NONE)||0;return t=e.Blockly.JavaScript.valueToCode(t,"BLUE",e.Blockly.JavaScript.ORDER_NONE)||0,[e.Blockly.JavaScript.provideFunction_("colourRgb",["function "+e.Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(r, g, b) {"," r = Math.max(Math.min(Number(r), 100), 0) * 2.55;"," g = Math.max(Math.min(Number(g), 100), 0) * 2.55;"," b = Math.max(Math.min(Number(b), 100), 0) * 2.55;"," r = ('0' + (Math.round(r) || 0).toString(16)).slice(-2);"," g = ('0' + (Math.round(g) || 0).toString(16)).slice(-2);"," b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2);"," return '#' + r + g + b;","}"])+"("+o+", "+n+", "+t+")",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript.colour_blend=function(t){var o=e.Blockly.JavaScript.valueToCode(t,"COLOUR1",e.Blockly.JavaScript.ORDER_NONE)||"'#000000'",n=e.Blockly.JavaScript.valueToCode(t,"COLOUR2",e.Blockly.JavaScript.ORDER_NONE)||"'#000000'";return t=e.Blockly.JavaScript.valueToCode(t,"RATIO",e.Blockly.JavaScript.ORDER_NONE)||.5,[e.Blockly.JavaScript.provideFunction_("colourBlend",["function "+e.Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(c1, c2, ratio) {"," ratio = Math.max(Math.min(Number(ratio), 1), 0);"," var r1 = parseInt(c1.substring(1, 3), 16);"," var g1 = parseInt(c1.substring(3, 5), 16);"," var b1 = parseInt(c1.substring(5, 7), 16);"," var r2 = parseInt(c2.substring(1, 3), 16);"," var g2 = parseInt(c2.substring(3, 5), 16);"," var b2 = parseInt(c2.substring(5, 7), 16);"," var r = Math.round(r1 * (1 - ratio) + r2 * ratio);"," var g = Math.round(g1 * (1 - ratio) + g2 * ratio);"," var b = Math.round(b1 * (1 - ratio) + b2 * ratio);"," r = ('0' + (r || 0).toString(16)).slice(-2);"," g = ('0' + (g || 0).toString(16)).slice(-2);"," b = ('0' + (b || 0).toString(16)).slice(-2);"," return '#' + r + g + b;","}"])+"("+o+", "+n+", "+t+")",e.Blockly.JavaScript.ORDER_FUNCTION_CALL]},e.Blockly.JavaScript})?n.apply(e,i):n)||(t.exports=r)},9177:function(t,e,o){var n,i,r;i=[o(8256)],void 0===(r="function"==typeof(n=function(t){return(t={Msg:{}}).Msg.ADD_COMMENT="Add Comment",t.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE="Can't delete the variable '%1' because it's part of the definition of the function '%2'",t.Msg.CHANGE_VALUE_TITLE="Change value:",t.Msg.CLEAN_UP="Clean up Blocks",t.Msg.COLLAPSED_WARNINGS_WARNING="Collapsed blocks contain warnings.",t.Msg.COLLAPSE_ALL="Collapse Blocks",t.Msg.COLLAPSE_BLOCK="Collapse Block",t.Msg.COLOUR_BLEND_COLOUR1="colour 1",t.Msg.COLOUR_BLEND_COLOUR2="colour 2",t.Msg.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp",t.Msg.COLOUR_BLEND_RATIO="ratio",t.Msg.COLOUR_BLEND_TITLE="blend",t.Msg.COLOUR_BLEND_TOOLTIP="Blends two colours together with a given ratio (0.0 - 1.0).",t.Msg.COLOUR_PICKER_HELPURL="https://en.wikipedia.org/wiki/Color",t.Msg.COLOUR_PICKER_TOOLTIP="Choose a colour from the palette.",t.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com",t.Msg.COLOUR_RANDOM_TITLE="random colour",t.Msg.COLOUR_RANDOM_TOOLTIP="Choose a colour at random.",t.Msg.COLOUR_RGB_BLUE="blue",t.Msg.COLOUR_RGB_GREEN="green",t.Msg.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html",t.Msg.COLOUR_RGB_RED="red",t.Msg.COLOUR_RGB_TITLE="colour with",t.Msg.COLOUR_RGB_TOOLTIP="Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.",t.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks",t.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="break out of loop",t.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="continue with next iteration of loop",t.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="Break out of the containing loop.",t.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="Skip the rest of this loop, and continue with the next iteration.",t.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="Warning: This block may only be used within a loop.",t.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each",t.Msg.CONTROLS_FOREACH_TITLE="for each item %1 in list %2",t.Msg.CONTROLS_FOREACH_TOOLTIP="For each item in a list, set the variable '%1' to the item, and then do some statements.",t.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with",t.Msg.CONTROLS_FOR_TITLE="count with %1 from %2 to %3 by %4",t.Msg.CONTROLS_FOR_TOOLTIP="Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.",t.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="Add a condition to the if block.",t.Msg.CONTROLS_IF_ELSE_TOOLTIP="Add a final, catch-all condition to the if block.",t.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse",t.Msg.CONTROLS_IF_IF_TOOLTIP="Add, remove, or reorder sections to reconfigure this if block.",t.Msg.CONTROLS_IF_MSG_ELSE="else",t.Msg.CONTROLS_IF_MSG_ELSEIF="else if",t.Msg.CONTROLS_IF_MSG_IF="if",t.Msg.CONTROLS_IF_TOOLTIP_1="If a value is true, then do some statements.",t.Msg.CONTROLS_IF_TOOLTIP_2="If a value is true, then do the first block of statements. Otherwise, do the second block of statements.",t.Msg.CONTROLS_IF_TOOLTIP_3="If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.",t.Msg.CONTROLS_IF_TOOLTIP_4="If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.",t.Msg.CONTROLS_REPEAT_HELPURL="https://en.wikipedia.org/wiki/For_loop",t.Msg.CONTROLS_REPEAT_INPUT_DO="do",t.Msg.CONTROLS_REPEAT_TITLE="repeat %1 times",t.Msg.CONTROLS_REPEAT_TOOLTIP="Do some statements several times.",t.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat",t.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="repeat until",t.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="repeat while",t.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="While a value is false, then do some statements.",t.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="While a value is true, then do some statements.",t.Msg.DELETE_ALL_BLOCKS="Delete all %1 blocks?",t.Msg.DELETE_BLOCK="Delete Block",t.Msg.DELETE_VARIABLE="Delete the '%1' variable",t.Msg.DELETE_VARIABLE_CONFIRMATION="Delete %1 uses of the '%2' variable?",t.Msg.DELETE_X_BLOCKS="Delete %1 Blocks",t.Msg.DIALOG_CANCEL="Cancel",t.Msg.DIALOG_OK="OK",t.Msg.DISABLE_BLOCK="Disable Block",t.Msg.DUPLICATE_BLOCK="Duplicate",t.Msg.DUPLICATE_COMMENT="Duplicate Comment",t.Msg.ENABLE_BLOCK="Enable Block",t.Msg.EXPAND_ALL="Expand Blocks",t.Msg.EXPAND_BLOCK="Expand Block",t.Msg.EXTERNAL_INPUTS="External Inputs",t.Msg.HELP="Help",t.Msg.INLINE_INPUTS="Inline Inputs",t.Msg.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list",t.Msg.LISTS_CREATE_EMPTY_TITLE="create empty list",t.Msg.LISTS_CREATE_EMPTY_TOOLTIP="Returns a list, of length 0, containing no data records",t.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="list",t.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="Add, remove, or reorder sections to reconfigure this list block.",t.Msg.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",t.Msg.LISTS_CREATE_WITH_INPUT_WITH="create list with",t.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP="Add an item to the list.",t.Msg.LISTS_CREATE_WITH_TOOLTIP="Create a list with any number of items.",t.Msg.LISTS_GET_INDEX_FIRST="first",t.Msg.LISTS_GET_INDEX_FROM_END="# from end",t.Msg.LISTS_GET_INDEX_FROM_START="#",t.Msg.LISTS_GET_INDEX_GET="get",t.Msg.LISTS_GET_INDEX_GET_REMOVE="get and remove",t.Msg.LISTS_GET_INDEX_LAST="last",t.Msg.LISTS_GET_INDEX_RANDOM="random",t.Msg.LISTS_GET_INDEX_REMOVE="remove",t.Msg.LISTS_GET_INDEX_TAIL="",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="Returns the first item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM="Returns the item at the specified position in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST="Returns the last item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="Returns a random item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="Removes and returns the first item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="Removes and returns the item at the specified position in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="Removes and returns the last item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="Removes and returns a random item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="Removes the first item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="Removes the item at the specified position in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="Removes the last item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="Removes a random item in a list.",t.Msg.LISTS_GET_SUBLIST_END_FROM_END="to # from end",t.Msg.LISTS_GET_SUBLIST_END_FROM_START="to #",t.Msg.LISTS_GET_SUBLIST_END_LAST="to last",t.Msg.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist",t.Msg.LISTS_GET_SUBLIST_START_FIRST="get sub-list from first",t.Msg.LISTS_GET_SUBLIST_START_FROM_END="get sub-list from # from end",t.Msg.LISTS_GET_SUBLIST_START_FROM_START="get sub-list from #",t.Msg.LISTS_GET_SUBLIST_TAIL="",t.Msg.LISTS_GET_SUBLIST_TOOLTIP="Creates a copy of the specified portion of a list.",t.Msg.LISTS_INDEX_FROM_END_TOOLTIP="%1 is the last item.",t.Msg.LISTS_INDEX_FROM_START_TOOLTIP="%1 is the first item.",t.Msg.LISTS_INDEX_OF_FIRST="find first occurrence of item",t.Msg.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list",t.Msg.LISTS_INDEX_OF_LAST="find last occurrence of item",t.Msg.LISTS_INDEX_OF_TOOLTIP="Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.",t.Msg.LISTS_INLIST="in list",t.Msg.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty",t.Msg.LISTS_ISEMPTY_TITLE="%1 is empty",t.Msg.LISTS_ISEMPTY_TOOLTIP="Returns true if the list is empty.",t.Msg.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of",t.Msg.LISTS_LENGTH_TITLE="length of %1",t.Msg.LISTS_LENGTH_TOOLTIP="Returns the length of a list.",t.Msg.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",t.Msg.LISTS_REPEAT_TITLE="create list with item %1 repeated %2 times",t.Msg.LISTS_REPEAT_TOOLTIP="Creates a list consisting of the given value repeated the specified number of times.",t.Msg.LISTS_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Lists#reversing-a-list",t.Msg.LISTS_REVERSE_MESSAGE0="reverse %1",t.Msg.LISTS_REVERSE_TOOLTIP="Reverse a copy of a list.",t.Msg.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set",t.Msg.LISTS_SET_INDEX_INPUT_TO="as",t.Msg.LISTS_SET_INDEX_INSERT="insert at",t.Msg.LISTS_SET_INDEX_SET="set",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="Inserts the item at the start of a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="Inserts the item at the specified position in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="Append the item to the end of a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="Inserts the item randomly in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="Sets the first item in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM="Sets the item at the specified position in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST="Sets the last item in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="Sets a random item in a list.",t.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list",t.Msg.LISTS_SORT_ORDER_ASCENDING="ascending",t.Msg.LISTS_SORT_ORDER_DESCENDING="descending",t.Msg.LISTS_SORT_TITLE="sort %1 %2 %3",t.Msg.LISTS_SORT_TOOLTIP="Sort a copy of a list.",t.Msg.LISTS_SORT_TYPE_IGNORECASE="alphabetic, ignore case",t.Msg.LISTS_SORT_TYPE_NUMERIC="numeric",t.Msg.LISTS_SORT_TYPE_TEXT="alphabetic",t.Msg.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists",t.Msg.LISTS_SPLIT_LIST_FROM_TEXT="make list from text",t.Msg.LISTS_SPLIT_TEXT_FROM_LIST="make text from list",t.Msg.LISTS_SPLIT_TOOLTIP_JOIN="Join a list of texts into one text, separated by a delimiter.",t.Msg.LISTS_SPLIT_TOOLTIP_SPLIT="Split text into a list of texts, breaking at each delimiter.",t.Msg.LISTS_SPLIT_WITH_DELIMITER="with delimiter",t.Msg.LOGIC_BOOLEAN_FALSE="false",t.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values",t.Msg.LOGIC_BOOLEAN_TOOLTIP="Returns either true or false.",t.Msg.LOGIC_BOOLEAN_TRUE="true",t.Msg.LOGIC_COMPARE_HELPURL="https://en.wikipedia.org/wiki/Inequality_(mathematics)",t.Msg.LOGIC_COMPARE_TOOLTIP_EQ="Return true if both inputs equal each other.",t.Msg.LOGIC_COMPARE_TOOLTIP_GT="Return true if the first input is greater than the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_GTE="Return true if the first input is greater than or equal to the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_LT="Return true if the first input is smaller than the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_LTE="Return true if the first input is smaller than or equal to the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="Return true if both inputs are not equal to each other.",t.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not",t.Msg.LOGIC_NEGATE_TITLE="not %1",t.Msg.LOGIC_NEGATE_TOOLTIP="Returns true if the input is false. Returns false if the input is true.",t.Msg.LOGIC_NULL="null",t.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type",t.Msg.LOGIC_NULL_TOOLTIP="Returns null.",t.Msg.LOGIC_OPERATION_AND="and",t.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations",t.Msg.LOGIC_OPERATION_OR="or",t.Msg.LOGIC_OPERATION_TOOLTIP_AND="Return true if both inputs are true.",t.Msg.LOGIC_OPERATION_TOOLTIP_OR="Return true if at least one of the inputs is true.",t.Msg.LOGIC_TERNARY_CONDITION="test",t.Msg.LOGIC_TERNARY_HELPURL="https://en.wikipedia.org/wiki/%3F:",t.Msg.LOGIC_TERNARY_IF_FALSE="if false",t.Msg.LOGIC_TERNARY_IF_TRUE="if true",t.Msg.LOGIC_TERNARY_TOOLTIP="Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.",t.Msg.MATH_ADDITION_SYMBOL="+",t.Msg.MATH_ARITHMETIC_HELPURL="https://en.wikipedia.org/wiki/Arithmetic",t.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="Return the sum of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="Return the quotient of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="Return the difference of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="Return the product of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="Return the first number raised to the power of the second number.",t.Msg.MATH_ATAN2_HELPURL="https://en.wikipedia.org/wiki/Atan2",t.Msg.MATH_ATAN2_TITLE="atan2 of X:%1 Y:%2",t.Msg.MATH_ATAN2_TOOLTIP="Return the arctangent of point (X, Y) in degrees from -180 to 180.",t.Msg.MATH_CHANGE_HELPURL="https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter",t.Msg.MATH_CHANGE_TITLE="change %1 by %2",t.Msg.MATH_CHANGE_TOOLTIP="Add a number to variable '%1'.",t.Msg.MATH_CONSTANT_HELPURL="https://en.wikipedia.org/wiki/Mathematical_constant",t.Msg.MATH_CONSTANT_TOOLTIP="Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).",t.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)",t.Msg.MATH_CONSTRAIN_TITLE="constrain %1 low %2 high %3",t.Msg.MATH_CONSTRAIN_TOOLTIP="Constrain a number to be between the specified limits (inclusive).",t.Msg.MATH_DIVISION_SYMBOL="÷",t.Msg.MATH_IS_DIVISIBLE_BY="is divisible by",t.Msg.MATH_IS_EVEN="is even",t.Msg.MATH_IS_NEGATIVE="is negative",t.Msg.MATH_IS_ODD="is odd",t.Msg.MATH_IS_POSITIVE="is positive",t.Msg.MATH_IS_PRIME="is prime",t.Msg.MATH_IS_TOOLTIP="Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.",t.Msg.MATH_IS_WHOLE="is whole",t.Msg.MATH_MODULO_HELPURL="https://en.wikipedia.org/wiki/Modulo_operation",t.Msg.MATH_MODULO_TITLE="remainder of %1 ÷ %2",t.Msg.MATH_MODULO_TOOLTIP="Return the remainder from dividing the two numbers.",t.Msg.MATH_MULTIPLICATION_SYMBOL="×",t.Msg.MATH_NUMBER_HELPURL="https://en.wikipedia.org/wiki/Number",t.Msg.MATH_NUMBER_TOOLTIP="A number.",t.Msg.MATH_ONLIST_HELPURL="",t.Msg.MATH_ONLIST_OPERATOR_AVERAGE="average of list",t.Msg.MATH_ONLIST_OPERATOR_MAX="max of list",t.Msg.MATH_ONLIST_OPERATOR_MEDIAN="median of list",t.Msg.MATH_ONLIST_OPERATOR_MIN="min of list",t.Msg.MATH_ONLIST_OPERATOR_MODE="modes of list",t.Msg.MATH_ONLIST_OPERATOR_RANDOM="random item of list",t.Msg.MATH_ONLIST_OPERATOR_STD_DEV="standard deviation of list",t.Msg.MATH_ONLIST_OPERATOR_SUM="sum of list",t.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="Return the average (arithmetic mean) of the numeric values in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MAX="Return the largest number in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="Return the median number in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MIN="Return the smallest number in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MODE="Return a list of the most common item(s) in the list.",t.Msg.MATH_ONLIST_TOOLTIP_RANDOM="Return a random element from the list.",t.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="Return the standard deviation of the list.",t.Msg.MATH_ONLIST_TOOLTIP_SUM="Return the sum of all the numbers in the list.",t.Msg.MATH_POWER_SYMBOL="^",t.Msg.MATH_RANDOM_FLOAT_HELPURL="https://en.wikipedia.org/wiki/Random_number_generation",t.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="random fraction",t.Msg.MATH_RANDOM_FLOAT_TOOLTIP="Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).",t.Msg.MATH_RANDOM_INT_HELPURL="https://en.wikipedia.org/wiki/Random_number_generation",t.Msg.MATH_RANDOM_INT_TITLE="random integer from %1 to %2",t.Msg.MATH_RANDOM_INT_TOOLTIP="Return a random integer between the two specified limits, inclusive.",t.Msg.MATH_ROUND_HELPURL="https://en.wikipedia.org/wiki/Rounding",t.Msg.MATH_ROUND_OPERATOR_ROUND="round",t.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="round down",t.Msg.MATH_ROUND_OPERATOR_ROUNDUP="round up",t.Msg.MATH_ROUND_TOOLTIP="Round a number up or down.",t.Msg.MATH_SINGLE_HELPURL="https://en.wikipedia.org/wiki/Square_root",t.Msg.MATH_SINGLE_OP_ABSOLUTE="absolute",t.Msg.MATH_SINGLE_OP_ROOT="square root",t.Msg.MATH_SINGLE_TOOLTIP_ABS="Return the absolute value of a number.",t.Msg.MATH_SINGLE_TOOLTIP_EXP="Return e to the power of a number.",t.Msg.MATH_SINGLE_TOOLTIP_LN="Return the natural logarithm of a number.",t.Msg.MATH_SINGLE_TOOLTIP_LOG10="Return the base 10 logarithm of a number.",t.Msg.MATH_SINGLE_TOOLTIP_NEG="Return the negation of a number.",t.Msg.MATH_SINGLE_TOOLTIP_POW10="Return 10 to the power of a number.",t.Msg.MATH_SINGLE_TOOLTIP_ROOT="Return the square root of a number.",t.Msg.MATH_SUBTRACTION_SYMBOL="-",t.Msg.MATH_TRIG_ACOS="acos",t.Msg.MATH_TRIG_ASIN="asin",t.Msg.MATH_TRIG_ATAN="atan",t.Msg.MATH_TRIG_COS="cos",t.Msg.MATH_TRIG_HELPURL="https://en.wikipedia.org/wiki/Trigonometric_functions",t.Msg.MATH_TRIG_SIN="sin",t.Msg.MATH_TRIG_TAN="tan",t.Msg.MATH_TRIG_TOOLTIP_ACOS="Return the arccosine of a number.",t.Msg.MATH_TRIG_TOOLTIP_ASIN="Return the arcsine of a number.",t.Msg.MATH_TRIG_TOOLTIP_ATAN="Return the arctangent of a number.",t.Msg.MATH_TRIG_TOOLTIP_COS="Return the cosine of a degree (not radian).",t.Msg.MATH_TRIG_TOOLTIP_SIN="Return the sine of a degree (not radian).",t.Msg.MATH_TRIG_TOOLTIP_TAN="Return the tangent of a degree (not radian).",t.Msg.NEW_COLOUR_VARIABLE="Create colour variable...",t.Msg.NEW_NUMBER_VARIABLE="Create number variable...",t.Msg.NEW_STRING_VARIABLE="Create string variable...",t.Msg.NEW_VARIABLE="Create variable...",t.Msg.NEW_VARIABLE_TITLE="New variable name:",t.Msg.NEW_VARIABLE_TYPE_TITLE="New variable type:",t.Msg.ORDINAL_NUMBER_SUFFIX="",t.Msg.PROCEDURES_ALLOW_STATEMENTS="allow statements",t.Msg.PROCEDURES_BEFORE_PARAMS="with:",t.Msg.PROCEDURES_CALLNORETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_CALLNORETURN_TOOLTIP="Run the user-defined function '%1'.",t.Msg.PROCEDURES_CALLRETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_CALLRETURN_TOOLTIP="Run the user-defined function '%1' and use its output.",t.Msg.PROCEDURES_CALL_BEFORE_PARAMS="with:",t.Msg.PROCEDURES_CREATE_DO="Create '%1'",t.Msg.PROCEDURES_DEFNORETURN_COMMENT="Describe this function...",t.Msg.PROCEDURES_DEFNORETURN_DO="",t.Msg.PROCEDURES_DEFNORETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_DEFNORETURN_PROCEDURE="do something",t.Msg.PROCEDURES_DEFNORETURN_TITLE="to",t.Msg.PROCEDURES_DEFNORETURN_TOOLTIP="Creates a function with no output.",t.Msg.PROCEDURES_DEFRETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_DEFRETURN_RETURN="return",t.Msg.PROCEDURES_DEFRETURN_TOOLTIP="Creates a function with an output.",t.Msg.PROCEDURES_DEF_DUPLICATE_WARNING="Warning: This function has duplicate parameters.",t.Msg.PROCEDURES_HIGHLIGHT_DEF="Highlight function definition",t.Msg.PROCEDURES_IFRETURN_HELPURL="http://c2.com/cgi/wiki?GuardClause",t.Msg.PROCEDURES_IFRETURN_TOOLTIP="If a value is true, then return a second value.",t.Msg.PROCEDURES_IFRETURN_WARNING="Warning: This block may be used only within a function definition.",t.Msg.PROCEDURES_MUTATORARG_TITLE="input name:",t.Msg.PROCEDURES_MUTATORARG_TOOLTIP="Add an input to the function.",t.Msg.PROCEDURES_MUTATORCONTAINER_TITLE="inputs",t.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP="Add, remove, or reorder inputs to this function.",t.Msg.REDO="Redo",t.Msg.REMOVE_COMMENT="Remove Comment",t.Msg.RENAME_VARIABLE="Rename variable...",t.Msg.RENAME_VARIABLE_TITLE="Rename all '%1' variables to:",t.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",t.Msg.TEXT_APPEND_TITLE="to %1 append text %2",t.Msg.TEXT_APPEND_TOOLTIP="Append some text to variable '%1'.",t.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case",t.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="to lower case",t.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="to Title Case",t.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="to UPPER CASE",t.Msg.TEXT_CHANGECASE_TOOLTIP="Return a copy of the text in a different case.",t.Msg.TEXT_CHARAT_FIRST="get first letter",t.Msg.TEXT_CHARAT_FROM_END="get letter # from end",t.Msg.TEXT_CHARAT_FROM_START="get letter #",t.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text",t.Msg.TEXT_CHARAT_LAST="get last letter",t.Msg.TEXT_CHARAT_RANDOM="get random letter",t.Msg.TEXT_CHARAT_TAIL="",t.Msg.TEXT_CHARAT_TITLE="in text %1 %2",t.Msg.TEXT_CHARAT_TOOLTIP="Returns the letter at the specified position.",t.Msg.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings",t.Msg.TEXT_COUNT_MESSAGE0="count %1 in %2",t.Msg.TEXT_COUNT_TOOLTIP="Count how many times some text occurs within some other text.",t.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="Add an item to the text.",t.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="join",t.Msg.TEXT_CREATE_JOIN_TOOLTIP="Add, remove, or reorder sections to reconfigure this text block.",t.Msg.TEXT_GET_SUBSTRING_END_FROM_END="to letter # from end",t.Msg.TEXT_GET_SUBSTRING_END_FROM_START="to letter #",t.Msg.TEXT_GET_SUBSTRING_END_LAST="to last letter",t.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text",t.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="in text",t.Msg.TEXT_GET_SUBSTRING_START_FIRST="get substring from first letter",t.Msg.TEXT_GET_SUBSTRING_START_FROM_END="get substring from letter # from end",t.Msg.TEXT_GET_SUBSTRING_START_FROM_START="get substring from letter #",t.Msg.TEXT_GET_SUBSTRING_TAIL="",t.Msg.TEXT_GET_SUBSTRING_TOOLTIP="Returns a specified portion of the text.",t.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text",t.Msg.TEXT_INDEXOF_OPERATOR_FIRST="find first occurrence of text",t.Msg.TEXT_INDEXOF_OPERATOR_LAST="find last occurrence of text",t.Msg.TEXT_INDEXOF_TITLE="in text %1 %2 %3",t.Msg.TEXT_INDEXOF_TOOLTIP="Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.",t.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text",t.Msg.TEXT_ISEMPTY_TITLE="%1 is empty",t.Msg.TEXT_ISEMPTY_TOOLTIP="Returns true if the provided text is empty.",t.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation",t.Msg.TEXT_JOIN_TITLE_CREATEWITH="create text with",t.Msg.TEXT_JOIN_TOOLTIP="Create a piece of text by joining together any number of items.",t.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",t.Msg.TEXT_LENGTH_TITLE="length of %1",t.Msg.TEXT_LENGTH_TOOLTIP="Returns the number of letters (including spaces) in the provided text.",t.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text",t.Msg.TEXT_PRINT_TITLE="print %1",t.Msg.TEXT_PRINT_TOOLTIP="Print the specified text, number or other value.",t.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user",t.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="Prompt for user for a number.",t.Msg.TEXT_PROMPT_TOOLTIP_TEXT="Prompt for user for some text.",t.Msg.TEXT_PROMPT_TYPE_NUMBER="prompt for number with message",t.Msg.TEXT_PROMPT_TYPE_TEXT="prompt for text with message",t.Msg.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Text#replacing-substrings",t.Msg.TEXT_REPLACE_MESSAGE0="replace %1 with %2 in %3",t.Msg.TEXT_REPLACE_TOOLTIP="Replace all occurances of some text within some other text.",t.Msg.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Text#reversing-text",t.Msg.TEXT_REVERSE_MESSAGE0="reverse %1",t.Msg.TEXT_REVERSE_TOOLTIP="Reverses the order of the characters in the text.",t.Msg.TEXT_TEXT_HELPURL="https://en.wikipedia.org/wiki/String_(computer_science)",t.Msg.TEXT_TEXT_TOOLTIP="A letter, word, or line of text.",t.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces",t.Msg.TEXT_TRIM_OPERATOR_BOTH="trim spaces from both sides of",t.Msg.TEXT_TRIM_OPERATOR_LEFT="trim spaces from left side of",t.Msg.TEXT_TRIM_OPERATOR_RIGHT="trim spaces from right side of",t.Msg.TEXT_TRIM_TOOLTIP="Return a copy of the text with spaces removed from one or both ends.",t.Msg.TODAY="Today",t.Msg.UNDO="Undo",t.Msg.UNNAMED_KEY="unnamed",t.Msg.VARIABLES_DEFAULT_NAME="item",t.Msg.VARIABLES_GET_CREATE_SET="Create 'set %1'",t.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get",t.Msg.VARIABLES_GET_TOOLTIP="Returns the value of this variable.",t.Msg.VARIABLES_SET="set %1 to %2",t.Msg.VARIABLES_SET_CREATE_GET="Create 'get %1'",t.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set",t.Msg.VARIABLES_SET_TOOLTIP="Sets this variable to be equal to the input.",t.Msg.VARIABLE_ALREADY_EXISTS="A variable named '%1' already exists.",t.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="A variable named '%1' already exists for another type: '%2'.",t.Msg.WORKSPACE_ARIA_LABEL="Blockly Workspace",t.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT="Say something...",t.Msg.CONTROLS_FOREACH_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_FOR_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=t.Msg.CONTROLS_IF_MSG_ELSEIF,t.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=t.Msg.CONTROLS_IF_MSG_ELSE,t.Msg.CONTROLS_IF_IF_TITLE_IF=t.Msg.CONTROLS_IF_MSG_IF,t.Msg.CONTROLS_IF_MSG_THEN=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.LISTS_CREATE_WITH_ITEM_TITLE=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.LISTS_GET_INDEX_HELPURL=t.Msg.LISTS_INDEX_OF_HELPURL,t.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.MATH_CHANGE_TITLE_ITEM=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.PROCEDURES_DEFRETURN_COMMENT=t.Msg.PROCEDURES_DEFNORETURN_COMMENT,t.Msg.PROCEDURES_DEFRETURN_DO=t.Msg.PROCEDURES_DEFNORETURN_DO,t.Msg.PROCEDURES_DEFRETURN_PROCEDURE=t.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,t.Msg.PROCEDURES_DEFRETURN_TITLE=t.Msg.PROCEDURES_DEFNORETURN_TITLE,t.Msg.TEXT_APPEND_VARIABLE=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.MATH_HUE="230",t.Msg.LOOPS_HUE="120",t.Msg.LISTS_HUE="260",t.Msg.LOGIC_HUE="210",t.Msg.VARIABLES_HUE="330",t.Msg.TEXTS_HUE="160",t.Msg.PROCEDURES_HUE="290",t.Msg.COLOUR_HUE="20",t.Msg.VARIABLES_DYNAMIC_HUE="310",t.Msg})?n.apply(e,i):n)||(t.exports=r)},5577:function(t,e,o){!function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=n(e);function r(t,e){for(var o=0;o=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};p.jQueryDetection(),i.default.fn.emulateTransitionEnd=u,i.default.event.special[p.TRANSITION_END]={bindType:c,delegateType:c,handle:function(t){if(i.default(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var h="bs.alert",d=i.default.fn.alert,_=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){i.default.removeData(this._element,h),this._element=null},e._getRootElement=function(t){var e=p.getSelectorFromElement(t),o=!1;return e&&(o=document.querySelector(e)),o||(o=i.default(t).closest(".alert")[0]),o},e._triggerCloseEvent=function(t){var e=i.default.Event("close.bs.alert");return i.default(t).trigger(e),e},e._removeElement=function(t){var e=this;if(i.default(t).removeClass("show"),i.default(t).hasClass("fade")){var o=p.getTransitionDurationFromElement(t);i.default(t).one(p.TRANSITION_END,(function(o){return e._destroyElement(t,o)})).emulateTransitionEnd(o)}else this._destroyElement(t)},e._destroyElement=function(t){i.default(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(e){return this.each((function(){var o=i.default(this),n=o.data(h);n||(n=new t(this),o.data(h,n)),"close"===e&&n[e](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},s(t,null,[{key:"VERSION",get:function(){return"4.6.1"}}]),t}();i.default(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',_._handleDismiss(new _)),i.default.fn.alert=_._jQueryInterface,i.default.fn.alert.Constructor=_,i.default.fn.alert.noConflict=function(){return i.default.fn.alert=d,_._jQueryInterface};var g="bs.button",f=i.default.fn.button,m="active",y='[data-toggle^="button"]',T='input:not([type="hidden"])',E=".btn",v=function(){function t(t){this._element=t,this.shouldAvoidTriggerChange=!1}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,o=i.default(this._element).closest('[data-toggle="buttons"]')[0];if(o){var n=this._element.querySelector(T);if(n){if("radio"===n.type)if(n.checked&&this._element.classList.contains(m))t=!1;else{var r=o.querySelector(".active");r&&i.default(r).removeClass(m)}t&&("checkbox"!==n.type&&"radio"!==n.type||(n.checked=!this._element.classList.contains(m)),this.shouldAvoidTriggerChange||i.default(n).trigger("change")),n.focus(),e=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(m)),t&&i.default(this._element).toggleClass(m))},e.dispose=function(){i.default.removeData(this._element,g),this._element=null},t._jQueryInterface=function(e,o){return this.each((function(){var n=i.default(this),r=n.data(g);r||(r=new t(this),n.data(g,r)),r.shouldAvoidTriggerChange=o,"toggle"===e&&r[e]()}))},s(t,null,[{key:"VERSION",get:function(){return"4.6.1"}}]),t}();i.default(document).on("click.bs.button.data-api",y,(function(t){var e=t.target,o=e;if(i.default(e).hasClass("btn")||(e=i.default(e).closest(E)[0]),!e||e.hasAttribute("disabled")||e.classList.contains("disabled"))t.preventDefault();else{var n=e.querySelector(T);if(n&&(n.hasAttribute("disabled")||n.classList.contains("disabled")))return void t.preventDefault();"INPUT"!==o.tagName&&"LABEL"===e.tagName||v._jQueryInterface.call(i.default(e),"toggle","INPUT"===o.tagName)}})).on("focus.bs.button.data-api blur.bs.button.data-api",y,(function(t){var e=i.default(t.target).closest(E)[0];i.default(e).toggleClass("focus",/^focus(in)?$/.test(t.type))})),i.default(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,o=t.length;e0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var e=t.prototype;return e.next=function(){this._isSliding||this._slide(O)},e.nextWhenVisible=function(){var t=i.default(this._element);!document.hidden&&t.is(":visible")&&"hidden"!==t.css("visibility")&&this.next()},e.prev=function(){this._isSliding||this._slide(R)},e.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(p.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},e.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},e.to=function(t){var e=this;this._activeElement=this._element.querySelector(N);var o=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)i.default(this._element).one(B,(function(){return e.to(t)}));else{if(o===t)return this.pause(),void this.cycle();var n=t>o?O:R;this._slide(n,this._items[t])}},e.dispose=function(){i.default(this._element).off(b),i.default.removeData(this._element,S),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},e._getConfig=function(t){return t=l({},D,t),p.typeCheckConfig(k,t,A),t},e._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},e._addEventListeners=function(){var t=this;this._config.keyboard&&i.default(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&i.default(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},e._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var e=function(e){t._pointerEvent&&x[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},o=function(e){t._pointerEvent&&x[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};i.default(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(i.default(this._element).on("pointerdown.bs.carousel",(function(t){return e(t)})),i.default(this._element).on("pointerup.bs.carousel",(function(t){return o(t)})),this._element.classList.add("pointer-event")):(i.default(this._element).on("touchstart.bs.carousel",(function(t){return e(t)})),i.default(this._element).on("touchmove.bs.carousel",(function(e){return function(e){t.touchDeltaX=e.originalEvent.touches&&e.originalEvent.touches.length>1?0:e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),i.default(this._element).on("touchend.bs.carousel",(function(t){return o(t)})))}},e._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},e._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},e._getItemByDirection=function(t,e){var o=t===O,n=t===R,i=this._getItemIndex(e),r=this._items.length-1;if((n&&0===i||o&&i===r)&&!this._config.wrap)return e;var s=(i+(t===R?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},e._triggerSlideEvent=function(t,e){var o=this._getItemIndex(t),n=this._getItemIndex(this._element.querySelector(N)),r=i.default.Event("slide.bs.carousel",{relatedTarget:t,direction:e,from:n,to:o});return i.default(this._element).trigger(r),r},e._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));i.default(e).removeClass(C);var o=this._indicatorsElement.children[this._getItemIndex(t)];o&&i.default(o).addClass(C)}},e._updateInterval=function(){var t=this._activeElement||this._element.querySelector(N);if(t){var e=parseInt(t.getAttribute("data-interval"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}},e._slide=function(t,e){var o,n,r,s=this,l=this._element.querySelector(N),a=this._getItemIndex(l),c=e||l&&this._getItemByDirection(t,l),u=this._getItemIndex(c),h=Boolean(this._interval);if(t===O?(o="carousel-item-left",n="carousel-item-next",r="left"):(o="carousel-item-right",n="carousel-item-prev",r="right"),c&&i.default(c).hasClass(C))this._isSliding=!1;else if(!this._triggerSlideEvent(c,r).isDefaultPrevented()&&l&&c){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(c),this._activeElement=c;var d=i.default.Event(B,{relatedTarget:c,direction:r,from:a,to:u});if(i.default(this._element).hasClass("slide")){i.default(c).addClass(n),p.reflow(c),i.default(l).addClass(o),i.default(c).addClass(o);var _=p.getTransitionDurationFromElement(l);i.default(l).one(p.TRANSITION_END,(function(){i.default(c).removeClass(o+" "+n).addClass(C),i.default(l).removeClass("active "+n+" "+o),s._isSliding=!1,setTimeout((function(){return i.default(s._element).trigger(d)}),0)})).emulateTransitionEnd(_)}else i.default(l).removeClass(C),i.default(c).addClass(C),this._isSliding=!1,i.default(this._element).trigger(d);h&&this.cycle()}},t._jQueryInterface=function(e){return this.each((function(){var o=i.default(this).data(S),n=l({},D,i.default(this).data());"object"==typeof e&&(n=l({},n,e));var r="string"==typeof e?e:n.slide;if(o||(o=new t(this,n),i.default(this).data(S,o)),"number"==typeof e)o.to(e);else if("string"==typeof r){if(void 0===o[r])throw new TypeError('No method named "'+r+'"');o[r]()}else n.interval&&n.ride&&(o.pause(),o.cycle())}))},t._dataApiClickHandler=function(e){var o=p.getSelectorFromElement(this);if(o){var n=i.default(o)[0];if(n&&i.default(n).hasClass("carousel")){var r=l({},i.default(n).data(),i.default(this).data()),s=this.getAttribute("data-slide-to");s&&(r.interval=!1),t._jQueryInterface.call(i.default(n),r),s&&i.default(n).data(S).to(s),e.preventDefault()}}},s(t,null,[{key:"VERSION",get:function(){return"4.6.1"}},{key:"Default",get:function(){return D}}]),t}();i.default(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",w._dataApiClickHandler),i.default(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),e=0,o=t.length;e0&&(this._selector=s,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var e=t.prototype;return e.toggle=function(){i.default(this._element).hasClass(P)?this.hide():this.show()},e.show=function(){var e,o,n=this;if(!(this._isTransitioning||i.default(this._element).hasClass(P)||(this._parent&&0===(e=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof n._config.parent?t.getAttribute("data-parent")===n._config.parent:t.classList.contains(F)}))).length&&(e=null),e&&(o=i.default(e).not(this._selector).data(L))&&o._isTransitioning))){var r=i.default.Event("show.bs.collapse");if(i.default(this._element).trigger(r),!r.isDefaultPrevented()){e&&(t._jQueryInterface.call(i.default(e).not(this._selector),"hide"),o||i.default(e).data(L,null));var s=this._getDimension();i.default(this._element).removeClass(F).addClass(U),this._element.style[s]=0,this._triggerArray.length&&i.default(this._triggerArray).removeClass(H).attr("aria-expanded",!0),this.setTransitioning(!0);var l="scroll"+(s[0].toUpperCase()+s.slice(1)),a=p.getTransitionDurationFromElement(this._element);i.default(this._element).one(p.TRANSITION_END,(function(){i.default(n._element).removeClass(U).addClass("collapse show"),n._element.style[s]="",n.setTransitioning(!1),i.default(n._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(a),this._element.style[s]=this._element[l]+"px"}}},e.hide=function(){var t=this;if(!this._isTransitioning&&i.default(this._element).hasClass(P)){var e=i.default.Event("hide.bs.collapse");if(i.default(this._element).trigger(e),!e.isDefaultPrevented()){var o=this._getDimension();this._element.style[o]=this._element.getBoundingClientRect()[o]+"px",p.reflow(this._element),i.default(this._element).addClass(U).removeClass("collapse show");var n=this._triggerArray.length;if(n>0)for(var r=0;r=0)return 1;return 0}();var J=K&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout((function(){e=!1,t()}),j))}};function z(t){return t&&"[object Function]"==={}.toString.call(t)}function q(t,e){if(1!==t.nodeType)return[];var o=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?o[e]:o}function Z(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function Q(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=q(t),o=e.overflow,n=e.overflowX,i=e.overflowY;return/(auto|scroll|overlay)/.test(o+i+n)?t:Q(Z(t))}function tt(t){return t&&t.referenceNode?t.referenceNode:t}var et=K&&!(!window.MSInputMethodContext||!document.documentMode),ot=K&&/MSIE 10/.test(navigator.userAgent);function nt(t){return 11===t?et:10===t?ot:et||ot}function it(t){if(!t)return document.documentElement;for(var e=nt(10)?document.body:null,o=t.offsetParent||null;o===e&&t.nextElementSibling;)o=(t=t.nextElementSibling).offsetParent;var n=o&&o.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TH","TD","TABLE"].indexOf(o.nodeName)&&"static"===q(o,"position")?it(o):o:t?t.ownerDocument.documentElement:document.documentElement}function rt(t){return null!==t.parentNode?rt(t.parentNode):t}function st(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var o=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?t:e,i=o?e:t,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var s,l,a=r.commonAncestorContainer;if(t!==a&&e!==a||n.contains(i))return"BODY"===(l=(s=a).nodeName)||"HTML"!==l&&it(s.firstElementChild)!==s?it(a):a;var c=rt(t);return c.host?st(c.host,e):st(t,rt(e).host)}function lt(t){var e="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",o=t.nodeName;if("BODY"===o||"HTML"===o){var n=t.ownerDocument.documentElement;return(t.ownerDocument.scrollingElement||n)[e]}return t[e]}function at(t,e){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=lt(e,"top"),i=lt(e,"left"),r=o?-1:1;return t.top+=n*r,t.bottom+=n*r,t.left+=i*r,t.right+=i*r,t}function ct(t,e){var o="x"===e?"Left":"Top",n="Left"===o?"Right":"Bottom";return parseFloat(t["border"+o+"Width"])+parseFloat(t["border"+n+"Width"])}function ut(t,e,o,n){return Math.max(e["offset"+t],e["scroll"+t],o["client"+t],o["offset"+t],o["scroll"+t],nt(10)?parseInt(o["offset"+t])+parseInt(n["margin"+("Height"===t?"Top":"Left")])+parseInt(n["margin"+("Height"===t?"Bottom":"Right")]):0)}function pt(t){var e=t.body,o=t.documentElement,n=nt(10)&&getComputedStyle(o);return{height:ut("Height",e,o,n),width:ut("Width",e,o,n)}}var ht=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},dt=function(){function t(t,e){for(var o=0;o2&&void 0!==arguments[2]&&arguments[2],n=nt(10),i="HTML"===e.nodeName,r=mt(t),s=mt(e),l=Q(t),a=q(e),c=parseFloat(a.borderTopWidth),u=parseFloat(a.borderLeftWidth);o&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=ft({top:r.top-s.top-c,left:r.left-s.left-u,width:r.width,height:r.height});if(p.marginTop=0,p.marginLeft=0,!n&&i){var h=parseFloat(a.marginTop),d=parseFloat(a.marginLeft);p.top-=c-h,p.bottom-=c-h,p.left-=u-d,p.right-=u-d,p.marginTop=h,p.marginLeft=d}return(n&&!o?e.contains(l):e===l&&"BODY"!==l.nodeName)&&(p=at(p,e)),p}function Tt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=t.ownerDocument.documentElement,n=yt(t,o),i=Math.max(o.clientWidth,window.innerWidth||0),r=Math.max(o.clientHeight,window.innerHeight||0),s=e?0:lt(o),l=e?0:lt(o,"left");return ft({top:s-n.top+n.marginTop,left:l-n.left+n.marginLeft,width:i,height:r})}function Et(t){var e=t.nodeName;if("BODY"===e||"HTML"===e)return!1;if("fixed"===q(t,"position"))return!0;var o=Z(t);return!!o&&Et(o)}function vt(t){if(!t||!t.parentElement||nt())return document.documentElement;for(var e=t.parentElement;e&&"none"===q(e,"transform");)e=e.parentElement;return e||document.documentElement}function kt(t,e,o,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={top:0,left:0},s=i?vt(t):st(t,tt(e));if("viewport"===n)r=Tt(s,i);else{var l=void 0;"scrollParent"===n?"BODY"===(l=Q(Z(e))).nodeName&&(l=t.ownerDocument.documentElement):l="window"===n?t.ownerDocument.documentElement:n;var a=yt(l,s,i);if("HTML"!==l.nodeName||Et(s))r=a;else{var c=pt(t.ownerDocument),u=c.height,p=c.width;r.top+=a.top-a.marginTop,r.bottom=u+a.top,r.left+=a.left-a.marginLeft,r.right=p+a.left}}var h="number"==typeof(o=o||0);return r.left+=h?o:o.left||0,r.top+=h?o:o.top||0,r.right-=h?o:o.right||0,r.bottom-=h?o:o.bottom||0,r}function St(t){return t.width*t.height}function bt(t,e,o,n,i){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var s=kt(o,n,r,i),l={top:{width:s.width,height:e.top-s.top},right:{width:s.right-e.right,height:s.height},bottom:{width:s.width,height:s.bottom-e.bottom},left:{width:e.left-s.left,height:s.height}},a=Object.keys(l).map((function(t){return gt({key:t},l[t],{area:St(l[t])})})).sort((function(t,e){return e.area-t.area})),c=a.filter((function(t){var e=t.width,n=t.height;return e>=o.clientWidth&&n>=o.clientHeight})),u=c.length>0?c[0].key:a[0].key,p=t.split("-")[1];return u+(p?"-"+p:"")}function It(t,e,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return yt(o,n?vt(e):st(e,tt(o)),n)}function Ct(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),o=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),n=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+n,height:t.offsetHeight+o}}function Ot(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,(function(t){return e[t]}))}function Rt(t,e,o){o=o.split("-")[0];var n=Ct(t),i={width:n.width,height:n.height},r=-1!==["right","left"].indexOf(o),s=r?"top":"left",l=r?"left":"top",a=r?"height":"width",c=r?"width":"height";return i[s]=e[s]+e[a]/2-n[a]/2,i[l]=o===l?e[l]-n[c]:e[Ot(l)],i}function Bt(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function Nt(t,e,o){return(void 0===o?t:t.slice(0,function(t,e,o){if(Array.prototype.findIndex)return t.findIndex((function(t){return t[e]===o}));var n=Bt(t,(function(t){return t[e]===o}));return t.indexOf(n)}(t,"name",o))).forEach((function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var o=t.function||t.fn;t.enabled&&z(o)&&(e.offsets.popper=ft(e.offsets.popper),e.offsets.reference=ft(e.offsets.reference),e=o(e,t))})),e}function Dt(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=It(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=bt(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=Rt(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=Nt(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function At(t,e){return t.some((function(t){var o=t.name;return t.enabled&&o===e}))}function xt(t){for(var e=[!1,"ms","Webkit","Moz","O"],o=t.charAt(0).toUpperCase()+t.slice(1),n=0;n1&&void 0!==arguments[1]&&arguments[1],o=Yt.indexOf(t),n=Yt.slice(o+1).concat(Yt.slice(0,o));return e?n.reverse():n}var Kt="flip",jt="clockwise",Jt="counterclockwise";function zt(t,e,o,n){var i=[0,0],r=-1!==["right","left"].indexOf(n),s=t.split(/(\+|\-)/).map((function(t){return t.trim()})),l=s.indexOf(Bt(s,(function(t){return-1!==t.search(/,|\s/)})));s[l]&&-1===s[l].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var a=/\s*,\s*|\s+/,c=-1!==l?[s.slice(0,l).concat([s[l].split(a)[0]]),[s[l].split(a)[1]].concat(s.slice(l+1))]:[s];return(c=c.map((function(t,n){var i=(1===n?!r:r)?"height":"width",s=!1;return t.reduce((function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,s=!0,t):s?(t[t.length-1]+=e,s=!1,t):t.concat(e)}),[]).map((function(t){return function(t,e,o,n){var i=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+i[1],s=i[2];return r?0===s.indexOf("%")?ft("%p"===s?o:n)[e]/100*r:"vh"===s||"vw"===s?("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*r:r:t}(t,i,e,o)}))}))).forEach((function(t,e){t.forEach((function(o,n){Ut(o)&&(i[e]+=o*("-"===t[n-1]?-1:1))}))})),i}var qt={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,o=e.split("-")[0],n=e.split("-")[1];if(n){var i=t.offsets,r=i.reference,s=i.popper,l=-1!==["bottom","top"].indexOf(o),a=l?"left":"top",c=l?"width":"height",u={start:_t({},a,r[a]),end:_t({},a,r[a]+r[c]-s[c])};t.offsets.popper=gt({},s,u[n])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var o,n=e.offset,i=t.placement,r=t.offsets,s=r.popper,l=r.reference,a=i.split("-")[0];return o=Ut(+n)?[+n,0]:zt(n,s,l,a),"left"===a?(s.top+=o[0],s.left-=o[1]):"right"===a?(s.top+=o[0],s.left+=o[1]):"top"===a?(s.left+=o[0],s.top-=o[1]):"bottom"===a&&(s.left+=o[0],s.top+=o[1]),t.popper=s,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var o=e.boundariesElement||it(t.instance.popper);t.instance.reference===o&&(o=it(o));var n=xt("transform"),i=t.instance.popper.style,r=i.top,s=i.left,l=i[n];i.top="",i.left="",i[n]="";var a=kt(t.instance.popper,t.instance.reference,e.padding,o,t.positionFixed);i.top=r,i.left=s,i[n]=l,e.boundaries=a;var c=e.priority,u=t.offsets.popper,p={primary:function(t){var o=u[t];return u[t]a[t]&&!e.escapeWithReference&&(n=Math.min(u[o],a[t]-("right"===t?u.width:u.height))),_t({},o,n)}};return c.forEach((function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";u=gt({},u,p[e](t))})),t.offsets.popper=u,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,o=e.popper,n=e.reference,i=t.placement.split("-")[0],r=Math.floor,s=-1!==["top","bottom"].indexOf(i),l=s?"right":"bottom",a=s?"left":"top",c=s?"width":"height";return o[l]r(n[l])&&(t.offsets.popper[a]=r(n[l])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var o;if(!Wt(t.instance.modifiers,"arrow","keepTogether"))return t;var n=e.element;if("string"==typeof n){if(!(n=t.instance.popper.querySelector(n)))return t}else if(!t.instance.popper.contains(n))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var i=t.placement.split("-")[0],r=t.offsets,s=r.popper,l=r.reference,a=-1!==["left","right"].indexOf(i),c=a?"height":"width",u=a?"Top":"Left",p=u.toLowerCase(),h=a?"left":"top",d=a?"bottom":"right",_=Ct(n)[c];l[d]-_s[d]&&(t.offsets.popper[p]+=l[p]+_-s[d]),t.offsets.popper=ft(t.offsets.popper);var g=l[p]+l[c]/2-_/2,f=q(t.instance.popper),m=parseFloat(f["margin"+u]),y=parseFloat(f["border"+u+"Width"]),T=g-t.offsets.popper[p]-m-y;return T=Math.max(Math.min(s[c]-_,T),0),t.arrowElement=n,t.offsets.arrow=(_t(o={},p,Math.round(T)),_t(o,h,""),o),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(At(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var o=kt(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),n=t.placement.split("-")[0],i=Ot(n),r=t.placement.split("-")[1]||"",s=[];switch(e.behavior){case Kt:s=[n,i];break;case jt:s=Xt(n);break;case Jt:s=Xt(n,!0);break;default:s=e.behavior}return s.forEach((function(l,a){if(n!==l||s.length===a+1)return t;n=t.placement.split("-")[0],i=Ot(n);var c=t.offsets.popper,u=t.offsets.reference,p=Math.floor,h="left"===n&&p(c.right)>p(u.left)||"right"===n&&p(c.left)p(u.top)||"bottom"===n&&p(c.top)p(o.right),g=p(c.top)p(o.bottom),m="left"===n&&d||"right"===n&&_||"top"===n&&g||"bottom"===n&&f,y=-1!==["top","bottom"].indexOf(n),T=!!e.flipVariations&&(y&&"start"===r&&d||y&&"end"===r&&_||!y&&"start"===r&&g||!y&&"end"===r&&f),E=!!e.flipVariationsByContent&&(y&&"start"===r&&_||y&&"end"===r&&d||!y&&"start"===r&&f||!y&&"end"===r&&g),v=T||E;(h||m||v)&&(t.flipped=!0,(h||m)&&(n=s[a+1]),v&&(r=function(t){return"end"===t?"start":"start"===t?"end":t}(r)),t.placement=n+(r?"-"+r:""),t.offsets.popper=gt({},t.offsets.popper,Rt(t.instance.popper,t.offsets.reference,t.placement)),t=Nt(t.instance.modifiers,t,"flip"))})),t},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,o=e.split("-")[0],n=t.offsets,i=n.popper,r=n.reference,s=-1!==["left","right"].indexOf(o),l=-1===["top","left"].indexOf(o);return i[s?"left":"top"]=r[o]-(l?i[s?"width":"height"]:0),t.placement=Ot(e),t.offsets.popper=ft(i),t}},hide:{order:800,enabled:!0,fn:function(t){if(!Wt(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,o=Bt(t.instance.modifiers,(function(t){return"preventOverflow"===t.name})).boundaries;if(e.bottomo.right||e.top>o.bottom||e.right2&&void 0!==arguments[2]?arguments[2]:{};ht(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(n.update)},this.update=J(this.update.bind(this)),this.options=gt({},t.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=o&&o.jquery?o[0]:o,this.options.modifiers={},Object.keys(gt({},t.Defaults.modifiers,i.modifiers)).forEach((function(e){n.options.modifiers[e]=gt({},t.Defaults.modifiers[e]||{},i.modifiers?i.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(t){return gt({name:t},n.options.modifiers[t])})).sort((function(t,e){return t.order-e.order})),this.modifiers.forEach((function(t){t.enabled&&z(t.onLoad)&&t.onLoad(n.reference,n.popper,n.options,t,n.state)})),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return dt(t,[{key:"update",value:function(){return Dt.call(this)}},{key:"destroy",value:function(){return wt.call(this)}},{key:"enableEventListeners",value:function(){return Pt.call(this)}},{key:"disableEventListeners",value:function(){return Ft.call(this)}}]),t}();Zt.Utils=("undefined"!=typeof window?window:o.g).PopperUtils,Zt.placements=Vt,Zt.Defaults=qt;var Qt=Zt,te="dropdown",ee="bs.dropdown",oe=".bs.dropdown",ne=i.default.fn[te],ie=new RegExp("38|40|27"),re="disabled",se="show",le="dropdown-menu-right",ae="hide.bs.dropdown",ce="hidden.bs.dropdown",ue="click.bs.dropdown.data-api",pe="keydown.bs.dropdown.data-api",he='[data-toggle="dropdown"]',de=".dropdown-menu",_e={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},ge={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},fe=function(){function t(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var e=t.prototype;return e.toggle=function(){if(!this._element.disabled&&!i.default(this._element).hasClass(re)){var e=i.default(this._menu).hasClass(se);t._clearMenus(),e||this.show(!0)}},e.show=function(e){if(void 0===e&&(e=!1),!(this._element.disabled||i.default(this._element).hasClass(re)||i.default(this._menu).hasClass(se))){var o={relatedTarget:this._element},n=i.default.Event("show.bs.dropdown",o),r=t._getParentFromElement(this._element);if(i.default(r).trigger(n),!n.isDefaultPrevented()){if(!this._inNavbar&&e){if(void 0===Qt)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");var s=this._element;"parent"===this._config.reference?s=r:p.isElement(this._config.reference)&&(s=this._config.reference,void 0!==this._config.reference.jquery&&(s=this._config.reference[0])),"scrollParent"!==this._config.boundary&&i.default(r).addClass("position-static"),this._popper=new Qt(s,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===i.default(r).closest(".navbar-nav").length&&i.default(document.body).children().on("mouseover",null,i.default.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),i.default(this._menu).toggleClass(se),i.default(r).toggleClass(se).trigger(i.default.Event("shown.bs.dropdown",o))}}},e.hide=function(){if(!this._element.disabled&&!i.default(this._element).hasClass(re)&&i.default(this._menu).hasClass(se)){var e={relatedTarget:this._element},o=i.default.Event(ae,e),n=t._getParentFromElement(this._element);i.default(n).trigger(o),o.isDefaultPrevented()||(this._popper&&this._popper.destroy(),i.default(this._menu).toggleClass(se),i.default(n).toggleClass(se).trigger(i.default.Event(ce,e)))}},e.dispose=function(){i.default.removeData(this._element,ee),i.default(this._element).off(oe),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},e.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},e._addEventListeners=function(){var t=this;i.default(this._element).on("click.bs.dropdown",(function(e){e.preventDefault(),e.stopPropagation(),t.toggle()}))},e._getConfig=function(t){return t=l({},this.constructor.Default,i.default(this._element).data(),t),p.typeCheckConfig(te,t,this.constructor.DefaultType),t},e._getMenuElement=function(){if(!this._menu){var e=t._getParentFromElement(this._element);e&&(this._menu=e.querySelector(de))}return this._menu},e._getPlacement=function(){var t=i.default(this._element.parentNode),e="bottom-start";return t.hasClass("dropup")?e=i.default(this._menu).hasClass(le)?"top-end":"top-start":t.hasClass("dropright")?e="right-start":t.hasClass("dropleft")?e="left-start":i.default(this._menu).hasClass(le)&&(e="bottom-end"),e},e._detectNavbar=function(){return i.default(this._element).closest(".navbar").length>0},e._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=l({},e.offsets,t._config.offset(e.offsets,t._element)),e}:e.offset=this._config.offset,e},e._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),l({},t,this._config.popperConfig)},t._jQueryInterface=function(e){return this.each((function(){var o=i.default(this).data(ee);if(o||(o=new t(this,"object"==typeof e?e:null),i.default(this).data(ee,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e]()}}))},t._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var o=[].slice.call(document.querySelectorAll(he)),n=0,r=o.length;n0&&s--,40===e.which&&sdocument.documentElement.clientHeight;o||(this._element.style.overflowY="hidden"),this._element.classList.add(be);var n=p.getTransitionDurationFromElement(this._dialog);i.default(this._element).off(p.TRANSITION_END),i.default(this._element).one(p.TRANSITION_END,(function(){t._element.classList.remove(be),o||i.default(t._element).one(p.TRANSITION_END,(function(){t._element.style.overflowY=""})).emulateTransitionEnd(t._element,n)})).emulateTransitionEnd(n),this._element.focus()}},e._showElement=function(t){var e=this,o=i.default(this._element).hasClass(ke),n=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),i.default(this._dialog).hasClass("modal-dialog-scrollable")&&n?n.scrollTop=0:this._element.scrollTop=0,o&&p.reflow(this._element),i.default(this._element).addClass(Se),this._config.focus&&this._enforceFocus();var r=i.default.Event("shown.bs.modal",{relatedTarget:t}),s=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,i.default(e._element).trigger(r)};if(o){var l=p.getTransitionDurationFromElement(this._dialog);i.default(this._dialog).one(p.TRANSITION_END,s).emulateTransitionEnd(l)}else s()},e._enforceFocus=function(){var t=this;i.default(document).off(Oe).on(Oe,(function(e){document!==e.target&&t._element!==e.target&&0===i.default(t._element).has(e.target).length&&t._element.focus()}))},e._setEscapeEvent=function(){var t=this;this._isShown?i.default(this._element).on(Ne,(function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()})):this._isShown||i.default(this._element).off(Ne)},e._setResizeEvent=function(){var t=this;this._isShown?i.default(window).on(Re,(function(e){return t.handleUpdate(e)})):i.default(window).off(Re)},e._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop((function(){i.default(document.body).removeClass(ve),t._resetAdjustments(),t._resetScrollbar(),i.default(t._element).trigger(Ie)}))},e._removeBackdrop=function(){this._backdrop&&(i.default(this._backdrop).remove(),this._backdrop=null)},e._showBackdrop=function(t){var e=this,o=i.default(this._element).hasClass(ke)?ke:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",o&&this._backdrop.classList.add(o),i.default(this._backdrop).appendTo(document.body),i.default(this._element).on(Be,(function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._triggerBackdropTransition():e.hide())})),o&&p.reflow(this._backdrop),i.default(this._backdrop).addClass(Se),!t)return;if(!o)return void t();var n=p.getTransitionDurationFromElement(this._backdrop);i.default(this._backdrop).one(p.TRANSITION_END,t).emulateTransitionEnd(n)}else if(!this._isShown&&this._backdrop){i.default(this._backdrop).removeClass(Se);var r=function(){e._removeBackdrop(),t&&t()};if(i.default(this._element).hasClass(ke)){var s=p.getTransitionDurationFromElement(this._backdrop);i.default(this._backdrop).one(p.TRANSITION_END,r).emulateTransitionEnd(s)}else r()}else t&&t()},e._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},e._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},e._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",customClass:"",sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},eo={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",customClass:"(string|function)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},oo={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},no=function(){function t(t,e){if(void 0===Qt)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var e=t.prototype;return e.enable=function(){this._isEnabled=!0},e.disable=function(){this._isEnabled=!1},e.toggleEnabled=function(){this._isEnabled=!this._isEnabled},e.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,o=i.default(t.currentTarget).data(e);o||(o=new this.constructor(t.currentTarget,this._getDelegateConfig()),i.default(t.currentTarget).data(e,o)),o._activeTrigger.click=!o._activeTrigger.click,o._isWithActiveTrigger()?o._enter(null,o):o._leave(null,o)}else{if(i.default(this.getTipElement()).hasClass(je))return void this._leave(null,this);this._enter(null,this)}},e.dispose=function(){clearTimeout(this._timeout),i.default.removeData(this.element,this.constructor.DATA_KEY),i.default(this.element).off(this.constructor.EVENT_KEY),i.default(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&i.default(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},e.show=function(){var t=this;if("none"===i.default(this.element).css("display"))throw new Error("Please use show on visible elements");var e=i.default.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){i.default(this.element).trigger(e);var o=p.findShadowRoot(this.element),n=i.default.contains(null!==o?o:this.element.ownerDocument.documentElement,this.element);if(e.isDefaultPrevented()||!n)return;var r=this.getTipElement(),s=p.getUID(this.constructor.NAME);r.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&i.default(r).addClass(Ke);var l="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,a=this._getAttachment(l);this.addAttachmentClass(a);var c=this._getContainer();i.default(r).data(this.constructor.DATA_KEY,this),i.default.contains(this.element.ownerDocument.documentElement,this.tip)||i.default(r).appendTo(c),i.default(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new Qt(this.element,r,this._getPopperConfig(a)),i.default(r).addClass(je),i.default(r).addClass(this.config.customClass),"ontouchstart"in document.documentElement&&i.default(document.body).children().on("mouseover",null,i.default.noop);var u=function(){t.config.animation&&t._fixTransition();var e=t._hoverState;t._hoverState=null,i.default(t.element).trigger(t.constructor.Event.SHOWN),e===ze&&t._leave(null,t)};if(i.default(this.tip).hasClass(Ke)){var h=p.getTransitionDurationFromElement(this.tip);i.default(this.tip).one(p.TRANSITION_END,u).emulateTransitionEnd(h)}else u()}},e.hide=function(t){var e=this,o=this.getTipElement(),n=i.default.Event(this.constructor.Event.HIDE),r=function(){e._hoverState!==Je&&o.parentNode&&o.parentNode.removeChild(o),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),i.default(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(i.default(this.element).trigger(n),!n.isDefaultPrevented()){if(i.default(o).removeClass(je),"ontouchstart"in document.documentElement&&i.default(document.body).children().off("mouseover",null,i.default.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,i.default(this.tip).hasClass(Ke)){var s=p.getTransitionDurationFromElement(o);i.default(o).one(p.TRANSITION_END,r).emulateTransitionEnd(s)}else r();this._hoverState=""}},e.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},e.isWithContent=function(){return Boolean(this.getTitle())},e.addAttachmentClass=function(t){i.default(this.getTipElement()).addClass("bs-tooltip-"+t)},e.getTipElement=function(){return this.tip=this.tip||i.default(this.config.template)[0],this.tip},e.setContent=function(){var t=this.getTipElement();this.setElementContent(i.default(t.querySelectorAll(".tooltip-inner")),this.getTitle()),i.default(t).removeClass("fade show")},e.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Ue(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?i.default(e).parent().is(t)||t.empty().append(e):t.text(i.default(e).text())},e.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},e._getPopperConfig=function(t){var e=this;return l({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}},this.config.popperConfig)},e._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=l({},e.offsets,t.config.offset(e.offsets,t.element)),e}:e.offset=this.config.offset,e},e._getContainer=function(){return!1===this.config.container?document.body:p.isElement(this.config.container)?i.default(this.config.container):i.default(document).find(this.config.container)},e._getAttachment=function(t){return Qe[t.toUpperCase()]},e._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(e){if("click"===e)i.default(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==e){var o=e===qe?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,n=e===qe?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;i.default(t.element).on(o,t.config.selector,(function(e){return t._enter(e)})).on(n,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},i.default(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},e._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},e._enter=function(t,e){var o=this.constructor.DATA_KEY;(e=e||i.default(t.currentTarget).data(o))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),i.default(t.currentTarget).data(o,e)),t&&(e._activeTrigger["focusin"===t.type?Ze:qe]=!0),i.default(e.getTipElement()).hasClass(je)||e._hoverState===Je?e._hoverState=Je:(clearTimeout(e._timeout),e._hoverState=Je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout((function(){e._hoverState===Je&&e.show()}),e.config.delay.show):e.show())},e._leave=function(t,e){var o=this.constructor.DATA_KEY;(e=e||i.default(t.currentTarget).data(o))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),i.default(t.currentTarget).data(o,e)),t&&(e._activeTrigger["focusout"===t.type?Ze:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=ze,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout((function(){e._hoverState===ze&&e.hide()}),e.config.delay.hide):e.hide())},e._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},e._getConfig=function(t){var e=i.default(this.element).data();return Object.keys(e).forEach((function(t){-1!==Xe.indexOf(t)&&delete e[t]})),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),p.typeCheckConfig(He,t,this.constructor.DefaultType),t.sanitize&&(t.template=Ue(t.template,t.whiteList,t.sanitizeFn)),t},e._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},e._cleanTipClass=function(){var t=i.default(this.getTipElement()),e=t.attr("class").match(Ye);null!==e&&e.length&&t.removeClass(e.join(""))},e._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},e._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(i.default(t).removeClass(Ke),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},t._jQueryInterface=function(e){return this.each((function(){var o=i.default(this),n=o.data(Ge),r="object"==typeof e&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new t(this,r),o.data(Ge,n)),"string"==typeof e)){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}}))},s(t,null,[{key:"VERSION",get:function(){return"4.6.1"}},{key:"Default",get:function(){return to}},{key:"NAME",get:function(){return He}},{key:"DATA_KEY",get:function(){return Ge}},{key:"Event",get:function(){return oo}},{key:"EVENT_KEY",get:function(){return We}},{key:"DefaultType",get:function(){return eo}}]),t}();i.default.fn.tooltip=no._jQueryInterface,i.default.fn.tooltip.Constructor=no,i.default.fn.tooltip.noConflict=function(){return i.default.fn.tooltip=Ve,no._jQueryInterface};var io="popover",ro="bs.popover",so=".bs.popover",lo=i.default.fn.popover,ao=new RegExp("(^|\\s)bs-popover\\S+","g"),co=l({},no.Default,{placement:"right",trigger:"click",content:"",template:''}),uo=l({},no.DefaultType,{content:"(string|element|function)"}),po={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},ho=function(t){function e(){return t.apply(this,arguments)||this}var o,n;n=t,(o=e).prototype=Object.create(n.prototype),o.prototype.constructor=o,a(o,n);var r=e.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){i.default(this.getTipElement()).addClass("bs-popover-"+t)},r.getTipElement=function(){return this.tip=this.tip||i.default(this.config.template)[0],this.tip},r.setContent=function(){var t=i.default(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(".popover-body"),e),t.removeClass("fade show")},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=i.default(this.getTipElement()),e=t.attr("class").match(ao);null!==e&&e.length>0&&t.removeClass(e.join(""))},e._jQueryInterface=function(t){return this.each((function(){var o=i.default(this).data(ro),n="object"==typeof t?t:null;if((o||!/dispose|hide/.test(t))&&(o||(o=new e(this,n),i.default(this).data(ro,o)),"string"==typeof t)){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}}))},s(e,null,[{key:"VERSION",get:function(){return"4.6.1"}},{key:"Default",get:function(){return co}},{key:"NAME",get:function(){return io}},{key:"DATA_KEY",get:function(){return ro}},{key:"Event",get:function(){return po}},{key:"EVENT_KEY",get:function(){return so}},{key:"DefaultType",get:function(){return uo}}]),e}(no);i.default.fn.popover=ho._jQueryInterface,i.default.fn.popover.Constructor=ho,i.default.fn.popover.noConflict=function(){return i.default.fn.popover=lo,ho._jQueryInterface};var _o="scrollspy",go="bs.scrollspy",fo="."+go,mo=i.default.fn[_o],yo="active",To="position",Eo=".nav, .list-group",vo=".nav-link",ko={offset:10,method:"auto",target:""},So={offset:"number",method:"string",target:"(string|element)"},bo=function(){function t(t,e){var o=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" "+".nav-link,"+this._config.target+" "+".list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,i.default(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return o._process(t)})),this.refresh(),this._process()}var e=t.prototype;return e.refresh=function(){var t=this,e=this._scrollElement===this._scrollElement.window?"offset":To,o="auto"===this._config.method?e:this._config.method,n=o===To?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var e,r=p.getSelectorFromElement(t);if(r&&(e=document.querySelector(r)),e){var s=e.getBoundingClientRect();if(s.width||s.height)return[i.default(e)[o]().top+n,r]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},e.dispose=function(){i.default.removeData(this._element,go),i.default(this._scrollElement).off(fo),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},e._getConfig=function(t){if("string"!=typeof(t=l({},ko,"object"==typeof t&&t?t:{})).target&&p.isElement(t.target)){var e=i.default(t.target).attr("id");e||(e=p.getUID(_o),i.default(t.target).attr("id",e)),t.target="#"+e}return p.typeCheckConfig(_o,t,So),t},e._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},e._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},e._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},e._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),o=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=o){var n=this._targets[this._targets.length-1];this._activeTarget!==n&&this._activate(n)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var i=this._offsets.length;i--;)this._activeTarget!==this._targets[i]&&t>=this._offsets[i]&&(void 0===this._offsets[i+1]||t li > .active",Ao=function(){function t(t){this._element=t}var e=t.prototype;return e.show=function(){var t=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&i.default(this._element).hasClass(Oo)||i.default(this._element).hasClass("disabled"))){var e,o,n=i.default(this._element).closest(".nav, .list-group")[0],r=p.getSelectorFromElement(this._element);if(n){var s="UL"===n.nodeName||"OL"===n.nodeName?Do:No;o=(o=i.default.makeArray(i.default(n).find(s)))[o.length-1]}var l=i.default.Event("hide.bs.tab",{relatedTarget:this._element}),a=i.default.Event("show.bs.tab",{relatedTarget:o});if(o&&i.default(o).trigger(l),i.default(this._element).trigger(a),!a.isDefaultPrevented()&&!l.isDefaultPrevented()){r&&(e=document.querySelector(r)),this._activate(this._element,n);var c=function(){var e=i.default.Event("hidden.bs.tab",{relatedTarget:t._element}),n=i.default.Event("shown.bs.tab",{relatedTarget:o});i.default(o).trigger(e),i.default(t._element).trigger(n)};e?this._activate(e,e.parentNode,c):c()}}},e.dispose=function(){i.default.removeData(this._element,Io),this._element=null},e._activate=function(t,e,o){var n=this,r=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?i.default(e).children(No):i.default(e).find(Do))[0],s=o&&r&&i.default(r).hasClass(Ro),l=function(){return n._transitionComplete(t,r,o)};if(r&&s){var a=p.getTransitionDurationFromElement(r);i.default(r).removeClass(Bo).one(p.TRANSITION_END,l).emulateTransitionEnd(a)}else l()},e._transitionComplete=function(t,e,o){if(e){i.default(e).removeClass(Oo);var n=i.default(e.parentNode).find("> .dropdown-menu .active")[0];n&&i.default(n).removeClass(Oo),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}i.default(t).addClass(Oo),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),p.reflow(t),t.classList.contains(Ro)&&t.classList.add(Bo);var r=t.parentNode;if(r&&"LI"===r.nodeName&&(r=r.parentNode),r&&i.default(r).hasClass("dropdown-menu")){var s=i.default(t).closest(".dropdown")[0];if(s){var l=[].slice.call(s.querySelectorAll(".dropdown-toggle"));i.default(l).addClass(Oo)}t.setAttribute("aria-expanded",!0)}o&&o()},t._jQueryInterface=function(e){return this.each((function(){var o=i.default(this),n=o.data(Io);if(n||(n=new t(this),o.data(Io,n)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}}))},s(t,null,[{key:"VERSION",get:function(){return"4.6.1"}}]),t}();i.default(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),Ao._jQueryInterface.call(i.default(this),"show")})),i.default.fn.tab=Ao._jQueryInterface,i.default.fn.tab.Constructor=Ao,i.default.fn.tab.noConflict=function(){return i.default.fn.tab=Co,Ao._jQueryInterface};var xo="toast",wo="bs.toast",Mo=i.default.fn.toast,Lo="hide",$o="show",Po="showing",Fo="click.dismiss.bs.toast",Uo={animation:!0,autohide:!0,delay:500},Ho={animation:"boolean",autohide:"boolean",delay:"number"},Go=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var e=t.prototype;return e.show=function(){var t=this,e=i.default.Event("show.bs.toast");if(i.default(this._element).trigger(e),!e.isDefaultPrevented()){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var o=function(){t._element.classList.remove(Po),t._element.classList.add($o),i.default(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove(Lo),p.reflow(this._element),this._element.classList.add(Po),this._config.animation){var n=p.getTransitionDurationFromElement(this._element);i.default(this._element).one(p.TRANSITION_END,o).emulateTransitionEnd(n)}else o()}},e.hide=function(){if(this._element.classList.contains($o)){var t=i.default.Event("hide.bs.toast");i.default(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},e.dispose=function(){this._clearTimeout(),this._element.classList.contains($o)&&this._element.classList.remove($o),i.default(this._element).off(Fo),i.default.removeData(this._element,wo),this._element=null,this._config=null},e._getConfig=function(t){return t=l({},Uo,i.default(this._element).data(),"object"==typeof t&&t?t:{}),p.typeCheckConfig(xo,t,this.constructor.DefaultType),t},e._setListeners=function(){var t=this;i.default(this._element).on(Fo,'[data-dismiss="toast"]',(function(){return t.hide()}))},e._close=function(){var t=this,e=function(){t._element.classList.add(Lo),i.default(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove($o),this._config.animation){var o=p.getTransitionDurationFromElement(this._element);i.default(this._element).one(p.TRANSITION_END,e).emulateTransitionEnd(o)}else e()},e._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},t._jQueryInterface=function(e){return this.each((function(){var o=i.default(this),n=o.data(wo);if(n||(n=new t(this,"object"==typeof e&&e),o.data(wo,n)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e](this)}}))},s(t,null,[{key:"VERSION",get:function(){return"4.6.1"}},{key:"DefaultType",get:function(){return Ho}},{key:"Default",get:function(){return Uo}}]),t}();i.default.fn.toast=Go._jQueryInterface,i.default.fn.toast.Constructor=Go,i.default.fn.toast.noConflict=function(){return i.default.fn.toast=Mo,Go._jQueryInterface},t.Alert=_,t.Button=v,t.Carousel=w,t.Collapse=X,t.Dropdown=fe,t.Modal=Le,t.Popover=ho,t.Scrollspy=bo,t.Tab=Ao,t.Toast=Go,t.Tooltip=no,t.Util=p,Object.defineProperty(t,"__esModule",{value:!0})}(e,o(9755))},9662:(t,e,o)=>{var n=o(7854),i=o(614),r=o(6330),s=n.TypeError;t.exports=function(t){if(i(t))return t;throw s(r(t)+" is not a function")}},9483:(t,e,o)=>{var n=o(7854),i=o(4411),r=o(6330),s=n.TypeError;t.exports=function(t){if(i(t))return t;throw s(r(t)+" is not a constructor")}},6077:(t,e,o)=>{var n=o(7854),i=o(614),r=n.String,s=n.TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw s("Can't set "+r(t)+" as a prototype")}},1223:(t,e,o)=>{var n=o(5112),i=o(30),r=o(3070),s=n("unscopables"),l=Array.prototype;null==l[s]&&r.f(l,s,{configurable:!0,value:i(null)}),t.exports=function(t){l[s][t]=!0}},1530:(t,e,o)=>{"use strict";var n=o(8710).charAt;t.exports=function(t,e,o){return e+(o?n(t,e).length:1)}},5787:(t,e,o)=>{var n=o(7854),i=o(7976),r=n.TypeError;t.exports=function(t,e){if(i(e,t))return t;throw r("Incorrect invocation")}},9670:(t,e,o)=>{var n=o(7854),i=o(111),r=n.String,s=n.TypeError;t.exports=function(t){if(i(t))return t;throw s(r(t)+" is not an object")}},1318:(t,e,o)=>{var n=o(5656),i=o(1400),r=o(6244),s=function(t){return function(e,o,s){var l,a=n(e),c=r(a),u=i(s,c);if(t&&o!=o){for(;c>u;)if((l=a[u++])!=l)return!0}else for(;c>u;u++)if((t||u in a)&&a[u]===o)return t||u||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},206:(t,e,o)=>{var n=o(1702);t.exports=n([].slice)},7072:(t,e,o)=>{var n=o(5112)("iterator"),i=!1;try{var r=0,s={next:function(){return{done:!!r++}},return:function(){i=!0}};s[n]=function(){return this},Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var o=!1;try{var r={};r[n]=function(){return{next:function(){return{done:o=!0}}}},t(r)}catch(t){}return o}},4326:(t,e,o)=>{var n=o(1702),i=n({}.toString),r=n("".slice);t.exports=function(t){return r(i(t),8,-1)}},648:(t,e,o)=>{var n=o(7854),i=o(1694),r=o(614),s=o(4326),l=o(5112)("toStringTag"),a=n.Object,c="Arguments"==s(function(){return arguments}());t.exports=i?s:function(t){var e,o,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(o=function(t,e){try{return t[e]}catch(t){}}(e=a(t),l))?o:c?s(e):"Object"==(n=s(e))&&r(e.callee)?"Arguments":n}},9920:(t,e,o)=>{var n=o(2597),i=o(3887),r=o(1236),s=o(3070);t.exports=function(t,e,o){for(var l=i(e),a=s.f,c=r.f,u=0;u{var n=o(5112)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(o){try{return e[n]=!1,"/./"[t](e)}catch(t){}}return!1}},8544:(t,e,o)=>{var n=o(7293);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},4994:(t,e,o)=>{"use strict";var n=o(3383).IteratorPrototype,i=o(30),r=o(9114),s=o(8003),l=o(7497),a=function(){return this};t.exports=function(t,e,o,c){var u=e+" Iterator";return t.prototype=i(n,{next:r(+!c,o)}),s(t,u,!1,!0),l[u]=a,t}},8880:(t,e,o)=>{var n=o(9781),i=o(3070),r=o(9114);t.exports=n?function(t,e,o){return i.f(t,e,r(1,o))}:function(t,e,o){return t[e]=o,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},654:(t,e,o)=>{"use strict";var n=o(2109),i=o(6916),r=o(1913),s=o(6530),l=o(614),a=o(4994),c=o(9518),u=o(7674),p=o(8003),h=o(8880),d=o(1320),_=o(5112),g=o(7497),f=o(3383),m=s.PROPER,y=s.CONFIGURABLE,T=f.IteratorPrototype,E=f.BUGGY_SAFARI_ITERATORS,v=_("iterator"),k="keys",S="values",b="entries",I=function(){return this};t.exports=function(t,e,o,s,_,f,C){a(o,e,s);var O,R,B,N=function(t){if(t===_&&M)return M;if(!E&&t in x)return x[t];switch(t){case k:case S:case b:return function(){return new o(this,t)}}return function(){return new o(this)}},D=e+" Iterator",A=!1,x=t.prototype,w=x[v]||x["@@iterator"]||_&&x[_],M=!E&&w||N(_),L="Array"==e&&x.entries||w;if(L&&(O=c(L.call(new t)))!==Object.prototype&&O.next&&(r||c(O)===T||(u?u(O,T):l(O[v])||d(O,v,I)),p(O,D,!0,!0),r&&(g[D]=I)),m&&_==S&&w&&w.name!==S&&(!r&&y?h(x,"name",S):(A=!0,M=function(){return i(w,this)})),_)if(R={values:N(S),keys:f?M:N(k),entries:N(b)},C)for(B in R)(E||A||!(B in x))&&d(x,B,R[B]);else n({target:e,proto:!0,forced:E||A},R);return r&&!C||x[v]===M||d(x,v,M,{name:_}),g[e]=M,R}},9781:(t,e,o)=>{var n=o(7293);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,e,o)=>{var n=o(7854),i=o(111),r=n.document,s=i(r)&&i(r.createElement);t.exports=function(t){return s?r.createElement(t):{}}},8324:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(t,e,o)=>{var n=o(317)("span").classList,i=n&&n.constructor&&n.constructor.prototype;t.exports=i===Object.prototype?void 0:i},7871:t=>{t.exports="object"==typeof window},1528:(t,e,o)=>{var n=o(8113),i=o(7854);t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==i.Pebble},6833:(t,e,o)=>{var n=o(8113);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:(t,e,o)=>{var n=o(4326),i=o(7854);t.exports="process"==n(i.process)},1036:(t,e,o)=>{var n=o(8113);t.exports=/web0s(?!.*chrome)/i.test(n)},8113:(t,e,o)=>{var n=o(5005);t.exports=n("navigator","userAgent")||""},7392:(t,e,o)=>{var n,i,r=o(7854),s=o(8113),l=r.process,a=r.Deno,c=l&&l.versions||a&&a.version,u=c&&c.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(i=+n[1]),t.exports=i},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,e,o)=>{var n=o(7854),i=o(1236).f,r=o(8880),s=o(1320),l=o(3505),a=o(9920),c=o(4705);t.exports=function(t,e){var o,u,p,h,d,_=t.target,g=t.global,f=t.stat;if(o=g?n:f?n[_]||l(_,{}):(n[_]||{}).prototype)for(u in e){if(h=e[u],p=t.noTargetGet?(d=i(o,u))&&d.value:o[u],!c(g?u:_+(f?".":"#")+u,t.forced)&&void 0!==p){if(typeof h==typeof p)continue;a(h,p)}(t.sham||p&&p.sham)&&r(h,"sham",!0),s(o,u,h,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:(t,e,o)=>{"use strict";o(4916);var n=o(1702),i=o(1320),r=o(2261),s=o(7293),l=o(5112),a=o(8880),c=l("species"),u=RegExp.prototype;t.exports=function(t,e,o,p){var h=l(t),d=!s((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),_=d&&!s((function(){var e=!1,o=/a/;return"split"===t&&((o={}).constructor={},o.constructor[c]=function(){return o},o.flags="",o[h]=/./[h]),o.exec=function(){return e=!0,null},o[h](""),!e}));if(!d||!_||o){var g=n(/./[h]),f=e(h,""[t],(function(t,e,o,i,s){var l=n(t),a=e.exec;return a===r||a===u.exec?d&&!s?{done:!0,value:g(e,o,i)}:{done:!0,value:l(o,e,i)}:{done:!1}}));i(String.prototype,t,f[0]),i(u,h,f[1])}p&&a(u[h],"sham",!0)}},2104:(t,e,o)=>{var n=o(4374),i=Function.prototype,r=i.apply,s=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(r):function(){return s.apply(r,arguments)})},9974:(t,e,o)=>{var n=o(1702),i=o(9662),r=o(4374),s=n(n.bind);t.exports=function(t,e){return i(t),void 0===e?t:r?s(t,e):function(){return t.apply(e,arguments)}}},4374:(t,e,o)=>{var n=o(7293);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,e,o)=>{var n=o(4374),i=Function.prototype.call;t.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},6530:(t,e,o)=>{var n=o(9781),i=o(2597),r=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,l=i(r,"name"),a=l&&"something"===function(){}.name,c=l&&(!n||n&&s(r,"name").configurable);t.exports={EXISTS:l,PROPER:a,CONFIGURABLE:c}},1702:(t,e,o)=>{var n=o(4374),i=Function.prototype,r=i.bind,s=i.call,l=n&&r.bind(s,s);t.exports=n?function(t){return t&&l(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},5005:(t,e,o)=>{var n=o(7854),i=o(614),r=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?r(n[t]):n[t]&&n[t][e]}},1246:(t,e,o)=>{var n=o(648),i=o(8173),r=o(7497),s=o(5112)("iterator");t.exports=function(t){if(null!=t)return i(t,s)||i(t,"@@iterator")||r[n(t)]}},8554:(t,e,o)=>{var n=o(7854),i=o(6916),r=o(9662),s=o(9670),l=o(6330),a=o(1246),c=n.TypeError;t.exports=function(t,e){var o=arguments.length<2?a(t):e;if(r(o))return s(i(o,t));throw c(l(t)+" is not iterable")}},8173:(t,e,o)=>{var n=o(9662);t.exports=function(t,e){var o=t[e];return null==o?void 0:n(o)}},647:(t,e,o)=>{var n=o(1702),i=o(7908),r=Math.floor,s=n("".charAt),l=n("".replace),a=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,o,n,p,h){var d=o+t.length,_=n.length,g=u;return void 0!==p&&(p=i(p),g=c),l(h,g,(function(i,l){var c;switch(s(l,0)){case"$":return"$";case"&":return t;case"`":return a(e,0,o);case"'":return a(e,d);case"<":c=p[a(l,1,-1)];break;default:var u=+l;if(0===u)return i;if(u>_){var h=r(u/10);return 0===h?i:h<=_?void 0===n[h-1]?s(l,1):n[h-1]+s(l,1):i}c=n[u-1]}return void 0===c?"":c}))}},7854:(t,e,o)=>{var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof o.g&&o.g)||function(){return this}()||Function("return this")()},2597:(t,e,o)=>{var n=o(1702),i=o(7908),r=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return r(i(t),e)}},3501:t=>{t.exports={}},842:(t,e,o)=>{var n=o(7854);t.exports=function(t,e){var o=n.console;o&&o.error&&(1==arguments.length?o.error(t):o.error(t,e))}},490:(t,e,o)=>{var n=o(5005);t.exports=n("document","documentElement")},4664:(t,e,o)=>{var n=o(9781),i=o(7293),r=o(317);t.exports=!n&&!i((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},8361:(t,e,o)=>{var n=o(7854),i=o(1702),r=o(7293),s=o(4326),l=n.Object,a=i("".split);t.exports=r((function(){return!l("z").propertyIsEnumerable(0)}))?function(t){return"String"==s(t)?a(t,""):l(t)}:l},2788:(t,e,o)=>{var n=o(1702),i=o(614),r=o(5465),s=n(Function.toString);i(r.inspectSource)||(r.inspectSource=function(t){return s(t)}),t.exports=r.inspectSource},9909:(t,e,o)=>{var n,i,r,s=o(8536),l=o(7854),a=o(1702),c=o(111),u=o(8880),p=o(2597),h=o(5465),d=o(6200),_=o(3501),g="Object already initialized",f=l.TypeError,m=l.WeakMap;if(s||h.state){var y=h.state||(h.state=new m),T=a(y.get),E=a(y.has),v=a(y.set);n=function(t,e){if(E(y,t))throw new f(g);return e.facade=t,v(y,t,e),e},i=function(t){return T(y,t)||{}},r=function(t){return E(y,t)}}else{var k=d("state");_[k]=!0,n=function(t,e){if(p(t,k))throw new f(g);return e.facade=t,u(t,k,e),e},i=function(t){return p(t,k)?t[k]:{}},r=function(t){return p(t,k)}}t.exports={set:n,get:i,has:r,enforce:function(t){return r(t)?i(t):n(t,{})},getterFor:function(t){return function(e){var o;if(!c(e)||(o=i(e)).type!==t)throw f("Incompatible receiver, "+t+" required");return o}}}},7659:(t,e,o)=>{var n=o(5112),i=o(7497),r=n("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||s[r]===t)}},614:t=>{t.exports=function(t){return"function"==typeof t}},4411:(t,e,o)=>{var n=o(1702),i=o(7293),r=o(614),s=o(648),l=o(5005),a=o(2788),c=function(){},u=[],p=l("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=n(h.exec),_=!h.exec(c),g=function(t){if(!r(t))return!1;try{return p(c,u,t),!0}catch(t){return!1}},f=function(t){if(!r(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _||!!d(h,a(t))}catch(t){return!0}};f.sham=!0,t.exports=!p||i((function(){var t;return g(g.call)||!g(Object)||!g((function(){t=!0}))||t}))?f:g},4705:(t,e,o)=>{var n=o(7293),i=o(614),r=/#|\.prototype\./,s=function(t,e){var o=a[l(t)];return o==u||o!=c&&(i(e)?n(e):!!e)},l=s.normalize=function(t){return String(t).replace(r,".").toLowerCase()},a=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";t.exports=s},111:(t,e,o)=>{var n=o(614);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},1913:t=>{t.exports=!1},7850:(t,e,o)=>{var n=o(111),i=o(4326),r=o(5112)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[r])?!!e:"RegExp"==i(t))}},2190:(t,e,o)=>{var n=o(7854),i=o(5005),r=o(614),s=o(7976),l=o(3307),a=n.Object;t.exports=l?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return r(e)&&s(e.prototype,a(t))}},408:(t,e,o)=>{var n=o(7854),i=o(9974),r=o(6916),s=o(9670),l=o(6330),a=o(7659),c=o(6244),u=o(7976),p=o(8554),h=o(1246),d=o(9212),_=n.TypeError,g=function(t,e){this.stopped=t,this.result=e},f=g.prototype;t.exports=function(t,e,o){var n,m,y,T,E,v,k,S=o&&o.that,b=!(!o||!o.AS_ENTRIES),I=!(!o||!o.IS_ITERATOR),C=!(!o||!o.INTERRUPTED),O=i(e,S),R=function(t){return n&&d(n,"normal",t),new g(!0,t)},B=function(t){return b?(s(t),C?O(t[0],t[1],R):O(t[0],t[1])):C?O(t,R):O(t)};if(I)n=t;else{if(!(m=h(t)))throw _(l(t)+" is not iterable");if(a(m)){for(y=0,T=c(t);T>y;y++)if((E=B(t[y]))&&u(f,E))return E;return new g(!1)}n=p(t,m)}for(v=n.next;!(k=r(v,n)).done;){try{E=B(k.value)}catch(t){d(n,"throw",t)}if("object"==typeof E&&E&&u(f,E))return E}return new g(!1)}},9212:(t,e,o)=>{var n=o(6916),i=o(9670),r=o(8173);t.exports=function(t,e,o){var s,l;i(t);try{if(!(s=r(t,"return"))){if("throw"===e)throw o;return o}s=n(s,t)}catch(t){l=!0,s=t}if("throw"===e)throw o;if(l)throw s;return i(s),o}},3383:(t,e,o)=>{"use strict";var n,i,r,s=o(7293),l=o(614),a=o(30),c=o(9518),u=o(1320),p=o(5112),h=o(1913),d=p("iterator"),_=!1;[].keys&&("next"in(r=[].keys())?(i=c(c(r)))!==Object.prototype&&(n=i):_=!0),null==n||s((function(){var t={};return n[d].call(t)!==t}))?n={}:h&&(n=a(n)),l(n[d])||u(n,d,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:_}},7497:t=>{t.exports={}},6244:(t,e,o)=>{var n=o(7466);t.exports=function(t){return n(t.length)}},5948:(t,e,o)=>{var n,i,r,s,l,a,c,u,p=o(7854),h=o(9974),d=o(1236).f,_=o(261).set,g=o(6833),f=o(1528),m=o(1036),y=o(5268),T=p.MutationObserver||p.WebKitMutationObserver,E=p.document,v=p.process,k=p.Promise,S=d(p,"queueMicrotask"),b=S&&S.value;b||(n=function(){var t,e;for(y&&(t=v.domain)&&t.exit();i;){e=i.fn,i=i.next;try{e()}catch(t){throw i?s():r=void 0,t}}r=void 0,t&&t.enter()},g||y||m||!T||!E?!f&&k&&k.resolve?((c=k.resolve(void 0)).constructor=k,u=h(c.then,c),s=function(){u(n)}):y?s=function(){v.nextTick(n)}:(_=h(_,p),s=function(){_(n)}):(l=!0,a=E.createTextNode(""),new T(n).observe(a,{characterData:!0}),s=function(){a.data=l=!l})),t.exports=b||function(t){var e={fn:t,next:void 0};r&&(r.next=e),i||(i=e,s()),r=e}},3366:(t,e,o)=>{var n=o(7854);t.exports=n.Promise},133:(t,e,o)=>{var n=o(7392),i=o(7293);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(t,e,o)=>{var n=o(7854),i=o(614),r=o(2788),s=n.WeakMap;t.exports=i(s)&&/native code/.test(r(s))},8523:(t,e,o)=>{"use strict";var n=o(9662),i=function(t){var e,o;this.promise=new t((function(t,n){if(void 0!==e||void 0!==o)throw TypeError("Bad Promise constructor");e=t,o=n})),this.resolve=n(e),this.reject=n(o)};t.exports.f=function(t){return new i(t)}},3929:(t,e,o)=>{var n=o(7854),i=o(7850),r=n.TypeError;t.exports=function(t){if(i(t))throw r("The method doesn't accept regular expressions");return t}},2814:(t,e,o)=>{var n=o(7854),i=o(7293),r=o(1702),s=o(1340),l=o(3111).trim,a=o(1361),c=r("".charAt),u=n.parseFloat,p=n.Symbol,h=p&&p.iterator,d=1/u(a+"-0")!=-1/0||h&&!i((function(){u(Object(h))}));t.exports=d?function(t){var e=l(s(t)),o=u(e);return 0===o&&"-"==c(e,0)?-0:o}:u},1574:(t,e,o)=>{"use strict";var n=o(9781),i=o(1702),r=o(6916),s=o(7293),l=o(1956),a=o(5181),c=o(5296),u=o(7908),p=o(8361),h=Object.assign,d=Object.defineProperty,_=i([].concat);t.exports=!h||s((function(){if(n&&1!==h({b:1},h(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},o=Symbol(),i="abcdefghijklmnopqrst";return t[o]=7,i.split("").forEach((function(t){e[t]=t})),7!=h({},t)[o]||l(h({},e)).join("")!=i}))?function(t,e){for(var o=u(t),i=arguments.length,s=1,h=a.f,d=c.f;i>s;)for(var g,f=p(arguments[s++]),m=h?_(l(f),h(f)):l(f),y=m.length,T=0;y>T;)g=m[T++],n&&!r(d,f,g)||(o[g]=f[g]);return o}:h},30:(t,e,o)=>{var n,i=o(9670),r=o(6048),s=o(748),l=o(3501),a=o(490),c=o(317),u=o(6200)("IE_PROTO"),p=function(){},h=function(t){return" + + - - - \ No newline at end of file + + + + + diff --git a/catroid/src/main/assets/catblocks/main.css b/catroid/src/main/assets/catblocks/main.css index 1f602a4eb71..78a4598bd52 100644 --- a/catroid/src/main/assets/catblocks/main.css +++ b/catroid/src/main/assets/catblocks/main.css @@ -66,6 +66,94 @@ body { width: 100%; } +#catroid-catblocks-add-brick-dialog { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + z-index: 9999; + background-color: white; +} + +#catroid-catblocks-add-brick-dialog-header { + position: absolute; + top: 0; + left: 0; + right: 0; + height: 50px; +} + +#catroid-catblocks-add-brick-dialog-content { + position: absolute; + top: 50px; + bottom: 0; + left: 0; + right: 0; + overflow-x: auto; +} + +#catroid-catblocks-bricks-container { + width: 90%; + margin-left: 5%; + margin-right: 5%; +} + +.catblocks-svg-brick-container { + width: 100%; + background-color: white; + overflow-y: hidden; + overflow-x: auto; +} + +.catblocks-svg-brick-container > svg { + width: 100%; +} + +#catroid-catblocks-add-brick-dialog-header-content-container { + position: absolute; + top: 0; + left: 10px; + right: 50px; + height: 50px; + + display: flex; + /*justify-content: center;*/ + align-items: center; +} + +#catroid-catblocks-add-brick-dialog-close-container { + position: absolute; + top: 0; + right: 0; + width: 50px; + height: 50px; + + display: flex; + justify-content: center; + align-items: center; +} + +#catroid-catblocks-add-brick-dialog-header-text { + margin-bottom: 0; +} + +#catroid-catblocks-add-brick-text-container { + vertical-align: middle; +} + +#catroid-catblocks-add-brick-back-container { + vertical-align: middle; +} + +.catblocks-brick { + margin-bottom: 5px; +} + +.catblocks-brick:first-of-type { + margin-top: 5px; +} + /*! * Bootstrap v4.6.1 (https://getbootstrap.com/) * Copyright 2011-2021 The Bootstrap Authors diff --git a/catroid/src/main/assets/catblocks/media/arrow_back_ios_black_24dp.svg b/catroid/src/main/assets/catblocks/media/arrow_back_ios_black_24dp.svg new file mode 100644 index 00000000000..ad6cf7320c0 --- /dev/null +++ b/catroid/src/main/assets/catblocks/media/arrow_back_ios_black_24dp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/catroid/src/main/assets/catblocks/media/arrow_back_ios_black_36dp.svg b/catroid/src/main/assets/catblocks/media/arrow_back_ios_black_36dp.svg new file mode 100644 index 00000000000..964a7d6358c --- /dev/null +++ b/catroid/src/main/assets/catblocks/media/arrow_back_ios_black_36dp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/catroid/src/main/assets/catblocks/media/close_black_36dp.svg b/catroid/src/main/assets/catblocks/media/close_black_36dp.svg new file mode 100644 index 00000000000..732175db2b6 --- /dev/null +++ b/catroid/src/main/assets/catblocks/media/close_black_36dp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.kt b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.kt index 76d2fbad5c5..2c9ab0b35db 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.kt +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryFragment.kt @@ -24,7 +24,6 @@ package org.catrobat.catroid.ui.fragment import android.content.Context import android.os.Bundle -import android.preference.PreferenceManager import android.view.LayoutInflater import android.view.Menu import android.view.MenuItem @@ -34,7 +33,6 @@ import android.widget.AdapterView import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager import androidx.fragment.app.ListFragment -import org.catrobat.catroid.ProjectManager import org.catrobat.catroid.R import org.catrobat.catroid.ui.BottomBar.hideBottomBar import org.catrobat.catroid.ui.BottomBar.showBottomBar @@ -44,11 +42,7 @@ import org.catrobat.catroid.ui.ViewSwitchLock import org.catrobat.catroid.ui.adapter.BrickCategoryAdapter import org.catrobat.catroid.ui.addTabLayout import org.catrobat.catroid.ui.removeTabLayout -import org.catrobat.catroid.ui.settingsfragments.AccessibilityProfile -import org.catrobat.catroid.ui.settingsfragments.RaspberryPiSettingsFragment -import org.catrobat.catroid.ui.settingsfragments.SettingsFragment import org.catrobat.catroid.utils.SnackbarUtil -import java.util.ArrayList import java.util.concurrent.locks.Lock class BrickCategoryFragment : ListFragment() { @@ -65,8 +59,6 @@ class BrickCategoryFragment : ListFragment() { scriptFragment = listener } - private fun onlyBeginnerBricks(): Boolean = PreferenceManager.getDefaultSharedPreferences(activity).getBoolean(AccessibilityProfile.BEGINNER_BRICKS, false) - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val isRestoringPreviouslyDestroyedActivity = savedInstanceState != null @@ -141,55 +133,9 @@ class BrickCategoryFragment : ListFragment() { @SuppressWarnings("ComplexMethod") private fun setupBrickCategories() { - val inflater = requireActivity().layoutInflater - val categories: MutableList = ArrayList() - - categories.add(inflater.inflate(R.layout.brick_category_recently_used, null)) + val brickCategoryFactory = BrickCategoryListBuilder(requireActivity()) + val categories = brickCategoryFactory.getBrickCategoryViews() - if (SettingsFragment.isEmroiderySharedPreferenceEnabled(activity)) { - categories.add(inflater.inflate(R.layout.brick_category_embroidery, null)) - } - if (SettingsFragment.isMindstormsNXTSharedPreferenceEnabled(activity)) { - categories.add(inflater.inflate(R.layout.brick_category_lego_nxt, null)) - } - if (SettingsFragment.isMindstormsEV3SharedPreferenceEnabled(activity)) { - categories.add(inflater.inflate(R.layout.brick_category_lego_ev3, null)) - } - if (SettingsFragment.isDroneSharedPreferenceEnabled(activity)) { - categories.add(inflater.inflate(R.layout.brick_category_drone, null)) - } - if (SettingsFragment.isJSSharedPreferenceEnabled(activity)) { - categories.add(inflater.inflate(R.layout.brick_category_drone_js, null)) - } - if (SettingsFragment.isArduinoSharedPreferenceEnabled(activity)) { - categories.add(inflater.inflate(R.layout.brick_category_arduino, null)) - } - if (RaspberryPiSettingsFragment.isRaspiSharedPreferenceEnabled(activity)) { - categories.add(inflater.inflate(R.layout.brick_category_raspi, null)) - } - if (SettingsFragment.isPhiroSharedPreferenceEnabled(activity)) { - categories.add(inflater.inflate(R.layout.brick_category_phiro, null)) - } - if (ProjectManager.getInstance().currentProject.isCastProject) { - categories.add(inflater.inflate(R.layout.brick_category_chromecast, null)) - } - - categories.add(inflater.inflate(R.layout.brick_category_event, null)) - categories.add(inflater.inflate(R.layout.brick_category_control, null)) - categories.add(inflater.inflate(R.layout.brick_category_motion, null)) - categories.add(inflater.inflate(R.layout.brick_category_sound, null)) - categories.add(inflater.inflate(R.layout.brick_category_looks, null)) - if (!onlyBeginnerBricks()) { - categories.add(inflater.inflate(R.layout.brick_category_pen, null)) - } - categories.add(inflater.inflate(R.layout.brick_category_data, null)) - categories.add(inflater.inflate(R.layout.brick_category_device, null)) - if (!onlyBeginnerBricks()) { - categories.add(inflater.inflate(R.layout.brick_category_userbrick, null)) - } - if (SettingsFragment.isTestSharedPreferenceEnabled(activity)) { - categories.add(inflater.inflate(R.layout.brick_category_assert, null)) - } adapter = BrickCategoryAdapter(categories) listAdapter = adapter } diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryListBuilder.kt b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryListBuilder.kt new file mode 100644 index 00000000000..b21629094c1 --- /dev/null +++ b/catroid/src/main/java/org/catrobat/catroid/ui/fragment/BrickCategoryListBuilder.kt @@ -0,0 +1,109 @@ +/* + * Catroid: An on-device visual programming system for Android devices + * Copyright (C) 2010-2022 The Catrobat Team + * () + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * An additional term exception under section 7 of the GNU Affero + * General Public License, version 3, is available at + * http://developer.catrobat.org/license_additional_term + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.catrobat.catroid.ui.fragment + +import android.preference.PreferenceManager +import android.view.View +import androidx.fragment.app.FragmentActivity +import org.catrobat.catroid.ProjectManager +import org.catrobat.catroid.R +import org.catrobat.catroid.ui.adapter.BrickCategoryAdapter +import org.catrobat.catroid.ui.settingsfragments.AccessibilityProfile +import org.catrobat.catroid.ui.settingsfragments.RaspberryPiSettingsFragment +import org.catrobat.catroid.ui.settingsfragments.SettingsFragment +import java.util.ArrayList + +class BrickCategoryListBuilder(private val activity: FragmentActivity) { + + private fun onlyBeginnerBricks(): Boolean = PreferenceManager.getDefaultSharedPreferences(activity).getBoolean( + AccessibilityProfile.BEGINNER_BRICKS, false) + + fun getBrickCategoryViews(): MutableList { + val categories: MutableList = ArrayList() + val inflater = activity.layoutInflater + + categories.add(inflater.inflate(R.layout.brick_category_recently_used, null)) + + if (SettingsFragment.isEmroiderySharedPreferenceEnabled(activity)) { + categories.add(inflater.inflate(R.layout.brick_category_embroidery, null)) + } + if (SettingsFragment.isMindstormsNXTSharedPreferenceEnabled(activity)) { + categories.add(inflater.inflate(R.layout.brick_category_lego_nxt, null)) + } + if (SettingsFragment.isMindstormsEV3SharedPreferenceEnabled(activity)) { + categories.add(inflater.inflate(R.layout.brick_category_lego_ev3, null)) + } + if (SettingsFragment.isDroneSharedPreferenceEnabled(activity)) { + categories.add(inflater.inflate(R.layout.brick_category_drone, null)) + } + if (SettingsFragment.isJSSharedPreferenceEnabled(activity)) { + categories.add(inflater.inflate(R.layout.brick_category_drone_js, null)) + } + if (SettingsFragment.isArduinoSharedPreferenceEnabled(activity)) { + categories.add(inflater.inflate(R.layout.brick_category_arduino, null)) + } + if (RaspberryPiSettingsFragment.isRaspiSharedPreferenceEnabled(activity)) { + categories.add(inflater.inflate(R.layout.brick_category_raspi, null)) + } + if (SettingsFragment.isPhiroSharedPreferenceEnabled(activity)) { + categories.add(inflater.inflate(R.layout.brick_category_phiro, null)) + } + if (ProjectManager.getInstance().currentProject.isCastProject) { + categories.add(inflater.inflate(R.layout.brick_category_chromecast, null)) + } + + categories.add(inflater.inflate(R.layout.brick_category_event, null)) + categories.add(inflater.inflate(R.layout.brick_category_control, null)) + categories.add(inflater.inflate(R.layout.brick_category_motion, null)) + categories.add(inflater.inflate(R.layout.brick_category_sound, null)) + categories.add(inflater.inflate(R.layout.brick_category_looks, null)) + + if (!onlyBeginnerBricks()) { + categories.add(inflater.inflate(R.layout.brick_category_pen, null)) + } + + categories.add(inflater.inflate(R.layout.brick_category_data, null)) + categories.add(inflater.inflate(R.layout.brick_category_device, null)) + + if (!onlyBeginnerBricks()) { + categories.add(inflater.inflate(R.layout.brick_category_userbrick, null)) + } + if (SettingsFragment.isTestSharedPreferenceEnabled(activity)) { + categories.add(inflater.inflate(R.layout.brick_category_assert, null)) + } + + return categories + } + + fun getCategoryNames(): List { + val categoryNames = arrayListOf() + + val brickCategoryAdapter = BrickCategoryAdapter(getBrickCategoryViews()) + for (categoryIndex in 0 until brickCategoryAdapter.count) { + categoryNames.add(brickCategoryAdapter.getItem(categoryIndex)) + } + + return categoryNames + } +} diff --git a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CatblocksScriptFragment.kt b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CatblocksScriptFragment.kt index 9e5f06ac479..27910250efa 100644 --- a/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CatblocksScriptFragment.kt +++ b/catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/CatblocksScriptFragment.kt @@ -25,6 +25,7 @@ package org.catrobat.catroid.ui.recyclerview.fragment import android.annotation.SuppressLint import android.os.Bundle +import android.util.Log import android.view.LayoutInflater import android.view.Menu import android.view.MenuItem @@ -37,7 +38,6 @@ import android.webkit.WebResourceResponse import android.webkit.WebView import android.webkit.WebViewClient import androidx.fragment.app.Fragment -import androidx.fragment.app.ListFragment import androidx.webkit.WebViewAssetLoader import com.google.gson.Gson import org.catrobat.catroid.BuildConfig @@ -46,12 +46,13 @@ import org.catrobat.catroid.R import org.catrobat.catroid.content.bricks.Brick import org.catrobat.catroid.content.bricks.EmptyEventBrick import org.catrobat.catroid.content.bricks.ScriptBrick +import org.catrobat.catroid.content.bricks.UserDefinedBrick +import org.catrobat.catroid.content.bricks.UserDefinedReceiverBrick import org.catrobat.catroid.io.XstreamSerializer import org.catrobat.catroid.ui.BottomBar -import org.catrobat.catroid.ui.fragment.AddBrickFragment -import org.catrobat.catroid.ui.fragment.BrickCategoryFragment -import org.catrobat.catroid.ui.fragment.BrickCategoryFragment.OnCategorySelectedListener -import org.catrobat.catroid.ui.fragment.UserDefinedBrickListFragment +import org.catrobat.catroid.ui.controller.RecentBrickListManager +import org.catrobat.catroid.ui.fragment.BrickCategoryListBuilder +import org.catrobat.catroid.ui.fragment.CategoryBricksFactory import org.catrobat.catroid.ui.settingsfragments.SettingsFragment import org.json.JSONArray import org.koin.java.KoinJavaComponent.inject @@ -60,7 +61,7 @@ import java.util.UUID class CatblocksScriptFragment( private val brickAtTopID: UUID? -) : Fragment(), OnCategorySelectedListener, AddBrickFragment.OnAddBrickListener { +) : Fragment() { private var webview: WebView? = null @@ -134,13 +135,9 @@ class CatblocksScriptFragment( catblocksWebView.loadUrl("https://appassets.androidplatform.net/assets/catblocks/index.html") } - inner class SwitchTo1DHelper() : Runnable, ValueCallback { + inner class SwitchTo1DHelper : Runnable, ValueCallback { var brickToFocus: Brick? = null - constructor(brickToFocus: Brick?) : this() { - this.brickToFocus = brickToFocus - } - override fun run() { SettingsFragment.setUseCatBlocks(context, false) @@ -306,7 +303,8 @@ class CatblocksScriptFragment( val foundBrick = projectManager.currentSprite.findBrickInSprite(brickId) if (foundBrick != null) { - val switchTo1DHelper = SwitchTo1DHelper(foundBrick) + val switchTo1DHelper = SwitchTo1DHelper() + switchTo1DHelper.brickToFocus = foundBrick activity?.runOnUiThread(switchTo1DHelper) } } @@ -352,73 +350,94 @@ class CatblocksScriptFragment( return emptyBrick.script.scriptId.toString() } } - } - fun handleAddButton() { - val brickCategoryFragment = BrickCategoryFragment() - brickCategoryFragment.setOnCategorySelectedListener(this) - - parentFragmentManager.beginTransaction() - .add( - R.id.fragment_container, - brickCategoryFragment, - BrickCategoryFragment.BRICK_CATEGORY_FRAGMENT_TAG - ) - .addToBackStack(BrickCategoryFragment.BRICK_CATEGORY_FRAGMENT_TAG) - .commit() - } + @JavascriptInterface + fun getBricksForCategory(category: String): String { + val bricksForCategory = CategoryBricksFactory().getBricks(category, projectManager + .currentSprite.isBackgroundSprite, requireContext()) - override fun onCategorySelected(category: String?) { - var addListFragment: ListFragment - var tag: String? = "" + val brickInfos = arrayListOf() + + for (brick in bricksForCategory) { + val brickType = brick.javaClass.simpleName + brickInfos.add(BrickInfoHolder(brickType, brickType)) + } - if (category == requireContext().getString(R.string.category_user_bricks)) { - addListFragment = UserDefinedBrickListFragment.newInstance(this) - tag = UserDefinedBrickListFragment.USER_DEFINED_BRICK_LIST_FRAGMENT_TAG - } else { - addListFragment = AddBrickFragment.newInstance(category, this) - tag = AddBrickFragment.ADD_BRICK_FRAGMENT_TAG + return Gson().toJson(brickInfos) } - parentFragmentManager.beginTransaction() - .add(R.id.fragment_container, addListFragment, tag) - .addToBackStack(null) - .commit() - } + @JavascriptInterface + fun addBrickByName(categoryName: String, brickName: String): String { + + val bricksOfCategory = CategoryBricksFactory().getBricks(categoryName, projectManager + .currentSprite.isBackgroundSprite, requireContext()) + + val foundBricks = bricksOfCategory.filter { it.javaClass.simpleName.equals(brickName) } + + val addedBricks = arrayListOf() + + if (foundBricks.size == 1) { + val brick = foundBricks[0].clone() + if (brick is ScriptBrick) { + projectManager.currentSprite.scriptList.add(brick.script) + + addedBricks.add(BrickInfoHolder(brick.script.scriptId.toString(), brick + .script.javaClass.simpleName)) + } else { + val emptyBrick = EmptyEventBrick() + emptyBrick.script.brickList.add(brick) + projectManager.currentSprite.scriptList.add(emptyBrick.script) + + addedBricks.add(BrickInfoHolder(emptyBrick.script.scriptId.toString(), + emptyBrick.script.javaClass.simpleName)) + + addedBricks.add(BrickInfoHolder(brick.brickID.toString(), + brick.javaClass.simpleName)) + } - override fun addBrick(brick: Brick?) { - if (brick == null) { - return + try { + if (brick.javaClass != UserDefinedReceiverBrick::class.java && + brick.javaClass != UserDefinedBrick::class.java) { + RecentBrickListManager.getInstance().addBrick(brick.clone()) + } + } catch (e: CloneNotSupportedException) { + Log.e(ScriptFragment.TAG, Log.getStackTraceString(e)) + } + } + return Gson().toJson(addedBricks) } - val addedBricks = arrayListOf() + @JavascriptInterface + fun getBrickCategoryInfos(): String { + val brickCategoryInfos = getAvailableBrickCategories() - if (brick is ScriptBrick) { - projectManager.currentSprite.scriptList.add(brick.script) - addedBricks.add( - BrickInfoHolder( - brick.script.scriptId.toString(), - brick.script.javaClass.simpleName - ) - ) - } else { - val emptyBrick = EmptyEventBrick() - emptyBrick.script.brickList.add(brick) - projectManager.currentSprite.scriptList.add(emptyBrick.script) + return Gson().toJson(brickCategoryInfos) + } + } - addedBricks.add( - BrickInfoHolder( - emptyBrick.script.scriptId.toString(), - emptyBrick.script.javaClass.simpleName - ) - ) + fun handleAddButton() { - addedBricks.add(BrickInfoHolder(brick.brickID.toString(), brick.javaClass.simpleName)) + val brickCategoryInfos = getAvailableBrickCategories() + val jsonCategoryInfos = Gson().toJson(brickCategoryInfos) + + webview!!.evaluateJavascript( + "javascript:CatBlocks.showBrickCategories($jsonCategoryInfos);", null) + } + + private fun getAvailableBrickCategories(): List { + val brickCategoryFactory = BrickCategoryListBuilder(requireActivity()) + val categoryNames = brickCategoryFactory.getCategoryNames() + + val brickCategoryInfos = arrayListOf() + + for (categoryName in categoryNames) { + brickCategoryInfos.add(BrickCategoryInfoHolder(categoryName)) } - val addedBricksString = Gson().toJson(addedBricks) - webview!!.evaluateJavascript("javascript:CatBlocks.addBricks($addedBricksString);", null) + return brickCategoryInfos } - private data class BrickInfoHolder(val brickId: String, val brickType: String) + private data class BrickCategoryInfoHolder(val name: String) + + data class BrickInfoHolder(val brickId: String, val brickType: String) }