webpackJsonp([0],{"++K3":function(t,e){var i,n,o,r,s,a,l,c,u,h,p,d,f,g,_,m=!1;function v(){if(!m){m=!0;var t=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),v=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(d=/\b(iPhone|iP[ao]d)/.exec(t),f=/\b(iP[ao]d)/.exec(t),h=/Android/i.exec(t),g=/FBAN\/\w+;/i.exec(t),_=/Mobile/i.exec(t),p=!!/Win64/.exec(t),e){(i=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN)&&document&&document.documentMode&&(i=document.documentMode);var y=/(?:Trident\/(\d+.\d+))/.exec(t);a=y?parseFloat(y[1])+4:i,n=e[2]?parseFloat(e[2]):NaN,o=e[3]?parseFloat(e[3]):NaN,(r=e[4]?parseFloat(e[4]):NaN)?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),s=e&&e[1]?parseFloat(e[1]):NaN):s=NaN}else i=n=o=s=r=NaN;if(v){if(v[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);l=!b||parseFloat(b[1].replace("_","."))}else l=!1;c=!!v[2],u=!!v[3]}else l=c=u=!1}}var y={ie:function(){return v()||i},ieCompatibilityMode:function(){return v()||a>i},ie64:function(){return y.ie()&&p},firefox:function(){return v()||n},opera:function(){return v()||o},webkit:function(){return v()||r},safari:function(){return y.webkit()},chrome:function(){return v()||s},windows:function(){return v()||c},osx:function(){return v()||l},linux:function(){return v()||u},iphone:function(){return v()||d},mobile:function(){return v()||d||f||h||_},nativeApp:function(){return v()||g},android:function(){return v()||h},ipad:function(){return v()||f}};t.exports=y},"+E39":function(t,e,i){t.exports=!i("S82l")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"+ZMJ":function(t,e,i){var n=i("lOnJ");t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}}},"+tPU":function(t,e,i){i("xGkn");for(var n=i("7KvD"),o=i("hJx8"),r=i("/bQp"),s=i("dSzd")("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(i=t.slice(o+1),t=t.slice(0,o)),{path:t,query:i,hash:e}}(r.path||""),p=e&&e.path||"/",d=c.path?C(c.path,p,i||r.append):p,f=function(t,e,i){void 0===e&&(e={});var n,o=i||h;try{n=o(t||"")}catch(t){n={}}for(var r in e){var s=e[r];n[r]=Array.isArray(s)?s.map(u):u(s)}return n}(c.query,r.query,n&&n.options.parseQuery),g=r.hash||c.hash;return g&&"#"!==g.charAt(0)&&(g="#"+g),{_normalized:!0,path:d,query:f,hash:g}}var $,j=[String,Object],z=[String,Array],X=function(){},Y={name:"RouterLink",props:{to:{type:j,required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:z,default:"click"}},render:function(t){var e=this,i=this.$router,n=this.$route,r=i.resolve(this.to,n,this.append),s=r.location,a=r.route,l=r.href,c={},u=i.options.linkActiveClass,h=i.options.linkExactActiveClass,p=null==u?"router-link-active":u,g=null==h?"router-link-exact-active":h,_=null==this.activeClass?p:this.activeClass,m=null==this.exactActiveClass?g:this.exactActiveClass,y=a.redirectedFrom?f(null,W(a.redirectedFrom),null,i):a;c[m]=v(n,y,this.exactPath),c[_]=this.exact||this.exactPath?c[m]:function(t,e){return 0===t.path.replace(d,"/").indexOf(e.path.replace(d,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var i in e)if(!(i in t))return!1;return!0}(t.query,e.query)}(n,y);var b=c[m]?this.ariaCurrentValue:null,T=function(t){K(t)&&(e.replace?i.replace(s,X):i.push(s,X))},E={click:K};Array.isArray(this.event)?this.event.forEach(function(t){E[t]=T}):E[this.event]=T;var C={class:c},S=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:l,route:a,navigate:T,isActive:c[_],isExactActive:c[m]});if(S){if(1===S.length)return S[0];if(S.length>1||!S.length)return 0===S.length?t():t("span",{},S)}if("a"===this.tag)C.on=E,C.attrs={href:l,"aria-current":b};else{var k=function t(e){if(e)for(var i,n=0;n-1&&(a.params[p]=i.params[p]);return a.path=G(u.path,a.params),l(u,a,s)}if(a.path){a.params={};for(var d=0;d=t.length?i():t[o]?e(t[o],function(){n(o+1)}):n(o+1)};n(0)}var Tt={redirected:2,aborted:4,cancelled:8,duplicated:16};function Et(t,e){return St(t,e,Tt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+function(t){if("string"==typeof t)return t;if("path"in t)return t.path;var e={};return kt.forEach(function(i){i in t&&(e[i]=t[i])}),JSON.stringify(e,null,2)}(e)+'" via a navigation guard.')}function Ct(t,e){return St(t,e,Tt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function St(t,e,i,n){var o=new Error(n);return o._isRouter=!0,o.from=t,o.to=e,o.type=i,o}var kt=["params","query","hash"];function Ot(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function It(t,e){return Ot(t)&&t._isRouter&&(null==e||t.type===e)}function wt(t){return function(e,i,n){var o=!1,r=0,s=null;Rt(t,function(t,e,i,a){if("function"==typeof t&&void 0===t.cid){o=!0,r++;var l,c=Mt(function(e){var o;((o=e).__esModule||xt&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:$.extend(e),i.components[a]=e,--r<=0&&n()}),u=Mt(function(t){var e="Failed to resolve async component "+a+": "+t;s||(s=Ot(t)?t:new Error(e),n(s))});try{l=t(c,u)}catch(t){u(t)}if(l)if("function"==typeof l.then)l.then(c,u);else{var h=l.component;h&&"function"==typeof h.then&&h.then(c,u)}}}),o||n()}}function Rt(t,e){return Dt(t.map(function(t){return Object.keys(t.components).map(function(i){return e(t.components[i],t.instances[i],t,i)})}))}function Dt(t){return Array.prototype.concat.apply([],t)}var xt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Mt(t){var e=!1;return function(){for(var i=[],n=arguments.length;n--;)i[n]=arguments[n];if(!e)return e=!0,t.apply(this,i)}}var At=function(t,e){this.router=t,this.base=function(t){if(!t)if(q){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=_,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Nt(t,e,i,n){var o=Rt(t,function(t,n,o,r){var s=function(t,e){"function"!=typeof t&&(t=$.extend(t));return t.options[e]}(t,e);if(s)return Array.isArray(s)?s.map(function(t){return i(t,n,o,r)}):i(s,n,o,r)});return Dt(n?o.reverse():o)}function Lt(t,e){if(e)return function(){return t.apply(e,arguments)}}At.prototype.listen=function(t){this.cb=t},At.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},At.prototype.onError=function(t){this.errorCbs.push(t)},At.prototype.transitionTo=function(t,e,i){var n,o=this;try{n=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach(function(e){e(t)}),t}var r=this.current;this.confirmTransition(n,function(){o.updateRoute(n),e&&e(n),o.ensureURL(),o.router.afterHooks.forEach(function(t){t&&t(n,r)}),o.ready||(o.ready=!0,o.readyCbs.forEach(function(t){t(n)}))},function(t){i&&i(t),t&&!o.ready&&(It(t,Tt.redirected)&&r===_||(o.ready=!0,o.readyErrorCbs.forEach(function(e){e(t)})))})},At.prototype.confirmTransition=function(t,e,i){var o=this,r=this.current;this.pending=t;var s,a,l=function(t){!It(t)&&Ot(t)&&(o.errorCbs.length?o.errorCbs.forEach(function(e){e(t)}):(n(),console.error(t))),i&&i(t)},c=t.matched.length-1,u=r.matched.length-1;if(v(t,r)&&c===u&&t.matched[c]===r.matched[u])return this.ensureURL(),l(((a=St(s=r,t,Tt.duplicated,'Avoided redundant navigation to current location: "'+s.fullPath+'".')).name="NavigationDuplicated",a));var h=function(t,e){var i,n=Math.max(t.length,e.length);for(i=0;i0)){var e=this.router,i=e.options.scrollBehavior,n=mt&&i;n&&this.listeners.push(at());var o=function(){var i=t.current,o=Bt(t.base);t.current===_&&o===t._startLocation||t.transitionTo(o,function(t){n&<(e,t,i,!0)})};window.addEventListener("popstate",o),this.listeners.push(function(){window.removeEventListener("popstate",o)})}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,i){var n=this,o=this.current;this.transitionTo(t,function(t){vt(S(n.base+t.fullPath)),lt(n.router,t,o,!1),e&&e(t)},i)},e.prototype.replace=function(t,e,i){var n=this,o=this.current;this.transitionTo(t,function(t){yt(S(n.base+t.fullPath)),lt(n.router,t,o,!1),e&&e(t)},i)},e.prototype.ensureURL=function(t){if(Bt(this.base)!==this.current.fullPath){var e=S(this.base+this.current.fullPath);t?vt(e):yt(e)}},e.prototype.getCurrentLocation=function(){return Bt(this.base)},e}(At);function Bt(t){var e=window.location.pathname,i=e.toLowerCase(),n=t.toLowerCase();return!t||i!==n&&0!==i.indexOf(S(n+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Ft=function(t){function e(e,i,n){t.call(this,e,i),n&&function(t){var e=Bt(t);if(!/^\/#/.test(e))return window.location.replace(S(t+"/#"+e)),!0}(this.base)||Ht()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,i=mt&&e;i&&this.listeners.push(at());var n=function(){var e=t.current;Ht()&&t.transitionTo(Ut(),function(n){i&<(t.router,n,e,!0),mt||Wt(n.fullPath)})},o=mt?"popstate":"hashchange";window.addEventListener(o,n),this.listeners.push(function(){window.removeEventListener(o,n)})}},e.prototype.push=function(t,e,i){var n=this,o=this.current;this.transitionTo(t,function(t){Gt(t.fullPath),lt(n.router,t,o,!1),e&&e(t)},i)},e.prototype.replace=function(t,e,i){var n=this,o=this.current;this.transitionTo(t,function(t){Wt(t.fullPath),lt(n.router,t,o,!1),e&&e(t)},i)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Ut()!==e&&(t?Gt(e):Wt(e))},e.prototype.getCurrentLocation=function(){return Ut()},e}(At);function Ht(){var t=Ut();return"/"===t.charAt(0)||(Wt("/"+t),!1)}function Ut(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Vt(t){var e=window.location.href,i=e.indexOf("#");return(i>=0?e.slice(0,i):e)+"#"+t}function Gt(t){mt?vt(Vt(t)):window.location.hash=t}function Wt(t){mt?yt(Vt(t)):window.location.replace(Vt(t))}var $t=function(t){function e(e,i){t.call(this,e,i),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,i){var n=this;this.transitionTo(t,function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)},i)},e.prototype.replace=function(t,e,i){var n=this;this.transitionTo(t,function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)},i)},e.prototype.go=function(t){var e=this,i=this.index+t;if(!(i<0||i>=this.stack.length)){var n=this.stack[i];this.confirmTransition(n,function(){var t=e.current;e.index=i,e.updateRoute(n),e.router.afterHooks.forEach(function(e){e&&e(n,t)})},function(t){It(t,Tt.duplicated)&&(e.index=i)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(At),jt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!mt&&!1!==t.fallback,this.fallback&&(e="hash"),q||(e="abstract"),this.mode=e,e){case"history":this.history=new Pt(this,t.base);break;case"hash":this.history=new Ft(this,t.base,this.fallback);break;case"abstract":this.history=new $t(this,t.base);break;default:0}},zt={currentRoute:{configurable:!0}};function Xt(t,e){return t.push(e),function(){var i=t.indexOf(e);i>-1&&t.splice(i,1)}}jt.prototype.match=function(t,e,i){return this.matcher.match(t,e,i)},zt.currentRoute.get=function(){return this.history&&this.history.current},jt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",function(){var i=e.apps.indexOf(t);i>-1&&e.apps.splice(i,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()}),!this.app){this.app=t;var i=this.history;if(i instanceof Pt||i instanceof Ft){var n=function(t){i.setupListeners(),function(t){var n=i.current,o=e.options.scrollBehavior;mt&&o&&"fullPath"in t&<(e,t,n,!1)}(t)};i.transitionTo(i.getCurrentLocation(),n,n)}i.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},jt.prototype.beforeEach=function(t){return Xt(this.beforeHooks,t)},jt.prototype.beforeResolve=function(t){return Xt(this.resolveHooks,t)},jt.prototype.afterEach=function(t){return Xt(this.afterHooks,t)},jt.prototype.onReady=function(t,e){this.history.onReady(t,e)},jt.prototype.onError=function(t){this.history.onError(t)},jt.prototype.push=function(t,e,i){var n=this;if(!e&&!i&&"undefined"!=typeof Promise)return new Promise(function(e,i){n.history.push(t,e,i)});this.history.push(t,e,i)},jt.prototype.replace=function(t,e,i){var n=this;if(!e&&!i&&"undefined"!=typeof Promise)return new Promise(function(e,i){n.history.replace(t,e,i)});this.history.replace(t,e,i)},jt.prototype.go=function(t){this.history.go(t)},jt.prototype.back=function(){this.go(-1)},jt.prototype.forward=function(){this.go(1)},jt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(function(t){return Object.keys(t.components).map(function(e){return t.components[e]})})):[]},jt.prototype.resolve=function(t,e,i){var n=W(t,e=e||this.history.current,i,this),o=this.match(n,e),r=o.redirectedFrom||o.fullPath;return{location:n,route:o,href:function(t,e,i){var n="hash"===i?"#"+e:e;return t?S(t+"/"+n):n}(this.history.base,r,this.mode),normalizedTo:n,resolved:o}},jt.prototype.getRoutes=function(){return this.matcher.getRoutes()},jt.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==_&&this.history.transitionTo(this.history.getCurrentLocation())},jt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==_&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(jt.prototype,zt),jt.install=J,jt.version="3.5.2",jt.isNavigationFailure=It,jt.NavigationFailureType=Tt,jt.START_LOCATION=_,q&&window.Vue&&window.Vue.use(jt),e.a=jt},"02w1":function(t,e,i){"use strict";e.__esModule=!0,e.removeResizeListener=e.addResizeListener=void 0;var n,o=i("z+gd"),r=(n=o)&&n.__esModule?n:{default:n};var s="undefined"==typeof window,a=function(t){var e=t,i=Array.isArray(e),n=0;for(e=i?e:e[Symbol.iterator]();;){var o;if(i){if(n>=e.length)break;o=e[n++]}else{if((n=e.next()).done)break;o=n.value}var r=o.target.__resizeListeners__||[];r.length&&r.forEach(function(t){t()})}};e.addResizeListener=function(t,e){s||(t.__resizeListeners__||(t.__resizeListeners__=[],t.__ro__=new r.default(a),t.__ro__.observe(t)),t.__resizeListeners__.push(e))},e.removeResizeListener=function(t,e){t&&t.__resizeListeners__&&(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||t.__ro__.disconnect())}},"06OY":function(t,e,i){var n=i("3Eo+")("meta"),o=i("EqjI"),r=i("D2L2"),s=i("evD5").f,a=0,l=Object.isExtensible||function(){return!0},c=!i("S82l")(function(){return l(Object.preventExtensions({}))}),u=function(t){s(t,n,{value:{i:"O"+ ++a,w:{}}})},h=t.exports={KEY:n,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!r(t,n)){if(!l(t))return"F";if(!e)return"E";u(t)}return t[n].i},getWeak:function(t,e){if(!r(t,n)){if(!l(t))return!0;if(!e)return!1;u(t)}return t[n].w},onFreeze:function(t){return c&&h.NEED&&l(t)&&!r(t,n)&&u(t),t}}},"0kY3":function(t,e,i){t.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/",i(i.s=102)}({0:function(t,e,i){"use strict";function n(t,e,i,n,o,r,s,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:c}}i.d(e,"a",function(){return n})},10:function(t,e){t.exports=i("HJMx")},102:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:["el-input-number",t.inputNumberSize?"el-input-number--"+t.inputNumberSize:"",{"is-disabled":t.inputNumberDisabled},{"is-without-controls":!t.controls},{"is-controls-right":t.controlsAtRight}],on:{dragstart:function(t){t.preventDefault()}}},[t.controls?i("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.decrease,expression:"decrease"}],staticClass:"el-input-number__decrease",class:{"is-disabled":t.minDisabled},attrs:{role:"button"},on:{keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.decrease(e):null}}},[i("i",{class:"el-icon-"+(t.controlsAtRight?"arrow-down":"minus")})]):t._e(),t.controls?i("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.increase,expression:"increase"}],staticClass:"el-input-number__increase",class:{"is-disabled":t.maxDisabled},attrs:{role:"button"},on:{keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.increase(e):null}}},[i("i",{class:"el-icon-"+(t.controlsAtRight?"arrow-up":"plus")})]):t._e(),i("el-input",{ref:"input",attrs:{value:t.displayValue,placeholder:t.placeholder,disabled:t.inputNumberDisabled,size:t.inputNumberSize,max:t.max,min:t.min,name:t.name,label:t.label},on:{blur:t.handleBlur,focus:t.handleFocus,input:t.handleInput,change:t.handleInputChange},nativeOn:{keydown:[function(e){return"button"in e||!t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?(e.preventDefault(),t.increase(e)):null},function(e){return"button"in e||!t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?(e.preventDefault(),t.decrease(e)):null}]}})],1)};n._withStripped=!0;var o=i(10),r=i.n(o),s=i(22),a=i.n(s),l=i(30),c={name:"ElInputNumber",mixins:[a()("input")],inject:{elForm:{default:""},elFormItem:{default:""}},directives:{repeatClick:l.a},components:{ElInput:r.a},props:{step:{type:Number,default:1},stepStrictly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},value:{},disabled:Boolean,size:String,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:""},name:String,label:String,placeholder:String,precision:{type:Number,validator:function(t){return t>=0&&t===parseInt(t,10)}}},data:function(){return{currentValue:0,userInput:null}},watch:{value:{immediate:!0,handler:function(t){var e=void 0===t?t:Number(t);if(void 0!==e){if(isNaN(e))return;if(this.stepStrictly){var i=this.getPrecision(this.step),n=Math.pow(10,i);e=Math.round(e/this.step)*n*this.step/n}void 0!==this.precision&&(e=this.toPrecision(e,this.precision))}e>=this.max&&(e=this.max),e<=this.min&&(e=this.min),this.currentValue=e,this.userInput=null,this.$emit("input",e)}}},computed:{minDisabled:function(){return this._decrease(this.value,this.step)this.max},numPrecision:function(){var t=this.value,e=this.step,i=this.getPrecision,n=this.precision,o=i(e);return void 0!==n?(o>n&&console.warn("[Element Warn][InputNumber]precision should not be less than the decimal places of step"),n):Math.max(i(t),o)},controlsAtRight:function(){return this.controls&&"right"===this.controlsPosition},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},inputNumberSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputNumberDisabled:function(){return this.disabled||!!(this.elForm||{}).disabled},displayValue:function(){if(null!==this.userInput)return this.userInput;var t=this.currentValue;if("number"==typeof t){if(this.stepStrictly){var e=this.getPrecision(this.step),i=Math.pow(10,e);t=Math.round(t/this.step)*i*this.step/i}void 0!==this.precision&&(t=t.toFixed(this.precision))}return t}},methods:{toPrecision:function(t,e){return void 0===e&&(e=this.numPrecision),parseFloat(Math.round(t*Math.pow(10,e))/Math.pow(10,e))},getPrecision:function(t){if(void 0===t)return 0;var e=t.toString(),i=e.indexOf("."),n=0;return-1!==i&&(n=e.length-i-1),n},_increase:function(t,e){if("number"!=typeof t&&void 0!==t)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*t+i*e)/i)},_decrease:function(t,e){if("number"!=typeof t&&void 0!==t)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*t-i*e)/i)},increase:function(){if(!this.inputNumberDisabled&&!this.maxDisabled){var t=this.value||0,e=this._increase(t,this.step);this.setCurrentValue(e)}},decrease:function(){if(!this.inputNumberDisabled&&!this.minDisabled){var t=this.value||0,e=this._decrease(t,this.step);this.setCurrentValue(e)}},handleBlur:function(t){this.$emit("blur",t)},handleFocus:function(t){this.$emit("focus",t)},setCurrentValue:function(t){var e=this.currentValue;"number"==typeof t&&void 0!==this.precision&&(t=this.toPrecision(t,this.precision)),t>=this.max&&(t=this.max),t<=this.min&&(t=this.min),e!==t&&(this.userInput=null,this.$emit("input",t),this.$emit("change",t,e),this.currentValue=t)},handleInput:function(t){this.userInput=t},handleInputChange:function(t){var e=""===t?void 0:Number(t);isNaN(e)&&""!==t||this.setCurrentValue(e),this.userInput=null},select:function(){this.$refs.input.select()}},mounted:function(){var t=this.$refs.input.$refs.input;t.setAttribute("role","spinbutton"),t.setAttribute("aria-valuemax",this.max),t.setAttribute("aria-valuemin",this.min),t.setAttribute("aria-valuenow",this.currentValue),t.setAttribute("aria-disabled",this.inputNumberDisabled)},updated:function(){this.$refs&&this.$refs.input&&this.$refs.input.$refs.input.setAttribute("aria-valuenow",this.currentValue)}},u=i(0),h=Object(u.a)(c,n,[],!1,null,null,null);h.options.__file="packages/input-number/src/input-number.vue";var p=h.exports;p.install=function(t){t.component(p.name,p)};e.default=p},2:function(t,e){t.exports=i("2kvA")},22:function(t,e){t.exports=i("1oZe")},30:function(t,e,i){"use strict";var n=i(2);e.a={bind:function(t,e,i){var o=null,r=void 0,s=function(){return i.context[e.expression].apply()},a=function(){Date.now()-r<100&&s(),clearInterval(o),o=null};Object(n.on)(t,"mousedown",function(t){0===t.button&&(r=Date.now(),Object(n.once)(document,"mouseup",a),clearInterval(o),o=setInterval(s,100))})}}}})},"1kS7":function(t,e){e.f=Object.getOwnPropertySymbols},"1oZe":function(t,e,i){"use strict";e.__esModule=!0,e.default=function(t){return{methods:{focus:function(){this.$refs[t].focus()}}}}},"21It":function(t,e,i){"use strict";var n=i("FtD3");t.exports=function(t,e,i){var o=i.config.validateStatus;i.status&&o&&!o(i.status)?e(n("Request failed with status code "+i.status,i.config,null,i.request,i)):t(i)}},"2KxR":function(t,e){t.exports=function(t,e,i,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(i+": incorrect invocation!");return t}},"2kvA":function(t,e,i){"use strict";e.__esModule=!0,e.isInContainer=e.getScrollContainer=e.isScroll=e.getStyle=e.once=e.off=e.on=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.hasClass=f,e.addClass=function(t,e){if(!t)return;for(var i=t.className,n=(e||"").split(" "),o=0,r=n.length;o-1}var g=e.getStyle=c<9?function(t,e){if(!s){if(!t||!e)return null;"float"===(e=h(e))&&(e="styleFloat");try{switch(e){case"opacity":try{return t.filters.item("alpha").opacity/100}catch(t){return 1}default:return t.style[e]||t.currentStyle?t.currentStyle[e]:null}}catch(i){return t.style[e]}}}:function(t,e){if(!s){if(!t||!e)return null;"float"===(e=h(e))&&(e="cssFloat");try{var i=document.defaultView.getComputedStyle(t,"");return t.style[e]||i?i[e]:null}catch(i){return t.style[e]}}};var _=e.isScroll=function(t,e){if(!s)return g(t,null!==e&&void 0!==e?e?"overflow-y":"overflow-x":"overflow").match(/(scroll|auto)/)};e.getScrollContainer=function(t,e){if(!s){for(var i=t;i;){if([window,document,document.documentElement].includes(i))return window;if(_(i,e))return i;i=i.parentNode}return i}},e.isInContainer=function(t,e){if(s||!t||!e)return!1;var i=t.getBoundingClientRect(),n=void 0;return n=[window,document,document.documentElement,null,void 0].includes(e)?{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:e.getBoundingClientRect(),i.topn.top&&i.right>n.left&&i.left=0&&Math.floor(e)===e&&isFinite(t)}function p(t){return o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function d(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===l?JSON.stringify(t,null,2):String(t)}function f(t){var e=parseFloat(t);return isNaN(e)?t:e}function g(t,e){for(var i=Object.create(null),n=t.split(","),o=0;o-1)return t.splice(i,1)}}var y=Object.prototype.hasOwnProperty;function b(t,e){return y.call(t,e)}function T(t){var e=Object.create(null);return function(i){return e[i]||(e[i]=t(i))}}var E=/-(\w)/g,C=T(function(t){return t.replace(E,function(t,e){return e?e.toUpperCase():""})}),S=T(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),k=/\B([A-Z])/g,O=T(function(t){return t.replace(k,"-$1").toLowerCase()});var I=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function i(i){var n=arguments.length;return n?n>1?t.apply(e,arguments):t.call(e,i):t.call(e)}return i._length=t.length,i};function w(t,e){e=e||0;for(var i=t.length-e,n=new Array(i);i--;)n[i]=t[i+e];return n}function R(t,e){for(var i in e)t[i]=e[i];return t}function D(t){for(var e={},i=0;i0,Q=J&&J.indexOf("edge/")>0,tt=(J&&J.indexOf("android"),J&&/iphone|ipad|ipod|ios/.test(J)||"ios"===K),et=(J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\/(\d+)/)),it={}.watch,nt=!1;if(X)try{var ot={};Object.defineProperty(ot,"passive",{get:function(){nt=!0}}),window.addEventListener("test-passive",null,ot)}catch(t){}var rt=function(){return void 0===j&&(j=!X&&!Y&&void 0!==t&&(t.process&&"server"===t.process.env.VUE_ENV)),j},st=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function at(t){return"function"==typeof t&&/native code/.test(t.toString())}var lt,ct="undefined"!=typeof Symbol&&at(Symbol)&&"undefined"!=typeof Reflect&&at(Reflect.ownKeys);lt="undefined"!=typeof Set&&at(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ut=x,ht=0,pt=function(){this.id=ht++,this.subs=[]};pt.prototype.addSub=function(t){this.subs.push(t)},pt.prototype.removeSub=function(t){v(this.subs,t)},pt.prototype.depend=function(){pt.target&&pt.target.addDep(this)},pt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,i=t.length;e-1)if(r&&!b(o,"default"))s=!1;else if(""===s||s===O(t)){var l=Wt(String,o.type);(l<0||a0&&(pe((c=t(c,(i||"")+"_"+l))[0])&&pe(h)&&(a[u]=yt(h.text+c[0].text),c.shift()),a.push.apply(a,c)):s(c)?pe(h)?a[u]=yt(h.text+c):""!==c&&a.push(yt(c)):pe(c)&&pe(h)?a[u]=yt(h.text+c.text):(r(e._isVList)&&o(c.tag)&&n(c.key)&&o(i)&&(c.key="__vlist"+i+"_"+l+"__"),a.push(c)));return a}(t):void 0}function pe(t){return o(t)&&o(t.text)&&!1===t.isComment}function de(t,e){if(t){for(var i=Object.create(null),n=ct?Reflect.ownKeys(t):Object.keys(t),o=0;o0,s=t?!!t.$stable:!r,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&n&&n!==i&&a===n.$key&&!r&&!n.$hasNormal)return n;for(var l in o={},t)t[l]&&"$"!==l[0]&&(o[l]=ve(e,l,t[l]))}else o={};for(var c in e)c in o||(o[c]=ye(e,c));return t&&Object.isExtensible(t)&&(t._normalized=o),W(o,"$stable",s),W(o,"$key",a),W(o,"$hasNormal",r),o}function ve(t,e,i){var n=function(){var t=arguments.length?i.apply(null,arguments):i({}),e=(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:he(t))&&t[0];return t&&(!e||1===t.length&&e.isComment&&!_e(e))?void 0:t};return i.proxy&&Object.defineProperty(t,e,{get:n,enumerable:!0,configurable:!0}),n}function ye(t,e){return function(){return t[e]}}function be(t,e){var i,n,r,s,l;if(Array.isArray(t)||"string"==typeof t)for(i=new Array(t.length),n=0,r=t.length;ndocument.createEvent("Event").timeStamp&&(hi=function(){return pi.now()})}function di(){var t,e;for(ui=hi(),li=!0,oi.sort(function(t,e){return t.id-e.id}),ci=0;cici&&oi[i].id>t.id;)i--;oi.splice(i+1,0,t)}else oi.push(t);ai||(ai=!0,ne(di))}}(this)},gi.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||a(t)||this.deep){var e=this.value;if(this.value=t,this.user){var i='callback for watcher "'+this.expression+'"';jt(this.cb,this.vm,[t,e],this.vm,i)}else this.cb.call(this.vm,t,e)}}},gi.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},gi.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},gi.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var _i={enumerable:!0,configurable:!0,get:x,set:x};function mi(t,e,i){_i.get=function(){return this[e][i]},_i.set=function(t){this[e][i]=t},Object.defineProperty(t,i,_i)}function vi(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var i=t.$options.propsData||{},n=t._props={},o=t.$options._propKeys=[],r=!t.$parent;r||kt(!1);var s=function(r){o.push(r);var s=Ht(r,e,i,t);wt(n,r,s),r in t||mi(t,"_props",r)};for(var a in e)s(a);kt(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var i in e)t[i]="function"!=typeof e[i]?x:I(e[i],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;c(e=t._data="function"==typeof e?function(t,e){ft();try{return t.call(e,e)}catch(t){return $t(t,e,"data()"),{}}finally{gt()}}(e,t):e||{})||(e={});var i=Object.keys(e),n=t.$options.props,o=(t.$options.methods,i.length);for(;o--;){var r=i[o];0,n&&b(n,r)||G(r)||mi(t,"_data",r)}It(e,!0)}(t):It(t._data={},!0),e.computed&&function(t,e){var i=t._computedWatchers=Object.create(null),n=rt();for(var o in e){var r=e[o],s="function"==typeof r?r:r.get;0,n||(i[o]=new gi(t,s||x,x,yi)),o in t||bi(t,o,r)}}(t,e.computed),e.watch&&e.watch!==it&&function(t,e){for(var i in e){var n=e[i];if(Array.isArray(n))for(var o=0;o-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!u(t)&&t.test(e)}function Di(t,e){var i=t.cache,n=t.keys,o=t._vnode;for(var r in i){var s=i[r];if(s){var a=s.name;a&&!e(a)&&xi(i,r,n,o)}}}function xi(t,e,i,n){var o=t[e];!o||n&&o.tag===n.tag||o.componentInstance.$destroy(),t[e]=null,v(i,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=Si++,e._isVue=!0,t&&t._isComponent?function(t,e){var i=t.$options=Object.create(t.constructor.options),n=e._parentVnode;i.parent=e.parent,i._parentVnode=n;var o=n.componentOptions;i.propsData=o.propsData,i._parentListeners=o.listeners,i._renderChildren=o.children,i._componentTag=o.tag,e.render&&(i.render=e.render,i.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Bt(ki(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,i=e.parent;if(i&&!e.abstract){for(;i.$options.abstract&&i.$parent;)i=i.$parent;i.$children.push(t)}t.$parent=i,t.$root=i?i.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ze(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=fe(e._renderChildren,o),t.$scopedSlots=i,t._c=function(e,i,n,o){return $e(t,e,i,n,o,!1)},t.$createElement=function(e,i,n,o){return $e(t,e,i,n,o,!0)};var r=n&&n.data;wt(t,"$attrs",r&&r.attrs||i,null,!0),wt(t,"$listeners",e._parentListeners||i,null,!0)}(e),ni(e,"beforeCreate"),function(t){var e=de(t.$options.inject,t);e&&(kt(!1),Object.keys(e).forEach(function(i){wt(t,i,e[i])}),kt(!0))}(e),vi(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),ni(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(Oi),function(t){var e={get:function(){return this._data}},i={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",i),t.prototype.$set=Rt,t.prototype.$delete=Dt,t.prototype.$watch=function(t,e,i){if(c(e))return Ci(this,t,e,i);(i=i||{}).user=!0;var n=new gi(this,t,e,i);if(i.immediate){var o='callback for immediate watcher "'+n.expression+'"';ft(),jt(e,this,[n.value],this,o),gt()}return function(){n.teardown()}}}(Oi),function(t){var e=/^hook:/;t.prototype.$on=function(t,i){var n=this;if(Array.isArray(t))for(var o=0,r=t.length;o1?w(i):i;for(var n=w(arguments,1),o='event handler for "'+t+'"',r=0,s=i.length;rparseInt(this.max)&&xi(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)xi(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",function(e){Di(t,function(t){return Ri(e,t)})}),this.$watch("exclude",function(e){Di(t,function(t){return!Ri(e,t)})})},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Ye(t),i=e&&e.componentOptions;if(i){var n=wi(i),o=this.include,r=this.exclude;if(o&&(!n||!Ri(o,n))||r&&n&&Ri(r,n))return e;var s=this.cache,a=this.keys,l=null==e.key?i.Ctor.cid+(i.tag?"::"+i.tag:""):e.key;s[l]?(e.componentInstance=s[l].componentInstance,v(a,l),a.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:ut,extend:R,mergeOptions:Bt,defineReactive:wt},t.set=Rt,t.delete=Dt,t.nextTick=ne,t.observable=function(t){return It(t),t},t.options=Object.create(null),F.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,R(t.options.components,Ai),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var i=w(arguments,1);return i.unshift(this),"function"==typeof t.install?t.install.apply(t,i):"function"==typeof t&&t.apply(null,i),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Bt(this.options,t),this}}(t),Ii(t),function(t){F.forEach(function(e){t[e]=function(t,i){return i?("component"===e&&c(i)&&(i.name=i.name||t,i=this.options._base.extend(i)),"directive"===e&&"function"==typeof i&&(i={bind:i,update:i}),this.options[e+"s"][t]=i,i):this.options[e+"s"][t]}})}(t)}(Oi),Object.defineProperty(Oi.prototype,"$isServer",{get:rt}),Object.defineProperty(Oi.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Oi,"FunctionalRenderContext",{value:Le}),Oi.version="2.6.14";var Ni=g("style,class"),Li=g("input,textarea,option,select,progress"),Pi=function(t,e,i){return"value"===i&&Li(t)&&"button"!==e||"selected"===i&&"option"===t||"checked"===i&&"input"===t||"muted"===i&&"video"===t},Bi=g("contenteditable,draggable,spellcheck"),Fi=g("events,caret,typing,plaintext-only"),Hi=function(t,e){return $i(e)||"false"===e?"false":"contenteditable"===t&&Fi(e)?e:"true"},Ui=g("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Vi="http://www.w3.org/1999/xlink",Gi=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Wi=function(t){return Gi(t)?t.slice(6,t.length):""},$i=function(t){return null==t||!1===t};function ji(t){for(var e=t.data,i=t,n=t;o(n.componentInstance);)(n=n.componentInstance._vnode)&&n.data&&(e=zi(n.data,e));for(;o(i=i.parent);)i&&i.data&&(e=zi(e,i.data));return function(t,e){if(o(t)||o(e))return Xi(t,Yi(e));return""}(e.staticClass,e.class)}function zi(t,e){return{staticClass:Xi(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Xi(t,e){return t?e?t+" "+e:t:e||""}function Yi(t){return Array.isArray(t)?function(t){for(var e,i="",n=0,r=t.length;n-1?bn(t,e,i):Ui(e)?$i(i)?t.removeAttribute(e):(i="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,i)):Bi(e)?t.setAttribute(e,Hi(e,i)):Gi(e)?$i(i)?t.removeAttributeNS(Vi,Wi(e)):t.setAttributeNS(Vi,e,i):bn(t,e,i)}function bn(t,e,i){if($i(i))t.removeAttribute(e);else{if(q&&!Z&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==i&&!t.__ieph){var n=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",n)};t.addEventListener("input",n),t.__ieph=!0}t.setAttribute(e,i)}}var Tn={create:vn,update:vn};function En(t,e){var i=e.elm,r=e.data,s=t.data;if(!(n(r.staticClass)&&n(r.class)&&(n(s)||n(s.staticClass)&&n(s.class)))){var a=ji(e),l=i._transitionClasses;o(l)&&(a=Xi(a,Yi(l))),a!==i._prevClass&&(i.setAttribute("class",a),i._prevClass=a)}}var Cn,Sn,kn,On,In,wn,Rn={create:En,update:En},Dn=/[\w).+\-_$\]]/;function xn(t){var e,i,n,o,r,s=!1,a=!1,l=!1,c=!1,u=0,h=0,p=0,d=0;for(n=0;n=0&&" "===(g=t.charAt(f));f--);g&&Dn.test(g)||(c=!0)}}else void 0===o?(d=n+1,o=t.slice(0,n).trim()):_();function _(){(r||(r=[])).push(t.slice(d,n).trim()),d=n+1}if(void 0===o?o=t.slice(0,n).trim():0!==d&&_(),r)for(n=0;n-1?{exp:t.slice(0,On),key:'"'+t.slice(On+1)+'"'}:{exp:t,key:null};Sn=t,On=In=wn=0;for(;!Kn();)Jn(kn=Yn())?Zn(kn):91===kn&&qn(kn);return{exp:t.slice(0,In),key:t.slice(In+1,wn)}}(t);return null===i.key?t+"="+e:"$set("+i.exp+", "+i.key+", "+e+")"}function Yn(){return Sn.charCodeAt(++On)}function Kn(){return On>=Cn}function Jn(t){return 34===t||39===t}function qn(t){var e=1;for(In=On;!Kn();)if(Jn(t=Yn()))Zn(t);else if(91===t&&e++,93===t&&e--,0===e){wn=On;break}}function Zn(t){for(var e=t;!Kn()&&(t=Yn())!==e;);}var Qn,to="__r",eo="__c";function io(t,e,i){var n=Qn;return function o(){null!==e.apply(null,arguments)&&ro(t,o,i,n)}}var no=Kt&&!(et&&Number(et[1])<=53);function oo(t,e,i,n){if(no){var o=ui,r=e;e=r._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return r.apply(this,arguments)}}Qn.addEventListener(t,e,nt?{capture:i,passive:n}:i)}function ro(t,e,i,n){(n||Qn).removeEventListener(t,e._wrapper||e,i)}function so(t,e){if(!n(t.data.on)||!n(e.data.on)){var i=e.data.on||{},r=t.data.on||{};Qn=e.elm,function(t){if(o(t[to])){var e=q?"change":"input";t[e]=[].concat(t[to],t[e]||[]),delete t[to]}o(t[eo])&&(t.change=[].concat(t[eo],t.change||[]),delete t[eo])}(i),le(i,r,oo,ro,io,e.context),Qn=void 0}}var ao,lo={create:so,update:so};function co(t,e){if(!n(t.data.domProps)||!n(e.data.domProps)){var i,r,s=e.elm,a=t.data.domProps||{},l=e.data.domProps||{};for(i in o(l.__ob__)&&(l=e.data.domProps=R({},l)),a)i in l||(s[i]="");for(i in l){if(r=l[i],"textContent"===i||"innerHTML"===i){if(e.children&&(e.children.length=0),r===a[i])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===i&&"PROGRESS"!==s.tagName){s._value=r;var c=n(r)?"":String(r);uo(s,c)&&(s.value=c)}else if("innerHTML"===i&&qi(s.tagName)&&n(s.innerHTML)){(ao=ao||document.createElement("div")).innerHTML=""+r+"";for(var u=ao.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;u.firstChild;)s.appendChild(u.firstChild)}else if(r!==a[i])try{s[i]=r}catch(t){}}}}function uo(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var i=!0;try{i=document.activeElement!==t}catch(t){}return i&&t.value!==e}(t,e)||function(t,e){var i=t.value,n=t._vModifiers;if(o(n)){if(n.number)return f(i)!==f(e);if(n.trim)return i.trim()!==e.trim()}return i!==e}(t,e))}var ho={create:co,update:co},po=T(function(t){var e={},i=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach(function(t){if(t){var n=t.split(i);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e});function fo(t){var e=go(t.style);return t.staticStyle?R(t.staticStyle,e):e}function go(t){return Array.isArray(t)?D(t):"string"==typeof t?po(t):t}var _o,mo=/^--/,vo=/\s*!important$/,yo=function(t,e,i){if(mo.test(e))t.style.setProperty(e,i);else if(vo.test(i))t.style.setProperty(O(e),i.replace(vo,""),"important");else{var n=To(e);if(Array.isArray(i))for(var o=0,r=i.length;o-1?e.split(So).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var i=" "+(t.getAttribute("class")||"")+" ";i.indexOf(" "+e+" ")<0&&t.setAttribute("class",(i+e).trim())}}function Oo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(So).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var i=" "+(t.getAttribute("class")||"")+" ",n=" "+e+" ";i.indexOf(n)>=0;)i=i.replace(n," ");(i=i.trim())?t.setAttribute("class",i):t.removeAttribute("class")}}function Io(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&R(e,wo(t.name||"v")),R(e,t),e}return"string"==typeof t?wo(t):void 0}}var wo=T(function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}}),Ro=X&&!Z,Do="transition",xo="animation",Mo="transition",Ao="transitionend",No="animation",Lo="animationend";Ro&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Mo="WebkitTransition",Ao="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(No="WebkitAnimation",Lo="webkitAnimationEnd"));var Po=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Bo(t){Po(function(){Po(t)})}function Fo(t,e){var i=t._transitionClasses||(t._transitionClasses=[]);i.indexOf(e)<0&&(i.push(e),ko(t,e))}function Ho(t,e){t._transitionClasses&&v(t._transitionClasses,e),Oo(t,e)}function Uo(t,e,i){var n=Go(t,e),o=n.type,r=n.timeout,s=n.propCount;if(!o)return i();var a=o===Do?Ao:Lo,l=0,c=function(){t.removeEventListener(a,u),i()},u=function(e){e.target===t&&++l>=s&&c()};setTimeout(function(){l0&&(i=Do,u=s,h=r.length):e===xo?c>0&&(i=xo,u=c,h=l.length):h=(i=(u=Math.max(s,c))>0?s>c?Do:xo:null)?i===Do?r.length:l.length:0,{type:i,timeout:u,propCount:h,hasTransform:i===Do&&Vo.test(n[Mo+"Property"])}}function Wo(t,e){for(;t.length1}function Ko(t,e){!0!==e.data.show&&jo(e)}var Jo=function(t){var e,i,a={},l=t.modules,c=t.nodeOps;for(e=0;ef?y(t,n(i[m+1])?null:i[m+1].elm,i,d,m,r):d>m&&T(e,p,f)}(p,g,m,i,u):o(m)?(o(t.text)&&c.setTextContent(p,""),y(p,null,m,0,m.length-1,i)):o(g)?T(g,0,g.length-1):o(t.text)&&c.setTextContent(p,""):t.text!==e.text&&c.setTextContent(p,e.text),o(f)&&o(d=f.hook)&&o(d=d.postpatch)&&d(t,e)}}}function k(t,e,i){if(r(i)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var n=0;n-1,s.selected!==r&&(s.selected=r);else if(N(er(s),n))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}}function tr(t,e){return e.every(function(e){return!N(e,t)})}function er(t){return"_value"in t?t._value:t.value}function ir(t){t.target.composing=!0}function nr(t){t.target.composing&&(t.target.composing=!1,or(t.target,"input"))}function or(t,e){var i=document.createEvent("HTMLEvents");i.initEvent(e,!0,!0),t.dispatchEvent(i)}function rr(t){return!t.componentInstance||t.data&&t.data.transition?t:rr(t.componentInstance._vnode)}var sr={model:qo,show:{bind:function(t,e,i){var n=e.value,o=(i=rr(i)).data&&i.data.transition,r=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;n&&o?(i.data.show=!0,jo(i,function(){t.style.display=r})):t.style.display=n?r:"none"},update:function(t,e,i){var n=e.value;!n!=!e.oldValue&&((i=rr(i)).data&&i.data.transition?(i.data.show=!0,n?jo(i,function(){t.style.display=t.__vOriginalDisplay}):zo(i,function(){t.style.display="none"})):t.style.display=n?t.__vOriginalDisplay:"none")},unbind:function(t,e,i,n,o){o||(t.style.display=t.__vOriginalDisplay)}}},ar={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function lr(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?lr(Ye(e.children)):t}function cr(t){var e={},i=t.$options;for(var n in i.propsData)e[n]=t[n];var o=i._parentListeners;for(var r in o)e[C(r)]=o[r];return e}function ur(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var hr=function(t){return t.tag||_e(t)},pr=function(t){return"show"===t.name},dr={name:"transition",props:ar,abstract:!0,render:function(t){var e=this,i=this.$slots.default;if(i&&(i=i.filter(hr)).length){0;var n=this.mode;0;var o=i[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var r=lr(o);if(!r)return o;if(this._leaving)return ur(t,o);var a="__transition-"+this._uid+"-";r.key=null==r.key?r.isComment?a+"comment":a+r.tag:s(r.key)?0===String(r.key).indexOf(a)?r.key:a+r.key:r.key;var l=(r.data||(r.data={})).transition=cr(this),c=this._vnode,u=lr(c);if(r.data.directives&&r.data.directives.some(pr)&&(r.data.show=!0),u&&u.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(r,u)&&!_e(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var h=u.data.transition=R({},l);if("out-in"===n)return this._leaving=!0,ce(h,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),ur(t,o);if("in-out"===n){if(_e(r))return c;var p,d=function(){p()};ce(l,"afterEnter",d),ce(l,"enterCancelled",d),ce(h,"delayLeave",function(t){p=t})}}return o}}},fr=R({tag:String,moveClass:String},ar);function gr(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function _r(t){t.data.newPos=t.elm.getBoundingClientRect()}function mr(t){var e=t.data.pos,i=t.data.newPos,n=e.left-i.left,o=e.top-i.top;if(n||o){t.data.moved=!0;var r=t.elm.style;r.transform=r.WebkitTransform="translate("+n+"px,"+o+"px)",r.transitionDuration="0s"}}delete fr.mode;var vr={Transition:dr,TransitionGroup:{props:fr,beforeMount:function(){var t=this,e=this._update;this._update=function(i,n){var o=ti(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,i,n)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",i=Object.create(null),n=this.prevChildren=this.children,o=this.$slots.default||[],r=this.children=[],s=cr(this),a=0;a-1?tn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:tn[t]=/HTMLUnknownElement/.test(e.toString())},R(Oi.options.directives,sr),R(Oi.options.components,vr),Oi.prototype.__patch__=X?Jo:x,Oi.prototype.$mount=function(t,e){return function(t,e,i){return t.$el=e,t.$options.render||(t.$options.render=vt),ni(t,"beforeMount"),new gi(t,function(){t._update(t._render(),i)},x,{before:function(){t._isMounted&&!t._isDestroyed&&ni(t,"beforeUpdate")}},!0),i=!1,null==t.$vnode&&(t._isMounted=!0,ni(t,"mounted")),t}(this,t=t&&X?nn(t):void 0,e)},X&&setTimeout(function(){U.devtools&&st&&st.emit("init",Oi)},0);var yr=/\{\{((?:.|\r?\n)+?)\}\}/g,br=/[-.*+?^${}()|[\]\/\\]/g,Tr=T(function(t){var e=t[0].replace(br,"\\$&"),i=t[1].replace(br,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+i,"g")});function Er(t,e){var i=e?Tr(e):yr;if(i.test(t)){for(var n,o,r,s=[],a=[],l=i.lastIndex=0;n=i.exec(t);){(o=n.index)>l&&(a.push(r=t.slice(l,o)),s.push(JSON.stringify(r)));var c=xn(n[1].trim());s.push("_s("+c+")"),a.push({"@binding":c}),l=o+n[0].length}return l\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,xr=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Mr="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+V.source+"]*",Ar="((?:"+Mr+"\\:)?"+Mr+")",Nr=new RegExp("^<"+Ar),Lr=/^\s*(\/?)>/,Pr=new RegExp("^<\\/"+Ar+"[^>]*>"),Br=/^]+>/i,Fr=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Wr=/&(?:lt|gt|quot|amp|#39);/g,$r=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,jr=g("pre,textarea",!0),zr=function(t,e){return t&&jr(t)&&"\n"===e[0]};function Xr(t,e){var i=e?$r:Wr;return t.replace(i,function(t){return Gr[t]})}var Yr,Kr,Jr,qr,Zr,Qr,ts,es,is=/^@|^v-on:/,ns=/^v-|^@|^:|^#/,os=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,rs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ss=/^\(|\)$/g,as=/^\[.*\]$/,ls=/:(.*)$/,cs=/^:|^\.|^v-bind:/,us=/\.[^.\]]+(?=[^\]]*$)/g,hs=/^v-slot(:|$)|^#/,ps=/[\r\n]/,ds=/[ \f\t\r\n]+/g,fs=T(Or),gs="_empty_";function _s(t,e,i){return{type:1,tag:t,attrsList:e,attrsMap:function(t){for(var e={},i=0,n=t.length;i]*>)","i")),p=t.replace(h,function(t,i,n){return c=n.length,Ur(u)||"noscript"===u||(i=i.replace(//g,"$1").replace(//g,"$1")),zr(u,i)&&(i=i.slice(1)),e.chars&&e.chars(i),""});l+=t.length-p.length,t=p,O(u,l-c,l)}else{var d=t.indexOf("<");if(0===d){if(Fr.test(t)){var f=t.indexOf("--\x3e");if(f>=0){e.shouldKeepComment&&e.comment(t.substring(4,f),l,l+f+3),C(f+3);continue}}if(Hr.test(t)){var g=t.indexOf("]>");if(g>=0){C(g+2);continue}}var _=t.match(Br);if(_){C(_[0].length);continue}var m=t.match(Pr);if(m){var v=l;C(m[0].length),O(m[1],v,l);continue}var y=S();if(y){k(y),zr(y.tagName,t)&&C(1);continue}}var b=void 0,T=void 0,E=void 0;if(d>=0){for(T=t.slice(d);!(Pr.test(T)||Nr.test(T)||Fr.test(T)||Hr.test(T)||(E=T.indexOf("<",1))<0);)d+=E,T=t.slice(d);b=t.substring(0,d)}d<0&&(b=t),b&&C(b.length),e.chars&&b&&e.chars(b,l-b.length,l)}if(t===i){e.chars&&e.chars(t);break}}function C(e){l+=e,t=t.substring(e)}function S(){var e=t.match(Nr);if(e){var i,n,o={tagName:e[1],attrs:[],start:l};for(C(e[0].length);!(i=t.match(Lr))&&(n=t.match(xr)||t.match(Dr));)n.start=l,C(n[0].length),n.end=l,o.attrs.push(n);if(i)return o.unarySlash=i[1],C(i[0].length),o.end=l,o}}function k(t){var i=t.tagName,l=t.unarySlash;r&&("p"===n&&Rr(i)&&O(n),a(i)&&n===i&&O(i));for(var c=s(i)||!!l,u=t.attrs.length,h=new Array(u),p=0;p=0&&o[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=o.length-1;c>=s;c--)e.end&&e.end(o[c].tag,i,r);o.length=s,n=s&&o[s-1].tag}else"br"===a?e.start&&e.start(t,[],!0,i,r):"p"===a&&(e.start&&e.start(t,[],!1,i,r),e.end&&e.end(t,i,r))}O()}(t,{warn:Yr,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,outputSourceRange:e.outputSourceRange,start:function(t,i,s,a,h){var p=o&&o.ns||es(t);q&&"svg"===p&&(i=function(t){for(var e=[],i=0;i-1"+("true"===r?":("+e+")":":_q("+e+","+r+")")),Un(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+r+"):("+s+");if(Array.isArray($$a)){var $$v="+(n?"_n("+o+")":o)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Xn(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Xn(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Xn(e,"$$c")+"}",null,!0)}(t,n,o);else if("input"===r&&"radio"===s)!function(t,e,i){var n=i&&i.number,o=Gn(t,"value")||"null";Ln(t,"checked","_q("+e+","+(o=n?"_n("+o+")":o)+")"),Un(t,"change",Xn(e,o),null,!0)}(t,n,o);else if("input"===r||"textarea"===r)!function(t,e,i){var n=t.attrsMap.type,o=i||{},r=o.lazy,s=o.number,a=o.trim,l=!r&&"range"!==n,c=r?"change":"range"===n?to:"input",u="$event.target.value";a&&(u="$event.target.value.trim()"),s&&(u="_n("+u+")");var h=Xn(e,u);l&&(h="if($event.target.composing)return;"+h),Ln(t,"value","("+e+")"),Un(t,c,h,null,!0),(a||s)&&Un(t,"blur","$forceUpdate()")}(t,n,o);else if(!U.isReservedTag(r))return zn(t,n,o),!1;return!0},text:function(t,e){e.value&&Ln(t,"textContent","_s("+e.value+")",e)},html:function(t,e){e.value&&Ln(t,"innerHTML","_s("+e.value+")",e)}},isPreTag:function(t){return"pre"===t},isUnaryTag:Ir,mustUseProp:Pi,canBeLeftOpenTag:wr,isReservedTag:Zi,getTagNamespace:Qi,staticKeys:function(t){return t.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")}(Os)},Ds=T(function(t){return g("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))});function xs(t,e){t&&(Is=Ds(e.staticKeys||""),ws=e.isReservedTag||M,function t(e){e.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||_(t.tag)||!ws(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Is)))}(e);if(1===e.type){if(!ws(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var i=0,n=e.children.length;i|^function(?:\s+[\w$]+)?\s*\(/,As=/\([^)]*?\);*$/,Ns=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ls={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ps={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Bs=function(t){return"if("+t+")return null;"},Fs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Bs("$event.target !== $event.currentTarget"),ctrl:Bs("!$event.ctrlKey"),shift:Bs("!$event.shiftKey"),alt:Bs("!$event.altKey"),meta:Bs("!$event.metaKey"),left:Bs("'button' in $event && $event.button !== 0"),middle:Bs("'button' in $event && $event.button !== 1"),right:Bs("'button' in $event && $event.button !== 2")};function Hs(t,e){var i=e?"nativeOn:":"on:",n="",o="";for(var r in t){var s=Us(t[r]);t[r]&&t[r].dynamic?o+=r+","+s+",":n+='"'+r+'":'+s+","}return n="{"+n.slice(0,-1)+"}",o?i+"_d("+n+",["+o.slice(0,-1)+"])":i+n}function Us(t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return Us(t)}).join(",")+"]";var e=Ns.test(t.value),i=Ms.test(t.value),n=Ns.test(t.value.replace(As,""));if(t.modifiers){var o="",r="",s=[];for(var a in t.modifiers)if(Fs[a])r+=Fs[a],Ls[a]&&s.push(a);else if("exact"===a){var l=t.modifiers;r+=Bs(["ctrl","shift","alt","meta"].filter(function(t){return!l[t]}).map(function(t){return"$event."+t+"Key"}).join("||"))}else s.push(a);return s.length&&(o+=function(t){return"if(!$event.type.indexOf('key')&&"+t.map(Vs).join("&&")+")return null;"}(s)),r&&(o+=r),"function($event){"+o+(e?"return "+t.value+".apply(null, arguments)":i?"return ("+t.value+").apply(null, arguments)":n?"return "+t.value:t.value)+"}"}return e||i?t.value:"function($event){"+(n?"return "+t.value:t.value)+"}"}function Vs(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var i=Ls[t],n=Ps[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(i)+",$event.key,"+JSON.stringify(n)+")"}var Gs={on:function(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}},bind:function(t,e){t.wrapData=function(i){return"_b("+i+",'"+t.tag+"',"+e.value+","+(e.modifiers&&e.modifiers.prop?"true":"false")+(e.modifiers&&e.modifiers.sync?",true":"")+")"}},cloak:x},Ws=function(t){this.options=t,this.warn=t.warn||An,this.transforms=Nn(t.modules,"transformCode"),this.dataGenFns=Nn(t.modules,"genData"),this.directives=R(R({},Gs),t.directives);var e=t.isReservedTag||M;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function $s(t,e){var i=new Ws(e);return{render:"with(this){return "+(t?"script"===t.tag?"null":js(t,i):'_c("div")')+"}",staticRenderFns:i.staticRenderFns}}function js(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return zs(t,e);if(t.once&&!t.onceProcessed)return Xs(t,e);if(t.for&&!t.forProcessed)return Ks(t,e);if(t.if&&!t.ifProcessed)return Ys(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var i=t.slotName||'"default"',n=Qs(t,e),o="_t("+i+(n?",function(){return "+n+"}":""),r=t.attrs||t.dynamicAttrs?ia((t.attrs||[]).concat(t.dynamicAttrs||[]).map(function(t){return{name:C(t.name),value:t.value,dynamic:t.dynamic}})):null,s=t.attrsMap["v-bind"];!r&&!s||n||(o+=",null");r&&(o+=","+r);s&&(o+=(r?"":",null")+","+s);return o+")"}(t,e);var i;if(t.component)i=function(t,e,i){var n=e.inlineTemplate?null:Qs(e,i,!0);return"_c("+t+","+Js(e,i)+(n?","+n:"")+")"}(t.component,t,e);else{var n;(!t.plain||t.pre&&e.maybeComponent(t))&&(n=Js(t,e));var o=t.inlineTemplate?null:Qs(t,e,!0);i="_c('"+t.tag+"'"+(n?","+n:"")+(o?","+o:"")+")"}for(var r=0;r>>0}(s):"")+")"}(t,t.scopedSlots,e)+","),t.model&&(i+="model:{value:"+t.model.value+",callback:"+t.model.callback+",expression:"+t.model.expression+"},"),t.inlineTemplate){var r=function(t,e){var i=t.children[0];0;if(i&&1===i.type){var n=$s(i,e.options);return"inlineTemplate:{render:function(){"+n.render+"},staticRenderFns:["+n.staticRenderFns.map(function(t){return"function(){"+t+"}"}).join(",")+"]}"}}(t,e);r&&(i+=r+",")}return i=i.replace(/,$/,"")+"}",t.dynamicAttrs&&(i="_b("+i+',"'+t.tag+'",'+ia(t.dynamicAttrs)+")"),t.wrapData&&(i=t.wrapData(i)),t.wrapListeners&&(i=t.wrapListeners(i)),i}function qs(t){return 1===t.type&&("slot"===t.tag||t.children.some(qs))}function Zs(t,e){var i=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!i)return Ys(t,e,Zs,"null");if(t.for&&!t.forProcessed)return Ks(t,e,Zs);var n=t.slotScope===gs?"":String(t.slotScope),o="function("+n+"){return "+("template"===t.tag?t.if&&i?"("+t.if+")?"+(Qs(t,e)||"undefined")+":undefined":Qs(t,e)||"undefined":js(t,e))+"}",r=n?"":",proxy:true";return"{key:"+(t.slotTarget||'"default"')+",fn:"+o+r+"}"}function Qs(t,e,i,n,o){var r=t.children;if(r.length){var s=r[0];if(1===r.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=i?e.maybeComponent(s)?",1":",0":"";return""+(n||js)(s,e)+a}var l=i?function(t,e){for(var i=0,n=0;n':'
',aa.innerHTML.indexOf(" ")>0}var ha=!!X&&ua(!1),pa=!!X&&ua(!0),da=T(function(t){var e=nn(t);return e&&e.innerHTML}),fa=Oi.prototype.$mount;Oi.prototype.$mount=function(t,e){if((t=t&&nn(t))===document.body||t===document.documentElement)return this;var i=this.$options;if(!i.render){var n=i.template;if(n)if("string"==typeof n)"#"===n.charAt(0)&&(n=da(n));else{if(!n.nodeType)return this;n=n.innerHTML}else t&&(n=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(n){0;var o=ca(n,{outputSourceRange:!1,shouldDecodeNewlines:ha,shouldDecodeNewlinesForHref:pa,delimiters:i.delimiters,comments:i.comments},this),r=o.render,s=o.staticRenderFns;i.render=r,i.staticRenderFns=s}}return fa.call(this,t,e)},Oi.compile=ca,e.default=Oi}.call(e,i("DuR2"))},"77Pl":function(t,e,i){var n=i("EqjI");t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},"7GwW":function(t,e,i){"use strict";var n=i("cGG2"),o=i("21It"),r=i("p1b6"),s=i("DQCr"),a=i("Oi+a"),l=i("oJlt"),c=i("GHBc"),u=i("FtD3");t.exports=function(t){return new Promise(function(e,i){var h=t.data,p=t.headers;n.isFormData(h)&&delete p["Content-Type"];var d=new XMLHttpRequest;if(t.auth){var f=t.auth.username||"",g=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";p.Authorization="Basic "+btoa(f+":"+g)}var _=a(t.baseURL,t.url);if(d.open(t.method.toUpperCase(),s(_,t.params,t.paramsSerializer),!0),d.timeout=t.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?l(d.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:t,request:d};o(e,i,r),d=null}},d.onabort=function(){d&&(i(u("Request aborted",t,"ECONNABORTED",d)),d=null)},d.onerror=function(){i(u("Network Error",t,null,d)),d=null},d.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),i(u(e,t,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var m=(t.withCredentials||c(_))&&t.xsrfCookieName?r.read(t.xsrfCookieName):void 0;m&&(p[t.xsrfHeaderName]=m)}if("setRequestHeader"in d&&n.forEach(p,function(t,e){void 0===h&&"content-type"===e.toLowerCase()?delete p[e]:d.setRequestHeader(e,t)}),n.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),t.responseType)try{d.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&d.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){d&&(d.abort(),i(t),d=null)}),h||(h=null),d.send(h)})}},"7J9s":function(t,e,i){"use strict";e.__esModule=!0,e.PopupManager=void 0;var n=l(i("7+uW")),o=l(i("jmaC")),r=l(i("OAzY")),s=l(i("6Twh")),a=i("2kvA");function l(t){return t&&t.__esModule?t:{default:t}}var c=1,u=void 0;e.default={props:{visible:{type:Boolean,default:!1},openDelay:{},closeDelay:{},zIndex:{},modal:{type:Boolean,default:!1},modalFade:{type:Boolean,default:!0},modalClass:{},modalAppendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1}},beforeMount:function(){this._popupId="popup-"+c++,r.default.register(this._popupId,this)},beforeDestroy:function(){r.default.deregister(this._popupId),r.default.closeModal(this._popupId),this.restoreBodyStyle()},data:function(){return{opened:!1,bodyPaddingRight:null,computedBodyPaddingRight:0,withoutHiddenClass:!0,rendered:!1}},watch:{visible:function(t){var e=this;if(t){if(this._opening)return;this.rendered?this.open():(this.rendered=!0,n.default.nextTick(function(){e.open()}))}else this.close()}},methods:{open:function(t){var e=this;this.rendered||(this.rendered=!0);var i=(0,o.default)({},this.$props||this,t);this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),clearTimeout(this._openTimer);var n=Number(i.openDelay);n>0?this._openTimer=setTimeout(function(){e._openTimer=null,e.doOpen(i)},n):this.doOpen(i)},doOpen:function(t){if(!this.$isServer&&(!this.willOpen||this.willOpen())&&!this.opened){this._opening=!0;var e=this.$el,i=t.modal,n=t.zIndex;if(n&&(r.default.zIndex=n),i&&(this._closing&&(r.default.closeModal(this._popupId),this._closing=!1),r.default.openModal(this._popupId,r.default.nextZIndex(),this.modalAppendToBody?void 0:e,t.modalClass,t.modalFade),t.lockScroll)){this.withoutHiddenClass=!(0,a.hasClass)(document.body,"el-popup-parent--hidden"),this.withoutHiddenClass&&(this.bodyPaddingRight=document.body.style.paddingRight,this.computedBodyPaddingRight=parseInt((0,a.getStyle)(document.body,"paddingRight"),10)),u=(0,s.default)();var o=document.documentElement.clientHeight0&&(o||"scroll"===l)&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.computedBodyPaddingRight+u+"px"),(0,a.addClass)(document.body,"el-popup-parent--hidden")}"static"===getComputedStyle(e).position&&(e.style.position="absolute"),e.style.zIndex=r.default.nextZIndex(),this.opened=!0,this.onOpen&&this.onOpen(),this.doAfterOpen()}},doAfterOpen:function(){this._opening=!1},close:function(){var t=this;if(!this.willClose||this.willClose()){null!==this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null),clearTimeout(this._closeTimer);var e=Number(this.closeDelay);e>0?this._closeTimer=setTimeout(function(){t._closeTimer=null,t.doClose()},e):this.doClose()}},doClose:function(){this._closing=!0,this.onClose&&this.onClose(),this.lockScroll&&setTimeout(this.restoreBodyStyle,200),this.opened=!1,this.doAfterClose()},doAfterClose:function(){r.default.closeModal(this._popupId),this._closing=!1},restoreBodyStyle:function(){this.modal&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.bodyPaddingRight,(0,a.removeClass)(document.body,"el-popup-parent--hidden")),this.withoutHiddenClass=!0}}},e.PopupManager=r.default},"7KvD":function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},"7UMu":function(t,e,i){var n=i("R9M2");t.exports=Array.isArray||function(t){return"Array"==n(t)}},"82Mu":function(t,e,i){var n=i("7KvD"),o=i("L42u").set,r=n.MutationObserver||n.WebKitMutationObserver,s=n.process,a=n.Promise,l="process"==i("R9M2")(s);t.exports=function(){var t,e,i,c=function(){var n,o;for(l&&(n=s.domain)&&n.exit();t;){o=t.fn,t=t.next;try{o()}catch(n){throw t?i():e=void 0,n}}e=void 0,n&&n.enter()};if(l)i=function(){s.nextTick(c)};else if(!r||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var u=a.resolve(void 0);i=function(){u.then(c)}}else i=function(){o.call(n,c)};else{var h=!0,p=document.createTextNode("");new r(c).observe(p,{characterData:!0}),i=function(){p.data=h=!h}}return function(n){var o={fn:n,next:void 0};e&&(e.next=o),t||(t=o,i()),e=o}}},"835U":function(t,e,i){"use strict";e.__esModule=!0,e.isDefined=e.isUndefined=e.isFunction=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.isString=function(t){return"[object String]"===Object.prototype.toString.call(t)},e.isObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)},e.isHtmlElement=function(t){return t&&t.nodeType===Node.ELEMENT_NODE};var o,r=i("7+uW"),s=(o=r)&&o.__esModule?o:{default:o};var a=function(t){return t&&"[object Function]"==={}.toString.call(t)};"function"==typeof/./||"object"===("undefined"==typeof Int8Array?"undefined":n(Int8Array))||!s.default.prototype.$isServer&&"function"==typeof document.childNodes||(e.isFunction=a=function(t){return"function"==typeof t||!1}),e.isFunction=a;e.isUndefined=function(t){return void 0===t},e.isDefined=function(t){return void 0!==t&&null!==t}},"880/":function(t,e,i){t.exports=i("hJx8")},"94VQ":function(t,e,i){"use strict";var n=i("Yobk"),o=i("X8DO"),r=i("e6n0"),s={};i("hJx8")(s,i("dSzd")("iterator"),function(){return this}),t.exports=function(t,e,i){t.prototype=n(s,{next:o(1,i)}),r(t,e+" Iterator")}},AMCD:function(t,e,i){"use strict";e.__esModule=!0,e.validateRangeInOneMonth=e.extractTimeFormat=e.extractDateFormat=e.nextYear=e.prevYear=e.nextMonth=e.prevMonth=e.changeYearMonthAndClampDate=e.timeWithinRange=e.limitTimeRange=e.clearMilliseconds=e.clearTime=e.modifyWithTimeString=e.modifyTime=e.modifyDate=e.range=e.getRangeMinutes=e.getMonthDays=e.getPrevMonthLastDays=e.getRangeHours=e.getWeekNumber=e.getStartDateOfMonth=e.nextDate=e.prevDate=e.getFirstDayOfMonth=e.getDayCountOfYear=e.getDayCountOfMonth=e.parseDate=e.formatDate=e.isDateObject=e.isDate=e.toDate=e.getI18nSettings=void 0;var n,o=i("eNfa"),r=(n=o)&&n.__esModule?n:{default:n},s=i("urW8");var a=["sun","mon","tue","wed","thu","fri","sat"],l=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],c=e.getI18nSettings=function(){return{dayNamesShort:a.map(function(t){return(0,s.t)("el.datepicker.weeks."+t)}),dayNames:a.map(function(t){return(0,s.t)("el.datepicker.weeks."+t)}),monthNamesShort:l.map(function(t){return(0,s.t)("el.datepicker.months."+t)}),monthNames:l.map(function(t,e){return(0,s.t)("el.datepicker.month"+(e+1))}),amPm:["am","pm"]}},u=e.toDate=function(t){return h(t)?new Date(t):null},h=e.isDate=function(t){return null!==t&&void 0!==t&&(!isNaN(new Date(t).getTime())&&!Array.isArray(t))},p=(e.isDateObject=function(t){return t instanceof Date},e.formatDate=function(t,e){return(t=u(t))?r.default.format(t,e||"yyyy-MM-dd",c()):""},e.parseDate=function(t,e){return r.default.parse(t,e||"yyyy-MM-dd",c())}),d=e.getDayCountOfMonth=function(t,e){return 3===e||5===e||8===e||10===e?30:1===e?t%4==0&&t%100!=0||t%400==0?29:28:31},f=(e.getDayCountOfYear=function(t){return t%400==0||t%100!=0&&t%4==0?366:365},e.getFirstDayOfMonth=function(t){var e=new Date(t.getTime());return e.setDate(1),e.getDay()},e.prevDate=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Date(t.getFullYear(),t.getMonth(),t.getDate()-e)});e.nextDate=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+e)},e.getStartDateOfMonth=function(t,e){var i=new Date(t,e,1),n=i.getDay();return f(i,0===n?7:n)},e.getWeekNumber=function(t){if(!h(t))return null;var e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var i=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},e.getRangeHours=function(t){var e=[],i=[];if((t||[]).forEach(function(t){var e=t.map(function(t){return t.getHours()});i=i.concat(function(t,e){for(var i=[],n=t;n<=e;n++)i.push(n);return i}(e[0],e[1]))}),i.length)for(var n=0;n<24;n++)e[n]=-1===i.indexOf(n);else for(var o=0;o<24;o++)e[o]=!1;return e},e.getPrevMonthLastDays=function(t,e){if(e<=0)return[];var i=new Date(t.getTime());i.setDate(0);var n=i.getDate();return _(e).map(function(t,i){return n-(e-i-1)})},e.getMonthDays=function(t){var e=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();return _(e).map(function(t,e){return e+1})};function g(t,e,i,n){for(var o=e;o0?t.forEach(function(t){var n=t[0],o=t[1],r=n.getHours(),s=n.getMinutes(),a=o.getHours(),l=o.getMinutes();r===e&&a!==e?g(i,s,60,!0):r===e&&a===e?g(i,s,l+1,!0):r!==e&&a===e?g(i,0,l+1,!0):re&&g(i,0,60,!0)}):g(i,0,60,!0),i};var _=e.range=function(t){return Array.apply(null,{length:t}).map(function(t,e){return e})},m=e.modifyDate=function(t,e,i,n){return new Date(e,i,n,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())},v=e.modifyTime=function(t,e,i,n){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e,i,n,t.getMilliseconds())},y=(e.modifyWithTimeString=function(t,e){return null!=t&&e?(e=p(e,"HH:mm:ss"),v(t,e.getHours(),e.getMinutes(),e.getSeconds())):t},e.clearTime=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},e.clearMilliseconds=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),0)},e.limitTimeRange=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"HH:mm:ss";if(0===e.length)return t;var n=function(t){return r.default.parse(r.default.format(t,i),i)},o=n(t),s=e.map(function(t){return t.map(n)});if(s.some(function(t){return o>=t[0]&&o<=t[1]}))return t;var a=s[0][0],l=s[0][0];return s.forEach(function(t){a=new Date(Math.min(t[0],a)),l=new Date(Math.max(t[1],a))}),m(o1&&void 0!==arguments[1]?arguments[1]:1,i=t.getFullYear(),n=t.getMonth();return b(t,i-e,n)},e.nextYear=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=t.getFullYear(),n=t.getMonth();return b(t,i+e,n)},e.extractDateFormat=function(t){return t.replace(/\W?m{1,2}|\W?ZZ/g,"").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi,"").trim()},e.extractTimeFormat=function(t){return t.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g,"").trim()},e.validateRangeInOneMonth=function(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}},BO1k:function(t,e,i){t.exports={default:i("fxRn"),__esModule:!0}},BwfY:function(t,e,i){i("fWfb"),i("M6a0"),i("OYls"),i("QWe/"),t.exports=i("FeBl").Symbol},CXw9:function(t,e,i){"use strict";var n,o,r,s,a=i("O4g8"),l=i("7KvD"),c=i("+ZMJ"),u=i("RY/4"),h=i("kM2E"),p=i("EqjI"),d=i("lOnJ"),f=i("2KxR"),g=i("NWt+"),_=i("t8x9"),m=i("L42u").set,v=i("82Mu")(),y=i("qARP"),b=i("dNDb"),T=i("iUbK"),E=i("fJUb"),C=l.TypeError,S=l.process,k=S&&S.versions,O=k&&k.v8||"",I=l.Promise,w="process"==u(S),R=function(){},D=o=y.f,x=!!function(){try{var t=I.resolve(1),e=(t.constructor={})[i("dSzd")("species")]=function(t){t(R,R)};return(w||"function"==typeof PromiseRejectionEvent)&&t.then(R)instanceof e&&0!==O.indexOf("6.6")&&-1===T.indexOf("Chrome/66")}catch(t){}}(),M=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},A=function(t,e){if(!t._n){t._n=!0;var i=t._c;v(function(){for(var n=t._v,o=1==t._s,r=0,s=function(e){var i,r,s,a=o?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{a?(o||(2==t._h&&P(t),t._h=1),!0===a?i=n:(u&&u.enter(),i=a(n),u&&(u.exit(),s=!0)),i===e.promise?c(C("Promise-chain cycle")):(r=M(i))?r.call(i,l,c):l(i)):c(n)}catch(t){u&&!s&&u.exit(),c(t)}};i.length>r;)s(i[r++]);t._c=[],t._n=!1,e&&!t._h&&N(t)})}},N=function(t){m.call(l,function(){var e,i,n,o=t._v,r=L(t);if(r&&(e=b(function(){w?S.emit("unhandledRejection",o,t):(i=l.onunhandledrejection)?i({promise:t,reason:o}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",o)}),t._h=w||L(t)?2:1),t._a=void 0,r&&e.e)throw e.v})},L=function(t){return 1!==t._h&&0===(t._a||t._c).length},P=function(t){m.call(l,function(){var e;w?S.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})})},B=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),A(e,!0))},F=function(t){var e,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw C("Promise can't be resolved itself");(e=M(t))?v(function(){var n={_w:i,_d:!1};try{e.call(t,c(F,n,1),c(B,n,1))}catch(t){B.call(n,t)}}):(i._v=t,i._s=1,A(i,!1))}catch(t){B.call({_w:i,_d:!1},t)}}};x||(I=function(t){f(this,I,"Promise","_h"),d(t),n.call(this);try{t(c(F,this,1),c(B,this,1))}catch(t){B.call(this,t)}},(n=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i("xH/j")(I.prototype,{then:function(t,e){var i=D(_(this,I));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=w?S.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&A(this,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new n;this.promise=t,this.resolve=c(F,t,1),this.reject=c(B,t,1)},y.f=D=function(t){return t===I||t===s?new r(t):o(t)}),h(h.G+h.W+h.F*!x,{Promise:I}),i("e6n0")(I,"Promise"),i("bRrM")("Promise"),s=i("FeBl").Promise,h(h.S+h.F*!x,"Promise",{reject:function(t){var e=D(this);return(0,e.reject)(t),e.promise}}),h(h.S+h.F*(a||!x),"Promise",{resolve:function(t){return E(a&&this===s?I:this,t)}}),h(h.S+h.F*!(x&&i("dY0y")(function(t){I.all(t).catch(R)})),"Promise",{all:function(t){var e=this,i=D(e),n=i.resolve,o=i.reject,r=b(function(){var i=[],r=0,s=1;g(t,!1,function(t){var a=r++,l=!1;i.push(void 0),s++,e.resolve(t).then(function(t){l||(l=!0,i[a]=t,--s||n(i))},o)}),--s||n(i)});return r.e&&o(r.v),i.promise},race:function(t){var e=this,i=D(e),n=i.reject,o=b(function(){g(t,!1,function(t){e.resolve(t).then(i.resolve,n)})});return o.e&&n(o.v),i.promise}})},Cdx3:function(t,e,i){var n=i("sB3e"),o=i("lktj");i("uqUo")("keys",function(){return function(t){return o(n(t))}})},Cr6W:function(t,e,i){var n,o,r,s;s=function(t,e){ /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 */ "use strict";return t.JavaScript=e,e},o=[i("xnUL"),i("JMbB")],void 0===(r="function"==typeof(n=s)?n.apply(e,o):n)||(t.exports=r)},CwSZ:function(t,e,i){"use strict";var n=i("p8xL"),o=i("XgCd"),r=Object.prototype.hasOwnProperty,s={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},a=Array.isArray,l=Array.prototype.push,c=function(t,e){l.apply(t,a(e)?e:[e])},u=Date.prototype.toISOString,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,formatter:o.formatters[o.default],indices:!1,serializeDate:function(t){return u.call(t)},skipNulls:!1,strictNullHandling:!1},p=function t(e,i,o,r,s,l,u,p,d,f,g,_,m){var v=e;if("function"==typeof u?v=u(i,v):v instanceof Date?v=f(v):"comma"===o&&a(v)&&(v=v.join(",")),null===v){if(r)return l&&!_?l(i,h.encoder,m):i;v=""}if("string"==typeof v||"number"==typeof v||"boolean"==typeof v||n.isBuffer(v))return l?[g(_?i:l(i,h.encoder,m))+"="+g(l(v,h.encoder,m))]:[g(i)+"="+g(String(v))];var y,b=[];if(void 0===v)return b;if(a(u))y=u;else{var T=Object.keys(v);y=p?T.sort(p):T}for(var E=0;E0?v+m:""}},D2L2:function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},DDCP:function(t,e,i){"use strict";var n=i("p8xL"),o=Object.prototype.hasOwnProperty,r={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},a=function(t,e,i){if(t){var n=i.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,r=/(\[[^[\]]*])/g,s=/(\[[^[\]]*])/.exec(n),a=s?n.slice(0,s.index):n,l=[];if(a){if(!i.plainObjects&&o.call(Object.prototype,a)&&!i.allowPrototypes)return;l.push(a)}for(var c=0;null!==(s=r.exec(n))&&c=0;--o){var r,s=t[o];if("[]"===s&&i.parseArrays)r=[].concat(n);else{r=i.plainObjects?Object.create(null):{};var a="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(a,10);i.parseArrays||""!==a?!isNaN(l)&&s!==a&&String(l)===a&&l>=0&&i.parseArrays&&l<=i.arrayLimit?(r=[])[l]=n:r[a]=n:r={0:n}}n=r}return n}(l,e,i)}};t.exports=function(t,e){var i=function(t){if(!t)return r;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?r.charset:t.charset;return{allowDots:void 0===t.allowDots?r.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:r.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:r.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:r.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:r.comma,decoder:"function"==typeof t.decoder?t.decoder:r.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:r.delimiter,depth:"number"==typeof t.depth?t.depth:r.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:r.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:r.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:r.strictNullHandling}}(e);if(""===t||null===t||void 0===t)return i.plainObjects?Object.create(null):{};for(var l="string"==typeof t?function(t,e){var i,a={},l=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,c=e.parameterLimit===1/0?void 0:e.parameterLimit,u=l.split(e.delimiter,c),h=-1,p=e.charset;if(e.charsetSentinel)for(i=0;i-1&&(f=f.split(",")),o.call(a,d)?a[d]=n.combine(a[d],f):a[d]=f}return a}(t,i):t,c=i.plainObjects?Object.create(null):{},u=Object.keys(l),h=0;h-1:t._q(t.model,t.trueLabel)},on:{change:[function(e){var i=t.model,n=e.target,o=n.checked?t.trueLabel:t.falseLabel;if(Array.isArray(i)){var r=t._i(i,null);n.checked?r<0&&(t.model=i.concat([null])):r>-1&&(t.model=i.slice(0,r).concat(i.slice(r+1)))}else t.model=o},t.handleChange],focus:function(e){t.focus=!0},blur:function(e){t.focus=!1}}}):i("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":t.indeterminate?"true":"false",disabled:t.isDisabled,name:t.name},domProps:{value:t.label,checked:Array.isArray(t.model)?t._i(t.model,t.label)>-1:t.model},on:{change:[function(e){var i=t.model,n=e.target,o=!!n.checked;if(Array.isArray(i)){var r=t.label,s=t._i(i,r);n.checked?s<0&&(t.model=i.concat([r])):s>-1&&(t.model=i.slice(0,s).concat(i.slice(s+1)))}else t.model=o},t.handleChange],focus:function(e){t.focus=!0},blur:function(e){t.focus=!1}}})]),t.$slots.default||t.label?i("span",{staticClass:"el-checkbox__label"},[t._t("default"),t.$slots.default?t._e():[t._v(t._s(t.label))]],2):t._e()])};n._withStripped=!0;var o=i(4),r={name:"ElCheckbox",mixins:[i.n(o).a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElCheckbox",data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(t){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&t.lengththis._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[t])):(this.$emit("input",t),this.selfModel=t)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},isGroup:function(){for(var t=this.$parent;t;){if("ElCheckboxGroup"===t.$options.componentName)return this._checkboxGroup=t,!0;t=t.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isLimitDisabled:function(){var t=this._checkboxGroup,e=t.max,i=t.min;return!(!e&&!i)&&this.model.length>=e&&!this.isChecked||this.model.length<=i&&this.isChecked},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxSize:function(){var t=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._checkboxGroup.checkboxGroupSize||t}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number],id:String,controls:String,border:Boolean,size:String},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(t){var e=this;if(!this.isLimitExceeded){var i=void 0;i=t.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",i,t),this.$nextTick(function(){e.isGroup&&e.dispatch("ElCheckboxGroup","change",[e._checkboxGroup.value])})}}},created:function(){this.checked&&this.addToStore()},mounted:function(){this.indeterminate&&this.$el.setAttribute("aria-controls",this.controls)},watch:{value:function(t){this.dispatch("ElFormItem","el.form.change",t)}}},s=i(0),a=Object(s.a)(r,n,[],!1,null,null,null);a.options.__file="packages/checkbox/src/checkbox.vue";var l=a.exports;l.install=function(t){t.component(l.name,l)};e.default=l},4:function(t,e){t.exports=i("fPll")}})},EqBC:function(t,e,i){"use strict";var n=i("kM2E"),o=i("FeBl"),r=i("7KvD"),s=i("t8x9"),a=i("fJUb");n(n.P+n.R,"Promise",{finally:function(t){var e=s(this,o.Promise||r.Promise),i="function"==typeof t;return this.then(i?function(i){return a(e,t()).then(function(){return i})}:t,i?function(i){return a(e,t()).then(function(){throw i})}:t)}})},EqjI:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},Ew4t:function(t,e,i){var n,o,r,s;s=function(t,e,i,n){ /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */ "use strict";return t.setLocale(e),t.Blocks=t.Blocks||{},Object.keys(i).forEach(function(e){t.Blocks[e]=i[e]}),t.JavaScript=n,t},o=[i("xnUL"),i("yUki"),i("wTUY"),i("Cr6W")],void 0===(r="function"==typeof(n=s)?n.apply(e,o):n)||(t.exports=r)},FeBl:function(t,e){var i=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=i)},FtD3:function(t,e,i){"use strict";var n=i("t8qj");t.exports=function(t,e,i,o,r){var s=new Error(t);return n(s,e,i,o,r)}},GEkh:function(t,e,i){(function(i){var n,o,r;o=[],void 0===(r="function"==typeof(n=function(){"use strict";var t={connectionTypes:{INPUT_VALUE:1,OUTPUT_VALUE:2,NEXT_STATEMENT:3,PREVIOUS_STATEMENT:4},constants:{},LINE_MODE_MULTIPLIER:40,PAGE_MODE_MULTIPLIER:125,DRAG_RADIUS:5,FLYOUT_DRAG_RADIUS:10,SNAP_RADIUS:28};return t.CONNECTING_SNAP_RADIUS=t.SNAP_RADIUS,t.CURRENT_CONNECTION_PREFERENCE=8,t.BUMP_DELAY=250,t.BUMP_RANDOMNESS=10,t.COLLAPSE_CHARS=30,t.LONGPRESS=750,t.SOUND_LIMIT=100,t.DRAG_STACK=!0,t.HSV_SATURATION=.45,t.HSV_VALUE=.65,t.SPRITE={width:96,height:124,url:"sprites.png"},t.constants.ALIGN={LEFT:-1,CENTRE:0,RIGHT:1},t.DRAG_NONE=0,t.DRAG_STICKY=1,t.DRAG_BEGIN=1,t.DRAG_FREE=2,t.OPPOSITE_TYPE=[],t.OPPOSITE_TYPE[t.connectionTypes.INPUT_VALUE]=t.connectionTypes.OUTPUT_VALUE,t.OPPOSITE_TYPE[t.connectionTypes.OUTPUT_VALUE]=t.connectionTypes.INPUT_VALUE,t.OPPOSITE_TYPE[t.connectionTypes.NEXT_STATEMENT]=t.connectionTypes.PREVIOUS_STATEMENT,t.OPPOSITE_TYPE[t.connectionTypes.PREVIOUS_STATEMENT]=t.connectionTypes.NEXT_STATEMENT,t.VARIABLE_CATEGORY_NAME="VARIABLE",t.VARIABLE_DYNAMIC_CATEGORY_NAME="VARIABLE_DYNAMIC",t.PROCEDURE_CATEGORY_NAME="PROCEDURE",t.RENAME_VARIABLE_ID="RENAME_VARIABLE_ID",t.DELETE_VARIABLE_ID="DELETE_VARIABLE_ID",t.constants.COLLAPSED_INPUT_NAME="_TEMP_COLLAPSED_INPUT",t.constants.COLLAPSED_FIELD_NAME="_TEMP_COLLAPSED_FIELD",t.utils={},t.utils.global=function(){return"object"==typeof self?self:"object"==typeof window?window:"object"==typeof i?i:this}(),t.Msg={},t.utils.global.Blockly||(t.utils.global.Blockly={}),t.utils.global.Blockly.Msg||(t.utils.global.Blockly.Msg=t.Msg),t.utils.colour={},t.utils.colour.parse=function(e){e=String(e).toLowerCase().trim();var i=t.utils.colour.names[e];if(i)return i;if(i="#"==(i="0x"==e.substring(0,2)?"#"+e.substring(2):e)[0]?i:"#"+i,/^#[0-9a-f]{6}$/.test(i))return i;if(/^#[0-9a-f]{3}$/.test(i))return["#",i[1],i[1],i[2],i[2],i[3],i[3]].join("");var n=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return n&&(e=Number(n[1]),i=Number(n[2]),n=Number(n[3]),0<=e&&256>e&&0<=i&&256>i&&0<=n&&256>n)?t.utils.colour.rgbToHex(e,i,n):null},t.utils.colour.rgbToHex=function(t,e,i){return e=t<<16|e<<8|i,16>t?"#"+(16777216|e).toString(16).substr(1):"#"+e.toString(16)},t.utils.colour.hexToRgb=function(e){return(e=t.utils.colour.parse(e))?[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e]:[0,0,0]},t.utils.colour.hsvToHex=function(e,i,n){var o=0,r=0,s=0;if(0==i)s=r=o=n;else{var a=Math.floor(e/60),l=e/60-a;e=n*(1-i);var c=n*(1-i*l);switch(i=n*(1-i*(1-l)),a){case 1:o=c,r=n,s=e;break;case 2:o=e,r=n,s=i;break;case 3:o=e,r=c,s=n;break;case 4:o=i,r=e,s=n;break;case 5:o=n,r=e,s=c;break;case 6:case 0:o=n,r=i,s=e}}return t.utils.colour.rgbToHex(Math.floor(o),Math.floor(r),Math.floor(s))},t.utils.colour.blend=function(e,i,n){return(e=t.utils.colour.parse(e))&&(i=t.utils.colour.parse(i))?(e=t.utils.colour.hexToRgb(e),i=t.utils.colour.hexToRgb(i),t.utils.colour.rgbToHex(Math.round(i[0]+n*(e[0]-i[0])),Math.round(i[1]+n*(e[1]-i[1])),Math.round(i[2]+n*(e[2]-i[2])))):null},t.utils.colour.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},t.utils.Coordinate=function(t,e){this.x=t,this.y=e},t.utils.Coordinate.equals=function(t,e){return t==e||!(!t||!e)&&(t.x==e.x&&t.y==e.y)},t.utils.Coordinate.distance=function(t,e){var i=t.x-e.x;return t=t.y-e.y,Math.sqrt(i*i+t*t)},t.utils.Coordinate.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.utils.Coordinate.difference=function(e,i){return new t.utils.Coordinate(e.x-i.x,e.y-i.y)},t.utils.Coordinate.sum=function(e,i){return new t.utils.Coordinate(e.x+i.x,e.y+i.y)},t.utils.Coordinate.prototype.clone=function(){return new t.utils.Coordinate(this.x,this.y)},t.utils.Coordinate.prototype.scale=function(t){return this.x*=t,this.y*=t,this},t.utils.Coordinate.prototype.translate=function(t,e){return this.x+=t,this.y+=e,this},t.utils.Rect=function(t,e,i,n){this.top=t,this.bottom=e,this.left=i,this.right=n},t.utils.Rect.prototype.contains=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t.utils.Rect.prototype.intersects=function(t){return!(this.left>t.right||this.rightt.bottom||this.bottomi&&(i=n[o].length);o=-1/0;var r=1;do{var s=o,a=e;e=[];var l=n.length/r,c=1;for(o=0;os);return a},t.utils.string.wrapScore_=function(t,e,i){for(var n=[0],o=[],r=0;rr&&(r=l,o=a)}return o?t.utils.string.wrapMutate_(e,o,n):i},t.utils.string.wrapToText_=function(t,e){for(var i=[],n=0;n=l?(r=2,s=l,(l=e.join(""))&&n.push(l),e.length=0):"{"==l?r=3:(e.push("%",l),r=0):2==r?"0"<=l&&"9">=l?s+=l:(n.push(parseInt(s,10)),a--,r=0):3==r&&(""==l?(e.splice(0,0,"%{"),a--,r=0):"}"!=l?e.push(l):(r=e.join(""),/[A-Z]\w*/i.test(r)?(l=r.toUpperCase(),(l=t.utils.string.startsWith(l,"BKY_")?l.substring(4):null)&&l in t.Msg?"string"==typeof(r=t.Msg[l])?Array.prototype.push.apply(n,t.utils.tokenizeInterpolation_(r,i)):i?n.push(String(r)):n.push(r):n.push("%{"+r+"}")):n.push("%{"+r+"}"),r=e.length=0))}for((l=e.join(""))&&n.push(l),i=[],a=e.length=0;an;n++)i[n]=t.utils.genUid.soup_.charAt(Math.random()*e);return i.join("")},t.utils.genUid.soup_="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t.utils.is3dSupported=function(){if(void 0!==t.utils.is3dSupported.cached_)return t.utils.is3dSupported.cached_;if(!t.utils.global.getComputedStyle)return!1;var e=document.createElement("p"),i="none",n={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};for(var o in document.body.insertBefore(e,null),n)if(void 0!==e.style[o]){if(e.style[o]="translate3d(1px,1px,1px)",!(i=t.utils.global.getComputedStyle(e)))return document.body.removeChild(e),!1;i=i.getPropertyValue(n[o])}return document.body.removeChild(e),t.utils.is3dSupported.cached_="none"!==i,t.utils.is3dSupported.cached_},t.utils.runAfterPageLoad=function(t){if("object"!=typeof document)throw Error("Blockly.utils.runAfterPageLoad() requires browser document.");if("complete"==document.readyState)t();else var e=setInterval(function(){"complete"==document.readyState&&(clearInterval(e),t())},10)},t.utils.getViewportBBox=function(){var e=t.utils.style.getViewportPageOffset();return new t.utils.Rect(e.y,document.documentElement.clientHeight+e.y,e.x,document.documentElement.clientWidth+e.x)},t.utils.arrayRemove=function(t,e){return-1!=(e=t.indexOf(e))&&(t.splice(e,1),!0)},t.utils.getDocumentScroll=function(){var e=document.documentElement,i=window;return t.utils.userAgent.IE&&i.pageYOffset!=e.scrollTop?new t.utils.Coordinate(e.scrollLeft,e.scrollTop):new t.utils.Coordinate(i.pageXOffset||e.scrollLeft,i.pageYOffset||e.scrollTop)},t.utils.getBlockTypeCounts=function(t,e){var i=Object.create(null),n=t.getDescendants(!0);for(e&&(t=t.getNextBlock())&&(t=n.indexOf(t),n.splice(t,n.length-t)),t=0;e=n[t];t++)i[e.type]?i[e.type]++:i[e.type]=1;return i},t.utils.screenToWsCoordinates=function(e,i){var n=i.x;i=i.y;var o=e.getInjectionDiv().getBoundingClientRect();return n=new t.utils.Coordinate(n-o.left,i-o.top),i=e.getOriginOffsetInPixels(),t.utils.Coordinate.difference(n,i).scale(1/e.scale)},t.utils.parseBlockColour=function(e){var i="string"==typeof e?t.utils.replaceMessageReferences(e):e,n=Number(i);if(!isNaN(n)&&0<=n&&360>=n)return{hue:n,hex:t.utils.colour.hsvToHex(n,t.HSV_SATURATION,255*t.HSV_VALUE)};if(n=t.utils.colour.parse(i))return{hue:null,hex:n};throw n='Invalid colour: "'+i+'"',e!=i&&(n+=' (from "'+e+'")'),Error(n)},t.Touch={},t.Touch.TOUCH_ENABLED="ontouchstart"in t.utils.global||!!(t.utils.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!t.utils.global.navigator||!t.utils.global.navigator.maxTouchPoints&&!t.utils.global.navigator.msMaxTouchPoints),t.Touch.touchIdentifier_=null,t.Touch.TOUCH_MAP={},t.utils.global.PointerEvent?t.Touch.TOUCH_MAP={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:t.Touch.TOUCH_ENABLED&&(t.Touch.TOUCH_MAP={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]}),t.longPid_=0,t.longStart=function(e,i){t.longStop_(),e.changedTouches&&1!=e.changedTouches.length||(t.longPid_=setTimeout(function(){e.changedTouches&&(e.button=2,e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),i&&i.handleRightClick(e)},t.LONGPRESS))},t.longStop_=function(){t.longPid_&&(clearTimeout(t.longPid_),t.longPid_=0)},t.Touch.clearTouchIdentifier=function(){t.Touch.touchIdentifier_=null},t.Touch.shouldHandleEvent=function(e){return!t.Touch.isMouseOrTouchEvent(e)||t.Touch.checkTouchIdentifier(e)},t.Touch.getTouchIdentifierFromEvent=function(t){return void 0!=t.pointerId?t.pointerId:t.changedTouches&&t.changedTouches[0]&&void 0!==t.changedTouches[0].identifier&&null!==t.changedTouches[0].identifier?t.changedTouches[0].identifier:"mouse"},t.Touch.checkTouchIdentifier=function(e){var i=t.Touch.getTouchIdentifierFromEvent(e);return void 0!==t.Touch.touchIdentifier_&&null!==t.Touch.touchIdentifier_?t.Touch.touchIdentifier_==i:("mousedown"==e.type||"touchstart"==e.type||"pointerdown"==e.type)&&(t.Touch.touchIdentifier_=i,!0)},t.Touch.setClientFromTouch=function(e){if(t.utils.string.startsWith(e.type,"touch")){var i=e.changedTouches[0];e.clientX=i.clientX,e.clientY=i.clientY}},t.Touch.isMouseOrTouchEvent=function(e){return t.utils.string.startsWith(e.type,"touch")||t.utils.string.startsWith(e.type,"mouse")||t.utils.string.startsWith(e.type,"pointer")},t.Touch.isTouchEvent=function(e){return t.utils.string.startsWith(e.type,"touch")||t.utils.string.startsWith(e.type,"pointer")},t.Touch.splitEventByTouches=function(t){var e=[];if(t.changedTouches)for(var i=0;ir.top?t.DropDownDiv.getPositionAboveMetrics_(n,o,r,s):i+s.heightdocument.documentElement.clientTop?t.DropDownDiv.getPositionAboveMetrics_(n,o,r,s):t.DropDownDiv.getPositionTopOfPageMetrics_(e,r,s)},t.DropDownDiv.getPositionBelowMetrics_=function(e,i,n,o){return{initialX:(e=t.DropDownDiv.getPositionX(e,n.left,n.right,o.width)).divX,initialY:i,finalX:e.divX,finalY:i+t.DropDownDiv.PADDING_Y,arrowX:e.arrowX,arrowY:-(t.DropDownDiv.ARROW_SIZE/2+t.DropDownDiv.BORDER_SIZE),arrowAtTop:!0,arrowVisible:!0}},t.DropDownDiv.getPositionAboveMetrics_=function(e,i,n,o){return{initialX:(e=t.DropDownDiv.getPositionX(e,n.left,n.right,o.width)).divX,initialY:i-o.height,finalX:e.divX,finalY:i-o.height-t.DropDownDiv.PADDING_Y,arrowX:e.arrowX,arrowY:o.height-2*t.DropDownDiv.BORDER_SIZE-t.DropDownDiv.ARROW_SIZE/2,arrowAtTop:!1,arrowVisible:!0}},t.DropDownDiv.getPositionTopOfPageMetrics_=function(e,i,n){return{initialX:(e=t.DropDownDiv.getPositionX(e,i.left,i.right,n.width)).divX,initialY:0,finalX:e.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}},t.DropDownDiv.getPositionX=function(e,i,n,o){var r=e;return e=t.utils.math.clamp(i,e-o/2,n-o),r-=t.DropDownDiv.ARROW_SIZE/2,i=t.DropDownDiv.ARROW_HORIZONTAL_PADDING,{arrowX:o=t.utils.math.clamp(i,r-e,o-i-t.DropDownDiv.ARROW_SIZE),divX:e}},t.DropDownDiv.isVisible=function(){return!!t.DropDownDiv.owner_},t.DropDownDiv.hideIfOwner=function(e,i){return t.DropDownDiv.owner_===e&&(i?t.DropDownDiv.hideWithoutAnimation():t.DropDownDiv.hide(),!0)},t.DropDownDiv.hide=function(){var e=t.DropDownDiv.DIV_;e.style.transform="translate(0, 0)",e.style.opacity=0,t.DropDownDiv.animateOutTimer_=setTimeout(function(){t.DropDownDiv.hideWithoutAnimation()},1e3*t.DropDownDiv.ANIMATION_TIME),t.DropDownDiv.onHide_&&(t.DropDownDiv.onHide_(),t.DropDownDiv.onHide_=null)},t.DropDownDiv.hideWithoutAnimation=function(){if(t.DropDownDiv.isVisible()){t.DropDownDiv.animateOutTimer_&&clearTimeout(t.DropDownDiv.animateOutTimer_);var e=t.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="",t.DropDownDiv.onHide_&&(t.DropDownDiv.onHide_(),t.DropDownDiv.onHide_=null),t.DropDownDiv.clearContent(),t.DropDownDiv.owner_=null,t.DropDownDiv.rendererClassName_&&(t.utils.dom.removeClass(e,t.DropDownDiv.rendererClassName_),t.DropDownDiv.rendererClassName_=""),t.DropDownDiv.themeClassName_&&(t.utils.dom.removeClass(e,t.DropDownDiv.themeClassName_),t.DropDownDiv.themeClassName_=""),t.getMainWorkspace().markFocused()}},t.DropDownDiv.positionInternal_=function(e,i,n,o){(e=t.DropDownDiv.getPositionMetrics_(e,i,n,o)).arrowVisible?(t.DropDownDiv.arrow_.style.display="",t.DropDownDiv.arrow_.style.transform="translate("+e.arrowX+"px,"+e.arrowY+"px) rotate(45deg)",t.DropDownDiv.arrow_.setAttribute("class",e.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):t.DropDownDiv.arrow_.style.display="none",i=Math.floor(e.initialX),n=Math.floor(e.initialY),o=Math.floor(e.finalX);var r=Math.floor(e.finalY),s=t.DropDownDiv.DIV_;return s.style.left=i+"px",s.style.top=n+"px",s.style.display="block",s.style.opacity=1,s.style.transform="translate("+(o-i)+"px,"+(r-n)+"px)",!!e.arrowAtTop},t.DropDownDiv.repositionForWindowResize=function(){if(t.DropDownDiv.owner_){var e=t.DropDownDiv.owner_,i=e.getSourceBlock();i=(e=t.DropDownDiv.positionToField_?t.DropDownDiv.getScaledBboxOfField_(e):t.DropDownDiv.getScaledBboxOfBlock_(i)).left+(e.right-e.left)/2,t.DropDownDiv.positionInternal_(i,e.bottom,i,e.top)}else t.DropDownDiv.hide()},t.registry={},t.registry.typeMap_=Object.create(null),t.registry.DEFAULT="default",t.registry.Type=function(t){this.name_=t},t.registry.Type.prototype.toString=function(){return this.name_},t.registry.Type.CONNECTION_CHECKER=new t.registry.Type("connectionChecker"),t.registry.Type.CURSOR=new t.registry.Type("cursor"),t.registry.Type.EVENT=new t.registry.Type("event"),t.registry.Type.FIELD=new t.registry.Type("field"),t.registry.Type.RENDERER=new t.registry.Type("renderer"),t.registry.Type.TOOLBOX=new t.registry.Type("toolbox"),t.registry.Type.THEME=new t.registry.Type("theme"),t.registry.Type.TOOLBOX_ITEM=new t.registry.Type("toolboxItem"),t.registry.Type.FLYOUTS_VERTICAL_TOOLBOX=new t.registry.Type("flyoutsVerticalToolbox"),t.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX=new t.registry.Type("flyoutsHorizontalToolbox"),t.registry.Type.METRICS_MANAGER=new t.registry.Type("metricsManager"),t.registry.Type.BLOCK_DRAGGER=new t.registry.Type("blockDragger"),t.registry.register=function(e,i,n,o){if(!(e instanceof t.registry.Type)&&"string"!=typeof e||""==String(e).trim())throw Error('Invalid type "'+e+'". The type must be a non-empty string or a Blockly.registry.Type.');if(e=String(e).toLowerCase(),"string"!=typeof i||""==i.trim())throw Error('Invalid name "'+i+'". The name must be a non-empty string.');if(i=i.toLowerCase(),!n)throw Error("Can not register a null value");var r=t.registry.typeMap_[e];if(r||(r=t.registry.typeMap_[e]=Object.create(null)),t.registry.validate_(e,n),!o&&r[i])throw Error('Name "'+i+'" with type "'+e+'" already registered.');r[i]=n},t.registry.validate_=function(e,i){switch(e){case String(t.registry.Type.FIELD):if("function"!=typeof i.fromJson)throw Error('Type "'+e+'" must have a fromJson function')}},t.registry.unregister=function(e,i){e=String(e).toLowerCase(),i=i.toLowerCase();var n=t.registry.typeMap_[e];n&&n[i]?delete t.registry.typeMap_[e][i]:console.warn("Unable to unregister ["+i+"]["+e+"] from the registry.")},t.registry.getItem_=function(e,i,n){e=String(e).toLowerCase(),i=i.toLowerCase();var o=t.registry.typeMap_[e];if(!o||!o[i]){if(i="Unable to find ["+i+"]["+e+"] in the registry.",n)throw Error(i+" You must require or register a "+e+" plugin.");return console.warn(i),null}return o[i]},t.registry.hasItem=function(e,i){return e=String(e).toLowerCase(),i=i.toLowerCase(),!!(e=t.registry.typeMap_[e])&&!!e[i]},t.registry.getClass=function(e,i,n){return t.registry.getItem_(e,i,n)},t.registry.getObject=function(e,i,n){return t.registry.getItem_(e,i,n)},t.registry.getClassFromOptions=function(e,i,n){return"function"==typeof(i=i.plugins[e.toString()]||t.registry.DEFAULT)?i:t.registry.getClass(e,i,n)},t.Events={},t.Events.group_="",t.Events.recordUndo=!0,t.Events.disabled_=0,t.Events.CREATE="create",t.Events.BLOCK_CREATE=t.Events.CREATE,t.Events.DELETE="delete",t.Events.BLOCK_DELETE=t.Events.DELETE,t.Events.CHANGE="change",t.Events.BLOCK_CHANGE=t.Events.CHANGE,t.Events.MOVE="move",t.Events.BLOCK_MOVE=t.Events.MOVE,t.Events.VAR_CREATE="var_create",t.Events.VAR_DELETE="var_delete",t.Events.VAR_RENAME="var_rename",t.Events.UI="ui",t.Events.BLOCK_DRAG="drag",t.Events.SELECTED="selected",t.Events.CLICK="click",t.Events.MARKER_MOVE="marker_move",t.Events.BUBBLE_OPEN="bubble_open",t.Events.TRASHCAN_OPEN="trashcan_open",t.Events.TOOLBOX_ITEM_SELECT="toolbox_item_select",t.Events.THEME_CHANGE="theme_change",t.Events.VIEWPORT_CHANGE="viewport_change",t.Events.COMMENT_CREATE="comment_create",t.Events.COMMENT_DELETE="comment_delete",t.Events.COMMENT_CHANGE="comment_change",t.Events.COMMENT_MOVE="comment_move",t.Events.FINISHED_LOADING="finished_loading",t.Events.BUMP_EVENTS=[t.Events.BLOCK_CREATE,t.Events.BLOCK_MOVE,t.Events.COMMENT_CREATE,t.Events.COMMENT_MOVE],t.Events.FIRE_QUEUE_=[],t.Events.fire=function(e){t.Events.isEnabled()&&(t.Events.FIRE_QUEUE_.length||setTimeout(t.Events.fireNow_,0),t.Events.FIRE_QUEUE_.push(e))},t.Events.fireNow_=function(){for(var e,i=t.Events.filter(t.Events.FIRE_QUEUE_,!0),n=t.Events.FIRE_QUEUE_.length=0;e=i[n];n++)if(e.workspaceId){var o=t.Workspace.getById(e.workspaceId);o&&o.fireChangeListener(e)}},t.Events.filter=function(e,i){e=e.slice(),i||e.reverse();for(var n,o=[],r=Object.create(null),s=0;n=e[s];s++)if(!n.isNull()){var a=[n.isUiEvent?t.Events.UI:n.type,n.blockId,n.workspaceId].join(" "),l=r[a],c=l?l.event:null;l?n.type==t.Events.MOVE&&l.index==s-1?(c.newParentId=n.newParentId,c.newInputName=n.newInputName,c.newCoordinate=n.newCoordinate,l.index=s):n.type==t.Events.CHANGE&&n.element==c.element&&n.name==c.name?c.newValue=n.newValue:n.type==t.Events.VIEWPORT_CHANGE?(c.viewTop=n.viewTop,c.viewLeft=n.viewLeft,c.scale=n.scale,c.oldScale=n.oldScale):n.type==t.Events.CLICK&&c.type==t.Events.BUBBLE_OPEN||(r[a]={event:n,index:s},o.push(n)):(r[a]={event:n,index:s},o.push(n))}for(e=o.filter(function(t){return!t.isNull()}),i||e.reverse(),s=1;n=e[s];s++)n.type==t.Events.CHANGE&&"mutation"==n.element&&e.unshift(e.splice(s,1)[0]);return e},t.Events.clearPendingUndo=function(){for(var e,i=0;e=t.Events.FIRE_QUEUE_[i];i++)e.recordUndo=!1},t.Events.disable=function(){t.Events.disabled_++},t.Events.enable=function(){t.Events.disabled_--},t.Events.isEnabled=function(){return 0==t.Events.disabled_},t.Events.getGroup=function(){return t.Events.group_},t.Events.setGroup=function(e){t.Events.group_="boolean"==typeof e?e?t.utils.genUid():"":e},t.Events.getDescendantIds=function(t){var e=[];t=t.getDescendants(!1);for(var i,n=0;i=t[n];n++)e[n]=i.id;return e},t.Events.fromJson=function(e,i){var n=t.Events.get(e.type);if(!n)throw Error("Unknown event type.");return(n=new n).fromJson(e),n.workspaceId=i.id,n},t.Events.get=function(e){return t.registry.getClass(t.registry.Type.EVENT,e)},t.Events.disableOrphans=function(e){if((e.type==t.Events.MOVE||e.type==t.Events.CREATE)&&e.workspaceId){var i=t.Workspace.getById(e.workspaceId),n=i.getBlockById(e.blockId);if(n){e=t.Events.recordUndo;try{t.Events.recordUndo=!1;var o=n.getParent();if(o&&o.isEnabled()){var r,s=n.getDescendants(!1);for(i=0;r=s[i];i++)r.setEnabled(!0)}else if((n.outputConnection||n.previousConnection)&&!i.isDragging())do{n.setEnabled(!1),n=n.getNextBlock()}while(n)}finally{t.Events.recordUndo=e}}}},t.Events.Abstract=function(){this.isBlank=null,this.workspaceId=void 0,this.group=t.Events.getGroup(),this.recordUndo=t.Events.recordUndo},t.Events.Abstract.prototype.isUiEvent=!1,t.Events.Abstract.prototype.toJson=function(){var t={type:this.type};return this.group&&(t.group=this.group),t},t.Events.Abstract.prototype.fromJson=function(t){this.isBlank=!1,this.group=t.group},t.Events.Abstract.prototype.isNull=function(){return!1},t.Events.Abstract.prototype.run=function(t){},t.Events.Abstract.prototype.getEventWorkspace_=function(){if(this.workspaceId)var e=t.Workspace.getById(this.workspaceId);if(!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e},t.utils.object={},t.utils.object.inherits=function(t,e){t.superClass_=e.prototype,t.prototype=Object.create(e.prototype),t.prototype.constructor=t},t.utils.object.mixin=function(t,e){for(var i in e)t[i]=e[i]},t.utils.object.deepMerge=function(e,i){for(var n in i)e[n]=null!=i[n]&&"object"==typeof i[n]?t.utils.object.deepMerge(e[n]||Object.create(null),i[n]):i[n];return e},t.utils.object.values=function(t){return Object.values?Object.values(t):Object.keys(t).map(function(e){return t[e]})},t.utils.xml={},t.utils.xml.NAME_SPACE="https://developers.google.com/blockly/xml",t.utils.xml.document=function(){return document},t.utils.xml.createElement=function(e){return t.utils.xml.document().createElementNS(t.utils.xml.NAME_SPACE,e)},t.utils.xml.createTextNode=function(e){return t.utils.xml.document().createTextNode(e)},t.utils.xml.textToDomDocument=function(t){return(new DOMParser).parseFromString(t,"text/xml")},t.utils.xml.domToText=function(t){return(new XMLSerializer).serializeToString(t)},t.inputTypes={VALUE:t.connectionTypes.INPUT_VALUE,STATEMENT:t.connectionTypes.NEXT_STATEMENT,DUMMY:5},t.Xml={},t.Xml.workspaceToDom=function(e,i){var n=t.utils.xml.createElement("xml"),o=t.Xml.variablesToDom(t.Variables.allUsedVarModels(e));o.hasChildNodes()&&n.appendChild(o);var r,s=e.getTopComments(!0);for(o=0;r=s[o];o++)n.appendChild(r.toXmlWithXY(i));for(e=e.getTopBlocks(!0),o=0;s=e[o];o++)n.appendChild(t.Xml.blockToDomWithXY(s,i));return n},t.Xml.variablesToDom=function(e){for(var i,n=t.utils.xml.createElement("variables"),o=0;i=e[o];o++){var r=t.utils.xml.createElement("variable");r.appendChild(t.utils.xml.createTextNode(i.name)),i.type&&r.setAttribute("type",i.type),r.id=i.getId(),n.appendChild(r)}return n},t.Xml.blockToDomWithXY=function(e,i){if(e.isInsertionMarker()&&!(e=e.getChildren(!1)[0]))return new DocumentFragment;var n;e.workspace.RTL&&(n=e.workspace.getWidth()),i=t.Xml.blockToDom(e,i);var o=e.getRelativeToSurfaceXY();return i.setAttribute("x",Math.round(e.workspace.RTL?n-o.x:o.x)),i.setAttribute("y",Math.round(o.y)),i},t.Xml.fieldToDom_=function(e){if(e.isSerializable()){var i=t.utils.xml.createElement("field");return i.setAttribute("name",e.name||""),e.toXml(i)}return null},t.Xml.allFieldsToDom_=function(e,i){for(var n,o=0;n=e.inputList[o];o++)for(var r,s=0;r=n.fieldRow[s];s++)(r=t.Xml.fieldToDom_(r))&&i.appendChild(r)},t.Xml.blockToDom=function(e,i){if(e.isInsertionMarker())return(e=e.getChildren(!1)[0])?t.Xml.blockToDom(e):new DocumentFragment;var n=t.utils.xml.createElement(e.isShadow()?"shadow":"block");if(n.setAttribute("type",e.type),i||n.setAttribute("id",e.id),e.mutationToDom){var o=e.mutationToDom();o&&(o.hasChildNodes()||o.hasAttributes())&&n.appendChild(o)}if(t.Xml.allFieldsToDom_(e,n),o=e.getCommentText()){var r=e.commentModel.size,s=e.commentModel.pinned,a=t.utils.xml.createElement("comment");a.appendChild(t.utils.xml.createTextNode(o)),a.setAttribute("pinned",s),a.setAttribute("h",r.height),a.setAttribute("w",r.width),n.appendChild(a)}for(e.data&&((o=t.utils.xml.createElement("data")).appendChild(t.utils.xml.createTextNode(e.data)),n.appendChild(o)),o=0;r=e.inputList[o];o++){var l;if(s=!0,r.type!=t.inputTypes.DUMMY){var c=r.connection.targetBlock();r.type==t.inputTypes.VALUE?l=t.utils.xml.createElement("value"):r.type==t.inputTypes.STATEMENT&&(l=t.utils.xml.createElement("statement")),!(a=r.connection.getShadowDom())||c&&c.isShadow()||l.appendChild(t.Xml.cloneShadow_(a,i)),c&&((a=t.Xml.blockToDom(c,i)).nodeType==t.utils.dom.NodeType.ELEMENT_NODE&&(l.appendChild(a),s=!1)),l.setAttribute("name",r.name),s||n.appendChild(l)}}return void 0!=e.inputsInline&&e.inputsInline!=e.inputsInlineDefault&&n.setAttribute("inline",e.inputsInline),e.isCollapsed()&&n.setAttribute("collapsed",!0),e.isEnabled()||n.setAttribute("disabled",!0),e.isDeletable()||e.isShadow()||n.setAttribute("deletable",!1),e.isMovable()||e.isShadow()||n.setAttribute("movable",!1),e.isEditable()||n.setAttribute("editable",!1),(o=e.getNextBlock())&&((a=t.Xml.blockToDom(o,i)).nodeType==t.utils.dom.NodeType.ELEMENT_NODE&&((l=t.utils.xml.createElement("next")).appendChild(a),n.appendChild(l))),!(a=e.nextConnection&&e.nextConnection.getShadowDom())||o&&o.isShadow()||l.appendChild(t.Xml.cloneShadow_(a,i)),n},t.Xml.cloneShadow_=function(e,i){for(var n,o=e=e.cloneNode(!0);o;)if(i&&"shadow"==o.nodeName&&o.removeAttribute("id"),o.firstChild)o=o.firstChild;else{for(;o&&!o.nextSibling;)n=o,o=o.parentNode,n.nodeType==t.utils.dom.NodeType.TEXT_NODE&&""==n.data.trim()&&o.firstChild!=n&&t.utils.dom.removeNode(n);o&&(n=o,o=o.nextSibling,n.nodeType==t.utils.dom.NodeType.TEXT_NODE&&""==n.data.trim()&&t.utils.dom.removeNode(n))}return e},t.Xml.domToText=function(e){return t.utils.xml.domToText(e).replace(/<(\w+)([^<]*)\/>/g,"<$1$2>")},t.Xml.domToPrettyText=function(e){e=t.Xml.domToText(e).split("<");for(var i="",n=1;n"!=o.slice(-2)&&(i+=" ")}return(e=(e=e.join("\n")).replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1")).replace(/^\n/,"")},t.Xml.textToDom=function(e){var i=t.utils.xml.textToDomDocument(e);if(!i||!i.documentElement||i.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+e);return i.documentElement},t.Xml.clearWorkspaceAndLoadFromXml=function(e,i){return i.setResizesEnabled(!1),i.clear(),e=t.Xml.domToWorkspace(e,i),i.setResizesEnabled(!0),e},t.Xml.domToWorkspace=function(e,i){if(e instanceof t.Workspace){var n=e;e=i,i=n,console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var o;i.RTL&&(o=i.getWidth()),n=[],t.utils.dom.startTextWidthCache();var r=t.Events.getGroup();r||t.Events.setGroup(!0),i.setResizesEnabled&&i.setResizesEnabled(!1);var s=!0;try{for(var a,l=0;a=e.childNodes[l];l++){var c=a.nodeName.toLowerCase(),u=a;if("block"==c||"shadow"==c&&!t.Events.recordUndo){var h=t.Xml.domToBlock(u,i);n.push(h.id);var p=u.hasAttribute("x")?parseInt(u.getAttribute("x"),10):10,d=u.hasAttribute("y")?parseInt(u.getAttribute("y"),10):10;isNaN(p)||isNaN(d)||h.moveBy(i.RTL?o-p:p,d),s=!1}else{if("shadow"==c)throw TypeError("Shadow block cannot be a top-level block.");if("comment"==c)i.rendered?t.WorkspaceCommentSvg?t.WorkspaceCommentSvg.fromXml(u,i,o):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment."):t.WorkspaceComment?t.WorkspaceComment.fromXml(u,i):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.");t.Xml.domToVariables(u,i),s=!1}}}}finally{r||t.Events.setGroup(!1),t.utils.dom.stopTextWidthCache()}return i.setResizesEnabled&&i.setResizesEnabled(!0),t.Events.fire(new(t.Events.get(t.Events.FINISHED_LOADING))(i)),n},t.Xml.appendDomToWorkspace=function(e,i){var n;if(Object.prototype.hasOwnProperty.call(i,"scale")&&(n=i.getBlocksBoundingBox()),e=t.Xml.domToWorkspace(e,i),n&&n.top!=n.bottom){var o=n.bottom,r=i.RTL?n.right:n.left,s=1/0,a=-1/0,l=1/0;for(n=0;na&&(a=c.x)}for(o=o-l+10,r=i.RTL?r-a:r-s,n=0;n");i.domToMutation(o)}t.Events.fire(new t.Events.BlockChange(i,"mutation",null,n,e));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.blockId)},t.Events.Create=function(e){t.Events.Create.superClass_.constructor.call(this,e),e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=e.workspace.rendered?t.Xml.blockToDomWithXY(e):t.Xml.blockToDom(e),this.ids=t.Events.getDescendantIds(e))},t.utils.object.inherits(t.Events.Create,t.Events.BlockBase),t.Events.BlockCreate=t.Events.Create,t.Events.Create.prototype.type=t.Events.CREATE,t.Events.Create.prototype.toJson=function(){var e=t.Events.Create.superClass_.toJson.call(this);return e.xml=t.Xml.domToText(this.xml),e.ids=this.ids,this.recordUndo||(e.recordUndo=this.recordUndo),e},t.Events.Create.prototype.fromJson=function(e){t.Events.Create.superClass_.fromJson.call(this,e),this.xml=t.Xml.textToDom(e.xml),this.ids=e.ids,void 0!==e.recordUndo&&(this.recordUndo=e.recordUndo)},t.Events.Create.prototype.run=function(e){var i=this.getEventWorkspace_();if(e)(e=t.utils.xml.createElement("xml")).appendChild(this.xml),t.Xml.domToWorkspace(e,i);else{e=0;for(var n;n=this.ids[e];e++){var o=i.getBlockById(n);o?o.dispose(!1):n==this.blockId&&console.warn("Can't uncreate non-existent block: "+n)}}},t.Events.Delete=function(e){if(t.Events.Delete.superClass_.constructor.call(this,e),e){if(e.getParent())throw Error("Connected blocks cannot be deleted.");e.isShadow()&&(this.recordUndo=!1),this.oldXml=e.workspace.rendered?t.Xml.blockToDomWithXY(e):t.Xml.blockToDom(e),this.ids=t.Events.getDescendantIds(e)}},t.utils.object.inherits(t.Events.Delete,t.Events.BlockBase),t.Events.BlockDelete=t.Events.Delete,t.Events.Delete.prototype.type=t.Events.DELETE,t.Events.Delete.prototype.toJson=function(){var e=t.Events.Delete.superClass_.toJson.call(this);return e.oldXml=t.Xml.domToText(this.oldXml),e.ids=this.ids,this.recordUndo||(e.recordUndo=this.recordUndo),e},t.Events.Delete.prototype.fromJson=function(e){t.Events.Delete.superClass_.fromJson.call(this,e),this.oldXml=t.Xml.textToDom(e.oldXml),this.ids=e.ids,void 0!==e.recordUndo&&(this.recordUndo=e.recordUndo)},t.Events.Delete.prototype.run=function(e){var i=this.getEventWorkspace_();if(e){e=0;for(var n;n=this.ids[e];e++){var o=i.getBlockById(n);o?o.dispose(!1):n==this.blockId&&console.warn("Can't delete non-existent block: "+n)}}else(e=t.utils.xml.createElement("xml")).appendChild(this.oldXml),t.Xml.domToWorkspace(e,i)},t.Events.Move=function(e){t.Events.Move.superClass_.constructor.call(this,e),e&&(e.isShadow()&&(this.recordUndo=!1),e=this.currentLocation_(),this.oldParentId=e.parentId,this.oldInputName=e.inputName,this.oldCoordinate=e.coordinate)},t.utils.object.inherits(t.Events.Move,t.Events.BlockBase),t.Events.BlockMove=t.Events.Move,t.Events.Move.prototype.type=t.Events.MOVE,t.Events.Move.prototype.toJson=function(){var e=t.Events.Move.superClass_.toJson.call(this);return this.newParentId&&(e.newParentId=this.newParentId),this.newInputName&&(e.newInputName=this.newInputName),this.newCoordinate&&(e.newCoordinate=Math.round(this.newCoordinate.x)+","+Math.round(this.newCoordinate.y)),this.recordUndo||(e.recordUndo=this.recordUndo),e},t.Events.Move.prototype.fromJson=function(e){if(t.Events.Move.superClass_.fromJson.call(this,e),this.newParentId=e.newParentId,this.newInputName=e.newInputName,e.newCoordinate){var i=e.newCoordinate.split(",");this.newCoordinate=new t.utils.Coordinate(Number(i[0]),Number(i[1]))}void 0!==e.recordUndo&&(this.recordUndo=e.recordUndo)},t.Events.Move.prototype.recordNew=function(){var t=this.currentLocation_();this.newParentId=t.parentId,this.newInputName=t.inputName,this.newCoordinate=t.coordinate},t.Events.Move.prototype.currentLocation_=function(){var t=this.getEventWorkspace_().getBlockById(this.blockId),e={},i=t.getParent();return i?(e.parentId=i.id,(t=i.getInputWithBlock(t))&&(e.inputName=t.name)):e.coordinate=t.getRelativeToSurfaceXY(),e},t.Events.Move.prototype.isNull=function(){return this.oldParentId==this.newParentId&&this.oldInputName==this.newInputName&&t.utils.Coordinate.equals(this.oldCoordinate,this.newCoordinate)},t.Events.Move.prototype.run=function(e){var i=this.getEventWorkspace_(),n=i.getBlockById(this.blockId);if(n){var o=e?this.newParentId:this.oldParentId,r=e?this.newInputName:this.oldInputName,s=e?this.newCoordinate:this.oldCoordinate;if(e=null,o&&!(e=i.getBlockById(o)))return void console.warn("Can't connect to non-existent block: "+o);if(n.getParent()&&n.unplug(),s)r=n.getRelativeToSurfaceXY(),n.moveBy(s.x-r.x,s.y-r.y);else{if(i=(n=n.outputConnection||n.previousConnection).type,r){if(e=e.getInput(r))var a=e.connection}else i==t.connectionTypes.PREVIOUS_STATEMENT&&(a=e.nextConnection);a?n.connect(a):console.warn("Can't connect to non-existent input: "+r)}}else console.warn("Can't move non-existent block: "+this.blockId)},t.registry.register(t.registry.Type.EVENT,t.Events.CREATE,t.Events.Create),t.registry.register(t.registry.Type.EVENT,t.Events.DELETE,t.Events.Delete),t.registry.register(t.registry.Type.EVENT,t.Events.CHANGE,t.Events.BlockChange),t.registry.register(t.registry.Type.EVENT,t.Events.MOVE,t.Events.Move),t.Events.FinishedLoading=function(e){this.isBlank=void 0===e,this.workspaceId=e?e.id:"",this.group=t.Events.getGroup(),this.recordUndo=!1},t.utils.object.inherits(t.Events.FinishedLoading,t.Events.Abstract),t.Events.FinishedLoading.prototype.type=t.Events.FINISHED_LOADING,t.Events.FinishedLoading.prototype.toJson=function(){var t={type:this.type};return this.group&&(t.group=this.group),this.workspaceId&&(t.workspaceId=this.workspaceId),t},t.Events.FinishedLoading.prototype.fromJson=function(t){this.isBlank=!1,this.workspaceId=t.workspaceId,this.group=t.group},t.registry.register(t.registry.Type.EVENT,t.Events.FINISHED_LOADING,t.Events.FinishedLoading),t.Events.UiBase=function(e){t.Events.UiBase.superClass_.constructor.call(this),this.isBlank=void 0===e,this.workspaceId=e||"",this.recordUndo=!1},t.utils.object.inherits(t.Events.UiBase,t.Events.Abstract),t.Events.UiBase.prototype.isUiEvent=!0,t.Events.Ui=function(e,i,n,o){t.Events.Ui.superClass_.constructor.call(this,e?e.workspace.id:void 0),this.blockId=e?e.id:null,this.element=void 0===i?"":i,this.oldValue=void 0===n?"":n,this.newValue=void 0===o?"":o},t.utils.object.inherits(t.Events.Ui,t.Events.UiBase),t.Events.Ui.prototype.type=t.Events.UI,t.Events.Ui.prototype.toJson=function(){var e=t.Events.Ui.superClass_.toJson.call(this);return e.element=this.element,void 0!==this.newValue&&(e.newValue=this.newValue),this.blockId&&(e.blockId=this.blockId),e},t.Events.Ui.prototype.fromJson=function(e){t.Events.Ui.superClass_.fromJson.call(this,e),this.element=e.element,this.newValue=e.newValue,this.blockId=e.blockId},t.registry.register(t.registry.Type.EVENT,t.Events.UI,t.Events.Ui),t.Events.VarBase=function(e){t.Events.VarBase.superClass_.constructor.call(this),this.varId=(this.isBlank=void 0===e)?"":e.getId(),this.workspaceId=this.isBlank?"":e.workspace.id},t.utils.object.inherits(t.Events.VarBase,t.Events.Abstract),t.Events.VarBase.prototype.toJson=function(){var e=t.Events.VarBase.superClass_.toJson.call(this);return e.varId=this.varId,e},t.Events.VarBase.prototype.fromJson=function(e){t.Events.VarBase.superClass_.toJson.call(this),this.varId=e.varId},t.Events.VarCreate=function(e){t.Events.VarCreate.superClass_.constructor.call(this,e),e&&(this.varType=e.type,this.varName=e.name)},t.utils.object.inherits(t.Events.VarCreate,t.Events.VarBase),t.Events.VarCreate.prototype.type=t.Events.VAR_CREATE,t.Events.VarCreate.prototype.toJson=function(){var e=t.Events.VarCreate.superClass_.toJson.call(this);return e.varType=this.varType,e.varName=this.varName,e},t.Events.VarCreate.prototype.fromJson=function(e){t.Events.VarCreate.superClass_.fromJson.call(this,e),this.varType=e.varType,this.varName=e.varName},t.Events.VarCreate.prototype.run=function(t){var e=this.getEventWorkspace_();t?e.createVariable(this.varName,this.varType,this.varId):e.deleteVariableById(this.varId)},t.Events.VarDelete=function(e){t.Events.VarDelete.superClass_.constructor.call(this,e),e&&(this.varType=e.type,this.varName=e.name)},t.utils.object.inherits(t.Events.VarDelete,t.Events.VarBase),t.Events.VarDelete.prototype.type=t.Events.VAR_DELETE,t.Events.VarDelete.prototype.toJson=function(){var e=t.Events.VarDelete.superClass_.toJson.call(this);return e.varType=this.varType,e.varName=this.varName,e},t.Events.VarDelete.prototype.fromJson=function(e){t.Events.VarDelete.superClass_.fromJson.call(this,e),this.varType=e.varType,this.varName=e.varName},t.Events.VarDelete.prototype.run=function(t){var e=this.getEventWorkspace_();t?e.deleteVariableById(this.varId):e.createVariable(this.varName,this.varType,this.varId)},t.Events.VarRename=function(e,i){t.Events.VarRename.superClass_.constructor.call(this,e),e&&(this.oldName=e.name,this.newName=void 0===i?"":i)},t.utils.object.inherits(t.Events.VarRename,t.Events.VarBase),t.Events.VarRename.prototype.type=t.Events.VAR_RENAME,t.Events.VarRename.prototype.toJson=function(){var e=t.Events.VarRename.superClass_.toJson.call(this);return e.oldName=this.oldName,e.newName=this.newName,e},t.Events.VarRename.prototype.fromJson=function(e){t.Events.VarRename.superClass_.fromJson.call(this,e),this.oldName=e.oldName,this.newName=e.newName},t.Events.VarRename.prototype.run=function(t){var e=this.getEventWorkspace_();t?e.renameVariableById(this.varId,this.newName):e.renameVariableById(this.varId,this.oldName)},t.registry.register(t.registry.Type.EVENT,t.Events.VAR_CREATE,t.Events.VarCreate),t.registry.register(t.registry.Type.EVENT,t.Events.VAR_DELETE,t.Events.VarDelete),t.registry.register(t.registry.Type.EVENT,t.Events.VAR_RENAME,t.Events.VarRename),t.BlockDragSurfaceSvg=function(t){this.container_=t,this.createDom()},t.BlockDragSurfaceSvg.prototype.SVG_=null,t.BlockDragSurfaceSvg.prototype.dragGroup_=null,t.BlockDragSurfaceSvg.prototype.container_=null,t.BlockDragSurfaceSvg.prototype.scale_=1,t.BlockDragSurfaceSvg.prototype.surfaceXY_=null,t.BlockDragSurfaceSvg.prototype.childSurfaceXY_=new t.utils.Coordinate(0,0),t.BlockDragSurfaceSvg.prototype.createDom=function(){this.SVG_||(this.SVG_=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{xmlns:t.utils.dom.SVG_NS,"xmlns:html":t.utils.dom.HTML_NS,"xmlns:xlink":t.utils.dom.XLINK_NS,version:"1.1",class:"blocklyBlockDragSurface"},this.container_),this.dragGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},this.SVG_))},t.BlockDragSurfaceSvg.prototype.setBlocksAndShow=function(e){if(this.dragGroup_.childNodes.length)throw Error("Already dragging a block.");this.dragGroup_.appendChild(e),this.SVG_.style.display="block",this.surfaceXY_=new t.utils.Coordinate(0,0)},t.BlockDragSurfaceSvg.prototype.translateAndScaleGroup=function(t,e,i){this.scale_=i,t=t.toFixed(0),e=e.toFixed(0),this.childSurfaceXY_.x=parseInt(t,10),this.childSurfaceXY_.y=parseInt(e,10),this.dragGroup_.setAttribute("transform","translate("+t+","+e+") scale("+i+")")},t.BlockDragSurfaceSvg.prototype.translateSurfaceInternal_=function(){var e=this.surfaceXY_.x,i=this.surfaceXY_.y;e=e.toFixed(0),i=i.toFixed(0),this.SVG_.style.display="block",t.utils.dom.setCssTransform(this.SVG_,"translate3d("+e+"px, "+i+"px, 0px)")},t.BlockDragSurfaceSvg.prototype.translateBy=function(e,i){this.surfaceXY_=new t.utils.Coordinate(this.surfaceXY_.x+e,this.surfaceXY_.y+i),this.translateSurfaceInternal_()},t.BlockDragSurfaceSvg.prototype.translateSurface=function(e,i){this.surfaceXY_=new t.utils.Coordinate(e*this.scale_,i*this.scale_),this.translateSurfaceInternal_()},t.BlockDragSurfaceSvg.prototype.getSurfaceTranslation=function(){var e=t.utils.getRelativeXY(this.SVG_);return new t.utils.Coordinate(e.x/this.scale_,e.y/this.scale_)},t.BlockDragSurfaceSvg.prototype.getGroup=function(){return this.dragGroup_},t.BlockDragSurfaceSvg.prototype.getSvgRoot=function(){return this.SVG_},t.BlockDragSurfaceSvg.prototype.getCurrentBlock=function(){return this.dragGroup_.firstChild},t.BlockDragSurfaceSvg.prototype.getWsTranslation=function(){return this.childSurfaceXY_.clone()},t.BlockDragSurfaceSvg.prototype.clearAndHide=function(t){if(t?t.appendChild(this.getCurrentBlock()):this.dragGroup_.removeChild(this.getCurrentBlock()),this.SVG_.style.display="none",this.dragGroup_.childNodes.length)throw Error("Drag group was not cleared.");this.surfaceXY_=null},t.Css={},t.Css.injected_=!1,t.Css.register=function(e){if(t.Css.injected_)throw Error("CSS already injected");Array.prototype.push.apply(t.Css.CONTENT,e),e.length=0},t.Css.inject=function(e,i){if(!t.Css.injected_){t.Css.injected_=!0;var n=t.Css.CONTENT.join("\n");t.Css.CONTENT.length=0,e&&(e=i.replace(/[\\/]$/,""),n=n.replace(/<<>>/g,e),(e=document.createElement("style")).id="blockly-common-style",n=document.createTextNode(n),e.appendChild(n),document.head.insertBefore(e,document.head.firstChild))}},t.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none;","}",".blocklyNonSelectable {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","}",".blocklyWsDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyBlockCanvas.blocklyCanvasTransitioning,",".blocklyBubbleCanvas.blocklyCanvasTransitioning {","transition: transform .5s;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);","color: #000;","display: none;","font: 9pt sans-serif;","opacity: .9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyDropDownDiv {","position: absolute;","left: 0;","top: 0;","z-index: 1000;","display: none;","border: 1px solid;","border-color: #dadce0;","background-color: #fff;","border-radius: 2px;","padding: 4px;","box-shadow: 0 0 3px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv.blocklyFocused {","box-shadow: 0 0 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownContent {","max-height: 300px;","overflow: auto;","overflow-x: hidden;","position: relative;","}",".blocklyDropDownArrow {","position: absolute;","left: 0;","top: 0;","width: 16px;","height: 16px;","z-index: -1;","background-color: inherit;","border-color: inherit;","}",".blocklyDropDownButton {","display: inline-block;","float: left;","padding: 0;","margin: 4px;","border-radius: 4px;","outline: none;","border: 1px solid;","transition: box-shadow .1s;","cursor: pointer;","}",".blocklyArrowTop {","border-top: 1px solid;","border-left: 1px solid;","border-top-left-radius: 4px;","border-color: inherit;","}",".blocklyArrowBottom {","border-bottom: 1px solid;","border-right: 1px solid;","border-bottom-right-radius: 4px;","border-color: inherit;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #515A5A;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {","fill: none;","stroke-linecap: round;","stroke-width: 1;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDraggable {",'cursor: url("<<>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {","display: none;","}",".blocklyInsertionMarker>.blocklyPath,",".blocklyInsertionMarker>.blocklyPathLight,",".blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: .2;","stroke: none;","}",".blocklyMultilineText {","font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyFlyout {","position: absolute;","z-index: 20;","}",".blocklyText text {","cursor: default;","}",".blocklySvg text,",".blocklyBlockDragSurface text {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","height: 100%;","margin: 0;","outline: none;","padding: 0;","width: 100%;","text-align: center;","display: block;","box-sizing: border-box;","}",".blocklyHtmlInput::-ms-clear {","display: none;","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyMainWorkspaceScrollbar {","z-index: 20;","}",".blocklyFlyoutScrollbar {","z-index: 30;","}",".blocklyScrollbarHorizontal,",".blocklyScrollbarVertical {","position: absolute;","outline: none;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyVerticalMarker {","stroke-width: 3px;","fill: rgba(255,255,255,.5);","pointer-events: none;","}",".blocklyComputeCanvas {","position: absolute;","width: 0;","height: 0;","}",".blocklyNoPointerEvents {","pointer-events: none;","}",".blocklyContextMenu {","border-radius: 4px;","max-height: 100%;","}",".blocklyDropdownMenu {","border-radius: 2px;","padding: 0 !important;","}",".blocklyDropdownMenu .blocklyMenuItem {","padding-left: 28px;","}",".blocklyDropdownMenu .blocklyMenuItemRtl {","padding-left: 5px;","padding-right: 28px;","}",".blocklyWidgetDiv .blocklyMenu {","background: #fff;","border: 1px solid transparent;","box-shadow: 0 0 3px 1px rgba(0,0,0,.3);","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","}",".blocklyWidgetDiv .blocklyMenu.blocklyFocused {","box-shadow: 0 0 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv .blocklyMenu {","background: inherit;","border: inherit;",'font: normal 13px "Helvetica Neue", Helvetica, sans-serif;',"outline: none;","position: relative;","z-index: 20000;","}",".blocklyMenuItem {","border: none;","color: #000;","cursor: pointer;","list-style: none;","margin: 0;","min-width: 7em;","padding: 6px 15px;","white-space: nowrap;","}",".blocklyMenuItemDisabled {","color: #ccc;","cursor: inherit;","}",".blocklyMenuItemHighlight {","background-color: rgba(0,0,0,.1);","}",".blocklyMenuItemCheckbox {","height: 16px;","position: absolute;","width: 16px;","}",".blocklyMenuItemSelected .blocklyMenuItemCheckbox {","background: url(<<>>/sprites.png) no-repeat -48px -16px;","float: left;","margin-left: -24px;","position: static;","}",".blocklyMenuItemRtl .blocklyMenuItemCheckbox {","float: right;","margin-right: -24px;","}"],t.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},t.Grid.prototype.scale_=1,t.Grid.prototype.dispose=function(){this.gridPattern_=null},t.Grid.prototype.shouldSnap=function(){return this.snapToGrid_},t.Grid.prototype.getSpacing=function(){return this.spacing_},t.Grid.prototype.getPatternId=function(){return this.gridPattern_.id},t.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 i=(e=Math.floor(this.spacing_/2)+.5)-this.length_/2,n=e+this.length_/2;e*=t,i*=t,n*=t,this.setLineAttributes_(this.line1_,t,i,n,e,e),this.setLineAttributes_(this.line2_,t,e,e,i,n)},t.Grid.prototype.setLineAttributes_=function(t,e,i,n,o,r){t&&(t.setAttribute("stroke-width",e),t.setAttribute("x1",i),t.setAttribute("y1",o),t.setAttribute("x2",n),t.setAttribute("y2",r))},t.Grid.prototype.moveTo=function(e,i){this.gridPattern_.setAttribute("x",e),this.gridPattern_.setAttribute("y",i),(t.utils.userAgent.IE||t.utils.userAgent.EDGE)&&this.update(this.scale_)},t.Grid.createDom=function(e,i,n){return e=t.utils.dom.createSvgElement(t.utils.Svg.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},n),0 document.")}else e=null;return e},t.Options=function(e){var i=!!e.readOnly;if(i)var n=null,o=!1,r=!1,s=!1,a=!1,l=!1,c=!1;else{n=t.utils.toolbox.convertToolboxDefToJson(e.toolbox),o=t.utils.toolbox.hasCategories(n),void 0===(r=e.trashcan)&&(r=o);var u=e.maxTrashcanContents;r?void 0===u&&(u=32):u=0,void 0===(s=e.collapse)&&(s=o),void 0===(a=e.comments)&&(a=o),void 0===(l=e.disable)&&(l=o),void 0===(c=e.sounds)&&(c=!0)}var h=!!e.rtl,p=e.horizontalLayout;void 0===p&&(p=!1);var d=e.toolboxPosition;d="end"!==d,d=p?d?t.utils.toolbox.Position.TOP:t.utils.toolbox.Position.BOTTOM:d==h?t.utils.toolbox.Position.RIGHT:t.utils.toolbox.Position.LEFT;var f=e.css;void 0===f&&(f=!0);var g="https://blockly-demo.appspot.com/static/media/";e.media?g=e.media:e.path&&(g=e.path+"media/");var _=void 0===e.oneBasedIndex||!!e.oneBasedIndex,m=e.renderer||"geras",v=e.plugins||{};this.RTL=h,this.oneBasedIndex=_,this.collapse=s,this.comments=a,this.disable=l,this.readOnly=i,this.maxBlocks=e.maxBlocks||1/0,this.maxInstances=e.maxInstances,this.pathToMedia=g,this.hasCategories=o,this.moveOptions=t.Options.parseMoveOptions_(e,o),this.hasScrollbars=!!this.moveOptions.scrollbars,this.hasTrashcan=r,this.maxTrashcanContents=u,this.hasSounds=c,this.hasCss=f,this.horizontalLayout=p,this.languageTree=n,this.gridOptions=t.Options.parseGridOptions_(e),this.zoomOptions=t.Options.parseZoomOptions_(e),this.toolboxPosition=d,this.theme=t.Options.parseThemeOptions_(e),this.renderer=m,this.rendererOverrides=e.rendererOverrides,this.gridPattern=null,this.parentWorkspace=e.parentWorkspace,this.plugins=v},t.BlocklyOptions=function(){},t.Options.parseMoveOptions_=function(t,e){var i=t.move||{},n={};return void 0===i.scrollbars&&void 0===t.scrollbars?n.scrollbars=e:"object"==typeof i.scrollbars?(n.scrollbars={},n.scrollbars.horizontal=!!i.scrollbars.horizontal,n.scrollbars.vertical=!!i.scrollbars.vertical,n.scrollbars.horizontal&&n.scrollbars.vertical?n.scrollbars=!0:n.scrollbars.horizontal||n.scrollbars.vertical||(n.scrollbars=!1)):n.scrollbars=!!i.scrollbars||!!t.scrollbars,n.wheel=n.scrollbars&&void 0!==i.wheel?!!i.wheel:"object"==typeof n.scrollbars,n.drag=!!n.scrollbars&&(void 0===i.drag||!!i.drag),n},t.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},t.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_)},t.Scrollbar.prototype.setHandleLength_=function(t){this.handleLength_=t,this.svgHandle_.setAttribute(this.lengthAttribute_,this.handleLength_)},t.Scrollbar.prototype.constrainHandlePosition_=function(t){return 0>=t||isNaN(t)?0:Math.min(t,this.scrollbarLength_-this.handleLength_)},t.Scrollbar.prototype.setHandlePosition=function(t){this.handlePosition_=t,this.svgHandle_.setAttribute(this.positionAttribute_,this.handlePosition_)},t.Scrollbar.prototype.setScrollbarLength_=function(t){this.scrollbarLength_=t,this.outerSvg_.setAttribute(this.lengthAttribute_,this.scrollbarLength_),this.svgBackground_.setAttribute(this.lengthAttribute_,this.scrollbarLength_)},t.Scrollbar.prototype.setPosition=function(e,i){this.position.x=e,this.position.y=i,t.utils.dom.setCssTransform(this.outerSvg_,"translate("+(this.position.x+this.origin_.x)+"px,"+(this.position.y+this.origin_.y)+"px)")},t.Scrollbar.prototype.resize=function(e){(e||(e=this.workspace_.getMetrics()))&&(this.oldHostMetrics_&&t.Scrollbar.metricsAreEquivalent_(e,this.oldHostMetrics_)||(this.horizontal_?this.resizeHorizontal_(e):this.resizeVertical_(e),this.oldHostMetrics_=e,this.updateMetrics_()))},t.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)},t.Scrollbar.prototype.resizeHorizontal_=function(t){this.requiresViewResize_(t)?this.resizeViewHorizontal(t):this.resizeContentHorizontal(t)},t.Scrollbar.prototype.resizeViewHorizontal=function(e){var i=e.viewWidth-2*this.margin_;this.pair_&&(i-=t.Scrollbar.scrollbarThickness),this.setScrollbarLength_(Math.max(0,i)),i=e.absoluteLeft+this.margin_,this.pair_&&this.workspace_.RTL&&(i+=t.Scrollbar.scrollbarThickness),this.setPosition(i,e.absoluteTop+e.viewHeight-t.Scrollbar.scrollbarThickness-this.margin_),this.resizeContentHorizontal(e)},t.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 i=this.scrollbarLength_-this.handleLength_;t=(t.viewLeft-t.scrollLeft)/e*i,t=this.constrainHandlePosition_(t),this.setHandlePosition(t),this.ratio=i/e}},t.Scrollbar.prototype.resizeVertical_=function(t){this.requiresViewResize_(t)?this.resizeViewVertical(t):this.resizeContentVertical(t)},t.Scrollbar.prototype.resizeViewVertical=function(e){var i=e.viewHeight-2*this.margin_;this.pair_&&(i-=t.Scrollbar.scrollbarThickness),this.setScrollbarLength_(Math.max(0,i)),this.setPosition(this.workspace_.RTL?e.absoluteLeft+this.margin_:e.absoluteLeft+e.viewWidth-t.Scrollbar.scrollbarThickness-this.margin_,e.absoluteTop+this.margin_),this.resizeContentVertical(e)},t.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 i=this.scrollbarLength_-this.handleLength_;t=(t.viewTop-t.scrollTop)/e*i,t=this.constrainHandlePosition_(t),this.setHandlePosition(t),this.ratio=i/e}},t.Scrollbar.prototype.createDom_=function(e){var i="blocklyScrollbar"+(this.horizontal_?"Horizontal":"Vertical");e&&(i+=" "+e),this.outerSvg_=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{class:i},null),this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},this.outerSvg_),this.svgBackground_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyScrollbarBackground"},this.svgGroup_),e=Math.floor((t.Scrollbar.scrollbarThickness-5)/2),this.svgHandle_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},this.svgGroup_),this.workspace_.getThemeManager().subscribe(this.svgHandle_,"scrollbarColour","fill"),this.workspace_.getThemeManager().subscribe(this.svgHandle_,"scrollbarOpacity","fill-opacity"),t.utils.dom.insertAfter(this.outerSvg_,this.workspace_.getParentSvg())},t.Scrollbar.prototype.isVisible=function(){return this.isVisible_},t.Scrollbar.prototype.setContainerVisible=function(t){var e=t!=this.containerVisible_;this.containerVisible_=t,e&&this.updateDisplay_()},t.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_()},t.Scrollbar.prototype.updateDisplay_=function(){this.containerVisible_&&this.isVisible()?this.outerSvg_.setAttribute("display","block"):this.outerSvg_.setAttribute("display","none")},t.Scrollbar.prototype.onMouseDownBar_=function(e){if(this.workspace_.markFocused(),t.Touch.clearTouchIdentifier(),this.cleanUp_(),t.utils.isRightButton(e))e.stopPropagation();else{var i=t.utils.mouseToSvg(e,this.workspace_.getParentSvg(),this.workspace_.getInverseScreenCTM());i=this.horizontal_?i.x:i.y;var n=t.utils.getInjectionDivXY_(this.svgHandle_);n=this.horizontal_?n.x:n.y;var o=this.handlePosition_,r=.95*this.handleLength_;i<=n?o-=r:i>=n+this.handleLength_&&(o+=r),this.setHandlePosition(this.constrainHandlePosition_(o)),this.updateMetrics_(),e.stopPropagation(),e.preventDefault()}},t.Scrollbar.prototype.onMouseDownHandle_=function(e){this.workspace_.markFocused(),this.cleanUp_(),t.utils.isRightButton(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition_,this.workspace_.setupDragSurface(),this.startDragMouse_=this.horizontal_?e.clientX:e.clientY,t.Scrollbar.onMouseUpWrapper_=t.browserEvents.conditionalBind(document,"mouseup",this,this.onMouseUpHandle_),t.Scrollbar.onMouseMoveWrapper_=t.browserEvents.conditionalBind(document,"mousemove",this,this.onMouseMoveHandle_),e.stopPropagation(),e.preventDefault())},t.Scrollbar.prototype.onMouseMoveHandle_=function(t){this.setHandlePosition(this.constrainHandlePosition_(this.startDragHandle+((this.horizontal_?t.clientX:t.clientY)-this.startDragMouse_))),this.updateMetrics_()},t.Scrollbar.prototype.onMouseUpHandle_=function(){this.workspace_.resetDragSurface(),t.Touch.clearTouchIdentifier(),this.cleanUp_()},t.Scrollbar.prototype.cleanUp_=function(){t.hideChaff(!0),t.Scrollbar.onMouseUpWrapper_&&(t.browserEvents.unbind(t.Scrollbar.onMouseUpWrapper_),t.Scrollbar.onMouseUpWrapper_=null),t.Scrollbar.onMouseMoveWrapper_&&(t.browserEvents.unbind(t.Scrollbar.onMouseMoveWrapper_),t.Scrollbar.onMouseMoveWrapper_=null)},t.Scrollbar.prototype.getRatio_=function(){var t=this.handlePosition_/(this.scrollbarLength_-this.handleLength_);return isNaN(t)&&(t=0),t},t.Scrollbar.prototype.updateMetrics_=function(){var t=this.getRatio_(),e={};this.horizontal_?e.x=t:e.y=t,this.workspace_.setMetrics(e)},t.Scrollbar.prototype.set=function(t,e){this.setHandlePosition(this.constrainHandlePosition_(t*this.ratio)),(e||void 0===e)&&this.updateMetrics_()},t.Scrollbar.prototype.setOrigin=function(e,i){this.origin_=new t.utils.Coordinate(e,i)},t.Tooltip={},t.Tooltip.visible=!1,t.Tooltip.blocked_=!1,t.Tooltip.LIMIT=50,t.Tooltip.mouseOutPid_=0,t.Tooltip.showPid_=0,t.Tooltip.lastX_=0,t.Tooltip.lastY_=0,t.Tooltip.element_=null,t.Tooltip.poisonedElement_=null,t.Tooltip.OFFSET_X=0,t.Tooltip.OFFSET_Y=10,t.Tooltip.RADIUS_OK=10,t.Tooltip.HOVER_MS=750,t.Tooltip.MARGINS=5,t.Tooltip.DIV=null,t.Tooltip.getTooltipOfObject=function(e){if(e=t.Tooltip.getTargetObject_(e)){for(e=e.tooltip;"function"==typeof e;)e=e();if("string"!=typeof e)throw Error("Tooltip function must return a string.");return e}return""},t.Tooltip.getTargetObject_=function(t){for(;t&&t.tooltip;){if("string"==typeof t.tooltip||"function"==typeof t.tooltip)return t;t=t.tooltip}return null},t.Tooltip.createDom=function(){t.Tooltip.DIV||(t.Tooltip.DIV=document.createElement("div"),t.Tooltip.DIV.className="blocklyTooltipDiv",(t.parentContainer||document.body).appendChild(t.Tooltip.DIV))},t.Tooltip.bindMouseEvents=function(e){e.mouseOverWrapper_=t.browserEvents.bind(e,"mouseover",null,t.Tooltip.onMouseOver_),e.mouseOutWrapper_=t.browserEvents.bind(e,"mouseout",null,t.Tooltip.onMouseOut_),e.addEventListener("mousemove",t.Tooltip.onMouseMove_,!1)},t.Tooltip.unbindMouseEvents=function(e){e&&(t.browserEvents.unbind(e.mouseOverWrapper_),t.browserEvents.unbind(e.mouseOutWrapper_),e.removeEventListener("mousemove",t.Tooltip.onMouseMove_))},t.Tooltip.onMouseOver_=function(e){t.Tooltip.blocked_||(e=t.Tooltip.getTargetObject_(e.currentTarget),t.Tooltip.element_!=e&&(t.Tooltip.hide(),t.Tooltip.poisonedElement_=null,t.Tooltip.element_=e),clearTimeout(t.Tooltip.mouseOutPid_))},t.Tooltip.onMouseOut_=function(e){t.Tooltip.blocked_||(t.Tooltip.mouseOutPid_=setTimeout(function(){t.Tooltip.element_=null,t.Tooltip.poisonedElement_=null,t.Tooltip.hide()},1),clearTimeout(t.Tooltip.showPid_))},t.Tooltip.onMouseMove_=function(e){if(t.Tooltip.element_&&t.Tooltip.element_.tooltip&&!t.Tooltip.blocked_)if(t.Tooltip.visible){var i=t.Tooltip.lastX_-e.pageX;e=t.Tooltip.lastY_-e.pageY,Math.sqrt(i*i+e*e)>t.Tooltip.RADIUS_OK&&t.Tooltip.hide()}else t.Tooltip.poisonedElement_!=t.Tooltip.element_&&(clearTimeout(t.Tooltip.showPid_),t.Tooltip.lastX_=e.pageX,t.Tooltip.lastY_=e.pageY,t.Tooltip.showPid_=setTimeout(t.Tooltip.show_,t.Tooltip.HOVER_MS))},t.Tooltip.dispose=function(){t.Tooltip.element_=null,t.Tooltip.poisonedElement_=null,t.Tooltip.hide()},t.Tooltip.hide=function(){t.Tooltip.visible&&(t.Tooltip.visible=!1,t.Tooltip.DIV&&(t.Tooltip.DIV.style.display="none")),t.Tooltip.showPid_&&clearTimeout(t.Tooltip.showPid_)},t.Tooltip.block=function(){t.Tooltip.hide(),t.Tooltip.blocked_=!0},t.Tooltip.unblock=function(){t.Tooltip.blocked_=!1},t.Tooltip.show_=function(){if(!t.Tooltip.blocked_&&(t.Tooltip.poisonedElement_=t.Tooltip.element_,t.Tooltip.DIV)){t.Tooltip.DIV.textContent="";var e=t.Tooltip.getTooltipOfObject(t.Tooltip.element_);e=(e=t.utils.string.wrap(e,t.Tooltip.LIMIT)).split("\n");for(var i=0;in+window.scrollY&&(r-=t.Tooltip.DIV.offsetHeight+2*t.Tooltip.OFFSET_Y),e?o=Math.max(t.Tooltip.MARGINS-window.scrollX,o):o+t.Tooltip.DIV.offsetWidth>i+window.scrollX-2*t.Tooltip.MARGINS&&(o=i-t.Tooltip.DIV.offsetWidth-2*t.Tooltip.MARGINS),t.Tooltip.DIV.style.top=r+"px",t.Tooltip.DIV.style.left=o+"px"}},t.utils.aria={},t.utils.aria.ARIA_PREFIX_="aria-",t.utils.aria.ROLE_ATTRIBUTE_="role",t.utils.aria.Role={GRID:"grid",GRIDCELL:"gridcell",GROUP:"group",LISTBOX:"listbox",MENU:"menu",MENUITEM:"menuitem",MENUITEMCHECKBOX:"menuitemcheckbox",OPTION:"option",PRESENTATION:"presentation",ROW:"row",TREE:"tree",TREEITEM:"treeitem"},t.utils.aria.State={ACTIVEDESCENDANT:"activedescendant",COLCOUNT:"colcount",DISABLED:"disabled",EXPANDED:"expanded",INVALID:"invalid",LABEL:"label",LABELLEDBY:"labelledby",LEVEL:"level",ORIENTATION:"orientation",POSINSET:"posinset",ROWCOUNT:"rowcount",SELECTED:"selected",SETSIZE:"setsize",VALUEMAX:"valuemax",VALUEMIN:"valuemin"},t.utils.aria.setRole=function(e,i){e.setAttribute(t.utils.aria.ROLE_ATTRIBUTE_,i)},t.utils.aria.setState=function(e,i,n){Array.isArray(n)&&(n=n.join(" ")),e.setAttribute(t.utils.aria.ARIA_PREFIX_+i,n)},t.IASTNodeLocation=function(){},t.IASTNodeLocationSvg=function(){},t.IASTNodeLocationWithBlock=function(){},t.IKeyboardAccessible=function(){},t.utils.deprecation={},t.utils.deprecation.warn=function(t,e,i,n){t=t+" was deprecated on "+e+" and will be deleted on "+i+".",n&&(t+="\nUse "+n+" instead."),console.warn(t)},t.Connection=function(t,e){this.sourceBlock_=t,this.type=e},t.Connection.CAN_CONNECT=0,t.Connection.REASON_SELF_CONNECTION=1,t.Connection.REASON_WRONG_TYPE=2,t.Connection.REASON_TARGET_NULL=3,t.Connection.REASON_CHECKS_FAILED=4,t.Connection.REASON_DIFFERENT_WORKSPACES=5,t.Connection.REASON_SHADOW_PARENT=6,t.Connection.REASON_DRAG_CHECKS_FAILED=7,t.Connection.prototype.targetConnection=null,t.Connection.prototype.disposed=!1,t.Connection.prototype.check_=null,t.Connection.prototype.shadowDom_=null,t.Connection.prototype.x=0,t.Connection.prototype.y=0,t.Connection.prototype.connect_=function(e){var i,n=t.connectionTypes.INPUT_VALUE,o=this.getSourceBlock(),r=e.getSourceBlock();if(e.isConnected()&&e.disconnect(),this.isConnected()){var s=this.getShadowDom(!0);this.shadowDom_=null;var a=this.targetBlock();if(a.isShadow())a.dispose(!1);else{this.disconnect();var l=a}this.shadowDom_=s}t.Events.isEnabled()&&(i=new(t.Events.get(t.Events.BLOCK_MOVE))(r)),t.Connection.connectReciprocally_(this,e),r.setParent(o),i&&(i.recordNew(),t.Events.fire(i)),l&&(e=this.type===n?l.outputConnection:l.previousConnection,(r=t.Connection.getConnectionForOrphanedConnection(r,e))?e.connect(r):e.onFailedConnect(this))},t.Connection.prototype.dispose=function(){if(this.isConnected()){this.setShadowDom(null);var t=this.targetBlock();t&&t.unplug()}this.disposed=!0},t.Connection.prototype.getSourceBlock=function(){return this.sourceBlock_},t.Connection.prototype.isSuperior=function(){return this.type==t.connectionTypes.INPUT_VALUE||this.type==t.connectionTypes.NEXT_STATEMENT},t.Connection.prototype.isConnected=function(){return!!this.targetConnection},t.Connection.prototype.canConnectWithReason=function(e){return t.utils.deprecation.warn("Connection.prototype.canConnectWithReason","July 2020","July 2021","the workspace's connection checker"),this.getConnectionChecker().canConnectWithReason(this,e,!1)},t.Connection.prototype.checkConnection=function(e){t.utils.deprecation.warn("Connection.prototype.checkConnection","July 2020","July 2021","the workspace's connection checker");var i=this.getConnectionChecker(),n=i.canConnectWithReason(this,e,!1);if(n!=t.Connection.CAN_CONNECT)throw Error(i.getErrorMessage(n,this,e))},t.Connection.prototype.getConnectionChecker=function(){return this.sourceBlock_.workspace.connectionChecker},t.Connection.prototype.isConnectionAllowed=function(e){return t.utils.deprecation.warn("Connection.prototype.isConnectionAllowed","July 2020","July 2021","the workspace's connection checker"),this.getConnectionChecker().canConnect(this,e,!0)},t.Connection.prototype.onFailedConnect=function(t){},t.Connection.prototype.connect=function(e){if(this.targetConnection!=e&&this.getConnectionChecker().canConnect(this,e,!1)){var i=t.Events.getGroup();i||t.Events.setGroup(!0),this.isSuperior()?this.connect_(e):e.connect_(this),i||t.Events.setGroup(!1)}},t.Connection.connectReciprocally_=function(t,e){if(!t||!e)throw Error("Cannot connect null connections.");t.targetConnection=e,e.targetConnection=t},t.Connection.getSingleConnection_=function(t,e){for(var i,n=null,o=(e=e.outputConnection).getConnectionChecker(),r=0;i=t.inputList[r];r++)if((i=i.connection)&&o.canConnect(e,i,!1)){if(n)return null;n=i}return n},t.Connection.getConnectionForOrphanedOutput_=function(e,i){for(var n;n=t.Connection.getSingleConnection_(e,i);)if(!(e=n.targetBlock())||e.isShadow())return n;return null},t.Connection.getConnectionForOrphanedConnection=function(e,i){if(i.type===t.connectionTypes.OUTPUT_VALUE)return t.Connection.getConnectionForOrphanedOutput_(e,i.getSourceBlock());e=e.lastConnectionInStack(!0);var n=i.getConnectionChecker();return e&&n.canConnect(i,e,!1)?e:null},t.Connection.prototype.disconnect=function(){var e=this.targetConnection;if(!e)throw Error("Source connection not connected.");if(e.targetConnection!=this)throw Error("Target connection not connected to source connection.");if(this.isSuperior()){var i=this.sourceBlock_,n=e.getSourceBlock();e=this}else i=e.getSourceBlock(),n=this.sourceBlock_;var o=t.Events.getGroup();o||t.Events.setGroup(!0),this.disconnectInternal_(i,n),n.isShadow()||e.respawnShadow_(),o||t.Events.setGroup(!1)},t.Connection.prototype.disconnectInternal_=function(e,i){var n;t.Events.isEnabled()&&(n=new(t.Events.get(t.Events.BLOCK_MOVE))(i)),this.targetConnection=this.targetConnection.targetConnection=null,i.setParent(null),n&&(n.recordNew(),t.Events.fire(n))},t.Connection.prototype.respawnShadow_=function(){var e=this.getSourceBlock(),i=this.getShadowDom();if(e.workspace&&i)if((e=t.Xml.domToBlock(i,e.workspace)).outputConnection)this.connect(e.outputConnection);else{if(!e.previousConnection)throw Error("Child block does not have output or previous statement.");this.connect(e.previousConnection)}},t.Connection.prototype.targetBlock=function(){return this.isConnected()?this.targetConnection.getSourceBlock():null},t.Connection.prototype.checkType=function(e){return t.utils.deprecation.warn("Connection.prototype.checkType","October 2019","January 2021","the workspace's connection checker"),this.getConnectionChecker().canConnect(this,e,!1)},t.Connection.prototype.checkType_=function(e){return t.utils.deprecation.warn("Connection.prototype.checkType_","October 2019","January 2021","the workspace's connection checker"),this.checkType(e)},t.Connection.prototype.onCheckChanged_=function(){!this.isConnected()||this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||(this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug()},t.Connection.prototype.setCheck=function(t){return t?(Array.isArray(t)||(t=[t]),this.check_=t,this.onCheckChanged_()):this.check_=null,this},t.Connection.prototype.getCheck=function(){return this.check_},t.Connection.prototype.setShadowDom=function(t){this.shadowDom_=t,(t=this.targetBlock())?t.isShadow()&&(t.dispose(!1),this.respawnShadow_()):this.respawnShadow_()},t.Connection.prototype.getShadowDom=function(e){return e&&this.targetBlock().isShadow()?t.Xml.blockToDom(this.targetBlock()):this.shadowDom_},t.Connection.prototype.neighbours=function(t){return[]},t.Connection.prototype.getParentInput=function(){for(var t=null,e=this.sourceBlock_.inputList,i=0;in||i.getSourceBlock().isInsertionMarker())return!1;switch(i.type){case t.connectionTypes.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,i);case t.connectionTypes.OUTPUT_VALUE:if(i.isConnected()&&!i.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case t.connectionTypes.INPUT_VALUE:if(i.isConnected()&&!i.targetBlock().isMovable()&&!i.targetBlock().isShadow())return!1;break;case t.connectionTypes.NEXT_STATEMENT:if(i.isConnected()&&!e.getSourceBlock().nextConnection&&!i.targetBlock().isShadow()&&i.targetBlock().nextConnection)return!1;break;default:return!1}return-1==t.draggingConnections.indexOf(i)},t.ConnectionChecker.prototype.canConnectToPrevious_=function(e,i){return!e.targetConnection&&-1==t.draggingConnections.indexOf(i)&&(!i.targetConnection||!!(e=i.targetBlock()).isInsertionMarker()&&!e.getPreviousBlock())},t.registry.register(t.registry.Type.CONNECTION_CHECKER,t.registry.DEFAULT,t.ConnectionChecker),t.VariableMap=function(t){this.variableMap_=Object.create(null),this.workspace=t},t.VariableMap.prototype.clear=function(){this.variableMap_=Object.create(null)},t.VariableMap.prototype.renameVariable=function(e,i){var n=this.getVariable(i,e.type),o=this.workspace.getAllBlocks(!1);t.Events.setGroup(!0);try{n&&n.getId()!=e.getId()?this.renameVariableWithConflict_(e,i,n,o):this.renameVariableAndUses_(e,i,o)}finally{t.Events.setGroup(!1)}},t.VariableMap.prototype.renameVariableById=function(t,e){var i=this.getVariableById(t);if(!i)throw Error("Tried to rename a variable that didn't exist. ID: "+t);this.renameVariable(i,e)},t.VariableMap.prototype.renameVariableAndUses_=function(e,i,n){for(t.Events.fire(new(t.Events.get(t.Events.VAR_RENAME))(e,i)),e.name=i,i=0;ithis.remainingCapacityOfType(e))return!1;i+=t[e]}return!(i>this.remainingCapacity())},t.Workspace.prototype.hasBlockLimits=function(){return 1/0!=this.options.maxBlocks||!!this.options.maxInstances},t.Workspace.prototype.getUndoStack=function(){return this.undoStack_},t.Workspace.prototype.getRedoStack=function(){return this.redoStack_},t.Workspace.prototype.undo=function(e){var i=e?this.redoStack_:this.undoStack_,n=e?this.undoStack_:this.redoStack_,o=i.pop();if(o){for(var r=[o];i.length&&o.group&&o.group==i[i.length-1].group;)r.push(i.pop());for(i=0;o=r[i];i++)n.push(o);r=t.Events.filter(r,e),t.Events.recordUndo=!1;try{for(i=0;o=r[i];i++)o.run(e)}finally{t.Events.recordUndo=!0}}},t.Workspace.prototype.clearUndo=function(){this.undoStack_.length=0,this.redoStack_.length=0,t.Events.clearPendingUndo()},t.Workspace.prototype.addChangeListener=function(t){return this.listeners_.push(t),t},t.Workspace.prototype.removeChangeListener=function(e){t.utils.arrayRemove(this.listeners_,e)},t.Workspace.prototype.fireChangeListener=function(t){if(t.recordUndo)for(this.undoStack_.push(t),this.redoStack_.length=0;this.undoStack_.length>this.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(var e,i=0;e=this.listeners_[i];i++)e(t)},t.Workspace.prototype.getBlockById=function(t){return this.blockDB_[t]||null},t.Workspace.prototype.setBlockById=function(t,e){this.blockDB_[t]=e},t.Workspace.prototype.removeBlockById=function(t){delete this.blockDB_[t]},t.Workspace.prototype.getCommentById=function(t){return this.commentDB_[t]||null},t.Workspace.prototype.allInputsFilled=function(t){for(var e,i=this.getTopBlocks(!1),n=0;e=i[n];n++)if(!e.allInputsFilled(t))return!1;return!0},t.Workspace.prototype.getPotentialVariableMap=function(){return this.potentialVariableMap_},t.Workspace.prototype.createPotentialVariableMap=function(){this.potentialVariableMap_=new t.VariableMap(this)},t.Workspace.prototype.getVariableMap=function(){return this.variableMap_},t.Workspace.prototype.setVariableMap=function(t){this.variableMap_=t},t.Workspace.WorkspaceDB_=Object.create(null),t.Workspace.getById=function(e){return t.Workspace.WorkspaceDB_[e]||null},t.Workspace.getAll=function(){var e,i=[];for(e in t.Workspace.WorkspaceDB_)i.push(t.Workspace.WorkspaceDB_[e]);return i},t.WorkspaceDragSurfaceSvg=function(t){this.container_=t,this.createDom()},t.WorkspaceDragSurfaceSvg.prototype.SVG_=null,t.WorkspaceDragSurfaceSvg.prototype.container_=null,t.WorkspaceDragSurfaceSvg.prototype.createDom=function(){this.SVG_||(this.SVG_=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{xmlns:t.utils.dom.SVG_NS,"xmlns:html":t.utils.dom.HTML_NS,"xmlns:xlink":t.utils.dom.XLINK_NS,version:"1.1",class:"blocklyWsDragSurface blocklyOverflowVisible"},null),this.container_.appendChild(this.SVG_))},t.WorkspaceDragSurfaceSvg.prototype.translateSurface=function(e,i){e=e.toFixed(0),i=i.toFixed(0),this.SVG_.style.display="block",t.utils.dom.setCssTransform(this.SVG_,"translate3d("+e+"px, "+i+"px, 0px)")},t.WorkspaceDragSurfaceSvg.prototype.getSurfaceTranslation=function(){return t.utils.getRelativeXY(this.SVG_)},t.WorkspaceDragSurfaceSvg.prototype.clearAndHide=function(e){if(!e)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var i=this.SVG_.childNodes[0],n=this.SVG_.childNodes[1];if(!(i&&n&&t.utils.dom.hasClass(i,"blocklyBlockCanvas")&&t.utils.dom.hasClass(n,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");if(null!=this.previousSibling_?t.utils.dom.insertAfter(i,this.previousSibling_):e.insertBefore(i,e.firstChild),t.utils.dom.insertAfter(n,i),this.SVG_.style.display="none",this.SVG_.childNodes.length)throw Error("Drag surface was not cleared.");t.utils.dom.setCssTransform(this.SVG_,""),this.previousSibling_=null},t.WorkspaceDragSurfaceSvg.prototype.setContentsAndShow=function(t,e,i,n,o,r){if(this.SVG_.childNodes.length)throw Error("Already dragging a block.");this.previousSibling_=i,t.setAttribute("transform","translate(0, 0) scale("+r+")"),e.setAttribute("transform","translate(0, 0) scale("+r+")"),this.SVG_.setAttribute("width",n),this.SVG_.setAttribute("height",o),this.SVG_.appendChild(t),this.SVG_.appendChild(e),this.SVG_.style.display="block"},t.blockRendering={},t.blockRendering.useDebugger=!1,t.blockRendering.register=function(e,i){t.registry.register(t.registry.Type.RENDERER,e,i)},t.blockRendering.unregister=function(e){t.registry.unregister(t.registry.Type.RENDERER,e)},t.blockRendering.startDebugger=function(){t.blockRendering.useDebugger=!0},t.blockRendering.stopDebugger=function(){t.blockRendering.useDebugger=!1},t.blockRendering.init=function(e,i,n){return(e=new(t.registry.getClass(t.registry.Type.RENDERER,e))(e)).init(i,n),e},t.ASTNode=function(e,i,n){if(!i)throw Error("Cannot create a node without a location.");this.type_=e,this.isConnection_=t.ASTNode.isConnectionType_(e),this.location_=i,this.wsCoordinate_=null,this.processParams_(n||null)},t.ASTNode.types={FIELD:"field",BLOCK:"block",INPUT:"input",OUTPUT:"output",NEXT:"next",PREVIOUS:"previous",STACK:"stack",WORKSPACE:"workspace"},t.ASTNode.NAVIGATE_ALL_FIELDS=!1,t.ASTNode.DEFAULT_OFFSET_Y=-20,t.ASTNode.isConnectionType_=function(e){switch(e){case t.ASTNode.types.PREVIOUS:case t.ASTNode.types.NEXT:case t.ASTNode.types.INPUT:case t.ASTNode.types.OUTPUT:return!0}return!1},t.ASTNode.createFieldNode=function(e){return e?new t.ASTNode(t.ASTNode.types.FIELD,e):null},t.ASTNode.createConnectionNode=function(e){if(!e)return null;var i=e.type;return i==t.connectionTypes.INPUT_VALUE||i==t.connectionTypes.NEXT_STATEMENT&&e.getParentInput()?t.ASTNode.createInputNode(e.getParentInput()):i==t.connectionTypes.NEXT_STATEMENT?new t.ASTNode(t.ASTNode.types.NEXT,e):i==t.connectionTypes.OUTPUT_VALUE?new t.ASTNode(t.ASTNode.types.OUTPUT,e):i==t.connectionTypes.PREVIOUS_STATEMENT?new t.ASTNode(t.ASTNode.types.PREVIOUS,e):null},t.ASTNode.createInputNode=function(e){return e&&e.connection?new t.ASTNode(t.ASTNode.types.INPUT,e.connection):null},t.ASTNode.createBlockNode=function(e){return e?new t.ASTNode(t.ASTNode.types.BLOCK,e):null},t.ASTNode.createStackNode=function(e){return e?new t.ASTNode(t.ASTNode.types.STACK,e):null},t.ASTNode.createWorkspaceNode=function(e,i){return i&&e?new t.ASTNode(t.ASTNode.types.WORKSPACE,e,{wsCoordinate:i}):null},t.ASTNode.createTopNode=function(e){var i=e.previousConnection||e.outputConnection;return i?t.ASTNode.createConnectionNode(i):t.ASTNode.createBlockNode(e)},t.ASTNode.prototype.processParams_=function(t){t&&t.wsCoordinate&&(this.wsCoordinate_=t.wsCoordinate)},t.ASTNode.prototype.getLocation=function(){return this.location_},t.ASTNode.prototype.getType=function(){return this.type_},t.ASTNode.prototype.getWsCoordinate=function(){return this.wsCoordinate_},t.ASTNode.prototype.isConnection=function(){return this.isConnection_},t.ASTNode.prototype.findNextForInput_=function(){var e,i=this.location_.getParentInput(),n=i.getSourceBlock();for(i=n.inputList.indexOf(i)+1;e=n.inputList[i];i++){for(var o,r=e.fieldRow,s=0;o=r[s];s++)if(o.isClickable()||t.ASTNode.NAVIGATE_ALL_FIELDS)return t.ASTNode.createFieldNode(o);if(e.connection)return t.ASTNode.createInputNode(e)}return null},t.ASTNode.prototype.findNextForField_=function(){var e=this.location_,i=e.getParentInput(),n=e.getSourceBlock(),o=n.inputList.indexOf(i);for(e=i.fieldRow.indexOf(e)+1;i=n.inputList[o];o++){for(var r=i.fieldRow;en)){var o=i.getSvgXY(e.getSvgRoot());e.outputConnection?(o.x+=(e.RTL?3:-3)*n,o.y+=13*n):e.previousConnection&&(o.x+=(e.RTL?-23:23)*n,o.y+=3*n),e=t.utils.dom.createSvgElement(t.utils.Svg.CIRCLE,{cx:o.x,cy:o.y,r:0,fill:"none",stroke:"#888","stroke-width":10},i.getParentSvg()),t.blockAnimations.connectionUiStep_(e,new Date,n)}},t.blockAnimations.connectionUiStep_=function(e,i,n){var o=(new Date-i)/150;1e.workspace.scale)){var i=e.getHeightWidth().height;i=Math.atan(10/i)/Math.PI*180,e.RTL||(i*=-1),t.blockAnimations.disconnectUiStep_(e.getSvgRoot(),i,new Date)}},t.blockAnimations.disconnectUiStep_=function(e,i,n){var o=(new Date-n)/200;1i-t.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_)},t.InsertionMarkerManager.prototype.getCandidate_=function(t){for(var e=this.getStartRadius_(),i=null,n=null,o=0;oe.width)return i;if(this.workspace_.RTL)var n=this.anchorXY_.x-i,o=n-this.width_,r=e.left+e.width,s=e.left+t.Scrollbar.scrollbarThickness/this.workspace_.scale;else n=(o=i+this.anchorXY_.x)+this.width_,s=e.left,r=e.left+e.width-t.Scrollbar.scrollbarThickness/this.workspace_.scale;return this.workspace_.RTL?or&&(i=-(r-this.anchorXY_.x)):or&&(i=r-this.anchorXY_.x-this.width_),i},t.Bubble.prototype.getOptimalRelativeTop_=function(e){var i=-this.height_/4;if(this.height_>e.height)return i;var n=this.anchorXY_.y+i,o=n+this.height_,r=e.top;e=e.top+e.height-t.Scrollbar.scrollbarThickness/this.workspace_.scale;var s=this.anchorXY_.y;return ne&&(i=e-s-this.height_),i},t.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)},t.Bubble.prototype.moveTo=function(t,e){this.bubbleGroup_.setAttribute("transform","translate("+t+","+e+")")},t.Bubble.prototype.setDragging=function(t){!t&&this.moveCallback_&&this.moveCallback_()},t.Bubble.prototype.getBubbleSize=function(){return new t.utils.Size(this.width_,this.height_)},t.Bubble.prototype.setBubbleSize=function(e,i){var n=2*t.Bubble.BORDER_WIDTH;e=Math.max(e,n+45),i=Math.max(i,n+20),this.width_=e,this.height_=i,this.bubbleBack_.setAttribute("width",e),this.bubbleBack_.setAttribute("height",i),this.resizeGroup_&&(this.workspace_.RTL?this.resizeGroup_.setAttribute("transform","translate("+2*t.Bubble.BORDER_WIDTH+","+(i-n)+") scale(-1 1)"):this.resizeGroup_.setAttribute("transform","translate("+(e-n)+","+(i-n)+")")),this.autoLayout_&&this.layoutBubble_(),this.positionBubble_(),this.renderArrow_(),this.resizeCallback_&&this.resizeCallback_()},t.Bubble.prototype.renderArrow_=function(){var e=[],i=this.width_/2,n=this.height_/2,o=-this.relativeLeft_,r=-this.relativeTop_;if(i==o&&n==r)e.push("M "+i+","+n);else{r-=n,o-=i,this.workspace_.RTL&&(o*=-1);var s=Math.sqrt(r*r+o*o),a=Math.acos(o/s);0>r&&(a=2*Math.PI-a);var l=a+Math.PI/2;l>2*Math.PI&&(l-=2*Math.PI);var c=Math.sin(l),u=Math.cos(l),h=this.getBubbleSize();l=(h.width+h.height)/t.Bubble.ARROW_THICKNESS,l=Math.min(l,h.width,h.height)/4,o=i+(h=1-t.Bubble.ANCHOR_RADIUS/s)*o,r=n+h*r,h=i+l*u;var p=n+l*c;i-=l*u,n-=l*c,(c=a+this.arrow_radians_)>2*Math.PI&&(c-=2*Math.PI),a=Math.sin(c)*s/t.Bubble.ARROW_BEND,s=Math.cos(c)*s/t.Bubble.ARROW_BEND,e.push("M"+h+","+p),e.push("C"+(h+s)+","+(p+a)+" "+o+","+r+" "+o+","+r),e.push("C"+o+","+r+" "+(i+s)+","+(n+a)+" "+i+","+n)}e.push("z"),this.bubbleArrow_.setAttribute("d",e.join(" "))},t.Bubble.prototype.setColour=function(t){this.bubbleBack_.setAttribute("fill",t),this.bubbleArrow_.setAttribute("fill",t)},t.Bubble.prototype.dispose=function(){this.onMouseDownBubbleWrapper_&&t.browserEvents.unbind(this.onMouseDownBubbleWrapper_),this.onMouseDownResizeWrapper_&&t.browserEvents.unbind(this.onMouseDownResizeWrapper_),t.Bubble.unbindDragEvents_(),t.utils.dom.removeNode(this.bubbleGroup_),this.disposed=!0},t.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_()},t.Bubble.prototype.getRelativeToSurfaceXY=function(){return new t.utils.Coordinate(this.workspace_.RTL?-this.relativeLeft_+this.anchorXY_.x-this.width_:this.anchorXY_.x+this.relativeLeft_,this.anchorXY_.y+this.relativeTop_)},t.Bubble.prototype.setAutoLayout=function(t){this.autoLayout_=t},t.Bubble.textToDom=function(e){var i=t.utils.dom.createSvgElement(t.utils.Svg.TEXT,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:t.Bubble.BORDER_WIDTH},null);e=e.split("\n");for(var n=0;n(this.flyout_?t.FLYOUT_DRAG_RADIUS:t.DRAG_RADIUS))},t.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(),t.Events.getGroup()||t.Events.setGroup(!0),this.startBlock_=null,this.targetBlock_=this.flyout_.createBlock(this.targetBlock_),this.targetBlock_.select(),!0))},t.Gesture.prototype.updateIsDraggingBubble_=function(){return!!this.startBubble_&&(this.isDraggingBubble_=!0,this.startDraggingBubble_(),!0)},t.Gesture.prototype.updateIsDraggingBlock_=function(){return!!this.targetBlock_&&(this.flyout_?this.isDraggingBlock_=this.updateIsDraggingFromFlyout_():this.targetBlock_.isMovable()&&(this.isDraggingBlock_=!0),!!this.isDraggingBlock_&&(this.startDraggingBlock_(),!0))},t.Gesture.prototype.updateIsDraggingWorkspace_=function(){(this.flyout_?this.flyout_.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.workspaceDragger_=new t.WorkspaceDragger(this.startWorkspace_),this.isDraggingWorkspace_=!0,this.workspaceDragger_.startDrag())},t.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_()},t.Gesture.prototype.startDraggingBlock_=function(){this.blockDragger_=new(t.registry.getClassFromOptions(t.registry.Type.BLOCK_DRAGGER,this.creatorWorkspace_.options,!0))(this.targetBlock_,this.startWorkspace_),this.blockDragger_.startDrag(this.currentDragDeltaXY_,this.healStack_),this.blockDragger_.drag(this.mostRecentEvent_,this.currentDragDeltaXY_)},t.Gesture.prototype.startDraggingBubble_=function(){this.bubbleDragger_=new t.BubbleDragger(this.startBubble_,this.startWorkspace_),this.bubbleDragger_.startBubbleDrag(),this.bubbleDragger_.dragBubble(this.mostRecentEvent_,this.currentDragDeltaXY_)},t.Gesture.prototype.doStart=function(e){t.utils.isTargetInput(e)?this.cancel():(this.hasStarted_=!0,t.blockAnimations.disconnectUiStop(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),t.hideChaff(!!this.flyout_),this.startWorkspace_.markFocused(),this.mostRecentEvent_=e,t.Tooltip.block(),this.targetBlock_&&this.targetBlock_.select(),t.utils.isRightButton(e)?this.handleRightClick(e):("touchstart"!=e.type.toLowerCase()&&"pointerdown"!=e.type.toLowerCase()||"mouse"==e.pointerType||t.longStart(e,this),this.mouseDownXY_=new t.utils.Coordinate(e.clientX,e.clientY),this.healStack_=e.altKey||e.ctrlKey||e.metaKey,this.bindMouseEvents(e)))},t.Gesture.prototype.bindMouseEvents=function(e){this.onMoveWrapper_=t.browserEvents.conditionalBind(document,"mousemove",null,this.handleMove.bind(this)),this.onUpWrapper_=t.browserEvents.conditionalBind(document,"mouseup",null,this.handleUp.bind(this)),e.preventDefault(),e.stopPropagation()},t.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()},t.Gesture.prototype.handleUp=function(e){this.updateFromEvent_(e),t.longStop_(),this.isEnding_?console.log("Trying to end a gesture recursively."):(this.isEnding_=!0,this.isDraggingBubble_?this.bubbleDragger_.endBubbleDrag(e,this.currentDragDeltaXY_):this.isDraggingBlock_?this.blockDragger_.endDrag(e,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_(e),e.preventDefault(),e.stopPropagation(),this.dispose())},t.Gesture.prototype.cancel=function(){this.isEnding_||(t.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())},t.Gesture.prototype.handleRightClick=function(e){this.targetBlock_?(this.bringBlockToFront_(),t.hideChaff(!!this.flyout_),this.targetBlock_.showContextMenu(e)):this.startBubble_?this.startBubble_.showContextMenu(e):this.startWorkspace_&&!this.flyout_&&(t.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()},t.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)},t.Gesture.prototype.fireWorkspaceClick_=function(e){t.Events.fire(new(t.Events.get(t.Events.CLICK))(null,e.id,"workspace"))},t.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())},t.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},t.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},t.Gesture.prototype.doBubbleClick_=function(){this.startBubble_.setFocus&&this.startBubble_.setFocus(),this.startBubble_.select&&this.startBubble_.select()},t.Gesture.prototype.doFieldClick_=function(){this.startField_.showEditor(this.mostRecentEvent_),this.bringBlockToFront_()},t.Gesture.prototype.doBlockClick_=function(){if(this.flyout_&&this.flyout_.autoClose)this.targetBlock_.isEnabled()&&(t.Events.getGroup()||t.Events.setGroup(!0),this.flyout_.createBlock(this.targetBlock_).scheduleSnapAndBump());else{var e=new(t.Events.get(t.Events.CLICK))(this.startBlock_,this.startWorkspace_.id,"block");t.Events.fire(e)}this.bringBlockToFront_(),t.Events.setGroup(!1)},t.Gesture.prototype.doWorkspaceClick_=function(e){e=this.creatorWorkspace_,t.selected&&t.selected.unselect(),this.fireWorkspaceClick_(this.startWorkspace_||e)},t.Gesture.prototype.bringBlockToFront_=function(){this.targetBlock_&&!this.flyout_&&this.targetBlock_.bringToFront()},t.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)},t.Gesture.prototype.setStartBubble=function(t){this.startBubble_||(this.startBubble_=t)},t.Gesture.prototype.setStartBlock=function(t){this.startBlock_||this.startBubble_||(this.startBlock_=t,t.isInFlyout&&t!=t.getRootBlock()?this.setTargetBlock_(t.getRootBlock()):this.setTargetBlock_(t))},t.Gesture.prototype.setTargetBlock_=function(t){t.isShadow()?this.setTargetBlock_(t.getParent()):this.targetBlock_=t},t.Gesture.prototype.setStartWorkspace_=function(t){this.startWorkspace_||(this.startWorkspace_=t)},t.Gesture.prototype.setStartFlyout_=function(t){this.flyout_||(this.flyout_=t)},t.Gesture.prototype.isBubbleClick_=function(){return!!this.startBubble_&&!this.hasExceededDragRadius_},t.Gesture.prototype.isBlockClick_=function(){return!!this.startBlock_&&!this.hasExceededDragRadius_&&!this.isFieldClick_()},t.Gesture.prototype.isFieldClick_=function(){return!!this.startField_&&this.startField_.isClickable()&&!this.hasExceededDragRadius_&&(!this.flyout_||!this.flyout_.autoClose)},t.Gesture.prototype.isWorkspaceClick_=function(){return!(this.startBlock_||this.startBubble_||this.startField_||this.hasExceededDragRadius_)},t.Gesture.prototype.isDragging=function(){return this.isDraggingWorkspace_||this.isDraggingBlock_||this.isDraggingBubble_},t.Gesture.prototype.hasStarted=function(){return this.hasStarted_},t.Gesture.prototype.getInsertionMarkers=function(){return this.blockDragger_?this.blockDragger_.getInsertionMarkers():[]},t.Gesture.prototype.getCurrentDragger=function(){return this.isDraggingBlock_?this.blockDragger_:this.isDraggingWorkspace_?this.workspaceDragger_:this.isDraggingBubble_?this.bubbleDragger_:null},t.Gesture.inProgress=function(){for(var e,i=t.Workspace.getAll(),n=0;e=i[n];n++)if(e.currentGesture_)return!0;return!1},t.IRegistrable=function(){},t.Marker=function(){this.drawer_=this.curNode_=this.colour=null,this.type="marker"},t.Marker.prototype.setDrawer=function(t){this.drawer_=t},t.Marker.prototype.getDrawer=function(){return this.drawer_},t.Marker.prototype.getCurNode=function(){return this.curNode_},t.Marker.prototype.setCurNode=function(t){var e=this.curNode_;this.curNode_=t,this.drawer_&&this.drawer_.draw(e,this.curNode_)},t.Marker.prototype.draw=function(){this.drawer_&&this.drawer_.draw(this.curNode_,this.curNode_)},t.Marker.prototype.hide=function(){this.drawer_&&this.drawer_.hide()},t.Marker.prototype.dispose=function(){this.getDrawer()&&this.getDrawer().dispose()},t.Cursor=function(){t.Cursor.superClass_.constructor.call(this),this.type="cursor"},t.utils.object.inherits(t.Cursor,t.Marker),t.Cursor.prototype.next=function(){var e=this.getCurNode();if(!e)return null;for(e=e.next();e&&e.next()&&(e.getType()==t.ASTNode.types.NEXT||e.getType()==t.ASTNode.types.BLOCK);)e=e.next();return e&&this.setCurNode(e),e},t.Cursor.prototype.in=function(){var e=this.getCurNode();return e?(e.getType()!=t.ASTNode.types.PREVIOUS&&e.getType()!=t.ASTNode.types.OUTPUT||(e=e.next()),(e=e.in())&&this.setCurNode(e),e):null},t.Cursor.prototype.prev=function(){var e=this.getCurNode();if(!e)return null;for(e=e.prev();e&&e.prev()&&(e.getType()==t.ASTNode.types.NEXT||e.getType()==t.ASTNode.types.BLOCK);)e=e.prev();return e&&this.setCurNode(e),e},t.Cursor.prototype.out=function(){var e=this.getCurNode();return e?((e=e.out())&&e.getType()==t.ASTNode.types.BLOCK&&(e=e.prev()||e),e&&this.setCurNode(e),e):null},t.registry.register(t.registry.Type.CURSOR,t.registry.DEFAULT,t.Cursor),t.MarkerManager=function(t){this.cursorSvg_=this.cursor_=null,this.markers_=Object.create(null),this.workspace_=t},t.MarkerManager.LOCAL_MARKER="local_marker_1",t.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},t.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]},t.MarkerManager.prototype.getCursor=function(){return this.cursor_},t.MarkerManager.prototype.getMarker=function(t){return this.markers_[t]||null},t.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()))},t.MarkerManager.prototype.setCursorSvg=function(t){t?(this.workspace_.getBlockCanvas().appendChild(t),this.cursorSvg_=t):this.cursorSvg_=null},t.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},t.MarkerManager.prototype.updateMarkers=function(){this.workspace_.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace_.getCursor().draw()},t.MarkerManager.prototype.dispose=function(){for(var t,e=Object.keys(this.markers_),i=0;t=e[i];i++)this.unregisterMarker(t);this.markers_=null,this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)},t.WidgetDiv={},t.WidgetDiv.owner_=null,t.WidgetDiv.dispose_=null,t.WidgetDiv.rendererClassName_="",t.WidgetDiv.themeClassName_="",t.WidgetDiv.createDom=function(){t.WidgetDiv.DIV||(t.WidgetDiv.DIV=document.createElement("div"),t.WidgetDiv.DIV.className="blocklyWidgetDiv",(t.parentContainer||document.body).appendChild(t.WidgetDiv.DIV))},t.WidgetDiv.show=function(e,i,n){t.WidgetDiv.hide(),t.WidgetDiv.owner_=e,t.WidgetDiv.dispose_=n,(e=t.WidgetDiv.DIV).style.direction=i?"rtl":"ltr",e.style.display="block",i=t.getMainWorkspace(),t.WidgetDiv.rendererClassName_=i.getRenderer().getClassName(),t.WidgetDiv.themeClassName_=i.getTheme().getClassName(),t.utils.dom.addClass(e,t.WidgetDiv.rendererClassName_),t.utils.dom.addClass(e,t.WidgetDiv.themeClassName_)},t.WidgetDiv.hide=function(){if(t.WidgetDiv.isVisible()){t.WidgetDiv.owner_=null;var e=t.WidgetDiv.DIV;e.style.display="none",e.style.left="",e.style.top="",t.WidgetDiv.dispose_&&t.WidgetDiv.dispose_(),t.WidgetDiv.dispose_=null,e.textContent="",t.WidgetDiv.rendererClassName_&&(t.utils.dom.removeClass(e,t.WidgetDiv.rendererClassName_),t.WidgetDiv.rendererClassName_=""),t.WidgetDiv.themeClassName_&&(t.utils.dom.removeClass(e,t.WidgetDiv.themeClassName_),t.WidgetDiv.themeClassName_=""),t.getMainWorkspace().markFocused()}},t.WidgetDiv.isVisible=function(){return!!t.WidgetDiv.owner_},t.WidgetDiv.hideIfOwner=function(e){t.WidgetDiv.owner_==e&&t.WidgetDiv.hide()},t.WidgetDiv.positionInternal_=function(e,i,n){t.WidgetDiv.DIV.style.left=e+"px",t.WidgetDiv.DIV.style.top=i+"px",t.WidgetDiv.DIV.style.height=n+"px"},t.WidgetDiv.positionWithAnchor=function(e,i,n,o){var r=t.WidgetDiv.calculateY_(e,i,n);e=t.WidgetDiv.calculateX_(e,i,n,o),0>r?t.WidgetDiv.positionInternal_(e,0,n.height+r):t.WidgetDiv.positionInternal_(e,r,n.height)},t.WidgetDiv.calculateX_=function(t,e,i,n){return n?(e=Math.max(e.right-i.width,t.left),Math.min(e,t.right-i.width)):(e=Math.min(e.left,t.right-i.width),Math.max(e,t.left))},t.WidgetDiv.calculateY_=function(t,e,i){return e.bottom+i.height>=t.bottom?e.top-i.height:e.bottom},t.Field=function(e,i,n){this.value_=this.DEFAULT_VALUE,this.tooltip_=this.validator_=null,this.size_=new t.utils.Size(0,0),this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=null,n&&this.configure_(n),this.setValue(e),i&&this.setValidator(i)},t.Field.prototype.DEFAULT_VALUE=null,t.Field.prototype.name=void 0,t.Field.prototype.disposed=!1,t.Field.prototype.maxDisplayLength=50,t.Field.prototype.sourceBlock_=null,t.Field.prototype.isDirty_=!0,t.Field.prototype.visible_=!0,t.Field.prototype.clickTarget_=null,t.Field.NBSP=" ",t.Field.prototype.EDITABLE=!0,t.Field.prototype.SERIALIZABLE=!1,t.Field.prototype.configure_=function(e){var i=e.tooltip;"string"==typeof i&&(i=t.utils.replaceMessageReferences(e.tooltip)),i&&this.setTooltip(i)},t.Field.prototype.setSourceBlock=function(t){if(this.sourceBlock_)throw Error("Field already bound to a block.");this.sourceBlock_=t},t.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_},t.Field.prototype.getSourceBlock=function(){return this.sourceBlock_},t.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=t.utils.dom.createSvgElement(t.utils.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())},t.Field.prototype.initView=function(){this.createBorderRect_(),this.createTextElement_()},t.Field.prototype.initModel=function(){},t.Field.prototype.createBorderRect_=function(){this.borderRect_=t.utils.dom.createSvgElement(t.utils.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_)},t.Field.prototype.createTextElement_=function(){this.textElement_=t.utils.dom.createSvgElement(t.utils.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_)},t.Field.prototype.bindEvents_=function(){t.Tooltip.bindMouseEvents(this.getClickTarget_()),this.mouseDownWrapper_=t.browserEvents.conditionalBind(this.getClickTarget_(),"mousedown",this,this.onMouseDown_)},t.Field.prototype.fromXml=function(t){this.setValue(t.textContent)},t.Field.prototype.toXml=function(t){return t.textContent=this.getValue(),t},t.Field.prototype.dispose=function(){t.DropDownDiv.hideIfOwner(this),t.WidgetDiv.hideIfOwner(this),t.Tooltip.unbindMouseEvents(this.getClickTarget_()),this.mouseDownWrapper_&&t.browserEvents.unbind(this.mouseDownWrapper_),t.utils.dom.removeNode(this.fieldGroup_),this.disposed=!0},t.Field.prototype.updateEditable=function(){var e=this.fieldGroup_;this.EDITABLE&&e&&(this.sourceBlock_.isEditable()?(t.utils.dom.addClass(e,"blocklyEditableText"),t.utils.dom.removeClass(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(t.utils.dom.addClass(e,"blocklyNonEditableText"),t.utils.dom.removeClass(e,"blocklyEditableText"),e.style.cursor=""))},t.Field.prototype.isClickable=function(){return!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&!!this.showEditor_&&"function"==typeof this.showEditor_},t.Field.prototype.isCurrentlyEditable=function(){return this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()},t.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},t.Field.prototype.isVisible=function(){return this.visible_},t.Field.prototype.setVisible=function(t){if(this.visible_!=t){this.visible_=t;var e=this.getSvgRoot();e&&(e.style.display=t?"block":"none")}},t.Field.prototype.setValidator=function(t){this.validator_=t},t.Field.prototype.getValidator=function(){return this.validator_},t.Field.prototype.getSvgRoot=function(){return this.fieldGroup_},t.Field.prototype.applyColour=function(){},t.Field.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()},t.Field.prototype.showEditor=function(t){this.isClickable()&&this.showEditor_(t)},t.Field.prototype.updateSize_=function(e){var i=this.getConstants(),n=2*(e=void 0!=e?e:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0),o=i.FIELD_TEXT_HEIGHT,r=0;this.textElement_&&(n+=r=t.utils.dom.getFastTextWidth(this.textElement_,i.FIELD_TEXT_FONTSIZE,i.FIELD_TEXT_FONTWEIGHT,i.FIELD_TEXT_FONTFAMILY)),this.borderRect_&&(o=Math.max(o,i.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=o,this.size_.width=n,this.positionTextElement_(e,r),this.positionBorderRect_()},t.Field.prototype.positionTextElement_=function(t,e){if(this.textElement_){var i=this.getConstants(),n=this.size_.height/2;this.textElement_.setAttribute("x",this.sourceBlock_.RTL?this.size_.width-e-t:t),this.textElement_.setAttribute("y",i.FIELD_TEXT_BASELINE_CENTER?n:n-i.FIELD_TEXT_HEIGHT/2+i.FIELD_TEXT_BASELINE)}},t.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))},t.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 t.utils.Size(0,0)},t.Field.prototype.getScaledBBox=function(){if(this.borderRect_)e=this.borderRect_.getBoundingClientRect(),n=t.utils.style.getPageOffset(this.borderRect_),o=e.width,e=e.height;else{var e=this.sourceBlock_.getHeightWidth(),i=this.sourceBlock_.workspace.scale,n=this.getAbsoluteXY_(),o=e.width*i;e=e.height*i,t.utils.userAgent.GECKO?(n.x+=1.5*i,n.y+=1.5*i):t.utils.userAgent.EDGE||t.utils.userAgent.IE||(n.x-=.5*i,n.y-=.5*i),o+=1*i,e+=1*i}return new t.utils.Rect(n.y,n.y+e,n.x,n.x+o)},t.Field.prototype.getDisplayText_=function(){var e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,t.Field.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):t.Field.NBSP},t.Field.prototype.getText=function(){if(this.getText_){var t=this.getText_.call(this);if(null!==t)return String(t)}return String(this.getValue())},t.Field.prototype.markDirty=function(){this.isDirty_=!0,this.constants_=null},t.Field.prototype.forceRerender=function(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours(),this.updateMarkers_())},t.Field.prototype.setValue=function(e){if(null!==e){var i=this.doClassValidation_(e);if(!((e=this.processValidation_(e,i))instanceof Error)){if((i=this.getValidator())&&(i=i.call(this,e),(e=this.processValidation_(e,i))instanceof Error))return;if(!(i=this.sourceBlock_)||!i.disposed){var n=this.getValue();n===e?this.doValueUpdate_(e):(i&&t.Events.isEnabled()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(i,"field",this.name||null,n,e)),this.doValueUpdate_(e),this.isDirty_&&this.forceRerender())}}}},t.Field.prototype.processValidation_=function(t,e){return null===e?(this.doValueInvalid_(t),this.isDirty_&&this.forceRerender(),Error()):(void 0!==e&&(t=e),t)},t.Field.prototype.getValue=function(){return this.value_},t.Field.prototype.doClassValidation_=function(t){return null===t||void 0===t?null:t},t.Field.prototype.doValueUpdate_=function(t){this.value_=t,this.isDirty_=!0},t.Field.prototype.doValueInvalid_=function(t){},t.Field.prototype.onMouseDown_=function(t){this.sourceBlock_&&this.sourceBlock_.workspace&&(t=this.sourceBlock_.workspace.getGesture(t))&&t.setStartField(this)},t.Field.prototype.setTooltip=function(t){t||""===t||(t=this.sourceBlock_);var e=this.getClickTarget_();e?e.tooltip=t:this.tooltip_=t},t.Field.prototype.getTooltip=function(){var e=this.getClickTarget_();return e?t.Tooltip.getTooltipOfObject(e):t.Tooltip.getTooltipOfObject({tooltip:this.tooltip_})},t.Field.prototype.getClickTarget_=function(){return this.clickTarget_||this.getSvgRoot()},t.Field.prototype.getAbsoluteXY_=function(){return t.utils.style.getPageOffset(this.getClickTarget_())},t.Field.prototype.referencesVariables=function(){return!1},t.Field.prototype.getParentInput=function(){for(var t=null,e=this.sourceBlock_,i=e.inputList,n=0;ne||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return i||""==i&&n?("string"==typeof i&&(i=t.fieldRegistry.fromJson({type:"field_label",text:i})),i.setSourceBlock(this.sourceBlock_),this.sourceBlock_.rendered&&(i.init(),i.applyColour()),i.name=n,i.setVisible(this.isVisible()),i.prefixField&&(e=this.insertFieldAt(e,i.prefixField)),this.fieldRow.splice(e,0,i),++e,i.suffixField&&(e=this.insertFieldAt(e,i.suffixField)),this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours()),e):e},t.Input.prototype.removeField=function(t,e){for(var i,n=0;i=this.fieldRow[n];n++)if(i.name===t)return i.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.Input.prototype.isVisible=function(){return this.visible_},t.Input.prototype.setVisible=function(t){var e=[];if(this.visible_==t)return e;this.visible_=t;for(var i,n=0;i=this.fieldRow[n];n++)i.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.Input.prototype.markDirty=function(){for(var t,e=0;t=this.fieldRow[e];e++)t.markDirty()},t.Input.prototype.setCheck=function(t){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(t),this},t.Input.prototype.setAlign=function(t){return this.align=t,this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render()),this},t.Input.prototype.setShadowDom=function(t){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(t),this},t.Input.prototype.getShadowDom=function(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()},t.Input.prototype.init=function(){if(this.sourceBlock_.workspace.rendered)for(var t=0;te&&(r=r.substring(0,e-3)+"..."),r},t.Block.prototype.appendValueInput=function(e){return this.appendInput_(t.inputTypes.VALUE,e)},t.Block.prototype.appendStatementInput=function(e){return this.appendInput_(t.inputTypes.STATEMENT,e)},t.Block.prototype.appendDummyInput=function(e){return this.appendInput_(t.inputTypes.DUMMY,e||"")},t.Block.prototype.jsonInit=function(e){var i=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(i+"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(i+"Must not have both a colour and a style.");e.style?this.jsonInitStyle_(e,i):this.jsonInitColour_(e,i);for(var n=0;void 0!==e["message"+n];)this.interpolate_(e["message"+n],e["args"+n]||[],e["lastDummyAlign"+n],i),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=e.tooltip,n=t.utils.replaceMessageReferences(n),this.setTooltip(n)),void 0!==e.enableContextMenu&&(n=e.enableContextMenu,this.contextMenu=!!n),void 0!==e.helpUrl&&(n=e.helpUrl,n=t.utils.replaceMessageReferences(n),this.setHelpUrl(n)),"string"==typeof e.extensions&&(console.warn(i+"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&&t.Extensions.apply(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(i=0;ir||r>e)throw Error('Block "'+this.type+'": Message index %'+r+" out of range.");if(i[r])throw Error('Block "'+this.type+'": Message index %'+r+" duplicated.");i[r]=!0,n++}}if(n!=e)throw Error('Block "'+this.type+'": Message does not reference all '+e+" arg(s).")},t.Block.prototype.interpolateArguments_=function(t,e,i){for(var n=[],o=0;o=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 i=this.inputList[t];this.inputList.splice(t,1),tt?this.menuItems_.length:t,-1)},t.Menu.prototype.highlightFirst_=function(){this.highlightHelper_(-1,1)},t.Menu.prototype.highlightLast_=function(){this.highlightHelper_(this.menuItems_.length,-1)},t.Menu.prototype.highlightHelper_=function(t,e){t+=e;for(var i;i=this.menuItems_[t];){if(i.isEnabled()){this.setHighlighted(i);break}t+=e}},t.Menu.prototype.handleMouseOver_=function(t){(t=this.getMenuItem_(t.target))&&(t.isEnabled()?this.highlightedItem_!=t&&this.setHighlighted(t):this.setHighlighted(null))},t.Menu.prototype.handleClick_=function(e){var i=this.openingCoords;if(this.openingCoords=null,i&&"number"==typeof e.clientX){var n=new t.utils.Coordinate(e.clientX,e.clientY);if(1>t.utils.Coordinate.distance(i,n))return}(e=this.getMenuItem_(e.target))&&e.performAction()},t.Menu.prototype.handleMouseEnter_=function(t){this.focus()},t.Menu.prototype.handleMouseLeave_=function(t){this.getElement()&&(this.blur_(),this.setHighlighted(null))},t.Menu.prototype.handleKeyEvent_=function(e){if(this.menuItems_.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var i=this.highlightedItem_;switch(e.keyCode){case t.utils.KeyCodes.ENTER:case t.utils.KeyCodes.SPACE:i&&i.performAction();break;case t.utils.KeyCodes.UP:this.highlightPrevious();break;case t.utils.KeyCodes.DOWN:this.highlightNext();break;case t.utils.KeyCodes.PAGE_UP:case t.utils.KeyCodes.HOME:this.highlightFirst_();break;case t.utils.KeyCodes.PAGE_DOWN:case t.utils.KeyCodes.END:this.highlightLast_();break;default:return}e.preventDefault(),e.stopPropagation()}},t.Menu.prototype.getSize=function(){var e=this.getElement(),i=t.utils.style.getSize(e);return i.height=e.scrollHeight,i},t.MenuItem=function(t,e){this.content_=t,this.value_=e,this.enabled_=!0,this.element_=null,this.rightToLeft_=!1,this.roleName_=null,this.highlight_=this.checked_=this.checkable_=!1,this.actionHandler_=null},t.MenuItem.prototype.createDom=function(){var e=document.createElement("div");e.id=t.utils.IdGenerator.getNextUniqueId(),this.element_=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled_?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked_?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight_?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft_?"blocklyMenuItemRtl goog-menuitem-rtl ":"");var i=document.createElement("div");if(i.className="blocklyMenuItemContent goog-menuitem-content",this.checkable_){var n=document.createElement("div");n.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",i.appendChild(n)}return n=this.content_,"string"==typeof this.content_&&(n=document.createTextNode(this.content_)),i.appendChild(n),e.appendChild(i),this.roleName_&&t.utils.aria.setRole(e,this.roleName_),t.utils.aria.setState(e,t.utils.aria.State.SELECTED,this.checkable_&&this.checked_||!1),t.utils.aria.setState(e,t.utils.aria.State.DISABLED,!this.enabled_),e},t.MenuItem.prototype.dispose=function(){this.element_=null},t.MenuItem.prototype.getElement=function(){return this.element_},t.MenuItem.prototype.getId=function(){return this.element_.id},t.MenuItem.prototype.getValue=function(){return this.value_},t.MenuItem.prototype.setRightToLeft=function(t){this.rightToLeft_=t},t.MenuItem.prototype.setRole=function(t){this.roleName_=t},t.MenuItem.prototype.setCheckable=function(t){this.checkable_=t},t.MenuItem.prototype.setChecked=function(t){this.checked_=t},t.MenuItem.prototype.setHighlighted=function(e){this.highlight_=e;var i=this.getElement();i&&this.isEnabled()&&(e?(t.utils.dom.addClass(i,"blocklyMenuItemHighlight"),t.utils.dom.addClass(i,"goog-menuitem-highlight")):(t.utils.dom.removeClass(i,"blocklyMenuItemHighlight"),t.utils.dom.removeClass(i,"goog-menuitem-highlight")))},t.MenuItem.prototype.isEnabled=function(){return this.enabled_},t.MenuItem.prototype.setEnabled=function(t){this.enabled_=t},t.MenuItem.prototype.performAction=function(){this.isEnabled()&&this.actionHandler_&&this.actionHandler_(this)},t.MenuItem.prototype.onAction=function(t,e){this.actionHandler_=t.bind(e)},t.ContextMenu={},t.ContextMenu.currentBlock=null,t.ContextMenu.menu_=null,t.ContextMenu.show=function(e,i,n){if(t.WidgetDiv.show(t.ContextMenu,n,t.ContextMenu.dispose),i.length){var o=t.ContextMenu.populate_(i,n);t.ContextMenu.menu_=o,t.ContextMenu.position_(o,e,n),setTimeout(function(){o.focus()},1),t.ContextMenu.currentBlock=null}else t.ContextMenu.hide()},t.ContextMenu.populate_=function(e,i){var n=new t.Menu;n.setRole(t.utils.aria.Role.MENU);for(var o,r=0;o=e[r];r++){var s=new t.MenuItem(o.text);s.setRightToLeft(i),s.setRole(t.utils.aria.Role.MENUITEM),n.addChild(s),s.setEnabled(o.enabled),o.enabled&&s.onAction(function(e){t.ContextMenu.hide(),this.callback(this.scope)},o)}return n},t.ContextMenu.position_=function(e,i,n){var o=t.utils.getViewportBBox();i=new t.utils.Rect(i.clientY+o.top,i.clientY+o.top,i.clientX+o.left,i.clientX+o.left),t.ContextMenu.createWidget_(e);var r=e.getSize();n&&(i.left+=r.width,i.right+=r.width,o.left+=r.width,o.right+=r.width),t.WidgetDiv.positionWithAnchor(o,i,r,n),e.focus()},t.ContextMenu.createWidget_=function(e){e.render(t.WidgetDiv.DIV);var i=e.getElement();t.utils.dom.addClass(i,"blocklyContextMenu"),t.browserEvents.conditionalBind(i,"contextmenu",null,t.utils.noEvent),e.focus()},t.ContextMenu.hide=function(){t.WidgetDiv.hideIfOwner(t.ContextMenu),t.ContextMenu.currentBlock=null},t.ContextMenu.dispose=function(){t.ContextMenu.menu_&&(t.ContextMenu.menu_.dispose(),t.ContextMenu.menu_=null)},t.ContextMenu.callbackFactory=function(e,i){return function(){t.Events.disable();try{var n=t.Xml.domToBlock(i,e.workspace),o=e.getRelativeToSurfaceXY();o.x=e.RTL?o.x-t.SNAP_RADIUS:o.x+t.SNAP_RADIUS,o.y+=2*t.SNAP_RADIUS,n.moveBy(o.x,o.y)}finally{t.Events.enable()}t.Events.isEnabled()&&!n.isShadow()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CREATE))(n)),n.select()}},t.ContextMenu.commentDeleteOption=function(e){return{text:t.Msg.REMOVE_COMMENT,enabled:!0,callback:function(){t.Events.setGroup(!0),e.dispose(!0,!0),t.Events.setGroup(!1)}}},t.ContextMenu.commentDuplicateOption=function(e){return{text:t.Msg.DUPLICATE_COMMENT,enabled:!0,callback:function(){t.duplicate(e)}}},t.ContextMenu.workspaceCommentOption=function(e,i){if(!t.WorkspaceCommentSvg)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var n={enabled:!t.utils.userAgent.IE};return n.text=t.Msg.ADD_COMMENT,n.callback=function(){var n=new t.WorkspaceCommentSvg(e,t.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT,t.WorkspaceCommentSvg.DEFAULT_SIZE,t.WorkspaceCommentSvg.DEFAULT_SIZE),o=e.getInjectionDiv().getBoundingClientRect();o=new t.utils.Coordinate(i.clientX-o.left,i.clientY-o.top);var r=e.getOriginOffsetInPixels();(o=t.utils.Coordinate.difference(o,r)).scale(1/e.scale),n.moveBy(o.x,o.y),e.rendered&&(n.initSvg(),n.render(),n.select())},n},t.ContextMenuRegistry=function(){t.ContextMenuRegistry.registry=this,this.registry_=Object.create(null)},t.ContextMenuRegistry.ScopeType={BLOCK:"block",WORKSPACE:"workspace"},t.ContextMenuRegistry.registry=null,t.ContextMenuRegistry.prototype.register=function(t){if(this.registry_[t.id])throw Error('Menu item with ID "'+t.id+'" is already registered.');this.registry_[t.id]=t},t.ContextMenuRegistry.prototype.unregister=function(t){if(!this.registry_[t])throw Error('Menu item with ID "'+t+'" not found.');delete this.registry_[t]},t.ContextMenuRegistry.prototype.getItem=function(t){return this.registry_[t]||null},t.ContextMenuRegistry.prototype.getContextMenuOptions=function(t,e){var i=[],n=this.registry_;return Object.keys(n).forEach(function(o){if(o=n[o],t==o.scopeType){var r=o.preconditionFn(e);"hidden"!=r&&(o={text:"function"==typeof o.displayText?o.displayText(e):o.displayText,enabled:"enabled"==r,callback:o.callback,scope:e,weight:o.weight},i.push(o))}}),i.sort(function(t,e){return t.weight-e.weight}),i},new t.ContextMenuRegistry,t.Events.Selected=function(e,i,n){t.Events.Selected.superClass_.constructor.call(this,n),this.oldElementId=e,this.newElementId=i},t.utils.object.inherits(t.Events.Selected,t.Events.UiBase),t.Events.Selected.prototype.type=t.Events.SELECTED,t.Events.Selected.prototype.toJson=function(){var e=t.Events.Selected.superClass_.toJson.call(this);return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e},t.Events.Selected.prototype.fromJson=function(e){t.Events.Selected.superClass_.fromJson.call(this,e),this.oldElementId=e.oldElementId,this.newElementId=e.newElementId},t.registry.register(t.registry.Type.EVENT,t.Events.SELECTED,t.Events.Selected),t.IBoundedElement=function(){},t.ICopyable=function(){},t.RenderedConnection=function(e,i){t.RenderedConnection.superClass_.constructor.call(this,e,i),this.db_=e.workspace.connectionDBList[i],this.dbOpposite_=e.workspace.connectionDBList[t.OPPOSITE_TYPE[i]],this.offsetInBlock_=new t.utils.Coordinate(0,0),this.trackedState_=t.RenderedConnection.TrackedState.WILL_TRACK,this.targetConnection=null},t.utils.object.inherits(t.RenderedConnection,t.Connection),t.RenderedConnection.TrackedState={WILL_TRACK:-1,UNTRACKED:0,TRACKED:1},t.RenderedConnection.prototype.dispose=function(){t.RenderedConnection.superClass_.dispose.call(this),this.trackedState_==t.RenderedConnection.TrackedState.TRACKED&&this.db_.removeConnection(this,this.y)},t.RenderedConnection.prototype.getSourceBlock=function(){return t.RenderedConnection.superClass_.getSourceBlock.call(this)},t.RenderedConnection.prototype.targetBlock=function(){return t.RenderedConnection.superClass_.targetBlock.call(this)},t.RenderedConnection.prototype.distanceFrom=function(t){var e=this.x-t.x;return t=this.y-t.y,Math.sqrt(e*e+t*t)},t.RenderedConnection.prototype.bumpAwayFrom=function(e){if(!this.sourceBlock_.workspace.isDragging()){var i=this.sourceBlock_.getRootBlock();if(!i.isInFlyout){var n=!1;if(!i.isMovable()){if(!(i=e.getSourceBlock().getRootBlock()).isMovable())return;e=this,n=!0}var o=t.selected==i;o||i.addSelect();var r=e.x+t.SNAP_RADIUS+Math.floor(Math.random()*t.BUMP_RANDOMNESS)-this.x,s=e.y+t.SNAP_RADIUS+Math.floor(Math.random()*t.BUMP_RANDOMNESS)-this.y;n&&(s=-s),i.RTL&&(r=e.x-t.SNAP_RADIUS-Math.floor(Math.random()*t.BUMP_RANDOMNESS)-this.x),i.moveBy(r,s),o||i.removeSelect()}}},t.RenderedConnection.prototype.moveTo=function(e,i){this.trackedState_==t.RenderedConnection.TrackedState.WILL_TRACK?(this.db_.addConnection(this,i),this.trackedState_=t.RenderedConnection.TrackedState.TRACKED):this.trackedState_==t.RenderedConnection.TrackedState.TRACKED&&(this.db_.removeConnection(this,this.y),this.db_.addConnection(this,i)),this.x=e,this.y=i},t.RenderedConnection.prototype.moveBy=function(t,e){this.moveTo(this.x+t,this.y+e)},t.RenderedConnection.prototype.moveToOffset=function(t){this.moveTo(t.x+this.offsetInBlock_.x,t.y+this.offsetInBlock_.y)},t.RenderedConnection.prototype.setOffsetInBlock=function(t,e){this.offsetInBlock_.x=t,this.offsetInBlock_.y=e},t.RenderedConnection.prototype.getOffsetInBlock=function(){return this.offsetInBlock_},t.RenderedConnection.prototype.tighten=function(){var e=this.targetConnection.x-this.x,i=this.targetConnection.y-this.y;if(0!=e||0!=i){var n=this.targetBlock(),o=n.getSvgRoot();if(!o)throw Error("block is not rendered.");o=t.utils.getRelativeXY(o),n.getSvgRoot().setAttribute("transform","translate("+(o.x-e)+","+(o.y-i)+")"),n.moveConnections(-e,-i)}},t.RenderedConnection.prototype.closest=function(t,e){return this.dbOpposite_.searchForClosest(this,t,e)},t.RenderedConnection.prototype.highlight=function(){var e=this.sourceBlock_.workspace.getRenderer().getConstants(),i=e.shapeFor(this);this.type==t.connectionTypes.INPUT_VALUE||this.type==t.connectionTypes.OUTPUT_VALUE?(e=e.TAB_OFFSET_FROM_TOP,i=t.utils.svgPaths.moveBy(0,-e)+t.utils.svgPaths.lineOnAxis("v",e)+i.pathDown+t.utils.svgPaths.lineOnAxis("v",e)):(e=e.NOTCH_OFFSET_LEFT-e.CORNER_RADIUS,i=t.utils.svgPaths.moveBy(-e,0)+t.utils.svgPaths.lineOnAxis("h",e)+i.pathLeft+t.utils.svgPaths.lineOnAxis("h",e)),e=this.sourceBlock_.getRelativeToSurfaceXY(),t.Connection.highlightedPath_=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyHighlightedConnectionPath",d:i,transform:"translate("+(this.x-e.x)+","+(this.y-e.y)+")"+(this.sourceBlock_.RTL?" scale(-1 1)":"")},this.sourceBlock_.getSvgRoot())},t.RenderedConnection.prototype.unhighlight=function(){t.utils.dom.removeNode(t.Connection.highlightedPath_),delete t.Connection.highlightedPath_},t.RenderedConnection.prototype.setTracking=function(e){e&&this.trackedState_==t.RenderedConnection.TrackedState.TRACKED||!e&&this.trackedState_==t.RenderedConnection.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(e?(this.db_.addConnection(this,this.y),this.trackedState_=t.RenderedConnection.TrackedState.TRACKED):(this.trackedState_==t.RenderedConnection.TrackedState.TRACKED&&this.db_.removeConnection(this,this.y),this.trackedState_=t.RenderedConnection.TrackedState.UNTRACKED))},t.RenderedConnection.prototype.stopTrackingAll=function(){if(this.setTracking(!1),this.targetConnection)for(var t=this.targetBlock().getDescendants(!1),e=0;ei)&&t.RenderedConnection.superClass_.isConnectionAllowed.call(this,e)},t.RenderedConnection.prototype.onFailedConnect=function(e){var i=this.getSourceBlock();if(t.Events.recordUndo){var n=t.Events.getGroup();setTimeout(function(){i.isDisposed()||i.getParent()||(t.Events.setGroup(n),this.bumpAwayFrom(e),t.Events.setGroup(!1))}.bind(this),t.BUMP_DELAY)}},t.RenderedConnection.prototype.disconnectInternal_=function(e,i){t.RenderedConnection.superClass_.disconnectInternal_.call(this,e,i),e.rendered&&e.render(),i.rendered&&(i.updateDisabled(),i.render(),i.getSvgRoot().style.display="block")},t.RenderedConnection.prototype.respawnShadow_=function(){t.RenderedConnection.superClass_.respawnShadow_.call(this);var e=this.targetBlock();e&&(e.initSvg(),e.render(!1),(e=this.getSourceBlock()).rendered&&e.render())},t.RenderedConnection.prototype.neighbours=function(t){return this.dbOpposite_.getNeighbours(this,t)},t.RenderedConnection.prototype.connect_=function(e){t.RenderedConnection.superClass_.connect_.call(this,e);var i=this.getSourceBlock();e=e.getSourceBlock();var n=i.rendered,o=e.rendered;n&&i.updateDisabled(),o&&e.updateDisabled(),n&&o&&(this.type==t.connectionTypes.NEXT_STATEMENT||this.type==t.connectionTypes.PREVIOUS_STATEMENT?e.render():i.render()),(i=i.getInputWithBlock(e))&&(i=i.isVisible(),e.getSvgRoot().style.display=i?"block":"none")},t.RenderedConnection.prototype.onCheckChanged_=function(){!this.isConnected()||this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||((this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug(),this.sourceBlock_.bumpNeighbours())},t.BasicCursor=function(){t.BasicCursor.superClass_.constructor.call(this)},t.utils.object.inherits(t.BasicCursor,t.Cursor),t.BasicCursor.registrationName="basicCursor",t.BasicCursor.prototype.next=function(){var t=this.getCurNode();return t?((t=this.getNextNode_(t,this.validNode_))&&this.setCurNode(t),t):null},t.BasicCursor.prototype.in=function(){return this.next()},t.BasicCursor.prototype.prev=function(){var t=this.getCurNode();return t?((t=this.getPreviousNode_(t,this.validNode_))&&this.setCurNode(t),t):null},t.BasicCursor.prototype.out=function(){return this.prev()},t.BasicCursor.prototype.getNextNode_=function(t,e){if(!t)return null;var i=t.in()||t.next();return e(i)?i:i?this.getNextNode_(i,e):e(t=this.findSiblingOrParent_(t.out()))?t:t?this.getNextNode_(t,e):null},t.BasicCursor.prototype.getPreviousNode_=function(t,e){if(!t)return null;var i=t.prev();return e(i=i?this.getRightMostChild_(i):t.out())?i:i?this.getPreviousNode_(i,e):null},t.BasicCursor.prototype.validNode_=function(e){var i=!1;return(e=e&&e.getType())!=t.ASTNode.types.OUTPUT&&e!=t.ASTNode.types.INPUT&&e!=t.ASTNode.types.FIELD&&e!=t.ASTNode.types.NEXT&&e!=t.ASTNode.types.PREVIOUS&&e!=t.ASTNode.types.WORKSPACE||(i=!0),i},t.BasicCursor.prototype.findSiblingOrParent_=function(t){if(!t)return null;var e=t.next();return e||this.findSiblingOrParent_(t.out())},t.BasicCursor.prototype.getRightMostChild_=function(t){if(!t.in())return t;for(t=t.in();t.next();)t=t.next();return this.getRightMostChild_(t)},t.registry.register(t.registry.Type.CURSOR,t.BasicCursor.registrationName,t.BasicCursor),t.TabNavigateCursor=function(){t.TabNavigateCursor.superClass_.constructor.call(this)},t.utils.object.inherits(t.TabNavigateCursor,t.BasicCursor),t.TabNavigateCursor.prototype.validNode_=function(e){var i=!1,n=e&&e.getType();return e&&(e=e.getLocation(),n==t.ASTNode.types.FIELD&&e&&e.isTabNavigable()&&e.isClickable()&&(i=!0)),i},t.BlockSvg=function(e,i,n){this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},null),this.svgGroup_.translate_="",this.style=e.getRenderer().getConstants().getBlockStyle(null),this.pathObject=e.getRenderer().makePathObject(this.svgGroup_,this.style),this.renderIsInProgress_=this.rendered=!1,this.workspace=e,this.previousConnection=this.nextConnection=this.outputConnection=null,this.useDragSurface_=t.utils.is3dSupported()&&!!e.getBlockDragSurface();var o=this.pathObject.svgPath;o.tooltip=this,t.Tooltip.bindMouseEvents(o),t.BlockSvg.superClass_.constructor.call(this,e,i,n),this.svgGroup_.dataset?this.svgGroup_.dataset.id=this.id:t.utils.userAgent.IE&&this.svgGroup_.setAttribute("data-id",this.id)},t.utils.object.inherits(t.BlockSvg,t.Block),t.BlockSvg.prototype.height=0,t.BlockSvg.prototype.width=0,t.BlockSvg.prototype.warningTextDb_=null,t.BlockSvg.INLINE=-1,t.BlockSvg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_",t.BlockSvg.prototype.initSvg=function(){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");for(var e,i=0;e=this.inputList[i];i++)e.init();for(e=this.getIcons(),i=0;i=this.connections_.length)return-1;e=t.y;for(var n=i;0<=n&&this.connections_[n].y==e;){if(this.connections_[n]==t)return n;n--}for(n=i;nt)){e=n;break}i=n}}return e},t.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)},t.ConnectionDB.prototype.getNeighbours=function(t,e){function i(t){var i=o-n[t].x,s=r-n[t].y;return Math.sqrt(i*i+s*s)<=e&&l.push(n[t]),s(t=this.subscribedWorkspaces_.indexOf(t)))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");this.subscribedWorkspaces_.splice(t,1)},t.ThemeManager.prototype.subscribe=function(t,e,i){this.componentDB_[e]||(this.componentDB_[e]=[]),this.componentDB_[e].push({element:t,propertyName:i}),e=this.theme_&&this.theme_.getComponentStyle(e),t.style[i]=e||""},t.ThemeManager.prototype.unsubscribe=function(t){if(t)for(var e,i=Object.keys(this.componentDB_),n=0;e=i[n];n++){for(var o=this.componentDB_[e],r=o.length-1;0<=r;r--)o[r].element===t&&o.splice(r,1);this.componentDB_[e].length||delete this.componentDB_[e]}},t.ThemeManager.prototype.dispose=function(){this.componentDB_=this.subscribedWorkspaces_=this.theme_=this.owner_=null},t.TouchGesture=function(e,i){t.TouchGesture.superClass_.constructor.call(this,e,i),this.isMultiTouch_=!1,this.cachedPoints_=Object.create(null),this.startDistance_=this.previousScale_=0,this.isPinchZoomEnabled_=this.onStartWrapper_=null},t.utils.object.inherits(t.TouchGesture,t.Gesture),t.TouchGesture.ZOOM_IN_MULTIPLIER=5,t.TouchGesture.ZOOM_OUT_MULTIPLIER=6,t.TouchGesture.prototype.doStart=function(e){this.isPinchZoomEnabled_=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,t.TouchGesture.superClass_.doStart.call(this,e),!this.isEnding_&&t.Touch.isTouchEvent(e)&&this.handleTouchStart(e)},t.TouchGesture.prototype.bindMouseEvents=function(e){this.onStartWrapper_=t.browserEvents.conditionalBind(document,"mousedown",null,this.handleStart.bind(this),!0),this.onMoveWrapper_=t.browserEvents.conditionalBind(document,"mousemove",null,this.handleMove.bind(this),!0),this.onUpWrapper_=t.browserEvents.conditionalBind(document,"mouseup",null,this.handleUp.bind(this),!0),e.preventDefault(),e.stopPropagation()},t.TouchGesture.prototype.handleStart=function(e){!this.isDragging()&&t.Touch.isTouchEvent(e)&&(this.handleTouchStart(e),this.isMultiTouch()&&t.longStop_())},t.TouchGesture.prototype.handleMove=function(e){this.isDragging()?t.Touch.shouldHandleEvent(e)&&t.TouchGesture.superClass_.handleMove.call(this,e):this.isMultiTouch()?(t.Touch.isTouchEvent(e)&&this.handleTouchMove(e),t.longStop_()):t.TouchGesture.superClass_.handleMove.call(this,e)},t.TouchGesture.prototype.handleUp=function(e){t.Touch.isTouchEvent(e)&&!this.isDragging()&&this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()?t.Touch.shouldHandleEvent(e)&&t.TouchGesture.superClass_.handleUp.call(this,e):(e.preventDefault(),e.stopPropagation(),this.dispose())},t.TouchGesture.prototype.isMultiTouch=function(){return this.isMultiTouch_},t.TouchGesture.prototype.dispose=function(){t.TouchGesture.superClass_.dispose.call(this),this.onStartWrapper_&&t.browserEvents.unbind(this.onStartWrapper_)},t.TouchGesture.prototype.handleTouchStart=function(e){var i=t.Touch.getTouchIdentifierFromEvent(e);this.cachedPoints_[i]=this.getTouchPoint(e),2==(i=Object.keys(this.cachedPoints_)).length&&(this.startDistance_=t.utils.Coordinate.distance(this.cachedPoints_[i[0]],this.cachedPoints_[i[1]]),this.isMultiTouch_=!0,e.preventDefault())},t.TouchGesture.prototype.handleTouchMove=function(e){var i=t.Touch.getTouchIdentifierFromEvent(e);this.cachedPoints_[i]=this.getTouchPoint(e),i=Object.keys(this.cachedPoints_),this.isPinchZoomEnabled_&&2===i.length?this.handlePinch_(e):t.TouchGesture.superClass_.handleMove.call(this,e)},t.TouchGesture.prototype.handlePinch_=function(e){var i=Object.keys(this.cachedPoints_);if(i=t.utils.Coordinate.distance(this.cachedPoints_[i[0]],this.cachedPoints_[i[1]])/this.startDistance_,0this.previousScale_){var n=i-this.previousScale_;n=0Object.keys(this.cachedPoints_).length&&(this.cachedPoints_=Object.create(null),this.previousScale_=0)},t.TouchGesture.prototype.getTouchPoint=function(e){return this.startWorkspace_?new t.utils.Coordinate(e.pageX?e.pageX:e.changedTouches[0].pageX,e.pageY?e.pageY:e.changedTouches[0].pageY):null},t.WorkspaceAudio=function(t){this.parentWorkspace_=t,this.SOUNDS_=Object.create(null)},t.WorkspaceAudio.prototype.lastSound_=null,t.WorkspaceAudio.prototype.dispose=function(){this.SOUNDS_=this.parentWorkspace_=null},t.WorkspaceAudio.prototype.load=function(e,i){if(e.length){try{var n=new t.utils.global.Audio}catch(t){return}for(var o,r=0;rMath.abs(i-this.oldTop_)&&1>Math.abs(n-this.oldLeft_))){var o=new(t.Events.get(t.Events.VIEWPORT_CHANGE))(i,n,e,this.id,this.oldScale_);this.oldScale_=e,this.oldTop_=i,this.oldLeft_=n,t.Events.fire(o)}}},t.WorkspaceSvg.prototype.translate=function(t,e){if(this.useWorkspaceDragSurface_&&this.isDragSurfaceActive_)this.workspaceDragSurface_.translateSurface(t,e);else{var i="translate("+t+","+e+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",i),this.svgBubbleCanvas_.setAttribute("transform",i)}this.blockDragSurface_&&this.blockDragSurface_.translateAndScaleGroup(t,e,this.scale),this.grid_&&this.grid_.moveTo(t,e),this.maybeFireViewportChangeEvent()},t.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)}},t.WorkspaceSvg.prototype.setupDragSurface=function(){if(this.useWorkspaceDragSurface_&&!this.isDragSurfaceActive_){this.isDragSurfaceActive_=!0;var e=this.svgBlockCanvas_.previousSibling,i=parseInt(this.getParentSvg().getAttribute("width"),10),n=parseInt(this.getParentSvg().getAttribute("height"),10),o=t.utils.getRelativeXY(this.getCanvas());this.workspaceDragSurface_.setContentsAndShow(this.getCanvas(),this.getBubbleCanvas(),e,i,n,this.scale),this.workspaceDragSurface_.translateSurface(o.x,o.y)}},t.WorkspaceSvg.prototype.getBlockDragSurface=function(){return this.blockDragSurface_},t.WorkspaceSvg.prototype.getWidth=function(){var t=this.getMetrics();return t?t.viewWidth/this.scale:0},t.WorkspaceSvg.prototype.setVisible=function(e){if(this.isVisible_=e,this.svgGroup_)if(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox_&&this.toolbox_.setVisible(e),e){for(var i=(e=this.getAllBlocks(!1)).length-1;0<=i;i--)e[i].markDirty();this.render(),this.toolbox_&&this.toolbox_.position()}else t.hideChaff(!0)},t.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=this.remainingCapacity()||(this.currentGesture_&&this.currentGesture_.cancel(),"comment"==t.tagName.toLowerCase()?this.pasteWorkspaceComment_(t):this.pasteBlock_(t))},t.WorkspaceSvg.prototype.pasteBlock_=function(e){t.Events.disable();try{var i=t.Xml.domToBlock(e,this),n=parseInt(e.getAttribute("x"),10),o=parseInt(e.getAttribute("y"),10);if(!isNaN(n)&&!isNaN(o)){this.RTL&&(n=-n);do{e=!1;for(var r,s=this.getAllBlocks(!1),a=0;r=s[a];a++){var l=r.getRelativeToSurfaceXY();if(1>=Math.abs(n-l.x)&&1>=Math.abs(o-l.y)){e=!0;break}}if(!e){var c,u=i.getConnections_(!1);for(a=0;c=u[a];a++)if(c.closest(t.SNAP_RADIUS,new t.utils.Coordinate(n,o)).connection){e=!0;break}}e&&(n=this.RTL?n-t.SNAP_RADIUS:n+t.SNAP_RADIUS,o+=2*t.SNAP_RADIUS)}while(e);i.moveBy(n,o)}}finally{t.Events.enable()}t.Events.isEnabled()&&!i.isShadow()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CREATE))(i)),i.select()},t.WorkspaceSvg.prototype.pasteWorkspaceComment_=function(e){t.Events.disable();try{var i=t.WorkspaceCommentSvg.fromXml(e,this),n=parseInt(e.getAttribute("x"),10),o=parseInt(e.getAttribute("y"),10);isNaN(n)||isNaN(o)||(this.RTL&&(n=-n),i.moveBy(n+50,o+50))}finally{t.Events.enable()}t.Events.isEnabled()&&t.WorkspaceComment.fireCreateEvent(i),i.select()},t.WorkspaceSvg.prototype.refreshToolboxSelection=function(){var t=this.isFlyout?this.targetWorkspace:this;t&&!t.currentGesture_&&t.toolbox_&&t.toolbox_.getFlyout()&&t.toolbox_.refreshSelection()},t.WorkspaceSvg.prototype.renameVariableById=function(e,i){t.WorkspaceSvg.superClass_.renameVariableById.call(this,e,i),this.refreshToolboxSelection()},t.WorkspaceSvg.prototype.deleteVariableById=function(e){t.WorkspaceSvg.superClass_.deleteVariableById.call(this,e),this.refreshToolboxSelection()},t.WorkspaceSvg.prototype.createVariable=function(e,i,n){return e=t.WorkspaceSvg.superClass_.createVariable.call(this,e,i,n),this.refreshToolboxSelection(),e},t.WorkspaceSvg.prototype.recordDeleteAreas=function(){t.utils.deprecation.warn("WorkspaceSvg.prototype.recordDeleteAreas","June 2021","June 2022","WorkspaceSvg.prototype.recordDragTargets"),this.recordDragTargets()},t.WorkspaceSvg.prototype.recordDragTargets=function(){var e=this.componentManager_.getComponents(t.ComponentManager.Capability.DRAG_TARGET,!0);this.dragTargetAreas_=[];for(var i,n=0;i=e[n];n++){var o=i.getClientRect();o&&this.dragTargetAreas_.push({component:i,clientRect:o})}},t.WorkspaceSvg.prototype.getDragTarget=function(t){for(var e,i=0;e=this.dragTargetAreas_[i];i++)if(e.clientRect.contains(t.clientX,t.clientY))return e.component;return null},t.WorkspaceSvg.prototype.onMouseDown_=function(t){var e=this.getGesture(t);e&&e.handleWsStart(t,this)},t.WorkspaceSvg.prototype.startDrag=function(e,i){(e=t.utils.mouseToSvg(e,this.getParentSvg(),this.getInverseScreenCTM())).x/=this.scale,e.y/=this.scale,this.dragDeltaXY_=t.utils.Coordinate.difference(i,e)},t.WorkspaceSvg.prototype.moveDrag=function(e){return(e=t.utils.mouseToSvg(e,this.getParentSvg(),this.getInverseScreenCTM())).x/=this.scale,e.y/=this.scale,t.utils.Coordinate.sum(this.dragDeltaXY_,e)},t.WorkspaceSvg.prototype.isDragging=function(){return null!=this.currentGesture_&&this.currentGesture_.isDragging()},t.WorkspaceSvg.prototype.isDraggable=function(){return this.options.moveOptions&&this.options.moveOptions.drag},t.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},t.WorkspaceSvg.prototype.isMovableHorizontally=function(){var t=!!this.scrollbar;return this.isMovable()&&(!t||t&&this.scrollbar.canScrollHorizontally())},t.WorkspaceSvg.prototype.isMovableVertically=function(){var t=!!this.scrollbar;return this.isMovable()&&(!t||t&&this.scrollbar.canScrollVertically())},t.WorkspaceSvg.prototype.onMouseWheel_=function(e){if(t.Gesture.inProgress())e.preventDefault(),e.stopPropagation();else{var i=this.options.zoomOptions&&this.options.zoomOptions.wheel,n=this.options.moveOptions&&this.options.moveOptions.wheel;if(i||n){var o=t.utils.getScrollDeltaPixels(e);!i||!e.ctrlKey&&n?(i=this.scrollX-o.x,n=this.scrollY-o.y,e.shiftKey&&!o.x&&(i=this.scrollX-o.y,n=this.scrollY),this.scroll(i,n)):(o=-o.y/50,i=t.utils.mouseToSvg(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(i.x,i.y,o)),e.preventDefault()}}},t.WorkspaceSvg.prototype.getBlocksBoundingBox=function(){var e=this.getTopBoundedElements();if(!e.length)return new t.utils.Rect(0,0,0,0);for(var i=e[0].getBoundingRectangle(),n=1;ni.bottom&&(i.bottom=o.bottom),o.lefti.right&&(i.right=o.right))}return i},t.WorkspaceSvg.prototype.cleanUp=function(){this.setResizesEnabled(!1),t.Events.setGroup(!0);for(var e,i=this.getTopBlocks(!0),n=0,o=0;e=i[o];o++)if(e.isMovable()){var r=e.getRelativeToSurfaceXY();e.moveBy(-r.x,n-r.y),e.snapToGrid(),n=e.getRelativeToSurfaceXY().y+e.getHeightWidth().height+this.renderer_.getConstants().MIN_BLOCK_HEIGHT}t.Events.setGroup(!1),this.setResizesEnabled(!0)},t.WorkspaceSvg.prototype.showContextMenu=function(e){if(!this.options.readOnly&&!this.isFlyout){var i=t.ContextMenuRegistry.registry.getContextMenuOptions(t.ContextMenuRegistry.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(i,e),t.ContextMenu.show(e,i,this.RTL)}},t.WorkspaceSvg.prototype.updateToolbox=function(e){if(e=t.utils.toolbox.convertToolboxDefToJson(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(t.utils.toolbox.hasCategories(e)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox_.render(e)}else{if(!this.flyout_)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout_.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")},t.WorkspaceSvg.prototype.markFocused=function(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(t.mainWorkspace=this,this.setBrowserFocus())},t.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})}}},t.WorkspaceSvg.prototype.zoom=function(t,e,i){i=Math.pow(this.options.zoomOptions.scaleSpeed,i);var n=this.scale*i;if(this.scale!=n){n>this.options.zoomOptions.maxScale?i=this.options.zoomOptions.maxScale/this.scale:nthis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&ei.oldScale&&t.bumpTopObjectsIntoBounds_(e)}},t.bumpObjectIntoBounds_=function(e,i,n){var o=n.getBoundingRectangle(),r=o.right-o.left,s=t.utils.math.clamp(i.top,o.top,i.top+i.height-(o.bottom-o.top))-o.top,a=i.left;return i=i.left+i.width-r,e.RTL?a=Math.min(i,a):i=Math.max(a,i),!(!(e=t.utils.math.clamp(a,o.left,i)-o.left)&&!s)&&(n.moveBy(e,s),!0)},t.init_=function(e){var i=e.options,n=e.getParentSvg();if(t.browserEvents.conditionalBind(n.parentNode,"contextmenu",null,function(e){t.utils.isTargetInput(e)||e.preventDefault()}),n=t.browserEvents.conditionalBind(window,"resize",null,function(){t.hideChaff(!0),t.svgResize(e),t.bumpTopObjectsIntoBounds_(e)}),e.setResizeHandlerWrapper(n),t.inject.bindDocumentEvents_(),i.languageTree){n=e.getToolbox();var o=e.getFlyout(!0);n?n.init():o&&(o.init(e),o.show(i.languageTree),"function"==typeof o.scrollToStart&&o.scrollToStart())}i.hasTrashcan&&e.trashcan.init(),i.zoomOptions&&i.zoomOptions.controls&&e.zoomControls_.init(),i.moveOptions&&i.moveOptions.scrollbars?(e.scrollbar=new t.ScrollbarPair(e,!0===i.moveOptions.scrollbars||!!i.moveOptions.scrollbars.horizontal,!0===i.moveOptions.scrollbars||!!i.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),e.scrollbar.resize()):e.setMetrics({x:.5,y:.5}),i.hasSounds&&t.inject.loadSounds_(i.pathToMedia,e)},t.inject.bindDocumentEvents_=function(){t.documentEventsBound_||(t.browserEvents.conditionalBind(document,"scroll",null,function(){for(var e,i=t.Workspace.getAll(),n=0;e=i[n];n++)e.updateInverseScreenCTM&&e.updateInverseScreenCTM()}),t.browserEvents.conditionalBind(document,"keydown",null,t.onKeyDown),t.browserEvents.bind(document,"touchend",null,t.longStop_),t.browserEvents.bind(document,"touchcancel",null,t.longStop_),t.utils.userAgent.IPAD&&t.browserEvents.conditionalBind(window,"orientationchange",document,function(){t.svgResize(t.getMainWorkspace())})),t.documentEventsBound_=!0},t.inject.loadSounds_=function(e,i){var n=i.getAudioManager();n.load([e+"click.mp3",e+"click.wav",e+"click.ogg"],"click"),n.load([e+"disconnect.wav",e+"disconnect.mp3",e+"disconnect.ogg"],"disconnect"),n.load([e+"delete.mp3",e+"delete.ogg",e+"delete.wav"],"delete");var o=[];e=function(){for(;o.length;)t.browserEvents.unbind(o.pop());n.preload()},o.push(t.browserEvents.conditionalBind(document,"mousemove",null,e,!0)),o.push(t.browserEvents.conditionalBind(document,"touchstart",null,e,!0))},t.Names=function(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(t=t.split(","),e=0;en.indexOf(i))throw Error(i+" is not a valid modifier key.")},t.ShortcutRegistry.prototype.createSerializedKey=function(e,i){var n="";if(i)for(var o in this.checkModifiers_(i),t.ShortcutRegistry.modifierKeys)-11'),o.appendChild(n),i.push(o)),t.Blocks.variables_get){e.sort(t.VariableModel.compareByName),n=0;for(var r;r=e[n];n++)(o=t.utils.xml.createElement("block")).setAttribute("type","variables_get"),o.setAttribute("gap",8),o.appendChild(t.Variables.generateVariableFieldDom(r)),i.push(o)}}return i},t.Variables.VAR_LETTER_OPTIONS="ijkmnopqrstuvwxyzabcdefgh",t.Variables.generateUniqueName=function(e){return t.Variables.generateUniqueNameFromOptions(t.Variables.VAR_LETTER_OPTIONS.charAt(0),e.getAllVariableNames())},t.Variables.generateUniqueNameFromOptions=function(e,i){if(!i.length)return e;for(var n=t.Variables.VAR_LETTER_OPTIONS,o="",r=n.indexOf(e);;){for(var s=!1,a=0;a90-e||t>-90-e&&t<-90+e},t.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;var e=this.svgGroup_.getBoundingClientRect(),i=e.top;return this.toolboxPosition_==t.utils.toolbox.Position.TOP?new t.utils.Rect(-1e9,i+e.height,-1e9,1e9):new t.utils.Rect(i,1e9,-1e9,1e9)},t.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.getFlyoutScale();for(var e,i=0,n=this.workspace_.getTopBlocks(!1),o=0;e=n[o];o++)i=Math.max(i,e.getHeightWidth().height);if(i+=1.5*this.MARGIN,i*=this.workspace_.scale,i+=t.Scrollbar.scrollbarThickness,this.height_!=i){for(o=0;e=n[o];o++)e.flyoutRect_&&this.moveRectToBlock_(e.flyoutRect_,e);this.targetWorkspace.toolboxPosition!=this.toolboxPosition_||this.toolboxPosition_!=t.utils.toolbox.Position.TOP||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+i),this.height_=i,this.position(),this.targetWorkspace.recordDragTargets()}},t.registry.register(t.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,t.registry.DEFAULT,t.HorizontalFlyout),t.VerticalFlyout=function(e){t.VerticalFlyout.superClass_.constructor.call(this,e)},t.utils.object.inherits(t.VerticalFlyout,t.Flyout),t.VerticalFlyout.registryName="verticalFlyout",t.VerticalFlyout.prototype.setMetrics_=function(t){if(this.isVisible()){var e=this.workspace_.getMetricsManager(),i=e.getScrollMetrics(),n=e.getViewMetrics();e=e.getAbsoluteMetrics(),"number"==typeof t.y&&(this.workspace_.scrollY=-(i.top+(i.height-n.height)*t.y)),this.workspace_.translate(this.workspace_.scrollX+e.left,this.workspace_.scrollY+e.top)}},t.VerticalFlyout.prototype.getX=function(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager(),i=e.getAbsoluteMetrics(),n=e.getViewMetrics();return e=e.getToolboxMetrics(),this.targetWorkspace.toolboxPosition==this.toolboxPosition_?this.targetWorkspace.getToolbox()?this.toolboxPosition_==t.utils.toolbox.Position.LEFT?e.width:n.width-this.width_:this.toolboxPosition_==t.utils.toolbox.Position.LEFT?0:n.width:this.toolboxPosition_==t.utils.toolbox.Position.LEFT?0:n.width+i.left-this.width_},t.VerticalFlyout.prototype.getY=function(){return 0},t.VerticalFlyout.prototype.position=function(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var t=this.targetWorkspace.getMetricsManager().getViewMetrics();this.height_=t.height,this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,t.height-2*this.CORNER_RADIUS),t=this.getX();var e=this.getY();this.positionAt_(this.width_,this.height_,t,e)}},t.VerticalFlyout.prototype.setBackgroundPath_=function(e,i){var n=this.toolboxPosition_==t.utils.toolbox.Position.RIGHT,o=e+this.CORNER_RADIUS;(o=["M "+(n?o:0)+",0"]).push("h",n?-e:e),o.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,n?0:1,n?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS),o.push("v",Math.max(0,i)),o.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,n?0:1,n?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS),o.push("h",n?e:-e),o.push("z"),this.svgBackground_.setAttribute("d",o.join(" "))},t.VerticalFlyout.prototype.scrollToStart=function(){this.workspace_.scrollbar.setY(0)},t.VerticalFlyout.prototype.wheel_=function(e){var i=t.utils.getScrollDeltaPixels(e);if(i.y){var n=this.workspace_.getMetricsManager(),o=n.getScrollMetrics();i=n.getViewMetrics().top-o.top+i.y,this.workspace_.scrollbar.setY(i),t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation()}e.preventDefault(),e.stopPropagation()},t.VerticalFlyout.prototype.layout_=function(t,e){this.workspace_.scale=this.targetWorkspace.scale;for(var i,n=this.MARGIN,o=this.RTL?n:n+this.tabWidth_,r=0;i=t[r];r++)if("block"==i.type){for(var s,a=(i=i.block).getDescendants(!1),l=0;s=a[l];l++)s.isInFlyout=!0;i.render(),a=i.getSvgRoot(),l=i.getHeightWidth(),s=i.outputConnection?o-this.tabWidth_:o,i.moveBy(s,n),s=this.createRect_(i,this.RTL?s-l.width:s,n,l,r),this.addBlockListeners_(a,i,s),n+=l.height+e[r]}else"button"==i.type&&(this.initFlyoutButton_(i.button,o,n),n+=i.button.height+e[r])},t.VerticalFlyout.prototype.isDragTowardWorkspace=function(t){t=Math.atan2(t.y,t.x)/Math.PI*180;var e=this.dragAngleRange_;return t-e||t<-180+e||t>180-e},t.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;var e=this.svgGroup_.getBoundingClientRect(),i=e.left;return this.toolboxPosition_==t.utils.toolbox.Position.LEFT?new t.utils.Rect(-1e9,1e9,-1e9,i+e.width):new t.utils.Rect(-1e9,1e9,i,1e9)},t.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.getFlyoutScale();for(var e,i=0,n=this.workspace_.getTopBlocks(!1),o=0;e=n[o];o++){var r=e.getHeightWidth().width;e.outputConnection&&(r-=this.tabWidth_),i=Math.max(i,r)}for(o=0;e=this.buttons_[o];o++)i=Math.max(i,e.width);if(i+=1.5*this.MARGIN+this.tabWidth_,i*=this.workspace_.scale,i+=t.Scrollbar.scrollbarThickness,this.width_!=i){for(o=0;e=n[o];o++){if(this.RTL){r=e.getRelativeToSurfaceXY().x;var s=i/this.workspace_.scale-this.MARGIN;e.outputConnection||(s-=this.tabWidth_),e.moveBy(s-r,0)}e.flyoutRect_&&this.moveRectToBlock_(e.flyoutRect_,e)}if(this.RTL)for(o=0;e=this.buttons_[o];o++)n=e.getPosition().y,e.moveTo(i/this.workspace_.scale-e.width-this.MARGIN-this.tabWidth_,n);this.targetWorkspace.toolboxPosition!=this.toolboxPosition_||this.toolboxPosition_!=t.utils.toolbox.Position.LEFT||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX+i,this.targetWorkspace.scrollY),this.width_=i,this.position(),this.targetWorkspace.recordDragTargets()}},t.registry.register(t.registry.Type.FLYOUTS_VERTICAL_TOOLBOX,t.registry.DEFAULT,t.VerticalFlyout),t.FlyoutButton=function(e,i,n,o){this.workspace_=e,this.targetWorkspace_=i,this.text_=n.text,this.position_=new t.utils.Coordinate(0,0),this.isLabel_=o,this.callbackKey_=n.callbackKey||n.callbackkey,this.cssClass_=n["web-class"]||null,this.onMouseUpWrapper_=null,this.info=n},t.FlyoutButton.MARGIN_X=5,t.FlyoutButton.MARGIN_Y=2,t.FlyoutButton.prototype.width=0,t.FlyoutButton.prototype.height=0,t.FlyoutButton.prototype.createDom=function(){var e=this.isLabel_?"blocklyFlyoutLabel":"blocklyFlyoutButton";if(this.cssClass_&&(e+=" "+this.cssClass_),this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:e},this.workspace_.getCanvas()),!this.isLabel_)var i=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.svgGroup_);e=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:this.isLabel_?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:4,ry:4},this.svgGroup_);var n=t.utils.dom.createSvgElement(t.utils.Svg.TEXT,{class:this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_),o=t.utils.replaceMessageReferences(this.text_);this.workspace_.RTL&&(o+="‏"),n.textContent=o,this.isLabel_&&(this.svgText_=n,this.workspace_.getThemeManager().subscribe(this.svgText_,"flyoutForegroundColour","fill"));var r=t.utils.style.getComputedStyle(n,"fontSize"),s=t.utils.style.getComputedStyle(n,"fontWeight"),a=t.utils.style.getComputedStyle(n,"fontFamily");return this.width=t.utils.dom.getFastTextWidthWithSizeString(n,r,s,a),o=t.utils.dom.measureFontMetrics(o,r,s,a),this.height=o.height,this.isLabel_||(this.width+=2*t.FlyoutButton.MARGIN_X,this.height+=2*t.FlyoutButton.MARGIN_Y,i.setAttribute("width",this.width),i.setAttribute("height",this.height)),e.setAttribute("width",this.width),e.setAttribute("height",this.height),n.setAttribute("x",this.width/2),n.setAttribute("y",this.height/2-o.height/2+o.baseline),this.updateTransform_(),this.onMouseUpWrapper_=t.browserEvents.conditionalBind(this.svgGroup_,"mouseup",this,this.onMouseUp_),this.svgGroup_},t.FlyoutButton.prototype.show=function(){this.updateTransform_(),this.svgGroup_.setAttribute("display","block")},t.FlyoutButton.prototype.updateTransform_=function(){this.svgGroup_.setAttribute("transform","translate("+this.position_.x+","+this.position_.y+")")},t.FlyoutButton.prototype.moveTo=function(t,e){this.position_.x=t,this.position_.y=e,this.updateTransform_()},t.FlyoutButton.prototype.isLabel=function(){return this.isLabel_},t.FlyoutButton.prototype.getPosition=function(){return this.position_},t.FlyoutButton.prototype.getButtonText=function(){return this.text_},t.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_},t.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&t.browserEvents.unbind(this.onMouseUpWrapper_),this.svgGroup_&&t.utils.dom.removeNode(this.svgGroup_),this.svgText_&&this.workspace_.getThemeManager().unsubscribe(this.svgText_)},t.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_)},t.Css.register(".blocklyFlyoutButton {,fill: #888;,cursor: default;,},.blocklyFlyoutButtonShadow {,fill: #666;,},.blocklyFlyoutButton:hover {,fill: #aaa;,},.blocklyFlyoutLabel {,cursor: default;,},.blocklyFlyoutLabelBackground {,opacity: 0;,}".split(",")),t.Generator=function(t){this.name_=t,this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")},t.Generator.prototype.INFINITE_LOOP_TRAP=null,t.Generator.prototype.STATEMENT_PREFIX=null,t.Generator.prototype.STATEMENT_SUFFIX=null,t.Generator.prototype.INDENT=" ",t.Generator.prototype.COMMENT_WRAP=60,t.Generator.prototype.ORDER_OVERRIDES=[],t.Generator.prototype.isInitialized=null,t.Generator.prototype.workspaceToCode=function(e){e||(console.warn("No workspace specified in workspaceToCode call. Guessing."),e=t.getMainWorkspace());var i=[];this.init(e),e=e.getTopBlocks(!0);for(var n,o=0;n=e[o];o++){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))),i.push(r))}return i=i.join("\n"),(i=(i=(i=this.finish(i)).replace(/^\s+\n/,"")).replace(/\n\s+$/,"\n")).replace(/[ \t]+\n/g,"\n")},t.Generator.prototype.prefixLines=function(t,e){return e+t.replace(/(?!\n$)\n/g,"\n"+e)},t.Generator.prototype.allNestedComments=function(t){var e=[];t=t.getDescendants(!0);for(var i=0;i>>/sprites.png);","height: 16px;","vertical-align: middle;","visibility: hidden;","width: 16px;","}",".blocklyTreeIconClosed {","background-position: -32px -1px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed {',"background-position: 0 -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosed {","background-position: -32px -17px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed {',"background-position: 0 -17px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeLabel {","cursor: default;","font: 16px sans-serif;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {",'cursor: url("<<>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]),t.registry.register(t.registry.Type.TOOLBOX_ITEM,t.ToolboxCategory.registrationName,t.ToolboxCategory),t.ToolboxSeparator=function(e,i){t.ToolboxSeparator.superClass_.constructor.call(this,e,i),this.cssConfig_={container:"blocklyTreeSeparator"},t.utils.object.mixin(this.cssConfig_,e.cssconfig||e.cssConfig)},t.utils.object.inherits(t.ToolboxSeparator,t.ToolboxItem),t.ToolboxSeparator.registrationName="sep",t.ToolboxSeparator.prototype.init=function(){this.createDom_()},t.ToolboxSeparator.prototype.createDom_=function(){var e=document.createElement("div");return t.utils.dom.addClass(e,this.cssConfig_.container),this.htmlDiv_=e},t.ToolboxSeparator.prototype.getDiv=function(){return this.htmlDiv_},t.ToolboxSeparator.prototype.dispose=function(){t.utils.dom.removeNode(this.htmlDiv_)},t.Css.register('.blocklyTreeSeparator {,border-bottom: solid #e5e5e5 1px;,height: 0;,margin: 5px 0;,},.blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator {,border-right: solid #e5e5e5 1px;,border-bottom: none;,height: auto;,margin: 0 5px 0 5px;,padding: 5px 0;,width: 0;,}'.split(",")),t.registry.register(t.registry.Type.TOOLBOX_ITEM,t.ToolboxSeparator.registrationName,t.ToolboxSeparator),t.CollapsibleToolboxCategory=function(e,i,n){this.subcategoriesDiv_=null,this.expanded_=!1,this.toolboxItems_=[],t.CollapsibleToolboxCategory.superClass_.constructor.call(this,e,i,n)},t.utils.object.inherits(t.CollapsibleToolboxCategory,t.ToolboxCategory),t.CollapsibleToolboxCategory.registrationName="collapsibleCategory",t.CollapsibleToolboxCategory.prototype.makeDefaultCssConfig_=function(){var e=t.CollapsibleToolboxCategory.superClass_.makeDefaultCssConfig_.call(this);return e.contents="blocklyToolboxContents",e},t.CollapsibleToolboxCategory.prototype.parseContents_=function(e){var i=e.contents,n=!0;if(e.custom)this.flyoutItems_=e.custom;else if(i){e=0;for(var o;o=i[e];e++)!t.registry.hasItem(t.registry.Type.TOOLBOX_ITEM,o.kind)||o.kind.toLowerCase()==t.ToolboxSeparator.registrationName&&n?(this.flyoutItems_.push(o),n=!0):(this.createToolboxItem_(o),n=!1)}},t.CollapsibleToolboxCategory.prototype.createToolboxItem_=function(e){var i=e.kind;"CATEGORY"==i.toUpperCase()&&t.utils.toolbox.isCategoryCollapsible(e)&&(i=t.CollapsibleToolboxCategory.registrationName),e=new(t.registry.getClass(t.registry.Type.TOOLBOX_ITEM,i))(e,this.parentToolbox_,this),this.toolboxItems_.push(e)},t.CollapsibleToolboxCategory.prototype.init=function(){t.CollapsibleToolboxCategory.superClass_.init.call(this),this.setExpanded("true"==this.toolboxItemDef_.expanded||this.toolboxItemDef_.expanded)},t.CollapsibleToolboxCategory.prototype.createDom_=function(){t.CollapsibleToolboxCategory.superClass_.createDom_.call(this);var e=this.getChildToolboxItems();return this.subcategoriesDiv_=this.createSubCategoriesDom_(e),t.utils.aria.setRole(this.subcategoriesDiv_,t.utils.aria.Role.GROUP),this.htmlDiv_.appendChild(this.subcategoriesDiv_),this.htmlDiv_},t.CollapsibleToolboxCategory.prototype.createIconDom_=function(){var e=document.createElement("span");return this.parentToolbox_.isHorizontal()||(t.utils.dom.addClass(e,this.cssConfig_.icon),e.style.visibility="visible"),e.style.display="inline-block",e},t.CollapsibleToolboxCategory.prototype.createSubCategoriesDom_=function(e){var i=document.createElement("div");t.utils.dom.addClass(i,this.cssConfig_.contents);for(var n=0;n>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","padding: 4px 0 4px 0;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyToolboxContents {","display: flex;","flex-wrap: wrap;","flex-direction: column;","}",".blocklyToolboxContents:focus {","outline: none;","}"]),t.registry.register(t.registry.Type.TOOLBOX,t.registry.DEFAULT,t.Toolbox),t.Events.TrashcanOpen=function(e,i){t.Events.TrashcanOpen.superClass_.constructor.call(this,i),this.isOpen=e},t.utils.object.inherits(t.Events.TrashcanOpen,t.Events.UiBase),t.Events.TrashcanOpen.prototype.type=t.Events.TRASHCAN_OPEN,t.Events.TrashcanOpen.prototype.toJson=function(){var e=t.Events.TrashcanOpen.superClass_.toJson.call(this);return e.isOpen=this.isOpen,e},t.Events.TrashcanOpen.prototype.fromJson=function(e){t.Events.TrashcanOpen.superClass_.fromJson.call(this,e),this.isOpen=e.isOpen},t.registry.register(t.registry.Type.EVENT,t.Events.TRASHCAN_OPEN,t.Events.TrashcanOpen),t.IPositionable=function(){},t.uiPosition={},t.uiPosition.verticalPosition={TOP:0,BOTTOM:1},t.uiPosition.horizontalPosition={LEFT:0,RIGHT:1},t.uiPosition.bumpDirection={UP:0,DOWN:1},t.uiPosition.getStartPositionRect=function(e,i,n,o,r,s){var a=s.scrollbar&&s.scrollbar.canScrollVertically();return e.horizontal===t.uiPosition.horizontalPosition.LEFT?(n=r.absoluteMetrics.left+n,a&&s.RTL&&(n+=t.Scrollbar.scrollbarThickness)):(n=r.absoluteMetrics.left+r.viewMetrics.width-i.width-n,a&&!s.RTL&&(n-=t.Scrollbar.scrollbarThickness)),e.vertical===t.uiPosition.verticalPosition.TOP?e=r.absoluteMetrics.top+o:(e=r.absoluteMetrics.top+r.viewMetrics.height-i.height-o,s.scrollbar&&s.scrollbar.canScrollHorizontally()&&(e-=t.Scrollbar.scrollbarThickness)),new t.utils.Rect(e,e+i.height,n,n+i.width)},t.uiPosition.getCornerOppositeToolbox=function(e,i){return{horizontal:i.toolboxMetrics.position===t.utils.toolbox.Position.LEFT||e.horizontalLayout&&!e.RTL?t.uiPosition.horizontalPosition.RIGHT:t.uiPosition.horizontalPosition.LEFT,vertical:i.toolboxMetrics.position===t.utils.toolbox.Position.BOTTOM?t.uiPosition.verticalPosition.TOP:t.uiPosition.verticalPosition.BOTTOM}},t.uiPosition.bumpPositionRect=function(e,i,n,o){for(var r,s=e.left,a=e.right-e.left,l=e.bottom-e.top,c=0;r=o[c];c++)e.intersects(r)&&(e=n===t.uiPosition.bumpDirection.UP?r.top-l-i:r.bottom+i,e=new t.utils.Rect(e,e+l,s,s+a),c=-1);return e},t.Trashcan=function(e){t.Trashcan.superClass_.constructor.call(this),this.workspace_=e,this.id="trashcan",this.contents_=[],this.flyout=null,0>=this.workspace_.options.maxTrashcanContents||(e=new t.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?(e.toolboxPosition=this.workspace_.toolboxPosition==t.utils.toolbox.Position.TOP?t.utils.toolbox.Position.BOTTOM:t.utils.toolbox.Position.TOP,this.flyout=new(t.registry.getClassFromOptions(t.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace_.options,!0))(e)):(e.toolboxPosition=this.workspace_.toolboxPosition==t.utils.toolbox.Position.RIGHT?t.utils.toolbox.Position.LEFT:t.utils.toolbox.Position.RIGHT,this.flyout=new(t.registry.getClassFromOptions(t.registry.Type.FLYOUTS_VERTICAL_TOOLBOX,this.workspace_.options,!0))(e)),this.workspace_.addChangeListener(this.onDelete_.bind(this)))},t.utils.object.inherits(t.Trashcan,t.DeleteArea),t.Trashcan.prototype.WIDTH_=47,t.Trashcan.prototype.BODY_HEIGHT_=44,t.Trashcan.prototype.LID_HEIGHT_=16,t.Trashcan.prototype.MARGIN_VERTICAL_=20,t.Trashcan.prototype.MARGIN_HORIZONTAL_=20,t.Trashcan.prototype.MARGIN_HOTSPOT_=10,t.Trashcan.prototype.SPRITE_LEFT_=0,t.Trashcan.prototype.SPRITE_TOP_=32,t.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE_=.1,t.Trashcan.ANIMATION_LENGTH_=80,t.Trashcan.ANIMATION_FRAMES_=4,t.Trashcan.OPACITY_MIN_=.4,t.Trashcan.OPACITY_MAX_=.8,t.Trashcan.MAX_LID_ANGLE_=45,t.Trashcan.prototype.isLidOpen=!1,t.Trashcan.prototype.minOpenness_=0,t.Trashcan.prototype.svgGroup_=null,t.Trashcan.prototype.svgLid_=null,t.Trashcan.prototype.lidTask_=0,t.Trashcan.prototype.lidOpen_=0,t.Trashcan.prototype.left_=0,t.Trashcan.prototype.top_=0,t.Trashcan.prototype.initialized_=!1,t.Trashcan.prototype.createDom=function(){this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyTrash"},null);var e=String(Math.random()).substring(2),i=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyTrashBodyClipPath"+e},this.svgGroup_);t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:this.WIDTH_,height:this.BODY_HEIGHT_,y:this.LID_HEIGHT_},i);var n=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,x:-this.SPRITE_LEFT_,height:t.SPRITE.height,y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashBodyClipPath"+e+")"},this.svgGroup_);return n.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),i=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyTrashLidClipPath"+e},this.svgGroup_),t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:this.WIDTH_,height:this.LID_HEIGHT_},i),this.svgLid_=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,x:-this.SPRITE_LEFT_,height:t.SPRITE.height,y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashLidClipPath"+e+")"},this.svgGroup_),this.svgLid_.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),t.browserEvents.bind(this.svgGroup_,"mousedown",this,this.blockMouseDownWhenOpenable_),t.browserEvents.bind(this.svgGroup_,"mouseup",this,this.click),t.browserEvents.bind(n,"mouseover",this,this.mouseOver_),t.browserEvents.bind(n,"mouseout",this,this.mouseOut_),this.animateLid_(),this.svgGroup_},t.Trashcan.prototype.init=function(){0this.minOpenness_&&1>this.lidOpen_&&(this.lidTask_=setTimeout(this.animateLid_.bind(this),t.Trashcan.ANIMATION_LENGTH_/e))},t.Trashcan.prototype.setLidAngle_=function(e){var i=this.workspace_.toolboxPosition==t.utils.toolbox.Position.RIGHT||this.workspace_.horizontalLayout&&this.workspace_.RTL;this.svgLid_.setAttribute("transform","rotate("+(i?-e:e)+","+(i?4:this.WIDTH_-4)+","+(this.LID_HEIGHT_-2)+")")},t.Trashcan.prototype.setMinOpenness_=function(e){this.minOpenness_=e,this.isLidOpen||this.setLidAngle_(e*t.Trashcan.MAX_LID_ANGLE_)},t.Trashcan.prototype.closeLid=function(){this.setLidOpen(!1)},t.Trashcan.prototype.click=function(){this.hasContents_()&&this.openFlyout()},t.Trashcan.prototype.fireUiEvent_=function(e){e=new(t.Events.get(t.Events.TRASHCAN_OPEN))(e,this.workspace_.id),t.Events.fire(e)},t.Trashcan.prototype.blockMouseDownWhenOpenable_=function(t){!this.contentsIsOpen()&&this.hasContents_()&&t.stopPropagation()},t.Trashcan.prototype.mouseOver_=function(){this.hasContents_()&&this.setLidOpen(!0)},t.Trashcan.prototype.mouseOut_=function(){this.setLidOpen(!1)},t.Trashcan.prototype.onDelete_=function(e){if(!(0>=this.workspace_.options.maxTrashcanContents)&&e.type==t.Events.BLOCK_DELETE&&e.oldXml.tagName&&"shadow"!=e.oldXml.tagName.toLowerCase()&&(e=this.cleanBlockXML_(e.oldXml),-1==this.contents_.indexOf(e))){for(this.contents_.unshift(e);this.contents_.length>this.workspace_.options.maxTrashcanContents;)this.contents_.pop();this.setMinOpenness_(this.HAS_BLOCKS_LID_ANGLE_)}},t.Trashcan.prototype.cleanBlockXML_=function(e){for(var i=e=e.cloneNode(!0);i;){i.removeAttribute&&(i.removeAttribute("x"),i.removeAttribute("y"),i.removeAttribute("id"),i.removeAttribute("disabled"),"comment"==i.nodeName&&(i.removeAttribute("h"),i.removeAttribute("w"),i.removeAttribute("pinned")));var n=i.firstChild||i.nextSibling;if(!n)for(n=i.parentNode;n;){if(n.nextSibling){n=n.nextSibling;break}n=n.parentNode}i=n}return t.Xml.domToText(e)},t.VariablesDynamic={},t.VariablesDynamic.onCreateVariableButtonClick_String=function(e){t.Variables.createVariableButtonHandler(e.getTargetWorkspace(),void 0,"String")},t.VariablesDynamic.onCreateVariableButtonClick_Number=function(e){t.Variables.createVariableButtonHandler(e.getTargetWorkspace(),void 0,"Number")},t.VariablesDynamic.onCreateVariableButtonClick_Colour=function(e){t.Variables.createVariableButtonHandler(e.getTargetWorkspace(),void 0,"Colour")},t.VariablesDynamic.flyoutCategory=function(e){var i=[],n=document.createElement("button");return n.setAttribute("text",t.Msg.NEW_STRING_VARIABLE),n.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),i.push(n),(n=document.createElement("button")).setAttribute("text",t.Msg.NEW_NUMBER_VARIABLE),n.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),i.push(n),(n=document.createElement("button")).setAttribute("text",t.Msg.NEW_COLOUR_VARIABLE),n.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),i.push(n),e.registerButtonCallback("CREATE_VARIABLE_STRING",t.VariablesDynamic.onCreateVariableButtonClick_String),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",t.VariablesDynamic.onCreateVariableButtonClick_Number),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",t.VariablesDynamic.onCreateVariableButtonClick_Colour),e=t.VariablesDynamic.flyoutCategoryBlocks(e),i.concat(e)},t.VariablesDynamic.flyoutCategoryBlocks=function(e){var i=[];if(0<(e=e.getAllVariables()).length){if(t.Blocks.variables_set_dynamic){var n=e[e.length-1],o=t.utils.xml.createElement("block");o.setAttribute("type","variables_set_dynamic"),o.setAttribute("gap",24),o.appendChild(t.Variables.generateVariableFieldDom(n)),i.push(o)}if(t.Blocks.variables_get_dynamic){e.sort(t.VariableModel.compareByName),n=0;for(var r;r=e[n];n++)(o=t.utils.xml.createElement("block")).setAttribute("type","variables_get_dynamic"),o.setAttribute("gap",8),o.appendChild(t.Variables.generateVariableFieldDom(r)),i.push(o)}}return i},t.ZoomControls=function(t){this.workspace_=t,this.id="zoomControls",this.zoomResetGroup_=this.zoomOutGroup_=this.zoomInGroup_=this.onZoomOutWrapper_=this.onZoomInWrapper_=this.onZoomResetWrapper_=null},t.ZoomControls.prototype.WIDTH_=32,t.ZoomControls.prototype.HEIGHT_=32,t.ZoomControls.prototype.SMALL_SPACING_=2,t.ZoomControls.prototype.LARGE_SPACING_=11,t.ZoomControls.prototype.MARGIN_VERTICAL_=20,t.ZoomControls.prototype.MARGIN_HORIZONTAL_=20,t.ZoomControls.prototype.svgGroup_=null,t.ZoomControls.prototype.left_=0,t.ZoomControls.prototype.top_=0,t.ZoomControls.prototype.initialized_=!1,t.ZoomControls.prototype.createDom=function(){this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},null);var e=String(Math.random()).substring(2);return this.createZoomOutSvg_(e),this.createZoomInSvg_(e),this.workspace_.isMovable()&&this.createZoomResetSvg_(e),this.svgGroup_},t.ZoomControls.prototype.init=function(){this.workspace_.getComponentManager().addComponent({component:this,weight:2,capabilities:[t.ComponentManager.Capability.POSITIONABLE]}),this.initialized_=!0},t.ZoomControls.prototype.dispose=function(){this.workspace_.getComponentManager().removeComponent("zoomControls"),this.svgGroup_&&t.utils.dom.removeNode(this.svgGroup_),this.onZoomResetWrapper_&&t.browserEvents.unbind(this.onZoomResetWrapper_),this.onZoomInWrapper_&&t.browserEvents.unbind(this.onZoomInWrapper_),this.onZoomOutWrapper_&&t.browserEvents.unbind(this.onZoomOutWrapper_)},t.ZoomControls.prototype.getBoundingRectangle=function(){var e=this.SMALL_SPACING_+2*this.HEIGHT_;return this.zoomResetGroup_&&(e+=this.LARGE_SPACING_+this.HEIGHT_),new t.utils.Rect(this.top_,this.top_+e,this.left_,this.left_+this.WIDTH_)},t.ZoomControls.prototype.position=function(e,i){if(this.initialized_){var n=t.uiPosition.getCornerOppositeToolbox(this.workspace_,e),o=this.SMALL_SPACING_+2*this.HEIGHT_;this.zoomResetGroup_&&(o+=this.LARGE_SPACING_+this.HEIGHT_),e=t.uiPosition.getStartPositionRect(n,new t.utils.Size(this.WIDTH_,o),this.MARGIN_HORIZONTAL_,this.MARGIN_VERTICAL_,e,this.workspace_),n=n.vertical,i=t.uiPosition.bumpPositionRect(e,this.MARGIN_VERTICAL_,n===t.uiPosition.verticalPosition.TOP?t.uiPosition.bumpDirection.DOWN:t.uiPosition.bumpDirection.UP,i),n===t.uiPosition.verticalPosition.TOP?(n=this.SMALL_SPACING_+this.HEIGHT_,this.zoomInGroup_.setAttribute("transform","translate(0, "+n+")"),this.zoomResetGroup_&&this.zoomResetGroup_.setAttribute("transform","translate(0, "+(n+this.LARGE_SPACING_+this.HEIGHT_)+")")):(n=this.zoomResetGroup_?this.LARGE_SPACING_+this.HEIGHT_:0,this.zoomInGroup_.setAttribute("transform","translate(0, "+n+")"),this.zoomOutGroup_.setAttribute("transform","translate(0, "+(n+this.SMALL_SPACING_+this.HEIGHT_)+")")),this.top_=i.top,this.left_=i.left,this.svgGroup_.setAttribute("transform","translate("+this.left_+","+this.top_+")")}},t.ZoomControls.prototype.createZoomOutSvg_=function(e){this.zoomOutGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyZoom"},this.svgGroup_);var i=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyZoomoutClipPath"+e},this.zoomOutGroup_);t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:32,height:32},i),t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,height:t.SPRITE.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+e+")"},this.zoomOutGroup_).setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),this.onZoomOutWrapper_=t.browserEvents.conditionalBind(this.zoomOutGroup_,"mousedown",null,this.zoom_.bind(this,-1))},t.ZoomControls.prototype.createZoomInSvg_=function(e){this.zoomInGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyZoom"},this.svgGroup_);var i=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyZoominClipPath"+e},this.zoomInGroup_);t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:32,height:32},i),t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,height:t.SPRITE.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+e+")"},this.zoomInGroup_).setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),this.onZoomInWrapper_=t.browserEvents.conditionalBind(this.zoomInGroup_,"mousedown",null,this.zoom_.bind(this,1))},t.ZoomControls.prototype.zoom_=function(e,i){this.workspace_.markFocused(),this.workspace_.zoomCenter(e),this.fireZoomEvent_(),t.Touch.clearTouchIdentifier(),i.stopPropagation(),i.preventDefault()},t.ZoomControls.prototype.createZoomResetSvg_=function(e){this.zoomResetGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyZoom"},this.svgGroup_);var i=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyZoomresetClipPath"+e},this.zoomResetGroup_);t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:32,height:32},i),t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,height:t.SPRITE.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+e+")"},this.zoomResetGroup_).setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),this.onZoomResetWrapper_=t.browserEvents.conditionalBind(this.zoomResetGroup_,"mousedown",null,this.resetZoom_.bind(this))},t.ZoomControls.prototype.resetZoom_=function(e){this.workspace_.markFocused();var i=Math.log(this.workspace_.options.zoomOptions.startScale/this.workspace_.scale)/Math.log(this.workspace_.options.zoomOptions.scaleSpeed);this.workspace_.beginCanvasTransition(),this.workspace_.zoomCenter(i),this.workspace_.scrollCenter(),setTimeout(this.workspace_.endCanvasTransition.bind(this.workspace_),500),this.fireZoomEvent_(),t.Touch.clearTouchIdentifier(),e.stopPropagation(),e.preventDefault()},t.ZoomControls.prototype.fireZoomEvent_=function(){var e=new(t.Events.get(t.Events.CLICK))(null,this.workspace_.id,"zoom_controls");t.Events.fire(e)},t.Css.register([".blocklyZoom>image, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]),t.ShortcutItems={},t.ShortcutItems.names={ESCAPE:"escape",DELETE:"delete",COPY:"copy",CUT:"cut",PASTE:"paste",UNDO:"undo",REDO:"redo"},t.ShortcutItems.registerEscape=function(){var e={name:t.ShortcutItems.names.ESCAPE,preconditionFn:function(t){return!t.options.readOnly},callback:function(){return t.hideChaff(),!0}};t.ShortcutRegistry.registry.register(e),t.ShortcutRegistry.registry.addKeyMapping(t.utils.KeyCodes.ESC,e.name)},t.ShortcutItems.registerDelete=function(){var e={name:t.ShortcutItems.names.DELETE,preconditionFn:function(e){return!e.options.readOnly&&t.selected&&t.selected.isDeletable()},callback:function(e,i){return i.preventDefault(),!t.Gesture.inProgress()&&(t.deleteBlock(t.selected),!0)}};t.ShortcutRegistry.registry.register(e),t.ShortcutRegistry.registry.addKeyMapping(t.utils.KeyCodes.DELETE,e.name),t.ShortcutRegistry.registry.addKeyMapping(t.utils.KeyCodes.BACKSPACE,e.name)},t.ShortcutItems.registerCopy=function(){var e={name:t.ShortcutItems.names.COPY,preconditionFn:function(e){return!e.options.readOnly&&!t.Gesture.inProgress()&&t.selected&&t.selected.isDeletable()&&t.selected.isMovable()},callback:function(e,i){return i.preventDefault(),t.hideChaff(),t.copy(t.selected),!0}};t.ShortcutRegistry.registry.register(e);var i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.C,[t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.C,[t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.C,[t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name)},t.ShortcutItems.registerCut=function(){var e={name:t.ShortcutItems.names.CUT,preconditionFn:function(e){return!e.options.readOnly&&!t.Gesture.inProgress()&&t.selected&&t.selected.isDeletable()&&t.selected.isMovable()&&!t.selected.workspace.isFlyout},callback:function(){return t.copy(t.selected),t.deleteBlock(t.selected),!0}};t.ShortcutRegistry.registry.register(e);var i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.X,[t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.X,[t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.X,[t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name)},t.ShortcutItems.registerPaste=function(){var e={name:t.ShortcutItems.names.PASTE,preconditionFn:function(e){return!e.options.readOnly&&!t.Gesture.inProgress()},callback:function(){return t.paste()}};t.ShortcutRegistry.registry.register(e);var i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.V,[t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.V,[t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.V,[t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name)},t.ShortcutItems.registerUndo=function(){var e={name:t.ShortcutItems.names.UNDO,preconditionFn:function(e){return!e.options.readOnly&&!t.Gesture.inProgress()},callback:function(e){return t.hideChaff(),e.undo(!1),!0}};t.ShortcutRegistry.registry.register(e);var i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name)},t.ShortcutItems.registerRedo=function(){var e={name:t.ShortcutItems.names.REDO,preconditionFn:function(e){return!t.Gesture.inProgress()&&!e.options.readOnly},callback:function(e){return t.hideChaff(),e.undo(!0),!0}};t.ShortcutRegistry.registry.register(e);var i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.SHIFT,t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.SHIFT,t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.SHIFT,t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name),i=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Y,[t.utils.KeyCodes.CTRL]),t.ShortcutRegistry.registry.addKeyMapping(i,e.name)},t.ShortcutItems.registerDefaultShortcuts=function(){t.ShortcutItems.registerEscape(),t.ShortcutItems.registerDelete(),t.ShortcutItems.registerCopy(),t.ShortcutItems.registerCut(),t.ShortcutItems.registerPaste(),t.ShortcutItems.registerUndo(),t.ShortcutItems.registerRedo()},t.ShortcutItems.registerDefaultShortcuts(),t.ContextMenuItems={},t.ContextMenuItems.registerUndo=function(){t.ContextMenuRegistry.registry.register({displayText:function(){return t.Msg.UNDO},preconditionFn:function(t){return 0i.length?t.ContextMenuItems.deleteNext_(i,n):t.confirm(t.Msg.DELETE_ALL_BLOCKS.replace("%1",i.length),function(e){e&&t.ContextMenuItems.deleteNext_(i,n)})}},scopeType:t.ContextMenuRegistry.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},t.ContextMenuItems.registerWorkspaceOptions_=function(){t.ContextMenuItems.registerUndo(),t.ContextMenuItems.registerRedo(),t.ContextMenuItems.registerCleanup(),t.ContextMenuItems.registerCollapse(),t.ContextMenuItems.registerExpand(),t.ContextMenuItems.registerDeleteAll()},t.ContextMenuItems.registerDuplicate=function(){t.ContextMenuRegistry.registry.register({displayText:function(){return t.Msg.DUPLICATE_BLOCK},preconditionFn:function(t){return!(t=t.block).isInFlyout&&t.isDeletable()&&t.isMovable()?t.isDuplicatable()?"enabled":"disabled":"hidden"},callback:function(e){e.block&&t.duplicate(e.block)},scopeType:t.ContextMenuRegistry.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},t.ContextMenuItems.registerComment=function(){t.ContextMenuRegistry.registry.register({displayText:function(e){return e.block.getCommentIcon()?t.Msg.REMOVE_COMMENT:t.Msg.ADD_COMMENT},preconditionFn:function(e){return e=e.block,t.utils.userAgent.IE||e.isInFlyout||!e.workspace.options.comments||e.isCollapsed()||!e.isEditable()?"hidden":"enabled"},callback:function(t){(t=t.block).getCommentIcon()?t.setCommentText(null):t.setCommentText("")},scopeType:t.ContextMenuRegistry.ScopeType.BLOCK,id:"blockComment",weight:2})},t.ContextMenuItems.registerInline=function(){t.ContextMenuRegistry.registry.register({displayText:function(e){return e.block.getInputsInline()?t.Msg.EXTERNAL_INPUTS:t.Msg.INLINE_INPUTS},preconditionFn:function(e){if(!(e=e.block).isInFlyout&&e.isMovable()&&!e.isCollapsed())for(var i=1;ie||Math.abs(this.workspaceHeight_-o)>e)&&(this.workspaceWidth_=n,this.workspaceHeight_=o,this.bubble_.setBubbleSize(n+e,o+e),this.svgDialog_.setAttribute("width",this.workspaceWidth_),this.svgDialog_.setAttribute("height",this.workspaceHeight_),this.workspace_.setCachedParentSvgSize(this.workspaceWidth_,this.workspaceHeight_)),this.block_.RTL&&(e="translate("+this.workspaceWidth_+",0)",this.workspace_.getCanvas().setAttribute("transform",e)),this.workspace_.resize()},t.Mutator.prototype.onBubbleMove_=function(){this.workspace_&&this.workspace_.recordDragTargets()},t.Mutator.prototype.setVisible=function(e){if(e!=this.isVisible())if(t.Events.fire(new(t.Events.get(t.Events.BUBBLE_OPEN))(this.block_,e,"mutator")),e){this.bubble_=new t.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 i=this.workspace_.options.languageTree;e=this.workspace_.getFlyout(),i&&(e.init(this.workspace_),e.show(i)),this.rootBlock_=this.block_.decompose(this.workspace_),i=this.rootBlock_.getDescendants(!1);for(var n,o=0;n=i[o];o++)n.render();if(this.rootBlock_.setMovable(!1),this.rootBlock_.setDeletable(!1),e?(i=2*e.CORNER_RADIUS,e=this.rootBlock_.RTL?e.getWidth()+i:i):e=i=16,this.block_.RTL&&(e=-e),this.rootBlock_.moveBy(e,i),this.block_.saveConnections){var r=this,s=this.block_;s.saveConnections(this.rootBlock_),this.sourceListener_=function(){s.saveConnections(r.rootBlock_)},this.block_.workspace.addChangeListener(this.sourceListener_)}this.resizeBubble_(),this.workspace_.addChangeListener(this.workspaceChanged_.bind(this)),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.Mutator.prototype.workspaceChanged_=function(e){if(!(e.isUiEvent||e.type==t.Events.CHANGE&&"disabled"==e.element)){if(!this.workspace_.isDragging()){e=this.workspace_.getTopBlocks(!1);for(var i,n=0;i=e[n];n++){var o=i.getRelativeToSurfaceXY();if(20>o.y&&i.moveBy(0,20-o.y),i.RTL){var r=-20,s=this.workspace_.getFlyout();s&&(r-=s.getWidth()),o.x>r&&i.moveBy(r-o.x,0)}else 20>o.x&&i.moveBy(20-o.x,0)}}if(this.rootBlock_.workspace==this.workspace_){if(t.Events.setGroup(!0),e=(e=(i=this.block_).mutationToDom())&&t.Xml.domToText(e),n=i.rendered,i.rendered=!1,i.compose(this.rootBlock_),i.rendered=n,i.initSvg(),i.rendered&&i.render(),e!=(n=(n=i.mutationToDom())&&t.Xml.domToText(n))){t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(i,"mutation",null,e,n));var a=t.Events.getGroup();setTimeout(function(){t.Events.setGroup(a),i.bumpNeighbours(),t.Events.setGroup(!1)},t.BUMP_DELAY)}this.workspace_.isDragging()||this.resizeBubble_(),t.Events.setGroup(!1)}}},t.Mutator.prototype.dispose=function(){this.block_.mutator=null,t.Icon.prototype.dispose.call(this)},t.Mutator.prototype.updateBlockStyle=function(){var t=this.workspace_;if(t&&t.getAllBlocks(!1)){for(var e,i=t.getAllBlocks(!1),n=0;e=i[n];n++)e.setStyle(e.getStyleName());if(n=t.getFlyout())for(t=n.workspace_.getAllBlocks(!1),n=0;e=t[n];n++)e.setStyle(e.getStyleName())}},t.Mutator.reconnect=function(t,e,i){if(!t||!t.getSourceBlock().workspace)return!1;i=e.getInput(i).connection;var n=t.targetBlock();return!(n&&n!=e||i.targetConnection==t)&&(i.isConnected()&&i.disconnect(),i.connect(t),!0)},t.Mutator.findParentWs=function(t){var e=null;if(t&&t.options){var i=t.options.parentWorkspace;t.isFlyout?i&&i.options&&(e=i.options.parentWorkspace):i&&(e=i)}return e},t.FieldTextInput=function(e,i,n){this.spellcheck_=!0,t.FieldTextInput.superClass_.constructor.call(this,e,i,n),this.onKeyInputWrapper_=this.onKeyDownWrapper_=this.htmlInput_=null,this.fullBlockClickTarget_=!1,this.workspace_=null},t.utils.object.inherits(t.FieldTextInput,t.Field),t.FieldTextInput.prototype.DEFAULT_VALUE="",t.FieldTextInput.fromJson=function(e){var i=t.utils.replaceMessageReferences(e.text);return new t.FieldTextInput(i,void 0,e)},t.FieldTextInput.prototype.SERIALIZABLE=!0,t.FieldTextInput.BORDERRADIUS=4,t.FieldTextInput.prototype.CURSOR="text",t.FieldTextInput.prototype.configure_=function(e){t.FieldTextInput.superClass_.configure_.call(this,e),"boolean"==typeof e.spellcheck&&(this.spellcheck_=e.spellcheck)},t.FieldTextInput.prototype.initView=function(){if(this.getConstants().FULL_BLOCK_FIELDS){for(var t,e=0,i=0,n=0;t=this.sourceBlock_.inputList[n];n++){for(var o=0;t.fieldRow[o];o++)e++;t.connection&&i++}this.fullBlockClickTarget_=1>=e&&this.sourceBlock_.outputConnection&&!i}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_(),this.createTextElement_()},t.FieldTextInput.prototype.doClassValidation_=function(t){return null===t||void 0===t?null:String(t)},t.FieldTextInput.prototype.doValueInvalid_=function(e){this.isBeingEdited_&&(this.isTextValid_=!1,e=this.value_,this.value_=this.htmlInput_.untypedDefaultValue_,this.sourceBlock_&&t.Events.isEnabled()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,e,this.value_)))},t.FieldTextInput.prototype.doValueUpdate_=function(t){this.isTextValid_=!0,this.value_=t,this.isBeingEdited_||(this.isDirty_=!0)},t.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.FieldTextInput.prototype.render_=function(){if(t.FieldTextInput.superClass_.render_.call(this),this.isBeingEdited_){this.resizeEditor_();var e=this.htmlInput_;this.isTextValid_?(t.utils.dom.removeClass(e,"blocklyInvalidInput"),t.utils.aria.setState(e,t.utils.aria.State.INVALID,!1)):(t.utils.dom.addClass(e,"blocklyInvalidInput"),t.utils.aria.setState(e,t.utils.aria.State.INVALID,!0))}},t.FieldTextInput.prototype.setSpellcheck=function(t){t!=this.spellcheck_&&(this.spellcheck_=t,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))},t.FieldTextInput.prototype.showEditor_=function(e,i){this.workspace_=this.sourceBlock_.workspace,!(e=i||!1)&&(t.utils.userAgent.MOBILE||t.utils.userAgent.ANDROID||t.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(e)},t.FieldTextInput.prototype.showPromptEditor_=function(){t.prompt(t.Msg.CHANGE_VALUE_TITLE,this.getText(),function(t){this.setValue(this.getValueFromEditorText_(t))}.bind(this))},t.FieldTextInput.prototype.showInlineEditor_=function(e){t.WidgetDiv.show(this,this.sourceBlock_.RTL,this.widgetDispose_.bind(this)),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())},t.FieldTextInput.prototype.widgetCreate_=function(){var e=t.WidgetDiv.DIV;t.utils.dom.addClass(this.getClickTarget_(),"editing");var i=document.createElement("input");i.className="blocklyHtmlInput",i.setAttribute("spellcheck",this.spellcheck_);var n=this.workspace_.getScale(),o=this.getConstants().FIELD_TEXT_FONTSIZE*n+"pt";if(e.style.fontSize=o,i.style.fontSize=o,o=t.FieldTextInput.BORDERRADIUS*n+"px",this.fullBlockClickTarget_){o=((o=this.getScaledBBox()).bottom-o.top)/2+"px";var r=this.sourceBlock_.getParent()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;i.style.border=1*n+"px solid "+r,e.style.borderRadius=o,e.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(e.style.boxShadow="rgba(255, 255, 255, 0.3) 0px 0px 0px "+4*n+"px")}return i.style.borderRadius=o,e.appendChild(i),i.value=i.defaultValue=this.getEditorText_(this.value_),i.untypedDefaultValue_=this.value_,i.oldValue_=null,this.resizeEditor_(),this.bindInputEvents_(i),i},t.FieldTextInput.prototype.widgetDispose_=function(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_&&this.onFinishEditing_(this.value_),this.unbindInputEvents_();var e=t.WidgetDiv.DIV.style;e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,t.utils.dom.removeClass(this.getClickTarget_(),"editing")},t.FieldTextInput.prototype.bindInputEvents_=function(e){this.onKeyDownWrapper_=t.browserEvents.conditionalBind(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=t.browserEvents.conditionalBind(e,"input",this,this.onHtmlInputChange_)},t.FieldTextInput.prototype.unbindInputEvents_=function(){this.onKeyDownWrapper_&&(t.browserEvents.unbind(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(t.browserEvents.unbind(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)},t.FieldTextInput.prototype.onHtmlInputKeyDown_=function(e){e.keyCode==t.utils.KeyCodes.ENTER?(t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation()):e.keyCode==t.utils.KeyCodes.ESC?(this.setValue(this.htmlInput_.untypedDefaultValue_),t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation()):e.keyCode==t.utils.KeyCodes.TAB&&(t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())},t.FieldTextInput.prototype.onHtmlInputChange_=function(e){(e=this.htmlInput_.value)!==this.htmlInput_.oldValue_&&(this.htmlInput_.oldValue_=e,t.Events.setGroup(!0),e=this.getValueFromEditorText_(e),this.setValue(e),this.forceRerender(),this.resizeEditor_(),t.Events.setGroup(!1))},t.FieldTextInput.prototype.setEditorValue_=function(t){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(t)),this.setValue(t)},t.FieldTextInput.prototype.resizeEditor_=function(){var e=t.WidgetDiv.DIV,i=this.getScaledBBox();e.style.width=i.right-i.left+"px",e.style.height=i.bottom-i.top+"px",i=new t.utils.Coordinate(this.sourceBlock_.RTL?i.right-e.offsetWidth:i.left,i.top),e.style.left=i.x+"px",e.style.top=i.y+"px"},t.FieldTextInput.prototype.isTabNavigable=function(){return!0},t.FieldTextInput.prototype.getText_=function(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null},t.FieldTextInput.prototype.getEditorText_=function(t){return String(t)},t.FieldTextInput.prototype.getValueFromEditorText_=function(t){return t},t.fieldRegistry.register("field_input",t.FieldTextInput),t.FieldAngle=function(e,i,n){this.clockwise_=t.FieldAngle.CLOCKWISE,this.offset_=t.FieldAngle.OFFSET,this.wrap_=t.FieldAngle.WRAP,this.round_=t.FieldAngle.ROUND,t.FieldAngle.superClass_.constructor.call(this,e,i,n),this.moveSurfaceWrapper_=this.clickSurfaceWrapper_=this.clickWrapper_=this.line_=this.gauge_=this.editor_=null},t.utils.object.inherits(t.FieldAngle,t.FieldTextInput),t.FieldAngle.prototype.DEFAULT_VALUE=0,t.FieldAngle.fromJson=function(e){return new t.FieldAngle(e.angle,void 0,e)},t.FieldAngle.prototype.SERIALIZABLE=!0,t.FieldAngle.ROUND=15,t.FieldAngle.HALF=50,t.FieldAngle.CLOCKWISE=!1,t.FieldAngle.OFFSET=0,t.FieldAngle.WRAP=360,t.FieldAngle.RADIUS=t.FieldAngle.HALF-1,t.FieldAngle.prototype.configure_=function(e){switch(t.FieldAngle.superClass_.configure_.call(this,e),e.mode){case"compass":this.clockwise_=!0,this.offset_=90;break;case"protractor":this.clockwise_=!1,this.offset_=0}var i=e.clockwise;"boolean"==typeof i&&(this.clockwise_=i),null!=(i=e.offset)&&(i=Number(i),isNaN(i)||(this.offset_=i)),null!=(i=e.wrap)&&(i=Number(i),isNaN(i)||(this.wrap_=i)),null!=(e=e.round)&&(e=Number(e),isNaN(e)||(this.round_=e))},t.FieldAngle.prototype.initView=function(){t.FieldAngle.superClass_.initView.call(this),this.symbol_=t.utils.dom.createSvgElement(t.utils.Svg.TSPAN,{},null),this.symbol_.appendChild(document.createTextNode("°")),this.textElement_.appendChild(this.symbol_)},t.FieldAngle.prototype.render_=function(){t.FieldAngle.superClass_.render_.call(this),this.updateGraph_()},t.FieldAngle.prototype.showEditor_=function(e){t.FieldAngle.superClass_.showEditor_.call(this,e,t.utils.userAgent.MOBILE||t.utils.userAgent.ANDROID||t.utils.userAgent.IPAD),this.dropdownCreate_(),t.DropDownDiv.getContentDiv().appendChild(this.editor_),t.DropDownDiv.setColour(this.sourceBlock_.style.colourPrimary,this.sourceBlock_.style.colourTertiary),t.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this)),this.updateGraph_()},t.FieldAngle.prototype.dropdownCreate_=function(){var e=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{xmlns:t.utils.dom.SVG_NS,"xmlns:html":t.utils.dom.HTML_NS,"xmlns:xlink":t.utils.dom.XLINK_NS,version:"1.1",height:2*t.FieldAngle.HALF+"px",width:2*t.FieldAngle.HALF+"px",style:"touch-action: none"},null),i=t.utils.dom.createSvgElement(t.utils.Svg.CIRCLE,{cx:t.FieldAngle.HALF,cy:t.FieldAngle.HALF,r:t.FieldAngle.RADIUS,class:"blocklyAngleCircle"},e);this.gauge_=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyAngleGauge"},e),this.line_=t.utils.dom.createSvgElement(t.utils.Svg.LINE,{x1:t.FieldAngle.HALF,y1:t.FieldAngle.HALF,class:"blocklyAngleLine"},e);for(var n=0;360>n;n+=15)t.utils.dom.createSvgElement(t.utils.Svg.LINE,{x1:t.FieldAngle.HALF+t.FieldAngle.RADIUS,y1:t.FieldAngle.HALF,x2:t.FieldAngle.HALF+t.FieldAngle.RADIUS-(0==n%45?10:5),y2:t.FieldAngle.HALF,class:"blocklyAngleMarks",transform:"rotate("+n+","+t.FieldAngle.HALF+","+t.FieldAngle.HALF+")"},e);this.clickWrapper_=t.browserEvents.conditionalBind(e,"click",this,this.hide_),this.clickSurfaceWrapper_=t.browserEvents.conditionalBind(i,"click",this,this.onMouseMove_,!0,!0),this.moveSurfaceWrapper_=t.browserEvents.conditionalBind(i,"mousemove",this,this.onMouseMove_,!0,!0),this.editor_=e},t.FieldAngle.prototype.dropdownDispose_=function(){this.clickWrapper_&&(t.browserEvents.unbind(this.clickWrapper_),this.clickWrapper_=null),this.clickSurfaceWrapper_&&(t.browserEvents.unbind(this.clickSurfaceWrapper_),this.clickSurfaceWrapper_=null),this.moveSurfaceWrapper_&&(t.browserEvents.unbind(this.moveSurfaceWrapper_),this.moveSurfaceWrapper_=null),this.line_=this.gauge_=null},t.FieldAngle.prototype.hide_=function(){t.DropDownDiv.hideIfOwner(this),t.WidgetDiv.hide()},t.FieldAngle.prototype.onMouseMove_=function(e){var i=this.gauge_.ownerSVGElement.getBoundingClientRect(),n=e.clientX-i.left-t.FieldAngle.HALF;e=e.clientY-i.top-t.FieldAngle.HALF,i=Math.atan(-e/n),isNaN(i)||(i=t.utils.math.toDegrees(i),0>n?i+=180:0(t%=360)&&(t+=360),t>this.wrap_&&(t-=360),t},t.Css.register(".blocklyAngleCircle {,stroke: #444;,stroke-width: 1;,fill: #ddd;,fill-opacity: .8;,},.blocklyAngleMarks {,stroke: #444;,stroke-width: 1;,},.blocklyAngleGauge {,fill: #f88;,fill-opacity: .8;,pointer-events: none;,},.blocklyAngleLine {,stroke: #f00;,stroke-width: 2;,stroke-linecap: round;,pointer-events: none;,}".split(",")),t.fieldRegistry.register("field_angle",t.FieldAngle),t.FieldCheckbox=function(e,i,n){this.checkChar_=null,t.FieldCheckbox.superClass_.constructor.call(this,e,i,n)},t.utils.object.inherits(t.FieldCheckbox,t.Field),t.FieldCheckbox.prototype.DEFAULT_VALUE=!1,t.FieldCheckbox.fromJson=function(e){return new t.FieldCheckbox(e.checked,void 0,e)},t.FieldCheckbox.CHECK_CHAR="✓",t.FieldCheckbox.prototype.SERIALIZABLE=!0,t.FieldCheckbox.prototype.CURSOR="default",t.FieldCheckbox.prototype.configure_=function(e){t.FieldCheckbox.superClass_.configure_.call(this,e),e.checkCharacter&&(this.checkChar_=e.checkCharacter)},t.FieldCheckbox.prototype.initView=function(){t.FieldCheckbox.superClass_.initView.call(this),t.utils.dom.addClass(this.textElement_,"blocklyCheckbox"),this.textElement_.style.display=this.value_?"block":"none"},t.FieldCheckbox.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)},t.FieldCheckbox.prototype.getDisplayText_=function(){return this.checkChar_||t.FieldCheckbox.CHECK_CHAR},t.FieldCheckbox.prototype.setCheckCharacter=function(t){this.checkChar_=t,this.forceRerender()},t.FieldCheckbox.prototype.showEditor_=function(){this.setValue(!this.value_)},t.FieldCheckbox.prototype.doClassValidation_=function(t){return!0===t||"TRUE"===t?"TRUE":!1===t||"FALSE"===t?"FALSE":null},t.FieldCheckbox.prototype.doValueUpdate_=function(t){this.value_=this.convertValueToBool_(t),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")},t.FieldCheckbox.prototype.getValue=function(){return this.value_?"TRUE":"FALSE"},t.FieldCheckbox.prototype.getValueBoolean=function(){return this.value_},t.FieldCheckbox.prototype.getText=function(){return String(this.convertValueToBool_(this.value_))},t.FieldCheckbox.prototype.convertValueToBool_=function(t){return"string"==typeof t?"TRUE"==t:!!t},t.fieldRegistry.register("field_checkbox",t.FieldCheckbox),t.FieldColour=function(e,i,n){t.FieldColour.superClass_.constructor.call(this,e,i,n),this.onKeyDownWrapper_=this.onMouseLeaveWrapper_=this.onMouseEnterWrapper_=this.onMouseMoveWrapper_=this.onClickWrapper_=this.highlightedIndex_=this.picker_=null},t.utils.object.inherits(t.FieldColour,t.Field),t.FieldColour.fromJson=function(e){return new t.FieldColour(e.colour,void 0,e)},t.FieldColour.prototype.SERIALIZABLE=!0,t.FieldColour.prototype.CURSOR="default",t.FieldColour.prototype.isDirty_=!1,t.FieldColour.prototype.colours_=null,t.FieldColour.prototype.titles_=null,t.FieldColour.prototype.columns_=0,t.FieldColour.prototype.configure_=function(e){t.FieldColour.superClass_.configure_.call(this,e),e.colourOptions&&(this.colours_=e.colourOptions,this.titles_=e.colourTitles),e.columns&&(this.columns_=e.columns)},t.FieldColour.prototype.initView=function(){this.size_=new t.utils.Size(this.getConstants().FIELD_COLOUR_DEFAULT_WIDTH,this.getConstants().FIELD_COLOUR_DEFAULT_HEIGHT),this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.clickTarget_=this.sourceBlock_.getSvgRoot():(this.createBorderRect_(),this.borderRect_.style.fillOpacity="1")},t.FieldColour.prototype.applyColour=function(){this.getConstants().FIELD_COLOUR_FULL_BLOCK?(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getValue()),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff")):this.borderRect_&&(this.borderRect_.style.fill=this.getValue())},t.FieldColour.prototype.doClassValidation_=function(e){return"string"!=typeof e?null:t.utils.colour.parse(e)},t.FieldColour.prototype.doValueUpdate_=function(t){this.value_=t,this.borderRect_?this.borderRect_.style.fill=t:this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",t),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff"))},t.FieldColour.prototype.getText=function(){var t=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(t)&&(t="#"+t[1]+t[3]+t[5]),t},t.FieldColour.COLOURS="#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033".split(" "),t.FieldColour.prototype.DEFAULT_VALUE=t.FieldColour.COLOURS[0],t.FieldColour.TITLES=[],t.FieldColour.COLUMNS=7,t.FieldColour.prototype.setColours=function(t,e){return this.colours_=t,e&&(this.titles_=e),this},t.FieldColour.prototype.setColumns=function(t){return this.columns_=t,this},t.FieldColour.prototype.showEditor_=function(){this.dropdownCreate_(),t.DropDownDiv.getContentDiv().appendChild(this.picker_),t.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this)),this.picker_.focus({preventScroll:!0})},t.FieldColour.prototype.onClick_=function(e){null!==(e=(e=e.target)&&e.label)&&(this.setValue(e),t.DropDownDiv.hideIfOwner(this))},t.FieldColour.prototype.onKeyDown_=function(e){var i=!1;e.keyCode===t.utils.KeyCodes.UP?(this.moveHighlightBy_(0,-1),i=!0):e.keyCode===t.utils.KeyCodes.DOWN?(this.moveHighlightBy_(0,1),i=!0):e.keyCode===t.utils.KeyCodes.LEFT?(this.moveHighlightBy_(-1,0),i=!0):e.keyCode===t.utils.KeyCodes.RIGHT?(this.moveHighlightBy_(1,0),i=!0):e.keyCode===t.utils.KeyCodes.ENTER&&((i=this.getHighlighted_())&&(null!==(i=i&&i.label)&&this.setValue(i)),t.DropDownDiv.hideWithoutAnimation(),i=!0),i&&e.stopPropagation()},t.FieldColour.prototype.moveHighlightBy_=function(e,i){var n=this.colours_||t.FieldColour.COLOURS,o=this.columns_||t.FieldColour.COLUMNS,r=this.highlightedIndex_%o,s=Math.floor(this.highlightedIndex_/o);r+=e,s+=i,0>e?0>r&&0r&&(r=0):0o-1&&so-1&&r--:0>i?0>s&&(s=0):0Math.floor(n.length/o)-1&&(s=Math.floor(n.length/o)-1),this.setHighlightedCell_(this.picker_.childNodes[s].childNodes[r],s*o+r)},t.FieldColour.prototype.onMouseMove_=function(t){var e=(t=t.target)&&Number(t.getAttribute("data-index"));null!==e&&e!==this.highlightedIndex_&&this.setHighlightedCell_(t,e)},t.FieldColour.prototype.onMouseEnter_=function(){this.picker_.focus({preventScroll:!0})},t.FieldColour.prototype.onMouseLeave_=function(){this.picker_.blur();var e=this.getHighlighted_();e&&t.utils.dom.removeClass(e,"blocklyColourHighlighted")},t.FieldColour.prototype.getHighlighted_=function(){var e=this.columns_||t.FieldColour.COLUMNS,i=this.picker_.childNodes[Math.floor(this.highlightedIndex_/e)];return i?i.childNodes[this.highlightedIndex_%e]:null},t.FieldColour.prototype.setHighlightedCell_=function(e,i){var n=this.getHighlighted_();n&&t.utils.dom.removeClass(n,"blocklyColourHighlighted"),t.utils.dom.addClass(e,"blocklyColourHighlighted"),this.highlightedIndex_=i,t.utils.aria.setState(this.picker_,t.utils.aria.State.ACTIVEDESCENDANT,e.getAttribute("id"))},t.FieldColour.prototype.dropdownCreate_=function(){var e=this.columns_||t.FieldColour.COLUMNS,i=this.colours_||t.FieldColour.COLOURS,n=this.titles_||t.FieldColour.TITLES,o=this.getValue(),r=document.createElement("table");r.className="blocklyColourTable",r.tabIndex=0,r.dir="ltr",t.utils.aria.setRole(r,t.utils.aria.Role.GRID),t.utils.aria.setState(r,t.utils.aria.State.EXPANDED,!0),t.utils.aria.setState(r,t.utils.aria.State.ROWCOUNT,Math.floor(i.length/e)),t.utils.aria.setState(r,t.utils.aria.State.COLCOUNT,e);for(var s,a=0;atr>td {","border: .5px solid #888;","box-sizing: border-box;","cursor: pointer;","display: inline-block;","height: 20px;","padding: 0;","width: 20px;","}",".blocklyColourTable>tr>td.blocklyColourHighlighted {","border-color: #eee;","box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);","position: relative;","}",".blocklyColourSelected, .blocklyColourSelected:hover {","border-color: #eee !important;","outline: 1px solid #333;","position: relative;","}"]),t.fieldRegistry.register("field_colour",t.FieldColour),t.FieldDropdown=function(e,i,n){"function"!=typeof e&&t.FieldDropdown.validateOptions_(e),this.menuGenerator_=e,this.suffixField=this.prefixField=this.generatedOptions_=null,this.trimOptions_(),this.selectedOption_=this.getOptions(!1)[0],t.FieldDropdown.superClass_.constructor.call(this,this.selectedOption_[1],i,n),this.svgArrow_=this.arrow_=this.imageElement_=this.menu_=this.selectedMenuItem_=null},t.utils.object.inherits(t.FieldDropdown,t.Field),t.FieldDropdown.fromJson=function(e){return new t.FieldDropdown(e.options,void 0,e)},t.FieldDropdown.prototype.fromXml=function(t){this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(t.textContent)},t.FieldDropdown.prototype.SERIALIZABLE=!0,t.FieldDropdown.CHECKMARK_OVERHANG=25,t.FieldDropdown.MAX_MENU_HEIGHT_VH=.45,t.FieldDropdown.IMAGE_Y_OFFSET=5,t.FieldDropdown.IMAGE_Y_PADDING=2*t.FieldDropdown.IMAGE_Y_OFFSET,t.FieldDropdown.ARROW_CHAR=t.utils.userAgent.ANDROID?"▼":"▾",t.FieldDropdown.prototype.CURSOR="default",t.FieldDropdown.prototype.initView=function(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot(),this.createTextElement_(),this.imageElement_=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{},this.fieldGroup_),this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_(),this.borderRect_&&t.utils.dom.addClass(this.borderRect_,"blocklyDropdownRect")},t.FieldDropdown.prototype.shouldAddBorderRect_=function(){return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.sourceBlock_.isShadow()},t.FieldDropdown.prototype.createTextArrow_=function(){this.arrow_=t.utils.dom.createSvgElement(t.utils.Svg.TSPAN,{},this.textElement_),this.arrow_.appendChild(document.createTextNode(this.sourceBlock_.RTL?t.FieldDropdown.ARROW_CHAR+" ":" "+t.FieldDropdown.ARROW_CHAR)),this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textContent_):this.textElement_.appendChild(this.arrow_)},t.FieldDropdown.prototype.createSVGArrow_=function(){this.svgArrow_=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_),this.svgArrow_.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)},t.FieldDropdown.prototype.showEditor_=function(e){if(this.dropdownCreate_(),this.menu_.openingCoords=e&&"number"==typeof e.clientX?new t.utils.Coordinate(e.clientX,e.clientY):null,this.menu_.render(t.DropDownDiv.getContentDiv()),e=this.menu_.getElement(),t.utils.dom.addClass(e,"blocklyDropdownMenu"),this.getConstants().FIELD_DROPDOWN_COLOURED_DIV){e=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().getColour():this.sourceBlock_.getColour();var i=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;t.DropDownDiv.setColour(e,i)}t.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this)),this.menu_.focus(),this.selectedMenuItem_&&this.menu_.setHighlighted(this.selectedMenuItem_),this.applyColour()},t.FieldDropdown.prototype.dropdownCreate_=function(){var e=new t.Menu;e.setRole(t.utils.aria.Role.LISTBOX),this.menu_=e;var i=this.getOptions(!1);this.selectedMenuItem_=null;for(var n=0;ne.length)){for(i=[],n=0;n=n||0>=i)throw Error("Height and width values of an image field must be greater than 0.");this.flipRtl_=!1,this.altText_="",t.FieldImage.superClass_.constructor.call(this,e,null,a),a||(this.flipRtl_=!!s,this.altText_=t.utils.replaceMessageReferences(o)||""),this.size_=new t.utils.Size(i,n+t.FieldImage.Y_PADDING),this.imageHeight_=n,this.clickHandler_=null,"function"==typeof r&&(this.clickHandler_=r),this.imageElement_=null},t.utils.object.inherits(t.FieldImage,t.Field),t.FieldImage.prototype.DEFAULT_VALUE="",t.FieldImage.fromJson=function(e){return new t.FieldImage(e.src,e.width,e.height,void 0,void 0,void 0,e)},t.FieldImage.Y_PADDING=1,t.FieldImage.prototype.EDITABLE=!1,t.FieldImage.prototype.isDirty_=!1,t.FieldImage.prototype.configure_=function(e){t.FieldImage.superClass_.configure_.call(this,e),this.flipRtl_=!!e.flipRtl,this.altText_=t.utils.replaceMessageReferences(e.alt)||""},t.FieldImage.prototype.initView=function(){this.imageElement_=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{height:this.imageHeight_+"px",width:this.size_.width+"px",alt:this.altText_},this.fieldGroup_),this.imageElement_.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.value_),this.clickHandler_&&(this.imageElement_.style.cursor="pointer")},t.FieldImage.prototype.updateSize_=function(){},t.FieldImage.prototype.doClassValidation_=function(t){return"string"!=typeof t?null:t},t.FieldImage.prototype.doValueUpdate_=function(e){this.value_=e,this.imageElement_&&this.imageElement_.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",String(this.value_))},t.FieldImage.prototype.getFlipRtl=function(){return this.flipRtl_},t.FieldImage.prototype.setAlt=function(t){t!=this.altText_&&(this.altText_=t||"",this.imageElement_&&this.imageElement_.setAttribute("alt",this.altText_))},t.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.clickHandler_(this)},t.FieldImage.prototype.setOnClickHandler=function(t){this.clickHandler_=t},t.FieldImage.prototype.getText_=function(){return this.altText_},t.fieldRegistry.register("field_image",t.FieldImage),t.FieldMultilineInput=function(e,i,n){t.FieldMultilineInput.superClass_.constructor.call(this,e,i,n),this.textGroup_=null,this.maxLines_=1/0,this.isOverflowedY_=!1},t.utils.object.inherits(t.FieldMultilineInput,t.FieldTextInput),t.FieldMultilineInput.prototype.configure_=function(e){t.FieldMultilineInput.superClass_.configure_.call(this,e),e.maxLines&&this.setMaxLines(e.maxLines)},t.FieldMultilineInput.fromJson=function(e){var i=t.utils.replaceMessageReferences(e.text);return new t.FieldMultilineInput(i,void 0,e)},t.FieldMultilineInput.prototype.toXml=function(t){return t.textContent=this.getValue().replace(/\n/g," "),t},t.FieldMultilineInput.prototype.fromXml=function(t){this.setValue(t.textContent.replace(/ /g,"\n"))},t.FieldMultilineInput.prototype.initView=function(){this.createBorderRect_(),this.textGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyEditableText"},this.fieldGroup_)},t.FieldMultilineInput.prototype.getDisplayText_=function(){var e=this.getText();if(!e)return t.Field.NBSP;var i=e.split("\n");e="";for(var n=this.isOverflowedY_?this.maxLines_:i.length,o=0;othis.maxDisplayLength?r=r.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&o===n-1&&(r=r.substring(0,r.length-3)+"..."),e+=r=r.replace(/\s/g,t.Field.NBSP),o!==n-1&&(e+="\n")}return this.sourceBlock_.RTL&&(e+="‏"),e},t.FieldMultilineInput.prototype.doValueUpdate_=function(e){t.FieldMultilineInput.superClass_.doValueUpdate_.call(this,e),this.isOverflowedY_=this.value_.split("\n").length>this.maxLines_},t.FieldMultilineInput.prototype.render_=function(){for(var e;e=this.textGroup_.firstChild;)this.textGroup_.removeChild(e);e=this.getDisplayText_().split("\n");for(var i=0,n=0;ni&&(i=r),n+=this.getConstants().FIELD_TEXT_HEIGHT+(0this.maxDisplayLength&&(e[o]=e[o].substring(0,this.maxDisplayLength)),r.textContent=e[o];var c=t.utils.dom.getFastTextWidth(r,s,a,l);c>i&&(i=c)}i+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&(n+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,i+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",i),this.borderRect_.setAttribute("height",n)),this.size_.width=i,this.size_.height=n,this.positionBorderRect_()},t.FieldMultilineInput.prototype.showEditor_=function(e,i){t.FieldMultilineInput.superClass_.showEditor_.call(this,e,i),this.forceRerender()},t.FieldMultilineInput.prototype.widgetCreate_=function(){var e=t.WidgetDiv.DIV,i=this.workspace_.getScale(),n=document.createElement("textarea");n.className="blocklyHtmlInput blocklyHtmlTextAreaInput",n.setAttribute("spellcheck",this.spellcheck_);var o=this.getConstants().FIELD_TEXT_FONTSIZE*i+"pt";e.style.fontSize=o,n.style.fontSize=o,n.style.borderRadius=t.FieldTextInput.BORDERRADIUS*i+"px",o=this.getConstants().FIELD_BORDER_RECT_X_PADDING*i;var r=this.getConstants().FIELD_BORDER_RECT_Y_PADDING*i/2;return n.style.padding=r+"px "+o+"px "+r+"px "+o+"px",o=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,n.style.lineHeight=o*i+"px",e.appendChild(n),n.value=n.defaultValue=this.getEditorText_(this.value_),n.untypedDefaultValue_=this.value_,n.oldValue_=null,t.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(n),n},t.FieldMultilineInput.prototype.setMaxLines=function(t){"number"==typeof t&&0this.max_&&t.utils.aria.setState(e,t.utils.aria.State.VALUEMAX,this.max_),e},t.fieldRegistry.register("field_number",t.FieldNumber),t.FieldVariable=function(e,i,n,o,r){this.menuGenerator_=t.FieldVariable.dropdownCreate,this.defaultVariableName="string"==typeof e?e:"",this.size_=new t.utils.Size(0,0),r&&this.configure_(r),i&&this.setValidator(i),r||this.setTypes_(n,o)},t.utils.object.inherits(t.FieldVariable,t.FieldDropdown),t.FieldVariable.fromJson=function(e){var i=t.utils.replaceMessageReferences(e.variable);return new t.FieldVariable(i,void 0,void 0,void 0,e)},t.FieldVariable.prototype.SERIALIZABLE=!0,t.FieldVariable.prototype.configure_=function(e){t.FieldVariable.superClass_.configure_.call(this,e),this.setTypes_(e.variableTypes,e.defaultType)},t.FieldVariable.prototype.initModel=function(){if(!this.variable_){var e=t.Variables.getOrCreateVariablePackage(this.sourceBlock_.workspace,null,this.defaultVariableName,this.defaultType_);this.doValueUpdate_(e.getId())}},t.FieldVariable.prototype.shouldAddBorderRect_=function(){return t.FieldVariable.superClass_.shouldAddBorderRect_.call(this)&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||"variables_get"!=this.sourceBlock_.type)},t.FieldVariable.prototype.fromXml=function(e){var i=e.getAttribute("id"),n=e.textContent,o=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(i=t.Variables.getOrCreateVariablePackage(this.sourceBlock_.workspace,i,n,o),null!=o&&o!==i.type)throw Error("Serialized variable type with id '"+i.getId()+"' had type "+i.type+", and does not match variable field that references it: "+t.Xml.domToText(e)+".");this.setValue(i.getId())},t.FieldVariable.prototype.toXml=function(t){return this.initModel(),t.id=this.variable_.getId(),t.textContent=this.variable_.name,this.variable_.type&&t.setAttribute("variabletype",this.variable_.type),t},t.FieldVariable.prototype.setSourceBlock=function(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");t.FieldVariable.superClass_.setSourceBlock.call(this,e)},t.FieldVariable.prototype.getValue=function(){return this.variable_?this.variable_.getId():null},t.FieldVariable.prototype.getText=function(){return this.variable_?this.variable_.name:""},t.FieldVariable.prototype.getVariable=function(){return this.variable_},t.FieldVariable.prototype.getValidator=function(){return this.variable_?this.validator_:null},t.FieldVariable.prototype.doClassValidation_=function(e){if(null===e)return null;var i=t.Variables.getVariable(this.sourceBlock_.workspace,e);return i?(i=i.type,this.typeIsAllowed_(i)?e:(console.warn("Variable type doesn't match this field! Type was "+i),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)},t.FieldVariable.prototype.doValueUpdate_=function(e){this.variable_=t.Variables.getVariable(this.sourceBlock_.workspace,e),t.FieldVariable.superClass_.doValueUpdate_.call(this,e)},t.FieldVariable.prototype.typeIsAllowed_=function(t){var e=this.getVariableTypes_();if(!e)return!0;for(var i=0;irect,",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;","}"]},t.blockRendering.Types={NONE:0,FIELD:1,HAT:2,ICON:4,SPACER:8,BETWEEN_ROW_SPACER:16,IN_ROW_SPACER:32,EXTERNAL_VALUE_INPUT:64,INPUT:128,INLINE_INPUT:256,STATEMENT_INPUT:512,CONNECTION:1024,PREVIOUS_CONNECTION:2048,NEXT_CONNECTION:4096,OUTPUT_CONNECTION:8192,CORNER:16384,LEFT_SQUARE_CORNER:32768,LEFT_ROUND_CORNER:65536,RIGHT_SQUARE_CORNER:131072,RIGHT_ROUND_CORNER:262144,JAGGED_EDGE:524288,ROW:1048576,TOP_ROW:2097152,BOTTOM_ROW:4194304,INPUT_ROW:8388608},t.blockRendering.Types.LEFT_CORNER=t.blockRendering.Types.LEFT_SQUARE_CORNER|t.blockRendering.Types.LEFT_ROUND_CORNER,t.blockRendering.Types.RIGHT_CORNER=t.blockRendering.Types.RIGHT_SQUARE_CORNER|t.blockRendering.Types.RIGHT_ROUND_CORNER,t.blockRendering.Types.nextTypeValue_=16777216,t.blockRendering.Types.getType=function(e){return Object.prototype.hasOwnProperty.call(t.blockRendering.Types,e)||(t.blockRendering.Types[e]=t.blockRendering.Types.nextTypeValue_,t.blockRendering.Types.nextTypeValue_<<=1),t.blockRendering.Types[e]},t.blockRendering.Types.isField=function(e){return e.type&t.blockRendering.Types.FIELD},t.blockRendering.Types.isHat=function(e){return e.type&t.blockRendering.Types.HAT},t.blockRendering.Types.isIcon=function(e){return e.type&t.blockRendering.Types.ICON},t.blockRendering.Types.isSpacer=function(e){return e.type&t.blockRendering.Types.SPACER},t.blockRendering.Types.isInRowSpacer=function(e){return e.type&t.blockRendering.Types.IN_ROW_SPACER},t.blockRendering.Types.isInput=function(e){return e.type&t.blockRendering.Types.INPUT},t.blockRendering.Types.isExternalInput=function(e){return e.type&t.blockRendering.Types.EXTERNAL_VALUE_INPUT},t.blockRendering.Types.isInlineInput=function(e){return e.type&t.blockRendering.Types.INLINE_INPUT},t.blockRendering.Types.isStatementInput=function(e){return e.type&t.blockRendering.Types.STATEMENT_INPUT},t.blockRendering.Types.isPreviousConnection=function(e){return e.type&t.blockRendering.Types.PREVIOUS_CONNECTION},t.blockRendering.Types.isNextConnection=function(e){return e.type&t.blockRendering.Types.NEXT_CONNECTION},t.blockRendering.Types.isPreviousOrNextConnection=function(e){return e.type&(t.blockRendering.Types.PREVIOUS_CONNECTION|t.blockRendering.Types.NEXT_CONNECTION)},t.blockRendering.Types.isLeftRoundedCorner=function(e){return e.type&t.blockRendering.Types.LEFT_ROUND_CORNER},t.blockRendering.Types.isRightRoundedCorner=function(e){return e.type&t.blockRendering.Types.RIGHT_ROUND_CORNER},t.blockRendering.Types.isLeftSquareCorner=function(e){return e.type&t.blockRendering.Types.LEFT_SQUARE_CORNER},t.blockRendering.Types.isRightSquareCorner=function(e){return e.type&t.blockRendering.Types.RIGHT_SQUARE_CORNER},t.blockRendering.Types.isCorner=function(e){return e.type&t.blockRendering.Types.CORNER},t.blockRendering.Types.isJaggedEdge=function(e){return e.type&t.blockRendering.Types.JAGGED_EDGE},t.blockRendering.Types.isRow=function(e){return e.type&t.blockRendering.Types.ROW},t.blockRendering.Types.isBetweenRowSpacer=function(e){return e.type&t.blockRendering.Types.BETWEEN_ROW_SPACER},t.blockRendering.Types.isTopRow=function(e){return e.type&t.blockRendering.Types.TOP_ROW},t.blockRendering.Types.isBottomRow=function(e){return e.type&t.blockRendering.Types.BOTTOM_ROW},t.blockRendering.Types.isTopOrBottomRow=function(e){return e.type&(t.blockRendering.Types.TOP_ROW|t.blockRendering.Types.BOTTOM_ROW)},t.blockRendering.Types.isInputRow=function(e){return e.type&t.blockRendering.Types.INPUT_ROW},t.blockRendering.Measurable=function(e){this.height=this.width=0,this.type=t.blockRendering.Types.NONE,this.centerline=this.xPos=0,this.constants_=e,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT},t.blockRendering.Connection=function(e,i){t.blockRendering.Connection.superClass_.constructor.call(this,e),this.connectionModel=i,this.shape=this.constants_.shapeFor(i),this.isDynamicShape=!!this.shape.isDynamic,this.type|=t.blockRendering.Types.CONNECTION},t.utils.object.inherits(t.blockRendering.Connection,t.blockRendering.Measurable),t.blockRendering.OutputConnection=function(e,i){t.blockRendering.OutputConnection.superClass_.constructor.call(this,e,i),this.type|=t.blockRendering.Types.OUTPUT_CONNECTION,this.height=this.isDynamicShape?0:this.shape.height,this.startX=this.width=this.isDynamicShape?0:this.shape.width,this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP,this.connectionOffsetX=0},t.utils.object.inherits(t.blockRendering.OutputConnection,t.blockRendering.Connection),t.blockRendering.PreviousConnection=function(e,i){t.blockRendering.PreviousConnection.superClass_.constructor.call(this,e,i),this.type|=t.blockRendering.Types.PREVIOUS_CONNECTION,this.height=this.shape.height,this.width=this.shape.width},t.utils.object.inherits(t.blockRendering.PreviousConnection,t.blockRendering.Connection),t.blockRendering.NextConnection=function(e,i){t.blockRendering.NextConnection.superClass_.constructor.call(this,e,i),this.type|=t.blockRendering.Types.NEXT_CONNECTION,this.height=this.shape.height,this.width=this.shape.width},t.utils.object.inherits(t.blockRendering.NextConnection,t.blockRendering.Connection),t.blockRendering.InputConnection=function(e,i){t.blockRendering.InputConnection.superClass_.constructor.call(this,e,i.connection),this.type|=t.blockRendering.Types.INPUT,this.input=i,this.align=i.align,(this.connectedBlock=i.connection&&i.connection.targetBlock()?i.connection.targetBlock():null)?(e=this.connectedBlock.getHeightWidth(),this.connectedBlockWidth=e.width,this.connectedBlockHeight=e.height):this.connectedBlockHeight=this.connectedBlockWidth=0,this.connectionOffsetY=this.connectionOffsetX=0},t.utils.object.inherits(t.blockRendering.InputConnection,t.blockRendering.Connection),t.blockRendering.InlineInput=function(e,i){t.blockRendering.InlineInput.superClass_.constructor.call(this,e,i),this.type|=t.blockRendering.Types.INLINE_INPUT,this.connectedBlock?(this.width=this.connectedBlockWidth,this.height=this.connectedBlockHeight):(this.height=this.constants_.EMPTY_INLINE_INPUT_HEIGHT,this.width=this.constants_.EMPTY_INLINE_INPUT_PADDING),this.connectionHeight=this.isDynamicShape?this.shape.height(this.height):this.shape.height,this.connectionWidth=this.isDynamicShape?this.shape.width(this.height):this.shape.width,this.connectedBlock||(this.width+=this.connectionWidth*(this.isDynamicShape?2:1)),this.connectionOffsetY=this.isDynamicShape?this.shape.connectionOffsetY(this.connectionHeight):this.constants_.TAB_OFFSET_FROM_TOP,this.connectionOffsetX=this.isDynamicShape?this.shape.connectionOffsetX(this.connectionWidth):0},t.utils.object.inherits(t.blockRendering.InlineInput,t.blockRendering.InputConnection),t.blockRendering.StatementInput=function(e,i){t.blockRendering.StatementInput.superClass_.constructor.call(this,e,i),this.type|=t.blockRendering.Types.STATEMENT_INPUT,this.height=this.connectedBlock?this.connectedBlockHeight+this.constants_.STATEMENT_BOTTOM_SPACER:this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT,this.width=this.constants_.STATEMENT_INPUT_NOTCH_OFFSET+this.shape.width},t.utils.object.inherits(t.blockRendering.StatementInput,t.blockRendering.InputConnection),t.blockRendering.ExternalValueInput=function(e,i){t.blockRendering.ExternalValueInput.superClass_.constructor.call(this,e,i),this.type|=t.blockRendering.Types.EXTERNAL_VALUE_INPUT,this.height=this.connectedBlock?this.connectedBlockHeight-this.constants_.TAB_OFFSET_FROM_TOP-this.constants_.MEDIUM_PADDING:this.shape.height,this.width=this.shape.width+this.constants_.EXTERNAL_VALUE_INPUT_PADDING,this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP,this.connectionHeight=this.shape.height,this.connectionWidth=this.shape.width},t.utils.object.inherits(t.blockRendering.ExternalValueInput,t.blockRendering.InputConnection),t.blockRendering.Icon=function(e,i){t.blockRendering.Icon.superClass_.constructor.call(this,e),this.icon=i,this.isVisible=i.isVisible(),this.type|=t.blockRendering.Types.ICON,e=i.getCorrectedSize(),this.height=e.height,this.width=e.width},t.utils.object.inherits(t.blockRendering.Icon,t.blockRendering.Measurable),t.blockRendering.JaggedEdge=function(e){t.blockRendering.JaggedEdge.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.JAGGED_EDGE,this.height=this.constants_.JAGGED_TEETH.height,this.width=this.constants_.JAGGED_TEETH.width},t.utils.object.inherits(t.blockRendering.JaggedEdge,t.blockRendering.Measurable),t.blockRendering.Field=function(e,i,n){t.blockRendering.Field.superClass_.constructor.call(this,e),this.field=i,this.isEditable=i.EDITABLE,this.flipRtl=i.getFlipRtl(),this.type|=t.blockRendering.Types.FIELD,e=this.field.getSize(),this.height=e.height,this.width=e.width,this.parentInput=n},t.utils.object.inherits(t.blockRendering.Field,t.blockRendering.Measurable),t.blockRendering.Hat=function(e){t.blockRendering.Hat.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.HAT,this.height=this.constants_.START_HAT.height,this.width=this.constants_.START_HAT.width,this.ascenderHeight=this.height},t.utils.object.inherits(t.blockRendering.Hat,t.blockRendering.Measurable),t.blockRendering.SquareCorner=function(e,i){t.blockRendering.SquareCorner.superClass_.constructor.call(this,e),this.type=(i&&"left"!=i?t.blockRendering.Types.RIGHT_SQUARE_CORNER:t.blockRendering.Types.LEFT_SQUARE_CORNER)|t.blockRendering.Types.CORNER,this.width=this.height=this.constants_.NO_PADDING},t.utils.object.inherits(t.blockRendering.SquareCorner,t.blockRendering.Measurable),t.blockRendering.RoundCorner=function(e,i){t.blockRendering.RoundCorner.superClass_.constructor.call(this,e),this.type=(i&&"left"!=i?t.blockRendering.Types.RIGHT_ROUND_CORNER:t.blockRendering.Types.LEFT_ROUND_CORNER)|t.blockRendering.Types.CORNER,this.width=this.constants_.CORNER_RADIUS,this.height=this.constants_.CORNER_RADIUS/2},t.utils.object.inherits(t.blockRendering.RoundCorner,t.blockRendering.Measurable),t.blockRendering.InRowSpacer=function(e,i){t.blockRendering.InRowSpacer.superClass_.constructor.call(this,e),this.type=this.type|t.blockRendering.Types.SPACER|t.blockRendering.Types.IN_ROW_SPACER,this.width=i,this.height=this.constants_.SPACER_DEFAULT_HEIGHT},t.utils.object.inherits(t.blockRendering.InRowSpacer,t.blockRendering.Measurable),t.blockRendering.Row=function(e){this.type=t.blockRendering.Types.ROW,this.elements=[],this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0,this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=this.hasStatement=this.hasExternalInput=!1,this.constants_=e,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT,this.align=null},t.blockRendering.Row.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.")},t.blockRendering.Row.prototype.getLastInput=function(){for(var e,i=this.elements.length-1;e=this.elements[i];i--)if(t.blockRendering.Types.isInput(e))return e;return null},t.blockRendering.Row.prototype.startsWithElemSpacer=function(){return!0},t.blockRendering.Row.prototype.endsWithElemSpacer=function(){return!0},t.blockRendering.Row.prototype.getFirstSpacer=function(){for(var e,i=0;e=this.elements[i];i++)if(t.blockRendering.Types.isSpacer(e))return e;return null},t.blockRendering.Row.prototype.getLastSpacer=function(){for(var e,i=this.elements.length-1;e=this.elements[i];i--)if(t.blockRendering.Types.isSpacer(e))return e;return null},t.blockRendering.TopRow=function(e){t.blockRendering.TopRow.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.TOP_ROW,this.ascenderHeight=this.capline=0,this.hasPreviousConnection=!1,this.connection=null},t.utils.object.inherits(t.blockRendering.TopRow,t.blockRendering.Row),t.blockRendering.TopRow.prototype.hasLeftSquareCorner=function(t){var e=(t.hat?"cap"===t.hat:this.constants_.ADD_START_HATS)&&!t.outputConnection&&!t.previousConnection,i=t.getPreviousBlock();return!!t.outputConnection||e||!!i&&i.getNextBlock()==t},t.blockRendering.TopRow.prototype.hasRightSquareCorner=function(t){return!0},t.blockRendering.TopRow.prototype.measure=function(){for(var e,i=0,n=0,o=0,r=0;e=this.elements[r];r++)n+=e.width,t.blockRendering.Types.isSpacer(e)||(t.blockRendering.Types.isHat(e)?o=Math.max(o,e.ascenderHeight):i=Math.max(i,e.height));this.width=Math.max(this.minWidth,n),this.height=Math.max(this.minHeight,i)+o,this.capline=this.ascenderHeight=o,this.widthWithConnectedBlocks=this.width},t.blockRendering.TopRow.prototype.startsWithElemSpacer=function(){return!1},t.blockRendering.TopRow.prototype.endsWithElemSpacer=function(){return!1},t.blockRendering.BottomRow=function(e){t.blockRendering.BottomRow.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.BOTTOM_ROW,this.hasNextConnection=!1,this.connection=null,this.baseline=this.descenderHeight=0},t.utils.object.inherits(t.blockRendering.BottomRow,t.blockRendering.Row),t.blockRendering.BottomRow.prototype.hasLeftSquareCorner=function(t){return!!t.outputConnection||!!t.getNextBlock()},t.blockRendering.BottomRow.prototype.hasRightSquareCorner=function(t){return!0},t.blockRendering.BottomRow.prototype.measure=function(){for(var e,i=0,n=0,o=0,r=0;e=this.elements[r];r++)n+=e.width,t.blockRendering.Types.isSpacer(e)||(t.blockRendering.Types.isNextConnection(e)?o=Math.max(o,e.height):i=Math.max(i,e.height));this.width=Math.max(this.minWidth,n),this.height=Math.max(this.minHeight,i)+o,this.descenderHeight=o,this.widthWithConnectedBlocks=this.width},t.blockRendering.BottomRow.prototype.startsWithElemSpacer=function(){return!1},t.blockRendering.BottomRow.prototype.endsWithElemSpacer=function(){return!1},t.blockRendering.SpacerRow=function(e,i,n){t.blockRendering.SpacerRow.superClass_.constructor.call(this,e),this.type=this.type|t.blockRendering.Types.SPACER|t.blockRendering.Types.BETWEEN_ROW_SPACER,this.width=n,this.height=i,this.followsStatement=!1,this.widthWithConnectedBlocks=0,this.elements=[new t.blockRendering.InRowSpacer(this.constants_,n)]},t.utils.object.inherits(t.blockRendering.SpacerRow,t.blockRendering.Row),t.blockRendering.SpacerRow.prototype.measure=function(){},t.blockRendering.InputRow=function(e){t.blockRendering.InputRow.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.INPUT_ROW,this.connectedBlockWidths=0},t.utils.object.inherits(t.blockRendering.InputRow,t.blockRendering.Row),t.blockRendering.InputRow.prototype.measure=function(){this.width=this.minWidth,this.height=this.minHeight;for(var e,i=0,n=0;e=this.elements[n];n++)this.width+=e.width,t.blockRendering.Types.isInput(e)&&(t.blockRendering.Types.isStatementInput(e)?i+=e.connectedBlockWidth:t.blockRendering.Types.isExternalInput(e)&&0!=e.connectedBlockWidth&&(i+=e.connectedBlockWidth-e.connectionWidth)),t.blockRendering.Types.isSpacer(e)||(this.height=Math.max(this.height,e.height));this.connectedBlockWidths=i,this.widthWithConnectedBlocks=this.width+i},t.blockRendering.InputRow.prototype.endsWithElemSpacer=function(){return!this.hasExternalInput&&!this.hasStatement},t.blockRendering.RenderInfo=function(e,i){this.block_=i,this.renderer_=e,this.constants_=this.renderer_.getConstants(),this.outputConnection=i.outputConnection?new t.blockRendering.OutputConnection(this.constants_,i.outputConnection):null,this.isInline=i.getInputsInline()&&!i.isCollapsed(),this.isCollapsed=i.isCollapsed(),this.isInsertionMarker=i.isInsertionMarker(),this.RTL=i.RTL,this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.hiddenIcons=[],this.topRow=new t.blockRendering.TopRow(this.constants_),this.bottomRow=new t.blockRendering.BottomRow(this.constants_),this.startY=this.startX=0},t.blockRendering.RenderInfo.prototype.getRenderer=function(){return this.renderer_},t.blockRendering.RenderInfo.prototype.measure=function(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()},t.blockRendering.RenderInfo.prototype.createRows_=function(){this.populateTopRow_(),this.rows.push(this.topRow);var e=new t.blockRendering.InputRow(this.constants_);this.inputRows.push(e);for(var i,n=this.block_.getIcons(),o=0;i=n[o];o++){var r=new t.blockRendering.Icon(this.constants_,i);this.isCollapsed&&i.collapseHidden?this.hiddenIcons.push(r):e.elements.push(r)}for(i=null,o=0;n=this.block_.inputList[o];o++)if(n.isVisible()){for(this.shouldStartNewRow_(n,i)&&(this.rows.push(e),e=new t.blockRendering.InputRow(this.constants_),this.inputRows.push(e)),i=0;r=n.fieldRow[i];i++)e.elements.push(new t.blockRendering.Field(this.constants_,r,n));this.addInput_(n,e),i=n}this.isCollapsed&&(e.hasJaggedEdge=!0,e.elements.push(new t.blockRendering.JaggedEdge(this.constants_))),(e.elements.length||e.hasDummyInput)&&this.rows.push(e),this.populateBottomRow_(),this.rows.push(this.bottomRow)},t.blockRendering.RenderInfo.prototype.populateTopRow_=function(){var e=!!this.block_.previousConnection,i=(this.block_.hat?"cap"===this.block_.hat:this.constants_.ADD_START_HATS)&&!this.outputConnection&&!e,n=this.topRow.hasLeftSquareCorner(this.block_)?t.blockRendering.SquareCorner:t.blockRendering.RoundCorner;this.topRow.elements.push(new n(this.constants_)),i?(e=new t.blockRendering.Hat(this.constants_),this.topRow.elements.push(e),this.topRow.capline=e.ascenderHeight):e&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new t.blockRendering.PreviousConnection(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0].type==t.inputTypes.STATEMENT&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,n=this.topRow.hasRightSquareCorner(this.block_)?t.blockRendering.SquareCorner:t.blockRendering.RoundCorner,this.topRow.elements.push(new n(this.constants_,"right"))},t.blockRendering.RenderInfo.prototype.populateBottomRow_=function(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1].type==t.inputTypes.STATEMENT?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new t.blockRendering.SquareCorner(this.constants_)):this.bottomRow.elements.push(new t.blockRendering.RoundCorner(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new t.blockRendering.NextConnection(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new t.blockRendering.SquareCorner(this.constants_,"right")):this.bottomRow.elements.push(new t.blockRendering.RoundCorner(this.constants_,"right"))},t.blockRendering.RenderInfo.prototype.addInput_=function(e,i){this.isInline&&e.type==t.inputTypes.VALUE?(i.elements.push(new t.blockRendering.InlineInput(this.constants_,e)),i.hasInlineInput=!0):e.type==t.inputTypes.STATEMENT?(i.elements.push(new t.blockRendering.StatementInput(this.constants_,e)),i.hasStatement=!0):e.type==t.inputTypes.VALUE?(i.elements.push(new t.blockRendering.ExternalValueInput(this.constants_,e)),i.hasExternalInput=!0):e.type==t.inputTypes.DUMMY&&(i.minHeight=Math.max(i.minHeight,e.getSourceBlock()&&e.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),i.hasDummyInput=!0),null==i.align&&(i.align=e.align)},t.blockRendering.RenderInfo.prototype.shouldStartNewRow_=function(e,i){return!!i&&(e.type==t.inputTypes.STATEMENT||i.type==t.inputTypes.STATEMENT||(e.type==t.inputTypes.VALUE||e.type==t.inputTypes.DUMMY)&&!this.isInline)},t.blockRendering.RenderInfo.prototype.addElemSpacing_=function(){for(var e,i=0;e=this.rows[i];i++){var n=e.elements;if(e.elements=[],e.startsWithElemSpacer()&&e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,this.getInRowSpacing_(null,n[0]))),n.length){for(var o=0;oe.height;r&&(i-=o),this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"rowSpacerRect blockRenderDebug",x:n?-(e.xPos+e.width):e.xPos,y:i,width:e.width,height:o,stroke:r?"black":"blue",fill:"blue","fill-opacity":"0.5","stroke-width":"1px"},this.svgRoot_))}},t.blockRendering.Debug.prototype.drawSpacerElem=function(e,i,n){if(t.blockRendering.Debug.config.elemSpacers){i=Math.abs(e.width);var o=0>e.width,r=o?e.xPos-i:e.xPos;n&&(r=-(r+i)),this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"elemSpacerRect blockRenderDebug",x:r,y:e.centerline-e.height/2,width:i,height:e.height,stroke:"pink",fill:o?"black":"pink","fill-opacity":"0.5","stroke-width":"1px"},this.svgRoot_))}},t.blockRendering.Debug.prototype.drawRenderedElem=function(e,i){if(t.blockRendering.Debug.config.elems){var n=e.xPos;i&&(n=-(n+e.width)),i=e.centerline-e.height/2,this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"rowRenderingRect blockRenderDebug",x:n,y:i,width:e.width,height:e.height,stroke:"black",fill:"none","stroke-width":"1px"},this.svgRoot_)),t.blockRendering.Types.isField(e)&&e.field instanceof t.FieldLabel&&this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"rowRenderingRect blockRenderDebug",x:n,y:i+this.constants_.FIELD_TEXT_BASELINE,width:e.width,height:"0.1px",stroke:"red",fill:"none","stroke-width":"0.5px"},this.svgRoot_))}t.blockRendering.Types.isInput(e)&&t.blockRendering.Debug.config.connections&&this.drawConnection(e.connectionModel)},t.blockRendering.Debug.prototype.drawConnection=function(e){if(t.blockRendering.Debug.config.connections){if(e.type==t.connectionTypes.INPUT_VALUE)var i=4,n="magenta",o="none";else e.type==t.connectionTypes.OUTPUT_VALUE?(i=2,o=n="magenta"):e.type==t.connectionTypes.NEXT_STATEMENT?(i=4,n="goldenrod",o="none"):e.type==t.connectionTypes.PREVIOUS_STATEMENT&&(i=2,o=n="goldenrod");this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.CIRCLE,{class:"blockRenderDebug",cx:e.offsetInBlock_.x,cy:e.offsetInBlock_.y,r:i,fill:o,stroke:n},this.svgRoot_))}},t.blockRendering.Debug.prototype.drawRenderedRow=function(e,i,n){t.blockRendering.Debug.config.rows&&(this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"elemRenderingRect blockRenderDebug",x:n?-(e.xPos+e.width):e.xPos,y:e.yPos,width:e.width,height:e.height,stroke:"red",fill:"none","stroke-width":"1px"},this.svgRoot_)),t.blockRendering.Types.isTopOrBottomRow(e)||t.blockRendering.Debug.config.connectedBlockBounds&&this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"connectedBlockWidth blockRenderDebug",x:n?-(e.xPos+e.widthWithConnectedBlocks):e.xPos,y:e.yPos,width:e.widthWithConnectedBlocks,height:e.height,stroke:this.randomColour_,fill:"none","stroke-width":"1px","stroke-dasharray":"3,3"},this.svgRoot_)))},t.blockRendering.Debug.prototype.drawRowWithElements=function(e,i,n){for(var o=0,r=e.elements.length;o.blocklyPathLight,",e+" .blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"])},t.geras.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},t.geras.Highlighter.prototype.getPath=function(){return this.steps_+"\n"+this.inlineSteps_},t.geras.Highlighter.prototype.drawTopCorner=function(e){this.steps_+=t.utils.svgPaths.moveBy(e.xPos,this.info_.startY);for(var i,n=0;i=e.elements[n];n++)t.blockRendering.Types.isLeftSquareCorner(i)?this.steps_+=this.highlightConstants_.START_POINT:t.blockRendering.Types.isLeftRoundedCorner(i)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):t.blockRendering.Types.isPreviousConnection(i)?this.steps_+=this.notchPaths_.pathLeft:t.blockRendering.Types.isHat(i)?this.steps_+=this.startPaths_.path(this.RTL_):t.blockRendering.Types.isSpacer(i)&&0!=i.width&&(this.steps_+=t.utils.svgPaths.lineOnAxis("H",i.xPos+i.width-this.highlightOffset_));this.steps_+=t.utils.svgPaths.lineOnAxis("H",e.xPos+e.width-this.highlightOffset_)},t.geras.Highlighter.prototype.drawJaggedEdge_=function(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+t.utils.svgPaths.lineOnAxis("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset_))},t.geras.Highlighter.prototype.drawValueInput=function(e){var i=e.getLastInput();if(this.RTL_){var n=e.height-i.connectionHeight;this.steps_+=t.utils.svgPaths.moveTo(i.xPos+i.width-this.highlightOffset_,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+t.utils.svgPaths.lineOnAxis("v",n)}else this.steps_+=t.utils.svgPaths.moveTo(i.xPos+i.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)},t.geras.Highlighter.prototype.drawStatementInput=function(e){var i=e.getLastInput();if(this.RTL_){var n=e.height-2*this.insideCornerPaths_.height;this.steps_+=t.utils.svgPaths.moveTo(i.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+t.utils.svgPaths.lineOnAxis("v",n)+this.insideCornerPaths_.pathBottom(this.RTL_)+t.utils.svgPaths.lineTo(e.width-i.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=t.utils.svgPaths.moveTo(i.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+t.utils.svgPaths.lineTo(e.width-i.xPos-this.insideCornerPaths_.width,0)},t.geras.Highlighter.prototype.drawRightSideRow=function(e){var i=e.xPos+e.width-this.highlightOffset_;e.followsStatement&&(this.steps_+=t.utils.svgPaths.lineOnAxis("H",i)),this.RTL_&&(this.steps_+=t.utils.svgPaths.lineOnAxis("H",i),e.height>this.highlightOffset_&&(this.steps_+=t.utils.svgPaths.lineOnAxis("V",e.yPos+e.height-this.highlightOffset_)))},t.geras.Highlighter.prototype.drawBottomRow=function(e){if(this.RTL_)this.steps_+=t.utils.svgPaths.lineOnAxis("V",e.baseline-this.highlightOffset_);else{var i=this.info_.bottomRow.elements[0];t.blockRendering.Types.isLeftSquareCorner(i)?this.steps_+=t.utils.svgPaths.moveTo(e.xPos+this.highlightOffset_,e.baseline-this.highlightOffset_):t.blockRendering.Types.isLeftRoundedCorner(i)&&(this.steps_+=t.utils.svgPaths.moveTo(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}},t.geras.Highlighter.prototype.drawLeft=function(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=t.utils.svgPaths.moveTo(this.info_.startX,e):(this.steps_+=t.utils.svgPaths.moveTo(this.info_.startX+this.highlightOffset_,this.info_.bottomRow.baseline-this.highlightOffset_),this.steps_+=t.utils.svgPaths.lineOnAxis("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,t.blockRendering.Types.isLeftRoundedCorner(e.elements[0])?this.steps_+=t.utils.svgPaths.lineOnAxis("V",this.outsideCornerPaths_.height):this.steps_+=t.utils.svgPaths.lineOnAxis("V",e.capline+this.highlightOffset_))},t.geras.Highlighter.prototype.drawInlineInput=function(e){var i=this.highlightOffset_,n=e.xPos+e.connectionWidth,o=e.centerline-e.height/2,r=e.width-e.connectionWidth,s=o+i;this.RTL_?(o=e.connectionOffsetY-i,e=e.height-(e.connectionOffsetY+e.connectionHeight)+i,this.inlineSteps_+=t.utils.svgPaths.moveTo(n-i,s)+t.utils.svgPaths.lineOnAxis("v",o)+this.puzzleTabPaths_.pathDown(this.RTL_)+t.utils.svgPaths.lineOnAxis("v",e)+t.utils.svgPaths.lineOnAxis("h",r)):this.inlineSteps_+=t.utils.svgPaths.moveTo(e.xPos+e.width+i,s)+t.utils.svgPaths.lineOnAxis("v",e.height)+t.utils.svgPaths.lineOnAxis("h",-r)+t.utils.svgPaths.moveTo(n,o+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)},t.geras.InlineInput=function(e,i){t.geras.InlineInput.superClass_.constructor.call(this,e,i),this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)},t.utils.object.inherits(t.geras.InlineInput,t.blockRendering.InlineInput),t.geras.StatementInput=function(e,i){t.geras.StatementInput.superClass_.constructor.call(this,e,i),this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)},t.utils.object.inherits(t.geras.StatementInput,t.blockRendering.StatementInput),t.geras.RenderInfo=function(e,i){t.geras.RenderInfo.superClass_.constructor.call(this,e,i)},t.utils.object.inherits(t.geras.RenderInfo,t.blockRendering.RenderInfo),t.geras.RenderInfo.prototype.getRenderer=function(){return this.renderer_},t.geras.RenderInfo.prototype.populateBottomRow_=function(){t.geras.RenderInfo.superClass_.populateBottomRow_.call(this),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1].type==t.inputTypes.STATEMENT||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)},t.geras.RenderInfo.prototype.addInput_=function(e,i){this.isInline&&e.type==t.inputTypes.VALUE?(i.elements.push(new t.geras.InlineInput(this.constants_,e)),i.hasInlineInput=!0):e.type==t.inputTypes.STATEMENT?(i.elements.push(new t.geras.StatementInput(this.constants_,e)),i.hasStatement=!0):e.type==t.inputTypes.VALUE?(i.elements.push(new t.blockRendering.ExternalValueInput(this.constants_,e)),i.hasExternalInput=!0):e.type==t.inputTypes.DUMMY&&(i.minHeight=Math.max(i.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),i.hasDummyInput=!0),this.isInline||null!=i.align||(i.align=e.align)},t.geras.RenderInfo.prototype.addElemSpacing_=function(){for(var e,i=!1,n=0;e=this.rows[n];n++)e.hasExternalInput&&(i=!0);for(n=0;e=this.rows[n];n++){var o=e.elements;if(e.elements=[],e.startsWithElemSpacer()&&e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,this.getInRowSpacing_(null,o[0]))),o.length){for(var r=0;ri?i:r,o=o?-1:1,e=(n?-1:1)*e/2,t.utils.svgPaths.lineTo(-o*r,e)+t.utils.svgPaths.lineTo(o*r,e)}var i=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width:function(t){return(t/=2)>i?i:t},height:function(t){return t},connectionOffsetY:function(t){return t/2},connectionOffsetX:function(t){return-t},pathDown:function(t){return e(t,!1,!1)},pathUp:function(t){return e(t,!0,!1)},pathRightDown:function(t){return e(t,!1,!0)},pathRightUp:function(t){return e(t,!1,!0)}}},t.zelos.ConstantProvider.prototype.makeRounded=function(){function e(e,i,o){var r=e>n?e-n:0;return e=(e>n?n:e)/2,t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point((i?-1:1)*e,(i?-1:1)*e))+t.utils.svgPaths.lineOnAxis("v",(o?1:-1)*r)+t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point((i?1:-1)*e,(i?-1:1)*e))}var i=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,n=2*i;return{type:this.SHAPES.ROUND,isDynamic:!0,width:function(t){return(t/=2)>i?i:t},height:function(t){return t},connectionOffsetY:function(t){return t/2},connectionOffsetX:function(t){return-t},pathDown:function(t){return e(t,!1,!1)},pathUp:function(t){return e(t,!0,!1)},pathRightDown:function(t){return e(t,!1,!0)},pathRightUp:function(t){return e(t,!1,!0)}}},t.zelos.ConstantProvider.prototype.makeSquared=function(){function e(e,n,o){return e-=2*i,t.utils.svgPaths.arc("a","0 0,1",i,t.utils.svgPaths.point((n?-1:1)*i,(n?-1:1)*i))+t.utils.svgPaths.lineOnAxis("v",(o?1:-1)*e)+t.utils.svgPaths.arc("a","0 0,1",i,t.utils.svgPaths.point((n?1:-1)*i,(n?-1:1)*i))}var i=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width:function(t){return i},height:function(t){return t},connectionOffsetY:function(t){return t/2},connectionOffsetX:function(t){return-t},pathDown:function(t){return e(t,!1,!1)},pathUp:function(t){return e(t,!0,!1)},pathRightDown:function(t){return e(t,!1,!0)},pathRightUp:function(t){return e(t,!1,!0)}}},t.zelos.ConstantProvider.prototype.shapeFor=function(e){var i=e.getCheck();switch(!i&&e.targetConnection&&(i=e.targetConnection.getCheck()),e.type){case t.connectionTypes.INPUT_VALUE:case t.connectionTypes.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 i&&-1!=i.indexOf("Boolean")?this.HEXAGONAL:i&&-1!=i.indexOf("Number")?this.ROUNDED:(i&&i.indexOf("String"),this.ROUNDED);case t.connectionTypes.PREVIOUS_STATEMENT:case t.connectionTypes.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}},t.zelos.ConstantProvider.prototype.makeNotch=function(){function e(e){return t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(e*r/2,0),t.utils.svgPaths.point(e*r*3/4,a/2),t.utils.svgPaths.point(e*r,a)])+t.utils.svgPaths.line([t.utils.svgPaths.point(e*r,s)])+t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(e*r/4,a/2),t.utils.svgPaths.point(e*r/2,a),t.utils.svgPaths.point(e*r,a)])+t.utils.svgPaths.lineOnAxis("h",e*o)+t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(e*r/2,0),t.utils.svgPaths.point(e*r*3/4,-a/2),t.utils.svgPaths.point(e*r,-a)])+t.utils.svgPaths.line([t.utils.svgPaths.point(e*r,-s)])+t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(e*r/4,-a/2),t.utils.svgPaths.point(e*r/2,-a),t.utils.svgPaths.point(e*r,-a)])}var i=this.NOTCH_WIDTH,n=this.NOTCH_HEIGHT,o=i/3,r=o/3,s=n/2,a=s/2,l=e(1),c=e(-1);return{type:this.SHAPES.NOTCH,width:i,height:n,pathLeft:l,pathRight:c}},t.zelos.ConstantProvider.prototype.makeInsideCorners=function(){var e=this.CORNER_RADIUS,i=t.utils.svgPaths.arc("a","0 0,0",e,t.utils.svgPaths.point(-e,e)),n=t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point(-e,e));return{width:e,height:e,pathTop:i,pathBottom:t.utils.svgPaths.arc("a","0 0,0",e,t.utils.svgPaths.point(e,e)),rightWidth:e,rightHeight:e,pathTopRight:n,pathBottomRight:t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point(e,e))}},t.zelos.ConstantProvider.prototype.generateSecondaryColour_=function(e){return t.utils.colour.blend("#000",e,.15)||e},t.zelos.ConstantProvider.prototype.generateTertiaryColour_=function(e){return t.utils.colour.blend("#000",e,.25)||e},t.zelos.ConstantProvider.prototype.createDom=function(e,i,n){t.zelos.ConstantProvider.superClass_.createDom.call(this,e,i,n),e=t.utils.dom.createSvgElement(t.utils.Svg.DEFS,{},e),i=t.utils.dom.createSvgElement(t.utils.Svg.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),t.utils.dom.createSvgElement(t.utils.Svg.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},i),n=t.utils.dom.createSvgElement(t.utils.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},i),t.utils.dom.createSvgElement(t.utils.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},n),t.utils.dom.createSvgElement(t.utils.Svg.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},i),t.utils.dom.createSvgElement(t.utils.Svg.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},i),this.selectedGlowFilterId=i.id,this.selectedGlowFilter_=i,e=t.utils.dom.createSvgElement(t.utils.Svg.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),t.utils.dom.createSvgElement(t.utils.Svg.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),i=t.utils.dom.createSvgElement(t.utils.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},e),t.utils.dom.createSvgElement(t.utils.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},i),t.utils.dom.createSvgElement(t.utils.Svg.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),t.utils.dom.createSvgElement(t.utils.Svg.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),t.utils.dom.createSvgElement(t.utils.Svg.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter_=e},t.zelos.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;","}"]},t.zelos.TopRow=function(e){t.zelos.TopRow.superClass_.constructor.call(this,e)},t.utils.object.inherits(t.zelos.TopRow,t.blockRendering.TopRow),t.zelos.TopRow.prototype.endsWithElemSpacer=function(){return!1},t.zelos.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},t.zelos.TopRow.prototype.hasRightSquareCorner=function(t){return!!t.outputConnection&&!t.statementInputCount&&!t.nextConnection},t.zelos.BottomRow=function(e){t.zelos.BottomRow.superClass_.constructor.call(this,e)},t.utils.object.inherits(t.zelos.BottomRow,t.blockRendering.BottomRow),t.zelos.BottomRow.prototype.endsWithElemSpacer=function(){return!1},t.zelos.BottomRow.prototype.hasLeftSquareCorner=function(t){return!!t.outputConnection},t.zelos.BottomRow.prototype.hasRightSquareCorner=function(t){return!!t.outputConnection&&!t.statementInputCount&&!t.nextConnection},t.zelos.RightConnectionShape=function(e){t.zelos.RightConnectionShape.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.getType("RIGHT_CONNECTION"),this.width=this.height=0},t.utils.object.inherits(t.zelos.RightConnectionShape,t.blockRendering.Measurable),t.zelos.RenderInfo=function(e,i){t.zelos.RenderInfo.superClass_.constructor.call(this,e,i),this.topRow=new t.zelos.TopRow(this.constants_),this.bottomRow=new t.zelos.BottomRow(this.constants_),this.isInline=!0,this.isMultiRow=!i.getInputsInline()||i.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!s.precedesStatement,t.blockRendering.Types.isInputRow(r)&&r.hasStatement)r.measure(),i=r.width-r.getLastInput().width+e;else if(o&&(2==n||s)&&t.blockRendering.Types.isInputRow(r)&&!r.hasStatement){s=r.xPos,o=null;for(var a,l=0;a=r.elements[l];l++)t.blockRendering.Types.isSpacer(a)&&(o=a),!(o&&(t.blockRendering.Types.isField(a)||t.blockRendering.Types.isInput(a))&&sn?n:this.height/2)*(1-Math.sin(Math.acos((n-this.constants_.SMALL_PADDING)/n)));default:return 0}if(t.blockRendering.Types.isInlineInput(e)){var r=e.connectedBlock;return e=r?r.pathObject.outputShapeType:e.shape.type,r&&r.outputConnection&&(r.statementInputCount||r.nextConnection)||n==o.SHAPES.HEXAGONAL&&n!=e?0:i-this.constants_.SHAPE_IN_SHAPE_PADDING[n][e]}return t.blockRendering.Types.isField(e)?n==o.SHAPES.ROUND&&e.field instanceof t.FieldTextInput?i-2.75*o.GRID_UNIT:i-this.constants_.SHAPE_IN_SHAPE_PADDING[n][0]:t.blockRendering.Types.isIcon(e)?this.constants_.SMALL_PADDING:0},t.zelos.RenderInfo.prototype.finalizeVerticalAlignment_=function(){if(!this.outputConnection)for(var e=2;e=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!o.precedesStatement;if(r?this.topRow.hasPreviousConnection:i.followsStatement){var a=3==n.elements.length&&(n.elements[1].field instanceof t.FieldLabel||n.elements[1].field instanceof t.FieldImage);if(!r&&a)i.height-=this.constants_.SMALL_PADDING,o.height-=this.constants_.SMALL_PADDING,n.height-=this.constants_.MEDIUM_PADDING;else if(r||s){if(s){for(r=!1,s=0;a=n.elements[s];s++)if(t.blockRendering.Types.isInlineInput(a)&&a.connectedBlock&&!a.connectedBlock.isShadow()&&40<=a.connectedBlock.getHeightWidth().height){r=!0;break}r&&(i.height-=this.constants_.SMALL_PADDING,o.height-=this.constants_.SMALL_PADDING)}}else i.height+=this.constants_.SMALL_PADDING}}},t.zelos.RenderInfo.prototype.finalize_=function(){this.finalizeOutputConnection_(),this.finalizeHorizontalAlignment_(),this.finalizeVerticalAlignment_(),t.zelos.RenderInfo.superClass_.finalize_.call(this),this.rightSide&&(this.widthWithChildren+=this.rightSide.width)},t.zelos.Drawer=function(e,i){t.zelos.Drawer.superClass_.constructor.call(this,e,i)},t.utils.object.inherits(t.zelos.Drawer,t.blockRendering.Drawer),t.zelos.Drawer.prototype.draw=function(){var e=this.block_.pathObject;e.beginDrawing(),this.hideHiddenIcons_(),this.drawOutline_(),this.drawInternals_(),e.setPath(this.outlinePath_+"\n"+this.inlinePath_),this.info_.RTL&&e.flipRTL(),t.blockRendering.useDebugger&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_),this.recordSizeOnBlock_(),this.info_.outputConnection&&(e.outputShapeType=this.info_.outputConnection.shape.type),e.endDrawing()},t.zelos.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_()):t.zelos.Drawer.superClass_.drawOutline_.call(this)},t.zelos.Drawer.prototype.drawLeft_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():t.zelos.Drawer.superClass_.drawLeft_.call(this)},t.zelos.Drawer.prototype.drawRightSideRow_=function(e){if(!(0>=e.height))if(e.precedesStatement||e.followsStatement){var i=this.constants_.INSIDE_CORNERS.rightHeight;i=e.height-(e.precedesStatement?i:0),this.outlinePath_+=(e.followsStatement?this.constants_.INSIDE_CORNERS.pathBottomRight:"")+(0-1}},percentage:{type:Number,default:0,required:!0,validator:function(t){return t>=0&&t<=100}},status:{type:String,validator:function(t){return["success","exception","warning"].indexOf(t)>-1}},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle:function(){var t={};return t.width=this.percentage+"%",t.backgroundColor=this.getCurrentColor(this.percentage),t},relativeStrokeWidth:function(){return(this.strokeWidth/this.width*100).toFixed(1)},radius:function(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath:function(){var t=this.radius,e="dashboard"===this.type;return"\n M 50 50\n m 0 "+(e?"":"-")+t+"\n a "+t+" "+t+" 0 1 1 0 "+(e?"-":"")+2*t+"\n a "+t+" "+t+" 0 1 1 0 "+(e?"":"-")+2*t+"\n "},perimeter:function(){return 2*Math.PI*this.radius},rate:function(){return"dashboard"===this.type?.75:1},strokeDashoffset:function(){return-1*this.perimeter*(1-this.rate)/2+"px"},trailPathStyle:function(){return{strokeDasharray:this.perimeter*this.rate+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset}},circlePathStyle:function(){return{strokeDasharray:this.perimeter*this.rate*(this.percentage/100)+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke:function(){var t=void 0;if(this.color)t=this.getCurrentColor(this.percentage);else switch(this.status){case"success":t="#13ce66";break;case"exception":t="#ff4949";break;case"warning":t="#e6a23c";break;default:t="#20a0ff"}return t},iconClass:function(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize:function(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content:function(){return"function"==typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor:function(t){return"function"==typeof this.color?this.color(t):"string"==typeof this.color?this.color:this.getLevelColor(t)},getLevelColor:function(t){for(var e=this.getColorArray().sort(function(t,e){return t.percentage-e.percentage}),i=0;it)return e[i].color;return e[e.length-1].color},getColorArray:function(){var t=this.color,e=100/t.length;return t.map(function(t,i){return"string"==typeof t?{color:t,percentage:(i+1)*e}:t})}}},r=i(0),s=Object(r.a)(o,n,[],!1,null,null,null);s.options.__file="packages/progress/src/progress.vue";var a=s.exports;a.install=function(t){t.component(a.name,a)};e.default=a}})},H8dH:function(t,e,i){"use strict";e.__esModule=!0,e.default=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!t||!e)throw new Error("instance & callback is required");var o=!1,r=function(){o||(o=!0,e&&e.apply(null,arguments))};n?t.$once("after-leave",r):t.$on("after-leave",r),setTimeout(function(){r()},i+100)}},HJMx:function(t,e,i){t.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/",i(i.s=79)}({0:function(t,e,i){"use strict";function n(t,e,i,n,o,r,s,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:c}}i.d(e,"a",function(){return n})},11:function(t,e){t.exports=i("aW5l")},21:function(t,e){t.exports=i("E/in")},4:function(t,e){t.exports=i("fPll")},79:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:["textarea"===t.type?"el-textarea":"el-input",t.inputSize?"el-input--"+t.inputSize:"",{"is-disabled":t.inputDisabled,"is-exceed":t.inputExceed,"el-input-group":t.$slots.prepend||t.$slots.append,"el-input-group--append":t.$slots.append,"el-input-group--prepend":t.$slots.prepend,"el-input--prefix":t.$slots.prefix||t.prefixIcon,"el-input--suffix":t.$slots.suffix||t.suffixIcon||t.clearable||t.showPassword}],on:{mouseenter:function(e){t.hovering=!0},mouseleave:function(e){t.hovering=!1}}},["textarea"!==t.type?[t.$slots.prepend?i("div",{staticClass:"el-input-group__prepend"},[t._t("prepend")],2):t._e(),"textarea"!==t.type?i("input",t._b({ref:"input",staticClass:"el-input__inner",attrs:{tabindex:t.tabindex,type:t.showPassword?t.passwordVisible?"text":"password":t.type,disabled:t.inputDisabled,readonly:t.readonly,autocomplete:t.autoComplete||t.autocomplete,"aria-label":t.label},on:{compositionstart:t.handleCompositionStart,compositionupdate:t.handleCompositionUpdate,compositionend:t.handleCompositionEnd,input:t.handleInput,focus:t.handleFocus,blur:t.handleBlur,change:t.handleChange}},"input",t.$attrs,!1)):t._e(),t.$slots.prefix||t.prefixIcon?i("span",{staticClass:"el-input__prefix"},[t._t("prefix"),t.prefixIcon?i("i",{staticClass:"el-input__icon",class:t.prefixIcon}):t._e()],2):t._e(),t.getSuffixVisible()?i("span",{staticClass:"el-input__suffix"},[i("span",{staticClass:"el-input__suffix-inner"},[t.showClear&&t.showPwdVisible&&t.isWordLimitVisible?t._e():[t._t("suffix"),t.suffixIcon?i("i",{staticClass:"el-input__icon",class:t.suffixIcon}):t._e()],t.showClear?i("i",{staticClass:"el-input__icon el-icon-circle-close el-input__clear",on:{mousedown:function(t){t.preventDefault()},click:t.clear}}):t._e(),t.showPwdVisible?i("i",{staticClass:"el-input__icon el-icon-view el-input__clear",on:{click:t.handlePasswordVisible}}):t._e(),t.isWordLimitVisible?i("span",{staticClass:"el-input__count"},[i("span",{staticClass:"el-input__count-inner"},[t._v("\n "+t._s(t.textLength)+"/"+t._s(t.upperLimit)+"\n ")])]):t._e()],2),t.validateState?i("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",t.validateIcon]}):t._e()]):t._e(),t.$slots.append?i("div",{staticClass:"el-input-group__append"},[t._t("append")],2):t._e()]:i("textarea",t._b({ref:"textarea",staticClass:"el-textarea__inner",style:t.textareaStyle,attrs:{tabindex:t.tabindex,disabled:t.inputDisabled,readonly:t.readonly,autocomplete:t.autoComplete||t.autocomplete,"aria-label":t.label},on:{compositionstart:t.handleCompositionStart,compositionupdate:t.handleCompositionUpdate,compositionend:t.handleCompositionEnd,input:t.handleInput,focus:t.handleFocus,blur:t.handleBlur,change:t.handleChange}},"textarea",t.$attrs,!1)),t.isWordLimitVisible&&"textarea"===t.type?i("span",{staticClass:"el-input__count"},[t._v(t._s(t.textLength)+"/"+t._s(t.upperLimit))]):t._e()],2)};n._withStripped=!0;var o=i(4),r=i.n(o),s=i(11),a=i.n(s),l=void 0,c="\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",u=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;l||(l=document.createElement("textarea"),document.body.appendChild(l));var n=function(t){var e=window.getComputedStyle(t),i=e.getPropertyValue("box-sizing"),n=parseFloat(e.getPropertyValue("padding-bottom"))+parseFloat(e.getPropertyValue("padding-top")),o=parseFloat(e.getPropertyValue("border-bottom-width"))+parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:u.map(function(t){return t+":"+e.getPropertyValue(t)}).join(";"),paddingSize:n,borderSize:o,boxSizing:i}}(t),o=n.paddingSize,r=n.borderSize,s=n.boxSizing,a=n.contextStyle;l.setAttribute("style",a+";"+c),l.value=t.value||t.placeholder||"";var h=l.scrollHeight,p={};"border-box"===s?h+=r:"content-box"===s&&(h-=o),l.value="";var d=l.scrollHeight-o;if(null!==e){var f=d*e;"border-box"===s&&(f=f+o+r),h=Math.max(f,h),p.minHeight=f+"px"}if(null!==i){var g=d*i;"border-box"===s&&(g=g+o+r),h=Math.min(g,h)}return p.height=h+"px",l.parentNode&&l.parentNode.removeChild(l),l=null,p}var p=i(9),d=i.n(p),f=i(21),g={name:"ElInput",componentName:"ElInput",mixins:[r.a,a.a],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{textareaCalcStyle:{},hovering:!1,focused:!1,isComposing:!1,passwordVisible:!1}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,readonly:Boolean,type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(t){return!0}},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},tabindex:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},textareaStyle:function(){return d()({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputDisabled:function(){return this.disabled||(this.elForm||{}).disabled},nativeInputValue:function(){return null===this.value||void 0===this.value?"":String(this.value)},showClear:function(){return this.clearable&&!this.inputDisabled&&!this.readonly&&this.nativeInputValue&&(this.focused||this.hovering)},showPwdVisible:function(){return this.showPassword&&!this.inputDisabled&&!this.readonly&&(!!this.nativeInputValue||this.focused)},isWordLimitVisible:function(){return this.showWordLimit&&this.$attrs.maxlength&&("text"===this.type||"textarea"===this.type)&&!this.inputDisabled&&!this.readonly&&!this.showPassword},upperLimit:function(){return this.$attrs.maxlength},textLength:function(){return"number"==typeof this.value?String(this.value).length:(this.value||"").length},inputExceed:function(){return this.isWordLimitVisible&&this.textLength>this.upperLimit}},watch:{value:function(t){this.$nextTick(this.resizeTextarea),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[t])},nativeInputValue:function(){this.setNativeInputValue()},type:function(){var t=this;this.$nextTick(function(){t.setNativeInputValue(),t.resizeTextarea(),t.updateIconOffset()})}},methods:{focus:function(){this.getInput().focus()},blur:function(){this.getInput().blur()},getMigratingConfig:function(){return{props:{icon:"icon is removed, use suffix-icon / prefix-icon instead.","on-icon-click":"on-icon-click is removed."},events:{click:"click is removed."}}},handleBlur:function(t){this.focused=!1,this.$emit("blur",t),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.value])},select:function(){this.getInput().select()},resizeTextarea:function(){if(!this.$isServer){var t=this.autosize;if("textarea"===this.type)if(t){var e=t.minRows,i=t.maxRows;this.textareaCalcStyle=h(this.$refs.textarea,e,i)}else this.textareaCalcStyle={minHeight:h(this.$refs.textarea).minHeight}}},setNativeInputValue:function(){var t=this.getInput();t&&t.value!==this.nativeInputValue&&(t.value=this.nativeInputValue)},handleFocus:function(t){this.focused=!0,this.$emit("focus",t)},handleCompositionStart:function(){this.isComposing=!0},handleCompositionUpdate:function(t){var e=t.target.value,i=e[e.length-1]||"";this.isComposing=!Object(f.isKorean)(i)},handleCompositionEnd:function(t){this.isComposing&&(this.isComposing=!1,this.handleInput(t))},handleInput:function(t){this.isComposing||t.target.value!==this.nativeInputValue&&(this.$emit("input",t.target.value),this.$nextTick(this.setNativeInputValue))},handleChange:function(t){this.$emit("change",t.target.value)},calcIconOffset:function(t){var e=[].slice.call(this.$el.querySelectorAll(".el-input__"+t)||[]);if(e.length){for(var i=null,n=0;n0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!(i&&i.context&&n.target&&o.target)||t.contains(n.target)||t.contains(o.target)||t===n.target||i.context.popperElm&&(i.context.popperElm.contains(n.target)||i.context.popperElm.contains(o.target))||(e.expression&&t[l].methodName&&i.context[t[l].methodName]?i.context[t[l].methodName]():t[l].bindingFn&&t[l].bindingFn())}}!r.default.prototype.$isServer&&(0,s.on)(document,"mousedown",function(t){return c=t}),!r.default.prototype.$isServer&&(0,s.on)(document,"mouseup",function(t){a.forEach(function(e){return e[l].documentHandler(t,c)})}),e.default={bind:function(t,e,i){a.push(t);var n=u++;t[l]={id:n,documentHandler:h(t,e,i),methodName:e.expression,bindingFn:e.value}},update:function(t,e,i){t[l].documentHandler=h(t,e,i),t[l].methodName=e.expression,t[l].bindingFn=e.value},unbind:function(t){for(var e=a.length,i=0;il;)n(a,i=e[l++])&&(~r(c,i)||c.push(i));return c}},JMbB:function(t,e,i){var n,o,r,s;s=function(t){"use strict";return t.JavaScript=new t.Generator("JavaScript"),t.JavaScript.addReservedWords("break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,new,return,super,switch,this,throw,try,typeof,var,void,while,with,yield,enum,implements,interface,let,package,private,protected,public,static,await,null,true,false,arguments,"+Object.getOwnPropertyNames(t.utils.global).join(",")),t.JavaScript.ORDER_ATOMIC=0,t.JavaScript.ORDER_NEW=1.1,t.JavaScript.ORDER_MEMBER=1.2,t.JavaScript.ORDER_FUNCTION_CALL=2,t.JavaScript.ORDER_INCREMENT=3,t.JavaScript.ORDER_DECREMENT=3,t.JavaScript.ORDER_BITWISE_NOT=4.1,t.JavaScript.ORDER_UNARY_PLUS=4.2,t.JavaScript.ORDER_UNARY_NEGATION=4.3,t.JavaScript.ORDER_LOGICAL_NOT=4.4,t.JavaScript.ORDER_TYPEOF=4.5,t.JavaScript.ORDER_VOID=4.6,t.JavaScript.ORDER_DELETE=4.7,t.JavaScript.ORDER_AWAIT=4.8,t.JavaScript.ORDER_EXPONENTIATION=5,t.JavaScript.ORDER_MULTIPLICATION=5.1,t.JavaScript.ORDER_DIVISION=5.2,t.JavaScript.ORDER_MODULUS=5.3,t.JavaScript.ORDER_SUBTRACTION=6.1,t.JavaScript.ORDER_ADDITION=6.2,t.JavaScript.ORDER_BITWISE_SHIFT=7,t.JavaScript.ORDER_RELATIONAL=8,t.JavaScript.ORDER_IN=8,t.JavaScript.ORDER_INSTANCEOF=8,t.JavaScript.ORDER_EQUALITY=9,t.JavaScript.ORDER_BITWISE_AND=10,t.JavaScript.ORDER_BITWISE_XOR=11,t.JavaScript.ORDER_BITWISE_OR=12,t.JavaScript.ORDER_LOGICAL_AND=13,t.JavaScript.ORDER_LOGICAL_OR=14,t.JavaScript.ORDER_CONDITIONAL=15,t.JavaScript.ORDER_ASSIGNMENT=16,t.JavaScript.ORDER_YIELD=17,t.JavaScript.ORDER_COMMA=18,t.JavaScript.ORDER_NONE=99,t.JavaScript.ORDER_OVERRIDES=[[t.JavaScript.ORDER_FUNCTION_CALL,t.JavaScript.ORDER_MEMBER],[t.JavaScript.ORDER_FUNCTION_CALL,t.JavaScript.ORDER_FUNCTION_CALL],[t.JavaScript.ORDER_MEMBER,t.JavaScript.ORDER_MEMBER],[t.JavaScript.ORDER_MEMBER,t.JavaScript.ORDER_FUNCTION_CALL],[t.JavaScript.ORDER_LOGICAL_NOT,t.JavaScript.ORDER_LOGICAL_NOT],[t.JavaScript.ORDER_MULTIPLICATION,t.JavaScript.ORDER_MULTIPLICATION],[t.JavaScript.ORDER_ADDITION,t.JavaScript.ORDER_ADDITION],[t.JavaScript.ORDER_LOGICAL_AND,t.JavaScript.ORDER_LOGICAL_AND],[t.JavaScript.ORDER_LOGICAL_OR,t.JavaScript.ORDER_LOGICAL_OR]],t.JavaScript.isInitialized=!1,t.JavaScript.init=function(e){Object.getPrototypeOf(this).init.call(this),this.nameDB_?this.nameDB_.reset():this.nameDB_=new t.Names(this.RESERVED_WORDS_),this.nameDB_.setVariableMap(e.getVariableMap()),this.nameDB_.populateVariables(e),this.nameDB_.populateProcedures(e);for(var i=[],n=t.Variables.allDeveloperVariables(e),o=0;on?this.valueToCode(e,i,this.ORDER_SUBTRACTION)||s:o?this.valueToCode(e,i,this.ORDER_UNARY_NEGATION)||s:this.valueToCode(e,i,r)||s,t.isNumber(e))e=Number(e)+n,o&&(e=-e);else{if(0n&&(e=e+" - "+-n,a=this.ORDER_SUBTRACTION);o&&(e=n?"-("+e+")":"-"+e,a=this.ORDER_UNARY_NEGATION),a=Math.floor(a),r=Math.floor(r),a&&r>=a&&(e="("+e+")")}return e},t.JavaScript.colour={},t.JavaScript.colour_picker=function(e){return[t.JavaScript.quote_(e.getFieldValue("COLOUR")),t.JavaScript.ORDER_ATOMIC]},t.JavaScript.colour_random=function(e){return[t.JavaScript.provideFunction_("colourRandom",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"() {"," var num = Math.floor(Math.random() * Math.pow(2, 24));"," return '#' + ('00000' + num.toString(16)).substr(-6);","}"])+"()",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.colour_rgb=function(e){var i=t.JavaScript.valueToCode(e,"RED",t.JavaScript.ORDER_NONE)||0,n=t.JavaScript.valueToCode(e,"GREEN",t.JavaScript.ORDER_NONE)||0;return e=t.JavaScript.valueToCode(e,"BLUE",t.JavaScript.ORDER_NONE)||0,[t.JavaScript.provideFunction_("colourRgb",["function "+t.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;","}"])+"("+i+", "+n+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.colour_blend=function(e){var i=t.JavaScript.valueToCode(e,"COLOUR1",t.JavaScript.ORDER_NONE)||"'#000000'",n=t.JavaScript.valueToCode(e,"COLOUR2",t.JavaScript.ORDER_NONE)||"'#000000'";return e=t.JavaScript.valueToCode(e,"RATIO",t.JavaScript.ORDER_NONE)||.5,[t.JavaScript.provideFunction_("colourBlend",["function "+t.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;","}"])+"("+i+", "+n+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.lists={},t.JavaScript.lists_create_empty=function(e){return["[]",t.JavaScript.ORDER_ATOMIC]},t.JavaScript.lists_create_with=function(e){for(var i=Array(e.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; }","}"])+'("'+e+'", '+n+"))",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.lists_split=function(e){var i=t.JavaScript.valueToCode(e,"INPUT",t.JavaScript.ORDER_MEMBER),n=t.JavaScript.valueToCode(e,"DELIM",t.JavaScript.ORDER_NONE)||"''";if("SPLIT"==(e=e.getFieldValue("MODE")))i||(i="''"),e="split";else{if("JOIN"!=e)throw Error("Unknown mode: "+e);i||(i="[]"),e="join"}return[i+"."+e+"("+n+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.lists_reverse=function(e){return[(t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_FUNCTION_CALL)||"[]")+".slice().reverse()",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.logic={},t.JavaScript.controls_if=function(e){var i=0,n="";t.JavaScript.STATEMENT_PREFIX&&(n+=t.JavaScript.injectId(t.JavaScript.STATEMENT_PREFIX,e));do{var o=t.JavaScript.valueToCode(e,"IF"+i,t.JavaScript.ORDER_NONE)||"false",r=t.JavaScript.statementToCode(e,"DO"+i);t.JavaScript.STATEMENT_SUFFIX&&(r=t.JavaScript.prefixLines(t.JavaScript.injectId(t.JavaScript.STATEMENT_SUFFIX,e),t.JavaScript.INDENT)+r),n+=(0",GTE:">="}[e.getFieldValue("OP")],n="=="==i||"!="==i?t.JavaScript.ORDER_EQUALITY:t.JavaScript.ORDER_RELATIONAL;return[(t.JavaScript.valueToCode(e,"A",n)||"0")+" "+i+" "+(e=t.JavaScript.valueToCode(e,"B",n)||"0"),n]},t.JavaScript.logic_operation=function(e){var i="AND"==e.getFieldValue("OP")?"&&":"||",n="&&"==i?t.JavaScript.ORDER_LOGICAL_AND:t.JavaScript.ORDER_LOGICAL_OR,o=t.JavaScript.valueToCode(e,"A",n);if(e=t.JavaScript.valueToCode(e,"B",n),o||e){var r="&&"==i?"true":"false";o||(o=r),e||(e=r)}else e=o="false";return[o+" "+i+" "+e,n]},t.JavaScript.logic_negate=function(e){var i=t.JavaScript.ORDER_LOGICAL_NOT;return["!"+(t.JavaScript.valueToCode(e,"BOOL",i)||"true"),i]},t.JavaScript.logic_boolean=function(e){return["TRUE"==e.getFieldValue("BOOL")?"true":"false",t.JavaScript.ORDER_ATOMIC]},t.JavaScript.logic_null=function(e){return["null",t.JavaScript.ORDER_ATOMIC]},t.JavaScript.logic_ternary=function(e){return[(t.JavaScript.valueToCode(e,"IF",t.JavaScript.ORDER_CONDITIONAL)||"false")+" ? "+(t.JavaScript.valueToCode(e,"THEN",t.JavaScript.ORDER_CONDITIONAL)||"null")+" : "+(e=t.JavaScript.valueToCode(e,"ELSE",t.JavaScript.ORDER_CONDITIONAL)||"null"),t.JavaScript.ORDER_CONDITIONAL]},t.JavaScript.loops={},t.JavaScript.controls_repeat_ext=function(e){var i=e.getField("TIMES")?String(Number(e.getFieldValue("TIMES"))):t.JavaScript.valueToCode(e,"TIMES",t.JavaScript.ORDER_ASSIGNMENT)||"0",n=t.JavaScript.statementToCode(e,"DO");n=t.JavaScript.addLoopTrap(n,e),e="";var o=t.JavaScript.nameDB_.getDistinctName("count",t.VARIABLE_CATEGORY_NAME),r=i;return i.match(/^\w+$/)||t.isNumber(i)||(e+="var "+(r=t.JavaScript.nameDB_.getDistinctName("repeat_end",t.VARIABLE_CATEGORY_NAME))+" = "+i+";\n"),e+"for (var "+o+" = 0; "+o+" < "+r+"; "+o+"++) {\n"+n+"}\n"},t.JavaScript.controls_repeat=t.JavaScript.controls_repeat_ext,t.JavaScript.controls_whileUntil=function(e){var i="UNTIL"==e.getFieldValue("MODE"),n=t.JavaScript.valueToCode(e,"BOOL",i?t.JavaScript.ORDER_LOGICAL_NOT:t.JavaScript.ORDER_NONE)||"false",o=t.JavaScript.statementToCode(e,"DO");return o=t.JavaScript.addLoopTrap(o,e),i&&(n="!"+n),"while ("+n+") {\n"+o+"}\n"},t.JavaScript.controls_for=function(e){var i=t.JavaScript.nameDB_.getName(e.getFieldValue("VAR"),t.VARIABLE_CATEGORY_NAME),n=t.JavaScript.valueToCode(e,"FROM",t.JavaScript.ORDER_ASSIGNMENT)||"0",o=t.JavaScript.valueToCode(e,"TO",t.JavaScript.ORDER_ASSIGNMENT)||"0",r=t.JavaScript.valueToCode(e,"BY",t.JavaScript.ORDER_ASSIGNMENT)||"1",s=t.JavaScript.statementToCode(e,"DO");if(s=t.JavaScript.addLoopTrap(s,e),t.isNumber(n)&&t.isNumber(o)&&t.isNumber(r)){var a=Number(n)<=Number(o);e="for ("+i+" = "+n+"; "+i+(a?" <= ":" >= ")+o+"; "+i,e=(1==(i=Math.abs(Number(r)))?e+(a?"++":"--"):e+(a?" += ":" -= ")+i)+") {\n"+s+"}\n"}else e="",a=n,n.match(/^\w+$/)||t.isNumber(n)||(e+="var "+(a=t.JavaScript.nameDB_.getDistinctName(i+"_start",t.VARIABLE_CATEGORY_NAME))+" = "+n+";\n"),n=o,o.match(/^\w+$/)||t.isNumber(o)||(e+="var "+(n=t.JavaScript.nameDB_.getDistinctName(i+"_end",t.VARIABLE_CATEGORY_NAME))+" = "+o+";\n"),e+="var "+(o=t.JavaScript.nameDB_.getDistinctName(i+"_inc",t.VARIABLE_CATEGORY_NAME))+" = ",e=(e=t.isNumber(r)?e+(Math.abs(r)+";\n"):e+"Math.abs("+r+");\n")+"if ("+a+" > "+n+") {\n"+(t.JavaScript.INDENT+o)+" = -"+o+";\n",e+="}\n",e+="for ("+i+" = "+a+"; "+o+" >= 0 ? "+i+" <= "+n+" : "+i+" >= "+n+"; "+i+" += "+o+") {\n"+s+"}\n";return e},t.JavaScript.controls_forEach=function(e){var i=t.JavaScript.nameDB_.getName(e.getFieldValue("VAR"),t.VARIABLE_CATEGORY_NAME),n=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_ASSIGNMENT)||"[]",o=t.JavaScript.statementToCode(e,"DO");o=t.JavaScript.addLoopTrap(o,e),e="";var r=n;return n.match(/^\w+$/)||(e+="var "+(r=t.JavaScript.nameDB_.getDistinctName(i+"_list",t.VARIABLE_CATEGORY_NAME))+" = "+n+";\n"),e+"for (var "+(n=t.JavaScript.nameDB_.getDistinctName(i+"_index",t.VARIABLE_CATEGORY_NAME))+" in "+r+") {\n"+(o=t.JavaScript.INDENT+i+" = "+r+"["+n+"];\n"+o)+"}\n"},t.JavaScript.controls_flow_statements=function(e){var i="";if(t.JavaScript.STATEMENT_PREFIX&&(i+=t.JavaScript.injectId(t.JavaScript.STATEMENT_PREFIX,e)),t.JavaScript.STATEMENT_SUFFIX&&(i+=t.JavaScript.injectId(t.JavaScript.STATEMENT_SUFFIX,e)),t.JavaScript.STATEMENT_PREFIX){var n=t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(e);n&&!n.suppressPrefixSuffix&&(i+=t.JavaScript.injectId(t.JavaScript.STATEMENT_PREFIX,n))}switch(e.getFieldValue("FLOW")){case"BREAK":return i+"break;\n";case"CONTINUE":return i+"continue;\n"}throw Error("Unknown flow statement.")},t.JavaScript.math={},t.JavaScript.math_number=function(e){return[e=Number(e.getFieldValue("NUM")),0<=e?t.JavaScript.ORDER_ATOMIC:t.JavaScript.ORDER_UNARY_NEGATION]},t.JavaScript.math_arithmetic=function(e){var i={ADD:[" + ",t.JavaScript.ORDER_ADDITION],MINUS:[" - ",t.JavaScript.ORDER_SUBTRACTION],MULTIPLY:[" * ",t.JavaScript.ORDER_MULTIPLICATION],DIVIDE:[" / ",t.JavaScript.ORDER_DIVISION],POWER:[null,t.JavaScript.ORDER_NONE]}[e.getFieldValue("OP")],n=i[0];i=i[1];var o=t.JavaScript.valueToCode(e,"A",i)||"0";return e=t.JavaScript.valueToCode(e,"B",i)||"0",n?[o+n+e,i]:["Math.pow("+o+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_single=function(e){var i=e.getFieldValue("OP");if("NEG"==i)return"-"==(e=t.JavaScript.valueToCode(e,"NUM",t.JavaScript.ORDER_UNARY_NEGATION)||"0")[0]&&(e=" "+e),["-"+e,t.JavaScript.ORDER_UNARY_NEGATION];switch(e="SIN"==i||"COS"==i||"TAN"==i?t.JavaScript.valueToCode(e,"NUM",t.JavaScript.ORDER_DIVISION)||"0":t.JavaScript.valueToCode(e,"NUM",t.JavaScript.ORDER_NONE)||"0",i){case"ABS":var n="Math.abs("+e+")";break;case"ROOT":n="Math.sqrt("+e+")";break;case"LN":n="Math.log("+e+")";break;case"EXP":n="Math.exp("+e+")";break;case"POW10":n="Math.pow(10,"+e+")";break;case"ROUND":n="Math.round("+e+")";break;case"ROUNDUP":n="Math.ceil("+e+")";break;case"ROUNDDOWN":n="Math.floor("+e+")";break;case"SIN":n="Math.sin("+e+" / 180 * Math.PI)";break;case"COS":n="Math.cos("+e+" / 180 * Math.PI)";break;case"TAN":n="Math.tan("+e+" / 180 * Math.PI)"}if(n)return[n,t.JavaScript.ORDER_FUNCTION_CALL];switch(i){case"LOG10":n="Math.log("+e+") / Math.log(10)";break;case"ASIN":n="Math.asin("+e+") / Math.PI * 180";break;case"ACOS":n="Math.acos("+e+") / Math.PI * 180";break;case"ATAN":n="Math.atan("+e+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+i)}return[n,t.JavaScript.ORDER_DIVISION]},t.JavaScript.math_constant=function(e){return{PI:["Math.PI",t.JavaScript.ORDER_MEMBER],E:["Math.E",t.JavaScript.ORDER_MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",t.JavaScript.ORDER_DIVISION],SQRT2:["Math.SQRT2",t.JavaScript.ORDER_MEMBER],SQRT1_2:["Math.SQRT1_2",t.JavaScript.ORDER_MEMBER],INFINITY:["Infinity",t.JavaScript.ORDER_ATOMIC]}[e.getFieldValue("CONSTANT")]},t.JavaScript.math_number_property=function(e){var i=t.JavaScript.valueToCode(e,"NUMBER_TO_CHECK",t.JavaScript.ORDER_MODULUS)||"0",n=e.getFieldValue("PROPERTY");if("PRIME"==n)return[t.JavaScript.provideFunction_("mathIsPrime",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(n) {"," // https://en.wikipedia.org/wiki/Primality_test#Naive_methods"," if (n == 2 || n == 3) {"," return true;"," }"," // False if n is NaN, negative, is 1, or not whole."," // And false if n is divisible by 2 or 3."," if (isNaN(n) || n <= 1 || n % 1 != 0 || n % 2 == 0 || n % 3 == 0) {"," return false;"," }"," // Check all the numbers of form 6k +/- 1, up to sqrt(n)."," for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {"," if (n % (x - 1) == 0 || n % (x + 1) == 0) {"," return false;"," }"," }"," return true;","}"])+"("+i+")",t.JavaScript.ORDER_FUNCTION_CALL];switch(n){case"EVEN":var o=i+" % 2 == 0";break;case"ODD":o=i+" % 2 == 1";break;case"WHOLE":o=i+" % 1 == 0";break;case"POSITIVE":o=i+" > 0";break;case"NEGATIVE":o=i+" < 0";break;case"DIVISIBLE_BY":o=i+" % "+(e=t.JavaScript.valueToCode(e,"DIVISOR",t.JavaScript.ORDER_MODULUS)||"0")+" == 0"}return[o,t.JavaScript.ORDER_EQUALITY]},t.JavaScript.math_change=function(e){var i=t.JavaScript.valueToCode(e,"DELTA",t.JavaScript.ORDER_ADDITION)||"0";return(e=t.JavaScript.nameDB_.getName(e.getFieldValue("VAR"),t.VARIABLE_CATEGORY_NAME))+" = (typeof "+e+" == 'number' ? "+e+" : 0) + "+i+";\n"},t.JavaScript.math_round=t.JavaScript.math_single,t.JavaScript.math_trig=t.JavaScript.math_single,t.JavaScript.math_on_list=function(e){var i=e.getFieldValue("OP");switch(i){case"SUM":e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_MEMBER)||"[]",e+=".reduce(function(x, y) {return x + y;})";break;case"MIN":e="Math.min.apply(null, "+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"MAX":e="Math.max.apply(null, "+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"AVERAGE":e=(i=t.JavaScript.provideFunction_("mathMean",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"MEDIAN":e=(i=t.JavaScript.provideFunction_("mathMedian",["function "+t.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];"," }","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"MODE":e=(i=t.JavaScript.provideFunction_("mathModes",["function "+t.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;","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"STD_DEV":e=(i=t.JavaScript.provideFunction_("mathStandardDeviation",["function "+t.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);","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"RANDOM":e=(i=t.JavaScript.provideFunction_("mathRandomList",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;default:throw Error("Unknown operator: "+i)}return[e,t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_modulo=function(e){return[(t.JavaScript.valueToCode(e,"DIVIDEND",t.JavaScript.ORDER_MODULUS)||"0")+" % "+(e=t.JavaScript.valueToCode(e,"DIVISOR",t.JavaScript.ORDER_MODULUS)||"0"),t.JavaScript.ORDER_MODULUS]},t.JavaScript.math_constrain=function(e){return["Math.min(Math.max("+(t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_NONE)||"0")+", "+(t.JavaScript.valueToCode(e,"LOW",t.JavaScript.ORDER_NONE)||"0")+"), "+(e=t.JavaScript.valueToCode(e,"HIGH",t.JavaScript.ORDER_NONE)||"Infinity")+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_random_int=function(e){var i=t.JavaScript.valueToCode(e,"FROM",t.JavaScript.ORDER_NONE)||"0";return e=t.JavaScript.valueToCode(e,"TO",t.JavaScript.ORDER_NONE)||"0",[t.JavaScript.provideFunction_("mathRandomInt",["function "+t.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);","}"])+"("+i+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_random_float=function(e){return["Math.random()",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_atan2=function(e){var i=t.JavaScript.valueToCode(e,"X",t.JavaScript.ORDER_NONE)||"0";return["Math.atan2("+(t.JavaScript.valueToCode(e,"Y",t.JavaScript.ORDER_NONE)||"0")+", "+i+") / Math.PI * 180",t.JavaScript.ORDER_DIVISION]},t.JavaScript.procedures={},t.JavaScript.procedures_defreturn=function(e){var i=t.JavaScript.nameDB_.getName(e.getFieldValue("NAME"),t.PROCEDURE_CATEGORY_NAME),n="";t.JavaScript.STATEMENT_PREFIX&&(n+=t.JavaScript.injectId(t.JavaScript.STATEMENT_PREFIX,e)),t.JavaScript.STATEMENT_SUFFIX&&(n+=t.JavaScript.injectId(t.JavaScript.STATEMENT_SUFFIX,e)),n&&(n=t.JavaScript.prefixLines(n,t.JavaScript.INDENT));var o="";t.JavaScript.INFINITE_LOOP_TRAP&&(o=t.JavaScript.prefixLines(t.JavaScript.injectId(t.JavaScript.INFINITE_LOOP_TRAP,e),t.JavaScript.INDENT));var r=t.JavaScript.statementToCode(e,"STACK"),s=t.JavaScript.valueToCode(e,"RETURN",t.JavaScript.ORDER_NONE)||"",a="";r&&s&&(a=n),s&&(s=t.JavaScript.INDENT+"return "+s+";\n");for(var l=[],c=e.getVars(),u=0;u=200&&t<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],function(t){l.headers[t]={}}),n.forEach(["post","put","patch"],function(t){l.headers[t]=n.merge(r)}),t.exports=l}).call(e,i("W2nU"))},Kh4W:function(t,e,i){e.f=i("dSzd")},L42u:function(t,e,i){var n,o,r,s=i("+ZMJ"),a=i("knuC"),l=i("RPLV"),c=i("ON07"),u=i("7KvD"),h=u.process,p=u.setImmediate,d=u.clearImmediate,f=u.MessageChannel,g=u.Dispatch,_=0,m={},v=function(){var t=+this;if(m.hasOwnProperty(t)){var e=m[t];delete m[t],e()}},y=function(t){v.call(t.data)};p&&d||(p=function(t){for(var e=[],i=1;arguments.length>i;)e.push(arguments[i++]);return m[++_]=function(){a("function"==typeof t?t:Function(t),e)},n(_),_},d=function(t){delete m[t]},"process"==i("R9M2")(h)?n=function(t){h.nextTick(s(v,t,1))}:g&&g.now?n=function(t){g.now(s(v,t,1))}:f?(r=(o=new f).port2,o.port1.onmessage=y,n=s(r.postMessage,r,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(n=function(t){u.postMessage(t+"","*")},u.addEventListener("message",y,!1)):n="onreadystatechange"in c("script")?function(t){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),v.call(t)}}:function(t){setTimeout(s(v,t,1),0)}),t.exports={set:p,clear:d}},LKZe:function(t,e,i){var n=i("NpIQ"),o=i("X8DO"),r=i("TcQ7"),s=i("MmMw"),a=i("D2L2"),l=i("SfB7"),c=Object.getOwnPropertyDescriptor;e.f=i("+E39")?c:function(t,e){if(t=r(t),e=s(e,!0),l)try{return c(t,e)}catch(t){}if(a(t,e))return o(!n.f.call(t,e),t[e])}},M6a0:function(t,e){},MU5D:function(t,e,i){var n=i("R9M2");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},Mhyx:function(t,e,i){var n=i("/bQp"),o=i("dSzd")("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||r[o]===t)}},MmMw:function(t,e,i){var n=i("EqjI");t.exports=function(t,e){if(!n(t))return t;var i,o;if(e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;if("function"==typeof(i=t.valueOf)&&!n(o=i.call(t)))return o;if(!e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},NMof:function(t,e,i){"use strict";var n,o;"function"==typeof Symbol&&Symbol.iterator;void 0===(o="function"==typeof(n=function(){var t=window,e={placement:"bottom",gpuAcceleration:!0,offset:0,boundariesElement:"viewport",boundariesPadding:5,preventOverflowOrder:["left","right","top","bottom"],flipBehavior:"flip",arrowElement:"[x-arrow]",arrowOffset:0,modifiers:["shift","offset","preventOverflow","keepTogether","arrow","flip","applyStyle"],modifiersIgnored:[],forceAbsolute:!1};function i(t,i,n){this._reference=t.jquery?t[0]:t,this.state={};var o=void 0===i||null===i,r=i&&"[object Object]"===Object.prototype.toString.call(i);return this._popper=o||r?this.parse(r?i:{}):i.jquery?i[0]:i,this._options=Object.assign({},e,n),this._options.modifiers=this._options.modifiers.map(function(t){if(-1===this._options.modifiersIgnored.indexOf(t))return"applyStyle"===t&&this._popper.setAttribute("x-placement",this._options.placement),this.modifiers[t]||t}.bind(this)),this.state.position=this._getPosition(this._popper,this._reference),u(this._popper,{position:this.state.position,top:0}),this.update(),this._setupEventListeners(),this}function n(e){var i=e.style.display,n=e.style.visibility;e.style.display="block",e.style.visibility="hidden";e.offsetWidth;var o=t.getComputedStyle(e),r=parseFloat(o.marginTop)+parseFloat(o.marginBottom),s=parseFloat(o.marginLeft)+parseFloat(o.marginRight),a={width:e.offsetWidth+s,height:e.offsetHeight+r};return e.style.display=i,e.style.visibility=n,a}function o(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 r(t){var e=Object.assign({},t);return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function s(t,e){var i,n=0;for(i in t){if(t[i]===e)return n;n++}return null}function a(e,i){return t.getComputedStyle(e,null)[i]}function l(e){var i=e.offsetParent;return i!==t.document.body&&i?i:t.document.documentElement}function c(e){var i=e.parentNode;return i?i===t.document?t.document.body.scrollTop||t.document.body.scrollLeft?t.document.body:t.document.documentElement:-1!==["scroll","auto"].indexOf(a(i,"overflow"))||-1!==["scroll","auto"].indexOf(a(i,"overflow-x"))||-1!==["scroll","auto"].indexOf(a(i,"overflow-y"))?i:c(e.parentNode):e}function u(t,e){Object.keys(e).forEach(function(i){var n,o="";-1!==["width","height","top","right","bottom","left"].indexOf(i)&&(""!==(n=e[i])&&!isNaN(parseFloat(n))&&isFinite(n))&&(o="px"),t.style[i]=e[i]+o})}function h(t){var e={width:t.offsetWidth,height:t.offsetHeight,left:t.offsetLeft,top:t.offsetTop};return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function p(t){var e=t.getBoundingClientRect(),i=-1!=navigator.userAgent.indexOf("MSIE")&&"HTML"===t.tagName?-t.scrollTop:e.top;return{left:e.left,top:i,right:e.right,bottom:e.bottom,width:e.right-e.left,height:e.bottom-i}}function d(e){for(var i=["","ms","webkit","moz","o"],n=0;n1&&console.warn("WARNING: the given `parent` query("+e.parent+") matched more than one element, the first one will be used"),0===s.length)throw"ERROR: the given `parent` doesn't exists!";s=s[0]}return s.length>1&&s instanceof Element==!1&&(console.warn("WARNING: you have passed as parent a list of elements, the first one will be used"),s=s[0]),s.appendChild(o),o;function a(t,e){e.forEach(function(e){t.classList.add(e)})}function l(t,e){e.forEach(function(e){t.setAttribute(e.split(":")[0],e.split(":")[1]||"")})}},i.prototype._getPosition=function(e,i){l(i);return this._options.forceAbsolute?"absolute":function e(i){if(i===t.document.body)return!1;if("fixed"===a(i,"position"))return!0;return i.parentNode?e(i.parentNode):i}(i)?"fixed":"absolute"},i.prototype._getOffsets=function(t,e,i){i=i.split("-")[0];var o={};o.position=this.state.position;var r="fixed"===o.position,s=function(t,e,i){var n=p(t),o=p(e);if(i){var r=c(e);o.top+=r.scrollTop,o.bottom+=r.scrollTop,o.left+=r.scrollLeft,o.right+=r.scrollLeft}return{top:n.top-o.top,left:n.left-o.left,bottom:n.top-o.top+n.height,right:n.left-o.left+n.width,width:n.width,height:n.height}}(e,l(t),r),a=n(t);return-1!==["right","left"].indexOf(i)?(o.top=s.top+s.height/2-a.height/2,o.left="left"===i?s.left-a.width:s.right):(o.left=s.left+s.width/2-a.width/2,o.top="top"===i?s.top-a.height:s.bottom),o.width=a.width,o.height=a.height,{popper:o,reference:s}},i.prototype._setupEventListeners=function(){if(this.state.updateBound=this.update.bind(this),t.addEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement){var e=c(this._reference);e!==t.document.body&&e!==t.document.documentElement||(e=t),e.addEventListener("scroll",this.state.updateBound),this.state.scrollTarget=e}},i.prototype._removeEventListeners=function(){t.removeEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement&&this.state.scrollTarget&&(this.state.scrollTarget.removeEventListener("scroll",this.state.updateBound),this.state.scrollTarget=null),this.state.updateBound=null},i.prototype._getBoundaries=function(e,i,n){var o,r,s={};if("window"===n){var a=t.document.body,u=t.document.documentElement;o=Math.max(a.scrollHeight,a.offsetHeight,u.clientHeight,u.scrollHeight,u.offsetHeight),s={top:0,right:Math.max(a.scrollWidth,a.offsetWidth,u.clientWidth,u.scrollWidth,u.offsetWidth),bottom:o,left:0}}else if("viewport"===n){var p=l(this._popper),d=c(this._popper),f=h(p),g="fixed"===e.offsets.popper.position?0:(r=d)==document.body?Math.max(document.documentElement.scrollTop,document.body.scrollTop):r.scrollTop,_="fixed"===e.offsets.popper.position?0:function(t){return t==document.body?Math.max(document.documentElement.scrollLeft,document.body.scrollLeft):t.scrollLeft}(d);s={top:0-(f.top-g),right:t.document.documentElement.clientWidth-(f.left-_),bottom:t.document.documentElement.clientHeight-(f.top-g),left:0-(f.left-_)}}else s=l(this._popper)===n?{top:0,left:0,right:n.clientWidth,bottom:n.clientHeight}:h(n);return s.left+=i,s.right-=i,s.top=s.top+i,s.bottom=s.bottom-i,s},i.prototype.runModifiers=function(t,e,i){var n=e.slice();return void 0!==i&&(n=this._options.modifiers.slice(0,s(this._options.modifiers,i))),n.forEach(function(e){var i;(i=e)&&"[object Function]"==={}.toString.call(i)&&(t=e.call(this,t))}.bind(this)),t},i.prototype.isModifierRequired=function(t,e){var i=s(this._options.modifiers,t);return!!this._options.modifiers.slice(0,i).filter(function(t){return t===e}).length},i.prototype.modifiers={},i.prototype.modifiers.applyStyle=function(t){var e,i={position:t.offsets.popper.position},n=Math.round(t.offsets.popper.left),o=Math.round(t.offsets.popper.top);return this._options.gpuAcceleration&&(e=d("transform"))?(i[e]="translate3d("+n+"px, "+o+"px, 0)",i.top=0,i.left=0):(i.left=n,i.top=o),Object.assign(i,t.styles),u(this._popper,i),this._popper.setAttribute("x-placement",t.placement),this.isModifierRequired(this.modifiers.applyStyle,this.modifiers.arrow)&&t.offsets.arrow&&u(t.arrowElement,t.offsets.arrow),t},i.prototype.modifiers.shift=function(t){var e=t.placement,i=e.split("-")[0],n=e.split("-")[1];if(n){var o=t.offsets.reference,s=r(t.offsets.popper),a={y:{start:{top:o.top},end:{top:o.top+o.height-s.height}},x:{start:{left:o.left},end:{left:o.left+o.width-s.width}}},l=-1!==["bottom","top"].indexOf(i)?"x":"y";t.offsets.popper=Object.assign(s,a[l][n])}return t},i.prototype.modifiers.preventOverflow=function(t){var e=this._options.preventOverflowOrder,i=r(t.offsets.popper),n={left:function(){var e=i.left;return i.leftt.boundaries.right&&(e=Math.min(i.left,t.boundaries.right-i.width)),{left:e}},top:function(){var e=i.top;return i.topt.boundaries.bottom&&(e=Math.min(i.top,t.boundaries.bottom-i.height)),{top:e}}};return e.forEach(function(e){t.offsets.popper=Object.assign(i,n[e]())}),t},i.prototype.modifiers.keepTogether=function(t){var e=r(t.offsets.popper),i=t.offsets.reference,n=Math.floor;return e.rightn(i.right)&&(t.offsets.popper.left=n(i.right)),e.bottomn(i.bottom)&&(t.offsets.popper.top=n(i.bottom)),t},i.prototype.modifiers.flip=function(t){if(!this.isModifierRequired(this.modifiers.flip,this.modifiers.preventOverflow))return console.warn("WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!"),t;if(t.flipped&&t.placement===t._originalPlacement)return t;var e=t.placement.split("-")[0],i=o(e),n=t.placement.split("-")[1]||"",s=[];return(s="flip"===this._options.flipBehavior?[e,i]:this._options.flipBehavior).forEach(function(a,l){if(e===a&&s.length!==l+1){e=t.placement.split("-")[0],i=o(e);var c=r(t.offsets.popper),u=-1!==["right","bottom"].indexOf(e);(u&&Math.floor(t.offsets.reference[e])>Math.floor(c[i])||!u&&Math.floor(t.offsets.reference[e])a[d]&&(t.offsets.popper[h]+=l[h]+f-a[d]);var g=l[h]+(i||l[u]/2-f/2)-a[h];return g=Math.max(Math.min(a[u]-f-8,g),8),o[h]=g,o[p]="",t.offsets.arrow=o,t.arrowElement=e,t},Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),i=1;iy;y++)if((_=e?v(s(f=t[y])[0],f[1]):v(t[y]))===c||_===u)return _}else for(g=m.call(t);!(f=g.next()).done;)if((_=o(g,v,f.value,e))===c||_===u)return _}).BREAK=c,e.RETURN=u},NYxO:function(t,e,i){"use strict";(function(t){var i=("undefined"!=typeof window?window:void 0!==t?t:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function n(t,e){if(void 0===e&&(e=[]),null===t||"object"!=typeof t)return t;var i,o=(i=function(e){return e.original===t},e.filter(i)[0]);if(o)return o.copy;var r=Array.isArray(t)?[]:{};return e.push({original:t,copy:r}),Object.keys(t).forEach(function(i){r[i]=n(t[i],e)}),r}function o(t,e){Object.keys(t).forEach(function(i){return e(t[i],i)})}function r(t){return null!==t&&"object"==typeof t}var s=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var i=t.state;this.state=("function"==typeof i?i():i)||{}},a={namespaced:{configurable:!0}};a.namespaced.get=function(){return!!this._rawModule.namespaced},s.prototype.addChild=function(t,e){this._children[t]=e},s.prototype.removeChild=function(t){delete this._children[t]},s.prototype.getChild=function(t){return this._children[t]},s.prototype.hasChild=function(t){return t in this._children},s.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},s.prototype.forEachChild=function(t){o(this._children,t)},s.prototype.forEachGetter=function(t){this._rawModule.getters&&o(this._rawModule.getters,t)},s.prototype.forEachAction=function(t){this._rawModule.actions&&o(this._rawModule.actions,t)},s.prototype.forEachMutation=function(t){this._rawModule.mutations&&o(this._rawModule.mutations,t)},Object.defineProperties(s.prototype,a);var l=function(t){this.register([],t,!1)};l.prototype.get=function(t){return t.reduce(function(t,e){return t.getChild(e)},this.root)},l.prototype.getNamespace=function(t){var e=this.root;return t.reduce(function(t,i){return t+((e=e.getChild(i)).namespaced?i+"/":"")},"")},l.prototype.update=function(t){!function t(e,i,n){0;i.update(n);if(n.modules)for(var o in n.modules){if(!i.getChild(o))return void 0;t(e.concat(o),i.getChild(o),n.modules[o])}}([],this.root,t)},l.prototype.register=function(t,e,i){var n=this;void 0===i&&(i=!0);var r=new s(e,i);0===t.length?this.root=r:this.get(t.slice(0,-1)).addChild(t[t.length-1],r);e.modules&&o(e.modules,function(e,o){n.register(t.concat(o),e,i)})},l.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),i=t[t.length-1],n=e.getChild(i);n&&n.runtime&&e.removeChild(i)},l.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),i=t[t.length-1];return!!e&&e.hasChild(i)};var c;var u=function(t){var e=this;void 0===t&&(t={}),!c&&"undefined"!=typeof window&&window.Vue&&v(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var o=t.strict;void 0===o&&(o=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new l(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new c,this._makeLocalGettersCache=Object.create(null);var r=this,s=this.dispatch,a=this.commit;this.dispatch=function(t,e){return s.call(r,t,e)},this.commit=function(t,e,i){return a.call(r,t,e,i)},this.strict=o;var u=this._modules.root.state;g(this,u,[],this._modules.root),f(this,u),n.forEach(function(t){return t(e)}),(void 0!==t.devtools?t.devtools:c.config.devtools)&&function(t){i&&(t._devtoolHook=i,i.emit("vuex:init",t),i.on("vuex:travel-to-state",function(e){t.replaceState(e)}),t.subscribe(function(t,e){i.emit("vuex:mutation",t,e)},{prepend:!0}),t.subscribeAction(function(t,e){i.emit("vuex:action",t,e)},{prepend:!0}))}(this)},h={state:{configurable:!0}};function p(t,e,i){return e.indexOf(t)<0&&(i&&i.prepend?e.unshift(t):e.push(t)),function(){var i=e.indexOf(t);i>-1&&e.splice(i,1)}}function d(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var i=t.state;g(t,i,[],t._modules.root,!0),f(t,i,e)}function f(t,e,i){var n=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var r={};o(t._wrappedGetters,function(e,i){r[i]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,i,{get:function(){return t._vm[i]},enumerable:!0})});var s=c.config.silent;c.config.silent=!0,t._vm=new c({data:{$$state:e},computed:r}),c.config.silent=s,t.strict&&function(t){t._vm.$watch(function(){return this._data.$$state},function(){0},{deep:!0,sync:!0})}(t),n&&(i&&t._withCommit(function(){n._data.$$state=null}),c.nextTick(function(){return n.$destroy()}))}function g(t,e,i,n,o){var r=!i.length,s=t._modules.getNamespace(i);if(n.namespaced&&(t._modulesNamespaceMap[s],t._modulesNamespaceMap[s]=n),!r&&!o){var a=_(e,i.slice(0,-1)),l=i[i.length-1];t._withCommit(function(){c.set(a,l,n.state)})}var u=n.context=function(t,e,i){var n=""===e,o={dispatch:n?t.dispatch:function(i,n,o){var r=m(i,n,o),s=r.payload,a=r.options,l=r.type;return a&&a.root||(l=e+l),t.dispatch(l,s)},commit:n?t.commit:function(i,n,o){var r=m(i,n,o),s=r.payload,a=r.options,l=r.type;a&&a.root||(l=e+l),t.commit(l,s,a)}};return Object.defineProperties(o,{getters:{get:n?function(){return t.getters}:function(){return function(t,e){if(!t._makeLocalGettersCache[e]){var i={},n=e.length;Object.keys(t.getters).forEach(function(o){if(o.slice(0,n)===e){var r=o.slice(n);Object.defineProperty(i,r,{get:function(){return t.getters[o]},enumerable:!0})}}),t._makeLocalGettersCache[e]=i}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return _(t.state,i)}}}),o}(t,s,i);n.forEachMutation(function(e,i){!function(t,e,i,n){(t._mutations[e]||(t._mutations[e]=[])).push(function(e){i.call(t,n.state,e)})}(t,s+i,e,u)}),n.forEachAction(function(e,i){var n=e.root?i:s+i,o=e.handler||e;!function(t,e,i,n){(t._actions[e]||(t._actions[e]=[])).push(function(e){var o,r=i.call(t,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:t.getters,rootState:t.state},e);return(o=r)&&"function"==typeof o.then||(r=Promise.resolve(r)),t._devtoolHook?r.catch(function(e){throw t._devtoolHook.emit("vuex:error",e),e}):r})}(t,n,o,u)}),n.forEachGetter(function(e,i){!function(t,e,i,n){if(t._wrappedGetters[e])return void 0;t._wrappedGetters[e]=function(t){return i(n.state,n.getters,t.state,t.getters)}}(t,s+i,e,u)}),n.forEachChild(function(n,r){g(t,e,i.concat(r),n,o)})}function _(t,e){return e.reduce(function(t,e){return t[e]},t)}function m(t,e,i){return r(t)&&t.type&&(i=e,e=t,t=t.type),{type:t,payload:e,options:i}}function v(t){c&&t===c|| /*! * vuex v3.6.2 * (c) 2021 Evan You * @license MIT */ function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:i});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[i].concat(t.init):i,e.call(this,t)}}function i(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(c=t)}h.state.get=function(){return this._vm._data.$$state},h.state.set=function(t){0},u.prototype.commit=function(t,e,i){var n=this,o=m(t,e,i),r=o.type,s=o.payload,a=(o.options,{type:r,payload:s}),l=this._mutations[r];l&&(this._withCommit(function(){l.forEach(function(t){t(s)})}),this._subscribers.slice().forEach(function(t){return t(a,n.state)}))},u.prototype.dispatch=function(t,e){var i=this,n=m(t,e),o=n.type,r=n.payload,s={type:o,payload:r},a=this._actions[o];if(a){try{this._actionSubscribers.slice().filter(function(t){return t.before}).forEach(function(t){return t.before(s,i.state)})}catch(t){0}var l=a.length>1?Promise.all(a.map(function(t){return t(r)})):a[0](r);return new Promise(function(t,e){l.then(function(e){try{i._actionSubscribers.filter(function(t){return t.after}).forEach(function(t){return t.after(s,i.state)})}catch(t){0}t(e)},function(t){try{i._actionSubscribers.filter(function(t){return t.error}).forEach(function(e){return e.error(s,i.state,t)})}catch(t){0}e(t)})})}},u.prototype.subscribe=function(t,e){return p(t,this._subscribers,e)},u.prototype.subscribeAction=function(t,e){return p("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},u.prototype.watch=function(t,e,i){var n=this;return this._watcherVM.$watch(function(){return t(n.state,n.getters)},e,i)},u.prototype.replaceState=function(t){var e=this;this._withCommit(function(){e._vm._data.$$state=t})},u.prototype.registerModule=function(t,e,i){void 0===i&&(i={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),g(this,this.state,t,this._modules.get(t),i.preserveState),f(this,this.state)},u.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var i=_(e.state,t.slice(0,-1));c.delete(i,t[t.length-1])}),d(this)},u.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},u.prototype.hotUpdate=function(t){this._modules.update(t),d(this,!0)},u.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(u.prototype,h);var y=S(function(t,e){var i={};return C(e).forEach(function(e){var n=e.key,o=e.val;i[n]=function(){var e=this.$store.state,i=this.$store.getters;if(t){var n=k(this.$store,"mapState",t);if(!n)return;e=n.context.state,i=n.context.getters}return"function"==typeof o?o.call(this,e,i):e[o]},i[n].vuex=!0}),i}),b=S(function(t,e){var i={};return C(e).forEach(function(e){var n=e.key,o=e.val;i[n]=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];var n=this.$store.commit;if(t){var r=k(this.$store,"mapMutations",t);if(!r)return;n=r.context.commit}return"function"==typeof o?o.apply(this,[n].concat(e)):n.apply(this.$store,[o].concat(e))}}),i}),T=S(function(t,e){var i={};return C(e).forEach(function(e){var n=e.key,o=e.val;o=t+o,i[n]=function(){if(!t||k(this.$store,"mapGetters",t))return this.$store.getters[o]},i[n].vuex=!0}),i}),E=S(function(t,e){var i={};return C(e).forEach(function(e){var n=e.key,o=e.val;i[n]=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];var n=this.$store.dispatch;if(t){var r=k(this.$store,"mapActions",t);if(!r)return;n=r.context.dispatch}return"function"==typeof o?o.apply(this,[n].concat(e)):n.apply(this.$store,[o].concat(e))}}),i});function C(t){return function(t){return Array.isArray(t)||r(t)}(t)?Array.isArray(t)?t.map(function(t){return{key:t,val:t}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}}):[]}function S(t){return function(e,i){return"string"!=typeof e?(i=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,i)}}function k(t,e,i){return t._modulesNamespaceMap[i]}function O(t,e,i){var n=i?t.groupCollapsed:t.group;try{n.call(t,e)}catch(i){t.log(e)}}function I(t){try{t.groupEnd()}catch(e){t.log("—— log end ——")}}function w(){var t=new Date;return" @ "+R(t.getHours(),2)+":"+R(t.getMinutes(),2)+":"+R(t.getSeconds(),2)+"."+R(t.getMilliseconds(),3)}function R(t,e){return i="0",n=e-t.toString().length,new Array(n+1).join(i)+t;var i,n}var D={Store:u,install:v,version:"3.6.2",mapState:y,mapMutations:b,mapGetters:T,mapActions:E,createNamespacedHelpers:function(t){return{mapState:y.bind(null,t),mapGetters:T.bind(null,t),mapMutations:b.bind(null,t),mapActions:E.bind(null,t)}},createLogger:function(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var i=t.filter;void 0===i&&(i=function(t,e,i){return!0});var o=t.transformer;void 0===o&&(o=function(t){return t});var r=t.mutationTransformer;void 0===r&&(r=function(t){return t});var s=t.actionFilter;void 0===s&&(s=function(t,e){return!0});var a=t.actionTransformer;void 0===a&&(a=function(t){return t});var l=t.logMutations;void 0===l&&(l=!0);var c=t.logActions;void 0===c&&(c=!0);var u=t.logger;return void 0===u&&(u=console),function(t){var h=n(t.state);void 0!==u&&(l&&t.subscribe(function(t,s){var a=n(s);if(i(t,h,a)){var l=w(),c=r(t),p="mutation "+t.type+l;O(u,p,e),u.log("%c prev state","color: #9E9E9E; font-weight: bold",o(h)),u.log("%c mutation","color: #03A9F4; font-weight: bold",c),u.log("%c next state","color: #4CAF50; font-weight: bold",o(a)),I(u)}h=a}),c&&t.subscribeAction(function(t,i){if(s(t,i)){var n=w(),o=a(t),r="action "+t.type+n;O(u,r,e),u.log("%c action","color: #03A9F4; font-weight: bold",o),I(u)}}))}}};e.a=D}).call(e,i("DuR2"))},NpIQ:function(t,e){e.f={}.propertyIsEnumerable},O4g8:function(t,e){t.exports=!0},OAzY:function(t,e,i){"use strict";e.__esModule=!0;var n,o=i("7+uW"),r=(n=o)&&n.__esModule?n:{default:n},s=i("2kvA");var a=!1,l=!1,c=void 0,u=function(){if(!r.default.prototype.$isServer){var t=p.modalDom;return t?a=!0:(a=!1,t=document.createElement("div"),p.modalDom=t,t.addEventListener("touchmove",function(t){t.preventDefault(),t.stopPropagation()}),t.addEventListener("click",function(){p.doOnModalClick&&p.doOnModalClick()})),t}},h={},p={modalFade:!0,getInstance:function(t){return h[t]},register:function(t,e){t&&e&&(h[t]=e)},deregister:function(t){t&&(h[t]=null,delete h[t])},nextZIndex:function(){return p.zIndex++},modalStack:[],doOnModalClick:function(){var t=p.modalStack[p.modalStack.length-1];if(t){var e=p.getInstance(t.id);e&&e.closeOnClickModal&&e.close()}},openModal:function(t,e,i,n,o){if(!r.default.prototype.$isServer&&t&&void 0!==e){this.modalFade=o;for(var l=this.modalStack,c=0,h=l.length;c0){var n=e[e.length-1];if(n.id===t){if(n.modalClass)n.modalClass.trim().split(/\s+/).forEach(function(t){return(0,s.removeClass)(i,t)});e.pop(),e.length>0&&(i.style.zIndex=e[e.length-1].zIndex)}else for(var o=e.length-1;o>=0;o--)if(e[o].id===t){e.splice(o,1);break}}0===e.length&&(this.modalFade&&(0,s.addClass)(i,"v-modal-leave"),setTimeout(function(){0===e.length&&(i.parentNode&&i.parentNode.removeChild(i),i.style.display="none",p.modalDom=void 0),(0,s.removeClass)(i,"v-modal-leave")},200))}};Object.defineProperty(p,"zIndex",{configurable:!0,get:function(){return l||(c=c||(r.default.prototype.$ELEMENT||{}).zIndex||2e3,l=!0),c},set:function(t){c=t}});r.default.prototype.$isServer||window.addEventListener("keydown",function(t){if(27===t.keyCode){var e=function(){if(!r.default.prototype.$isServer&&p.modalStack.length>0){var t=p.modalStack[p.modalStack.length-1];if(!t)return;return p.getInstance(t.id)}}();e&&e.closeOnPressEscape&&(e.handleClose?e.handleClose():e.handleAction?e.handleAction("cancel"):e.close())}}),e.default=p},ON07:function(t,e,i){var n=i("EqjI"),o=i("7KvD").document,r=n(o)&&n(o.createElement);t.exports=function(t){return r?o.createElement(t):{}}},ON3O:function(t,e,i){var n=i("uY1a");t.exports=function(t,e,i){return void 0===i?n(t,e,!1):n(t,i,!1!==e)}},OYls:function(t,e,i){i("crlp")("asyncIterator")},"Oi+a":function(t,e,i){"use strict";var n=i("dIwP"),o=i("qRfI");t.exports=function(t,e){return t&&!n(e)?o(t,e):e}},PzxK:function(t,e,i){var n=i("D2L2"),o=i("sB3e"),r=i("ax3d")("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),n(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},QRG4:function(t,e,i){var n=i("UuGF"),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},QUGb:function(t,e,i){var n,o,r,s;s=function(t){"use strict";return t.Blocks.colour={},t.Constants={},t.Constants.Colour={},t.Constants.Colour.HUE=20,t.defineBlocksWithJsonArray([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"},{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"},{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}]),t.Constants.Lists={},t.Constants.Lists.HUE=260,t.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}"}]),t.Blocks.lists_create_with={init:function(){this.setHelpUrl(t.Msg.LISTS_CREATE_WITH_HELPURL),this.setStyle("list_blocks"),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new t.Mutator(["lists_create_with_item"])),this.setTooltip(t.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=t.utils.xml.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var i=e.getInput("STACK").connection,n=0;n","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"]}]),t.defineBlocksWithJsonArray([{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}"}]),t.Constants.Logic.TOOLTIPS_BY_OP={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"},t.Extensions.register("logic_op_tooltip",t.Extensions.buildTooltipForDropdown("OP",t.Constants.Logic.TOOLTIPS_BY_OP)),t.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN={elseifCount_:0,elseCount_:0,suppressPrefixSuffix:!0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=t.utils.xml.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(t){this.elseifCount_=parseInt(t.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(t.getAttribute("else"),10)||0,this.rebuildShape_()},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var i=e.nextConnection,n=1;n<=this.elseifCount_;n++){var o=t.newBlock("controls_if_elseif");o.initSvg(),i.connect(o.previousConnection),i=o.nextConnection}return this.elseCount_&&((t=t.newBlock("controls_if_else")).initSvg(),i.connect(t.previousConnection)),e},compose:function(t){t=t.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;for(var e=[null],i=[null],n=null;t&&!t.isInsertionMarker();){switch(t.type){case"controls_if_elseif":this.elseifCount_++,e.push(t.valueConnection_),i.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,i,n)},saveConnections:function(t){t=t.nextConnection.targetBlock();for(var e=1;t;){switch(t.type){case"controls_if_elseif":var i=this.getInput("IF"+e),n=this.getInput("DO"+e);t.valueConnection_=i&&i.connection.targetConnection,t.statementConnection_=n&&n.connection.targetConnection,e++;break;case"controls_if_else":n=this.getInput("ELSE"),t.statementConnection_=n&&n.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+t.type)}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],i=null;this.getInput("ELSE")&&(i=this.getInput("ELSE").connection.targetConnection);for(var n=1;this.getInput("IF"+n);){var o=this.getInput("IF"+n),r=this.getInput("DO"+n);t.push(o.connection.targetConnection),e.push(r.connection.targetConnection),n++}this.updateShape_(),this.reconnectChildBlocks_(t,e,i)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck("Boolean").appendField(t.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(t.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(t.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,i,n){for(var o=1;o<=this.elseifCount_;o++)t.Mutator.reconnect(e[o],this,"IF"+o),t.Mutator.reconnect(i[o],this,"DO"+o);t.Mutator.reconnect(n,this,"ELSE")}},t.Extensions.registerMutator("controls_if_mutator",t.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN,null,["controls_if_elseif","controls_if_else"]),t.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION=function(){this.setTooltip(function(){return this.elseifCount_||this.elseCount_?!this.elseifCount_&&this.elseCount_?t.Msg.CONTROLS_IF_TOOLTIP_2:this.elseifCount_&&!this.elseCount_?t.Msg.CONTROLS_IF_TOOLTIP_3:this.elseifCount_&&this.elseCount_?t.Msg.CONTROLS_IF_TOOLTIP_4:"":t.Msg.CONTROLS_IF_TOOLTIP_1}.bind(this))},t.Extensions.register("controls_if_tooltip",t.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION),t.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN={onchange:function(e){this.prevBlocks_||(this.prevBlocks_=[null,null]);var i=this.getInputTargetBlock("A"),n=this.getInputTargetBlock("B");i&&n&&!this.workspace.connectionChecker.doTypeChecks(i.outputConnection,n.outputConnection)&&(t.Events.setGroup(e.group),(e=this.prevBlocks_[0])!==i&&(i.unplug(),!e||e.isDisposed()||e.isShadow()||this.getInput("A").connection.connect(e.outputConnection)),(i=this.prevBlocks_[1])!==n&&(n.unplug(),!i||i.isDisposed()||i.isShadow()||this.getInput("B").connection.connect(i.outputConnection)),this.bumpNeighbours(),t.Events.setGroup(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}},t.Constants.Logic.LOGIC_COMPARE_EXTENSION=function(){this.mixin(t.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN)},t.Extensions.register("logic_compare",t.Constants.Logic.LOGIC_COMPARE_EXTENSION),t.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN={prevParentConnection_:null,onchange:function(e){var i=this.getInputTargetBlock("THEN"),n=this.getInputTargetBlock("ELSE"),o=this.outputConnection.targetConnection;if((i||n)&&o)for(var r=0;2>r;r++){var s=1==r?i:n;s&&!s.workspace.connectionChecker.doTypeChecks(s.outputConnection,o)&&(t.Events.setGroup(e.group),o===this.prevParentConnection_?(this.unplug(),o.getSourceBlock().bumpNeighbours()):(s.unplug(),s.bumpNeighbours()),t.Events.setGroup(!1))}this.prevParentConnection_=o}},t.Extensions.registerMixin("logic_ternary",t.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN),t.Blocks.loops={},t.Constants.Loops={},t.Constants.Loops.HUE=120,t.defineBlocksWithJsonArray([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]),t.Constants.Loops.WHILE_UNTIL_TOOLTIPS={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"},t.Extensions.register("controls_whileUntil_tooltip",t.Extensions.buildTooltipForDropdown("MODE",t.Constants.Loops.WHILE_UNTIL_TOOLTIPS)),t.Constants.Loops.BREAK_CONTINUE_TOOLTIPS={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"},t.Extensions.register("controls_flow_tooltip",t.Extensions.buildTooltipForDropdown("FLOW",t.Constants.Loops.BREAK_CONTINUE_TOOLTIPS)),t.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(e){if(!this.isInFlyout){var i=this.getField("VAR").getVariable(),n=i.name;if(!this.isCollapsed()&&null!=n){var o={enabled:!0};o.text=t.Msg.VARIABLES_SET_CREATE_GET.replace("%1",n),i=t.Variables.generateVariableFieldDom(i),(n=t.utils.xml.createElement("block")).setAttribute("type","variables_get"),n.appendChild(i),o.callback=t.ContextMenu.callbackFactory(this,n),e.push(o)}}}},t.Extensions.registerMixin("contextMenu_newGetVariableBlock",t.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN),t.Extensions.register("controls_for_tooltip",t.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR")),t.Extensions.register("controls_forEach_tooltip",t.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR")),t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],suppressPrefixSuffix:!0,getSurroundLoop:function(e){do{if(-1!=t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.LOOP_TYPES.indexOf(e.type))return e;e=e.getSurroundParent()}while(e);return null},onchange:function(e){if(this.workspace.isDragging&&!this.workspace.isDragging()&&e.type==t.Events.BLOCK_MOVE){var i=t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(this);if(this.setWarningText(i?null:t.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),!this.isInFlyout){var n=t.Events.getGroup();t.Events.setGroup(e.group),this.setEnabled(i),t.Events.setGroup(n)}}}},t.Extensions.registerMixin("controls_flow_in_loop_check",t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN),t.Blocks.math={},t.Constants.Math={},t.Constants.Math.HUE=230,t.defineBlocksWithJsonArray([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}","MULTIPLY"],["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_TRIG_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_constant",message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["π","PI"],["e","E"],["φ","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(½)","SQRT1_2"],["∞","INFINITY"]]}],output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTANT_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTANT_HELPURL}"},{type:"math_number_property",message0:"%1 %2",args0:[{type:"input_value",name:"NUMBER_TO_CHECK",check:"Number"},{type:"field_dropdown",name:"PROPERTY",options:[["%{BKY_MATH_IS_EVEN}","EVEN"],["%{BKY_MATH_IS_ODD}","ODD"],["%{BKY_MATH_IS_PRIME}","PRIME"],["%{BKY_MATH_IS_WHOLE}","WHOLE"],["%{BKY_MATH_IS_POSITIVE}","POSITIVE"],["%{BKY_MATH_IS_NEGATIVE}","NEGATIVE"],["%{BKY_MATH_IS_DIVISIBLE_BY}","DIVISIBLE_BY"]]}],inputsInline:!0,output:"Boolean",style:"math_blocks",tooltip:"%{BKY_MATH_IS_TOOLTIP}",mutator:"math_is_divisibleby_mutator"},{type:"math_change",message0:"%{BKY_MATH_CHANGE_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_MATH_CHANGE_TITLE_ITEM}"},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,style:"variable_blocks",helpUrl:"%{BKY_MATH_CHANGE_HELPURL}",extensions:["math_change_tooltip"]},{type:"math_round",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ROUND_OPERATOR_ROUND}","ROUND"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}","ROUNDUP"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}","ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ROUND_HELPURL}",tooltip:"%{BKY_MATH_ROUND_TOOLTIP}"},{type:"math_on_list",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ONLIST_OPERATOR_SUM}","SUM"],["%{BKY_MATH_ONLIST_OPERATOR_MIN}","MIN"],["%{BKY_MATH_ONLIST_OPERATOR_MAX}","MAX"],["%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}","AVERAGE"],["%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}","MEDIAN"],["%{BKY_MATH_ONLIST_OPERATOR_MODE}","MODE"],["%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}","STD_DEV"],["%{BKY_MATH_ONLIST_OPERATOR_RANDOM}","RANDOM"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ONLIST_HELPURL}",mutator:"math_modes_of_list_mutator",extensions:["math_op_tooltip"]},{type:"math_modulo",message0:"%{BKY_MATH_MODULO_TITLE}",args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_MODULO_TOOLTIP}",helpUrl:"%{BKY_MATH_MODULO_HELPURL}"},{type:"math_constrain",message0:"%{BKY_MATH_CONSTRAIN_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTRAIN_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTRAIN_HELPURL}"},{type:"math_random_int",message0:"%{BKY_MATH_RANDOM_INT_TITLE}",args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_INT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_INT_HELPURL}"},{type:"math_random_float",message0:"%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}",output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_FLOAT_HELPURL}"},{type:"math_atan2",message0:"%{BKY_MATH_ATAN2_TITLE}",args0:[{type:"input_value",name:"X",check:"Number"},{type:"input_value",name:"Y",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_ATAN2_TOOLTIP}",helpUrl:"%{BKY_MATH_ATAN2_HELPURL}"}]),t.Constants.Math.TOOLTIPS_BY_OP={ADD:"%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}",MINUS:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}",MULTIPLY:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}",DIVIDE:"%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}",POWER:"%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}",ROOT:"%{BKY_MATH_SINGLE_TOOLTIP_ROOT}",ABS:"%{BKY_MATH_SINGLE_TOOLTIP_ABS}",NEG:"%{BKY_MATH_SINGLE_TOOLTIP_NEG}",LN:"%{BKY_MATH_SINGLE_TOOLTIP_LN}",LOG10:"%{BKY_MATH_SINGLE_TOOLTIP_LOG10}",EXP:"%{BKY_MATH_SINGLE_TOOLTIP_EXP}",POW10:"%{BKY_MATH_SINGLE_TOOLTIP_POW10}",SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY_MATH_TRIG_TOOLTIP_TAN}",ASIN:"%{BKY_MATH_TRIG_TOOLTIP_ASIN}",ACOS:"%{BKY_MATH_TRIG_TOOLTIP_ACOS}",ATAN:"%{BKY_MATH_TRIG_TOOLTIP_ATAN}",SUM:"%{BKY_MATH_ONLIST_TOOLTIP_SUM}",MIN:"%{BKY_MATH_ONLIST_TOOLTIP_MIN}",MAX:"%{BKY_MATH_ONLIST_TOOLTIP_MAX}",AVERAGE:"%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}",MEDIAN:"%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}",MODE:"%{BKY_MATH_ONLIST_TOOLTIP_MODE}",STD_DEV:"%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}",RANDOM:"%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}"},t.Extensions.register("math_op_tooltip",t.Extensions.buildTooltipForDropdown("OP",t.Constants.Math.TOOLTIPS_BY_OP)),t.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN={mutationToDom:function(){var e=t.utils.xml.createElement("mutation"),i="DIVISIBLE_BY"==this.getFieldValue("PROPERTY");return e.setAttribute("divisor_input",i),e},domToMutation:function(t){t="true"==t.getAttribute("divisor_input"),this.updateShape_(t)},updateShape_:function(t){var e=this.getInput("DIVISOR");t?e||this.appendValueInput("DIVISOR").setCheck("Number"):e&&this.removeInput("DIVISOR")}},t.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION=function(){this.getField("PROPERTY").setValidator(function(t){t="DIVISIBLE_BY"==t,this.getSourceBlock().updateShape_(t)})},t.Extensions.registerMutator("math_is_divisibleby_mutator",t.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN,t.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION),t.Extensions.register("math_change_tooltip",t.Extensions.buildTooltipWithFieldText("%{BKY_MATH_CHANGE_TOOLTIP}","VAR")),t.Constants.Math.LIST_MODES_MUTATOR_MIXIN={updateType_:function(t){"MODE"==t?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){var e=t.utils.xml.createElement("mutation");return e.setAttribute("op",this.getFieldValue("OP")),e},domToMutation:function(t){this.updateType_(t.getAttribute("op"))}},t.Constants.Math.LIST_MODES_MUTATOR_EXTENSION=function(){this.getField("OP").setValidator(function(t){this.updateType_(t)}.bind(this))},t.Extensions.registerMutator("math_modes_of_list_mutator",t.Constants.Math.LIST_MODES_MUTATOR_MIXIN,t.Constants.Math.LIST_MODES_MUTATOR_EXTENSION),t.Blocks.procedures={},t.Blocks.procedures_defnoreturn={init:function(){var e=t.Procedures.findLegalName("",this);(e=new t.FieldTextInput(e,t.Procedures.rename)).setSpellcheck(!1),this.appendDummyInput().appendField(t.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new t.Mutator(["procedures_mutatorarg"])),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&t.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(t.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(t.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(e){this.hasStatements_!==e&&(e?(this.appendStatementInput("STACK").appendField(t.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=e)},updateParams_:function(){var e="";this.arguments_.length&&(e=t.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),t.Events.disable();try{this.setFieldValue(e,"PARAMS")}finally{t.Events.enable()}},mutationToDom:function(e){var i=t.utils.xml.createElement("mutation");e&&i.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(t,e){var i=this.select,n=i.remote,o=i.valueKey;if(!this.created&&!n){if(o&&"object"===(void 0===t?"undefined":a(t))&&"object"===(void 0===e?"undefined":a(e))&&t[o]===e[o])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(t,e){if(this.isObject){var i=this.select.valueKey;return Object(s.getValueByPath)(t,i)===Object(s.getValueByPath)(e,i)}return t===e},contains:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1];if(this.isObject){var i=this.select.valueKey;return t&&t.some(function(t){return Object(s.getValueByPath)(t,i)===Object(s.getValueByPath)(e,i)})}return t&&t.indexOf(e)>-1},handleGroupDisabled:function(t){this.groupDisabled=t},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(t){this.visible=new RegExp(Object(s.escapeRegexpString)(t),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){var t=this.select,e=t.selected,i=t.multiple?e:[e],n=this.select.cachedOptions.indexOf(this),o=i.indexOf(this);n>-1&&o<0&&this.select.cachedOptions.splice(n,1),this.select.onOptionDestroy(this.select.options.indexOf(this))}},c=i(0),u=Object(c.a)(l,n,[],!1,null,null,null);u.options.__file="packages/select/src/option.vue";e.a=u.exports},4:function(t,e){t.exports=i("fPll")},53:function(t,e,i){"use strict";i.r(e);var n=i(33);n.a.install=function(t){t.component(n.a.name,n.a)},e.default=n.a}})},SXzR:function(t,e,i){t.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/",i(i.s=73)}({0:function(t,e,i){"use strict";function n(t,e,i,n,o,r,s,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:c}}i.d(e,"a",function(){return n})},2:function(t,e){t.exports=i("2kvA")},3:function(t,e){t.exports=i("ylDJ")},5:function(t,e){t.exports=i("fKx3")},7:function(t,e){t.exports=i("7+uW")},73:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",[i("transition",{attrs:{name:t.transition},on:{"after-enter":t.handleAfterEnter,"after-leave":t.handleAfterLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:!t.disabled&&t.showPopper,expression:"!disabled && showPopper"}],ref:"popper",staticClass:"el-popover el-popper",class:[t.popperClass,t.content&&"el-popover--plain"],style:{width:t.width+"px"},attrs:{role:"tooltip",id:t.tooltipId,"aria-hidden":t.disabled||!t.showPopper?"true":"false"}},[t.title?i("div",{staticClass:"el-popover__title",domProps:{textContent:t._s(t.title)}}):t._e(),t._t("default",[t._v(t._s(t.content))])],2)]),i("span",{ref:"wrapper",staticClass:"el-popover__reference-wrapper"},[t._t("reference")],2)],1)};n._withStripped=!0;var o=i(5),r=i.n(o),s=i(2),a=i(3),l={name:"ElPopover",mixins:[r.a],props:{trigger:{type:String,default:"click",validator:function(t){return["click","focus","hover","manual"].indexOf(t)>-1}},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:200},title:String,disabled:Boolean,content:String,reference:{},popperClass:String,width:{},visibleArrow:{default:!0},arrowOffset:{type:Number,default:0},transition:{type:String,default:"fade-in-linear"},tabindex:{type:Number,default:0}},computed:{tooltipId:function(){return"el-popover-"+Object(a.generateId)()}},watch:{showPopper:function(t){this.disabled||(t?this.$emit("show"):this.$emit("hide"))}},mounted:function(){var t=this,e=this.referenceElm=this.reference||this.$refs.reference,i=this.popper||this.$refs.popper;!e&&this.$refs.wrapper.children&&(e=this.referenceElm=this.$refs.wrapper.children[0]),e&&(Object(s.addClass)(e,"el-popover__reference"),e.setAttribute("aria-describedby",this.tooltipId),e.setAttribute("tabindex",this.tabindex),i.setAttribute("tabindex",0),"click"!==this.trigger&&(Object(s.on)(e,"focusin",function(){t.handleFocus();var i=e.__vue__;i&&"function"==typeof i.focus&&i.focus()}),Object(s.on)(i,"focusin",this.handleFocus),Object(s.on)(e,"focusout",this.handleBlur),Object(s.on)(i,"focusout",this.handleBlur)),Object(s.on)(e,"keydown",this.handleKeydown),Object(s.on)(e,"click",this.handleClick)),"click"===this.trigger?(Object(s.on)(e,"click",this.doToggle),Object(s.on)(document,"click",this.handleDocumentClick)):"hover"===this.trigger?(Object(s.on)(e,"mouseenter",this.handleMouseEnter),Object(s.on)(i,"mouseenter",this.handleMouseEnter),Object(s.on)(e,"mouseleave",this.handleMouseLeave),Object(s.on)(i,"mouseleave",this.handleMouseLeave)):"focus"===this.trigger&&(this.tabindex<0&&console.warn("[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key"),e.querySelector("input, textarea")?(Object(s.on)(e,"focusin",this.doShow),Object(s.on)(e,"focusout",this.doClose)):(Object(s.on)(e,"mousedown",this.doShow),Object(s.on)(e,"mouseup",this.doClose)))},beforeDestroy:function(){this.cleanup()},deactivated:function(){this.cleanup()},methods:{doToggle:function(){this.showPopper=!this.showPopper},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},handleFocus:function(){Object(s.addClass)(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!0)},handleClick:function(){Object(s.removeClass)(this.referenceElm,"focusing")},handleBlur:function(){Object(s.removeClass)(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!1)},handleMouseEnter:function(){var t=this;clearTimeout(this._timer),this.openDelay?this._timer=setTimeout(function(){t.showPopper=!0},this.openDelay):this.showPopper=!0},handleKeydown:function(t){27===t.keyCode&&"manual"!==this.trigger&&this.doClose()},handleMouseLeave:function(){var t=this;clearTimeout(this._timer),this.closeDelay?this._timer=setTimeout(function(){t.showPopper=!1},this.closeDelay):this.showPopper=!1},handleDocumentClick:function(t){var e=this.reference||this.$refs.reference,i=this.popper||this.$refs.popper;!e&&this.$refs.wrapper.children&&(e=this.referenceElm=this.$refs.wrapper.children[0]),this.$el&&e&&!this.$el.contains(t.target)&&!e.contains(t.target)&&i&&!i.contains(t.target)&&(this.showPopper=!1)},handleAfterEnter:function(){this.$emit("after-enter")},handleAfterLeave:function(){this.$emit("after-leave"),this.doDestroy()},cleanup:function(){(this.openDelay||this.closeDelay)&&clearTimeout(this._timer)}},destroyed:function(){var t=this.reference;Object(s.off)(t,"click",this.doToggle),Object(s.off)(t,"mouseup",this.doClose),Object(s.off)(t,"mousedown",this.doShow),Object(s.off)(t,"focusin",this.doShow),Object(s.off)(t,"focusout",this.doClose),Object(s.off)(t,"mousedown",this.doShow),Object(s.off)(t,"mouseup",this.doClose),Object(s.off)(t,"mouseleave",this.handleMouseLeave),Object(s.off)(t,"mouseenter",this.handleMouseEnter),Object(s.off)(document,"click",this.handleDocumentClick)}},c=i(0),u=Object(c.a)(l,n,[],!1,null,null,null);u.options.__file="packages/popover/src/main.vue";var h=u.exports,p=function(t,e,i){var n=e.expression?e.value:e.arg,o=i.context.$refs[n];o&&(Array.isArray(o)?o[0].$refs.reference=t:o.$refs.reference=t)},d={bind:function(t,e,i){p(t,e,i)},inserted:function(t,e,i){p(t,e,i)}},f=i(7);i.n(f).a.directive("popover",d),h.install=function(t){t.directive("popover",d),t.component(h.name,h)},h.directive=d;e.default=h}})},SfB7:function(t,e,i){t.exports=!i("+E39")&&!i("S82l")(function(){return 7!=Object.defineProperty(i("ON07")("div"),"a",{get:function(){return 7}}).a})},SldL:function(t,e){!function(e){"use strict";var i,n=Object.prototype,o=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag",c="object"==typeof t,u=e.regeneratorRuntime;if(u)c&&(t.exports=u);else{(u=e.regeneratorRuntime=c?t.exports:{}).wrap=b;var h="suspendedStart",p="suspendedYield",d="executing",f="completed",g={},_={};_[s]=function(){return this};var m=Object.getPrototypeOf,v=m&&m(m(x([])));v&&v!==n&&o.call(v,s)&&(_=v);var y=S.prototype=E.prototype=Object.create(_);C.prototype=y.constructor=S,S.constructor=C,S[l]=C.displayName="GeneratorFunction",u.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===C||"GeneratorFunction"===(e.displayName||e.name))},u.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,S):(t.__proto__=S,l in t||(t[l]="GeneratorFunction")),t.prototype=Object.create(y),t},u.awrap=function(t){return{__await:t}},k(O.prototype),O.prototype[a]=function(){return this},u.AsyncIterator=O,u.async=function(t,e,i,n){var o=new O(b(t,e,i,n));return u.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},k(y),y[l]="Generator",y[s]=function(){return this},y.toString=function(){return"[object Generator]"},u.keys=function(t){var e=[];for(var i in t)e.push(i);return e.reverse(),function i(){for(;e.length;){var n=e.pop();if(n in t)return i.value=n,i.done=!1,i}return i.done=!0,i}},u.values=x,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=i)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return a.type="throw",a.arg=t,e.next=n,o&&(e.method="next",e.arg=i),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=o.call(s,"catchLoc"),c=o.call(s,"finallyLoc");if(l&&c){if(this.prev=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),R(i),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;R(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=i),g}}}function b(t,e,i,n){var o=e&&e.prototype instanceof E?e:E,r=Object.create(o.prototype),s=new D(n||[]);return r._invoke=function(t,e,i){var n=h;return function(o,r){if(n===d)throw new Error("Generator is already running");if(n===f){if("throw"===o)throw r;return M()}for(i.method=o,i.arg=r;;){var s=i.delegate;if(s){var a=I(s,i);if(a){if(a===g)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===h)throw n=f,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=d;var l=T(t,e,i);if("normal"===l.type){if(n=i.done?f:p,l.arg===g)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n=f,i.method="throw",i.arg=l.arg)}}}(t,i,s),r}function T(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}function E(){}function C(){}function S(){}function k(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function O(t){var e;this._invoke=function(i,n){function r(){return new Promise(function(e,r){!function e(i,n,r,s){var a=T(t[i],t,n);if("throw"!==a.type){var l=a.arg,c=l.value;return c&&"object"==typeof c&&o.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,r,s)},function(t){e("throw",t,r,s)}):Promise.resolve(c).then(function(t){l.value=t,r(l)},s)}s(a.arg)}(i,n,e,r)})}return e=e?e.then(r,r):r()}}function I(t,e){var n=t.iterator[e.method];if(n===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=i,I(t,e),"throw"===e.method))return g;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=T(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,g;var r=o.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=i),e.delegate=null,g):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function x(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n1?e-1:0),s=1;su;)for(var d,f=l(arguments[u++]),g=h?o(f).concat(h(f)):o(f),_=g.length,m=0;_>m;)d=g[m++],n&&!p.call(f,d)||(i[d]=f[d]);return i}:c},U5ju:function(t,e,i){i("M6a0"),i("zQR9"),i("+tPU"),i("CXw9"),i("EqBC"),i("jKW+"),t.exports=i("FeBl").Promise},UuGF:function(t,e){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},V3tA:function(t,e,i){i("R4wc"),t.exports=i("FeBl").Object.assign},"VU/8":function(t,e){t.exports=function(t,e,i,n,o,r){var s,a=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(s=t,a=t.default);var c,u="function"==typeof a?a.options:a;if(e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId=o),r?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=c):n&&(c=n),c){var h=u.functional,p=h?u.render:u.beforeCreate;h?(u._injectStyles=c,u.render=function(t,e){return c.call(e),p(t,e)}):u.beforeCreate=p?[].concat(p,c):[c]}return{esModule:s,exports:a,options:u}}},Vi3T:function(t,e,i){"use strict";e.__esModule=!0,e.default={el:{colorpicker:{confirm:"确定",clear:"清空"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},empty:{description:"暂无数据"}}}},W2nU:function(t,e){var i,n,o=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var l,c=[],u=!1,h=-1;function p(){u&&l&&(u=!1,l.length?c=l.concat(c):h=-1,c.length&&d())}function d(){if(!u){var t=a(p);u=!0;for(var e=c.length;e;){for(l=c,c=[];++h1)for(var i=1;ic;)l.call(t,s=a[c++])&&e.push(s);return e}},Xd32:function(t,e,i){i("+tPU"),i("zQR9"),t.exports=i("5PlU")},XgCd:function(t,e,i){"use strict";var n=String.prototype.replace,o=/%20/g;t.exports={default:"RFC3986",formatters:{RFC1738:function(t){return n.call(t,o,"+")},RFC3986:function(t){return t}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},XmWM:function(t,e,i){"use strict";var n=i("cGG2"),o=i("DQCr"),r=i("fuGk"),s=i("xLtR"),a=i("DUeU");function l(t){this.defaults=t,this.interceptors={request:new r,response:new r}}l.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[s,void 0],i=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)i=i.then(e.shift(),e.shift());return i},l.prototype.getUri=function(t){return t=a(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],function(t){l.prototype[t]=function(e,i){return this.request(a(i||{},{method:t,url:e,data:(i||{}).data}))}}),n.forEach(["post","put","patch"],function(t){l.prototype[t]=function(e,i,n){return this.request(a(n||{},{method:t,url:e,data:i}))}}),t.exports=l},Xxa5:function(t,e,i){t.exports=i("jyFz")},Y5mS:function(t,e,i){"use strict";var n,o=i("lFkc");o.canUseDOM&&(n=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")) /** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @param {?boolean} capture Check if the capture phase is supported. * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */,t.exports=function(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var i="on"+t,r=i in document;if(!r){var s=document.createElement("div");s.setAttribute(i,"return;"),r="function"==typeof s[i]}return!r&&n&&"wheel"===t&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}},YAhB:function(t,e,i){"use strict";var n=i("++K3"),o=i("Y5mS"),r=10,s=40,a=800;function l(t){var e=0,i=0,n=0,o=0;return"detail"in t&&(i=t.detail),"wheelDelta"in t&&(i=-t.wheelDelta/120),"wheelDeltaY"in t&&(i=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=i,i=0),n=e*r,o=i*r,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(n=t.deltaX),(n||o)&&t.deltaMode&&(1==t.deltaMode?(n*=s,o*=s):(n*=a,o*=a)),n&&!e&&(e=n<1?-1:1),o&&!i&&(i=o<1?-1:1),{spinX:e,spinY:i,pixelX:n,pixelY:o}}l.getEventType=function(){return n.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},t.exports=l},Yobk:function(t,e,i){var n=i("77Pl"),o=i("qio6"),r=i("xnc9"),s=i("ax3d")("IE_PROTO"),a=function(){},l=function(){var t,e=i("ON07")("iframe"),n=r.length;for(e.style.display="none",i("RPLV").appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("