diff --git a/docs/assets/index-BVMSXnbw.js b/docs/assets/index-BVMSXnbw.js deleted file mode 100644 index 2cf5d065..00000000 --- a/docs/assets/index-BVMSXnbw.js +++ /dev/null @@ -1,2368 +0,0 @@ -var sI=Object.defineProperty;var oI=(n,h,o)=>h in n?sI(n,h,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[h]=o;var et=(n,h,o)=>oI(n,typeof h!="symbol"?h+"":h,o);(function(){const h=document.createElement("link").relList;if(h&&h.supports&&h.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))c(m);new MutationObserver(m=>{for(const f of m)if(f.type==="childList")for(const R of f.addedNodes)R.tagName==="LINK"&&R.rel==="modulepreload"&&c(R)}).observe(document,{childList:!0,subtree:!0});function o(m){const f={};return m.integrity&&(f.integrity=m.integrity),m.referrerPolicy&&(f.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?f.credentials="include":m.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(m){if(m.ep)return;m.ep=!0;const f=o(m);fetch(m.href,f)}})();/** -* @vue/shared v3.5.6 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function u$(n){const h=Object.create(null);for(const o of n.split(","))h[o]=1;return o=>o in h}const lt={},Ar=[],Js=()=>{},iI=()=>!1,jc=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),a$=n=>n.startsWith("onUpdate:"),Vt=Object.assign,h$=(n,h)=>{const o=n.indexOf(h);o>-1&&n.splice(o,1)},rI=Object.prototype.hasOwnProperty,Ke=(n,h)=>rI.call(n,h),we=Array.isArray,Fn=n=>Kc(n)==="[object Map]",nI=n=>Kc(n)==="[object Set]",De=n=>typeof n=="function",Pt=n=>typeof n=="string",Dr=n=>typeof n=="symbol",Lt=n=>n!==null&&typeof n=="object",Vm=n=>(Lt(n)||De(n))&&De(n.then)&&De(n.catch),lI=Object.prototype.toString,Kc=n=>lI.call(n),cI=n=>Kc(n).slice(8,-1),uI=n=>Kc(n)==="[object Object]",d$=n=>Pt(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Un=u$(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Jc=n=>{const h=Object.create(null);return o=>h[o]||(h[o]=n(o))},aI=/-(\w)/g,Ms=Jc(n=>n.replace(aI,(h,o)=>o?o.toUpperCase():"")),hI=/\B([A-Z])/g,yi=Jc(n=>n.replace(hI,"-$1").toLowerCase()),qc=Jc(n=>n.charAt(0).toUpperCase()+n.slice(1)),Pd=Jc(n=>n?`on${qc(n)}`:""),vi=(n,h)=>!Object.is(n,h),xd=(n,...h)=>{for(let o=0;o{Object.defineProperty(n,h,{configurable:!0,enumerable:!1,writable:c,value:o})},dI=n=>{const h=parseFloat(n);return isNaN(h)?n:h};let nm;const Xm=()=>nm||(nm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function $$(n){if(we(n)){const h={};for(let o=0;o{if(o){const c=o.split(_I);c.length>1&&(h[c[0].trim()]=c[1].trim())}}),h}function _$(n){let h="";if(Pt(n))h=n;else if(we(n))for(let o=0;o0)return;let n;for(;Hn;){let h=Hn;for(Hn=void 0;h;){const o=h.next;if(h.next=void 0,h.flags&=-9,h.flags&1)try{h.trigger()}catch(c){n||(n=c)}h=o}}if(n)throw n}function Jm(n){for(let h=n.deps;h;h=h.nextDep)h.version=-1,h.prevActiveLink=h.dep.activeLink,h.dep.activeLink=h}function qm(n){let h,o=n.depsTail,c=o;for(;c;){const m=c.prevDep;c.version===-1?(c===o&&(o=m),g$(c),II(c)):h=c,c.dep.activeLink=c.prevActiveLink,c.prevActiveLink=void 0,c=m}n.deps=h,n.depsTail=o}function Qd(n){for(let h=n.deps;h;h=h.nextDep)if(h.dep.version!==h.version||h.dep.computed&&(Qm(h.dep.computed)||h.dep.version!==h.version))return!0;return!!n._dirty}function Qm(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===zn))return;n.globalVersion=zn;const h=n.dep;if(n.flags|=2,h.version>0&&!n.isSSR&&n.deps&&!Qd(n)){n.flags&=-3;return}const o=ot,c=As;ot=n,As=!0;try{Jm(n);const m=n.fn(n._value);(h.version===0||vi(m,n._value))&&(n._value=m,h.version++)}catch(m){throw h.version++,m}finally{ot=o,As=c,qm(n),n.flags&=-3}}function g$(n){const{dep:h,prevSub:o,nextSub:c}=n;if(o&&(o.nextSub=c,n.prevSub=void 0),c&&(c.prevSub=o,n.nextSub=void 0),h.subs===n&&(h.subs=o),!h.subs&&h.computed){h.computed.flags&=-5;for(let m=h.computed.deps;m;m=m.nextDep)g$(m)}}function II(n){const{prevDep:h,nextDep:o}=n;h&&(h.nextDep=o,n.prevDep=void 0),o&&(o.prevDep=h,n.nextDep=void 0)}let As=!0;const Zm=[];function jo(){Zm.push(As),As=!1}function Ko(){const n=Zm.pop();As=n===void 0?!0:n}function lm(n){const{cleanup:h}=n;if(n.cleanup=void 0,h){const o=ot;ot=void 0;try{h()}finally{ot=o}}}let zn=0;class OI{constructor(h,o){this.sub=h,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eE{constructor(h){this.computed=h,this.version=0,this.activeLink=void 0,this.subs=void 0}track(h){if(!ot||!As||ot===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==ot)o=this.activeLink=new OI(ot,this),ot.deps?(o.prevDep=ot.depsTail,ot.depsTail.nextDep=o,ot.depsTail=o):ot.deps=ot.depsTail=o,ot.flags&4&&tE(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const c=o.nextDep;c.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=c),o.prevDep=ot.depsTail,o.nextDep=void 0,ot.depsTail.nextDep=o,ot.depsTail=o,ot.deps===o&&(ot.deps=c)}return o}trigger(h){this.version++,zn++,this.notify(h)}notify(h){p$();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{T$()}}}function tE(n){const h=n.dep.computed;if(h&&!n.dep.subs){h.flags|=20;for(let c=h.deps;c;c=c.nextDep)tE(c)}const o=n.dep.subs;o!==n&&(n.prevSub=o,o&&(o.nextSub=n)),n.dep.subs=n}const Zd=new WeakMap,Mi=Symbol(""),e$=Symbol(""),jn=Symbol("");function Wt(n,h,o){if(As&&ot){let c=Zd.get(n);c||Zd.set(n,c=new Map);let m=c.get(o);m||c.set(o,m=new eE),m.track()}}function Ro(n,h,o,c,m,f){const R=Zd.get(n);if(!R){zn++;return}const N=k=>{k&&k.trigger()};if(p$(),h==="clear")R.forEach(N);else{const k=we(n),F=k&&d$(o);if(k&&o==="length"){const w=Number(c);R.forEach((P,W)=>{(W==="length"||W===jn||!Dr(W)&&W>=w)&&N(P)})}else switch(o!==void 0&&N(R.get(o)),F&&N(R.get(jn)),h){case"add":k?F&&N(R.get("length")):(N(R.get(Mi)),Fn(n)&&N(R.get(e$)));break;case"delete":k||(N(R.get(Mi)),Fn(n)&&N(R.get(e$)));break;case"set":Fn(n)&&N(R.get(Mi));break}}T$()}function Cr(n){const h=tt(n);return h===n?h:(Wt(h,"iterate",jn),qs(n)?h:h.map(us))}function m$(n){return Wt(n=tt(n),"iterate",jn),n}const bI={__proto__:null,[Symbol.iterator](){return Fd(this,Symbol.iterator,us)},concat(...n){return Cr(this).concat(...n.map(h=>we(h)?Cr(h):h))},entries(){return Fd(this,"entries",n=>(n[1]=us(n[1]),n))},every(n,h){return Oo(this,"every",n,h,void 0,arguments)},filter(n,h){return Oo(this,"filter",n,h,o=>o.map(us),arguments)},find(n,h){return Oo(this,"find",n,h,us,arguments)},findIndex(n,h){return Oo(this,"findIndex",n,h,void 0,arguments)},findLast(n,h){return Oo(this,"findLast",n,h,us,arguments)},findLastIndex(n,h){return Oo(this,"findLastIndex",n,h,void 0,arguments)},forEach(n,h){return Oo(this,"forEach",n,h,void 0,arguments)},includes(...n){return Ud(this,"includes",n)},indexOf(...n){return Ud(this,"indexOf",n)},join(n){return Cr(this).join(n)},lastIndexOf(...n){return Ud(this,"lastIndexOf",n)},map(n,h){return Oo(this,"map",n,h,void 0,arguments)},pop(){return kn(this,"pop")},push(...n){return kn(this,"push",n)},reduce(n,...h){return cm(this,"reduce",n,h)},reduceRight(n,...h){return cm(this,"reduceRight",n,h)},shift(){return kn(this,"shift")},some(n,h){return Oo(this,"some",n,h,void 0,arguments)},splice(...n){return kn(this,"splice",n)},toReversed(){return Cr(this).toReversed()},toSorted(n){return Cr(this).toSorted(n)},toSpliced(...n){return Cr(this).toSpliced(...n)},unshift(...n){return kn(this,"unshift",n)},values(){return Fd(this,"values",us)}};function Fd(n,h,o){const c=m$(n),m=c[h]();return c!==n&&!qs(n)&&(m._next=m.next,m.next=()=>{const f=m._next();return f.value&&(f.value=o(f.value)),f}),m}const RI=Array.prototype;function Oo(n,h,o,c,m,f){const R=m$(n),N=R!==n&&!qs(n),k=R[h];if(k!==RI[h]){const P=k.apply(n,f);return N?us(P):P}let F=o;R!==n&&(N?F=function(P,W){return o.call(this,us(P),W,n)}:o.length>2&&(F=function(P,W){return o.call(this,P,W,n)}));const w=k.call(R,F,c);return N&&m?m(w):w}function cm(n,h,o,c){const m=m$(n);let f=o;return m!==n&&(qs(n)?o.length>3&&(f=function(R,N,k){return o.call(this,R,N,k,n)}):f=function(R,N,k){return o.call(this,R,us(N),k,n)}),m[h](f,...c)}function Ud(n,h,o){const c=tt(n);Wt(c,"iterate",jn);const m=c[h](...o);return(m===-1||m===!1)&&b$(o[0])?(o[0]=tt(o[0]),c[h](...o)):m}function kn(n,h,o=[]){jo(),p$();const c=tt(n)[h].apply(n,o);return T$(),Ko(),c}const SI=u$("__proto__,__v_isRef,__isVue"),sE=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Dr));function NI(n){Dr(n)||(n=String(n));const h=tt(this);return Wt(h,"has",n),h.hasOwnProperty(n)}class oE{constructor(h=!1,o=!1){this._isReadonly=h,this._isShallow=o}get(h,o,c){const m=this._isReadonly,f=this._isShallow;if(o==="__v_isReactive")return!m;if(o==="__v_isReadonly")return m;if(o==="__v_isShallow")return f;if(o==="__v_raw")return c===(m?f?FI:lE:f?nE:rE).get(h)||Object.getPrototypeOf(h)===Object.getPrototypeOf(c)?h:void 0;const R=we(h);if(!m){let k;if(R&&(k=bI[o]))return k;if(o==="hasOwnProperty")return NI}const N=Reflect.get(h,o,qt(h)?h:c);return(Dr(o)?sE.has(o):SI(o))||(m||Wt(h,"get",o),f)?N:qt(N)?R&&d$(o)?N:N.value:Lt(N)?m?cE(N):I$(N):N}}class iE extends oE{constructor(h=!1){super(!1,h)}set(h,o,c,m){let f=h[o];if(!this._isShallow){const k=yr(f);if(!qs(c)&&!yr(c)&&(f=tt(f),c=tt(c)),!we(h)&&qt(f)&&!qt(c))return k?!1:(f.value=c,!0)}const R=we(h)&&d$(o)?Number(o)n,Qc=n=>Reflect.getPrototypeOf(n);function Dc(n,h,o=!1,c=!1){n=n.__v_raw;const m=tt(n),f=tt(h);o||(vi(h,f)&&Wt(m,"get",h),Wt(m,"get",f));const{has:R}=Qc(m),N=c?E$:o?R$:us;if(R.call(m,h))return N(n.get(h));if(R.call(m,f))return N(n.get(f));n!==m&&n.get(h)}function wc(n,h=!1){const o=this.__v_raw,c=tt(o),m=tt(n);return h||(vi(n,m)&&Wt(c,"has",n),Wt(c,"has",m)),n===m?o.has(n):o.has(n)||o.has(m)}function Pc(n,h=!1){return n=n.__v_raw,!h&&Wt(tt(n),"iterate",Mi),Reflect.get(n,"size",n)}function um(n,h=!1){!h&&!qs(n)&&!yr(n)&&(n=tt(n));const o=tt(this);return Qc(o).has.call(o,n)||(o.add(n),Ro(o,"add",n,n)),this}function am(n,h,o=!1){!o&&!qs(h)&&!yr(h)&&(h=tt(h));const c=tt(this),{has:m,get:f}=Qc(c);let R=m.call(c,n);R||(n=tt(n),R=m.call(c,n));const N=f.call(c,n);return c.set(n,h),R?vi(h,N)&&Ro(c,"set",n,h):Ro(c,"add",n,h),this}function hm(n){const h=tt(this),{has:o,get:c}=Qc(h);let m=o.call(h,n);m||(n=tt(n),m=o.call(h,n)),c&&c.call(h,n);const f=h.delete(n);return m&&Ro(h,"delete",n,void 0),f}function dm(){const n=tt(this),h=n.size!==0,o=n.clear();return h&&Ro(n,"clear",void 0,void 0),o}function xc(n,h){return function(c,m){const f=this,R=f.__v_raw,N=tt(R),k=h?E$:n?R$:us;return!n&&Wt(N,"iterate",Mi),R.forEach((F,w)=>c.call(m,k(F),k(w),f))}}function Bc(n,h,o){return function(...c){const m=this.__v_raw,f=tt(m),R=Fn(f),N=n==="entries"||n===Symbol.iterator&&R,k=n==="keys"&&R,F=m[n](...c),w=o?E$:h?R$:us;return!h&&Wt(f,"iterate",k?e$:Mi),{next(){const{value:P,done:W}=F.next();return W?{value:P,done:W}:{value:N?[w(P[0]),w(P[1])]:w(P),done:W}},[Symbol.iterator](){return this}}}}function Wo(n){return function(...h){return n==="delete"?!1:n==="clear"?void 0:this}}function vI(){const n={get(f){return Dc(this,f)},get size(){return Pc(this)},has:wc,add:um,set:am,delete:hm,clear:dm,forEach:xc(!1,!1)},h={get(f){return Dc(this,f,!1,!0)},get size(){return Pc(this)},has:wc,add(f){return um.call(this,f,!0)},set(f,R){return am.call(this,f,R,!0)},delete:hm,clear:dm,forEach:xc(!1,!0)},o={get(f){return Dc(this,f,!0)},get size(){return Pc(this,!0)},has(f){return wc.call(this,f,!0)},add:Wo("add"),set:Wo("set"),delete:Wo("delete"),clear:Wo("clear"),forEach:xc(!0,!1)},c={get(f){return Dc(this,f,!0,!0)},get size(){return Pc(this,!0)},has(f){return wc.call(this,f,!0)},add:Wo("add"),set:Wo("set"),delete:Wo("delete"),clear:Wo("clear"),forEach:xc(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(f=>{n[f]=Bc(f,!1,!1),o[f]=Bc(f,!0,!1),h[f]=Bc(f,!1,!0),c[f]=Bc(f,!0,!0)}),[n,o,h,c]}const[yI,kI,DI,wI]=vI();function f$(n,h){const o=h?n?wI:DI:n?kI:yI;return(c,m,f)=>m==="__v_isReactive"?!n:m==="__v_isReadonly"?n:m==="__v_raw"?c:Reflect.get(Ke(o,m)&&m in c?o:c,m,f)}const PI={get:f$(!1,!1)},xI={get:f$(!1,!0)},BI={get:f$(!0,!1)};const rE=new WeakMap,nE=new WeakMap,lE=new WeakMap,FI=new WeakMap;function UI(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function HI(n){return n.__v_skip||!Object.isExtensible(n)?0:UI(cI(n))}function I$(n){return yr(n)?n:O$(n,!1,LI,PI,rE)}function GI(n){return O$(n,!1,MI,xI,nE)}function cE(n){return O$(n,!0,AI,BI,lE)}function O$(n,h,o,c,m){if(!Lt(n)||n.__v_raw&&!(h&&n.__v_isReactive))return n;const f=m.get(n);if(f)return f;const R=HI(n);if(R===0)return n;const N=new Proxy(n,R===2?c:o);return m.set(n,N),N}function Gn(n){return yr(n)?Gn(n.__v_raw):!!(n&&n.__v_isReactive)}function yr(n){return!!(n&&n.__v_isReadonly)}function qs(n){return!!(n&&n.__v_isShallow)}function b$(n){return n?!!n.__v_raw:!1}function tt(n){const h=n&&n.__v_raw;return h?tt(h):n}function VI(n){return!Ke(n,"__v_skip")&&Object.isExtensible(n)&&Wm(n,"__v_skip",!0),n}const us=n=>Lt(n)?I$(n):n,R$=n=>Lt(n)?cE(n):n;function qt(n){return n?n.__v_isRef===!0:!1}function WI(n){return qt(n)?n.value:n}const XI={get:(n,h,o)=>h==="__v_raw"?n:WI(Reflect.get(n,h,o)),set:(n,h,o,c)=>{const m=n[h];return qt(m)&&!qt(o)?(m.value=o,!0):Reflect.set(n,h,o,c)}};function uE(n){return Gn(n)?n:new Proxy(n,XI)}class YI{constructor(h,o,c){this.fn=h,this.setter=o,this._value=void 0,this.dep=new eE(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=zn-1,this.effect=this,this.__v_isReadonly=!o,this.isSSR=c}notify(){if(this.flags|=16,!(this.flags&8)&&ot!==this)return Km(this),!0}get value(){const h=this.dep.track();return Qm(this),h&&(h.version=this.dep.version),this._value}set value(h){this.setter&&this.setter(h)}}function zI(n,h,o=!1){let c,m;return De(n)?c=n:(c=n.get,m=n.set),new YI(c,m,o)}const Fc={},Wc=new WeakMap;let Ai;function jI(n,h=!1,o=Ai){if(o){let c=Wc.get(o);c||Wc.set(o,c=[]),c.push(n)}}function KI(n,h,o=lt){const{immediate:c,deep:m,once:f,scheduler:R,augmentJob:N,call:k}=o,F=de=>m?de:qs(de)||m===!1||m===0?zo(de,1):zo(de);let w,P,W,ae,re=!1,X=!1;if(qt(n)?(P=()=>n.value,re=qs(n)):Gn(n)?(P=()=>F(n),re=!0):we(n)?(X=!0,re=n.some(de=>Gn(de)||qs(de)),P=()=>n.map(de=>{if(qt(de))return de.value;if(Gn(de))return F(de);if(De(de))return k?k(de,2):de()})):De(n)?h?P=k?()=>k(n,2):n:P=()=>{if(W){jo();try{W()}finally{Ko()}}const de=Ai;Ai=w;try{return k?k(n,3,[ae]):n(ae)}finally{Ai=de}}:P=Js,h&&m){const de=P,Ue=m===!0?1/0:m;P=()=>zo(de(),Ue)}const be=fI(),Re=()=>{w.stop(),be&&h$(be.effects,w)};if(f&&h){const de=h;h=(...Ue)=>{de(...Ue),Re()}}let Se=X?new Array(n.length).fill(Fc):Fc;const ve=de=>{if(!(!(w.flags&1)||!w.dirty&&!de))if(h){const Ue=w.run();if(m||re||(X?Ue.some((it,He)=>vi(it,Se[He])):vi(Ue,Se))){W&&W();const it=Ai;Ai=w;try{const He=[Ue,Se===Fc?void 0:X&&Se[0]===Fc?[]:Se,ae];k?k(h,3,He):h(...He),Se=Ue}finally{Ai=it}}}else w.run()};return N&&N(ve),w=new zm(P),w.scheduler=R?()=>R(ve,!1):ve,ae=de=>jI(de,!1,w),W=w.onStop=()=>{const de=Wc.get(w);if(de){if(k)k(de,4);else for(const Ue of de)Ue();Wc.delete(w)}},h?c?ve(!0):Se=w.run():R?R(ve.bind(null,!0),!0):w.run(),Re.pause=w.pause.bind(w),Re.resume=w.resume.bind(w),Re.stop=Re,Re}function zo(n,h=1/0,o){if(h<=0||!Lt(n)||n.__v_skip||(o=o||new Set,o.has(n)))return n;if(o.add(n),h--,qt(n))zo(n.value,h,o);else if(we(n))for(let c=0;c{zo(c,h,o)});else if(uI(n)){for(const c in n)zo(n[c],h,o);for(const c of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,c)&&zo(n[c],h,o)}return n}/** -* @vue/runtime-core v3.5.6 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Zn(n,h,o,c){try{return c?n(...c):n()}catch(m){Zc(m,h,o)}}function Qs(n,h,o,c){if(De(n)){const m=Zn(n,h,o,c);return m&&Vm(m)&&m.catch(f=>{Zc(f,h,o)}),m}if(we(n)){const m=[];for(let f=0;f>>1,m=Jt[c],f=Jn(m);f=Jn(o)?Jt.push(n):Jt.splice(qI(h),0,n),n.flags|=1,dE()}}function dE(){!Kn&&!t$&&(t$=!0,S$=aE.then(_E))}function QI(n){we(n)?Mr.push(...n):Xo&&n.id===-1?Xo.splice(Lr+1,0,n):n.flags&1||(Mr.push(n),n.flags|=1),dE()}function $m(n,h,o=Kn?zs+1:0){for(;oJn(o)-Jn(c));if(Mr.length=0,Xo){Xo.push(...h);return}for(Xo=h,Lr=0;Lrn.id==null?n.flags&2?-1:1/0:n.id;function _E(n){t$=!1,Kn=!0;try{for(zs=0;zs{c._d&&bm(-1);const f=Xc(h);let R;try{R=n(...m)}finally{Xc(f),c._d&&bm(1)}return R};return c._n=!0,c._c=!0,c._d=!0,c}function Ci(n,h,o,c){const m=n.dirs,f=h&&h.dirs;for(let R=0;Rn.__isTeleport;function C$(n,h){n.shapeFlag&6&&n.component?(n.transition=h,C$(n.component.subTree,h)):n.shapeFlag&128?(n.ssContent.transition=h.clone(n.ssContent),n.ssFallback.transition=h.clone(n.ssFallback)):n.transition=h}function gE(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function s$(n,h,o,c,m=!1){if(we(n)){n.forEach((re,X)=>s$(re,h&&(we(h)?h[X]:h),o,c,m));return}if(Vn(c)&&!m)return;const f=c.shapeFlag&4?y$(c.component):c.el,R=m?null:f,{i:N,r:k}=n,F=h&&h.r,w=N.refs===lt?N.refs={}:N.refs,P=N.setupState,W=tt(P),ae=P===lt?()=>!1:re=>Ke(W,re);if(F!=null&&F!==k&&(Pt(F)?(w[F]=null,ae(F)&&(P[F]=null)):qt(F)&&(F.value=null)),De(k))Zn(k,N,12,[R,w]);else{const re=Pt(k),X=qt(k);if(re||X){const be=()=>{if(n.f){const Re=re?ae(k)?P[k]:w[k]:k.value;m?we(Re)&&h$(Re,f):we(Re)?Re.includes(f)||Re.push(f):re?(w[k]=[f],ae(k)&&(P[k]=w[k])):(k.value=[f],n.k&&(w[n.k]=k.value))}else re?(w[k]=R,ae(k)&&(P[k]=R)):X&&(k.value=R,n.k&&(w[n.k]=R))};R?(be.id=-1,ls(be,o)):be()}}}const Vn=n=>!!n.type.__asyncLoader,mE=n=>n.type.__isKeepAlive;function tO(n,h){EE(n,"a",h)}function sO(n,h){EE(n,"da",h)}function EE(n,h,o=Gt){const c=n.__wdc||(n.__wdc=()=>{let m=o;for(;m;){if(m.isDeactivated)return;m=m.parent}return n()});if(eu(h,c,o),o){let m=o.parent;for(;m&&m.parent;)mE(m.parent.vnode)&&oO(c,h,o,m),m=m.parent}}function oO(n,h,o,c){const m=eu(h,n,c,!0);IE(()=>{h$(c[h],m)},o)}function eu(n,h,o=Gt,c=!1){if(o){const m=o[n]||(o[n]=[]),f=h.__weh||(h.__weh=(...R)=>{jo();const N=el(o),k=Qs(h,o,n,R);return N(),Ko(),k});return c?m.unshift(f):m.push(f),f}}const No=n=>(h,o=Gt)=>{(!ou||n==="sp")&&eu(n,(...c)=>h(...c),o)},iO=No("bm"),fE=No("m"),rO=No("bu"),nO=No("u"),lO=No("bum"),IE=No("um"),cO=No("sp"),uO=No("rtg"),aO=No("rtc");function hO(n,h=Gt){eu("ec",n,h)}const dO="components";function _m(n,h){return _O(dO,n,!0,h)||n}const $O=Symbol.for("v-ndc");function _O(n,h,o=!0,c=!1){const m=Ls||Gt;if(m){const f=m.type;{const N=nb(f,!1);if(N&&(N===h||N===Ms(h)||N===qc(Ms(h))))return f}const R=pm(m[n]||f[n],h)||pm(m.appContext[n],h);return!R&&c?f:R}}function pm(n,h){return n&&(n[h]||n[Ms(h)]||n[qc(Ms(h))])}const o$=n=>n?UE(n)?y$(n):o$(n.parent):null,Wn=Vt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>o$(n.parent),$root:n=>o$(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>L$(n),$forceUpdate:n=>n.f||(n.f=()=>{N$(n.update)}),$nextTick:n=>n.n||(n.n=hE.bind(n.proxy)),$watch:n=>PO.bind(n)}),Hd=(n,h)=>n!==lt&&!n.__isScriptSetup&&Ke(n,h),pO={get({_:n},h){if(h==="__v_skip")return!0;const{ctx:o,setupState:c,data:m,props:f,accessCache:R,type:N,appContext:k}=n;let F;if(h[0]!=="$"){const ae=R[h];if(ae!==void 0)switch(ae){case 1:return c[h];case 2:return m[h];case 4:return o[h];case 3:return f[h]}else{if(Hd(c,h))return R[h]=1,c[h];if(m!==lt&&Ke(m,h))return R[h]=2,m[h];if((F=n.propsOptions[0])&&Ke(F,h))return R[h]=3,f[h];if(o!==lt&&Ke(o,h))return R[h]=4,o[h];i$&&(R[h]=0)}}const w=Wn[h];let P,W;if(w)return h==="$attrs"&&Wt(n.attrs,"get",""),w(n);if((P=N.__cssModules)&&(P=P[h]))return P;if(o!==lt&&Ke(o,h))return R[h]=4,o[h];if(W=k.config.globalProperties,Ke(W,h))return W[h]},set({_:n},h,o){const{data:c,setupState:m,ctx:f}=n;return Hd(m,h)?(m[h]=o,!0):c!==lt&&Ke(c,h)?(c[h]=o,!0):Ke(n.props,h)||h[0]==="$"&&h.slice(1)in n?!1:(f[h]=o,!0)},has({_:{data:n,setupState:h,accessCache:o,ctx:c,appContext:m,propsOptions:f}},R){let N;return!!o[R]||n!==lt&&Ke(n,R)||Hd(h,R)||(N=f[0])&&Ke(N,R)||Ke(c,R)||Ke(Wn,R)||Ke(m.config.globalProperties,R)},defineProperty(n,h,o){return o.get!=null?n._.accessCache[h]=0:Ke(o,"value")&&this.set(n,h,o.value,null),Reflect.defineProperty(n,h,o)}};function Tm(n){return we(n)?n.reduce((h,o)=>(h[o]=null,h),{}):n}let i$=!0;function TO(n){const h=L$(n),o=n.proxy,c=n.ctx;i$=!1,h.beforeCreate&&gm(h.beforeCreate,n,"bc");const{data:m,computed:f,methods:R,watch:N,provide:k,inject:F,created:w,beforeMount:P,mounted:W,beforeUpdate:ae,updated:re,activated:X,deactivated:be,beforeDestroy:Re,beforeUnmount:Se,destroyed:ve,unmounted:de,render:Ue,renderTracked:it,renderTriggered:He,errorCaptured:$e,serverPrefetch:Ot,expose:Pe,inheritAttrs:at,components:bt,directives:Rt,filters:xe}=h;if(F&&gO(F,c,null),R)for(const ye in R){const Le=R[ye];De(Le)&&(c[ye]=Le.bind(o))}if(m){const ye=m.call(o,o);Lt(ye)&&(n.data=I$(ye))}if(i$=!0,f)for(const ye in f){const Le=f[ye],ze=De(Le)?Le.bind(o,o):De(Le.get)?Le.get.bind(o,o):Js,$t=!De(Le)&&De(Le.set)?Le.set.bind(o):Js,_t=cb({get:ze,set:$t});Object.defineProperty(c,ye,{enumerable:!0,configurable:!0,get:()=>_t.value,set:rt=>_t.value=rt})}if(N)for(const ye in N)OE(N[ye],c,o,ye);if(k){const ye=De(k)?k.call(o):k;Reflect.ownKeys(ye).forEach(Le=>{bO(Le,ye[Le])})}w&&gm(w,n,"c");function Ne(ye,Le){we(Le)?Le.forEach(ze=>ye(ze.bind(o))):Le&&ye(Le.bind(o))}if(Ne(iO,P),Ne(fE,W),Ne(rO,ae),Ne(nO,re),Ne(tO,X),Ne(sO,be),Ne(hO,$e),Ne(aO,it),Ne(uO,He),Ne(lO,Se),Ne(IE,de),Ne(cO,Ot),we(Pe))if(Pe.length){const ye=n.exposed||(n.exposed={});Pe.forEach(Le=>{Object.defineProperty(ye,Le,{get:()=>o[Le],set:ze=>o[Le]=ze})})}else n.exposed||(n.exposed={});Ue&&n.render===Js&&(n.render=Ue),at!=null&&(n.inheritAttrs=at),bt&&(n.components=bt),Rt&&(n.directives=Rt),Ot&&gE(n)}function gO(n,h,o=Js){we(n)&&(n=r$(n));for(const c in n){const m=n[c];let f;Lt(m)?"default"in m?f=Uc(m.from||c,m.default,!0):f=Uc(m.from||c):f=Uc(m),qt(f)?Object.defineProperty(h,c,{enumerable:!0,configurable:!0,get:()=>f.value,set:R=>f.value=R}):h[c]=f}}function gm(n,h,o){Qs(we(n)?n.map(c=>c.bind(h.proxy)):n.bind(h.proxy),h,o)}function OE(n,h,o,c){let m=c.includes(".")?PE(o,c):()=>o[c];if(Pt(n)){const f=h[n];De(f)&&Vd(m,f)}else if(De(n))Vd(m,n.bind(o));else if(Lt(n))if(we(n))n.forEach(f=>OE(f,h,o,c));else{const f=De(n.handler)?n.handler.bind(o):h[n.handler];De(f)&&Vd(m,f,n)}}function L$(n){const h=n.type,{mixins:o,extends:c}=h,{mixins:m,optionsCache:f,config:{optionMergeStrategies:R}}=n.appContext,N=f.get(h);let k;return N?k=N:!m.length&&!o&&!c?k=h:(k={},m.length&&m.forEach(F=>Yc(k,F,R,!0)),Yc(k,h,R)),Lt(h)&&f.set(h,k),k}function Yc(n,h,o,c=!1){const{mixins:m,extends:f}=h;f&&Yc(n,f,o,!0),m&&m.forEach(R=>Yc(n,R,o,!0));for(const R in h)if(!(c&&R==="expose")){const N=mO[R]||o&&o[R];n[R]=N?N(n[R],h[R]):h[R]}return n}const mO={data:mm,props:Em,emits:Em,methods:Bn,computed:Bn,beforeCreate:Kt,created:Kt,beforeMount:Kt,mounted:Kt,beforeUpdate:Kt,updated:Kt,beforeDestroy:Kt,beforeUnmount:Kt,destroyed:Kt,unmounted:Kt,activated:Kt,deactivated:Kt,errorCaptured:Kt,serverPrefetch:Kt,components:Bn,directives:Bn,watch:fO,provide:mm,inject:EO};function mm(n,h){return h?n?function(){return Vt(De(n)?n.call(this,this):n,De(h)?h.call(this,this):h)}:h:n}function EO(n,h){return Bn(r$(n),r$(h))}function r$(n){if(we(n)){const h={};for(let o=0;o1)return o&&De(h)?h.call(c&&c.proxy):h}}const RE={},SE=()=>Object.create(RE),NE=n=>Object.getPrototypeOf(n)===RE;function RO(n,h,o,c=!1){const m={},f=SE();n.propsDefaults=Object.create(null),CE(n,h,m,f);for(const R in n.propsOptions[0])R in m||(m[R]=void 0);o?n.props=c?m:GI(m):n.type.props?n.props=m:n.props=f,n.attrs=f}function SO(n,h,o,c){const{props:m,attrs:f,vnode:{patchFlag:R}}=n,N=tt(m),[k]=n.propsOptions;let F=!1;if((c||R>0)&&!(R&16)){if(R&8){const w=n.vnode.dynamicProps;for(let P=0;P{k=!0;const[W,ae]=LE(P,h,!0);Vt(R,W),ae&&N.push(...ae)};!o&&h.mixins.length&&h.mixins.forEach(w),n.extends&&w(n.extends),n.mixins&&n.mixins.forEach(w)}if(!f&&!k)return Lt(n)&&c.set(n,Ar),Ar;if(we(f))for(let w=0;wn[0]==="_"||n==="$stable",A$=n=>we(n)?n.map(Ks):[Ks(n)],CO=(n,h,o)=>{if(h._n)return h;const c=TE((...m)=>A$(h(...m)),o);return c._c=!1,c},ME=(n,h,o)=>{const c=n._ctx;for(const m in n){if(AE(m))continue;const f=n[m];if(De(f))h[m]=CO(m,f,c);else if(f!=null){const R=A$(f);h[m]=()=>R}}},vE=(n,h)=>{const o=A$(h);n.slots.default=()=>o},yE=(n,h,o)=>{for(const c in h)(o||c!=="_")&&(n[c]=h[c])},LO=(n,h,o)=>{const c=n.slots=SE();if(n.vnode.shapeFlag&32){const m=h._;m?(yE(c,h,o),o&&Wm(c,"_",m,!0)):ME(h,c)}else h&&vE(n,h)},AO=(n,h,o)=>{const{vnode:c,slots:m}=n;let f=!0,R=lt;if(c.shapeFlag&32){const N=h._;N?o&&N===1?f=!1:yE(m,h,o):(f=!h.$stable,ME(h,m)),R=h}else h&&(vE(n,h),R={default:1});if(f)for(const N in m)!AE(N)&&R[N]==null&&delete m[N]},ls=VO;function MO(n){return vO(n)}function vO(n,h){const o=Xm();o.__VUE__=!0;const{insert:c,remove:m,patchProp:f,createElement:R,createText:N,createComment:k,setText:F,setElementText:w,parentNode:P,nextSibling:W,setScopeId:ae=Js,insertStaticContent:re}=n,X=(C,v,G,Z=null,z=null,q=null,ie=void 0,A=null,U=!!v.dynamicChildren)=>{if(C===v)return;C&&!Dn(C,v)&&(Z=pt(C),rt(C,z,q,!0),C=null),v.patchFlag===-2&&(U=!1,v.dynamicChildren=null);const{type:K,ref:oe,shapeFlag:ne}=v;switch(K){case su:be(C,v,G,Z);break;case qn:Re(C,v,G,Z);break;case Xd:C==null&&Se(v,G,Z,ie);break;case js:bt(C,v,G,Z,z,q,ie,A,U);break;default:ne&1?Ue(C,v,G,Z,z,q,ie,A,U):ne&6?Rt(C,v,G,Z,z,q,ie,A,U):(ne&64||ne&128)&&K.process(C,v,G,Z,z,q,ie,A,U,pe)}oe!=null&&z&&s$(oe,C&&C.ref,q,v||C,!v)},be=(C,v,G,Z)=>{if(C==null)c(v.el=N(v.children),G,Z);else{const z=v.el=C.el;v.children!==C.children&&F(z,v.children)}},Re=(C,v,G,Z)=>{C==null?c(v.el=k(v.children||""),G,Z):v.el=C.el},Se=(C,v,G,Z)=>{[C.el,C.anchor]=re(C.children,v,G,Z,C.el,C.anchor)},ve=({el:C,anchor:v},G,Z)=>{let z;for(;C&&C!==v;)z=W(C),c(C,G,Z),C=z;c(v,G,Z)},de=({el:C,anchor:v})=>{let G;for(;C&&C!==v;)G=W(C),m(C),C=G;m(v)},Ue=(C,v,G,Z,z,q,ie,A,U)=>{v.type==="svg"?ie="svg":v.type==="math"&&(ie="mathml"),C==null?it(v,G,Z,z,q,ie,A,U):Ot(C,v,z,q,ie,A,U)},it=(C,v,G,Z,z,q,ie,A)=>{let U,K;const{props:oe,shapeFlag:ne,transition:$,dirs:L}=C;if(U=C.el=R(C.type,q,oe&&oe.is,oe),ne&8?w(U,C.children):ne&16&&$e(C.children,U,null,Z,z,Gd(C,q),ie,A),L&&Ci(C,null,Z,"created"),He(U,C,C.scopeId,ie,Z),oe){for(const ce in oe)ce!=="value"&&!Un(ce)&&f(U,ce,null,oe[ce],q,Z);"value"in oe&&f(U,"value",null,oe.value,q),(K=oe.onVnodeBeforeMount)&&Ys(K,Z,C)}L&&Ci(C,null,Z,"beforeMount");const le=yO(z,$);le&&$.beforeEnter(U),c(U,v,G),((K=oe&&oe.onVnodeMounted)||le||L)&&ls(()=>{K&&Ys(K,Z,C),le&&$.enter(U),L&&Ci(C,null,Z,"mounted")},z)},He=(C,v,G,Z,z)=>{if(G&&ae(C,G),Z)for(let q=0;q{for(let K=U;K{const A=v.el=C.el;let{patchFlag:U,dynamicChildren:K,dirs:oe}=v;U|=C.patchFlag&16;const ne=C.props||lt,$=v.props||lt;let L;if(G&&Li(G,!1),(L=$.onVnodeBeforeUpdate)&&Ys(L,G,v,C),oe&&Ci(v,C,G,"beforeUpdate"),G&&Li(G,!0),(ne.innerHTML&&$.innerHTML==null||ne.textContent&&$.textContent==null)&&w(A,""),K?Pe(C.dynamicChildren,K,A,G,Z,Gd(v,z),q):ie||Le(C,v,A,null,G,Z,Gd(v,z),q,!1),U>0){if(U&16)at(A,ne,$,G,z);else if(U&2&&ne.class!==$.class&&f(A,"class",null,$.class,z),U&4&&f(A,"style",ne.style,$.style,z),U&8){const le=v.dynamicProps;for(let ce=0;ce{L&&Ys(L,G,v,C),oe&&Ci(v,C,G,"updated")},Z)},Pe=(C,v,G,Z,z,q,ie)=>{for(let A=0;A{if(v!==G){if(v!==lt)for(const q in v)!Un(q)&&!(q in G)&&f(C,q,v[q],null,z,Z);for(const q in G){if(Un(q))continue;const ie=G[q],A=v[q];ie!==A&&q!=="value"&&f(C,q,A,ie,z,Z)}"value"in G&&f(C,"value",v.value,G.value,z)}},bt=(C,v,G,Z,z,q,ie,A,U)=>{const K=v.el=C?C.el:N(""),oe=v.anchor=C?C.anchor:N("");let{patchFlag:ne,dynamicChildren:$,slotScopeIds:L}=v;L&&(A=A?A.concat(L):L),C==null?(c(K,G,Z),c(oe,G,Z),$e(v.children||[],G,oe,z,q,ie,A,U)):ne>0&&ne&64&&$&&C.dynamicChildren?(Pe(C.dynamicChildren,$,G,z,q,ie,A),(v.key!=null||z&&v===z.subTree)&&kE(C,v,!0)):Le(C,v,G,oe,z,q,ie,A,U)},Rt=(C,v,G,Z,z,q,ie,A,U)=>{v.slotScopeIds=A,C==null?v.shapeFlag&512?z.ctx.activate(v,G,Z,ie,U):xe(v,G,Z,z,q,ie,U):dt(C,v,U)},xe=(C,v,G,Z,z,q,ie)=>{const A=C.component=tb(C,Z,z);if(mE(C)&&(A.ctx.renderer=pe),sb(A,!1,ie),A.asyncDep){if(z&&z.registerDep(A,Ne,ie),!C.el){const U=A.subTree=So(qn);Re(null,U,v,G)}}else Ne(A,C,v,G,z,q,ie)},dt=(C,v,G)=>{const Z=v.component=C.component;if(HO(C,v,G))if(Z.asyncDep&&!Z.asyncResolved){ye(Z,v,G);return}else Z.next=v,Z.update();else v.el=C.el,Z.vnode=v},Ne=(C,v,G,Z,z,q,ie)=>{const A=()=>{if(C.isMounted){let{next:ne,bu:$,u:L,parent:le,vnode:ce}=C;{const g=DE(C);if(g){ne&&(ne.el=ce.el,ye(C,ne,ie)),g.asyncDep.then(()=>{C.isUnmounted||A()});return}}let ue=ne,he;Li(C,!1),ne?(ne.el=ce.el,ye(C,ne,ie)):ne=ce,$&&xd($),(he=ne.props&&ne.props.onVnodeBeforeUpdate)&&Ys(he,le,ne,ce),Li(C,!0);const Ie=Wd(C),Ee=C.subTree;C.subTree=Ie,X(Ee,Ie,P(Ee.el),pt(Ee),C,z,q),ne.el=Ie.el,ue===null&&GO(C,Ie.el),L&&ls(L,z),(he=ne.props&&ne.props.onVnodeUpdated)&&ls(()=>Ys(he,le,ne,ce),z)}else{let ne;const{el:$,props:L}=v,{bm:le,m:ce,parent:ue,root:he,type:Ie}=C,Ee=Vn(v);if(Li(C,!1),le&&xd(le),!Ee&&(ne=L&&L.onVnodeBeforeMount)&&Ys(ne,ue,v),Li(C,!0),$&&Ae){const g=()=>{C.subTree=Wd(C),Ae($,C.subTree,C,z,null)};Ee&&Ie.__asyncHydrate?Ie.__asyncHydrate($,C,g):g()}else{he.ce&&he.ce._injectChildStyle(Ie);const g=C.subTree=Wd(C);X(null,g,G,Z,C,z,q),v.el=g.el}if(ce&&ls(ce,z),!Ee&&(ne=L&&L.onVnodeMounted)){const g=v;ls(()=>Ys(ne,ue,g),z)}(v.shapeFlag&256||ue&&Vn(ue.vnode)&&ue.vnode.shapeFlag&256)&&C.a&&ls(C.a,z),C.isMounted=!0,v=G=Z=null}};C.scope.on();const U=C.effect=new zm(A);C.scope.off();const K=C.update=U.run.bind(U),oe=C.job=U.runIfDirty.bind(U);oe.i=C,oe.id=C.uid,U.scheduler=()=>N$(oe),Li(C,!0),K()},ye=(C,v,G)=>{v.component=C;const Z=C.vnode.props;C.vnode=v,C.next=null,SO(C,v.props,Z,G),AO(C,v.children,G),jo(),$m(C),Ko()},Le=(C,v,G,Z,z,q,ie,A,U=!1)=>{const K=C&&C.children,oe=C?C.shapeFlag:0,ne=v.children,{patchFlag:$,shapeFlag:L}=v;if($>0){if($&128){$t(K,ne,G,Z,z,q,ie,A,U);return}else if($&256){ze(K,ne,G,Z,z,q,ie,A,U);return}}L&8?(oe&16&&je(K,z,q),ne!==K&&w(G,ne)):oe&16?L&16?$t(K,ne,G,Z,z,q,ie,A,U):je(K,z,q,!0):(oe&8&&w(G,""),L&16&&$e(ne,G,Z,z,q,ie,A,U))},ze=(C,v,G,Z,z,q,ie,A,U)=>{C=C||Ar,v=v||Ar;const K=C.length,oe=v.length,ne=Math.min(K,oe);let $;for($=0;$oe?je(C,z,q,!0,!1,ne):$e(v,G,Z,z,q,ie,A,U,ne)},$t=(C,v,G,Z,z,q,ie,A,U)=>{let K=0;const oe=v.length;let ne=C.length-1,$=oe-1;for(;K<=ne&&K<=$;){const L=C[K],le=v[K]=U?Yo(v[K]):Ks(v[K]);if(Dn(L,le))X(L,le,G,null,z,q,ie,A,U);else break;K++}for(;K<=ne&&K<=$;){const L=C[ne],le=v[$]=U?Yo(v[$]):Ks(v[$]);if(Dn(L,le))X(L,le,G,null,z,q,ie,A,U);else break;ne--,$--}if(K>ne){if(K<=$){const L=$+1,le=L$)for(;K<=ne;)rt(C[K],z,q,!0),K++;else{const L=K,le=K,ce=new Map;for(K=le;K<=$;K++){const y=v[K]=U?Yo(v[K]):Ks(v[K]);y.key!=null&&ce.set(y.key,K)}let ue,he=0;const Ie=$-le+1;let Ee=!1,g=0;const O=new Array(Ie);for(K=0;K=Ie){rt(y,z,q,!0);continue}let Y;if(y.key!=null)Y=ce.get(y.key);else for(ue=le;ue<=$;ue++)if(O[ue-le]===0&&Dn(y,v[ue])){Y=ue;break}Y===void 0?rt(y,z,q,!0):(O[Y-le]=K+1,Y>=g?g=Y:Ee=!0,X(y,v[Y],G,null,z,q,ie,A,U),he++)}const M=Ee?kO(O):Ar;for(ue=M.length-1,K=Ie-1;K>=0;K--){const y=le+K,Y=v[y],a=y+1{const{el:q,type:ie,transition:A,children:U,shapeFlag:K}=C;if(K&6){_t(C.component.subTree,v,G,Z);return}if(K&128){C.suspense.move(v,G,Z);return}if(K&64){ie.move(C,v,G,pe);return}if(ie===js){c(q,v,G);for(let ne=0;neA.enter(q),z);else{const{leave:ne,delayLeave:$,afterLeave:L}=A,le=()=>c(q,v,G),ce=()=>{ne(q,()=>{le(),L&&L()})};$?$(q,le,ce):ce()}else c(q,v,G)},rt=(C,v,G,Z=!1,z=!1)=>{const{type:q,props:ie,ref:A,children:U,dynamicChildren:K,shapeFlag:oe,patchFlag:ne,dirs:$,cacheIndex:L}=C;if(ne===-2&&(z=!1),A!=null&&s$(A,null,G,C,!0),L!=null&&(v.renderCache[L]=void 0),oe&256){v.ctx.deactivate(C);return}const le=oe&1&&$,ce=!Vn(C);let ue;if(ce&&(ue=ie&&ie.onVnodeBeforeUnmount)&&Ys(ue,v,C),oe&6)ct(C.component,G,Z);else{if(oe&128){C.suspense.unmount(G,Z);return}le&&Ci(C,null,v,"beforeUnmount"),oe&64?C.type.remove(C,v,G,pe,Z):K&&!K.hasOnce&&(q!==js||ne>0&&ne&64)?je(K,v,G,!1,!0):(q===js&&ne&384||!z&&oe&16)&&je(U,v,G),Z&&xt(C)}(ce&&(ue=ie&&ie.onVnodeUnmounted)||le)&&ls(()=>{ue&&Ys(ue,v,C),le&&Ci(C,null,v,"unmounted")},G)},xt=C=>{const{type:v,el:G,anchor:Z,transition:z}=C;if(v===js){It(G,Z);return}if(v===Xd){de(C);return}const q=()=>{m(G),z&&!z.persisted&&z.afterLeave&&z.afterLeave()};if(C.shapeFlag&1&&z&&!z.persisted){const{leave:ie,delayLeave:A}=z,U=()=>ie(G,q);A?A(C.el,q,U):U()}else q()},It=(C,v)=>{let G;for(;C!==v;)G=W(C),m(C),C=G;m(v)},ct=(C,v,G)=>{const{bum:Z,scope:z,job:q,subTree:ie,um:A,m:U,a:K}=C;Im(U),Im(K),Z&&xd(Z),z.stop(),q&&(q.flags|=8,rt(ie,C,v,G)),A&&ls(A,v),ls(()=>{C.isUnmounted=!0},v),v&&v.pendingBranch&&!v.isUnmounted&&C.asyncDep&&!C.asyncResolved&&C.suspenseId===v.pendingId&&(v.deps--,v.deps===0&&v.resolve())},je=(C,v,G,Z=!1,z=!1,q=0)=>{for(let ie=q;ie{if(C.shapeFlag&6)return pt(C.component.subTree);if(C.shapeFlag&128)return C.suspense.next();const v=W(C.anchor||C.el),G=v&&v[ZI];return G?W(G):v};let Tt=!1;const kt=(C,v,G)=>{C==null?v._vnode&&rt(v._vnode,null,null,!0):X(v._vnode||null,C,v,null,null,null,G),v._vnode=C,Tt||(Tt=!0,$m(),$E(),Tt=!1)},pe={p:X,um:rt,m:_t,r:xt,mt:xe,mc:$e,pc:Le,pbc:Pe,n:pt,o:n};let Je,Ae;return{render:kt,hydrate:Je,createApp:OO(kt,Je)}}function Gd({type:n,props:h},o){return o==="svg"&&n==="foreignObject"||o==="mathml"&&n==="annotation-xml"&&h&&h.encoding&&h.encoding.includes("html")?void 0:o}function Li({effect:n,job:h},o){o?(n.flags|=32,h.flags|=4):(n.flags&=-33,h.flags&=-5)}function yO(n,h){return(!n||n&&!n.pendingBranch)&&h&&!h.persisted}function kE(n,h,o=!1){const c=n.children,m=h.children;if(we(c)&&we(m))for(let f=0;f>1,n[o[N]]0&&(h[c]=o[f-1]),o[f]=c)}}for(f=o.length,R=o[f-1];f-- >0;)o[f]=R,R=h[R];return o}function DE(n){const h=n.subTree.component;if(h)return h.asyncDep&&!h.asyncResolved?h:DE(h)}function Im(n){if(n)for(let h=0;hUc(DO);function Vd(n,h,o){return wE(n,h,o)}function wE(n,h,o=lt){const{immediate:c,deep:m,flush:f,once:R}=o,N=Vt({},o);let k;if(ou)if(f==="sync"){const W=wO();k=W.__watcherHandles||(W.__watcherHandles=[])}else if(!h||c)N.once=!0;else{const W=()=>{};return W.stop=Js,W.resume=Js,W.pause=Js,W}const F=Gt;N.call=(W,ae,re)=>Qs(W,F,ae,re);let w=!1;f==="post"?N.scheduler=W=>{ls(W,F&&F.suspense)}:f!=="sync"&&(w=!0,N.scheduler=(W,ae)=>{ae?W():N$(W)}),N.augmentJob=W=>{h&&(W.flags|=4),w&&(W.flags|=2,F&&(W.id=F.uid,W.i=F))};const P=KI(n,h,N);return k&&k.push(P),P}function PO(n,h,o){const c=this.proxy,m=Pt(n)?n.includes(".")?PE(c,n):()=>c[n]:n.bind(c,c);let f;De(h)?f=h:(f=h.handler,o=h);const R=el(this),N=wE(m,f.bind(c),o);return R(),N}function PE(n,h){const o=h.split(".");return()=>{let c=n;for(let m=0;mh==="modelValue"||h==="model-value"?n.modelModifiers:n[`${h}Modifiers`]||n[`${Ms(h)}Modifiers`]||n[`${yi(h)}Modifiers`];function BO(n,h,...o){if(n.isUnmounted)return;const c=n.vnode.props||lt;let m=o;const f=h.startsWith("update:"),R=f&&xO(c,h.slice(7));R&&(R.trim&&(m=o.map(w=>Pt(w)?w.trim():w)),R.number&&(m=o.map(dI)));let N,k=c[N=Pd(h)]||c[N=Pd(Ms(h))];!k&&f&&(k=c[N=Pd(yi(h))]),k&&Qs(k,n,6,m);const F=c[N+"Once"];if(F){if(!n.emitted)n.emitted={};else if(n.emitted[N])return;n.emitted[N]=!0,Qs(F,n,6,m)}}function xE(n,h,o=!1){const c=h.emitsCache,m=c.get(n);if(m!==void 0)return m;const f=n.emits;let R={},N=!1;if(!De(n)){const k=F=>{const w=xE(F,h,!0);w&&(N=!0,Vt(R,w))};!o&&h.mixins.length&&h.mixins.forEach(k),n.extends&&k(n.extends),n.mixins&&n.mixins.forEach(k)}return!f&&!N?(Lt(n)&&c.set(n,null),null):(we(f)?f.forEach(k=>R[k]=null):Vt(R,f),Lt(n)&&c.set(n,R),R)}function tu(n,h){return!n||!jc(h)?!1:(h=h.slice(2).replace(/Once$/,""),Ke(n,h[0].toLowerCase()+h.slice(1))||Ke(n,yi(h))||Ke(n,h))}function Wd(n){const{type:h,vnode:o,proxy:c,withProxy:m,propsOptions:[f],slots:R,attrs:N,emit:k,render:F,renderCache:w,props:P,data:W,setupState:ae,ctx:re,inheritAttrs:X}=n,be=Xc(n);let Re,Se;try{if(o.shapeFlag&4){const de=m||c,Ue=de;Re=Ks(F.call(Ue,de,w,P,ae,W,re)),Se=N}else{const de=h;Re=Ks(de.length>1?de(P,{attrs:N,slots:R,emit:k}):de(P,null)),Se=h.props?N:FO(N)}}catch(de){Xn.length=0,Zc(de,n,1),Re=So(qn)}let ve=Re;if(Se&&X!==!1){const de=Object.keys(Se),{shapeFlag:Ue}=ve;de.length&&Ue&7&&(f&&de.some(a$)&&(Se=UO(Se,f)),ve=kr(ve,Se,!1,!0))}return o.dirs&&(ve=kr(ve,null,!1,!0),ve.dirs=ve.dirs?ve.dirs.concat(o.dirs):o.dirs),o.transition&&C$(ve,o.transition),Re=ve,Xc(be),Re}const FO=n=>{let h;for(const o in n)(o==="class"||o==="style"||jc(o))&&((h||(h={}))[o]=n[o]);return h},UO=(n,h)=>{const o={};for(const c in n)(!a$(c)||!(c.slice(9)in h))&&(o[c]=n[c]);return o};function HO(n,h,o){const{props:c,children:m,component:f}=n,{props:R,children:N,patchFlag:k}=h,F=f.emitsOptions;if(h.dirs||h.transition)return!0;if(o&&k>=0){if(k&1024)return!0;if(k&16)return c?Om(c,R,F):!!R;if(k&8){const w=h.dynamicProps;for(let P=0;Pn.__isSuspense;function VO(n,h){h&&h.pendingBranch?we(n)?h.effects.push(...n):h.effects.push(n):QI(n)}const js=Symbol.for("v-fgt"),su=Symbol.for("v-txt"),qn=Symbol.for("v-cmt"),Xd=Symbol.for("v-stc"),Xn=[];let as=null;function WO(n=!1){Xn.push(as=n?null:[])}function XO(){Xn.pop(),as=Xn[Xn.length-1]||null}let Qn=1;function bm(n){Qn+=n,n<0&&as&&(as.hasOnce=!0)}function YO(n){return n.dynamicChildren=Qn>0?as||Ar:null,XO(),Qn>0&&as&&as.push(n),n}function zO(n,h,o,c,m,f){return YO(M$(n,h,o,c,m,f,!0))}function jO(n){return n?n.__v_isVNode===!0:!1}function Dn(n,h){return n.type===h.type&&n.key===h.key}const FE=({key:n})=>n??null,Hc=({ref:n,ref_key:h,ref_for:o})=>(typeof n=="number"&&(n=""+n),n!=null?Pt(n)||qt(n)||De(n)?{i:Ls,r:n,k:h,f:!!o}:n:null);function M$(n,h=null,o=null,c=0,m=null,f=n===js?0:1,R=!1,N=!1){const k={__v_isVNode:!0,__v_skip:!0,type:n,props:h,key:h&&FE(h),ref:h&&Hc(h),scopeId:pE,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:f,patchFlag:c,dynamicProps:m,dynamicChildren:null,appContext:null,ctx:Ls};return N?(v$(k,o),f&128&&n.normalize(k)):o&&(k.shapeFlag|=Pt(o)?8:16),Qn>0&&!R&&as&&(k.patchFlag>0||f&6)&&k.patchFlag!==32&&as.push(k),k}const So=KO;function KO(n,h=null,o=null,c=0,m=null,f=!1){if((!n||n===$O)&&(n=qn),jO(n)){const N=kr(n,h,!0);return o&&v$(N,o),Qn>0&&!f&&as&&(N.shapeFlag&6?as[as.indexOf(n)]=N:as.push(N)),N.patchFlag=-2,N}if(lb(n)&&(n=n.__vccOpts),h){h=JO(h);let{class:N,style:k}=h;N&&!Pt(N)&&(h.class=_$(N)),Lt(k)&&(b$(k)&&!we(k)&&(k=Vt({},k)),h.style=$$(k))}const R=Pt(n)?1:BE(n)?128:eO(n)?64:Lt(n)?4:De(n)?2:0;return M$(n,h,o,c,m,R,f,!0)}function JO(n){return n?b$(n)||NE(n)?Vt({},n):n:null}function kr(n,h,o=!1,c=!1){const{props:m,ref:f,patchFlag:R,children:N,transition:k}=n,F=h?QO(m||{},h):m,w={__v_isVNode:!0,__v_skip:!0,type:n.type,props:F,key:F&&FE(F),ref:h&&h.ref?o&&f?we(f)?f.concat(Hc(h)):[f,Hc(h)]:Hc(h):f,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:N,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:h&&n.type!==js?R===-1?16:R|16:R,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:k,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&kr(n.ssContent),ssFallback:n.ssFallback&&kr(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return k&&c&&C$(w,k.clone(w)),w}function qO(n=" ",h=0){return So(su,null,n,h)}function Ks(n){return n==null||typeof n=="boolean"?So(qn):we(n)?So(js,null,n.slice()):typeof n=="object"?Yo(n):So(su,null,String(n))}function Yo(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:kr(n)}function v$(n,h){let o=0;const{shapeFlag:c}=n;if(h==null)h=null;else if(we(h))o=16;else if(typeof h=="object")if(c&65){const m=h.default;m&&(m._c&&(m._d=!1),v$(n,m()),m._c&&(m._d=!0));return}else{o=32;const m=h._;!m&&!NE(h)?h._ctx=Ls:m===3&&Ls&&(Ls.slots._===1?h._=1:(h._=2,n.patchFlag|=1024))}else De(h)?(h={default:h,_ctx:Ls},o=32):(h=String(h),c&64?(o=16,h=[qO(h)]):o=8);n.children=h,n.shapeFlag|=o}function QO(...n){const h={};for(let o=0;o{let m;return(m=n[o])||(m=n[o]=[]),m.push(c),f=>{m.length>1?m.forEach(R=>R(f)):m[0](f)}};zc=h("__VUE_INSTANCE_SETTERS__",o=>Gt=o),l$=h("__VUE_SSR_SETTERS__",o=>ou=o)}const el=n=>{const h=Gt;return zc(n),n.scope.on(),()=>{n.scope.off(),zc(h)}},Rm=()=>{Gt&&Gt.scope.off(),zc(null)};function UE(n){return n.vnode.shapeFlag&4}let ou=!1;function sb(n,h=!1,o=!1){h&&l$(h);const{props:c,children:m}=n.vnode,f=UE(n);RO(n,c,f,h),LO(n,m,o);const R=f?ob(n,h):void 0;return h&&l$(!1),R}function ob(n,h){const o=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,pO);const{setup:c}=o;if(c){const m=n.setupContext=c.length>1?rb(n):null,f=el(n);jo();const R=Zn(c,n,0,[n.props,m]);if(Ko(),f(),Vm(R)){if(Vn(n)||gE(n),R.then(Rm,Rm),h)return R.then(N=>{Sm(n,N,h)}).catch(N=>{Zc(N,n,0)});n.asyncDep=R}else Sm(n,R,h)}else HE(n,h)}function Sm(n,h,o){De(h)?n.type.__ssrInlineRender?n.ssrRender=h:n.render=h:Lt(h)&&(n.setupState=uE(h)),HE(n,o)}let Nm;function HE(n,h,o){const c=n.type;if(!n.render){if(!h&&Nm&&!c.render){const m=c.template||L$(n).template;if(m){const{isCustomElement:f,compilerOptions:R}=n.appContext.config,{delimiters:N,compilerOptions:k}=c,F=Vt(Vt({isCustomElement:f,delimiters:N},R),k);c.render=Nm(m,F)}}n.render=c.render||Js}{const m=el(n);jo();try{TO(n)}finally{Ko(),m()}}}const ib={get(n,h){return Wt(n,"get",""),n[h]}};function rb(n){const h=o=>{n.exposed=o||{}};return{attrs:new Proxy(n.attrs,ib),slots:n.slots,emit:n.emit,expose:h}}function y$(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(uE(VI(n.exposed)),{get(h,o){if(o in h)return h[o];if(o in Wn)return Wn[o](n)},has(h,o){return o in h||o in Wn}})):n.proxy}function nb(n,h=!0){return De(n)?n.displayName||n.name:n.name||h&&n.__name}function lb(n){return De(n)&&"__vccOpts"in n}const cb=(n,h)=>zI(n,h,ou),ub="3.5.6";/** -* @vue/runtime-dom v3.5.6 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let c$;const Cm=typeof window<"u"&&window.trustedTypes;if(Cm)try{c$=Cm.createPolicy("vue",{createHTML:n=>n})}catch{}const GE=c$?n=>c$.createHTML(n):n=>n,ab="http://www.w3.org/2000/svg",hb="http://www.w3.org/1998/Math/MathML",bo=typeof document<"u"?document:null,Lm=bo&&bo.createElement("template"),db={insert:(n,h,o)=>{h.insertBefore(n,o||null)},remove:n=>{const h=n.parentNode;h&&h.removeChild(n)},createElement:(n,h,o,c)=>{const m=h==="svg"?bo.createElementNS(ab,n):h==="mathml"?bo.createElementNS(hb,n):o?bo.createElement(n,{is:o}):bo.createElement(n);return n==="select"&&c&&c.multiple!=null&&m.setAttribute("multiple",c.multiple),m},createText:n=>bo.createTextNode(n),createComment:n=>bo.createComment(n),setText:(n,h)=>{n.nodeValue=h},setElementText:(n,h)=>{n.textContent=h},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>bo.querySelector(n),setScopeId(n,h){n.setAttribute(h,"")},insertStaticContent(n,h,o,c,m,f){const R=o?o.previousSibling:h.lastChild;if(m&&(m===f||m.nextSibling))for(;h.insertBefore(m.cloneNode(!0),o),!(m===f||!(m=m.nextSibling)););else{Lm.innerHTML=GE(c==="svg"?`${n}`:c==="mathml"?`${n}`:n);const N=Lm.content;if(c==="svg"||c==="mathml"){const k=N.firstChild;for(;k.firstChild;)N.appendChild(k.firstChild);N.removeChild(k)}h.insertBefore(N,o)}return[R?R.nextSibling:h.firstChild,o?o.previousSibling:h.lastChild]}},$b=Symbol("_vtc");function _b(n,h,o){const c=n[$b];c&&(h=(h?[h,...c]:[...c]).join(" ")),h==null?n.removeAttribute("class"):o?n.setAttribute("class",h):n.className=h}const Am=Symbol("_vod"),pb=Symbol("_vsh"),Tb=Symbol(""),gb=/(^|;)\s*display\s*:/;function mb(n,h,o){const c=n.style,m=Pt(o);let f=!1;if(o&&!m){if(h)if(Pt(h))for(const R of h.split(";")){const N=R.slice(0,R.indexOf(":")).trim();o[N]==null&&Gc(c,N,"")}else for(const R in h)o[R]==null&&Gc(c,R,"");for(const R in o)R==="display"&&(f=!0),Gc(c,R,o[R])}else if(m){if(h!==o){const R=c[Tb];R&&(o+=";"+R),c.cssText=o,f=gb.test(o)}}else h&&n.removeAttribute("style");Am in n&&(n[Am]=f?c.display:"",n[pb]&&(c.display="none"))}const Mm=/\s*!important$/;function Gc(n,h,o){if(we(o))o.forEach(c=>Gc(n,h,c));else if(o==null&&(o=""),h.startsWith("--"))n.setProperty(h,o);else{const c=Eb(n,h);Mm.test(o)?n.setProperty(yi(c),o.replace(Mm,""),"important"):n[c]=o}}const vm=["Webkit","Moz","ms"],Yd={};function Eb(n,h){const o=Yd[h];if(o)return o;let c=Ms(h);if(c!=="filter"&&c in n)return Yd[h]=c;c=qc(c);for(let m=0;mzd||(Sb.then(()=>zd=0),zd=Date.now());function Cb(n,h){const o=c=>{if(!c._vts)c._vts=Date.now();else if(c._vts<=o.attached)return;Qs(Lb(c,o.value),h,5,[c])};return o.value=n,o.attached=Nb(),o}function Lb(n,h){if(we(h)){const o=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{o.call(n),n._stopped=!0},h.map(c=>m=>!m._stopped&&c&&c(m))}else return h}const Pm=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,Ab=(n,h,o,c,m,f)=>{const R=m==="svg";h==="class"?_b(n,c,R):h==="style"?mb(n,o,c):jc(h)?a$(h)||bb(n,h,o,c,f):(h[0]==="."?(h=h.slice(1),!0):h[0]==="^"?(h=h.slice(1),!1):Mb(n,h,c,R))?(fb(n,h,c),!n.tagName.includes("-")&&(h==="value"||h==="checked"||h==="selected")&&km(n,h,c,R,f,h!=="value")):(h==="true-value"?n._trueValue=c:h==="false-value"&&(n._falseValue=c),km(n,h,c,R))};function Mb(n,h,o,c){if(c)return!!(h==="innerHTML"||h==="textContent"||h in n&&Pm(h)&&De(o));if(h==="spellcheck"||h==="draggable"||h==="translate"||h==="form"||h==="list"&&n.tagName==="INPUT"||h==="type"&&n.tagName==="TEXTAREA")return!1;if(h==="width"||h==="height"){const m=n.tagName;if(m==="IMG"||m==="VIDEO"||m==="CANVAS"||m==="SOURCE")return!1}return Pm(h)&&Pt(o)?!1:!!(h in n||n._isVueCE&&(/[A-Z]/.test(h)||!Pt(o)))}const vb=Vt({patchProp:Ab},db);let xm;function yb(){return xm||(xm=MO(vb))}const kb=(...n)=>{const h=yb().createApp(...n),{mount:o}=h;return h.mount=c=>{const m=wb(c);if(!m)return;const f=h._component;!De(f)&&!f.render&&!f.template&&(f.template=m.innerHTML),m.nodeType===1&&(m.textContent="");const R=o(m,!1,Db(m));return m instanceof Element&&(m.removeAttribute("v-cloak"),m.setAttribute("data-v-app","")),R},h};function Db(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function wb(n){return Pt(n)?document.querySelector(n):n}var hs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function VE(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var WE={exports:{}},jd={exports:{}},Bm;function Co(){return Bm||(Bm=1,function(n,h){(function(o,c){n.exports=c()})(hs,function(){var o={},c,m,f,R,N,k,F,w,P,W,ae,re,X,be,Re,Se,ve,de,Ue,it,He,$e,Ot,Pe,at,bt,Rt,xe,dt,Ne,ye,Le,ze,$t,_t,rt,xt,It,ct,je,pt,Tt,kt,pe,Je,Ae,C,v,G,Z,z,q,ie,A,U,K,oe,ne,$,L,le,ce,ue,he,Ie,Ee,g,O,M,y,Y,a,T,d,u,l,_,E,b,B,te,fe,Ge,ut,St,Zs,D$,wr,tl,w$,sl,P$,ol,iu,ru,il,rl,nl,Pr,x$,ll,B$,F$,cl,U$,nu,ki,H$,ul,lu,cu,G$,al,Di,hl,V$,uu,au,W$,X$,Jo,Y$,xr,hu,vs,eo,z$,du,dl,$u,j$,_u,Br,K$,wi,Fr,$l,J$,q$,Q$,Lo,Dt,Ur,ts,Z$,e_,t_,s_,o_,i_,r_,pu,to,Pi,Tu,n_,l_,c_,u_,a_,h_,d_,$_,__,gu,p_,xi,_l,T_,Bi,mu,Eu,fu,pl,Tl,Iu,g_,Ou,bu,Ru,Su,Nu,Cu,Lu,m_,Hr,Au,gl,ml,ys,Mu,vu,Gr,yu,ku,E_,El,Du,f_,I_,O_,b_,R_,Fi,wu,Pu,Ui,fl,S_,N_,xu,Bu,so,Fu,Uu,C_,L_,A_,M_,Hu,v_,Gu,y_,qo,Vr,Il,Ol,Qo,Vu,bl,Wu,gt,k_,Hi,Gi,D_,Xu,Rl,Vi,Yu,Zo,Wr,zu,ju,w_,P_,x_,Ku,B_,Ju,Xr,F_,U_,H_,G_,Yr,qu,V_,zr,Qu,jr,W_,X_,Ao,Zu,ks,Y_,z_,ea,j_,ei,ta,K_,J_,q_,Q_,Z_,sa,ep,tp,Sl,sp,op,oa,Nl,ia,Cl,ra,na,Wi,ti,oo,Mo,Ll,Ds,ip,rp,np,lp,la,cp,ca,Al,up,ap,hp,ua,Ml,aa,vl,dp,$p,_p,pp,vo,Oe,Qt,At,nt,ws,Xi,ge,mt,ha,Tp,yl,da,gp,$a,kl,_a,pa,mp,Ta,Ep,Dl,fp,Ip,Op,bp,Rp,ga,Sp,Kr,Jr,Np,ma,Ea,fa,Ia,wl,Oa,Cp,Lp,Ap,Yi,ba,Mp,Pl,ds,vp,yo,Ra,yp,qr,Sa,Na,Ca,La,Aa,Ma,va,ya,ka,Da,kp,Dp,wp,Pp,xp,Bp,Fp,Up,Hp,wa,Pa,xa,Ba,Fa,Ua,Ha,xl,Qr,Ga,Gp,Va,Wa,Xa,Ya,za,ja,Ka,Ja,qa,Qa,Vp,Wp,Xp,Za,Yp,zp,jp,Kp,Jp,J;c=function(e,t,s,i){if(!(e instanceof ee)&&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=`${e}`.toLowerCase(),typeof t!="string"||t.trim()==="")throw Error('Invalid name "'+t+'". The name must be a non-empty string.');const r=t.toLowerCase();if(!s)throw Error("Can not register a null value");let p=ko[e],I=Bl[e];if(p||(p=ko[e]=Object.create(null),I=Bl[e]=Object.create(null)),m(e,s),!i&&p[r]&&p[r]!==s)throw Error('Name "'+r+'" with type "'+e+'" already registered.');p[r]=s,I[r]=t},m=function(e,t){switch(e){case String(ee.FIELD):if(typeof t.fromJson!="function")throw Error('Type "'+e+'" must have a fromJson function')}},f=function(e,t){e=`${e}`.toLowerCase(),t=t.toLowerCase();const s=ko[e];s&&s[t]?(delete ko[e][t],delete Bl[e][t]):console.warn("Unable to unregister ["+t+"]["+e+"] from the registry.")},R=function(e,t,s){e=`${e}`.toLowerCase(),t=t.toLowerCase();const i=ko[e];if(!i||!i[t]){if(t="Unable to find ["+t+"]["+e+"] in the registry.",s)throw Error(t+" You must require or register a "+e+" plugin.");return console.warn(t),null}return i[t]},N=function(e,t){return e=`${e}`.toLowerCase(),t=t.toLowerCase(),(e=ko[e])?!!e[t]:!1},k=function(e,t,s){return R(e,t,s)},F=function(e,t,s){return R(e,t,s)},w=function(e,t,s){e=`${e}`.toLowerCase();var i=ko[e];if(!i){if(i=`Unable to find [${e}] in the registry.`,s)throw Error(`${i} You must require or register a ${e} plugin.`);return console.warn(i),null}if(!t)return i;e=Bl[e],s=Object.create(null);for(const r of Object.keys(i))s[e[r]]=i[r];return s},P=function(e,t,s){return t=t.plugins[String(e)]||Ps,typeof t=="function"?t:k(e,t,s)},W=function(){return"blockly-"+(lf++).toString(36)},ae=function(){return Qp.genUid()},o.setRecordUndo$$module$build$src$core$events$utils=function(e){zi=e},re=function(){return zi},X=function(e){Vl.fireInternal(e)},be=function(e){if(de()){if(!ni.length)try{requestAnimationFrame(()=>{setTimeout(Re,0)})}catch{setTimeout(Re,0)}ni.push(e)}},Re=function(){var e=Se(ni,!0);ni.length=0;for(let s=0,i;i=e[s];s++)if(i.workspaceId){var t=Pe(i.workspaceId);t&&t.fireChangeListener(i)}e=new Set(e.map(s=>s.workspaceId));for(const s of e){if(!s||(e=Pe(s),!e))continue;e=e.getUndoStack();let i;for(t=e.length;0>>/g,e),uh="",e=document.createElement("style"),e.id="blockly-common-style",t=document.createTextNode(t),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild)))},A=function(e,t,s){e=document.createElementNS(on,`${e}`);for(const i in t)e.setAttribute(i,`${t[i]}`);return s&&s.appendChild(e),e},U=function(e,t){return t=t.split(" "),t.every(s=>e.classList.contains(s))?!1:(e.classList.add(...t),!0)},K=function(e,t){e.classList.remove(...t.split(" "))},oe=function(e,t){return t=t.split(" "),t.every(s=>!e.classList.contains(s))?!1:(e.classList.remove(...t),!0)},ne=function(e,t){return e.classList.contains(t)},$=function(e){return e&&e.parentNode?e.parentNode.removeChild(e):null},L=function(e,t){const s=t.nextSibling;if(t=t.parentNode,!t)throw Error("Reference node has no parent.");s?t.insertBefore(e,s):t.appendChild(e)},le=function(e,t){e.style.transform=t,e.style["-webkit-transform"]=t},ce=function(){hh++,Is||(Is=Object.create(null))},ue=function(){hh--,hh||(Is=null)},he=function(e){const t=e.textContent+` -`+e.className.baseVal;let s;if(Is&&(s=Is[t]))return s;try{s=e.getComputedTextLength()}catch{return 8*e.textContent.length}return Is&&(Is[t]=s),s},Ie=function(e,t,s,i){return Ee(e,t+"pt",s,i)},Ee=function(e,t,s,i){const r=e.textContent;e=r+` -`+e.className.baseVal;var p;return Is&&(p=Is[e])||(jl||(p=document.createElement("canvas"),p.className="blocklyComputeCanvas",document.body.appendChild(p),jl=p.getContext("2d")),jl.font=s+" "+t+" "+i,p=r?jl.measureText(r).width:0,Is&&(Is[e]=p)),p},g=function(e,t,s,i){const r=document.createElement("span");r.style.font=s+" "+t+" "+i,r.textContent=e,e=document.createElement("div"),e.style.width="1px",e.style.height="0",t=document.createElement("div"),t.style.display="flex",t.style.position="fixed",t.style.top="0",t.style.left="0",t.appendChild(r),t.appendChild(e),document.body.appendChild(t),s={height:0,baseline:0};try{t.style.alignItems="baseline",s.baseline=e.offsetTop-r.offsetTop,t.style.alignItems="flex-end",s.height=e.offsetTop-r.offsetTop}finally{document.body.removeChild(t)}return s},O=function(e){return TT.getSizeInternal(e)},M=function(e){if(Y(e,"display")!=="none")return y(e);const t=e.style,s=t.display,i=t.visibility,r=t.position;t.visibility="hidden",t.position="absolute",t.display="inline";const p=e.offsetWidth;return e=e.offsetHeight,t.display=s,t.position=r,t.visibility=i,new Be(p,e)},y=function(e){return new Be(e.offsetWidth,e.offsetHeight)},Y=function(e,t){return e=window.getComputedStyle(e),e[t]||e.getPropertyValue(t)},a=function(e){const t=new se(0,0);e=e.getBoundingClientRect();var s=document.documentElement;return s=new se(window.pageXOffset||s.scrollLeft,window.pageYOffset||s.scrollTop),t.x=e.left+s.x,t.y=e.top+s.y,t},T=function(){const e=document.body,t=document.documentElement;return new se(e.scrollLeft||t.scrollLeft,e.scrollTop||t.scrollTop)},d=function(e){const t=parseFloat(Y(e,"borderLeftWidth")),s=parseFloat(Y(e,"borderRightWidth")),i=parseFloat(Y(e,"borderTopWidth"));return e=parseFloat(Y(e,"borderBottomWidth")),new qe(i,e,t,s)},u=function(e,t,s){e=l(e,t,s),t.scrollLeft=e.x,t.scrollTop=e.y},l=function(e,t,s){var i=a(e),r=a(t),p=d(t);const I=i.x-r.x-p.left;return i=i.y-r.y-p.top,r=y(e),e=t.clientWidth-r.width,r=t.clientHeight-r.height,p=t.scrollLeft,t=t.scrollTop,s?(p+=I-e/2,t+=i-r/2):(p+=Math.min(I,Math.max(I-e,0)),t+=Math.min(i,Math.max(i-r,0))),new se(p,t)},_=function(e){const t=new se(0,0);var s=e.x&&e.getAttribute("x");const i=e.y&&e.getAttribute("y");return s&&(t.x=parseInt(s)),i&&(t.y=parseInt(i)),(s=(s=e.getAttribute("transform"))&&s.match(gT))&&(t.x+=Number(s[1]),s[3]&&(t.y+=Number(s[3]))),(e=e.getAttribute("style"))&&e.includes("translate")&&(e=e.match(mT))&&(t.x+=Number(e[1]),e[3]&&(t.y+=Number(e[3]))),t},E=function(e){let t=0,s=0;for(;e;){const i=_(e);if(t+=i.x,s+=i.y,(" "+(e.getAttribute("class")||"")+" ").includes(" injectionDiv "))break;e=e.parentNode}return new se(t,s)},b=function(){const e=T();return new qe(e.y,document.documentElement.clientHeight+e.y,e.x,document.documentElement.clientWidth+e.x)},B=function(){const e=document.documentElement,t=window;return new se(t.pageXOffset||e.scrollLeft,t.pageYOffset||e.scrollTop)},te=function(e,t){var s=t.x;t=t.y;const i=e.getInjectionDiv().getBoundingClientRect();return s=new se(s-i.left,t-i.top),t=e.getOriginOffsetInPixels(),se.difference(s,t).scale(1/e.scale)},fe=function(e,t){var s=t.scale(e.scale);t=s.x,s=s.y;const i=e.getInjectionDiv().getBoundingClientRect();return e=e.getOriginOffsetInPixels(),new se(t+i.left+e.x,s+i.top+e.y)},Ge=function(e){({document:Jl=Jl,DOMParser:rn=rn,XMLSerializer:nn=nn}=e),Kl=new rn,dh=new nn},o.createElement$$module$build$src$core$utils$xml=function(e){return Jl.createElementNS(ET,e)},o.createTextNode$$module$build$src$core$utils$xml=function(e){return Jl.createTextNode(e)},o.textToDom$$module$build$src$core$utils$xml=function(e){let t=Kl.parseFromString(e,"text/xml");if(t&&t.documentElement&&!t.getElementsByTagName("parsererror").length)return t.documentElement;if((t=Kl.parseFromString(e,"text/html"))&&t.body.firstChild&&t.body.firstChild.nodeName.toLowerCase()==="xml")return t.body.firstChild;throw Error(`DOMParser was unable to parse: ${e}`)},ut=function(e){return St(dh.serializeToString(e))},St=function(e){return e.replace(df,t=>`&#${t.charCodeAt(0)};`)},Zs=function(e){return e?((e instanceof Element||typeof e=="string")&&(e=ru(e),e=P$(e)),D$(e),e):null},D$=function(e){const t=e.kind;if(e=e.contents,t&&t!==fT&&t!==$h)throw Error("Invalid toolbox kind "+t+". Please supply either "+fT+" or "+$h);if(!e)throw Error("Toolbox must have a contents attribute.")},wr=function(e){return e?e.contents?e.contents:Array.isArray(e)&&0 document.")}else e instanceof Element&&(t=e);return t},il=function(e,t,s,i,r,p){const I=p.scrollbar&&p.scrollbar.canScrollVertically();return e.horizontal===ir.LEFT?(s=r.absoluteMetrics.left+s,I&&p.RTL&&(s+=Et.scrollbarThickness)):(s=r.absoluteMetrics.left+r.viewMetrics.width-t.width-s,I&&!p.RTL&&(s-=Et.scrollbarThickness)),e.vertical===$o.TOP?e=r.absoluteMetrics.top+i:(e=r.absoluteMetrics.top+r.viewMetrics.height-t.height-i,p.scrollbar&&p.scrollbar.canScrollHorizontally()&&(e-=Et.scrollbarThickness)),new qe(e,e+t.height,s,s+t.width)},rl=function(e,t){return{horizontal:t.toolboxMetrics.position===Ce.LEFT||e.horizontalLayout&&!e.RTL?ir.RIGHT:ir.LEFT,vertical:t.toolboxMetrics.position===Ce.BOTTOM?$o.TOP:$o.BOTTOM}},nl=function(e,t,s,i){const r=e.left,p=e.right-e.left,I=e.bottom-e.top;for(let S=0;S1'),i.appendChild(s),t.push(i)),Zt.variables_get){e.sort(un.compareByName);for(let r=0,p;p=e[r];r++)s=o.createElement$$module$build$src$core$utils$xml("block"),s.setAttribute("type","variables_get"),s.setAttribute("gap","8"),s.appendChild(Jo(p)),t.push(s)}}return t},cu=function(e){return LT.generateUniqueNameInternal(e)},G$=function(e){return al(gh.charAt(0),e.getAllVariableNames())},al=function(e,t){if(!t.length)return e;const s=gh;let i="",r=s.indexOf(e);for(;;){let p=!1;for(let I=0;Ip.getVariableModel().name);if(i&&(s=i.some(p=>p.toLowerCase()===e),i=i.some(p=>p.toLowerCase()===t),s&&i))return r.getName()}return null},X$=function(e,t,s){e=e.toLowerCase(),t=t.toLowerCase(),s=s.getAllBlocks(!1);for(const r of s){if(!ki(r))continue;s=r.getProcedureDef();var i=s[1];const p=i.some(I=>I.toLowerCase()===e);if(i=i.some(I=>I.toLowerCase()===t),p&&i)return s[0]}return null},Jo=function(e){const t=o.createElement$$module$build$src$core$utils$xml("field");return t.setAttribute("name","VAR"),t.setAttribute("id",e.getId()),t.setAttribute("variabletype",e.type),e=o.createTextNode$$module$build$src$core$utils$xml(e.name),t.appendChild(e),t},o.getOrCreateVariablePackage$$module$build$src$core$variables=function(e,t,s,i){let r=o.getVariable$$module$build$src$core$variables(e,t,s,i);return r||(r=Y$(e,t,s,i)),r},o.getVariable$$module$build$src$core$variables=function(e,t,s,i){const r=e.getPotentialVariableMap();let p=null;if(t&&(p=e.getVariableById(t),!p&&r&&(p=r.getVariableById(t)),p))return p;if(s){if(i===void 0)throw Error("Tried to look up a variable by name without a type");p=e.getVariable(s,i),!p&&r&&(p=r.getVariable(s,i))}return p},Y$=function(e,t,s,i){const r=e.getPotentialVariableMap();return s||(s=cu(e.isFlyout?e.targetWorkspace:e)),r?r.createVariable(s,i,t):e.createVariable(s,i,t)},xr=function(e,t){e=e.getAllVariables();const s=[];if(t.length!==e.length)for(let i=0;i{fh=t,AT=window.requestAnimationFrame(()=>{dl(),t()})})),rr)},vs=function(){return rr||Promise.resolve()},eo=function(e){e||window.cancelAnimationFrame(AT),dl(e),!e&&fh&&fh()},z$=function(){return uT},du=function(e){mh.add(e),Eh.set(e,o.getGroup$$module$build$src$core$events$utils());const t=e.getParent();t?du(t):Ql.add(e)},dl=function(e){const t=e?new Set([e]):new Set([...Ql].map(p=>p.workspace)),s=[...Ql].filter(j$).filter(p=>t.has(p.workspace));for(var i of s)_u(i);for(const p of t)p.resizeContents();for(var r of s)i=r.getRelativeToSurfaceXY(),r.updateComponentLocations(i);for(const p of s)r=o.getGroup$$module$build$src$core$events$utils(),(i=Eh.get(p))&&o.setGroup$$module$build$src$core$events$utils(i),p.bumpNeighbours(),o.setGroup$$module$build$src$core$events$utils(r);for(const p of s)$u(p);e||(rr=null)},$u=function(e){Ql.delete(e),mh.delete(e),Eh.delete(e);for(const t of e.getChildren(!1))$u(t)},j$=function(e){return!e.isDisposed()&&!e.getParent()},_u=function(e){if(mh.has(e)&&e.initialized){for(const t of e.getChildren(!1))_u(t);e.renderEfficiently()}},Br=function(e,t){c(ee.SERIALIZER,e,t)},K$=function(e){f(ee.SERIALIZER,e)},wi=function(e,{addCoordinates:t=!1,saveIds:s=!0}={}){const i=e.workspace,r=Object.create(null);return r.height=e.getSize().height,r.width=e.getSize().width,s&&(r.id=e.id),t&&(t=e.getRelativeToSurfaceXY(),r.x=i.RTL?i.getWidth()-t.x:t.x,r.y=t.y),e.getText()&&(r.text=e.getText()),e.isCollapsed()&&(r.collapsed=!0),e.isOwnEditable()||(r.editable=!1),e.isOwnMovable()||(r.movable=!1),e.isOwnDeletable()||(r.deletable=!1),r},Fr=function(e,t,{recordUndo:s=!1}={}){const i=re();if(o.setRecordUndo$$module$build$src$core$events$utils(s),s=t.newComment(e.id),e.text!==void 0&&s.setText(e.text),e.x!==void 0||e.y!==void 0){const p=s.getRelativeToSurfaceXY();let I,S=(I=e.x)!=null?I:p.x;S=t.RTL?t.getWidth()-S:S;var r;t=(r=e.y)!=null?r:p.y,s.moveTo(new se(S,t))}if(e.width!==void 0||e.height){r=s.getSize();let p,I;s.setSize(new Be((p=e.width)!=null?p:r.width,(I=e.height)!=null?I:r.height))}return e.collapsed!==void 0&&s.setCollapsed(e.collapsed),e.editable!==void 0&&s.setEditable(e.editable),e.movable!==void 0&&s.setMovable(e.movable),e.deletable!==void 0&&s.setDeletable(e.deletable),o.setRecordUndo$$module$build$src$core$events$utils(i),s},$l=function(e,t){c(ee.PASTER,e,t)},J$=function(e){f(ee.PASTER,e)},q$=function(e){const t=e.workspace,s=e.getRelativeToSurfaceXY(),i=new se(0,0),r=t.getTopComments(!1).filter(p=>p.id!==e.id).map(p=>p.getRelativeToSurfaceXY());for(;Q$(se.sum(s,i),r);)i.translate(t.RTL?-30:30,30);e.moveTo(se.sum(s,i))},Q$=function(e,t){return t.some(s=>1>=Math.abs(s.x-e.x)&&1>=Math.abs(s.y-e.y))},Lo=function(e,t){e.setAttribute(Tf,t)},Dt=function(e,t,s){Array.isArray(s)&&(s=s.join(" ")),e.setAttribute(pf+t,`${s}`)},Ur=function(e){return e.saveState!==void 0&&e.loadState!==void 0},ts=function(e,{addCoordinates:t=!1,addInputBlocks:s=!0,addNextBlocks:i=!0,doFullSerialization:r=!0,saveIds:p=!0}={}){if(e.isInsertionMarker())return null;const I={type:e.type,id:p?e.id:void 0};return t&&e_(e,I),Z$(e,I),t_(e,I,r),s_(e,I,r),o_(e,I,r),s&&i_(e,I,r,p),i&&r_(e,I,r,p),I},Z$=function(e,t){e.isCollapsed()&&(t.collapsed=!0),e.isEnabled()||(t.disabledReasons=Array.from(e.getDisabledReasons())),e.isOwnDeletable()||(t.deletable=!1),e.isOwnMovable()||(t.movable=!1),e.isOwnEditable()||(t.editable=!1),e.inputsInline!==void 0&&e.inputsInline!==e.inputsInlineDefault&&(t.inline=e.inputsInline),e.data&&(t.data=e.data)},e_=function(e,t){const s=e.workspace;e=e.getRelativeToSurfaceXY(),t.x=Math.round(s.RTL?s.getWidth()-e.x:e.x),t.y=Math.round(e.y)},t_=function(e,t,s){e.saveExtraState?(e=e.saveExtraState(s),e!==null&&(t.extraState=e)):e.mutationToDom&&(e=e.mutationToDom(),e!==null&&(t.extraState=ks(e).replace(' xmlns="https://developers.google.com/blockly/xml"',"")))},s_=function(e,t,s){const i=Object.create(null);for(const r of e.getIcons())Ur(r)&&(e=r.saveState(s))&&(i[r.getType().toString()]=e);Object.keys(i).length&&(t.icons=i)},o_=function(e,t,s){const i=Object.create(null);for(let r=0;r{H.disposed||H.setConnectionTracking(!0)},1)}return S},Tu=function(e,t,{parentConnection:s,isShadow:i=!1}={}){if(!e.type)throw new xT(e);const r=t.newBlock(e.type,e.id);return r.setShadow(i),l_(r,e),c_(r,e),u_(r,e),a_(s,r,e),h_(r,e),d_(r,e),$_(r,e),__(r,e),p_(r,t.rendered),r},n_=function(e,t){if(de())for(e=xr(e,t),t=0;tt&&(t=s[i].length);var r=-1/0;let p,I=1;do{i=r,p=e,e=[],r=s.length/I;let S=1;for(let H=0;Hi);return p},El=function(e,t,s){const i=[0],r=[];for(var p=0;pi&&(i=S,r=I)}return r?Du(e,r,s):t},f_=function(e,t){const s=[];for(let i=0;iYT&&so()}else Tn!==_s&&(clearTimeout(mi),yh=e.pageX,kh=e.pageY,mi=setTimeout(M_,zT))},Bu=function(){Tn=_s=null,so()},so=function(){pn&&(pn=!1,Ct&&(Ct.style.display="none")),mi&&(clearTimeout(mi),mi=0)},Fu=function(){so(),dr=!0},Uu=function(){dr=!1},C_=function(){Ct&&_s&&(typeof rc=="function"?rc(Ct,_s):L_())},L_=function(){var e=Fi(_s);e=o.wrap$$module$build$src$core$utils$string(e,WT),e=e.split(` -`);for(let t=0;ts+window.scrollY&&(r-=Ct.offsetHeight+2*wh),e?i=Math.max(nc-window.scrollX,i):i+Ct.offsetWidth>t+window.scrollX-2*nc&&(i=t-Ct.offsetWidth-2*nc),{x:i,y:r}},M_=function(){if(!dr&&(Tn=_s,Ct)){Ct.textContent="",C_();var e=_s.RTL;Ct.style.direction=e?"rtl":"ltr",Ct.style.display="block",pn=!0;var{x:t,y:s}=A_(e);Ct.style.left=t+"px",Ct.style.top=s+"px"}},Hu=function(){return Ph},v_=function(e){Ph=e},Gu=function(){return xh},y_=function(e){xh=e},qo=function(e){e=`${e}`.toLowerCase().trim();var t=jT[e];if(t||(t=e.substring(0,2)==="0x"?"#"+e.substring(2):e,t=t[0]==="#"?t:"#"+t,/^#[0-9a-f]{6}$/.test(t)))return t;if(/^#[0-9a-f]{3}$/.test(t))return["#",t[1],t[1],t[2],t[2],t[3],t[3]].join("");var s=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return s&&(e=Number(s[1]),t=Number(s[2]),s=Number(s[3]),0<=e&&256>e&&0<=t&&256>t&&0<=s&&256>s)?Vr(e,t,s):null},Vr=function(e,t,s){return t=e<<16|t<<8|s,16>e?"#"+(16777216|t).toString(16).substr(1):"#"+t.toString(16)},Il=function(e){return e=qo(e),e?(e=parseInt(e.substr(1),16),[e>>16,e>>8&255,e&255]):[0,0,0]},Ol=function(e,t,s){let i=0,r=0,p=0;if(t===0)p=r=i=s;else{const I=Math.floor(e/60),S=e/60-I;e=s*(1-t);const H=s*(1-t*S);switch(t=s*(1-t*(1-S)),I){case 1:i=H,r=s,p=e;break;case 2:i=e,r=s,p=t;break;case 3:i=e,r=H,p=s;break;case 4:i=t,r=e,p=s;break;case 5:i=s,r=e,p=H;break;case 6:case 0:i=s,r=t,p=e}}return Vr(Math.floor(i),Math.floor(r),Math.floor(p))},Qo=function(e,t,s){return e=qo(e),!e||(t=qo(t),!t)?null:(e=Il(e),t=Il(t),Vr(Math.round(t[0]+s*(e[0]-t[0])),Math.round(t[1]+s*(e[1]-t[1])),Math.round(t[2]+s*(e[2]-t[2]))))},Vu=function(e){return Ol(e,Ph,255*xh)},bl=function(e,t,s){const i=[];var r=e.split("");r.push("");var p=0;e=[];let I=null;for(let _e=0;_e=S?(p=2,I=S,(S=e.join(""))&&i.push(S),e.length=0):S==="{"?p=3:(e.push("%",S),p=0);else if(p===2)if("0"<=S&&"9">=S)I+=S;else{var H=void 0;i.push(parseInt((H=I)!=null?H:"",10)),_e--,p=0}else p===3&&(S===""?(e.splice(0,0,"%{"),_e--,p=0):S!=="}"?e.push(S):(p=e.join(""),/[A-Z]\w*/i.test(p)?(S=p.toUpperCase(),(S=S.startsWith("BKY_")?S.substring(4):null)&&S in o.Msg$$module$build$src$core$msg?(p=o.Msg$$module$build$src$core$msg[S],typeof p=="string"?Array.prototype.push.apply(i,bl(p,t,s)):t?i.push(`${p}`):i.push(p)):i.push("%{"+p+"}")):i.push("%{"+p+"}"),p=e.length=0))}for((t=e.join(""))&&i.push(t),H=[],e.length=0,r=0;r=s)return{hue:s,hex:Ol(s,Hu(),255*Gu())};if(s=qo(t))return{hue:null,hex:s};throw s='Invalid colour: "'+t+'"',e!==t&&(s+=' (from "'+e+'")'),Error(s)},Gi=function(){return bs},D_=function(e){if(bs=e,e===null){let t;(t=document.querySelector("."+cc))==null||t.remove()}},Xu=function(){const e=ye()||document.body;document.querySelector("."+cc)?bs=document.querySelector("."+cc):(bs=document.createElement("div"),bs.className=cc),e.appendChild(bs)},Rl=function(e,t,s,i){if(Vi(),$r=e,lc=s,s=bs){if(s.style.direction=t?"rtl":"ltr",s.style.display="block",!i&&e instanceof Qe){let I;i=(I=e.getSourceBlock())==null?void 0:I.workspace}var r;Bh=(r=i)!=null?r:null;var p;e=(p=i)!=null?p:xe(),_r=e.getRenderer().getClassName(),pr=e.getTheme().getClassName(),_r&&U(s,_r),pr&&U(s,pr)}},Vi=function(){if(Yu()){$r=null;var e=bs;e&&(e.style.display="none",e.style.left="",e.style.top="",lc&&lc(),lc=null,e.textContent="",_r&&(oe(e,_r),_r=""),pr&&(oe(e,pr),pr=""),xe().markFocused())}},Yu=function(){return!!$r},Zo=function(e){$r===e&&Vi()},Wr=function(e){Bh!==null&&Bh!==e||Vi()},zu=function(e,t,s){bs.style.left=e+"px",bs.style.top=t+"px",bs.style.height=s+"px"},ju=function(e,t,s,i){const r=P_(e,t,s);e=w_(e,t,s,i),0>r?zu(e,0,s.height+r):zu(e,r,s.height)},w_=function(e,t,s,i){return i?Math.min(Math.max(t.right-s.width,e.left),e.right-s.width):Math.max(Math.min(t.left,e.right-s.width),e.left)},P_=function(e,t,s){return t.bottom+s.height>=e.bottom?t.top-s.height:t.bottom},x_=function(e){return!(e==null||!e.repositionForWindowResize)},Ku=function(){x_($r)&&$r.repositionForWindowResize()||Vi()},B_=function(){return uc},Ju=function(e){uc=e},Xr=function(e,t,s,i){if(Rl(KT,s,qu,i),t.length){var r=F_(t,s,e);ac=r,U_(r,e,s),setTimeout(function(){r.focus()},1),uc=null}else Yr()},F_=function(e,t,s){const i=new Sh;i.setRole(Os.MENU);for(let r=0;r{setTimeout(()=>{p.callback(p.scope,s)},0)})},{})}return i},U_=function(e,t,s){const i=b();t=new qe(t.clientY+i.top,t.clientY+i.top,t.clientX+i.left,t.clientX+i.left),H_(e);const r=e.getSize();s&&(t.left+=r.width,t.right+=r.width,i.left+=r.width,i.right+=r.width),ju(i,t,r,s),e.focus()},H_=function(e){var t=Gi();if(!t)throw Error("Attempting to create a context menu when widget div is null");t=e.render(t),U(t,"blocklyContextMenu"),pe(t,"contextmenu",null,G_),e.focus()},G_=function(e){e.preventDefault(),e.stopPropagation()},Yr=function(){Zo(KT),uc=null},qu=function(){ac&&(ac.dispose(),ac=null)},o.callbackFactory$$module$build$src$core$contextmenu=function(e,t){return()=>{o.disable$$module$build$src$core$events$utils();let s;try{s=t instanceof Element?ei(t,e.workspace):Pi(t,e.workspace);const i=e.getRelativeToSurfaceXY();i.x=e.RTL?i.x-o.config$$module$build$src$core$config.snapRadius:i.x+o.config$$module$build$src$core$config.snapRadius,i.y+=2*o.config$$module$build$src$core$config.snapRadius,s.moveBy(i.x,i.y)}finally{o.enable$$module$build$src$core$events$utils()}return de()&&!s.isShadow()&&X(new($e(o.CREATE$$module$build$src$core$events$utils))(s)),o.setSelected$$module$build$src$core$common(s),s}},V_=function(e,t=!1){const s=o.createElement$$module$build$src$core$utils$xml("xml");var i=Qu(o.allUsedVarModels$$module$build$src$core$variables(e));i.hasChildNodes()&&s.appendChild(i);for(const r of e.getTopComments())s.appendChild(zr(r,t));for(e=e.getTopBlocks(!0),i=0;i/g,"<$1$2>")},Y_=function(e){e=ks(e).split("<");let t="";for(let s=1;s"&&(t+=" ")}return e=e.join(` -`),e=e.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),e.replace(/^\n/,"")},z_=function(e,t){return t.setResizesEnabled(!1),t.clear(),e=o.domToWorkspace$$module$build$src$core$xml(e,t),t.setResizesEnabled(!0),e},o.domToWorkspace$$module$build$src$core$xml=function(e,t){let s=0;t.RTL&&(s=t.getWidth());const i=[];ce();const r=o.getGroup$$module$build$src$core$events$utils();r||o.setGroup$$module$build$src$core$events$utils(!0),t.setResizesEnabled&&t.setResizesEnabled(!1);let p=!0;try{for(let I=0,S;S=e.childNodes[I];I++){const H=S.nodeName.toLowerCase(),_e=S;if(H==="block"||H==="shadow"&&!re()){const st=ei(_e,t);i.push(st.id);let Ze;const es=parseInt((Ze=_e.getAttribute("x"))!=null?Ze:"10",10);let Nr;const yn=parseInt((Nr=_e.getAttribute("y"))!=null?Nr:"10",10);isNaN(es)||isNaN(yn)||st.moveBy(t.RTL?s-es:es,yn,["create"]),p=!1}else{if(H==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(H==="comment")ea(_e,t);else if(H==="variables"){if(p)ta(_e,t);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");p=!1}}}}finally{o.setGroup$$module$build$src$core$events$utils(r),t.setResizesEnabled&&t.setResizesEnabled(!0),t.rendered&&eo(),ue()}return X(new($e(ri))(t)),i},ea=function(e,t){var s;const i=(s=e.getAttribute("id"))!=null?s:void 0;s=t.rendered?new hc(t,i):new ec(t,i);var r;s.setText((r=e.textContent)!=null?r:"");var p;r=parseInt((p=e.getAttribute("x"))!=null?p:"",10);let I;p=parseInt((I=e.getAttribute("y"))!=null?I:"",10),isNaN(r)||isNaN(p)||(r=t.RTL?t.getWidth()-r:r,s.moveTo(new se(r,p)));var S;t=parseInt((S=e.getAttribute("w"))!=null?S:"",10);let H;return S=parseInt((H=e.getAttribute("h"))!=null?H:"",10),isNaN(t)||isNaN(S)||s.setSize(new Be(t,S)),e.getAttribute("collapsed")==="true"&&s.setCollapsed(!0),e.getAttribute("editable")==="false"&&s.setEditable(!1),e.getAttribute("movable")==="false"&&s.setMovable(!1),e.getAttribute("deletable")==="false"&&s.setDeletable(!1),s},j_=function(e,t){if(!t.getBlocksBoundingBox)return o.domToWorkspace$$module$build$src$core$xml(e,t);var s=t.getBlocksBoundingBox();if(e=o.domToWorkspace$$module$build$src$core$xml(e,t),s&&s.top!==s.bottom){var i=s.bottom;s=t.RTL?s.right:s.left;var r=1/0;let p=-1/0,I=1/0;for(let S=0;Sp&&(p=H.x)}for(i=i-I+10,s=t.RTL?s-p:s-r,r=0;r_e.setBubbleVisible(p),1)}},Q_=function(e,t){for(let s=0;sr}),ia(r,{x:i.x,y:i.y,width:e.width,height:e.height},t.RTL,new Date)}},ia=function(e,t,s,i){const r=(new Date().getTime()-i.getTime())/150;1s)){var i=t.getSvgXY(e.getSvgRoot());e.outputConnection?(i.x+=(e.RTL?3:-3)*s,i.y+=13*s):e.previousConnection&&(i.x+=(e.RTL?-23:23)*s,i.y+=3*s);var r=A(x.CIRCLE,{cx:i.x,cy:i.y,r:0,fill:"none",stroke:"#888","stroke-width":10},t.getParentSvg());e=A(x.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*s},r),t=A(x.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},r),e.beginElement(),t.beginElement(),setTimeout(()=>void $(r),150)}},ra=function(e){if(Wi(),e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var t=e.getHeightWidth().height;t=Math.atan(10/t)/Math.PI*180,e.RTL||(t*=-1),mn=e,na(e,t,new Date)}},na=function(e,t,s){const i=(new Date().getTime()-s.getTime())/200;let r="";1>=i&&(r=`skewX(${Math.round(Math.sin(i*Math.PI*3)*(1-i)*t)})`,dc=setTimeout(na,10,e,t,s)),e.getSvgRoot().setAttribute("transform",`${e.getTranslation()} ${r}`)},Wi=function(){mn&&(dc&&(clearTimeout(dc),dc=null),mn.getSvgRoot().setAttribute("transform",mn.getTranslation()),mn=null)},ti=function(e){return e.getRelativeToSurfaceXY!==void 0&&e.isMovable!==void 0&&e.startDrag!==void 0&&e.drag!==void 0&&e.endDrag!==void 0&&e.revertDrag!==void 0},oo=function(e,t){for(const s in t)e[s]=t[s]!==null&&typeof t[s]=="object"?oo(e[s]||Object.create(null),t[s]):t[s];return e},Mo=function(e){return e.getProcedureModel!==void 0&&e.doProcedureUpdate!==void 0&&e.isProcedureDef!==void 0},Ll=function(e){return e.startPublishing!==void 0&&e.stopPublishing!==void 0},Ds=function(e,t){c(ee.FIELD,e,t)},ip=function(e){f(ee.FIELD,e)},o.fromJson$$module$build$src$core$field_registry=function(e){return ZT.fromJsonInternal(e)},rp=function(e){const t=F(ee.FIELD,e.type);return t?t.fromJson(e):(console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)},np=function(e){let t=!1;const s=e.map(([I,S])=>typeof I=="string"?[gt(I),S]:(t=!0,[I.alt!==null?Object.assign({},I,{alt:gt(I.alt)}):Object.assign({},I),S]));if(t||2>e.length)return{options:s};var i=s.map(([I])=>I),r=Gr(i);e=yu(i,r);const p=ku(i,r);return!e&&!p||r<=e+p?{options:s}:(r=e?i[0].substring(0,e-1):void 0,i=p?i[0].substr(1-p):void 0,{options:lp(s,e,p),prefix:r,suffix:i})},lp=function(e,t,s){return e.map(([i,r])=>[i.substring(t,i.length-s),r])},la=function(e){if(!Array.isArray(e))throw TypeError("FieldDropdown options must be an array.");if(!e.length)throw TypeError("FieldDropdown options must not be an empty array.");let t=!1;for(let s=0;s!i.getReturnTypes()).map(i=>[i.getName(),i.getParameters().map(r=>r.getName()),!1]);e.getBlocksByType("procedures_defnoreturn",!1).forEach(i=>{!Mo(i)&&ki(i)&&t.push(i.getProcedureDef())});const s=e.getProcedureMap().getProcedures().filter(i=>!!i.getReturnTypes()).map(i=>[i.getName(),i.getParameters().map(r=>r.getName()),!0]);return e.getBlocksByType("procedures_defreturn",!1).forEach(i=>{!Mo(i)&&ki(i)&&s.push(i.getProcedureDef())}),t.sort(da),s.sort(da),[t,s]},da=function(e,t){return e[0].localeCompare(t[0],void 0,{sensitivity:"base"})},o.findLegalName$$module$build$src$core$procedures=function(e,t){if(t.isInFlyout)return e;for(e=e||o.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!gp(e,t.workspace,t);){const s=e.match(/^(.*?)(\d+)$/);e=s?s[1]+(parseInt(s[2])+1):e+"2"}return e},gp=function(e,t,s){return!$a(e,t,s)},$a=function(e,t,s){for(const i of t.getAllBlocks(!1))if(i!==s&&ki(i)&&o.Names$$module$build$src$core$names.equals(i.getProcedureDef()[0],e))return!0;s=s&&Mo(s)?s==null?void 0:s.getProcedureModel():void 0;for(const i of t.getProcedureMap().getProcedures())if(i!==s&&o.Names$$module$build$src$core$names.equals(i.getName(),e))return!0;return!1},o.rename$$module$build$src$core$procedures=function(e){var t=this.getSourceBlock();if(!t)throw new ft;e=e.trim();const s=o.findLegalName$$module$build$src$core$procedures(e,t);Mo(t)&&!t.isInsertionMarker()&&t.getProcedureModel().setName(s);const i=this.getValue();if(i!==e&&i!==s)for(e=t.workspace.getAllBlocks(!1),t=0;tEp(s,e)||H$(s)&&o.Names$$module$build$src$core$names.equals(s.getProcedureCall(),e))},Ep=function(e,t){return Mo(e)&&!e.isProcedureDef()&&e.getProcedureModel()&&o.Names$$module$build$src$core$names.equals(e.getProcedureModel().getName(),t)},o.mutateCallers$$module$build$src$core$procedures=function(e){const t=re();var s=e.getProcedureDef()[0];const i=e.mutationToDom(!0);e=Ta(s,e.workspace);for(let p=0,I;I=e[p];p++){s=(s=I.mutationToDom())&&ut(s),I.domToMutation&&I.domToMutation(i);var r=I.mutationToDom();r=r&&ut(r),s!==r&&(o.setRecordUndo$$module$build$src$core$events$utils(!1),X(new($e(o.CHANGE$$module$build$src$core$events$utils))(I,"mutation",null,s,r)),o.setRecordUndo$$module$build$src$core$events$utils(t))}},o.getDefinition$$module$build$src$core$procedures=function(e,t){for(const s of t.getAllBlocks(!1))if(Mo(s)&&s.isProcedureDef()&&o.Names$$module$build$src$core$names.equals(s.getProcedureModel().getName(),e)||ki(s)&&o.Names$$module$build$src$core$names.equals(s.getProcedureDef()[0],e))return s;return null},Dl=function(e){return e.isDynamic},fp=function(e){return e.pathDown!==void 0&&e.pathUp!==void 0},Ip=function(e){return e.pathLeft!==void 0&&e.pathRight!==void 0},Op=function(e,t){if(!e||!t)throw Error("Cannot connect null connections.");e.targetConnection=t,t.targetConnection=e},bp=function(e,t){let s=null;t=t.outputConnection;const i=t==null?void 0:t.getConnectionChecker();for(let r=0,p;p=e.inputList[r];r++){const I=p.connection;let S;if(I&&((S=i)!=null&&S.canConnect(t,I,!1))){if(s)return null;s=I}}return s},Rp=function(e,t){let s;for(;s=bp(e,t);)if(e=s.targetBlock(),!e||e.isShadow())return s;return null},ga=function(e){return e.getType!==void 0&&e.initView!==void 0&&e.dispose!==void 0&&e.getWeight!==void 0&&e.getSize!==void 0&&e.applyColour!==void 0&&e.hideForInsertionMarker!==void 0&&e.updateEditable!==void 0&&e.updateCollapsed!==void 0&&e.isShownWhenCollapsed!==void 0&&e.setOffsetInBlock!==void 0&&e.onLocationChange!==void 0&&e.onClick!==void 0},Sp=function(e){return ga(e)&&xi(e)&&Ur(e)&&e.setText!==void 0&&e.getText!==void 0&&e.setBubbleSize!==void 0&&e.getBubbleSize!==void 0&&e.getType()===Nt.COMMENT},Kr=function(e){let t=e.outputConnection;return(!t||e.previousConnection&&e.previousConnection.isConnected())&&(t=e.previousConnection),t},Jr=function(e,t){c(ee.RENDERER,e,t)},Np=function(e){f(ee.RENDERER,e)},ma=function(e,t,s){return e=new(k(ee.RENDERER,e))(e),e.init(t,s),e},Ea=function(e){Di(e.getTargetWorkspace(),void 0,"String")},fa=function(e){Di(e.getTargetWorkspace(),void 0,"Number")},Ia=function(e){Di(e.getTargetWorkspace(),void 0,"Colour")},wl=function(e){let t=[],s=document.createElement("button");return s.setAttribute("text",o.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),s.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),t.push(s),s=document.createElement("button"),s.setAttribute("text",o.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),s.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),t.push(s),s=document.createElement("button"),s.setAttribute("text",o.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),s.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),t.push(s),e.registerButtonCallback("CREATE_VARIABLE_STRING",Ea),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",fa),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",Ia),e=Oa(e),t=t.concat(e)},Oa=function(e){e=e.getAllVariables();const t=[];if(0S.id!=e.id).map(S=>S.getRelativeToSurfaceXY());for(;Lp(se.sum(t,p),I)||Ap(e,se.sum(r,p),i);)s.RTL?p.translate(-i,2*i):p.translate(i,2*i);e.moveTo(se.sum(t,p))},Lp=function(e,t){return t.some(s=>1>=Math.abs(s.x-e.x)&&1>=Math.abs(s.y-e.y))},Ap=function(e,t,s){return e.getConnections_(!1).some(i=>!!i.closest(s,t).connection)},Yi=function(e,t,s){const i=s.getBoundingRectangle(),r=i.right-i.left,p=Bi(t.top,i.top,t.top+t.height-(i.bottom-i.top))-i.top;let I=t.left;return t=t.left+t.width-r,e.RTL?I=Math.min(t,I):t=Math.max(I,t),(e=Bi(I,i.left,t)-i.left)||p?(s.moveBy(e,p,["inbounds"]),!0):!1},ba=function(e){return t=>{var s=e.getMetricsManager();if(s.hasFixedEdges()&&!e.isDragging()){var i;if(Gl.includes((i=t.type)!=null?i:"")){i=s.getScrollMetrics(!0);const r=Mp(e,t);r&&(s=o.getGroup$$module$build$src$core$events$utils()||!1,o.setGroup$$module$build$src$core$events$utils(t.group),Yi(e,i,r)&&!t.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),o.setGroup$$module$build$src$core$events$utils(s))}else t.type===Do&&t.scale&&t.oldScale&&t.scale>t.oldScale&&Pl(e)}}},Mp=function(e,t){let s=null;switch(t.type){case o.CREATE$$module$build$src$core$events$utils:case o.MOVE$$module$build$src$core$events$utils:(s=e.getBlockById(t.blockId))&&(s=s.getRootBlock());break;case lo:case co:s=e.getCommentById(t.commentId)}return s},Pl=function(e){var t=e.getMetricsManager();if(t.hasFixedEdges()&&!e.isDragging()){t=t.getScrollMetrics(!0);var s=e.getTopBoundedElements();for(let i=0,r;r=s[i];i++)Yi(e,t,r)}},ds=function(e){return e.isDeletable!==void 0&&e.dispose!==void 0&&e.setDeleteStyle!==void 0},vp=function(e){const t=e.toCopyData();_d=t;let s;return pd=(s=e.workspace)!=null?s:null,t},yo=function(e,t,s){return e&&t?Ra(e,t,s):_d&&pd?Ra(_d,pd):null},Ra=function(e,t,s){let i;t=(i=t.getRootWorkspace())!=null?i:t;let r,p;return(p=(r=F(ee.PASTER,e.paster,!1))==null?void 0:r.paste(e,t,s))!=null?p:null},yp=function(e){const t=e.toCopyData();return t?yo(t,e.workspace):null},qr=function(e){return e.toCopyData!==void 0},Sa=function(){We.registry.register({name:Vs.ESCAPE,preconditionFn(e){return!e.options.readOnly},callback(e){return e.hideChaff(),!0},keyCodes:[ke.ESC]})},Na=function(){We.registry.register({name:Vs.DELETE,preconditionFn(e){const t=Ne();return!e.options.readOnly&&t!=null&&ds(t)&&t.isDeletable()&&!_o.inProgress()},callback(e,t){return t.preventDefault(),e=Ne(),e instanceof fs?e.checkAndDelete():ds(e)&&e.isDeletable()&&(o.setGroup$$module$build$src$core$events$utils(!0),e.dispose(),o.setGroup$$module$build$src$core$events$utils(!1)),!0},keyCodes:[ke.DELETE,ke.BACKSPACE]})},Ca=function(){const e=We.registry.createSerializedKey(ke.C,[ke.CTRL]),t=We.registry.createSerializedKey(ke.C,[ke.ALT]),s=We.registry.createSerializedKey(ke.C,[ke.META]);We.registry.register({name:Vs.COPY,preconditionFn(i){const r=Ne();return!i.options.readOnly&&!_o.inProgress()&&r!=null&&ds(r)&&r.isDeletable()&&ti(r)&&r.isMovable()&&qr(r)},callback(i,r){return r.preventDefault(),i.hideChaff(),r=Ne(),!r||!qr(r)?!1:(Ho=r.toCopyData(),Go=i,br=ti(r)?r.getRelativeToSurfaceXY():null,!!Ho)},keyCodes:[e,t,s]})},La=function(){const e=We.registry.createSerializedKey(ke.X,[ke.CTRL]),t=We.registry.createSerializedKey(ke.X,[ke.ALT]),s=We.registry.createSerializedKey(ke.X,[ke.META]);We.registry.register({name:Vs.CUT,preconditionFn(i){const r=Ne();return!i.options.readOnly&&!_o.inProgress()&&r!=null&&ds(r)&&r.isDeletable()&&ti(r)&&r.isMovable()&&!r.workspace.isFlyout},callback(i){const r=Ne();return r instanceof fs?(Ho=r.toCopyData(),Go=i,br=r.getRelativeToSurfaceXY(),r.checkAndDelete(),!0):ds(r)&&r.isDeletable()&&qr(r)?(Ho=r.toCopyData(),Go=i,br=ti(r)?r.getRelativeToSurfaceXY():null,r.dispose(),!0):!1},keyCodes:[e,t,s]})},Aa=function(){const e=We.registry.createSerializedKey(ke.V,[ke.CTRL]),t=We.registry.createSerializedKey(ke.V,[ke.ALT]),s=We.registry.createSerializedKey(ke.V,[ke.META]);We.registry.register({name:Vs.PASTE,preconditionFn(i){return!i.options.readOnly&&!_o.inProgress()},callback(){if(!Ho||!Go)return!1;if(!br)return!!yo(Ho,Go);const{left:i,top:r,width:p,height:I}=Go.getMetricsManager().getViewMetrics(!0);if(new qe(r,r+I,i,i+p).contains(br.x,br.y))return!!yo(Ho,Go);const S=new se(i+p/2,r+I/2);return!!yo(Ho,Go,S)},keyCodes:[e,t,s]})},Ma=function(){const e=We.registry.createSerializedKey(ke.Z,[ke.CTRL]),t=We.registry.createSerializedKey(ke.Z,[ke.ALT]),s=We.registry.createSerializedKey(ke.Z,[ke.META]);We.registry.register({name:Vs.UNDO,preconditionFn(i){return!i.options.readOnly&&!_o.inProgress()},callback(i,r){return i.hideChaff(),i.undo(!1),r.preventDefault(),!0},keyCodes:[e,t,s]})},va=function(){const e=We.registry.createSerializedKey(ke.Z,[ke.SHIFT,ke.CTRL]),t=We.registry.createSerializedKey(ke.Z,[ke.SHIFT,ke.ALT]),s=We.registry.createSerializedKey(ke.Z,[ke.SHIFT,ke.META]),i=We.registry.createSerializedKey(ke.Y,[ke.CTRL]);We.registry.register({name:Vs.REDO,preconditionFn(r){return!_o.inProgress()&&!r.options.readOnly},callback(r,p){return r.hideChaff(),r.undo(!0),p.preventDefault(),!0},keyCodes:[e,t,s,i]})},ya=function(){Sa(),Na(),Ca(),La(),Aa(),Ma(),va()},ka=function(e){const t=e.saveState();return e.getParameters().length&&(t.parameters=e.getParameters().map(s=>s.saveState())),t},Da=function(e,t,s,i){if(e=e.loadState(s,i),!s.parameters)return e;for(const[r,p]of s.parameters.entries())e.insertParameter(t.loadState(p,i),r);return e},kp=function(e){const t=Object.create(null),s=w(ee.SERIALIZER,!0);for(const i in s){let r;const p=(r=s[i])==null?void 0:r.save(e);p&&(t[i]=p)}return t},Dp=function(e,t,{recordUndo:s=!1}={}){var i=w(ee.SERIALIZER,!0);if(i){i=Object.entries(i).sort((p,I)=>I[1].priority-p[1].priority);var r=re();o.setRecordUndo$$module$build$src$core$events$utils(s),(s=o.getGroup$$module$build$src$core$events$utils())||o.setGroup$$module$build$src$core$events$utils(!0),ce(),t instanceof Es&&t.setResizesEnabled(!1);for(const[,p]of i.reverse()){let I;(I=p)==null||I.clear(t)}for(const[p,I]of i.reverse())if(e[p]){let S;(S=I)==null||S.load(e[p],t)}t instanceof Es&&t.setResizesEnabled(!0),ue(),X(new($e(ri))(t)),o.setGroup$$module$build$src$core$events$utils(s),o.setRecordUndo$$module$build$src$core$events$utils(r)}},wp=function(e,t){let s=null;s=typeof e=="string"?document.getElementById(e)||document.querySelector(e):e;var i;if(!document.contains(s)&&document!==((i=s)==null?void 0:i.ownerDocument))throw Error("Error: container is not in current document");e=new Ts(t||{}),i=document.createElement("div"),U(i,"injectionDiv"),t!=null&&t.rtl&&U(i,"blocklyRTL"),i.tabIndex=0,Dt(i,vt.LABEL,o.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL),s.appendChild(i),t=Pp(i,e);const r=xp(i,t,e);return Bp(r),dt(r),ze(r),i.addEventListener("focusin",function(){dt(r)}),r},Pp=function(e,t){e.setAttribute("dir","LTR"),ie(t.hasCss,t.pathToMedia),e=A(x.SVG,{xmlns:on,"xmlns:html":Fs,"xmlns:xlink":ss,version:"1.1",class:"blocklySvg",tabindex:"0"},e);const s=A(x.DEFS,{},e),i=String(Math.random()).substring(2);return t.gridPattern=Gh.createDom(i,t.gridOptions,s),e},xp=function(e,t,s){s.parentWorkspace=null,s=new Es(s);const i=s.options;s.scale=i.zoomOptions.startScale,t.appendChild(s.createDom("blocklyMainBackground",e));var r=s.getRenderer().getClassName();return r&&U(e,r),(r=s.getTheme().getClassName())&&U(e,r),!i.hasCategories&&i.languageTree&&(e=s.addFlyout(x.SVG),L(e,t)),i.hasTrashcan&&s.addTrashcan(),i.zoomOptions&&i.zoomOptions.controls&&s.addZoomControls(),s.getThemeManager().subscribe(t,"workspaceBackgroundColour","background-color"),s.translate(0,0),s.addChangeListener(ba(s)),ze(s),Xu(),mu(),Pu(),s},Bp=function(e){const t=e.options;var s=e.getParentSvg();if(pe(s.parentNode,"contextmenu",null,function(i){C(i)||i.preventDefault()}),s=pe(window,"resize",null,function(){so(),e.hideComponents(!0),vu(),Ku(),ze(e),Pl(e)}),e.setResizeHandlerWrapper(s),Up(),t.languageTree){s=e.getToolbox();const i=e.getFlyout(!0);s?s.init():i&&(i.init(e),i.show(t.languageTree),typeof i.scrollToStart=="function"&&i.scrollToStart())}t.hasTrashcan&&e.trashcan.init(),t.zoomOptions&&t.zoomOptions.controls&&e.zoomControls_.init(),t.moveOptions&&t.moveOptions.scrollbars?(e.scrollbar=new gd(e,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.horizontal,t.moveOptions.scrollbars===!0||!!t.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),e.scrollbar.resize()):e.setMetrics({x:.5,y:.5}),t.hasSounds&&Hp(t.pathToMedia,e)},Fp=function(e){const t=xe();t&&!(C(e)||t.rendered&&!t.isVisible())&&We.registry.onKeyDown(t,e)},Up=function(){xg||(pe(document,"scroll",null,function(){const e=at();for(let t=0,s;s=e[t];t++)s instanceof Es&&s.updateInverseScreenCTM()}),pe(document,"keydown",null,Fp),Je(document,"touchend",null,ct),Je(document,"touchcancel",null,ct),sn&&pe(window,"orientationchange",document,function(){ze(xe())})),xg=!0},Hp=function(e,t){function s(){for(;r.length;){const p=r.pop();p&&Ae(p)}i.preload()}const i=t.getAudioManager();i.load([e+"click.mp3",e+"click.wav",e+"click.ogg"],"click"),i.load([e+"disconnect.wav",e+"disconnect.mp3",e+"disconnect.ogg"],"disconnect"),i.load([e+"delete.mp3",e+"delete.ogg",e+"delete.wav"],"delete");const r=[];r.push(pe(document,"pointermove",null,s,!0)),r.push(pe(document,"touchstart",null,s,!0))},wa=function(){Me.registry.register({displayText(){return o.Msg$$module$build$src$core$msg.UNDO},preconditionFn(e){return 0t.length?Qr(t):ll(o.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(t.length)),function(s){s&&Qr(t)})}},scopeType:Me.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},Gp=function(){wa(),Pa(),xa(),Fa(),Ua(),Ga()},Va=function(){Me.registry.register({displayText(){return o.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"},callback(e){if(e.block){var t=e.block.toCopyData();t&&yo(t,e.block.workspace)}},scopeType:Me.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},Wa=function(){Me.registry.register({displayText(e){return e.block.hasIcon(go.TYPE)?o.Msg$$module$build$src$core$msg.REMOVE_COMMENT:o.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.workspace.options.comments&&!e.isCollapsed()&&e.isEditable()?"enabled":"hidden"},callback(e){e=e.block,e.hasIcon(go.TYPE)?e.setCommentText(null):e.setCommentText("")},scopeType:Me.ScopeType.BLOCK,id:"blockComment",weight:2})},Xa=function(){Me.registry.register({displayText(e){return e.block.getInputsInline()?o.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:o.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(e){if(e=e.block,!e.isInFlyout&&e.isMovable()&&!e.isCollapsed()){for(let t=1;t(t.has($s)?1:0),e.getInheritedDisabled()||t?"disabled":"enabled"}return"hidden"},callback(e){e=e.block;const t=o.getGroup$$module$build$src$core$events$utils();t||o.setGroup$$module$build$src$core$events$utils(!0),e.setDisabledReason(!e.hasDisabledReason($s),$s),o.setGroup$$module$build$src$core$events$utils(t)},scopeType:Me.ScopeType.BLOCK,id:"blockDisable",weight:5})},ja=function(){Me.registry.register({displayText(e){var t=e.block;return e=t.getDescendants(!1).length,(t=t.getNextBlock())&&(e-=t.getDescendants(!1).length),e===1?o.Msg$$module$build$src$core$msg.DELETE_BLOCK:o.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${e}`)},preconditionFn(e){return!e.block.isInFlyout&&e.block.isDeletable()?"enabled":"hidden"},callback(e){e.block&&e.block.checkAndDelete()},scopeType:Me.ScopeType.BLOCK,id:"blockDelete",weight:6})},Ka=function(){Me.registry.register({displayText(){return o.Msg$$module$build$src$core$msg.HELP},preconditionFn(e){return e=e.block,(typeof e.helpUrl=="function"?e.helpUrl():e.helpUrl)?"enabled":"hidden"},callback(e){e.block.showHelp()},scopeType:Me.ScopeType.BLOCK,id:"blockHelp",weight:7})},Ja=function(){Me.registry.register({displayText:()=>o.Msg$$module$build$src$core$msg.REMOVE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isDeletable()?"enabled":"hidden"},callback(e){o.setGroup$$module$build$src$core$events$utils(!0);let t;(t=e.comment)==null||t.dispose(),o.setGroup$$module$build$src$core$events$utils(!1)},scopeType:Me.ScopeType.COMMENT,id:"commentDelete",weight:6})},qa=function(){Me.registry.register({displayText:()=>o.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,preconditionFn(e){let t;return(t=e.comment)!=null&&t.isMovable()?"enabled":"hidden"},callback(e){if(e.comment){var t=e.comment.toCopyData();t&&yo(t,e.comment.workspace)}},scopeType:Me.ScopeType.COMMENT,id:"commentDuplicate",weight:1})},Qa=function(){Me.registry.register({displayText:()=>o.Msg$$module$build$src$core$msg.ADD_COMMENT,preconditionFn:()=>"enabled",callback:(e,t)=>{if(e=e.workspace){o.setGroup$$module$build$src$core$events$utils(!0);var s=new hc(e);s.setText(o.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT),s.moveTo(Vp(new se(t.clientX,t.clientY),e)),o.setSelected$$module$build$src$core$common(s),o.setGroup$$module$build$src$core$events$utils(!1)}},scopeType:Me.ScopeType.WORKSPACE,id:"commentCreate",weight:8})},Vp=function(e,t){var s=t.getInjectionDiv().getBoundingClientRect();return e=new se(e.x-s.left,e.y-s.top),s=t.getOriginOffsetInPixels(),e=se.difference(e,s),e.scale(1/t.scale),e},Wp=function(){Va(),Wa(),Xa(),Ya(),za(),ja(),Ka()},Xp=function(){qa(),Ja(),Qa()},Za=function(){Gp(),Wp()},Yp=function(e){return e.paste!==void 0},zp=function(e){return e.getSvgRoot!==void 0},jp=function(e){return typeof e.id=="string"&&e.workspace!==void 0&&e.select!==void 0&&e.unselect!==void 0},Kp=function(e){return e.isSelectable()},Jp=function(e){xe().hideChaff(e)},J=J||{},J.scope={},J.ASSUME_ES5=!1,J.ASSUME_NO_NATIVE_MAP=!1,J.ASSUME_NO_NATIVE_SET=!1,J.SIMPLE_FROUND_POLYFILL=!1,J.ISOLATE_POLYFILLS=!1,J.FORCE_POLYFILL_PROMISE=!1,J.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,J.defineProperty=J.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,s){return e==Array.prototype||e==Object.prototype||(e[t]=s.value),e},J.getGlobal=function(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof hs=="object"&&hs];for(var t=0;t>>0,J.propertyToPolyfillSymbol[r]=J.IS_SYMBOL_NATIVE?J.global.Symbol(r):J.POLYFILL_PREFIX+s+"$"+r),J.defineProperty(i,J.propertyToPolyfillSymbol[r],{configurable:!0,writable:!0,value:t})))},J.underscoreProtoCanBeSet=function(){var e={a:!0},t={};try{return t.__proto__=e,t.a}catch{}return!1},J.setPrototypeOf=J.TRUST_ES6_POLYFILLS&&typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf:J.underscoreProtoCanBeSet()?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null,J.arrayIteratorImpl=function(e){var t=0;return function(){return ts&&(s=Math.max(s+r,0));s{const e=qp.length,t=[];for(let s=0;20>s;s++)t[s]=qp.charAt(Math.random()*e);return t.join("")}},lf=0,eh={TEST_ONLY:Qp};eh.genUid=ae,eh.getNextUniqueId=W;var th,zi,Fl,si,ro,oi,ji,Ul,ii,Ki,no,Ji,xs,qi,Qi,Zi,Do,lo,er,tr,co,Zr,ri,Hl,Gl,ni,Vl,Xt;th="",zi=!0,Fl=0,o.CREATE$$module$build$src$core$events$utils="create",o.CREATE$$module$build$src$core$events$utils,o.DELETE$$module$build$src$core$events$utils="delete",o.DELETE$$module$build$src$core$events$utils,o.CHANGE$$module$build$src$core$events$utils="change",o.CHANGE$$module$build$src$core$events$utils,si="block_field_intermediate_change",o.MOVE$$module$build$src$core$events$utils="move",o.MOVE$$module$build$src$core$events$utils,ro="var_create",oi="var_delete",ji="var_rename",Ul="ui",ii="drag",Ki="selected",no="click",Ji="marker_move",xs="bubble_open",qi="trashcan_open",Qi="toolbox_item_select",Zi="theme_change",Do="viewport_change",lo="comment_create",er="comment_delete",tr="comment_change",co="comment_move",Zr="comment_collapse",ri="finished_loading",Hl="ORPHANED_BLOCK",Gl=[o.CREATE$$module$build$src$core$events$utils,o.MOVE$$module$build$src$core$events$utils,lo,co],ni=[],Vl={FIRE_QUEUE:ni,fireNow:Re,fireInternal:be,setGroupInternal:Ue},Xt={BLOCK_CHANGE:o.CHANGE$$module$build$src$core$events$utils,BLOCK_CREATE:o.CREATE$$module$build$src$core$events$utils,BLOCK_DELETE:o.DELETE$$module$build$src$core$events$utils,BLOCK_DRAG:ii,BLOCK_FIELD_INTERMEDIATE_CHANGE:si,BLOCK_MOVE:o.MOVE$$module$build$src$core$events$utils,BUBBLE_OPEN:xs,BUMP_EVENTS:Gl,CHANGE:o.CHANGE$$module$build$src$core$events$utils,CLICK:no,COMMENT_CHANGE:tr,COMMENT_COLLAPSE:Zr,COMMENT_CREATE:lo,COMMENT_DELETE:er,COMMENT_MOVE:co,CREATE:o.CREATE$$module$build$src$core$events$utils,DELETE:o.DELETE$$module$build$src$core$events$utils,FINISHED_LOADING:ri,MARKER_MOVE:Ji,MOVE:o.MOVE$$module$build$src$core$events$utils,SELECTED:Ki,TEST_ONLY:Vl,THEME_CHANGE:Zi,TOOLBOX_ITEM_SELECT:Qi,TRASHCAN_OPEN:qi,UI:Ul,VAR_CREATE:ro,VAR_DELETE:oi,VAR_RENAME:ji,VIEWPORT_CHANGE:Do},Xt.clearPendingUndo=ve,Xt.disable=o.disable$$module$build$src$core$events$utils,Xt.disableOrphans=Ot,Xt.enable=o.enable$$module$build$src$core$events$utils,Xt.filter=Se,Xt.fire=X,Xt.fromJson=He,Xt.get=$e,Xt.getDescendantIds=it,Xt.getGroup=o.getGroup$$module$build$src$core$events$utils,Xt.getRecordUndo=re,Xt.isEnabled=de,Xt.setGroup=o.setGroup$$module$build$src$core$events$utils,Xt.setRecordUndo=o.setRecordUndo$$module$build$src$core$events$utils;var en=Object.create(null),Zp,li=null,eT,tn=[],tT={defineBlocksWithJsonArrayInternal:xt},Bt={TEST_ONLY:tT};Bt.createBlockDefinitionsFromJsonArray=o.createBlockDefinitionsFromJsonArray$$module$build$src$core$common,Bt.defineBlocks=o.defineBlocks$$module$build$src$core$common,Bt.defineBlocksWithJsonArray=rt,Bt.draggingConnections=tn,Bt.getAllWorkspaces=at,Bt.getBlockTypeCounts=$t,Bt.getMainWorkspace=xe,Bt.getParentContainer=ye,Bt.getSelected=Ne,Bt.getWorkspaceById=Pe,Bt.registerWorkspace=bt,Bt.setMainWorkspace=dt,Bt.setParentContainer=Le,Bt.setSelected=o.setSelected$$module$build$src$core$common,Bt.svgResize=ze,Bt.unregisterWorkpace=Rt;var sr=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=o.getGroup$$module$build$src$core$events$utils(),this.recordUndo=re()}toJson(){return{type:this.type,group:this.group}}static fromJson(e,t,s){return s.isBlank=!1,s.group=e.group||"",s.workspaceId=t.id,s}isNull(){return!1}run(e){}getEventWorkspace_(){let e;if(this.workspaceId&&(e=Pe(this.workspaceId)),!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e}},Bs=class extends sr{constructor(e){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof e>"u",this.workspaceId=e||""}},sh=class extends Bs{constructor(e,t,s){t=e?e.workspace.id:t,t===null&&(t=void 0),super(t),this.type=no,this.blockId=e?e.id:void 0,this.targetType=s}toJson(){const e=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return e.targetType=this.targetType,e.blockId=this.blockId,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new sh),t.targetType=e.targetType,t.blockId=e.blockId,t}},oh;(function(e){e.BLOCK="block",e.WORKSPACE="workspace",e.ZOOM_CONTROLS="zoom_controls"})(oh||(oh={})),c(ee.EVENT,no,sh);var cf=750,sT="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),Wl=null,ci={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},Xl=0,ui={TOUCH_ENABLED:sT,TOUCH_MAP:ci};ui.checkTouchIdentifier=kt,ui.clearTouchIdentifier=je,ui.getTouchIdentifierFromEvent=Tt,ui.longStart=It,ui.longStop=ct,ui.shouldHandleEvent=pt;var ih,oT,iT,rT,Yl,zl,rh,nT,lT,cT;(function(e){function t(i){return s.includes(i.toUpperCase())}ih=e;const s=ih.toUpperCase();oT=t("JavaFX"),iT=t("WebKit"),rT=t("Gecko")&&!iT,Yl=t("Android"),e=globalThis.navigator&&globalThis.navigator.maxTouchPoints,zl=t("iPad")||t("Macintosh")&&0{i.push(this.componentData.get(r))}),i.sort(function(r,p){return r.weight-p.weight}),i.forEach(function(r){s.push(r.component)})}else e.forEach(i=>{s.push(this.componentData.get(i).component)});return s}};Mt.Capability=ao;var ch=!1,uh=` -.blocklySvg { - background-color: #fff; - outline: none; - overflow: hidden; /* IE overflows by default. */ - position: absolute; - display: block; -} - -.blocklyWidgetDiv { - display: none; - position: absolute; - z-index: 99999; /* big value for bootstrap3 compatibility */ -} - -.injectionDiv { - height: 100%; - position: relative; - overflow: hidden; /* So blocks in drag surface disappear at edges */ - touch-action: none; -} - -.blocklyNonSelectable { - user-select: none; - -ms-user-select: none; - -webkit-user-select: none; -} - -.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; /* big value for bootstrap3 compatibility */ -} - -.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; /* @todo: spec for maximum height. */ - 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: grab; - cursor: -webkit-grab; -} - -.blocklyDragging { - cursor: grabbing; - cursor: -webkit-grabbing; - /* Drag surface disables events to not block the toolbox, so we have to - * reenable them here for the cursor values to work. */ - pointer-events: auto; -} - - /* Changes cursor on mouse down. Not effective in Firefox because of - https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */ -.blocklyDraggable:active { - 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; -} - -/* - Don't allow users to select text. It gets annoying when trying to - drag a block and selected text moves instead. -*/ -.blocklySvg 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; - height: 100%; -} - -.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; -} - -/* Remove the increase and decrease arrows on the field number editor */ -input.blocklyHtmlInput[type=number]::-webkit-inner-spin-button, -input.blocklyHtmlInput[type=number]::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} - -input[type=number] { - -moz-appearance: textfield; -} - -.blocklyMainBackground { - stroke-width: 1; - stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */ -} - -.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; -} - -/* Darken flyout scrollbars due to being on a grey background. */ -/* By contrast, workspace scrollbars are on a white background. */ -.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 { - /* 28px on the left for icon or checkbox. */ - padding-left: 28px; -} - -/* BiDi override for the resting state. */ -.blocklyDropdownMenu .blocklyMenuItemRtl { - /* Flip left/right padding for BiDi. */ - 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; /* Arbitrary, but some apps depend on it... */ -} - -.blocklyWidgetDiv .blocklyMenu.blocklyFocused { - box-shadow: 0 0 6px 1px rgba(0,0,0,.3); -} - -.blocklyDropDownDiv .blocklyMenu { - background: inherit; /* Compatibility with gapi, reset from goog-menu */ - border: inherit; /* Compatibility with gapi, reset from goog-menu */ - font: normal 13px "Helvetica Neue", Helvetica, sans-serif; - outline: none; - position: relative; /* Compatibility with gapi, reset from goog-menu */ - z-index: 20000; /* Arbitrary, but some apps depend on it... */ -} - -/* State: resting. */ -.blocklyMenuItem { - border: none; - color: #000; - cursor: pointer; - list-style: none; - margin: 0; - /* 7em on the right for shortcut. */ - min-width: 7em; - padding: 6px 15px; - white-space: nowrap; -} - -/* State: disabled. */ -.blocklyMenuItemDisabled { - color: #ccc; - cursor: inherit; -} - -/* State: hover. */ -.blocklyMenuItemHighlight { - background-color: rgba(0,0,0,.1); -} - -/* State: selected/checked. */ -.blocklyMenuItemCheckbox { - height: 16px; - position: absolute; - width: 16px; -} - -.blocklyMenuItemSelected .blocklyMenuItemCheckbox { - background: url(<<>>/sprites.png) no-repeat -48px -16px; - float: left; - margin-left: -24px; - position: static; /* Scroll with the menu. */ -} - -.blocklyMenuItemRtl .blocklyMenuItemCheckbox { - float: right; - margin-right: -24px; -} - -.blocklyBlockDragSurface, .blocklyAnimationLayer { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - overflow: visible !important; - z-index: 80; - pointer-events: none; -} -`,ah={};ah.inject=ie,ah.register=q;var se=class{constructor(e,t){this.x=e,this.y=t}clone(){return new se(this.x,this.y)}scale(e){return this.x*=e,this.y*=e,this}translate(e,t){return this.x+=e,this.y+=t,this}static equals(e,t){return e===t?!0:e&&t?e.x===t.x&&e.y===t.y:!1}static distance(e,t){const s=e.x-t.x;return e=e.y-t.y,Math.sqrt(s*s+e*e)}static magnitude(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static difference(e,t){return new se(e.x-t.x,e.y-t.y)}static sum(e,t){return new se(e.x+t.x,e.y+t.y)}},on="http://www.w3.org/2000/svg",Fs="http://www.w3.org/1999/xhtml",ss="http://www.w3.org/1999/xlink",ho;(function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE"})(ho||(ho={}));var Is=null,hh=0,jl=null,wt={HTML_NS:Fs};wt.NodeType=ho,wt.SVG_NS=on,wt.XLINK_NS=ss,wt.addClass=U,wt.createSvgElement=A,wt.getFastTextWidth=Ie,wt.getFastTextWidthWithSizeString=Ee,wt.getTextWidth=he,wt.hasClass=ne,wt.insertAfter=L,wt.measureFontMetrics=g,wt.removeClass=oe,wt.removeClasses=K,wt.removeNode=$,wt.setCssTransform=le,wt.startTextWidthCache=ce,wt.stopTextWidthCache=ue;var x=class{constructor(e){this.tagName=e}toString(){return this.tagName}};x.ANIMATE=new x("animate"),x.CIRCLE=new x("circle"),x.CLIPPATH=new x("clipPath"),x.DEFS=new x("defs"),x.FECOMPOSITE=new x("feComposite"),x.FECOMPONENTTRANSFER=new x("feComponentTransfer"),x.FEFLOOD=new x("feFlood"),x.FEFUNCA=new x("feFuncA"),x.FEGAUSSIANBLUR=new x("feGaussianBlur"),x.FEPOINTLIGHT=new x("fePointLight"),x.FESPECULARLIGHTING=new x("feSpecularLighting"),x.FILTER=new x("filter"),x.FOREIGNOBJECT=new x("foreignObject"),x.G=new x("g"),x.IMAGE=new x("image"),x.LINE=new x("line"),x.PATH=new x("path"),x.PATTERN=new x("pattern"),x.POLYGON=new x("polygon"),x.RECT=new x("rect"),x.SVG=new x("svg"),x.TEXT=new x("text"),x.TSPAN=new x("tspan");var qe=class{constructor(e,t,s,i){this.top=e,this.bottom=t,this.left=s,this.right=i}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom}intersects(e){return!(this.left>e.right||this.righte.bottom||this.bottom=e||isNaN(e)?0:Math.min(e,this.scrollbarLength)}setHandleLength(e){this.handleLength=e,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength-this.handleLength)}setHandlePosition(e){this.handlePosition=e,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(e){this.scrollbarLength=e,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(e,t){this.position.x=e,this.position.y=t,le(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(e){!e&&(e=this.workspace.getMetrics(),!e)||this.oldHostMetrics&&Et.metricsAreEquivalent(e,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(e):this.resizeVertical(e),this.oldHostMetrics=e,this.updateMetrics())}requiresViewResize(e){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft||this.oldHostMetrics.absoluteTop!==e.absoluteTop:!0}resizeHorizontal(e){this.requiresViewResize(e)?this.resizeViewHorizontal(e):this.resizeContentHorizontal(e)}resizeViewHorizontal(e){var t=e.viewWidth-2*this.margin;this.pair&&(t-=Et.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),t=e.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(t+=Et.scrollbarThickness),this.setPosition(t,e.absoluteTop+e.viewHeight-Et.scrollbarThickness-this.margin),this.resizeContentHorizontal(e)}resizeContentHorizontal(e){if(e.viewWidth>=e.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewWidth/e.scrollWidth;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollWidth-e.viewWidth;var s=this.scrollbarLength-this.handleLength;e=(e.viewLeft-e.scrollLeft)/t*s,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=s/t}}resizeVertical(e){this.requiresViewResize(e)?this.resizeViewVertical(e):this.resizeContentVertical(e)}resizeViewVertical(e){let t=e.viewHeight-2*this.margin;this.pair&&(t-=Et.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),this.setPosition(this.workspace.RTL?e.absoluteLeft+this.margin:e.absoluteLeft+e.viewWidth-Et.scrollbarThickness-this.margin,e.absoluteTop+this.margin),this.resizeContentVertical(e)}resizeContentVertical(e){if(e.viewHeight>=e.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewHeight/e.scrollHeight;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollHeight-e.viewHeight;var s=this.scrollbarLength-this.handleLength;e=(e.viewTop-e.scrollTop)/t*s,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=s/t}}isVisible(){return this.isHandleVisible}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay_()}setVisible(e){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(e)}setVisibleInternal(e){const t=e!==this.isVisible();this.isHandleVisible=e,t&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(e){if(this.workspace.markFocused(),je(),this.cleanUp(),v(e))e.stopPropagation();else{var t=G(e,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());t=this.horizontal?t.x:t.y;var s=E(this.svgHandle);s=this.horizontal?s.x:s.y;var i=this.handlePosition,r=.95*this.handleLength;t<=s?i-=r:t>=s+this.handleLength&&(i+=r),this.setHandlePosition(this.constrainHandlePosition(i)),this.updateMetrics(),e.stopPropagation(),e.preventDefault()}}onMouseDownHandle(e){this.workspace.markFocused(),this.cleanUp(),v(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?e.clientX:e.clientY,this.onMouseUpWrapper_=pe(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=pe(document,"pointermove",this,this.onMouseMoveHandle),e.stopPropagation(),e.preventDefault())}onMouseMoveHandle(e){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?e.clientX:e.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){je(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(Ae(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(Ae(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let e=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(e)&&(e=0),e}updateMetrics(){const e=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:e}):this.workspace.setMetrics({y:e})}set(e,t){this.setHandlePosition(this.constrainHandlePosition(e*this.ratio)),(t||t===void 0)&&this.updateMetrics()}setOrigin(e,t){this.origin=new se(e,t)}static metricsAreEquivalent(e,t){return e.viewWidth===t.viewWidth&&e.viewHeight===t.viewHeight&&e.viewLeft===t.viewLeft&&e.viewTop===t.viewTop&&e.absoluteTop===t.absoluteTop&&e.absoluteLeft===t.absoluteLeft&&e.scrollWidth===t.scrollWidth&&e.scrollHeight===t.scrollHeight&&e.scrollLeft===t.scrollLeft&&e.scrollTop===t.scrollTop}};Et.scrollbarThickness=sT?25:15,Et.DEFAULT_SCROLLBAR_MARGIN=.5;var Kl={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},dh={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:Jl,DOMParser:rn,XMLSerializer:nn}=globalThis;rn&&(Kl=new rn),nn&&(dh=new nn);var ET="https://developers.google.com/blockly/xml",df=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,or={NAME_SPACE:ET};or.createElement=o.createElement$$module$build$src$core$utils$xml,or.createTextNode=o.createTextNode$$module$build$src$core$utils$xml,or.domToText=ut,or.injectDependencies=Ge,or.textToDom=o.textToDom$$module$build$src$core$utils$xml;var $h="categoryToolbox",fT="flyoutToolbox",Ce;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"})(Ce||(Ce={}));var IT={hasCategoriesInternal:w$},Po={};Po.Position=Ce,Po.TEST_ONLY=IT,Po.convertFlyoutDefToJsonArray=wr,Po.convertToolboxDefToJson=Zs,Po.hasCategories=tl,Po.isCategoryCollapsible=sl,Po.parseToolboxTree=ru;var $o;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM"})($o||($o={}));var ir;(function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT"})(ir||(ir={}));var xo;(function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN"})(xo||(xo={}));var hi={};hi.bumpDirection=xo,hi.bumpPositionRect=nl,hi.getCornerOppositeToolbox=rl,hi.getStartPositionRect=il,hi.horizontalPosition=ir,hi.verticalPosition=$o;var Yt={width:96,height:124,url:"sprites.png"},OT=class{constructor(e){this.workspace=e,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=A(x.G,{});const e=String(Math.random()).substring(2);return this.createZoomOutSvg(e),this.createZoomInSvg(e),this.workspace.isMovable()&&this.createZoomResetSvg(e),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:2,capabilities:[Mt.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&$(this.svgGroup);for(const e of this.boundEvents)Ae(e);this.boundEvents.length=0}getBoundingRectangle(){let e=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(e+=this.LARGE_SPACING+this.HEIGHT),new qe(this.top,this.top+e,this.left,this.left+this.WIDTH)}position(e,t){if(this.initialized){var s=rl(this.workspace,e),i=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(i+=this.LARGE_SPACING+this.HEIGHT),e=il(s,new Be(this.WIDTH,i),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,e,this.workspace),s=s.vertical,t=nl(e,this.MARGIN_VERTICAL,s===$o.TOP?xo.DOWN:xo.UP,t),s===$o.TOP){var r=this.SMALL_SPACING+this.HEIGHT,p;(p=this.zoomInGroup)==null||p.setAttribute("transform","translate(0, "+r+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(r+this.LARGE_SPACING+this.HEIGHT)+")")}else{p=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let S;(S=this.zoomInGroup)==null||S.setAttribute("transform","translate(0, "+p+")"),p=p+this.SMALL_SPACING+this.HEIGHT,(r=this.zoomOutGroup)==null||r.setAttribute("transform","translate(0, "+p+")")}this.top=t.top,this.left=t.left;var I;(I=this.svgGroup)==null||I.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(e){this.zoomOutGroup=A(x.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const t=A(x.CLIPPATH,{id:"blocklyZoomoutClipPath"+e},this.zoomOutGroup);A(x.RECT,{width:32,height:32},t),A(x.IMAGE,{width:Yt.width,height:Yt.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+e+")"},this.zoomOutGroup).setAttributeNS(ss,"xlink:href",this.workspace.options.pathToMedia+Yt.url),this.boundEvents.push(pe(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(e){this.zoomInGroup=A(x.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const t=A(x.CLIPPATH,{id:"blocklyZoominClipPath"+e},this.zoomInGroup);A(x.RECT,{width:32,height:32},t),A(x.IMAGE,{width:Yt.width,height:Yt.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+e+")"},this.zoomInGroup).setAttributeNS(ss,"xlink:href",this.workspace.options.pathToMedia+Yt.url),this.boundEvents.push(pe(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(e,t){this.workspace.markFocused(),this.workspace.zoomCenter(e),this.fireZoomEvent(),je(),t.stopPropagation(),t.preventDefault()}createZoomResetSvg(e){this.zoomResetGroup=A(x.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const t=A(x.CLIPPATH,{id:"blocklyZoomresetClipPath"+e},this.zoomResetGroup);A(x.RECT,{width:32,height:32},t),A(x.IMAGE,{width:Yt.width,height:Yt.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+e+")"},this.zoomResetGroup).setAttributeNS(ss,"xlink:href",this.workspace.options.pathToMedia+Yt.url),this.boundEvents.push(pe(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(e){this.workspace.markFocused();const t=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(t),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),je(),e.stopPropagation(),e.preventDefault()}fireZoomEvent(){const e=new($e(no))(null,this.workspace.id,"zoom_controls");X(e)}};q(` -.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; -} -`);var ln="_TEMP_COLLAPSED_INPUT",ql="_TEMP_COLLAPSED_FIELD",$s="MANUALLY_DISABLED",$f={COLLAPSED_FIELD_NAME:ql,COLLAPSED_INPUT_NAME:ln,MANUALLY_DISABLED:$s},Nt=class{constructor(e){this.name=e}toString(){return this.name}equals(e){return this.name===e.toString()}};Nt.MUTATOR=new Nt("mutator"),Nt.WARNING=new Nt("warning"),Nt.COMMENT=new Nt("comment"),function(e){e[e.VALUE=1]="VALUE",e[e.STATEMENT=3]="STATEMENT",e[e.DUMMY=5]="DUMMY",e[e.CUSTOM=6]="CUSTOM",e[e.END_ROW=7]="END_ROW"}(o.inputTypes$$module$build$src$core$inputs$input_types||(o.inputTypes$$module$build$src$core$inputs$input_types={})),o.inputTypes$$module$build$src$core$inputs$input_types;var bT=function(e,t){window.alert(e),t&&t()},RT=function(e,t){t(window.confirm(e))},ST=function(e,t,s){s(window.prompt(e,t))},NT={confirmInternal:B$},di={TEST_ONLY:NT};di.alert=Pr,di.confirm=ll,di.prompt=cl,di.setAlert=x$,di.setConfirm=F$,di.setPrompt=U$;var _h,CT;o.Msg$$module$build$src$core$msg=Object.create(null),_h=function(e){Object.keys(e).forEach(function(t){o.Msg$$module$build$src$core$msg[t]=e[t]})},CT={Msg:o.Msg$$module$build$src$core$msg,setLocale:_h};var cn=class extends sr{constructor(e){super(),this.isBlank=typeof e>"u",e&&(this.varId=e.getId(),this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return e.varId=this.varId,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new cn),t.varId=e.varId,t}},ph=class extends cn{constructor(e){super(e),this.type=ro,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new ph),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.createVariable(this.varName,this.varType,this.varId):t.deleteVariableById(this.varId)}};c(ee.EVENT,ro,ph);var un=class{constructor(e,t,s,i){this.workspace=e,this.name=t,this.type=s||"",this.id_=i||ae()}getId(){return this.id_}static compareByName(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}},Th="VARIABLE",gh="ijkmnopqrstuvwxyzabcdefgh",LT={generateUniqueNameInternal:G$},Ft={CATEGORY_NAME:Th,TEST_ONLY:LT,VAR_LETTER_OPTIONS:gh};Ft.allDeveloperVariables=o.allDeveloperVariables$$module$build$src$core$variables,Ft.allUsedVarModels=o.allUsedVarModels$$module$build$src$core$variables,Ft.createVariableButtonHandler=Di,Ft.flyoutCategory=ul,Ft.flyoutCategoryBlocks=lu,Ft.generateUniqueName=cu,Ft.generateUniqueNameFromOptions=al,Ft.generateVariableFieldDom=Jo,Ft.getAddedVariables=xr,Ft.getOrCreateVariablePackage=o.getOrCreateVariablePackage$$module$build$src$core$variables,Ft.getVariable=o.getVariable$$module$build$src$core$variables,Ft.nameUsedWithAnyType=uu,Ft.nameUsedWithConflictingParam=au,Ft.promptName=hl,Ft.renameVariable=o.renameVariable$$module$build$src$core$variables;var Ql=new Set,mh=new WeakSet,Eh=new WeakMap,rr=null,fh=null,AT=0,Zl={};Zl.finishQueuedRenders=vs,Zl.queueRender=hu,Zl.triggerQueuedRenders=eo;var ec=class{constructor(e,t){this.workspace=e,this.text="",this.size=new Be(120,100),this.collapsed=!1,this.deletable=this.movable=this.editable=!0,this.location=new se(0,0),this.disposing=this.disposed=!1,this.id=t&&!e.getCommentById(t)?t:ae(),e.addTopComment(this),this.fireCreateEvent()}fireCreateEvent(){de()&&X(new($e(lo))(this))}fireDeleteEvent(){de()&&X(new($e(er))(this))}fireChangeEvent(e,t){de()&&X(new($e(tr))(this,e,t))}fireCollapseEvent(e){de()&&X(new($e(Zr))(this,e))}setText(e){const t=this.text;this.text=e,this.fireChangeEvent(t,e)}getText(){return this.text}setSize(e){this.size=e}getSize(){return this.size}setCollapsed(e){this.collapsed=e,this.fireCollapseEvent(e)}isCollapsed(){return this.collapsed}setEditable(e){this.editable=e}isEditable(){return this.isOwnEditable()&&!this.workspace.options.readOnly}isOwnEditable(){return this.editable}setMovable(e){this.movable=e}isMovable(){return this.isOwnMovable()&&!this.workspace.options.readOnly}isOwnMovable(){return this.movable}setDeletable(e){this.deletable=e}isDeletable(){return this.isOwnDeletable()&&!this.workspace.options.readOnly}isOwnDeletable(){return this.deletable}moveTo(e,t){const s=new($e(co))(this);t&&s.setReason(t),this.location=e,s.recordNew(),de()&&X(s)}getRelativeToSurfaceXY(){return this.location}dispose(){this.disposing=!0,this.fireDeleteEvent(),this.workspace.removeTopComment(this),this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||this.disposed}},nr=50,Ih=100,MT=class{constructor(e){this.workspace=e,this.size=new Be(120,100),this.collapsed=!1,this.editable=!0,this.location=new se(0,0),this.text="",this.textChangeListeners=[],this.sizeChangeListeners=[],this.disposeListeners=[],this.collapseChangeListeners=[],this.resizePointerMoveListener=this.resizePointerUpListener=null,this.disposed=this.disposing=!1,this.svgRoot=A(x.G,{class:"blocklyComment blocklyEditable"}),this.highlightRect=this.createHighlightRect(this.svgRoot),{topBarGroup:this.topBarGroup,topBarBackground:this.topBarBackground,deleteIcon:this.deleteIcon,foldoutIcon:this.foldoutIcon,textPreview:this.textPreview,textPreviewNode:this.textPreviewNode}=this.createTopBar(this.svgRoot,e),{foreignObject:this.foreignObject,textArea:this.textArea}=this.createTextArea(this.svgRoot),this.resizeHandle=this.createResizeHandle(this.svgRoot,e);let t;(t=e.getLayerManager())==null||t.append(this,nr),this.setSize(this.size),this.moveTo(new se(0,0))}createHighlightRect(e){return A(x.RECT,{class:"blocklyCommentHighlight"},e)}createTopBar(e,t){e=A(x.G,{class:"blocklyCommentTopbar"},e);const s=A(x.RECT,{class:"blocklyCommentTopbarBackground"},e),i=A(x.IMAGE,{class:"blocklyDeleteIcon",href:`${t.options.pathToMedia}delete-icon.svg`},e);t=A(x.IMAGE,{class:"blocklyFoldoutIcon",href:`${t.options.pathToMedia}foldout-icon.svg`},e);const r=A(x.TEXT,{class:"blocklyCommentPreview blocklyCommentText blocklyText"},e),p=document.createTextNode("");return r.appendChild(p),pe(t,"pointerdown",this,this.onFoldoutDown),pe(i,"pointerdown",this,this.onDeleteDown),{topBarGroup:e,topBarBackground:s,deleteIcon:i,foldoutIcon:t,textPreview:r,textPreviewNode:p}}createTextArea(e){e=A(x.FOREIGNOBJECT,{class:"blocklyCommentForeignObject"},e);const t=document.createElementNS(Fs,"body");t.setAttribute("xmlns",Fs),t.className="blocklyMinimalBody";const s=document.createElementNS(Fs,"textarea");return U(s,"blocklyCommentText"),U(s,"blocklyTextarea"),U(s,"blocklyText"),t.appendChild(s),e.appendChild(t),pe(s,"change",this,this.onTextChange),{foreignObject:e,textArea:s}}createResizeHandle(e,t){return e=A(x.IMAGE,{class:"blocklyResizeHandle",href:`${t.options.pathToMedia}resize-handle.svg`},e),pe(e,"pointerdown",this,this.onResizePointerDown),e}getSvgRoot(){return this.svgRoot}getSize(){return this.collapsed?this.topBarBackground.getBBox():this.size}setSize(e){const t=this.topBarBackground.getBBox(),s=this.deleteIcon.getBBox(),i=this.foldoutIcon.getBBox(),r=this.textPreview.getBBox(),p=this.resizeHandle.getBBox();e=Be.max(e,this.calcMinSize(t,i,s));const I=this.size;this.size=e,this.svgRoot.setAttribute("height",`${e.height}`),this.svgRoot.setAttribute("width",`${e.width}`),this.updateHighlightRect(e),this.updateTopBarSize(e),this.updateTextAreaSize(e,t),this.updateDeleteIconPosition(e,t,s),this.updateFoldoutIconPosition(t,i),this.updateTextPreviewSize(e,t,r,s,p),this.updateResizeHandlePosition(e,p),this.onSizeChange(I,this.size)}calcMinSize(e,t,s){var i;this.updateTextPreview((i=this.textArea.value)!=null?i:""),i=he(this.textPreview);const r=this.calcFoldoutMargin(e,t),p=this.calcDeleteMargin(e,s);let I=i;return this.foldoutIcon.checkVisibility()?I+=t.width+2*r:i&&(I+=4),this.deleteIcon.checkVisibility()?I+=s.width+2*p:i&&(I+=4),new Be(I,e.height+20)}calcDeleteMargin(e,t){return(e.height-t.height)/2}calcFoldoutMargin(e,t){return(e.height-t.height)/2}updateHighlightRect(e){this.highlightRect.setAttribute("height",`${e.height}`),this.highlightRect.setAttribute("width",`${e.width}`),this.workspace.RTL&&this.highlightRect.setAttribute("x",`${-e.width}`)}updateTopBarSize(e){this.topBarBackground.setAttribute("width",`${e.width}`)}updateTextAreaSize(e,t){this.foreignObject.setAttribute("height",`${e.height-t.height}`),this.foreignObject.setAttribute("width",`${e.width}`),this.foreignObject.setAttribute("y",`${t.height}`),this.workspace.RTL&&this.foreignObject.setAttribute("x",`${-e.width}`)}updateDeleteIconPosition(e,t,s){t=this.calcDeleteMargin(t,s),this.deleteIcon.setAttribute("y",`${t}`),this.deleteIcon.setAttribute("x",`${e.width-s.width-t}`)}updateFoldoutIconPosition(e,t){e=this.calcFoldoutMargin(e,t),this.foldoutIcon.setAttribute("y",`${e}`),this.foldoutIcon.setAttribute("x",`${e}`)}updateTextPreviewSize(e,t,s,i,r){const p=(t.height-s.height)/2,I=this.calcDeleteMargin(t,i);t=this.calcFoldoutMargin(t,r),e=e.width-r.width-2*t-i.width-2*I,this.textPreview.setAttribute("x",`${r.width+2*t*(this.workspace.RTL?-1:1)}`),this.textPreview.setAttribute("y",`${p+s.height/2}`),this.textPreview.setAttribute("width",`${e}`)}updateResizeHandlePosition(e,t){this.resizeHandle.setAttribute("y",`${e.height-t.height}`),this.resizeHandle.setAttribute("x",`${e.width-t.width}`)}onSizeChange(e,t){for(let s=this.sizeChangeListeners.length-1;0<=s;s--)this.sizeChangeListeners[s](e,t)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}removeSizeChangeListener(e){this.sizeChangeListeners.splice(this.sizeChangeListeners.indexOf(e),1)}onResizePointerDown(e){this.isEditable()&&(this.bringToFront(),v(e)||(this.workspace.startDrag(e,new se(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=pe(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=pe(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation())}onResizePointerUp(e){je(),this.resizePointerUpListener&&(Ae(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(Ae(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=this.workspace.moveDrag(e),this.setSize(new Be(this.workspace.RTL?-e.x:e.x,e.y))}isCollapsed(){return this.collapsed}setCollapsed(e){(this.collapsed=e)?U(this.svgRoot,"blocklyCollapsed"):oe(this.svgRoot,"blocklyCollapsed"),this.setSize(this.size),this.onCollapse()}onCollapse(){for(let e=this.collapseChangeListeners.length-1;0<=e;e--)this.collapseChangeListeners[e](this.collapsed)}addOnCollapseListener(e){this.collapseChangeListeners.push(e)}removeOnCollapseListener(e){this.collapseChangeListeners.splice(this.collapseChangeListeners.indexOf(e),1)}onFoldoutDown(e){this.bringToFront(),v(e)||(this.setCollapsed(!this.collapsed),this.workspace.hideChaff()),e.stopPropagation()}isEditable(){return this.editable}setEditable(e){(this.editable=e)?(U(this.svgRoot,"blocklyEditable"),oe(this.svgRoot,"blocklyReadonly"),this.textArea.removeAttribute("readonly")):(oe(this.svgRoot,"blocklyEditable"),U(this.svgRoot,"blocklyReadonly"),this.textArea.setAttribute("readonly","true"))}getRelativeToSurfaceXY(){return this.location}moveTo(e){this.location=e,this.svgRoot.setAttribute("transform",`translate(${e.x}, ${e.y})`)}getText(){return this.text}setText(e){this.textArea.value=e,this.onTextChange()}addTextChangeListener(e){this.textChangeListeners.push(e)}removeTextChangeListener(e){this.textChangeListeners.splice(this.textChangeListeners.indexOf(e),1)}onTextChange(){const e=this.text;this.text=this.textArea.value,this.updateTextPreview(this.text),this.setSize(this.size);for(let t=this.textChangeListeners.length-1;0<=t;t--)this.textChangeListeners[t](e,this.text)}updateTextPreview(e){this.textPreviewNode.textContent=this.truncateText(e)}truncateText(e){return 12<=e.length?`${e.substring(0,9)}...`:e}bringToFront(){const e=this.svgRoot.parentNode,t=e.childNodes;t[t.length-1]!==this.svgRoot&&e.appendChild(this.svgRoot)}onDeleteDown(e){v(e)||this.dispose(),e.stopPropagation()}dispose(){this.disposing=!0,$(this.svgRoot);for(let e=this.disposeListeners.length-1;0<=e;e--)this.disposeListeners[e]();this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||this.disposed}addDisposeListener(e){this.disposeListeners.push(e)}removeDisposeListener(e){this.disposeListeners.splice(this.disposeListeners.indexOf(e),1)}};q(` -.injectionDiv { - --commentFillColour: #FFFCC7; - --commentBorderColour: #F2E49B; -} - -.blocklyComment .blocklyTextarea { - background-color: var(--commentFillColour); - border: 1px solid var(--commentBorderColour); - box-sizing: border-box; - display: block; - outline: 0; - padding: 5px; - resize: none; - width: 100%; - height: 100%; -} - -.blocklyReadonly.blocklyComment .blocklyTextarea { - cursor: inherit; -} - -.blocklyDeleteIcon { - width: 20px; - height: 20px; - display: none; - cursor: pointer; -} - -.blocklyFoldoutIcon { - width: 20px; - height: 20px; - transform-origin: 12px 12px; - cursor: pointer; -} -.blocklyResizeHandle { - width: 12px; - height: 12px; - cursor: se-resize; -} -.blocklyReadonly.blocklyComment .blocklyResizeHandle { - cursor: inherit; -} - -.blocklyCommentTopbarBackground { - cursor: grab; - fill: var(--commentBorderColour); - height: 24px; -} - -.blocklyComment .blocklyCommentPreview.blocklyText { - fill: #000; - dominant-baseline: middle; - visibility: hidden; -} - -.blocklyCollapsed.blocklyComment .blocklyCommentPreview { - visibility: visible; -} - -.blocklyCollapsed.blocklyComment .blocklyCommentForeignObject, -.blocklyCollapsed.blocklyComment .blocklyResizeHandle { - display: none; -} - -.blocklyCollapsed.blocklyComment .blocklyFoldoutIcon { - transform: rotate(-90deg); -} - -.blocklyRTL .blocklyCommentTopbar { - transform: scale(-1, 1); -} - -.blocklyRTL .blocklyCommentForeignObject { - direction: rtl; -} - -.blocklyRTL .blocklyCommentPreview { - /* Revert the scale and control RTL using direction instead. */ - transform: scale(-1, 1); - direction: rtl; -} - -.blocklyRTL .blocklyResizeHandle { - transform: scale(-1, 1); - cursor: sw-resize; -} - -.blocklyCommentHighlight { - fill: none; -} - -.blocklySelected .blocklyCommentHighlight { - stroke: #fc3; - stroke-width: 3px; -} - -.blocklyCollapsed.blocklySelected .blocklyCommentHighlight { - stroke: none; -} - -.blocklyCollapsed.blocklySelected .blocklyCommentTopbarBackground { - stroke: #fc3; - stroke-width: 3px; -} -`);var vT=class{constructor(e){this.comment=e,this.startLoc=null,this.workspace=e.workspace}isMovable(){return this.comment.isOwnMovable()&&!this.workspace.options.readOnly}startDrag(){o.getGroup$$module$build$src$core$events$utils()||o.setGroup$$module$build$src$core$events$utils(!0),this.startLoc=this.comment.getRelativeToSurfaceXY(),this.workspace.setResizesEnabled(!1);let e;(e=this.workspace.getLayerManager())==null||e.moveToDragLayer(this.comment),this.comment.setDragging(!0)}drag(e){this.comment.moveDuringDrag(e)}endDrag(){this.fireMoveEvent();let e;(e=this.workspace.getLayerManager())==null||e.moveOffDragLayer(this.comment,nr),this.comment.setDragging(!1),this.comment.snapToGrid(),this.workspace.setResizesEnabled(!0),o.setGroup$$module$build$src$core$events$utils(!1)}fireMoveEvent(){if(!this.comment.isDeadOrDying()){var e=new($e(co))(this.comment);e.setReason(["drag"]),e.oldCoordinate_=this.startLoc,e.recordNew(),X(e)}}revertDrag(){this.startLoc&&this.comment.moveDuringDrag(this.startLoc)}},yT=100,kT=75,DT=50,wT=25,_f={BLOCKS:DT,PROCEDURES:kT,VARIABLES:yT,WORKSPACE_COMMENTS:wT},Oh={};Oh.register=Br,Oh.unregister=K$;var PT=class{constructor(){this.priority=wT}save(e){const t=[];for(const s of e.getTopComments())(e=wi(s,{addCoordinates:!0,saveIds:!0}))&&t.push(e);return t.length?t:null}load(e,t){for(const s of e)Fr(s,t,{recordUndo:re()})}clear(e){for(const t of e.getTopComments())t.dispose()}};Br("workspaceComments",new PT);var tc={};tc.WorkspaceCommentSerializer=PT,tc.append=Fr,tc.save=wi;var bh={};bh.register=$l,bh.unregister=J$;var sc=class{paste(e,t,s){e=e.commentState,s&&(e.x=s.x,e.y=s.y),o.disable$$module$build$src$core$events$utils();let i;try{i=Fr(e,t),q$(i)}finally{o.enable$$module$build$src$core$events$utils()}return i?(de()&&X(new($e(lo))(i)),o.setSelected$$module$build$src$core$common(i),i):null}};sc.TYPE="workspace-comment",$l(sc.TYPE,new sc);var Rh;Rh=28,o.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:Rh,connectingSnapRadius:Rh,currentConnectionPreference:8,bumpDelay:250},o.config$$module$build$src$core$config;var pf="aria-",Tf="role",Os;(function(e){e.GRID="grid",e.GRIDCELL="gridcell",e.GROUP="group",e.LISTBOX="listbox",e.MENU="menu",e.MENUITEM="menuitem",e.MENUITEMCHECKBOX="menuitemcheckbox",e.OPTION="option",e.PRESENTATION="presentation",e.ROW="row",e.TREE="tree",e.TREEITEM="treeitem"})(Os||(Os={}));var vt;(function(e){e.ACTIVEDESCENDANT="activedescendant",e.COLCOUNT="colcount",e.DISABLED="disabled",e.EXPANDED="expanded",e.INVALID="invalid",e.LABEL="label",e.LABELLEDBY="labelledby",e.LEVEL="level",e.ORIENTATION="orientation",e.POSINSET="posinset",e.ROWCOUNT="rowcount",e.SELECTED="selected",e.SETSIZE="setsize",e.VALUEMAX="valuemax",e.VALUEMIN="valuemin"})(vt||(vt={}));var an={};an.Role=Os,an.State=vt,an.setRole=Lo,an.setState=Dt;var Sh=class{constructor(){this.menuItems=[],this.roleName=this.element=this.onKeyDownHandler=this.mouseLeaveHandler=this.mouseEnterHandler=this.clickHandler=this.mouseOverHandler=this.highlightedItem=this.openingCoords=null}addChild(e){this.menuItems.push(e)}render(e){const t=document.createElement("div");t.className="blocklyMenu goog-menu blocklyNonSelectable",t.tabIndex=0,this.roleName&&Lo(t,this.roleName),this.element=t;for(let s=0,i;i=this.menuItems[s];s++)t.appendChild(i.createDom());return this.mouseOverHandler=pe(t,"pointerover",this,this.handleMouseOver,!0),this.clickHandler=pe(t,"pointerup",this,this.handleClick,!0),this.mouseEnterHandler=pe(t,"pointerenter",this,this.handleMouseEnter,!0),this.mouseLeaveHandler=pe(t,"pointerleave",this,this.handleMouseLeave,!0),this.onKeyDownHandler=pe(t,"keydown",this,this.handleKeyEvent),e.appendChild(t),t}getElement(){return this.element}focus(){const e=this.getElement();e&&(e.focus({preventScroll:!0}),U(e,"blocklyFocused"))}blur(){const e=this.getElement();e&&(e.blur(),oe(e,"blocklyFocused"))}setRole(e){this.roleName=e}dispose(){this.mouseOverHandler&&(Ae(this.mouseOverHandler),this.mouseOverHandler=null),this.clickHandler&&(Ae(this.clickHandler),this.clickHandler=null),this.mouseEnterHandler&&(Ae(this.mouseEnterHandler),this.mouseEnterHandler=null),this.mouseLeaveHandler&&(Ae(this.mouseLeaveHandler),this.mouseLeaveHandler=null),this.onKeyDownHandler&&(Ae(this.onKeyDownHandler),this.onKeyDownHandler=null);for(let e=0,t;t=this.menuItems[e];e++)t.dispose();this.element=null}getMenuItem(e){const t=this.getElement();for(;e&&e!==t;){if(e.classList.contains("blocklyMenuItem")){for(let s=0,i;i=this.menuItems[s];s++)if(i.getElement()===e)return i}e=e.parentElement}return null}setHighlighted(e){var t=this.highlightedItem;t&&(t.setHighlighted(!1),this.highlightedItem=null),e&&(e.setHighlighted(!0),this.highlightedItem=e,t=this.getElement(),u(e.getElement(),t),Dt(t,vt.ACTIVEDESCENDANT,e.getId()))}highlightNext(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(e,1)}highlightPrevious(){const e=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(0>e?this.menuItems.length:e,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(e,t){e+=t;let s;for(;s=this.menuItems[e];){if(s.isEnabled()){this.setHighlighted(s);break}e+=t}}handleMouseOver(e){(e=this.getMenuItem(e.target))&&(e.isEnabled()?this.highlightedItem!==e&&this.setHighlighted(e):this.setHighlighted(null))}handleClick(e){const t=this.openingCoords;if(this.openingCoords=null,t&&typeof e.clientX=="number"){const s=new se(e.clientX,e.clientY);if(1>se.distance(t,s))return}(e=this.getMenuItem(e.target))&&e.performAction()}handleMouseEnter(e){this.focus()}handleMouseLeave(e){this.getElement()&&(this.blur(),this.setHighlighted(null))}handleKeyEvent(e){if(this.menuItems.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var t=this.highlightedItem;switch(e.key){case"Enter":case" ":t&&t.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}e.preventDefault(),e.stopPropagation()}}getSize(){const e=this.getElement(),t=O(e);return t.height=e.scrollHeight,t}},Nh=class{constructor(e,t){this.content=e,this.opt_value=t,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const e=document.createElement("div");e.id=W(),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 ":"");const t=document.createElement("div");if(t.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var s=document.createElement("div");s.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",t.appendChild(s)}return s=this.content,typeof this.content=="string"&&(s=document.createTextNode(this.content)),t.appendChild(s),e.appendChild(t),this.roleName&&Lo(e,this.roleName),Dt(e,vt.SELECTED,this.checkable&&this.checked||!1),Dt(e,vt.DISABLED,!this.enabled),e}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let e;return(e=this.opt_value)!=null?e:null}setRightToLeft(e){this.rightToLeft=e}setRole(e){this.roleName=e}setCheckable(e){this.checkable=e}setChecked(e){this.checked=e}setHighlighted(e){this.highlight=e;const t=this.getElement();t&&this.isEnabled()&&(e?(U(t,"blocklyMenuItemHighlight"),U(t,"goog-menuitem-highlight")):(oe(t,"blocklyMenuItemHighlight"),oe(t,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(e,t){this.actionHandler=e.bind(t)}},lr=class extends Error{},xT=class extends lr{constructor(e){super("Expected to find a 'type' property, defining the block type"),this.state=e}},hn=class extends lr{constructor(e,t,s){super(`The block ${t.toDevString()} is missing a(n) ${e} -connection`),this.block=t,this.state=s}},BT=class extends lr{constructor(e,t,s,i){super(`The block ${s.toDevString()} could not connect its -${t} to its parent, because: ${e}`),this.childBlock=s,this.childState=i}},FT=class extends lr{constructor(e){super(`Encountered a real block which is defined as a child of a shadow -block. It is an invariant of Blockly that shadow blocks only have shadow -children`),this.state=e}},UT=class extends lr{constructor(e,t,s){super(`Cannot add an icon of type '${e}' to the block ${t.toDevString()}, because there is no icon registered with type '${e}'. Make sure that all of your icons have been registered.`),this.block=t,this.state=s}},$i={};$i.BadConnectionCheck=BT,$i.DeserializationError=lr,$i.MissingBlockType=xT,$i.MissingConnection=hn,$i.RealChildOfShadow=FT,$i.UnregisteredIcon=UT;var HT=class{constructor(){this.priority=DT}save(e){const t=[];for(const s of e.getTopBlocks(!1))(e=ts(s,{addCoordinates:!0,doFullSerialization:!1}))&&t.push(e);return t.length?{languageVersion:0,blocks:t}:null}load(e,t){e=e.blocks;for(const s of e)to(s,t,{recordUndo:re()})}clear(e){for(const t of e.getTopBlocks(!1))t.dispose(!1)}};Br("blocks",new HT);var dn={};dn.BlockSerializer=HT,dn.append=to,dn.appendInternal=Pi,dn.save=ts;var _i=class extends sr{constructor(e){super(),this.isBlank=!e,e&&(this.blockId=e.id,this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.blockId=this.blockId,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new _i),t.blockId=e.blockId,t}},pi=class extends _i{constructor(e,t,s,i,r){super(e),this.type=o.CHANGE$$module$build$src$core$events$utils,e&&(this.element=t,this.name=s||void 0,this.oldValue=i,this.newValue=r)}toJson(){const e=super.toJson();if(!this.element)throw Error("The changed element is undefined. Either pass an element to the constructor, or call fromJson");return e.element=this.element,e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,this.disabledReason&&(e.disabledReason=this.disabledReason),e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new pi),t.element=e.element,t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,e.disabledReason!==void 0&&(t.disabledReason=e.disabledReason),t}setDisabledReason(e){if(this.element!=="disabled")throw Error('Cannot set the disabled reason for a BlockChange event if the element is not "disabled".');this.disabledReason=e}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");const s=t.getIcon(Nt.MUTATOR);switch(s&&xi(s)&&s.bubbleIsVisible()&&s.setBubbleVisible(!1),e=e?this.newValue:this.oldValue,this.element){case"field":(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name);break;case"comment":t.setCommentText(e||null);break;case"collapsed":t.setCollapsed(!!e);break;case"disabled":var i;t.setDisabledReason(!!e,(i=this.disabledReason)!=null?i:$s);break;case"inline":t.setInputsInline(!!e);break;case"mutation":i=pi.getExtraBlockState_(t),t.loadExtraState?t.loadExtraState(JSON.parse(e||"{}")):t.domToMutation&&t.domToMutation(o.textToDom$$module$build$src$core$utils$xml(e||"")),X(new pi(t,"mutation",null,i,e));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(e){return e.saveExtraState?(e=e.saveExtraState(!0))?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?ks(e):""}};c(ee.EVENT,o.CHANGE$$module$build$src$core$events$utils,pi);var oc={};oc.clamp=Bi,oc.toDegrees=T_,oc.toRadians=_l;var $n=16,Ch=1,GT=12,Lh=16,ic=.25,Ah=null,Ti=null,cr="",ur="",Ve,ar,gi,Mh=null,Bo=null,VT=null,vh={getBoundsInfo:function(){const e=a(Mh),t=O(Mh);return{left:e.x,right:e.x+t.width,top:e.y,bottom:e.y+t.height,width:t.width,height:t.height}},getPositionMetrics:function(e,t,s,i){const r=vh.getBoundsInfo(),p=O(Ve);return t+p.heightr.top?Lu(s,i,r,p):t+p.heightdocument.documentElement.clientTop?Lu(s,i,r,p):m_(e,r,p)}},Ut={ANIMATION_TIME:ic,ARROW_HORIZONTAL_PADDING:GT,ARROW_SIZE:$n,BORDER_SIZE:Ch,PADDING_Y:Lh,TEST_ONLY:vh};Ut.clearContent=Tl,Ut.createDom=mu,Ut.getContentDiv=pl,Ut.getOwner=fu,Ut.getPositionX=Hr,Ut.hide=ml,Ut.hideIfOwner=gl,Ut.hideWithoutAnimation=ys,Ut.isVisible=Au,Ut.repositionForWindowResize=vu,Ut.setBoundsElement=Eu,Ut.setColour=Iu,Ut.show=Nu,Ut.showPositionedByBlock=g_,Ut.showPositionedByField=Ou;var _n=class{constructor(e){this.workspace=e,this.cursorSvg_=this.cursor_=null,this.markers=new Map,this.markerSvg_=null}registerMarker(e,t){this.markers.has(e)&&this.unregisterMarker(e),t.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,t)),this.setMarkerSvg(t.getDrawer().createDom()),this.markers.set(e,t)}unregisterMarker(e){const t=this.markers.get(e);if(t)t.dispose(),this.markers.delete(e);else throw Error("Marker with ID "+e+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor_}getMarker(e){return this.markers.get(e)||null}setCursor(e){this.cursor_&&this.cursor_.getDrawer()&&this.cursor_.getDrawer().dispose(),(this.cursor_=e)&&(e=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor_),this.cursor_.setDrawer(e),this.setCursorSvg(this.cursor_.getDrawer().createDom()))}setCursorSvg(e){e?(this.workspace.getBlockCanvas().appendChild(e),this.cursorSvg_=e):this.cursorSvg_=null}setMarkerSvg(e){e?this.workspace.getBlockCanvas()&&(this.cursorSvg_?this.workspace.getBlockCanvas().insertBefore(e,this.cursorSvg_):this.workspace.getBlockCanvas().appendChild(e)):this.markerSvg_=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace.getCursor().draw()}dispose(){const e=Object.keys(this.markers);for(let t=0,s;s=e[t];t++)this.unregisterMarker(s);this.markers.clear(),this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)}};_n.LOCAL_MARKER="local_marker_1";var hr={};hr.commonWordPrefix=yu,hr.commonWordSuffix=ku,hr.isNumber=o.isNumber$$module$build$src$core$utils$string,hr.shortestStringLength=Gr,hr.wrap=o.wrap$$module$build$src$core$utils$string;var rc=void 0,pn=!1,dr=!1,WT=50,XT=0,mi=0,yh=0,kh=0,_s=null,Tn=null,Dh=0,wh=10,YT=10,zT=750,nc=5,Ct=null,os={HOVER_MS:zT,LIMIT:WT,MARGINS:nc,OFFSET_X:Dh,OFFSET_Y:wh,RADIUS_OK:YT};os.bindMouseEvents=Ui,os.block=Fu,os.createDom=Pu,os.dispose=Bu,os.getCustomTooltip=O_,os.getDiv=R_,os.getTooltipOfObject=Fi,os.hide=so,os.isVisible=b_,os.setCustomTooltip=I_,os.unbindMouseEvents=fl,os.unblock=Uu;var Ph=.45,xh=.65,jT={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"},ps={};ps.blend=Qo,ps.getHsvSaturation=Hu,ps.getHsvValue=Gu,ps.hexToRgb=Il,ps.hsvToHex=Ol,ps.hueToHex=Vu,ps.names=jT,ps.parse=qo,ps.rgbToHex=Vr,ps.setHsvSaturation=v_,ps.setHsvValue=y_;var gn={};gn.checkMessageReferences=k_,gn.parseBlockColour=Hi,gn.replaceMessageReferences=gt,gn.tokenizeInterpolation=Wu;var Qe=class{constructor(e,t,s){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=this.tooltip_=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new Be(0,0),e!==Qe.SKIP_SETUP&&(s&&this.configure_(s),this.setValue(e),t&&this.setValidator(t))}configure_(e){e.tooltip&&this.setTooltip(gt(e.tooltip))}setSourceBlock(e){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=e}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=A(x.G,{}),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(),this.applyColour())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=A(x.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_)}createTextElement_(){this.textElement_=A(x.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_)}bindEvents_(){const e=this.getClickTarget_();if(!e)throw Error("A click target has not been set.");Ui(e),this.mouseDownWrapper_=pe(e,"pointerdown",this,this.onMouseDown_)}fromXml(e){this.setValue(e.textContent)}toXml(e){return e.textContent=this.getValue(),e}saveState(e){return e=this.saveLegacyState(Qe),e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(Qe,e)||this.setValue(e)}saveLegacyState(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?(e=o.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name",this.name||""),ut(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(e,t){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml?(this.fromXml(o.textToDom$$module$build$src$core$utils$xml(t)),!0):!1}dispose(){gl(this),Zo(this);let e;(e=this.getSourceBlock())!=null&&e.isDeadOrDying()||$(this.fieldGroup_),this.disposed=!0}updateEditable(){const e=this.fieldGroup_,t=this.getSourceBlock();this.EDITABLE&&e&&t&&(this.enabled_&&t.isEditable()?(U(e,"blocklyEditableText"),oe(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(U(e,"blocklyNonEditableText"),oe(e,"blocklyEditableText"),e.style.cursor=""))}setEnabled(e){this.enabled_=e,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==Qe.prototype.showEditor_}isClickableInFlyout(e){return!e}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let e=!1;return this.name&&(this.SERIALIZABLE?e=!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."),e=!0)),e}isVisible(){return this.visible_}setVisible(e){if(this.visible_!==e){this.visible_=e;var t=this.fieldGroup_;t&&(t.style.display=e?"block":"none")}}setValidator(e){this.validator_=e}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(e){this.isClickable()&&this.showEditor_(e)}showEditor_(e){}repositionForWindowResize(){return!1}updateSize_(e){const t=this.getConstants();e=e!==void 0?e:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let s=2*e,i=t.FIELD_TEXT_HEIGHT,r=0;this.textElement_&&(r=Ie(this.textElement_,t.FIELD_TEXT_FONTSIZE,t.FIELD_TEXT_FONTWEIGHT,t.FIELD_TEXT_FONTFAMILY),s+=r),this.isFullBlockField()||(i=Math.max(i,t.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=i,this.size_.width=s,this.positionTextElement_(e,r),this.positionBorderRect_()}positionTextElement_(e,t){if(this.textElement_){var s=this.getConstants(),i=this.size_.height/2,r;this.textElement_.setAttribute("x",String((r=this.getSourceBlock())!=null&&r.RTL?this.size_.width-t-e:e)),this.textElement_.setAttribute("y",String(s.FIELD_TEXT_BASELINE_CENTER?i:i-s.FIELD_TEXT_HEIGHT/2+s.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new Be(0,0)}getScaledBBox(){let e;var t=this.getSourceBlock();if(!t)throw new ft;if(this.isFullBlockField()){var s=this.sourceBlock_.getHeightWidth();const i=t.workspace.scale;e=this.getAbsoluteXY_(),t=(s.width+1)*i,s=(s.height+1)*i,aT?(e.x+=1.5*i,e.y+=1.5*i):(e.x-=.5*i,e.y-=.5*i)}else s=this.borderRect_.getBoundingClientRect(),e=a(this.borderRect_),t=s.width,s=s.height;return new qe(e.y,e.y+s,e.x,e.x+t)}onLocationChange(e){}getDisplayText_(){let e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,Qe.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):Qe.NBSP}getText(){const e=this.getText_();return String(e!==null?e:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(e,t=!0){if(e!==null){var s=this.doClassValidation_(e);if(e=this.processValidation_(e,s,t),!(e instanceof Error)){var i;s=(i=this.getValidator())==null?void 0:i.call(this,e),i=this.processValidation_(e,s,t),i instanceof Error||(e=this.sourceBlock_,e&&e.disposed||(s=this.getValue(),s===i?this.doValueUpdate_(i):(this.doValueUpdate_(i),t&&e&&de()&&X(new($e(o.CHANGE$$module$build$src$core$events$utils))(e,"field",this.name||null,s,i)),this.isDirty_&&this.forceRerender())))}}}processValidation_(e,t,s){return t===null?(this.doValueInvalid_(e,s),this.isDirty_&&this.forceRerender(),Error()):t===void 0?e:t}getValue(){return this.value_}doClassValidation_(e){return e??null}doValueUpdate_(e){this.value_=e,this.isDirty_=!0}doValueInvalid_(e,t){}onMouseDown_(e){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(e=this.sourceBlock_.workspace.getGesture(e))&&e.setStartField(this)}setTooltip(e){e||e===""||(e=this.sourceBlock_);const t=this.getClickTarget_();t?t.tooltip=e:this.tooltip_=e}getTooltip(){const e=this.getClickTarget_();return Fi(e||{tooltip:this.tooltip_})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return a(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let e=null;const t=this.getSourceBlock();if(!t)throw new ft;const s=t.inputList;for(let i=0;i{s.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((e,t)=>void super.setText(t)),this.view.addSizeChangeListener((e,t)=>void super.setSize(t)),this.view.addOnCollapseListener(()=>void super.setCollapsed(this.view.isCollapsed())),this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(e){this.view.setText(e)}setSize(e){this.view.setSize(e)}setCollapsed(e){this.view.setCollapsed(e)}setEditable(e){super.setEditable(e),this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const e=this.getRelativeToSurfaceXY();var t,s;const i=(s=(t=this.view)==null?void 0:t.getSize())!=null?s:this.getSize();return this.workspace.RTL?(t=e.x-i.width,s=e.x):(t=e.x,s=e.x+i.width),new qe(e.y,e.y+i.height,t,s)}moveBy(e,t,s){const i=this.getRelativeToSurfaceXY();e=new se(i.x+e,i.y+t),this.moveTo(e,s)}moveTo(e,t){super.moveTo(e,t),this.view.moveTo(e)}moveDuringDrag(e){this.location=e,this.view.moveTo(e)}setDragging(e){e?U(this.getSvgRoot(),"blocklyDragging"):oe(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0,this.view.isDeadOrDying()||this.view.dispose(),super.dispose()}startGesture(e){const t=this.workspace.getGesture(e);t&&(t.handleCommentStart(e,this),o.setSelected$$module$build$src$core$common(this))}setDeleteStyle(e){e?U(this.getSvgRoot(),"blocklyDraggingDelete"):oe(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){U(this.getSvgRoot(),"blocklySelected")}unselect(){oe(this.getSvgRoot(),"blocklySelected")}toCopyData(){return{paster:sc.TYPE,commentState:wi(this,{addCoordinates:!0})}}showContextMenu(e){const t=Me.registry.getContextMenuOptions(Me.ScopeType.COMMENT,{comment:this});Xr(e,t,this.workspace.RTL,this.workspace)}snapToGrid(){if(!this.isDeadOrDying()){var e=this.workspace.getGrid();if(e!=null&&e.shouldSnap()){var t=this.getRelativeToSurfaceXY();e=e.alignXY(t),e!==t&&this.moveTo(e,["snap"])}}}},Ht={};Ht.appendDomToWorkspace=j_,Ht.blockToDom=Ao,Ht.blockToDomWithXY=jr,Ht.clearWorkspaceAndLoadFromXml=z_,Ht.deleteNext=op,Ht.domToBlock=o.domToBlock$$module$build$src$core$xml,Ht.domToBlockInternal=ei,Ht.domToPrettyText=Y_,Ht.domToText=ks,Ht.domToVariables=ta,Ht.domToWorkspace=o.domToWorkspace$$module$build$src$core$xml,Ht.loadWorkspaceComment=ea,Ht.saveWorkspaceComment=zr,Ht.variablesToDom=Qu,Ht.workspaceToDom=V_;var Fh=class extends _i{constructor(e){super(e),this.type=o.CREATE$$module$build$src$core$events$utils,e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=jr(e),this.ids=it(e),this.json=ts(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=ks(this.xml),e.ids=this.ids,e.json=this.json,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Fh),t.xml=o.textToDom$$module$build$src$core$utils$xml(e.xml),t.ids=e.ids,t.json=e.json,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!gf(t,this.ids))if(e)to(this.json,t);else for(e=0;ee.getBlockById(s)).filter(s=>s&&s.isShadow()).length===t.length};c(ee.EVENT,o.CREATE$$module$build$src$core$events$utils,Fh);var Uh=class extends Bs{constructor(e,t){super(t),this.type=Zi,this.themeName=e}toJson(){const e=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return e.themeName=this.themeName,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Uh),t.themeName=e.themeName,t}};c(ee.EVENT,Zi,Uh);var Hh=class extends Bs{constructor(e,t,s,i,r){super(i),this.type=Do,this.viewTop=e,this.viewLeft=t,this.scale=s,this.oldScale=r}toJson(){const e=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Hh),t.viewTop=e.viewTop,t.viewLeft=e.viewLeft,t.scale=e.scale,t.oldScale=e.oldScale,t}};c(ee.EVENT,Do,Hh);var Te;(function(e){e[e.INPUT_VALUE=1]="INPUT_VALUE",e[e.OUTPUT_VALUE=2]="OUTPUT_VALUE",e[e.NEXT_STATEMENT=3]="NEXT_STATEMENT",e[e.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(Te||(Te={}));var Tr=class{constructor(e){this.connectionChecker=e,this.connections=[]}addConnection(e,t){t=this.calculateIndexForYPos(t),this.connections.splice(t,0,e)}findIndexOfConnection(e,t){if(!this.connections.length)return-1;const s=this.calculateIndexForYPos(t);if(s>=this.connections.length)return-1;t=e.y;let i=s;for(;0<=i&&this.connections[i].y===t;){if(this.connections[i]===e)return i;i--}for(i=s;ie)s=i;else{t=i;break}}return t}removeConnection(e,t){if(e=this.findIndexOfConnection(e,t),e===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(e,1)}getNeighbours(e,t){function s(_e){const st=r-i[_e].x,Ze=p-i[_e].y;return Math.sqrt(st*st+Ze*Ze)<=t&&H.push(i[_e]),Ze(this.flyout?o.config$$module$build$src$core$config.flyoutDragRadius:o.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let e;if(!this.targetBlock||(e=this.flyout)==null||!e.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + - 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),o.getGroup$$module$build$src$core$events$utils()||o.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),o.setSelected$$module$build$src$core$common(this.targetBlock),!0):!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.dragging=!0,this.workspaceDragger=new JT(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(e){if(!this.startWorkspace_)throw Error("Cannot update dragging because the start workspace is undefined");if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.flyout&&this.updateIsDraggingFromFlyout();const t=Ne();t&&ti(t)&&t.isMovable()?(this.dragging=!0,this.dragger=this.createDragger(t,this.startWorkspace_),this.dragger.onDragStart(e),this.dragger.onDrag(e,this.currentDragDeltaXY)):this.updateIsDraggingWorkspace()}createDragger(e,t){return new(P(ee.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(e,t)}doStart(e){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,C(e)?this.cancel():(this.gestureHasStarted=!0,Wi(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=fu(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=e,Fu(),v(e)?this.handleRightClick(e):(e.type.toLowerCase()==="pointerdown"&&e.pointerType!=="mouse"&&It(e,this),this.mouseDownXY=new se(e.clientX,e.clientY),this.bindMouseEvents(e),this.isEnding_||this.handleTouchStart(e)))}bindMouseEvents(e){this.boundEvents.push(pe(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(pe(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(pe(document,"pointerup",null,this.handleUp.bind(this),!0)),e.preventDefault(),e.stopPropagation()}handleStart(e){this.isDragging()||(this.handleTouchStart(e),this.isMultiTouch()&&ct())}handleMove(e){this.isDragging()&&pt(e)||!this.isMultiTouch()?(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.dragger&&this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(e),ct())}handleUp(e){if(this.isDragging()||this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()){if(!pt(e))return;if(this.updateFromEvent(e),ct(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.dragger?this.dragger.onDragEnd(e,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(e))}e.preventDefault(),e.stopPropagation(),this.dispose()}handleTouchStart(e){var t=Tt(e);this.cachedPoints.set(t,this.getTouchPoint(e));var s=Array.from(this.cachedPoints.keys());s.length===2&&(t=this.cachedPoints.get(s[0]),s=this.cachedPoints.get(s[1]),this.startDistance=se.distance(t,s),this.isMultiTouch_=!0,e.preventDefault())}handleTouchMove(e){const t=Tt(e);this.cachedPoints.set(t,this.getTouchPoint(e)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(e):this.handleMove(e)}handlePinch(e){var t=Array.from(this.cachedPoints.keys()),s=this.cachedPoints.get(t[0]);if(t=this.cachedPoints.get(t[1]),s=se.distance(s,t)/this.startDistance,0this.previousScale){if(t=s-this.previousScale,t=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(e){return this.startWorkspace_?new se(e.pageX,e.pageY):null}isMultiTouch(){return this.isMultiTouch_}cancel(){this.isEnding_||(ct(),this.dragger?this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(e){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(e)):this.startBubble?this.startBubble.showContextMenu(e):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(e)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()}handleWsStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(t),this.mostRecentEvent=e,this.startBlock||this.startBubble||this.startComment||o.setSelected$$module$build$src$core$common(null),this.doStart(e)}fireWorkspaceClick(e){X(new($e(no))(null,e.id,"workspace"))}handleFlyoutStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(t),this.handleWsStart(e,t.getWorkspace())}handleBlockStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(t),this.mostRecentEvent=e}handleBubbleStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(t),this.mostRecentEvent=e}handleCommentStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(t),this.mostRecentEvent=e}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");if(this.targetBlock.isEnabled()){o.getGroup$$module$build$src$core$events$utils()||o.setGroup$$module$build$src$core$events$utils(!0);var e=this.flyout.createBlock(this.targetBlock);e.snapToGrid(),e.bumpNeighbours()}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");e=new($e(no))(this.startBlock,this.startWorkspace_.id,"block"),X(e)}this.bringBlockToFront(),o.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(e){e=this.creatorWorkspace,Ne()&&Ne().unselect(),this.fireWorkspaceClick(this.startWorkspace_||e)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=e)}setStartIcon(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=e)}setStartBubble(e){this.startBubble||(this.startBubble=e)}setStartComment(e){this.startComment||(this.startComment=e)}setStartBlock(e){this.startBlock||this.startBubble||(this.startBlock=e,o.setSelected$$module$build$src$core$common(this.startBlock),e.isInFlyout&&e!==e.getRootBlock()?this.setTargetBlock(e.getRootBlock()):this.setTargetBlock(e))}setTargetBlock(e){e.isShadow()?this.setTargetBlock(e.getParent()):this.targetBlock=e}setStartWorkspace(e){this.startWorkspace_||(this.startWorkspace_=e)}setStartFlyout(e){this.flyout||(this.flyout=e)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const e=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&e}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let e,t;return(t=(e=this.workspaceDragger)!=null?e:this.dragger)!=null?t:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const e=at();for(let t=0,s;s=e[t];t++)if(s.currentGesture_)return!0;return!1}},Gh=class{constructor(e,t){this.pattern=e,this.scale=1;let s;this.spacing=(s=t.spacing)!=null?s:0;let i;this.length=(i=t.length)!=null?i:1,this.line2=(this.line1=e.firstChild)&&this.line1.nextSibling;let r;this.snapToGrid=(r=t.snap)!=null?r:!1}setSpacing(e){this.spacing=e,this.update(this.scale)}getSpacing(){return this.spacing}setLength(e){this.length=e,this.update(this.scale)}getLength(){return this.length}setSnapToGrid(e){this.snapToGrid=e}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(e){this.scale=e;var t=this.spacing*e;this.pattern.setAttribute("width",`${t}`),this.pattern.setAttribute("height",`${t}`),t=Math.floor(this.spacing/2)+.5;let s=t-this.length/2,i=t+this.length/2;t*=e,s*=e,i*=e,this.setLineAttributes(this.line1,e,s,i,t,t),this.setLineAttributes(this.line2,e,t,t,s,i)}setLineAttributes(e,t,s,i,r,p){e&&(e.setAttribute("stroke-width",`${t}`),e.setAttribute("x1",`${s}`),e.setAttribute("y1",`${r}`),e.setAttribute("x2",`${i}`),e.setAttribute("y2",`${p}`))}moveTo(e,t){this.pattern.setAttribute("x",`${e}`),this.pattern.setAttribute("y",`${t}`)}alignXY(e){var t=this.getSpacing();const s=t/2,i=Math.round(Math.round((e.x-s)/t)*t+s);return t=Math.round(Math.round((e.y-s)/t)*t+s),i===e.x&&t===e.y?e:new se(i,t)}static createDom(e,t,s){e=A(x.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},s);let i,r;if(0<((i=t.length)!=null?i:1)&&0<((r=t.spacing)!=null?r:0)){A(x.LINE,{stroke:t.colour},e);let p;(p=t.length)!=null&&p&&A(x.LINE,{stroke:t.colour},e)}else A(x.LINE,{},e);return e}},qT={};qT.deepMerge=oo;var fi=class{constructor(e,t,s,i){this.name=e,this.startHats=!1,this.blockStyles=t||Object.create(null),this.categoryStyles=s||Object.create(null),this.componentStyles=i||Object.create(null),this.fontStyle=Object.create(null),c(ee.THEME,e,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(e,t){this.blockStyles[e]=t}setCategoryStyle(e,t){this.categoryStyles[e]=t}getComponentStyle(e){if(e=this.componentStyles[e],!e)return null;if(typeof e=="string"){const t=this.getComponentStyle(e);if(t)return t}return`${e}`}setComponentStyle(e,t){this.componentStyles[e]=t}setFontStyle(e){this.fontStyle=e}setStartHats(e){this.startHats=e}static defineTheme(e,t){e=e.toLowerCase();const s=new fi(e);let i=t.base;if(i){if(typeof i=="string"){let r;i=(r=F(ee.THEME,i))!=null?r:void 0}i instanceof fi&&(oo(s,i),s.name=e)}return oo(s.blockStyles,t.blockStyles),oo(s.categoryStyles,t.categoryStyles),oo(s.componentStyles,t.componentStyles),oo(s.fontStyle,t.fontStyle),t.startHats!==null&&(s.startHats=t.startHats),s}},ff={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},If={colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}},$c=new fi("classic",ff,If),Ts=class{constructor(e){this.gridPattern=null,this.getMetrics=this.setMetrics=void 0;let t=null,s=!1;var i=!1,r=!1,p=!1,I=!1,S=!1;const H=!!e.readOnly;if(!H){var _e;t=Zs((_e=e.toolbox)!=null?_e:null),s=tl(t),i=e.trashcan,i=i===void 0?s:i,r=e.collapse,r=r===void 0?s:r,p=e.comments,p=p===void 0?s:p,I=e.disable,I=I===void 0?s:I,S=e.sounds,S=S===void 0?!0:S}_e=e.maxTrashcanContents,i?_e===void 0&&(_e=32):_e=0;const st=!!e.rtl;let Ze=e.horizontalLayout;Ze===void 0&&(Ze=!1);var es=e.toolboxPosition!=="end";es=Ze?es?Ce.TOP:Ce.BOTTOM:es===st?Ce.RIGHT:Ce.LEFT;let Nr=e.css;Nr===void 0&&(Nr=!0);let yn="https://blockly-demo.appspot.com/static/media/";e.media&&(yn=e.media.endsWith("/")?e.media:e.media+"/");const sm=e.oneBasedIndex,eI=e.renderer||"geras",tI=e.plugins||{};let wd=e.modalInputs;wd===void 0&&(wd=!0),this.RTL=st,this.oneBasedIndex=sm===void 0?!0:sm,this.collapse=r,this.comments=p,this.disable=I,this.readOnly=H,this.maxBlocks=e.maxBlocks||1/0;let om;this.maxInstances=(om=e.maxInstances)!=null?om:null,this.modalInputs=wd,this.pathToMedia=yn,this.hasCategories=s,this.moveOptions=Ts.parseMoveOptions_(e,s),this.hasScrollbars=!!this.moveOptions.scrollbars,this.hasTrashcan=i,this.maxTrashcanContents=_e,this.hasSounds=S,this.hasCss=Nr,this.horizontalLayout=Ze,this.languageTree=t,this.gridOptions=Ts.parseGridOptions_(e),this.zoomOptions=Ts.parseZoomOptions_(e),this.toolboxPosition=es,this.theme=Ts.parseThemeOptions_(e),this.renderer=eI;let im;this.rendererOverrides=(im=e.rendererOverrides)!=null?im:null;let rm;this.parentWorkspace=(rm=e.parentWorkspace)!=null?rm:null,this.plugins=tI}static parseMoveOptions_(e,t){const s=e.move||{},i={};return s.scrollbars===void 0&&e.scrollbars===void 0?i.scrollbars=t:typeof s.scrollbars=="object"?(i.scrollbars={horizontal:!!s.scrollbars.horizontal,vertical:!!s.scrollbars.vertical},i.scrollbars.horizontal&&i.scrollbars.vertical?i.scrollbars=!0:i.scrollbars.horizontal||i.scrollbars.vertical||(i.scrollbars=!1)):i.scrollbars=!!s.scrollbars||!!e.scrollbars,i.wheel=i.scrollbars&&s.wheel!==void 0?!!s.wheel:typeof i.scrollbars=="object",i.drag=i.scrollbars?s.drag===void 0?!0:!!s.drag:!1,i}static parseZoomOptions_(e){e=e.zoom||{};const t={};return t.controls=e.controls===void 0?!1:!!e.controls,t.wheel=e.wheel===void 0?!1:!!e.wheel,t.startScale=e.startScale===void 0?1:Number(e.startScale),t.maxScale=e.maxScale===void 0?3:Number(e.maxScale),t.minScale=e.minScale===void 0?.3:Number(e.minScale),t.scaleSpeed=e.scaleSpeed===void 0?1.2:Number(e.scaleSpeed),t.pinch=e.pinch===void 0?t.wheel||t.controls:!!e.pinch,t}static parseGridOptions_(e){e=e.grid||{};const t={};return t.spacing=Number(e.spacing)||0,t.colour=e.colour||"#888",t.length=e.length===void 0?1:Number(e.length),t.snap=0t[1]===e)?e:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+e),null)}doValueUpdate_(e){super.doValueUpdate_(e),e=this.getOptions(!0);for(let t=0,s;s=e[t];t++)s[1]===this.value_&&(this.selectedOption=s)}applyColour(){const e=this.sourceBlock_.style;this.borderRect_&&(this.borderRect_.setAttribute("stroke",e.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",e.colourTertiary):this.borderRect_.setAttribute("fill","transparent")),this.sourceBlock_&&this.arrow&&(this.sourceBlock_.isShadow()?this.arrow.style.fill=e.colourSecondary:this.arrow.style.fill=e.colourPrimary)}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const e=this.selectedOption&&this.selectedOption[0];e&&typeof e=="object"?this.renderSelectedImage(e):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(e){const t=this.getSourceBlock();if(!t)throw new ft;this.imageElement.style.display="",this.imageElement.setAttributeNS(ss,"xlink:href",e.src),this.imageElement.setAttribute("height",String(e.height)),this.imageElement.setAttribute("width",String(e.width));const s=Number(e.height);e=Number(e.width);var i=!!this.borderRect_;const r=Math.max(i?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,s+bf);i=i?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let p;p=this.svgArrow?this.positionSVGArrow(e+i,r/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Ie(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=e+p+2*i,this.size_.height=r;let I=0;t.RTL?this.imageElement.setAttribute("x",`${i+p}`):(I=e+p,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${i}`)),this.imageElement.setAttribute("y",String(r/2-s/2)),this.positionTextElement_(I+i,e+p)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var e=this.getTextElement();U(e,"blocklyDropdownText"),e.setAttribute("text-anchor","start");var t=!!this.borderRect_;e=Math.max(t?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const s=Ie(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);t=t?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let i=0;this.svgArrow&&(i=this.positionSVGArrow(s+t,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=s+i+2*t,this.size_.height=e,this.positionTextElement_(t,s)}positionSVGArrow(e,t){if(!this.svgArrow)return 0;const s=this.getSourceBlock();if(!s)throw new ft;const i=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,r=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,p=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(s.RTL?i:e+r)+","+t+")"),p+r}getText_(){if(!this.selectedOption)return null;const e=this.selectedOption[0];return typeof e=="object"?e.alt:e}static fromJson(e){if(!e.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(e.options,void 0,e)}};Us.CHECKMARK_OVERHANG=25,Us.MAX_MENU_HEIGHT_VH=.45,Us.ARROW_CHAR="▾";var Of=5,bf=2*Of;Ds("field_dropdown",Us);var eg=class{constructor(e,t){this.bubble=e,this.workspace=t,this.startLoc=null}isMovable(){return!0}startDrag(){o.getGroup$$module$build$src$core$events$utils()||o.setGroup$$module$build$src$core$events$utils(!0),this.startLoc=this.bubble.getRelativeToSurfaceXY(),this.workspace.setResizesEnabled(!1);let e;(e=this.workspace.getLayerManager())==null||e.moveToDragLayer(this.bubble),this.bubble.setDragging&&this.bubble.setDragging(!0)}drag(e){this.bubble.moveDuringDrag(e)}endDrag(){this.workspace.setResizesEnabled(!0),o.setGroup$$module$build$src$core$events$utils(!1);let e;(e=this.workspace.getLayerManager())==null||e.moveOffDragLayer(this.bubble,Ih),this.bubble.setDragging(!1)}revertDrag(){this.startLoc&&this.bubble.moveDuringDrag(this.startLoc)}},is,Ye=class{constructor(e,t,s){this.workspace=e,this.anchor=t,this.ownerRect=s,this.size=new Be(0,0),this.colour="#ffffff",this.disposed=!1,this.relativeLeft=this.relativeTop=0,this.dragStrategy=new eg(this,this.workspace),this.id=W(),this.svgRoot=A(x.G,{class:"blocklyBubble"},e.getBubbleCanvas()),e=A(x.G,{filter:`url(#${this.workspace.getRenderer().getConstants().embossFilterId})`},this.svgRoot),this.tail=A(x.PATH,{class:"blocklyBubbleTail"},e),this.background=A(x.RECT,{class:"blocklyDraggable",x:0,y:0,rx:is.BORDER_WIDTH,ry:is.BORDER_WIDTH},e),this.contentContainer=A(x.G,{},this.svgRoot),pe(this.background,"pointerdown",this,this.onMouseDown)}dispose(){$(this.svgRoot),this.disposed=!0}setAnchorLocation(e,t=!1){this.anchor=e,t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}setPositionRelativeToAnchor(e,t){this.relativeLeft=e,this.relativeTop=t,this.positionRelativeToAnchor(),this.renderTail()}getSize(){return this.size}setSize(e,t=!1){e.width=Math.max(e.width,is.MIN_SIZE),e.height=Math.max(e.height,is.MIN_SIZE),this.size=e,this.background.setAttribute("width",`${e.width}`),this.background.setAttribute("height",`${e.height}`),t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}getColour(){return this.colour}setColour(e){this.colour=e,this.tail.setAttribute("fill",e),this.background.setAttribute("fill",e)}onMouseDown(e){let t;(t=this.workspace.getGesture(e))==null||t.handleBubbleStart(e,this),o.setSelected$$module$build$src$core$common(this)}positionRelativeToAnchor(){let e=this.anchor.x;e=this.workspace.RTL?e-(this.relativeLeft+this.size.width):e+this.relativeLeft,this.moveTo(e,this.relativeTop+this.anchor.y)}moveTo(e,t){this.svgRoot.setAttribute("transform",`translate(${e}, ${t})`)}positionByRect(e=new qe(0,0,0,0)){var t=this.workspace.getMetricsManager().getViewMetrics(!0),s=this.getOptimalRelativeLeft(t),i=this.getOptimalRelativeTop(t);const r={x:s,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},p={x:-this.size.width-30,y:i};i={x:e.getWidth(),y:i};var I={x:s,y:e.getHeight()};s=e.getWidth()e.width)return t;if(e=this.getWorkspaceViewRect(e),this.workspace.RTL){var s=this.anchor.x-t;s-this.size.widthe.right&&(t=-(e.right-this.anchor.x))}else{s=t+this.anchor.x;const i=s+this.size.width;se.right&&(t=e.right-this.anchor.x-this.size.width)}return t}getOptimalRelativeTop(e){let t=-this.size.height/4;if(this.size.height>e.height)return t;const s=this.anchor.y+t,i=s+this.size.height;return e=this.getWorkspaceViewRect(e),se.bottom&&(t=e.bottom-this.anchor.y-this.size.height),t}getWorkspaceViewRect(e){const t=e.top;let s=e.top+e.height,i=e.left;return e=e.left+e.width,s-=this.getScrollbarThickness(),this.workspace.RTL?i-=this.getScrollbarThickness():e-=this.getScrollbarThickness(),new qe(t,s,i,e)}getScrollbarThickness(){return Et.scrollbarThickness/this.workspace.scale}renderTail(){const e=[];var t=this.size.width/2,s=this.size.height/2,i=-this.relativeLeft,r=-this.relativeTop;if(t===i&&s===r)e.push("M "+t+","+s);else{r-=s,i-=t,this.workspace.RTL&&(i*=-1);var p=Math.sqrt(r*r+i*i),I=Math.acos(i/p);0>r&&(I=2*Math.PI-I);var S=I+Math.PI/2;S>2*Math.PI&&(S-=2*Math.PI);var H=Math.sin(S);const st=Math.cos(S);let Ze=(this.size.width+this.size.height)/is.TAIL_THICKNESS;Ze=Math.min(Ze,this.size.width,this.size.height)/4,S=1-is.ANCHOR_RADIUS/p,i=t+S*i,r=s+S*r,S=t+Ze*st;const es=s+Ze*H;t-=Ze*st,s-=Ze*H,H=_l(this.workspace.RTL?-is.TAIL_ANGLE:is.TAIL_ANGLE),H=I+H,H>2*Math.PI&&(H-=2*Math.PI),I=Math.sin(H)*p/is.TAIL_BEND,p=Math.cos(H)*p/is.TAIL_BEND,e.push("M"+S+","+es),e.push("C"+(S+p)+","+(es+I)+" "+i+","+r+" "+i+","+r),e.push("C"+i+","+r+" "+(t+p)+","+(s+I)+" "+t+","+s)}e.push("z");let _e;(_e=this.tail)==null||_e.setAttribute("d",e.join(" "))}bringToFront(){let e;const t=(e=this.svgRoot)==null?void 0:e.parentNode;return this.svgRoot&&(t==null?void 0:t.lastChild)!==this.svgRoot?(t==null||t.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new se(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(e){this.moveTo(e.x,e.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-e.x-this.size.width:e.x-this.anchor.x,this.relativeTop=e.y-this.anchor.y,this.renderTail()}setDragging(e){}setDeleteStyle(e){}isDeletable(){return!1}showContextMenu(e){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(e){this.dragStrategy.drag(e)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){}unselect(){}};is=Ye,Ye.BORDER_WIDTH=6,Ye.DOUBLE_BORDER=2*is.BORDER_WIDTH,Ye.MIN_SIZE=is.DOUBLE_BORDER,Ye.TAIL_THICKNESS=1,Ye.TAIL_ANGLE=20,Ye.TAIL_BEND=4,Ye.ANCHOR_RADIUS=8;var po=class extends Ye{constructor(e,t,s,i){super(t,s,i),this.workspace=t,this.anchor=s,this.ownerRect=i,this.autoLayout=!0,t=new Ts(e),this.validateWorkspaceOptions(t),this.svgDialog=A(x.SVG,{x:Ye.BORDER_WIDTH,y:Ye.BORDER_WIDTH},this.contentContainer),e.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new Ts(e)),this.miniWorkspace.internalIsMutator=!0,e=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(e),t.languageTree&&(e.insertBefore(this.miniWorkspace.addFlyout(x.G),this.miniWorkspace.getCanvas()),e=this.miniWorkspace.getFlyout(),e==null||e.init(this.miniWorkspace),e==null||e.show(t.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let r,p;(r=this.miniWorkspace.getFlyout())==null||(p=r.getWorkspace())==null||p.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(e){this.miniWorkspace.addChangeListener(e)}validateWorkspaceOptions(e){if(e.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(e.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(e.zoomOptions.controls||e.zoomOptions.wheel||e.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(e.moveOptions.scrollbars||e.moveOptions.wheel||e.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(e.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const e of this.miniWorkspace.getTopBlocks(!1)){const t=e.getRelativeToSurfaceXY();if(20>t.y&&e.moveBy(0,20-t.y),e.RTL){let s=-20;const i=this.miniWorkspace.getFlyout();i&&(s-=i.getWidth()),t.x>s&&e.moveBy(s-t.x,0)}else 20>t.x&&e.moveBy(20-t.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var e=this.getSize(),t=this.calculateWorkspaceSize();Math.abs(e.width-t.width)({kind:"block",type:s}))}),t}getAnchorLocation(){const e=Tc/2;return se.sum(this.workspaceLocation,new se(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new qe(e.y,e.y+e.height,e.x,e.x+e.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var e of this.rootBlock.getDescendants(!1))e.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let t,s,i,r;e=(r=(t=this.miniWorkspaceBubble)==null||(s=t.getWorkspace())==null||(i=s.getFlyout())==null?void 0:i.getWidth())!=null?r:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(e+gc):gc,gc)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return e=>{o.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(e)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(e){return e.isUiEvent||e.type===o.CREATE$$module$build$src$core$events$utils||e.type===o.CHANGE$$module$build$src$core$events$utils&&e.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var e=o.getGroup$$module$build$src$core$events$utils();e||o.setGroup$$module$build$src$core$events$utils(!0);var t=pi.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var s=pi.getExtraBlockState_(this.sourceBlock);t!==s&&X(new($e(o.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"mutation",null,t,s)),o.setGroup$$module$build$src$core$events$utils(e)}}getWorkspace(){let e;return(e=this.miniWorkspaceBubble)==null?void 0:e.getWorkspace()}},o.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Nt.MUTATOR,o.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,o.MutatorIcon$$module$build$src$core$icons$mutator_icon;var gr=Object.create(null),Rf={allExtensions:gr};o.register$$module$build$src$core$extensions("parent_tooltip_when_inline",pp);var Ss={TEST_ONLY:Rf};Ss.apply=Al,Ss.buildTooltipForDropdown=o.buildTooltipForDropdown$$module$build$src$core$extensions,Ss.buildTooltipWithFieldText=o.buildTooltipWithFieldText$$module$build$src$core$extensions,Ss.isRegistered=ca,Ss.register=o.register$$module$build$src$core$extensions,Ss.registerMixin=o.registerMixin$$module$build$src$core$extensions,Ss.registerMutator=o.registerMutator$$module$build$src$core$extensions,Ss.runAfterPageLoad=$p,Ss.unregister=cp;var tg=new Set,sg={};sg.warn=vo;var ke;(function(e){e[e.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",e[e.MAC_ENTER=3]="MAC_ENTER",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.NUM_CENTER=12]="NUM_CENTER",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ALT=18]="ALT",e[e.PAUSE=19]="PAUSE",e[e.CAPS_LOCK=20]="CAPS_LOCK",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.PRINT_SCREEN=44]="PRINT_SCREEN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.FF_SEMICOLON=59]="FF_SEMICOLON",e[e.FF_EQUALS=61]="FF_EQUALS",e[e.FF_DASH=173]="FF_DASH",e[e.FF_HASH=163]="FF_HASH",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.AT_SIGN=64]="AT_SIGN",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.META=91]="META",e[e.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",e[e.CONTEXT_MENU=93]="CONTEXT_MENU",e[e.NUM_ZERO=96]="NUM_ZERO",e[e.NUM_ONE=97]="NUM_ONE",e[e.NUM_TWO=98]="NUM_TWO",e[e.NUM_THREE=99]="NUM_THREE",e[e.NUM_FOUR=100]="NUM_FOUR",e[e.NUM_FIVE=101]="NUM_FIVE",e[e.NUM_SIX=102]="NUM_SIX",e[e.NUM_SEVEN=103]="NUM_SEVEN",e[e.NUM_EIGHT=104]="NUM_EIGHT",e[e.NUM_NINE=105]="NUM_NINE",e[e.NUM_MULTIPLY=106]="NUM_MULTIPLY",e[e.NUM_PLUS=107]="NUM_PLUS",e[e.NUM_MINUS=109]="NUM_MINUS",e[e.NUM_PERIOD=110]="NUM_PERIOD",e[e.NUM_DIVISION=111]="NUM_DIVISION",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUMLOCK=144]="NUMLOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",e[e.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",e[e.SEMICOLON=186]="SEMICOLON",e[e.DASH=189]="DASH",e[e.EQUALS=187]="EQUALS",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.SLASH=191]="SLASH",e[e.APOSTROPHE=192]="APOSTROPHE",e[e.TILDE=192]="TILDE",e[e.SINGLE_QUOTE=222]="SINGLE_QUOTE",e[e.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",e[e.BACKSLASH=220]="BACKSLASH",e[e.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",e[e.WIN_KEY=224]="WIN_KEY",e[e.MAC_FF_META=224]="MAC_FF_META",e[e.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",e[e.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",e[e.WIN_IME=229]="WIN_IME",e[e.VK_NONAME=252]="VK_NONAME",e[e.PHANTOM=255]="PHANTOM"})(ke||(ke={}));var To={};To.arc=mt,To.curve=Qt,To.line=Xi,To.lineOnAxis=ge,To.lineTo=ws,To.moveBy=nt,To.moveTo=At,To.point=Oe;var ht={};ht.Coordinate=se,ht.KeyCodes=ke,ht.Rect=qe,ht.Size=Be,ht.Svg=x,ht.aria=an,ht.array=pT,ht.browserEvents=uo,ht.colour=ps,ht.deprecation=sg,ht.dom=wt,ht.extensions=Ss,ht.idGenerator=eh,ht.math=oc,ht.object=qT,ht.parsing=gn,ht.string=hr,ht.style=wo,ht.svgMath=ai,ht.svgPaths=To,ht.toolbox=Po,ht.userAgent=af,ht.xml=or;var Vh={};Vh.register=ha,Vh.unregister=Tp;var Wh=class extends Ye{constructor(e,t,s,i){super(t,s,i),this.text=e,this.workspace=t,this.anchor=s,this.ownerRect=i,this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(e){this.text=e,$(this.paragraph),this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}stringToSvg(e,t){return t=this.createParagraph(t),e=this.createSpans(t,e),this.workspace.RTL&&this.rightAlignSpans(t.getBBox().width,e),t}createParagraph(e){return A(x.TEXT,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:Ye.BORDER_WIDTH},e)}createSpans(e,t){return t.split(` -`).map(s=>{const i=A(x.TSPAN,{dy:"1em",x:Ye.BORDER_WIDTH},e);return s=document.createTextNode(s),i.appendChild(s),i})}rightAlignSpans(e,t){for(const s of t)s.setAttribute("text-anchor","end"),s.setAttribute("x",`${e+Ye.BORDER_WIDTH}`)}updateBubbleSize(){const e=this.paragraph.getBBox();this.setSize(new Be(e.width+2*Ye.BORDER_WIDTH,e.height+2*Ye.BORDER_WIDTH),!0)}},og=class extends Ye{constructor(e,t,s){super(e,t,s),this.workspace=e,this.anchor=t,this.ownerRect=s,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new Be(160+Ye.DOUBLE_BORDER,80+Ye.DOUBLE_BORDER),this.MIN_SIZE=new Be(45+Ye.DOUBLE_BORDER,20+Ye.DOUBLE_BORDER),U(this.svgRoot,"blocklyTextInputBubble"),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot,e),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(e){this.text=e,this.textArea.value=e,this.onTextChange()}addTextChangeListener(e){this.textChangeListeners.push(e)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}createEditor(e){e=A(x.FOREIGNOBJECT,{x:Ye.BORDER_WIDTH,y:Ye.BORDER_WIDTH},e);const t=document.createElementNS(Fs,"body");t.setAttribute("xmlns",Fs),t.className="blocklyMinimalBody";const s=document.createElementNS(Fs,"textarea");return s.className="blocklyTextarea blocklyText",s.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),t.appendChild(s),e.appendChild(t),this.bindTextAreaEvents(s),setTimeout(()=>{s.focus()},0),{inputRoot:e,textArea:s}}bindTextAreaEvents(e){pe(e,"wheel",this,t=>{t.stopPropagation()}),pe(e,"focus",this,this.onStartEdit,!0),pe(e,"change",this,this.onTextChange)}createResizeHandle(e,t){return e=A(x.IMAGE,{class:"blocklyResizeHandle",href:`${t.options.pathToMedia}resize-handle.svg`},e),pe(e,"pointerdown",this,this.onResizePointerDown),e}setSize(e,t=!1){e.width=Math.max(e.width,this.MIN_SIZE.width),e.height=Math.max(e.height,this.MIN_SIZE.height);const s=e.width-Ye.DOUBLE_BORDER,i=e.height-Ye.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${s}`),this.inputRoot.setAttribute("height",`${i}`),this.resizeGroup.setAttribute("y",`${i}`),this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-Ye.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${s}`),super.setSize(e,t),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(e){this.bringToFront(),v(e)||(this.workspace.startDrag(e,new se(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=pe(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=pe(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation()}onResizePointerUp(e){je(),this.resizePointerUpListener&&(Ae(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(Ae(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=this.workspace.moveDrag(e),this.setSize(new Be(this.workspace.RTL?-e.x:e.x,e.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const e of this.textChangeListeners)e()}onSizeChange(){for(const e of this.sizeChangeListeners)e()}};q(` -.blocklyTextInputBubble .blocklyTextarea { - background-color: var(--commentFillColour); - border: 0; - box-sizing: border-box; - display: block; - outline: 0; - padding: 5px; - resize: none; - width: 100%; - height: 100%; -} -`);var Xh=17,ig=160,rg=80,go=class extends _c{constructor(e){super(e),this.sourceBlock=e,this.textBubble=this.textInputBubble=null,this.text="",this.bubbleSize=new Be(ig,rg),this.bubbleVisiblity=!1}getType(){return go.TYPE}initView(e){this.svgRoot||(super.initView(e),A(x.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),A(x.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),A(x.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),U(this.svgRoot,"blockly-icon-comment"))}dispose(){super.dispose();let e;(e=this.textInputBubble)==null||e.dispose();let t;(t=this.textBubble)==null||t.dispose()}getWeight(){return go.WEIGHT}getSize(){return new Be(Xh,Xh)}applyColour(){super.applyColour();const e=this.sourceBlock.style.colourPrimary;let t;(t=this.textInputBubble)==null||t.setColour(e);let s;(s=this.textBubble)==null||s.setColour(e)}updateEditable(){const e=this,t=()=>super.updateEditable;return J.asyncExecutePromiseGeneratorFunction(function*(){t().call(e),e.bubbleIsVisible()&&(yield e.setBubbleVisible(!1),yield e.setBubbleVisible(!0))})}onLocationChange(e){super.onLocationChange(e),e=this.getAnchorLocation();let t;(t=this.textInputBubble)==null||t.setAnchorLocation(e);let s;(s=this.textBubble)==null||s.setAnchorLocation(e)}setText(e){const t=this.text;X(new($e(o.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"comment",null,t,e)),this.text=e;let s;(s=this.textInputBubble)==null||s.setText(this.text);let i;(i=this.textBubble)==null||i.setText(this.text)}getText(){return this.text}setBubbleSize(e){this.bubbleSize=e;let t;(t=this.textInputBubble)==null||t.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(e){let t;this.text=(t=e.text)!=null?t:"";let s,i;this.bubbleSize=new Be((s=e.width)!=null?s:ig,(i=e.height)!=null?i:rg);let r;this.bubbleVisiblity=(r=e.pinned)!=null?r:!1,this.setBubbleVisible(this.bubbleVisiblity)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var e=this.textInputBubble.getText();this.text!==e&&(X(new($e(o.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"comment",null,this.text,e)),this.text=e)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(e){const t=this;return J.asyncExecutePromiseGeneratorFunction(function*(){t.bubbleVisiblity!==e&&(t.bubbleVisiblity=e,yield vs(),!t.sourceBlock.rendered||t.sourceBlock.isInFlyout||t.sourceBlock.isInsertionMarker()||(e?(t.sourceBlock.isEditable()?t.showEditableBubble():t.showNonEditableBubble(),t.applyColour()):t.hideBubble(),X(new($e(xs))(t.sourceBlock,e,"comment"))))})}showEditableBubble(){this.textInputBubble=new og(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0),this.textInputBubble.addTextChangeListener(()=>this.onTextChange()),this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.textBubble=new Wh(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect())}hideBubble(){let e;(e=this.textInputBubble)==null||e.dispose(),this.textInputBubble=null;let t;(t=this.textBubble)==null||t.dispose(),this.textBubble=null}getAnchorLocation(){const e=Xh/2;return se.sum(this.workspaceLocation,new se(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new qe(e.y,e.y+e.height,e.x,e.x+e.width)}};go.TYPE=Nt.COMMENT,go.WEIGHT=3,ha(go.TYPE,go);var Yh=17,mo=class extends _c{constructor(e){super(e),this.sourceBlock=e,this.textMap=new Map,this.textBubble=null}getType(){return mo.TYPE}initView(e){this.svgRoot||(super.initView(e),A(x.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},this.svgRoot),A(x.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),A(x.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),U(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let e;(e=this.textBubble)==null||e.dispose()}getWeight(){return mo.WEIGHT}getSize(){return new Be(Yh,Yh)}applyColour(){super.applyColour();let e;(e=this.textBubble)==null||e.setColour(this.sourceBlock.style.colourPrimary)}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(e){super.onLocationChange(e);let t;(t=this.textBubble)==null||t.setAnchorLocation(this.getAnchorLocation())}addMessage(e,t){if(this.textMap.get(t)===e)return this;e?this.textMap.set(t,e):this.textMap.delete(t);let s;return(s=this.textBubble)==null||s.setText(this.getText()),this}getText(){return[...this.textMap.values()].join(` -`)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(e){const t=this;return J.asyncExecutePromiseGeneratorFunction(function*(){if(t.bubbleIsVisible()!==e){if(yield vs(),e)t.textBubble=new Wh(t.getText(),t.sourceBlock.workspace,t.getAnchorLocation(),t.getBubbleOwnerRect()),t.applyColour();else{let s;(s=t.textBubble)==null||s.dispose(),t.textBubble=null}X(new($e(xs))(t.sourceBlock,e,"warning"))}})}getAnchorLocation(){const e=Yh/2;return se.sum(this.workspaceLocation,new se(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new qe(e.y,e.y+e.height,e.x,e.x+e.width)}};mo.TYPE=Nt.WARNING,mo.WEIGHT=2;var ng=class extends Error{constructor(e){super(`Tried to append an icon of type ${e.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=e}},lg={};lg.DuplicateIconType=ng;var Fo={};Fo.CommentIcon=go,Fo.Icon=_c,Fo.IconType=Nt,Fo.MutatorIcon=o.MutatorIcon$$module$build$src$core$icons$mutator_icon,Fo.WarningIcon=mo,Fo.exceptions=lg,Fo.registry=Vh;var mc,zt;mc="PROCEDURE",o.DEFAULT_ARG$$module$build$src$core$procedures="x",zt={CATEGORY_NAME:mc,DEFAULT_ARG:o.DEFAULT_ARG$$module$build$src$core$procedures},zt.ObservableProcedureMap=QT,zt.allProcedures=yl,zt.findLegalName=o.findLegalName$$module$build$src$core$procedures,zt.flyoutCategory=kl,zt.getCallers=Ta,zt.getDefinition=o.getDefinition$$module$build$src$core$procedures,zt.isNameUsed=$a,zt.isProcedureBlock=Mo,zt.mutateCallers=o.mutateCallers$$module$build$src$core$procedures,zt.mutatorOpenListener=pa,zt.rename=o.rename$$module$build$src$core$procedures;var Sf=class{constructor(){this.NONE=0,this.FIELD=1,this.HAT=2,this.ICON=4,this.SPACER=8,this.BETWEEN_ROW_SPACER=16,this.IN_ROW_SPACER=32,this.EXTERNAL_VALUE_INPUT=64,this.INPUT=128,this.INLINE_INPUT=256,this.STATEMENT_INPUT=512,this.CONNECTION=1024,this.PREVIOUS_CONNECTION=2048,this.NEXT_CONNECTION=4096,this.OUTPUT_CONNECTION=8192,this.CORNER=16384,this.LEFT_SQUARE_CORNER=32768,this.LEFT_ROUND_CORNER=65536,this.RIGHT_SQUARE_CORNER=131072,this.RIGHT_ROUND_CORNER=262144,this.JAGGED_EDGE=524288,this.ROW=1048576,this.TOP_ROW=2097152,this.BOTTOM_ROW=4194304,this.INPUT_ROW=8388608,this.LEFT_CORNER=this.LEFT_SQUARE_CORNER|this.LEFT_ROUND_CORNER,this.RIGHT_CORNER=this.RIGHT_SQUARE_CORNER|this.RIGHT_ROUND_CORNER,this.nextTypeValue_=16777216}getType(e){return Object.prototype.hasOwnProperty.call(this,e)||(this[e]=this.nextTypeValue_,this.nextTypeValue_<<=1),this[e]}isField(e){return e.type&this.FIELD}isHat(e){return e.type&this.HAT}isIcon(e){return e.type&this.ICON}isSpacer(e){return e.type&this.SPACER}isInRowSpacer(e){return e.type&this.IN_ROW_SPACER}isInput(e){return e.type&this.INPUT}isExternalInput(e){return e.type&this.EXTERNAL_VALUE_INPUT}isInlineInput(e){return e.type&this.INLINE_INPUT}isStatementInput(e){return e.type&this.STATEMENT_INPUT}isPreviousConnection(e){return e.type&this.PREVIOUS_CONNECTION}isNextConnection(e){return e.type&this.NEXT_CONNECTION}isPreviousOrNextConnection(e){return e.type&(this.PREVIOUS_CONNECTION|this.NEXT_CONNECTION)}isLeftRoundedCorner(e){return e.type&this.LEFT_ROUND_CORNER}isRightRoundedCorner(e){return e.type&this.RIGHT_ROUND_CORNER}isLeftSquareCorner(e){return e.type&this.LEFT_SQUARE_CORNER}isRightSquareCorner(e){return e.type&this.RIGHT_SQUARE_CORNER}isCorner(e){return e.type&this.CORNER}isJaggedEdge(e){return e.type&this.JAGGED_EDGE}isRow(e){return e.type&this.ROW}isBetweenRowSpacer(e){return e.type&this.BETWEEN_ROW_SPACER}isTopRow(e){return e.type&this.TOP_ROW}isBottomRow(e){return e.type&this.BOTTOM_ROW}isTopOrBottomRow(e){return e.type&(this.TOP_ROW|this.BOTTOM_ROW)}isInputRow(e){return e.type&this.INPUT_ROW}},D=new Sf,Hs=class{constructor(e){this.centerline=this.xPos=this.height=this.width=0,this.constants_=e,this.type=D.NONE,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}},fn=class{constructor(e){this.elements=[],this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0,this.hasStatement=this.hasExternalInput=!1,this.statementEdge=0,this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=!1,this.align=null,this.constants_=e,this.type=D.ROW,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}getLastInput(){for(let e=this.elements.length-1;0<=e;e--){const t=this.elements[e];if(D.isInput(t))return t}return null}measure(){throw Error("Unexpected attempt to measure a base Row.")}startsWithElemSpacer(){return!0}endsWithElemSpacer(){return!0}getFirstSpacer(){for(let e=0;erect,`,`${e} .blocklyEditableText>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text {`,"fill: #000;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${e} .blocklyEditableText:not(.editing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${e} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${e} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${e} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${e} .blocklyReplaceable .blocklyPathLight,`,`${e} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Ic=class{constructor(e,t){this.inlinePath_=this.outlinePath_="",this.block_=e,this.info_=t,this.topLeft_=e.getRelativeToSurfaceXY(),this.constants_=t.getRenderer().getConstants()}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),this.block_.pathObject.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren}drawOutline_(){this.drawTop_();for(let e=1;ee||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return(t||t===""&&s)&&(typeof t=="string"&&(t=o.fromJson$$module$build$src$core$field_registry({type:"field_label",text:t})),t.setSourceBlock(this.sourceBlock),this.sourceBlock.initialized&&this.initField(t),t.name=s,t.setVisible(this.isVisible()),t.prefixField&&(e=this.insertFieldAt(e,t.prefixField)),this.fieldRow.splice(e,0,t),e++,t.suffixField&&(e=this.insertFieldAt(e,t.suffixField)),this.sourceBlock.rendered&&this.sourceBlock.queueRender()),e}removeField(e,t){for(let s=0,i;i=this.fieldRow[s];s++)if(i.name===e)return i.dispose(),this.fieldRow.splice(s,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(t)return!1;throw Error('Field "'+e+'" not found.')}isVisible(){return this.visible}setVisible(e){let t=[];if(this.visible===e)return t;this.visible=e;for(let i=0,r;r=this.fieldRow[i];i++)r.setVisible(e);if(this.connection){var s=this.connection;e?t=s.startTrackingAll():s.stopTrackingAll(),(s=s.targetBlock())&&(s.getSvgRoot().style.display=e?"block":"none")}return t}markDirty(){for(let e=0,t;t=this.fieldRow[e];e++)t.markDirty()}setCheck(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(e),this}setAlign(e){return this.align=e,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(e),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(const e of this.fieldRow)e.init()}initModel(){for(const e of this.fieldRow)e.initModel()}initField(e){this.sourceBlock.rendered?e.init():e.initModel()}dispose(){for(let e=0,t;t=this.fieldRow[e];e++)t.dispose();this.connection&&this.connection.dispose()}makeConnection(e){return this.sourceBlock.makeConnection_(e)}},Gs=class extends Er{constructor(e,t){super(e,t),this.name=e,this.type=o.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},fo=class extends Er{constructor(e,t){super(e,t),this.name=e,this.type=o.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},ns=class extends Er{constructor(e,t){if(!e)throw Error("Statement inputs must have a non-empty name");super(e,t),this.name=e,this.type=o.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT,this.connection=this.makeConnection(Te.NEXT_STATEMENT)}},$g;o.ValueInput$$module$build$src$core$inputs$value_input=class extends Er{constructor(e,t){if(!e)throw Error("Value inputs must have a non-empty name");super(e,t),this.name=e,this.type=o.inputTypes$$module$build$src$core$inputs$input_types.VALUE,this.connection=this.makeConnection(Te.INPUT_VALUE)}},$g={},$g.ValueInput=o.ValueInput$$module$build$src$core$inputs$value_input;var Rn=class{constructor(e,t){this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.startY=this.startX=0,this.renderer_=e,this.block_=t,this.constants_=this.renderer_.getConstants(),this.outputConnection=t.outputConnection?new hg(this.constants_,t.outputConnection):null,this.isInline=t.getInputsInline()&&!t.isCollapsed(),this.isCollapsed=t.isCollapsed(),this.isInsertionMarker=t.isInsertionMarker(),this.RTL=t.RTL,this.topRow=new Qh(this.constants_),this.bottomRow=new zh(this.constants_)}getRenderer(){return this.renderer_}measure(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()}createRows_(){this.populateTopRow_(),this.rows.push(this.topRow);let e=new Jh(this.constants_);this.inputRows.push(e);var t=this.block_.getIcons();for(let s=0,i;i=t[s];s++){const r=new cg(this.constants_,i);this.isCollapsed&&!i.isShownWhenCollapsed()||e.elements.push(r)}t=void 0;for(let s=0,i;i=this.block_.inputList[s];s++)if(i.isVisible()){this.shouldStartNewRow_(i,t)&&(this.rows.push(e),e=new Jh(this.constants_),this.inputRows.push(e));for(let r=0,p;p=i.fieldRow[r];r++)e.elements.push(new mr(this.constants_,p,i));this.addInput_(i,e),t=i}this.isCollapsed&&(e.hasJaggedEdge=!0,e.elements.push(new ug(this.constants_))),(e.elements.length||e.hasDummyInput)&&this.rows.push(e),this.populateBottomRow_(),this.rows.push(this.bottomRow)}populateTopRow_(){var e=!!this.block_.previousConnection;const t=(this.block_.hat?this.block_.hat==="cap":this.constants_.ADD_START_HATS)&&!this.outputConnection&&!e;let s=this.topRow.hasLeftSquareCorner(this.block_)?bn:On;this.topRow.elements.push(new s(this.constants_)),t?(e=new jh(this.constants_),this.topRow.elements.push(e),this.topRow.capline=e.ascenderHeight):e&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new dg(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0]instanceof ns&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,s=this.topRow.hasRightSquareCorner(this.block_)?bn:On,this.topRow.elements.push(new s(this.constants_,"right"))}populateBottomRow_(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ns?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new bn(this.constants_)):this.bottomRow.elements.push(new On(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new ag(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new bn(this.constants_,"right")):this.bottomRow.elements.push(new On(this.constants_,"right"))}addInput_(e,t){this.isInline&&e instanceof o.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Kh(this.constants_,e)),t.hasInlineInput=!0):e instanceof ns?(t.elements.push(new In(this.constants_,e)),t.hasStatement=!0):e instanceof o.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ec(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Gs||e instanceof fo)&&(t.minHeight=Math.max(t.minHeight,e.getSourceBlock()&&e.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),t.align===null&&(t.align=e.align)}shouldStartNewRow_(e,t){return t?t instanceof fo||e instanceof ns||t instanceof ns?!0:e instanceof o.ValueInput$$module$build$src$core$inputs$value_input||e instanceof Gs||t instanceof o.ValueInput$$module$build$src$core$inputs$value_input?!this.isInline:!1:!1}addElemSpacing_(){for(let e=0,t;t=this.rows[e];e++){const s=t.elements;if(t.elements=[],t.startsWithElemSpacer()&&t.elements.push(new rs(this.constants_,this.getInRowSpacing_(null,s[0]))),s.length){for(let i=0;ie.disposeInternal()),this.inputList.forEach(e=>e.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(e=>e.dispose()),this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const e of this.inputList)e.initModel();this.initialized=!0}}unplug(e){this.outputConnection&&this.unplugFromRow_(e),this.previousConnection&&this.unplugFromStack_(e)}unplugFromRow_(e){let t=null,s;(s=this.outputConnection)!=null&&s.isConnected()&&(t=this.outputConnection.targetConnection,this.outputConnection.disconnect()),t&&e&&(e=this.getOnlyValueConnection_())&&e.isConnected()&&!e.targetBlock().isShadow()&&(e=e.targetConnection,e==null||e.disconnect(),this.workspace.connectionChecker.canConnect(e,t,!1)?t.connect(e):e==null||e.onFailedConnect(t))}getOnlyValueConnection_(){let e=null;for(let t=0;t(i=i+(s==="("||r===")"?"":" ")+r,s=r[r.length-1],i),""),t=t.trim()||"???",e&&t.length>e&&(t=t.substring(0,e-3)+"..."),t}toTokens(e="?"){const t=[];for(const i of this.inputList)if(i.name!=ln){for(const r of i.fieldRow)t.push(r.getText());if(i.connection){const r=i.connection.targetBlock();if(r){var s=i.connection;let p=s.getCheck();!p&&s.targetConnection&&(p=s.targetConnection.getCheck()),(s=!!p&&(p.includes("Boolean")||p.includes("Number")))&&t.push("("),t.push(...r.toTokens(e)),s&&t.push(")")}else t.push(e)}}return t}appendValueInput(e){return this.appendInput(new o.ValueInput$$module$build$src$core$inputs$value_input(e,this))}appendStatementInput(e){return this.statementInputCount++,this.appendInput(new ns(e,this))}appendDummyInput(e=""){return this.appendInput(new Gs(e,this))}appendEndRowInput(e=""){return this.appendInput(new fo(e,this))}appendInput(e){return this.inputList.push(e),e}appendInputFromRegistry(e,t){return(e=k(ee.INPUT,e,!1))?this.appendInput(new e(t,this)):null}jsonInit(e){var t=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(t+"Must not have both an output and a previousStatement.");for(var s=0;e["args"+s];){if(e["message"+s]===void 0)throw Error(t+`args${s} must have a corresponding message (message${s}).`);s++}if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(t+"Must not have both a colour and a style.");for(e.style?this.jsonInitStyle_(e,t):this.jsonInitColour_(e,t),s=0;e["message"+s]!==void 0;)this.interpolate_(e["message"+s],e["args"+s]||[],e["implicitAlign"+s]||e["lastDummyAlign"+s],t),s++;if(e.inputsInline!==void 0&&(o.disable$$module$build$src$core$events$utils(),this.setInputsInline(e.inputsInline),o.enable$$module$build$src$core$events$utils()),e.output!==void 0&&this.setOutput(!0,e.output),e.outputShape!==void 0&&this.setOutputShape(e.outputShape),e.previousStatement!==void 0&&this.setPreviousStatement(!0,e.previousStatement),e.nextStatement!==void 0&&this.setNextStatement(!0,e.nextStatement),e.tooltip!==void 0&&(s=gt(e.tooltip),this.setTooltip(s)),e.enableContextMenu!==void 0&&(this.contextMenu=!!e.enableContextMenu),e.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),e.helpUrl!==void 0&&(s=gt(e.helpUrl),this.setHelpUrl(s)),typeof e.extensions=="string"&&(console.warn(t+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),e.mutator!==void 0&&Al(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(t=0;tp||p>t)throw Error('Block "'+this.type+'": Message index %'+p+" out of range.");if(s[p])throw Error('Block "'+this.type+'": Message index %'+p+" duplicated.");s[p]=!0,i++}}if(i!==t)throw Error('Block "'+this.type+'": Message does not reference all '+t+" arg(s).")}interpolateArguments_(e,t,s){const i=[];for(let p=0;p=this.inputList.length)throw RangeError("Input index "+e+" out of bounds.");if(t>this.inputList.length)throw RangeError("Reference input "+t+" out of bounds.");const s=this.inputList[e];this.inputList.splice(e,1),et.getWeight()-s.getWeight()),e}removeIcon(e){if(!this.hasIcon(e))return!1;let t;return(t=this.getIcon(e))==null||t.dispose(),this.icons=this.icons.filter(s=>!s.getType().equals(e)),!0}hasIcon(e){return this.icons.some(t=>t.getType().equals(e))}getIcon(e){return e instanceof Nt?this.icons.find(t=>t.getType().equals(e)):this.icons.find(t=>t.getType().toString()===e)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy_}moveBy(e,t,s){if(this.parentBlock_)throw Error("Block has parent");const i=new($e(o.MOVE$$module$build$src$core$events$utils))(this);s&&i.setReason(s),this.xy_.translate(e,t),i.recordNew(),X(i)}makeConnection_(e){return new Fe(this,e)}allInputsFilled(e){if(e===void 0&&(e=!0),!e&&this.isShadow())return!1;for(let s=0,i;i=this.inputList[s];s++)if(i.connection){var t=i.connection.targetBlock();if(!t||!t.allInputsFilled(e))return!1}return(t=this.getNextBlock())?t.allInputsFilled(e):!0}toDevString(){let e=this.type?'"'+this.type+'" block':"Block";return this.id&&(e+=' (id="'+this.id+'")'),e}};Oi.COLLAPSED_INPUT_NAME=ln,Oi.COLLAPSED_FIELD_NAME=ql;var gs=class{constructor(e,t,s,i){this.workspace=e,this.targetWorkspace=t,this.isFlyoutLabel=i,this.onMouseUpWrapper=null,this.height=this.width=0,this.cursorSvg=this.svgText=this.svgGroup=null,this.text=s.text,this.position=new se(0,0),this.callbackKey=s.callbackKey||s.callbackkey,this.cssClass=s["web-class"]||null,this.info=s}createDom(){var e=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(e+=" "+this.cssClass),this.svgGroup=A(x.G,{class:e},this.workspace.getCanvas());let t;this.isFlyoutLabel||(t=A(x.RECT,{class:"blocklyFlyoutButtonShadow",rx:gs.BORDER_RADIUS,ry:gs.BORDER_RADIUS,x:1,y:1},this.svgGroup)),e=A(x.RECT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:gs.BORDER_RADIUS,ry:gs.BORDER_RADIUS},this.svgGroup);const s=A(x.TEXT,{class:this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);var i=gt(this.text);this.workspace.RTL&&(i+="‏"),s.textContent=i,this.isFlyoutLabel&&(this.svgText=s,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));const r=Y(s,"fontSize"),p=Y(s,"fontWeight"),I=Y(s,"fontFamily");if(this.width=Ee(s,r,p,I),i=g(i,r,p,I),this.height=i.height,!this.isFlyoutLabel){this.width+=2*gs.TEXT_MARGIN_X,this.height+=2*gs.TEXT_MARGIN_Y;let S;(S=t)==null||S.setAttribute("width",String(this.width));let H;(H=t)==null||H.setAttribute("height",String(this.height))}return e.setAttribute("width",String(this.width)),e.setAttribute("height",String(this.height)),s.setAttribute("x",String(this.width/2)),s.setAttribute("y",String(this.height/2-i.height/2+i.baseline)),this.updateTransform(),this.onMouseUpWrapper=pe(this.svgGroup,"pointerup",this,this.onMouseUp),this.svgGroup}show(){this.updateTransform(),this.svgGroup.setAttribute("display","block")}updateTransform(){this.svgGroup.setAttribute("transform","translate("+this.position.x+","+this.position.y+")")}moveTo(e,t){this.position.x=e,this.position.y=t,this.updateTransform()}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){this.onMouseUpWrapper&&Ae(this.onMouseUpWrapper),this.svgGroup&&$(this.svgGroup),this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(e){e?this.svgGroup&&(this.svgGroup.appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(){throw Error("Attempted to set a marker on a button.")}onMouseUp(e){(e=this.targetWorkspace.getGesture(e))&&e.cancel(),this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(e=this.targetWorkspace.getButtonCallback(this.callbackKey))&&e(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}};gs.TEXT_MARGIN_X=5,gs.TEXT_MARGIN_Y=2,gs.BORDER_RADIUS=4,q(` -.blocklyFlyoutButton { - fill: #888; - cursor: default; -} - -.blocklyFlyoutButtonShadow { - fill: #666; -} - -.blocklyFlyoutButton:hover { - fill: #aaa; -} - -.blocklyFlyoutLabel { - cursor: default; -} - -.blocklyFlyoutLabelBackground { - opacity: 0; -} -`);var j=class{constructor(e,t,s){if(this.wsCoordinate=null,!t)throw Error("Cannot create a node without a location.");this.type=e,this.isConnectionLocation=j.isConnectionType(e),this.location=t,this.processParams(s||null)}processParams(e){e&&e.wsCoordinate&&(this.wsCoordinate=e.wsCoordinate)}getLocation(){return this.location}getType(){return this.type}getWsCoordinate(){return this.wsCoordinate}isConnection(){return this.isConnectionLocation}findNextForInput(){var e=this.location.getParentInput();const t=e.getSourceBlock();for(e=t.inputList.indexOf(e),e+=1;et instanceof Oi&&r.block===t||t instanceof gs&&r.button===t);return 0>i?null:(s=s?i+1:i-1,s===-1||s===e.length?null:e[s])}findTopASTNodeForBlock(e){const t=Kr(e);return t?j.createConnectionNode(t):j.createBlockNode(e)}getOutAstNodeForBlock(e){if(!e)return null;e=e.getTopStackBlock();const t=Kr(e);return t&&t.targetConnection&&t.targetConnection.getParentInput()?j.createInputNode(t.targetConnection.getParentInput()):j.createStackNode(e)}findFirstFieldOrInput(e){e=e.inputList;for(let t=0;t{Cl(s.getSourceBlock()),setTimeout(()=>{i.bringToFront()},0)})}}update(e,t){const s=this.getCandidate(e);((this.wouldDeleteBlock=this.shouldDelete(!!s,t))||this.shouldUpdatePreviews(s,e))&&(o.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(s),this.maybeShowPreview(s),o.enable$$module$build$src$core$events$utils())}createMarkerBlock(e){o.disable$$module$build$src$core$events$utils();let t;try{const s=ts(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!s)throw Error(`Failed to serialize source block. ${e.toDevString()}`);t=to(s,this.workspace);for(const i of t.getDescendants(!1))i.setInsertionMarker(!0);t.initSvg(),t.getSvgRoot().setAttribute("visibility","hidden")}finally{o.enable$$module$build$src$core$events$utils()}return t}initAvailableConnections(){const e=this.topBlock.getConnections_(!1),t=this.topBlock.lastConnectionInStack(!0);return t&&t!==this.topBlock.nextConnection&&(e.push(t),this.lastOnStack=t),e}shouldUpdatePreviews(e,t){if(!e)return!!this.activeCandidate;if(!this.activeCandidate)return!0;const{local:s,closest:i}=this.activeCandidate;if(i===e.closest&&s===e.local)return!1;const r=s.x+t.x-i.x;return t=s.y+t.y-i.y,e.radius{let H;(H=i)==null||H.positionNearConnection(S,p,I);let _e;(_e=i)==null||_e.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=r}hideInsertionMarker(){if(this.markerConnection){var e=this.markerConnection,t=e.getSourceBlock(),s=t.outputConnection,i;if((i=t.previousConnection)!=null&&i.targetConnection||s!=null&&s.targetConnection)t.unplug(!0);else{let r;(r=e.targetBlock())==null||r.unplug(!1)}if(e.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(e=t.getSvgRoot())&&e.setAttribute("visibility","hidden")}}showInsertionInputOutline(e){e=e.closest,this.highlightedBlock=e.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(e,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(e){if(this.fadedBlock=e.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const e=[];return this.firstMarker&&e.push(this.firstMarker),this.lastMarker&&e.push(this.lastMarker),e}disposeInsertionMarker(e){if(e){o.disable$$module$build$src$core$events$utils();try{e.dispose()}finally{o.enable$$module$build$src$core$events$utils()}}}};(function(e){e=e.PREVIEW_TYPE||(e.PREVIEW_TYPE={}),e[e.INSERTION_MARKER=0]="INSERTION_MARKER",e[e.INPUT_OUTLINE=1]="INPUT_OUTLINE",e[e.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(ms||(ms={})),ms.PREVIEW_TYPE;var bc=class{constructor(e){this.overrides=null,this.name=e}getClassName(){return this.name+"-renderer"}init(e,t){this.constants_=this.makeConstants_(),t&&(this.overrides=t,Object.assign(this.constants_,t)),this.constants_.setTheme(e),this.constants_.init()}createDom(e,t){this.constants_.createDom(e,this.name+"-"+t.name,"."+this.getClassName()+"."+t.getClassName())}refreshDom(e,t){const s=this.getConstants();s.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=s.randomIdentifier,this.constants_.setTheme(t),this.constants_.init(),this.createDom(e,t)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new fc}makeRenderInfo_(e){return new Rn(this,e)}makeDrawer_(e,t){return new Ic(e,t)}makeMarkerDrawer(e,t){return new td(e,this.getConstants(),t)}makePathObject(e,t){return new Oc(e,t,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(e){return!0}orphanCanConnectAtEnd(e,t,s){return!!Fe.getConnectionForOrphanedConnection(e,s===Te.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}getConnectionPreviewMethod(e,t,s){return vo("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),t.type===Te.OUTPUT_VALUE||t.type===Te.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(s,e.targetBlock(),t.type)?ms.PREVIEW_TYPE.INSERTION_MARKER:ms.PREVIEW_TYPE.REPLACEMENT_FADE:ms.PREVIEW_TYPE.INSERTION_MARKER}render(e){const t=this.makeRenderInfo_(e);t.measure(),this.makeDrawer_(e,t).draw()}},Xe={};Xe.BottomRow=zh,Xe.Connection=Eo,Xe.ConstantProvider=fc,Xe.Drawer=Ic,Xe.ExternalValueInput=Ec,Xe.Field=mr,Xe.Hat=jh,Xe.Icon=cg,Xe.InRowSpacer=rs,Xe.InlineInput=Kh,Xe.InputConnection=Uo,Xe.InputRow=Jh,Xe.JaggedEdge=ug,Xe.MarkerSvg=td,Xe.Measurable=Hs,Xe.NextConnection=ag,Xe.OutputConnection=hg,Xe.PathObject=Oc,Xe.PreviousConnection=dg,Xe.RenderInfo=Rn,Xe.Renderer=bc,Xe.RoundCorner=On,Xe.Row=fn,Xe.SpacerRow=qh,Xe.SquareCorner=bn,Xe.StatementInput=In,Xe.TopRow=Qh,Xe.Types=D,Xe.init=ma,Xe.register=Jr,Xe.unregister=Np;var _g=class{constructor(e,t){this.workspace=e,this.theme=t,this.subscribedWorkspaces_=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(e){var t=this.theme;this.theme=e,(e=this.workspace.getInjectionDiv())&&(t&&(t=t.getClassName())&&oe(e,t),(t=this.theme.getClassName())&&U(e,t));for(let s=0,i;i=this.subscribedWorkspaces_[s];s++)i.refreshTheme();for(const[s,i]of this.componentDB)for(const r of i){e=r.element,t=r.propertyName;const p=this.theme&&this.theme.getComponentStyle(s);e.style.setProperty(t,p||"")}for(const s of this.subscribedWorkspaces_)s.hideChaff()}subscribeWorkspace(e){this.subscribedWorkspaces_.push(e)}unsubscribeWorkspace(e){if(!z(this.subscribedWorkspaces_,e))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(e,t,s){this.componentDB.has(t)||this.componentDB.set(t,[]),this.componentDB.get(t).push({element:e,propertyName:s}),t=this.theme&&this.theme.getComponentStyle(t),e.style.setProperty(s,t||"")}unsubscribe(e){if(e)for(const[t,s]of this.componentDB){for(let i=s.length-1;0<=i;i--)s[i].element===e&&s.splice(i,1);s.length||this.componentDB.delete(t)}}dispose(){this.subscribedWorkspaces_.length=0,this.componentDB.clear()}},sd="VARIABLE_DYNAMIC",bi={CATEGORY_NAME:sd};bi.flyoutCategory=wl,bi.flyoutCategoryBlocks=Oa,bi.onCreateVariableButtonClick_Colour=Ia,bi.onCreateVariableButtonClick_Number=fa,bi.onCreateVariableButtonClick_String=Ea;var pg=30,Ri=[];Ri[Te.INPUT_VALUE]=Te.OUTPUT_VALUE,Ri[Te.OUTPUT_VALUE]=Te.INPUT_VALUE,Ri[Te.NEXT_STATEMENT]=Te.PREVIOUS_STATEMENT,Ri[Te.PREVIOUS_STATEMENT]=Te.NEXT_STATEMENT;var od="RENAME_VARIABLE_ID",id="DELETE_VARIABLE_ID",Tg=class{canConnect(e,t,s,i){return this.canConnectWithReason(e,t,s,i)===Fe.CAN_CONNECT}canConnectWithReason(e,t,s,i){const r=this.doSafetyChecks(e,t);return r!==Fe.CAN_CONNECT?r:this.doTypeChecks(e,t)?s&&!this.doDragChecks(e,t,i||0)?Fe.REASON_DRAG_CHECKS_FAILED:Fe.CAN_CONNECT:Fe.REASON_CHECKS_FAILED}getErrorMessage(e,t,s){switch(e){case Fe.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Fe.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Fe.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Fe.REASON_TARGET_NULL:return"Target connection is null.";case Fe.REASON_CHECKS_FAILED:return"Connection checks failed. "+(t+" expected "+t.getCheck()+", found "+s.getCheck());case Fe.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Fe.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Fe.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(e,t){if(!e||!t)return Fe.REASON_TARGET_NULL;let s,i,r;return e.isSuperior()?(s=e.getSourceBlock(),i=t.getSourceBlock(),r=t):(i=e.getSourceBlock(),s=t.getSourceBlock(),r=e,e=t),s===i?Fe.REASON_SELF_CONNECTION:r.type!==Ri[e.type]?Fe.REASON_WRONG_TYPE:s.workspace!==i.workspace?Fe.REASON_DIFFERENT_WORKSPACES:s.isShadow()&&!i.isShadow()?Fe.REASON_SHADOW_PARENT:r.type===Te.OUTPUT_VALUE&&i.previousConnection&&i.previousConnection.isConnected()||r.type===Te.PREVIOUS_STATEMENT&&i.outputConnection&&i.outputConnection.isConnected()?Fe.REASON_PREVIOUS_AND_OUTPUT:Fe.CAN_CONNECT}doTypeChecks(e,t){if(e=e.getCheck(),t=t.getCheck(),!e||!t)return!0;for(let s=0;ss||t.getSourceBlock().isInsertionMarker())return!1;switch(t.type){case Te.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,t);case Te.OUTPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case Te.INPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;case Te.NEXT_STATEMENT:if(t.isConnected()&&!e.getSourceBlock().nextConnection&&!t.targetBlock().isShadow()&&t.targetBlock().nextConnection||t.targetBlock()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;default:return!1}return!tn.includes(t)}canConnectToPrevious_(e,t){return e.targetConnection||tn.includes(t)?!1:t.targetConnection?(e=t.targetBlock(),e.isInsertionMarker()?!e.getPreviousBlock():!1):!0}};c(ee.CONNECTION_CHECKER,Ps,Tg);var rd=class extends cn{constructor(e){super(e),this.type=oi,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new rd),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.deleteVariableById(this.varId):t.createVariable(this.varName,this.varType,this.varId)}};c(ee.EVENT,oi,rd);var nd=class extends cn{constructor(e,t){super(e),this.type=ji,e&&(this.oldName=e.name,this.newName=typeof t>"u"?"":t)}toJson(){const e=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return e.oldName=this.oldName,e.newName=this.newName,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new nd),t.oldName=e.oldName,t.newName=e.newName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");e?t.renameVariableById(this.varId,this.newName):t.renameVariableById(this.varId,this.oldName)}};c(ee.EVENT,ji,nd);var ld=class{constructor(e){this.workspace=e,this.variableMap=new Map}clear(){for(const e of this.variableMap.values())for(;0{r&&t&&this.deleteVariableInternal(t,i)})):this.deleteVariableInternal(t,i)}else console.warn("Can't delete non-existent variable: "+e)}deleteVariableInternal(e,t){const s=o.getGroup$$module$build$src$core$events$utils();s||o.setGroup$$module$build$src$core$events$utils(!0);try{for(let i=0;ie.name)}getVariableUsesById(e){const t=[],s=this.workspace.getAllBlocks(!1);for(let i=0;ithis.remainingCapacityOfType(s))return!1;t+=e[s]}return!(t>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(e){var t=e?this.redoStack_:this.undoStack_,s=e?this.undoStack_:this.redoStack_;const i=t.pop();if(i){for(var r=[i];t.length&&i.group&&i.group===t[t.length-1].group;){const p=t.pop();p&&r.push(p)}for(t=0;tthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let t=0;tp[0]-I[0]);for(const[p,I]of r)if(e{},document.body.addEventListener("wheel",this.dummyWheelListener),pe(this.svgGroup_,"wheel",this,this.onMouseWheel_)),this.options.hasCategories&&(this.toolbox_=new(P(ee.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(e=P(ee.CURSOR,this.options))&&this.markerManager.setCursor(new e),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&$(this.svgGroup_),this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const e=this.getParentSvg();e&&e.parentNode&&$(e.parentNode)}this.resizeHandlerWrapper&&(Ae(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=Es.newTrashcan(this);const e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.getCanvas())}static newTrashcan(e){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new OT(this);const e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)}addFlyout(e){const t=new Ts({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return t.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(P(ee.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(t):new(P(ee.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(t),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(e)}getFlyout(e){return this.flyout||e?this.flyout:this.toolbox_?this.toolbox_.getFlyout():null}getToolbox(){return this.toolbox_}updateScreenCalculations_(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox_&&this.toolbox_.position(),this.flyout&&this.flyout.position();const e=this.componentManager.getComponents(Mt.Capability.POSITIONABLE,!0),t=this.getMetricsManager().getUiMetrics(),s=[];for(let i=0,r;r=e[i];i++){r.position(t,s);const p=r.getBoundingRectangle();p&&s.push(p)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations_()}updateScreenCalculationsIfScrolled(){const e=B();se.equals(this.lastRecordedPageScroll,e)||(this.lastRecordedPageScroll=e,this.updateScreenCalculations_())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(e,t){const s=this.getParentSvg();e!=null&&(this.cachedParentSvgSize.width=e,s.setAttribute("data-cached-width",`${e}`)),t!=null&&(this.cachedParentSvgSize.height=t,s.setAttribute("data-cached-height",`${t}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let e=this.svgGroup_;for(;e;){if(e.tagName==="svg"){this.cachedParentSvg=e;break}e=e.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(de()){var e=this.scale,t=-this.scrollY,s=-this.scrollX;if(!(e===this.oldScale&&1>Math.abs(t-this.oldTop)&&1>Math.abs(s-this.oldLeft))){var i=new($e(Do))(t,s,e,this.id,this.oldScale);this.oldScale=e,this.oldTop=t,this.oldLeft=s,X(i)}}}translate(e,t){let s;(s=this.layerManager)==null||s.translateLayers(new se(e,t),this.scale);let i;(i=this.grid)==null||i.moveTo(e,t),this.maybeFireViewportChangeEvent()}getWidth(){const e=this.getMetrics();return e?e.viewWidth/this.scale:0}setVisible(e){this.isVisible_=e,this.svgGroup_&&(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||this.hideChaff(!0))}render(){const e=this.getAllBlocks(!1);for(let t=e.length-1;0<=t;t--)e[t].queueRender();this.getTopBlocks().flatMap(t=>t.getDescendants(!1)).filter(t=>t.isInsertionMarker()).forEach(t=>t.queueRender()),vs().then(()=>void this.markerManager.updateMarkers())}highlightBlock(e,t){if(t===void 0){for(let s=0,i;i=this.highlightedBlocks[s];s++)i.setHighlighted(!1);this.highlightedBlocks.length=0}(e=e?this.getBlockById(e):null)&&((t=t===void 0||t)?this.highlightedBlocks.includes(e)||this.highlightedBlocks.push(e):z(this.highlightedBlocks,e),e.setHighlighted(t))}refreshToolboxSelection(){const e=this.isFlyout?this.targetWorkspace:this;e&&!e.currentGesture_&&e.toolbox_&&e.toolbox_.getFlyout()&&e.toolbox_.refreshSelection()}renameVariableById(e,t){super.renameVariableById(e,t),this.refreshToolboxSelection()}deleteVariableById(e){super.deleteVariableById(e),this.refreshToolboxSelection()}createVariable(e,t,s){return e=super.createVariable(e,t,s),this.refreshToolboxSelection(),e}recordDragTargets(){const e=this.componentManager.getComponents(Mt.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let t=0,s;s=e[t];t++){const i=s.getClientRect();i&&this.dragTargetAreas.push({component:s,clientRect:i})}}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}newComment(e){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts")}getDragTarget(e){for(let t=0,s;s=this.dragTargetAreas[t];t++)if(s.clientRect.contains(e.clientX,e.clientY))return s.component;return null}onMouseDown_(e){const t=this.getGesture(e);t&&t.handleWsStart(e,this)}startDrag(e,t){e=G(e,this.getParentSvg(),this.getInverseScreenCTM()),e.x/=this.scale,e.y/=this.scale,this.dragDeltaXY=se.difference(t,e)}moveDrag(e){return e=G(e,this.getParentSvg(),this.getInverseScreenCTM()),e.x/=this.scale,e.y/=this.scale,se.sum(this.dragDeltaXY,e)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){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}isMovableHorizontally(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollVertically())}onMouseWheel_(e){if(_o.inProgress())e.preventDefault(),e.stopPropagation();else{var t=this.options.zoomOptions&&this.options.zoomOptions.wheel,s=this.options.moveOptions&&this.options.moveOptions.wheel;if(t||s){var i=Z(e);if(lh)var r=e.metaKey;t&&(e.ctrlKey||r||!s)?(i=-i.y/50,t=G(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(t.x,t.y,i)):(t=this.scrollX-i.x,s=this.scrollY-i.y,e.shiftKey&&!i.x&&(t=this.scrollX-i.y,s=this.scrollY),this.scroll(t,s)),e.preventDefault()}}}getBlocksBoundingBox(){const e=this.getTopBoundedElements();if(!e.length)return new qe(0,0,0,0);const t=e[0].getBoundingRectangle();for(let i=1;it.bottom&&(t.bottom=s.bottom),s.leftt.right&&(t.right=s.right))}return t}cleanUp(){this.setResizesEnabled(!1),o.setGroup$$module$build$src$core$events$utils(!0);const e=this.getTopBlocks(!0);let t=0;for(let s=0,i;i=e[s];s++){if(!i.isMovable())continue;const r=i.getRelativeToSurfaceXY();i.moveBy(-r.x,t-r.y,["cleanup"]),i.snapToGrid(),t=i.getRelativeToSurfaceXY().y+i.getHeightWidth().height+this.renderer.getConstants().MIN_BLOCK_HEIGHT}o.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(e){if(!this.options.readOnly&&!this.isFlyout){var t=Me.registry.getContextMenuOptions(Me.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(t,e),Xr(e,t,this.RTL,this)}}updateToolbox(e){if(e=Zs(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(tl(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.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(dt(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(e,t,s){s=Math.pow(this.options.zoomOptions.scaleSpeed,s);const i=this.scale*s;if(this.scale!==i){i>this.options.zoomOptions.maxScale?s=this.options.zoomOptions.maxScale/this.scale:ithis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&et.autoHide(e))}static setTopLevelWorkspaceMetrics_(e){const t=this.getMetrics();typeof e.x=="number"&&(this.scrollX=-(t.scrollLeft+(t.scrollWidth-t.viewWidth)*e.x)),typeof e.y=="number"&&(this.scrollY=-(t.scrollTop+(t.scrollHeight-t.viewHeight)*e.y)),this.translate(this.scrollX+t.absoluteLeft,this.scrollY+t.absoluteTop)}},cd=class extends Bs{constructor(e,t){super(t),this.type=qi,this.isOpen=e}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this is already open or not is undefined. Either pass a value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new cd),t.isOpen=e.isOpen,t}};c(ee.EVENT,qi,cd);var ud=class extends Bs{constructor(e,t,s){super(s),this.type=Ki,this.oldElementId=e??void 0,this.newElementId=t??void 0}toJson(){const e=super.toJson();return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new ud),t.oldElementId=e.oldElementId,t.newElementId=e.newElementId,t}};c(ee.EVENT,Ki,ud);var mg=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(e){this.drawer=e}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(e){const t=this.curNode;this.curNode=e,this.drawer&&this.drawer.draw(t,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},ad=class extends mg{constructor(){super(),this.type="cursor"}next(){var e=this.getCurNode();if(!e)return null;for(e=e.next();e&&e.next()&&(e.getType()===j.types.NEXT||e.getType()===j.types.BLOCK);)e=e.next();return e&&this.setCurNode(e),e}in(){var e=this.getCurNode();if(!e)return null;(e.getType()===j.types.PREVIOUS||e.getType()===j.types.OUTPUT)&&(e=e.next());let t,s;return(e=(s=(t=e)==null?void 0:t.in())!=null?s:null)&&this.setCurNode(e),e}prev(){var e=this.getCurNode();if(!e)return null;for(e=e.prev();e&&e.prev()&&(e.getType()===j.types.NEXT||e.getType()===j.types.BLOCK);)e=e.prev();return e&&this.setCurNode(e),e}out(){var e=this.getCurNode();return e?((e=e.out())&&e.getType()===j.types.BLOCK&&(e=e.prev()||e),e&&this.setCurNode(e),e):null}};c(ee.CURSOR,Ps,ad);var Sn=class extends ad{constructor(){super()}next(){var e=this.getCurNode();return e?((e=this.getNextNode_(e,this.validNode_))&&this.setCurNode(e),e):null}in(){return this.next()}prev(){var e=this.getCurNode();return e?((e=this.getPreviousNode_(e,this.validNode_))&&this.setCurNode(e),e):null}out(){return this.prev()}getNextNode_(e,t){if(!e)return null;const s=e.in()||e.next();return t(s)?s:s?this.getNextNode_(s,t):(e=this.findSiblingOrParent(e.out()),t(e)?e:e?this.getNextNode_(e,t):null)}getPreviousNode_(e,t){if(!e)return null;let s=e.prev();return s=s?this.getRightMostChild(s):e.out(),t(s)?s:s?this.getPreviousNode_(s,t):null}validNode_(e){let t=!1;return e=e&&e.getType(),(e===j.types.OUTPUT||e===j.types.INPUT||e===j.types.FIELD||e===j.types.NEXT||e===j.types.PREVIOUS||e===j.types.WORKSPACE)&&(t=!0),t}findSiblingOrParent(e){if(!e)return null;const t=e.next();return t||this.findSiblingOrParent(e.out())}getRightMostChild(e){if(!e.in())return e;for(e=e.in();e&&e.next();)e=e.next();return this.getRightMostChild(e)}};Sn.registrationName="basicCursor",c(ee.CURSOR,Sn.registrationName,Sn);var Eg=class extends Sn{validNode_(e){let t=!1;const s=e&&e.getType();return e&&(e=e.getLocation(),s===j.types.FIELD&&e&&e.isTabNavigable()&&e.isClickable()&&(t=!0)),t}},hd=10,jt=class extends Fe{constructor(e,t){super(e,t),this.highlighted=!1,this.targetConnection=null,this.db=e.workspace.connectionDBList[t],this.dbOpposite=e.workspace.connectionDBList[Ri[t]],this.offsetInBlock=new se(0,0),this.trackedState=jt.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===jt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let e,t;(t=(e=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||t.call(e,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(e){const t=this.x-e.x;return e=this.y-e.y,Math.sqrt(t*t+e*e)}bumpAwayFrom(e){if(!this.sourceBlock_.workspace.isDragging()){var t=this.sourceBlock_.getRootBlock();if(!t.isInFlyout){var s=!1;if(!t.isMovable()){if(t=e.getSourceBlock().getRootBlock(),!t.isMovable())return;e=this,s=!0}var i=Ne()==t;i||t.addSelect();var r=e.x+o.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*hd)-this.x,p=e.y+o.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*hd)-this.y;s&&(p=-p),t.RTL&&(r=e.x-o.config$$module$build$src$core$config.snapRadius-Math.floor(Math.random()*hd)-this.x),t.moveBy(r,p,["bump"]),i||t.removeSelect()}}}moveTo(e,t){let s=!1;return this.trackedState===jt.TrackedState.WILL_TRACK?(this.db.addConnection(this,t),this.trackedState=jt.TrackedState.TRACKED,s=!0):this.trackedState===jt.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,t),s=!0),this.x=e,this.y=t,s}moveBy(e,t){return this.moveTo(this.x+e,this.y+t)}moveToOffset(e){return this.moveTo(e.x+this.offsetInBlock.x,e.y+this.offsetInBlock.y)}setOffsetInBlock(e,t){this.offsetInBlock.x=e,this.offsetInBlock.y=t}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var e=this.targetConnection;const t=this.targetBlock();e&&t&&(e=se.difference(this.offsetInBlock,e.offsetInBlock),t.translate(e.x,e.y))}closest(e,t){return this.dbOpposite.searchForClosest(this,e,t)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(e){e&&this.trackedState===jt.TrackedState.TRACKED||!e&&this.trackedState===jt.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(e?(this.db.addConnection(this,this.y),this.trackedState=jt.TrackedState.TRACKED):(this.trackedState===jt.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=jt.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const e=this.targetBlock().getDescendants(!1);for(let t=0;tt-o.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(e,t){e=this.getLocalConnections(e);let s=this.connectionCandidate?o.config$$module$build$src$core$config.connectingSnapRadius:o.config$$module$build$src$core$config.snapRadius,i=null;for(const r of e){const{connection:p,radius:I}=r.closest(s,t);p&&(i={local:r,neighbour:p,distance:I},s=I)}return i}getLocalConnections(e){const t=e.getConnections_(!1),s=e.lastConnectionInStack(!0);return s&&s!==e.nextConnection&&t.push(s),t}endDrag(e){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.endDrag(e)}else{if(this.fireDragEndEvent(),this.fireMoveEvent(),ue(),Wi(),this.connectionPreviewer.hidePreview(),!this.block.isDeadOrDying()&&this.dragging){let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,nr),this.block.setDragging(!1)}this.connectionCandidate?this.applyConnections(this.connectionCandidate):this.block.queueRender(),this.block.snapToGrid(),this.connectionPreviewer.dispose(),this.workspace.setResizesEnabled(!0),o.setGroup$$module$build$src$core$events$utils(!1)}}applyConnections(e){const{local:t,neighbour:s}=e;t.connect(s);const i=t.isSuperior()?s:t,r=this.block.getRootBlock();vs().then(()=>{Cl(i.getSourceBlock()),setTimeout(()=>{r.bringToFront()},0)})}revertDrag(){if(this.block.isShadow()){let t;(t=this.block.getParent())==null||t.revertDrag()}else{var e;if((e=this.startChildConn)==null||e.connect(this.block.nextConnection),this.startParentConn)switch(this.startParentConn.type){case Te.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection);break;case Te.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let t;(t=this.workspace.getLayerManager())==null||t.moveOffDragLayer(this.block,nr),Yi(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null,this.connectionPreviewer.hidePreview(),this.connectionCandidate=null,this.block.setDragging(!1),this.dragging=!1}}},fs=class extends Oi{constructor(e,t,s){if(super(e,t,s),this.width=this.height=0,this.warningTextDb=new Map,this.mutator=null,this.rendered=!0,this.eventsInit_=this.renderIsInProgress_=this.visuallyDisabled=!1,this.translation="",this.dragging=!1,this.relativeCoords=new se(0,0),this.dragStrategy=new fg(this),!e.rendered)throw TypeError("Cannot create a rendered block in a headless workspace");this.workspace=e,this.svgGroup_=A(x.G,{}),this.style=e.getRenderer().getConstants().getBlockStyle(null),this.pathObject=e.getRenderer().makePathObject(this.svgGroup_,this.style),e=this.pathObject.svgPath,e.tooltip=this,Ui(e),this.svgGroup_.setAttribute("data-id",this.id),this.doInit_()}initSvg(){if(!this.initialized){for(var e of this.inputList)e.init();for(const t of this.getIcons())t.initView(this.createIconPointerDownListener(t)),t.updateEditable();this.applyColour(),this.pathObject.updateMovable(this.isMovable()||this.isInFlyout),e=this.getSvgRoot(),!this.workspace.options.readOnly&&e&&pe(e,"pointerdown",this,this.onMouseDown_),e.parentNode||this.workspace.getCanvas().appendChild(e),this.initialized=!0}}getColourSecondary(){return this.style.colourSecondary}getColourTertiary(){return this.style.colourTertiary}select(){if(this.isShadow()){let e;(e=this.getParent())==null||e.select()}else this.addSelect()}unselect(){if(this.isShadow()){let e;(e=this.getParent())==null||e.unselect()}else this.removeSelect()}setParent(e){const t=this.parentBlock_;if(e!==t){ce(),super.setParent(e),ue();var s=this.getSvgRoot();if(!this.workspace.isClearing&&s){var i=this.getRelativeToSurfaceXY();e?e.getSvgRoot().appendChild(s):t&&((e=this.workspace.getCanvas().querySelector(".blocklyDragging"))?this.workspace.getCanvas().insertBefore(s,e):this.workspace.getCanvas().appendChild(s),this.translate(i.x,i.y)),this.applyColour()}}}getRelativeToSurfaceXY(){const e=this.workspace.getLayerManager();if(!e)throw Error("Cannot calculate position because the workspace has not been appended");let t=0,s=0,i=this.getSvgRoot();if(i)do{const r=_(i);t+=r.x,s+=r.y,i=i.parentNode}while(i&&!e.hasLayer(i));return new se(t,s)}moveBy(e,t,s){if(this.parentBlock_)throw Error("Block has parent");const i=de();let r=null;i&&(r=new($e(o.MOVE$$module$build$src$core$events$utils))(this),s&&r.setReason(s)),e=new se(e,t),t=this.getRelativeToSurfaceXY(),e=se.sum(t,e),this.translate(e.x,e.y),this.updateComponentLocations(e),i&&r&&(r.recordNew(),X(r)),this.workspace.resizeContents()}translate(e,t){this.translation=`translate(${e}, ${t})`,this.relativeCoords=new se(e,t),this.getSvgRoot().setAttribute("transform",this.getTranslation())}getTranslation(){return this.translation}moveTo(e,t){const s=this.getRelativeToSurfaceXY();this.moveBy(e.x-s.x,e.y-s.y,t)}moveDuringDrag(e){this.translate(e.x,e.y),this.getSvgRoot().setAttribute("transform",this.getTranslation()),this.updateComponentLocations(e)}snapToGrid(){if(!this.isDeadOrDying()&&!this.getParent()&&!this.isInFlyout){var e=this.workspace.getGrid();if(e!=null&&e.shouldSnap()){var t=this.getRelativeToSurfaceXY();e=e.alignXY(t),e!==t&&this.moveTo(e,["snap"])}}}getBoundingRectangle(){const e=this.getRelativeToSurfaceXY(),t=this.getHeightWidth();let s,i;return this.RTL?(s=e.x-t.width,i=e.x):(s=e.x,i=e.x+t.width),new qe(e.y,e.y+t.height,s,i)}markDirty(){this.pathObject.constants=this.workspace.getRenderer().getConstants();for(let e=0,t;t=this.inputList[e];e++)t.markDirty()}setCollapsed(e){this.collapsed_!==e&&(super.setCollapsed(e),this.updateCollapsed_())}updateCollapsed_(){var e=this.isCollapsed();const t=ln,s=ql;for(let r=0,p;p=this.inputList[r];r++)p.name!==t&&p.setVisible(!e);for(var i of this.getIcons())i.updateCollapsed();e?(e=this.toString(pg),(i=this.getField(s))?i.setValue(e):(this.getInput(t)||this.appendDummyInput(t)).appendField(new Ii(e),s)):(this.updateDisabled(),this.removeInput(t))}tab(e,t){const s=new Eg;s.setCurNode(j.createFieldNode(e)),e=s.getCurNode(),t?s.next():s.prev(),(t=s.getCurNode())&&t!==e&&(t.getLocation().showEditor(),this.workspace.keyboardAccessibilityMode&&this.workspace.getCursor().setCurNode(t))}onMouseDown_(e){const t=this.workspace.getGesture(e);t&&t.handleBlockStart(e,this)}showHelp(){const e=typeof this.helpUrl=="function"?this.helpUrl():this.helpUrl;e&&window.open(e)}generateContextMenu(){if(this.workspace.options.readOnly||!this.contextMenu)return null;const e=Me.registry.getContextMenuOptions(Me.ScopeType.BLOCK,{block:this});return this.customContextMenu&&this.customContextMenu(e),e}showContextMenu(e){const t=this.generateContextMenu();t&&t.length&&(Xr(e,t,this.RTL,this.workspace),Ju(this))}updateComponentLocations(e){this.dragging||this.updateConnectionLocations(e),this.updateIconLocations(e),this.updateFieldLocations(e);for(const t of this.getChildren(!1))t.updateComponentLocations(se.sum(e,t.relativeCoords))}updateConnectionLocations(e){for(const t of this.getConnections_(!1))t.moveToOffset(e)}updateIconLocations(e){for(const t of this.getIcons())t.onLocationChange(e)}updateFieldLocations(e){for(const t of this.inputList)for(const s of t.fieldRow)s.onLocationChange(e)}setDragging(e){(this.dragging=e)?(this.translation="",tn.push(...this.getConnections_(!0)),U(this.svgGroup_,"blocklyDragging")):(tn.length=0,oe(this.svgGroup_,"blocklyDragging"));for(let t=0;tclearTimeout(e)),this.warningTextDb.clear(),this.getIcons().forEach(e=>e.dispose())}checkAndDelete(){this.workspace.isFlyout||(o.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),o.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:Nn.TYPE,blockState:ts(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:$t(this,!0)}}applyColour(){this.pathObject.applyColour(this);const e=this.getIcons();for(let t=0;t{this.isDeadOrDying()||(this.warningTextDb.delete(t),this.setWarningText(e,t))},100));else if(this.isInFlyout&&(e=null),s=this.getIcon(mo.TYPE),e){let i=this.getSurroundParent(),r=null;for(;i;)i.isCollapsed()&&(r=i),i=i.getSurroundParent();r&&r.setWarningText(o.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,fs.COLLAPSED_WARNING_ID),s?s.addMessage(e,t):this.addIcon(new mo(this).addMessage(e,t))}else s&&(t?(s.addMessage("",t),s.getText()||this.removeIcon(mo.TYPE)):this.removeIcon(mo.TYPE))}setMutator(e){this.removeIcon(o.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),e&&this.addIcon(e)}addIcon(e){return super.addIcon(e),e instanceof o.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=e),e.initView(this.createIconPointerDownListener(e)),e.applyColour(),e.updateEditable(),this.queueRender(),e}createIconPointerDownListener(e){return t=>{this.isDeadOrDying()||(t=this.workspace.getGesture(t))&&t.setStartIcon(e)}}removeIcon(e){const t=super.removeIcon(e);return e.equals(o.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.queueRender(),t}setEnabled(e){vo("setEnabled","v11","v12","the setDisabledReason method of BlockSvg");const t=this.isEnabled();super.setEnabled(e),this.isEnabled()===t||this.getInheritedDisabled()||this.updateDisabled()}setDisabledReason(e,t){const s=this.isEnabled();super.setDisabledReason(e,t),this.isEnabled()===s||this.getInheritedDisabled()||this.updateDisabled()}setHighlighted(e){this.pathObject.updateHighlighted(e)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(e){this.pathObject.updateDraggingDelete(e)}getColour(){return this.style.colourPrimary}setColour(e){super.setColour(e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()}setStyle(e){const t=this.workspace.getRenderer().getConstants().getBlockStyle(e);if(this.styleName_=e,t)this.hat=t.hat,this.pathObject.setStyle(t),this.colour_=t.colourPrimary,this.style=t,this.applyColour();else throw Error("Invalid style name: "+e)}bringToFront(e=!1){let t=this;if(!t.isDeadOrDying())do{const s=t.getSvgRoot(),i=s.parentNode,r=i.childNodes;if(r[r.length-1]!==s&&i.appendChild(s),e)break;t=t.getParent()}while(t)}setPreviousStatement(e,t){super.setPreviousStatement(e,t),this.queueRender()}setNextStatement(e,t){super.setNextStatement(e,t),this.queueRender()}setOutput(e,t){super.setOutput(e,t),this.queueRender()}setInputsInline(e){super.setInputsInline(e),this.queueRender()}removeInput(e,t){return e=super.removeInput(e,t),this.queueRender(),e}moveNumberedInputBefore(e,t){super.moveNumberedInputBefore(e,t),this.queueRender()}appendInput(e){return super.appendInput(e),this.queueRender(),e}setConnectionTracking(e){if(this.previousConnection&&this.previousConnection.setTracking(e),this.outputConnection&&this.outputConnection.setTracking(e),this.nextConnection){this.nextConnection.setTracking(e);var t=this.nextConnection.targetBlock();t&&t.setConnectionTracking(e)}if(!this.collapsed_)for(t=0;t=this.workspace.options.maxTrashcanContents||(e=new Ts({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===Ce.TOP?Ce.BOTTOM:Ce.TOP,this.flyout=new(P(ee.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(e)):(e.toolboxPosition=this.workspace.toolboxPosition===Ce.RIGHT?Ce.LEFT:Ce.RIGHT,this.flyout=new(P(ee.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(e)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=A(x.G,{class:"blocklyTrash"});let e;const t=String(Math.random()).substring(2);e=A(x.CLIPPATH,{id:"blocklyTrashBodyClipPath"+t},this.svgGroup),A(x.RECT,{width:Ir,height:Nc,y:Or},e);const s=A(x.IMAGE,{width:Yt.width,x:-dd,height:Yt.height,y:-$d,"clip-path":"url(#blocklyTrashBodyClipPath"+t+")"},this.svgGroup);return s.setAttributeNS(ss,"xlink:href",this.workspace.options.pathToMedia+Yt.url),e=A(x.CLIPPATH,{id:"blocklyTrashLidClipPath"+t},this.svgGroup),A(x.RECT,{width:Ir,height:Or},e),this.svgLid=A(x.IMAGE,{width:Yt.width,x:-dd,height:Yt.height,y:-$d,"clip-path":"url(#blocklyTrashLidClipPath"+t+")"},this.svgGroup),this.svgLid.setAttributeNS(ss,"xlink:href",this.workspace.options.pathToMedia+Yt.url),Je(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),Je(this.svgGroup,"pointerup",this,this.click),Je(s,"pointerover",this,this.mouseOver),Je(s,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let s;(s=this.flyout)==null||s.show(e),t.cursor="";let i;(i=this.workspace.scrollbar)==null||i.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var e;(e=this.flyout)==null||e.hide();var t;(t=this.workspace.scrollbar)==null||t.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(e){!e&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(e,t){if(this.initialized){var s=rl(this.workspace,e);e=il(s,new Be(Ir,Nc+Or),yf,bg,e,this.workspace),t=nl(e,bg,s.vertical===$o.TOP?xo.DOWN:xo.UP,t),this.top=t.top,this.left=t.left;var i;(i=this.svgGroup)==null||i.setAttribute("transform","translate("+this.left+","+this.top+")")}}getBoundingRectangle(){return new qe(this.top,this.top+Nc+Or,this.left,this.left+Ir)}getClientRect(){if(!this.svgGroup)return null;var e=this.svgGroup.getBoundingClientRect();const t=e.top+$d-Cc;return e=e.left+dd-Cc,new qe(t,t+Or+Nc+2*Cc,e,e+Ir+2*Cc)}onDragOver(e){this.setLidOpen(this.wouldDelete_)}onDragExit(e){this.setLidOpen(!1)}onDrop(e){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(e){this.isLidOpen!==e&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=e,this.animateLid())}animateLid(){const e=wf;var t=1/(e+1);this.lidOpen+=this.isLidOpen?t:-t,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*Sg),t=Rg+this.lidOpen*(Pf-Rg),this.svgGroup&&(this.svgGroup.style.opacity=`${t}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),Df/e))}setLidAngle(e){const t=this.workspace.toolboxPosition===Ce.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let s;(s=this.svgLid)==null||s.setAttribute("transform","rotate("+(t?-e:e)+","+(t?4:Ir-4)+","+(Or-2)+")")}setMinOpenness(e){this.minOpenness=e,this.isLidOpen||this.setLidAngle(e*Sg)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(e){e=new($e(qi))(e,this.workspace.id),X(e)}blockMouseDownWhenOpenable(e){!this.contentsIsOpen()&&this.hasContents()&&e.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(e){if(!(0>=this.workspace.options.maxTrashcanContents||e.type!==o.DELETE$$module$build$src$core$events$utils||e.type!==o.DELETE$$module$build$src$core$events$utils||e.wasShadow)){if(!e.oldJson)throw Error("Encountered a delete event without proper oldJson");if(e=JSON.stringify(this.cleanBlockJson(e.oldJson)),!this.contents.includes(e)){for(this.contents.unshift(e);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(kf)}}}cleanBlockJson(e){function t(s){if(s){if(delete s.id,delete s.x,delete s.y,delete s.enabled,delete s.disabledReasons,s.icons&&s.icons.comment){var i=s.icons.comment;delete i.height,delete i.width,delete i.pinned}i=s.inputs;for(var r in i){var p=i[r];const I=p.block;p=p.shadow,I&&t(I),p&&t(p)}s.next&&(r=s.next,s=r.block,r=r.shadow,s&&t(s),r&&t(r))}}return e=JSON.parse(JSON.stringify(e)),t(e),Object.assign({},{kind:"BLOCK"},e)}},Ir=47,Nc=44,Or=16,bg=20,yf=20,Cc=10,dd=0,$d=32,kf=.1,Df=80,wf=4,Rg=.4,Pf=.8,Sg=45,We=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(e,t){if(this.shortcuts.get(e.name)&&!t)throw Error(`Shortcut named "${e.name}" already exists.`);if(this.shortcuts.set(e.name,e),(t=e.keyCodes)&&0ka(t)),e.length?e:null}load(e,t){const s=t.getProcedureMap();for(const i of e)s.add(Da(this.procedureModelClass,this.parameterModelClass,i,t))}clear(e){e.getProcedureMap().clear()}},Lc={};Lc.ProcedureSerializer=Bf,Lc.loadProcedure=Da,Lc.saveProcedure=ka;var Ng=class{constructor(){this.priority=yT}save(e){const t=[];for(const s of e.getAllVariables())e={name:s.name,id:s.getId()},s.type&&(e.type=s.type),t.push(e);return t.length?t:null}load(e,t){for(const s of e)t.createVariable(s.name,s.type,s.id)}clear(e){e.getVariableMap().clear()}};Br("variables",new Ng);var Cg={};Cg.VariableSerializer=Ng;var Td={};Td.load=Dp,Td.save=kp;var Ff={blocks:dn,exceptions:$i,priorities:_f,procedures:Lc,registry:Oh,variables:Cg,workspaceComments:tc,workspaces:Td},gd=class{constructor(e,t,s,i,r){this.workspace=e,this.oldHostMetrics_=this.corner_=this.vScroll=this.hScroll=null,t=t===void 0?!0:t,s=s===void 0?!0:s;const p=t&&s;t&&(this.hScroll=new Et(e,!0,p,i,r)),s&&(this.vScroll=new Et(e,!1,p,i,r)),p&&(this.corner_=A(x.RECT,{height:Et.scrollbarThickness,width:Et.scrollbarThickness,class:"blocklyScrollbarBackground"}),L(this.corner_,e.getBubbleCanvas()))}dispose(){$(this.corner_),this.oldHostMetrics_=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const e=this.workspace.getMetrics();if(e){var t=!1,s=!1;if(this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth===e.viewWidth&&this.oldHostMetrics_.viewHeight===e.viewHeight&&this.oldHostMetrics_.absoluteTop===e.absoluteTop&&this.oldHostMetrics_.absoluteLeft===e.absoluteLeft?(this.oldHostMetrics_&&this.oldHostMetrics_.scrollWidth===e.scrollWidth&&this.oldHostMetrics_.viewLeft===e.viewLeft&&this.oldHostMetrics_.scrollLeft===e.scrollLeft||(t=!0),this.oldHostMetrics_&&this.oldHostMetrics_.scrollHeight===e.scrollHeight&&this.oldHostMetrics_.viewTop===e.viewTop&&this.oldHostMetrics_.scrollTop===e.scrollTop||(s=!0)):s=t=!0,t||s){try{o.disable$$module$build$src$core$events$utils(),this.hScroll&&t&&this.hScroll.resize(e),this.vScroll&&s&&this.vScroll.resize(e)}finally{o.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics_||this.oldHostMetrics_.viewWidth!==e.viewWidth||this.oldHostMetrics_.absoluteLeft!==e.absoluteLeft){let i;(i=this.corner_)==null||i.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics_||this.oldHostMetrics_.viewHeight!==e.viewHeight||this.oldHostMetrics_.absoluteTop!==e.absoluteTop){let i;(i=this.corner_)==null||i.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics_=e}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(e,t){this.hScroll&&this.hScroll.setOrigin(e,t),this.vScroll&&this.vScroll.setOrigin(e,t)}set(e,t,s){this.hScroll&&this.hScroll.set(e,!1),this.vScroll&&this.vScroll.set(t,!1),(s||s===void 0)&&(e={},this.hScroll&&(e.x=this.hScroll.getRatio_()),this.vScroll&&(e.y=this.vScroll.getRatio_()),this.workspace.setMetrics(e))}setX(e){this.hScroll&&this.hScroll.set(e,!0)}setY(e){this.vScroll&&this.vScroll.set(e,!0)}setContainerVisible(e){this.hScroll&&this.hScroll.setContainerVisible(e),this.vScroll&&this.vScroll.setContainerVisible(e)}isVisible(){let e=!1;return this.hScroll&&(e=this.hScroll.isVisible()),this.vScroll&&(e=e||this.vScroll.isVisible()),e}setVisible(e){this.hScroll&&this.hScroll.setVisibleInternal(e),this.vScroll&&this.vScroll.setVisibleInternal(e)}resizeContent(e){this.hScroll&&this.hScroll.resizeContentHorizontal(e),this.vScroll&&this.vScroll.resizeContentVertical(e)}resizeView(e){this.hScroll&&this.hScroll.resizeViewHorizontal(e),this.vScroll&&this.vScroll.resizeViewVertical(e)}},md=class{constructor(e){this.workspace_=e}getDimensionsPx_(e){let t=0,s=0;return e&&(t=e.getWidth(),s=e.getHeight()),new Be(t,s)}getFlyoutMetrics(e){return e=this.getDimensionsPx_(this.workspace_.getFlyout(e)),{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const e=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:e.width,height:e.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let e=0,t=0;const s=this.getToolboxMetrics(),i=this.getFlyoutMetrics(),r=!!this.workspace_.getToolbox();var p;const I=!((p=this.workspace_.getFlyout())!=null&&p.autoClose);p=r?s.position:i.position;const S=p===Ce.TOP;return p===Ce.LEFT&&(r&&(e+=s.width),I&&(e+=i.width)),S&&(r&&(t+=s.height),I&&(t+=i.height)),{top:t,left:e}}getViewMetrics(e){e=e?this.workspace_.scale:1;const t=this.getSvgMetrics(),s=this.getToolboxMetrics(),i=this.getFlyoutMetrics(),r=!!this.workspace_.getToolbox();var p;const I=!((p=this.workspace_.getFlyout())!=null&&p.autoClose);p=r?s.position:i.position;const S=p===Ce.LEFT||p===Ce.RIGHT;return(p===Ce.TOP||p===Ce.BOTTOM)&&(r&&(t.height-=s.height),I&&(t.height-=i.height)),S&&(r&&(t.width-=s.width),I&&(t.width-=i.width)),{height:t.height/e,width:t.width/e,top:-this.workspace_.scrollY/e,left:-this.workspace_.scrollX/e}}getContentMetrics(e){e=e?1:this.workspace_.scale;const t=this.workspace_.getBlocksBoundingBox();return{height:(t.bottom-t.top)*e,width:(t.right-t.left)*e,top:t.top*e,left:t.left*e}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(e){if(!this.hasFixedEdges())return{};const t=this.workspace_.isMovableHorizontally(),s=this.workspace_.isMovableVertically();e=e||this.getViewMetrics(!1);const i={};return s||(i.top=e.top,i.bottom=e.top+e.height),t||(i.left=e.left,i.right=e.left+e.width),i}getPaddedContent_(e,t){const s=t.top+t.height,i=t.left+t.width,r=e.width;e=e.height;const p=r/2,I=e/2;return{top:Math.min(t.top-I,s-e),bottom:Math.max(s+I,t.top+e),left:Math.min(t.left-p,i-r),right:Math.max(i+p,t.left+r)}}getScrollMetrics(e,t,s){e=e?this.workspace_.scale:1,t=t||this.getViewMetrics(!1);var i=s||this.getContentMetrics();s=this.getComputedFixedEdges_(t),t=this.getPaddedContent_(t,i),i=s.top!==void 0?s.top:t.top;const r=s.left!==void 0?s.left:t.left;return{top:i/e,left:r/e,width:((s.right!==void 0?s.right:t.right)-r)/e,height:((s.bottom!==void 0?s.bottom:t.bottom)-i)/e}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const e=this.getToolboxMetrics(),t=this.getFlyoutMetrics(!0),s=this.getSvgMetrics(),i=this.getAbsoluteMetrics(),r=this.getViewMetrics(),p=this.getContentMetrics(),I=this.getScrollMetrics(!1,r,p);return{contentHeight:p.height,contentWidth:p.width,contentTop:p.top,contentLeft:p.left,scrollHeight:I.height,scrollWidth:I.width,scrollTop:I.top,scrollLeft:I.left,viewHeight:r.height,viewWidth:r.width,viewTop:r.top,viewLeft:r.left,absoluteTop:i.top,absoluteLeft:i.left,svgHeight:s.height,svgWidth:s.width,toolboxWidth:e.width,toolboxHeight:e.height,toolboxPosition:e.position,flyoutWidth:t.width,flyoutHeight:t.height}}};c(ee.METRICS_MANAGER,Ps,md),"Blockly"in globalThis||(globalThis.Blockly={Msg:CT});var Lg=class extends fc{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(e){super.setFontConstants_(e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(e){super.setDynamicProperties_(e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const t=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=t&&!isNaN(t)?t:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&$(this.selectedGlowFilter),this.replacementGlowFilter&&$(this.replacementGlowFilter)}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,s=Qt("c",[Oe(25,-e),Oe(71,-e),Oe(t,0)]);return{height:e,width:t,path:s}}makeHexagonal(){function e(s,i,r){var p=s/2;return p=p>t?t:p,r=r?-1:1,s=(i?-1:1)*s/2,ws(-r*p,s)+ws(r*p,s)}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(s){return s/=2,s>t?t:s},height(s){return s},connectionOffsetY(s){return s/2},connectionOffsetX(s){return-s},pathDown(s){return e(s,!1,!1)},pathUp(s){return e(s,!0,!1)},pathRightDown(s){return e(s,!1,!0)},pathRightUp(s){return e(s,!1,!0)}}}makeRounded(){function e(i,r,p){const I=i>s?i-s:0;i=(i>s?s:i)/2;const S=p===r?"0":"1";return mt("a","0 0,"+S,i,Oe((p?1:-1)*i,(r?-1:1)*i))+ge("v",(r?-1:1)*I)+mt("a","0 0,"+S,i,Oe((p?-1:1)*i,(r?-1:1)*i))}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,s=2*t;return{type:this.SHAPES.ROUND,isDynamic:!0,width(i){return i/=2,i>t?t:i},height(i){return i},connectionOffsetY(i){return i/2},connectionOffsetX(i){return-i},pathDown(i){return e(i,!1,!1)},pathUp(i){return e(i,!0,!1)},pathRightDown(i){return e(i,!1,!0)},pathRightUp(i){return e(i,!1,!0)}}}makeSquared(){function e(s,i,r){s-=2*t;const p=r===i?"0":"1";return mt("a","0 0,"+p,t,Oe((r?1:-1)*t,(i?-1:1)*t))+ge("v",(i?-1:1)*s)+mt("a","0 0,"+p,t,Oe((r?-1:1)*t,(i?-1:1)*t))}const t=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(s){return t},height(s){return s},connectionOffsetY(s){return s/2},connectionOffsetX(s){return-s},pathDown(s){return e(s,!1,!1)},pathUp(s){return e(s,!0,!1)},pathRightDown(s){return e(s,!1,!0)},pathRightUp(s){return e(s,!1,!0)}}}shapeFor(e){let t=e.getCheck();switch(!t&&e.targetConnection&&(t=e.targetConnection.getCheck()),e.type){case Te.INPUT_VALUE:case Te.OUTPUT_VALUE:if(e=e.getSourceBlock().getOutputShape(),e!==null)switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return t&&t.includes("Boolean")?this.HEXAGONAL:t&&t.includes("Number")?this.ROUNDED:(t&&t.includes("String"),this.ROUNDED);case Te.PREVIOUS_STATEMENT:case Te.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function e(_e){return Qt("c",[Oe(_e*r/2,0),Oe(_e*r*3/4,I/2),Oe(_e*r,I)])+Xi([Oe(_e*r,p)])+Qt("c",[Oe(_e*r/4,I/2),Oe(_e*r/2,I),Oe(_e*r,I)])+ge("h",_e*i)+Qt("c",[Oe(_e*r/2,0),Oe(_e*r*3/4,-(I/2)),Oe(_e*r,-I)])+Xi([Oe(_e*r,-p)])+Qt("c",[Oe(_e*r/4,-(I/2)),Oe(_e*r/2,-I),Oe(_e*r,-I)])}const t=this.NOTCH_WIDTH,s=this.NOTCH_HEIGHT,i=t/3,r=i/3,p=s/2,I=p/2,S=e(1),H=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:s,pathLeft:S,pathRight:H}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=mt("a","0 0,0",e,Oe(-e,e)),s=mt("a","0 0,1",e,Oe(-e,e)),i=mt("a","0 0,0",e,Oe(e,e)),r=mt("a","0 0,1",e,Oe(e,e));return{width:e,height:e,pathTop:t,pathBottom:i,rightWidth:e,rightHeight:e,pathTopRight:s,pathBottomRight:r}}generateSecondaryColour_(e){return Qo("#000",e,.15)||e}generateTertiaryColour_(e){return Qo("#000",e,.25)||e}createDom(e,t,s){super.createDom(e,t,s),e=A(x.DEFS,{},e),t=A(x.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),A(x.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},t),s=A(x.FECOMPONENTTRANSFER,{result:"outBlur"},t),A(x.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},s),A(x.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),A(x.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.selectedGlowFilterId=t.id,this.selectedGlowFilter=t,e=A(x.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),A(x.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),t=A(x.FECOMPONENTTRANSFER,{result:"outBlur"},e),A(x.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),A(x.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),A(x.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),A(x.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter=e}getCSS_(e){return[`${e} .blocklyText,`,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyTextInputBubble textarea {`,"font-weight: normal;","}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${e} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text,`,`${e} .blocklyNonEditableText>g>text,`,`${e} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${e} .blocklyDropdownText {`,"fill: #fff !important;","}",`${e}.blocklyWidgetDiv .goog-menuitem,`,`${e}.blocklyDropDownDiv .goog-menuitem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e}.blocklyDropDownDiv .goog-menuitem-content {`,"color: #fff;","}",`${e} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${e} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},Ag=class extends Ic{constructor(e,t){super(e,t)}draw(){const e=this.block_.pathObject;e.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),e.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(e.outputShapeType=this.info_.outputConnection.shape.type),e.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(e){if(!(0>=e.height)){if(D.isSpacer(e)){const i=e.precedesStatement;var t=e.followsStatement;if(i||t){const r=this.constants_.INSIDE_CORNERS;var s=r.rightHeight;s=e.height-(i?s:0),t=t?r.pathBottomRight:"",e=0=s||0>=t)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Be(t,s+Si.Y_PADDING),this.imageHeight=s,typeof r=="function"&&(this.clickHandler=r),e!==Qe.SKIP_SETUP&&(I?this.configure_(I):(this.flipRtl=!!p,this.altText=gt(i)||""),this.setValue(gt(e)))}configure_(e){super.configure_(e),e.flipRtl&&(this.flipRtl=e.flipRtl),e.alt&&(this.altText=gt(e.alt))}initView(){this.imageElement=A(x.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(ss,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(e){return typeof e!="string"?null:e}doValueUpdate_(e){this.value_=e,this.imageElement&&this.imageElement.setAttributeNS(ss,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(e){e!==this.altText&&(this.altText=e||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(e){this.clickHandler=e}getText_(){return this.altText}static fromJson(e){if(!e.src||!e.width||!e.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(e.src,e.width,e.height,void 0,void 0,void 0,e)}};Si.Y_PADDING=1,Ds("field_image",Si),Si.prototype.DEFAULT_VALUE="";var Ac=class extends Qe{constructor(e,t,s){super(Qe.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper_=this.onKeyDownWrapper_=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",e!==Qe.SKIP_SETUP&&(s&&this.configure_(s),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.spellcheck!==void 0&&(this.spellcheck_=e.spellcheck)}initView(){if(!this.getSourceBlock())throw new ft;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const e=this.getSourceBlock();if(!e)throw new ft;let t;return this.fullBlockClickTarget_=!((t=this.getConstants())==null||!t.FULL_BLOCK_FIELDS)&&e.isSimpleReporter()}doValueInvalid_(e,t=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,e=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&de()&&this.value_!==e&&t&&X(new($e(o.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,e,this.value_)))}doValueUpdate_(e){this.isTextValid_=this.isDirty_=!0,this.value_=e}applyColour(){const e=this.getSourceBlock();if(!e)throw new ft;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",e.style.colourTertiary)):(this.borderRect_.style.display="none",e.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let e;return(e=this.getConstants())!=null&&e.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var e=this.htmlInput_;this.isTextValid_?(oe(e,"blocklyInvalidInput"),Dt(e,vt.INVALID,!1)):(U(e,"blocklyInvalidInput"),Dt(e,vt.INVALID,!0))}if(e=this.getSourceBlock(),!e)throw new ft;this.getConstants().FULL_BLOCK_FIELDS&&e.applyColour()}setSpellcheck(e){e!==this.spellcheck_&&(this.spellcheck_=e,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(e,t=!1){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(dT||nh||sn)?this.showPromptEditor_():this.showInlineEditor_(t)}showPromptEditor_(){cl(o.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),e=>{e!==null&&this.setValue(this.getValueFromEditorText_(e)),this.onFinishEditing_(this.value_)})}showInlineEditor_(e){const t=this.getSourceBlock();if(!t)throw new ft;Rl(this,t.RTL,this.widgetDispose_.bind(this),this.workspace_),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var e=this.getSourceBlock();if(!e)throw new ft;o.setGroup$$module$build$src$core$events$utils(!0);const t=Gi();var s=this.getClickTarget_();if(!s)throw Error("A click target has not been set.");U(s,"editing"),s=document.createElement("input"),s.className="blocklyHtmlInput",s.setAttribute("spellcheck",this.spellcheck_);const i=this.workspace_.getScale();var r=this.getConstants().FIELD_TEXT_FONTSIZE*i+"pt";return t.style.fontSize=r,s.style.fontSize=r,r=Ac.BORDERRADIUS*i+"px",this.isFullBlockField()&&(r=this.getScaledBBox(),r=(r.bottom-r.top)/2+"px",e=e.getParent()?e.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary,s.style.border=1*i+"px solid "+e,t.style.borderRadius=r,t.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(t.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*i+"px")),s.style.borderRadius=r,t.appendChild(s),s.value=s.defaultValue=this.getEditorText_(this.value_),s.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(s),s}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&de()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(X(new($e(o.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),o.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var e=Gi().style;if(e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,e=this.getClickTarget_(),!e)throw Error("A click target has not been set.");oe(e,"editing")}onFinishEditing_(e){}bindInputEvents_(e){this.onKeyDownWrapper_=pe(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=pe(e,"input",this,this.onHtmlInputChange_)}unbindInputEvents_(){this.onKeyDownWrapper_&&(Ae(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(Ae(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}onHtmlInputKeyDown_(e){e.key==="Enter"?(Zo(this),ys()):e.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),Zo(this),ys()):e.key==="Tab"&&(Zo(this),ys(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange_(e){e=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&de()&&this.value_!==e&&X(new($e(si))(this.sourceBlock_,this.name||null,e,this.value_))}setEditorValue_(e,t=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(e)),this.setValue(e,t)}resizeEditor_(){var e=this.getSourceBlock();if(!e)throw new ft;const t=Gi(),s=this.getScaledBBox();t.style.width=s.right-s.left+"px",t.style.height=s.bottom-s.top+"px",e=new se(e.RTL?s.right-t.offsetWidth:s.left,s.top),t.style.left=e.x+"px",t.style.top=e.y+"px"}repositionForWindowResize(){const e=this.getSourceBlock();return e instanceof fs?(Yi(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),e)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(e){return`${e}`}getValueFromEditorText_(e){return e}};Ac.BORDERRADIUS=4;var Mc=class extends Ac{constructor(e,t,s){super(e,t,s)}doClassValidation_(e){return e===void 0?null:`${e}`}static fromJson(e){return new this(gt(e.text),void 0,e)}};Ds("field_input",Mc),Mc.prototype.DEFAULT_VALUE="";var Mg=class extends zh{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){return!!e.outputConnection}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},vc=class extends In{constructor(e,t){if(super(e,t),this.connectedBottomNextConnection=!1,this.connectedBlock){for(e=this.connectedBlock;t=e.getNextBlock();)e=t;e.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},vg=class extends Hs{constructor(e){super(e),this.width=this.height=0,this.type|=D.getType("RIGHT_CONNECTION")}},yg=class extends Qh{constructor(e){super(e)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(e){const t=(e.hat?e.hat==="cap":this.constants_.ADD_START_HATS)&&!e.outputConnection&&!e.previousConnection;return!!e.outputConnection||t}hasRightSquareCorner(e){return!!e.outputConnection&&!e.statementInputCount&&!e.nextConnection}},kg=class extends Rn{constructor(e,t){super(e,t),this.isInline=!0,this.renderer_=e,this.constants_=this.renderer_.getConstants(),this.topRow=new yg(this.constants_),this.bottomRow=new Mg(this.constants_),this.isMultiRow=!t.getInputsInline()||t.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!i.precedesStatement,D.isInputRow(p)&&p.hasStatement){p.measure();let I,S;t=p.width-((S=(I=p.getLastInput())==null?void 0:I.width)!=null?S:0)+e}else if(s&&(r===2||i)&&D.isInputRow(p)&&!p.hasStatement){i=p.xPos,s=null;for(let I=0;Is?s:this.height/2,t-s*(1-Math.sin(Math.acos((s-this.constants_.SMALL_PADDING)/s)));default:return 0}if(D.isInlineInput(e)&&e instanceof Uo){const r=e.connectedBlock;return e=r?r.pathObject.outputShapeType:e.shape.type,e==null||r&&r.outputConnection&&(r.statementInputCount||r.nextConnection)||s===i.SHAPES.HEXAGONAL&&s!==e?0:t-this.constants_.SHAPE_IN_SHAPE_PADDING[s][e]}return D.isField(e)&&e instanceof mr?s===i.SHAPES.ROUND&&e.field instanceof Mc?t-2.75*i.GRID_UNIT:t-this.constants_.SHAPE_IN_SHAPE_PADDING[s][0]:D.isIcon(e)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let i=2;i=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!I.precedesStatement;if(e?this.topRow.hasPreviousConnection:r.followsStatement){var s=p.elements[1];if(s=p.elements.length===3&&s instanceof mr&&(s.field instanceof Ii||s.field instanceof Si),!e&&s)r.height-=this.constants_.SMALL_PADDING,I.height-=this.constants_.SMALL_PADDING,p.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!t)r.height+=this.constants_.SMALL_PADDING;else if(t){for(e=!1,t=0;t{if(!i.isDeadOrDying()){o.disable$$module$build$src$core$events$utils();try{i==null||i.positionNearConnection(r,p,I),i==null||i.getSvgRoot().setAttribute("visibility","visible")}finally{o.enable$$module$build$src$core$events$utils()}}}),r}createInsertionMarker(e){const t=ts(e,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!t)throw Error(`Failed to serialize source block. ${e.toDevString()}`);e=to(t,this.workspace);for(const s of e.getDescendants(!1))s.setInsertionMarker(!0);return e.initSvg(),e.getSvgRoot().setAttribute("visibility","hidden"),e}getMatchingConnection(e,t,s){if(e=e.getConnections_(!0),t=t.getConnections_(!0),e.length!==t.length)return null;for(let i=0;i{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(Je(e,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()})),this.listeners.push(Je(s,"pointerenter",t,()=>{this.targetWorkspace.isDragging()||t.addSelect()})),this.listeners.push(Je(s,"pointerleave",t,()=>{this.targetWorkspace.isDragging()||t.removeSelect()}))}blockMouseDown(e){return t=>{const s=this.targetWorkspace.getGesture(t);s&&(s.setStartBlock(e),s.handleFlyoutStart(t,this))}}onMouseDown(e){const t=this.targetWorkspace.getGesture(e);t&&t.handleFlyoutStart(e,this)}isBlockCreatable(e){return e.isEnabled()}createBlock(e){let t=null;o.disable$$module$build$src$core$events$utils();var s=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{t=this.placeNewBlock(e)}finally{o.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),e=xr(this.targetWorkspace,s),de()){for(o.setGroup$$module$build$src$core$events$utils(!0),s=0;s-t||e<-180+t||e>180-t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.left;return this.toolboxPosition_===Ce.LEFT?new qe(-1e9,1e9,-1e9,t+e.width):new qe(-1e9,1e9,t,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;var t=this.workspace_.getTopBlocks(!1);for(let i=0,r;r=t[i];i++){var s=r.getHeightWidth().width;r.outputConnection&&(s-=this.tabWidth_),e=Math.max(e,s)}for(let i=0,r;r=this.buttons_[i];i++)e=Math.max(e,r.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=Et.scrollbarThickness,this.width_!==e){for(let i=0,r;r=t[i];i++){if(this.RTL){s=r.getRelativeToSurfaceXY().x;let p=e/this.workspace_.scale-this.MARGIN;r.outputConnection||(p-=this.tabWidth_),r.moveBy(p-s,0)}this.rectMap_.has(r)&&this.moveRectToBlock_(this.rectMap_.get(r),r)}if(this.RTL)for(let i=0,r;r=this.buttons_[i];i++)t=r.getPosition().y,r.moveTo(e/this.workspace_.scale-r.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ce.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};fd.registryName="verticalFlyout",c(ee.FLYOUTS_VERTICAL_TOOLBOX,Ps,fd);var Ug=class extends yc{constructor(e){super(e),this.horizontalLayout=!0}setMetrics_(e){if(this.isVisible()){var t=this.workspace_.getMetricsManager(),s=t.getScrollMetrics(),i=t.getViewMetrics();t=t.getAbsoluteMetrics(),typeof e.x=="number"&&(this.workspace_.scrollX=-(s.left+(s.width-i.width)*e.x)),this.workspace_.translate(this.workspace_.scrollX+t.left,this.workspace_.scrollY+t.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager();const t=e.getAbsoluteMetrics(),s=e.getViewMetrics();e=e.getToolboxMetrics();const i=this.toolboxPosition_===Ce.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?i?e.height:s.height-this.height_:i?0:s.height:i?0:s.height+t.top-this.height_}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var e=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=e.width,this.setBackgroundPath(e.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),e=this.getX();var t=this.getY();this.positionAt_(this.width_,this.height_,e,t)}}setBackgroundPath(e,t){const s=this.toolboxPosition_===Ce.TOP,i=["M 0,"+(s?0:this.CORNER_RADIUS)];s?(i.push("h",e+2*this.CORNER_RADIUS),i.push("v",t),i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),i.push("h",-e),i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),i.push("h",e),i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),i.push("v",t),i.push("h",-e-2*this.CORNER_RADIUS)),i.push("z"),this.svgBackground_.setAttribute("d",i.join(" "))}scrollToStart(){let e;(e=this.workspace_.scrollbar)==null||e.setX(this.RTL?1/0:0)}wheel_(e){var t=Z(e);if(t=t.x||t.y){const s=this.workspace_.getMetricsManager(),i=s.getScrollMetrics();t=s.getViewMetrics().left-i.left+t;let r;(r=this.workspace_.scrollbar)==null||r.setX(t),Wr(this.workspace_),ys()}e.preventDefault(),e.stopPropagation()}layout_(e,t){this.workspace_.scale=this.targetWorkspace.scale;const s=this.MARGIN;let i=s+this.tabWidth_;this.RTL&&(e=e.reverse());for(let S=0,H;H=e[S];S++)if(H.type==="block"){var r=H.block;if(r==null)continue;var p=r.getDescendants(!1);for(let st=0,Ze;Ze=p[st];st++)Ze.isInFlyout=!0;p=r.getSvgRoot();const _e=r.getHeightWidth();var I=r.outputConnection?this.tabWidth_:0;I=this.RTL?i+_e.width:i-I,r.moveBy(I,s),I=this.createRect_(r,I,s,_e,S),i+=_e.width+t[S],this.addBlockListeners_(p,r,I)}else H.type==="button"&&(r=H.button,this.initFlyoutButton_(r,i,s),i+=r.width+t[S])}isDragTowardWorkspace(e){e=Math.atan2(e.y,e.x)/Math.PI*180;const t=this.dragAngleRange_;return e<90+t&&e>90-t||e>-90-t&&e<-90+t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.top;return this.toolboxPosition_===Ce.TOP?new qe(-1e9,t+e.height,-1e9,1e9):new qe(t,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;const t=this.workspace_.getTopBlocks(!1);for(let i=0,r;r=t[i];i++)e=Math.max(e,r.getHeightWidth().height);const s=this.buttons_;for(let i=0,r;r=s[i];i++)e=Math.max(e,r.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=Et.scrollbarThickness,this.height_!==e){for(let i=0,r;r=t[i];i++)this.rectMap_.has(r)&&this.moveRectToBlock_(this.rectMap_.get(r),r);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Ce.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};c(ee.FLYOUTS_HORIZONTAL_TOOLBOX,Ps,Ug);var Ln=class extends Us{constructor(e,t,s,i,r){super(Qe.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=Ln.dropdownCreate,this.defaultVariableName=typeof e=="string"?e:"",this.size_=new Be(0,0),e!==Qe.SKIP_SETUP&&(r?this.configure_(r):this.setTypes(s,i),t&&this.setValidator(t))}configure_(e){super.configure_(e),this.setTypes(e.variableTypes,e.defaultType)}initModel(){var e=this.getSourceBlock();if(!e)throw new ft;this.variable||(e=o.getOrCreateVariablePackage$$module$build$src$core$variables(e.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(e.getId()))}shouldAddBorderRect_(){const e=this.getSourceBlock();if(!e)throw new ft;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||e.type!=="variables_get")}fromXml(e){var t=this.getSourceBlock();if(!t)throw new ft;const s=e.getAttribute("id"),i=e.textContent,r=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(t=o.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,s,i,r),r!==null&&r!==t.type)throw Error("Serialized variable type with id '"+t.getId()+"' had type "+t.type+", and does not match variable field that references it: "+ks(e)+".");this.setValue(t.getId())}toXml(e){return this.initModel(),e.id=this.variable.getId(),e.textContent=this.variable.name,this.variable.type&&e.setAttribute("variabletype",this.variable.type),e}saveState(e){var t=this.saveLegacyState(Ln);return t!==null||(this.initModel(),t={id:this.variable.getId()},e&&(t.name=this.variable.name,t.type=this.variable.type)),t}loadState(e){const t=this.getSourceBlock();if(!t)throw new ft;this.loadLegacyState(Ln,e)||(e=o.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,e.id||null,e.name,e.type||""),this.setValue(e.getId()))}setSourceBlock(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(e)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(e){if(e===null)return null;var t=this.getSourceBlock();if(!t)throw new ft;return t=o.getVariable$$module$build$src$core$variables(t.workspace,e),t?(t=t.type,this.typeIsAllowed(t)?e:(console.warn("Variable type doesn't match this field! Type was "+t),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)}doValueUpdate_(e){const t=this.getSourceBlock();if(!t)throw new ft;this.variable=o.getVariable$$module$build$src$core$variables(t.workspace,e),super.doValueUpdate_(e)}typeIsAllowed(e){const t=this.getVariableTypes();if(!t)return!0;for(let s=0;sthis.max_&&(e.max=`${this.max_}`,Dt(e,vt.VALUEMAX,this.max_)),e}static fromJson(e){return new this(e.value,void 0,void 0,void 0,void 0,e)}};Ds("field_number",Id),Id.prototype.DEFAULT_VALUE=0;var Hg=class extends Ii{constructor(e,t,s){super(String(e??""),t,s),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(e){return new this(gt(e.text),void 0,e)}};Ds("field_label_serializable",Hg);var Ni=class extends Qe{constructor(e,t,s){super(Qe.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=Ni.CHECK_CHAR,e!==Qe.SKIP_SETUP&&(s&&this.configure_(s),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.checkCharacter&&(this.checkChar=e.checkCharacter)}saveState(){const e=this.saveLegacyState(Ni);return e!==null?e:this.getValueBoolean()}initView(){super.initView();const e=this.getTextElement();U(e,"blocklyCheckbox"),e.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(e){this.checkChar=e||Ni.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(e){return e===!0||e==="TRUE"?"TRUE":e===!1||e==="FALSE"?"FALSE":null}doValueUpdate_(e){this.value_=this.convertValueToBool_(e),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool_(this.value_))}convertValueToBool_(e){return typeof e=="string"?e==="TRUE":!!e}static fromJson(e){return new this(e.checked,void 0,e)}};Ni.CHECK_CHAR="✓",Ds("field_checkbox",Ni),Ni.prototype.DEFAULT_VALUE=!1;var Gg=class{constructor(e,t){this.draggable=e,this.workspace=t,this.dragTarget=null,this.startLoc=e.getRelativeToSurfaceXY()}onDragStart(e){this.draggable.startDrag(e)}onDrag(e,t){this.moveDraggable(e,t),t=this.getRoot(this.draggable),ds(t)&&t.setDeleteStyle(this.wouldDeleteDraggable(e,t)),this.updateDragTarget(e)}updateDragTarget(e){e=this.workspace.getDragTarget(e);const t=this.getRoot(this.draggable);if(this.dragTarget!==e){let s;(s=this.dragTarget)==null||s.onDragExit(t),e==null||e.onDragEnter(t)}e==null||e.onDragOver(t),this.dragTarget=e}moveDraggable(e,t){t=this.pixelsToWorkspaceUnits(t),t=se.sum(this.startLoc,t),this.draggable.drag(t,e)}wouldDeleteDraggable(e,t){return(e=this.workspace.getDragTarget(e))&&this.workspace.getComponentManager().hasCapability(e.id,Mt.Capability.DELETE_AREA)?e.wouldDelete(t):!1}onDragEnd(e){const t=o.getGroup$$module$build$src$core$events$utils();var s=this.workspace.getDragTarget(e);const i=this.getRoot(this.draggable);if(s){let r;(r=this.dragTarget)==null||r.onDrop(i)}this.shouldReturnToStart(e,i)&&this.draggable.revertDrag(),(s=ds(i)&&this.wouldDeleteDraggable(e,i))&&this.draggable instanceof fs&&Nl(this.draggable.getRootBlock()),this.draggable.endDrag(e),s&&ds(i)&&(e=o.getGroup$$module$build$src$core$events$utils(),o.setGroup$$module$build$src$core$events$utils(t),i.dispose(),o.setGroup$$module$build$src$core$events$utils(e))}getRoot(e){return e instanceof fs?e.getRootBlock():e}shouldReturnToStart(e,t){return(e=this.workspace.getDragTarget(e))?e.shouldPreventMove(t):!1}pixelsToWorkspaceUnits(e){return e=new se(e.x/this.workspace.scale,e.y/this.workspace.scale),this.workspace.isMutator&&e.scale(1/this.workspace.options.parentWorkspace.scale),e}};c(ee.BLOCK_DRAGGER,Ps,Gg);var An={};An.BlockDragStrategy=fg,An.BubbleDragStrategy=eg,An.CommentDragStrategy=vT,An.Dragger=Gg;var Od=class extends Bs{constructor(e,t,s){super(e?e.workspace.id:void 0),this.type=ii,e&&(this.blockId=e.id,this.isStart=t,this.blocks=s)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Od),t.isStart=e.isStart,t.blockId=e.blockId,t.blocks=e.blocks,t}};c(ee.EVENT,ii,Od);var bd=class extends _i{constructor(e,t,s,i){super(e),this.type=si,this.recordUndo=!1,e&&(this.name=t,this.oldValue=s,this.newValue=i)}toJson(){const e=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return e.name=this.name,e.oldValue=this.oldValue,e.newValue=this.newValue,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new bd),t.name=e.name,t.oldValue=e.oldValue,t.newValue=e.newValue,t}isNull(){return this.oldValue===this.newValue}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(t=t.getBlockById(this.blockId),!t)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");e=e?this.newValue:this.oldValue,(t=t.getField(this.name))?t.setValue(e):console.warn("Can't set non-existent field: "+this.name)}};c(ee.EVENT,si,bd);var Rd=class extends _i{constructor(e){super(e),this.type=o.MOVE$$module$build$src$core$events$utils,e&&(e.isShadow()&&(this.recordUndo=!1),e=this.currentLocation_(),this.oldParentId=e.parentId,this.oldInputName=e.inputName,this.oldCoordinate=e.coordinate)}toJson(){const e=super.toJson();return e.oldParentId=this.oldParentId,e.oldInputName=this.oldInputName,this.oldCoordinate&&(e.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),e.newParentId=this.newParentId,e.newInputName=this.newInputName,this.newCoordinate&&(e.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(e.reason=this.reason),this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Rd),t.oldParentId=e.oldParentId,t.oldInputName=e.oldInputName,e.oldCoordinate&&(s=e.oldCoordinate.split(","),t.oldCoordinate=new se(Number(s[0]),Number(s[1]))),t.newParentId=e.newParentId,t.newInputName=e.newInputName,e.newCoordinate&&(s=e.newCoordinate.split(","),t.newCoordinate=new se(Number(s[0]),Number(s[1]))),e.reason!==void 0&&(t.reason=e.reason),e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}recordNew(){const e=this.currentLocation_();this.newParentId=e.parentId,this.newInputName=e.inputName,this.newCoordinate=e.coordinate}setReason(e){this.reason=e}currentLocation_(){var e=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var t=e.getBlockById(this.blockId);if(!t)throw Error("The block associated with the block move event could not be found");e={};const s=t.getParent();return s?(e.parentId=s.id,(t=s.getInputWithBlock(t))&&(e.inputName=t.name)):e.coordinate=t.getRelativeToSurfaceXY(),e}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&se.equals(this.oldCoordinate,this.newCoordinate)}run(e){var t=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var s=t.getBlockById(this.blockId);if(s){var i=e?this.newParentId:this.oldParentId,r=e?this.newInputName:this.oldInputName;if(e=e?this.newCoordinate:this.oldCoordinate,i){var p=t.getBlockById(i);if(!p){console.warn("Can't connect to non-existent block: "+i);return}}if(s.getParent()&&s.unplug(),e)r=s.getRelativeToSurfaceXY(),s.moveBy(e.x-r.x,e.y-r.y,this.reason);else{t=s.outputConnection,(!t||s.previousConnection&&s.previousConnection.isConnected())&&(t=s.previousConnection);let I,S;s=(S=t)==null?void 0:S.type,r?(s=p.getInput(r))&&(I=s.connection):s===Te.PREVIOUS_STATEMENT&&(I=p.nextConnection),I&&t?t.connect(I):console.warn("Can't connect to non-existent input: "+r)}}else console.warn("Can't move non-existent block: "+this.blockId)}};c(ee.EVENT,o.MOVE$$module$build$src$core$events$utils,Rd);var Sd=class extends Bs{constructor(e,t,s){super(e?e.workspace.id:void 0),this.type=xs,e&&(this.blockId=e.id,this.isOpen=t,this.bubbleType=s)}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e.bubbleType=this.bubbleType,e.blockId=this.blockId||"",e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Sd),t.isOpen=e.isOpen,t.bubbleType=e.bubbleType,t.blockId=e.blockId,t}},Nd;(function(e){e.MUTATOR="mutator",e.COMMENT="comment",e.WARNING="warning"})(Nd||(Nd={})),c(ee.EVENT,xs,Sd);var Io=class extends sr{constructor(e){super(),this.isBlank=!e,e&&(this.commentId=e.id,this.workspaceId=e.workspace.id,this.group=o.getGroup$$module$build$src$core$events$utils(),this.recordUndo=re())}toJson(){const e=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return e.commentId=this.commentId,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Io),t.commentId=e.commentId,t}static CommentCreateDeleteHelper(e,t){const s=e.getEventWorkspace_();if(t){if(!e.json)throw Error("Encountered a comment event without proper json");Fr(e.json,s)}else{if(!e.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=s.getCommentById(e.commentId))?t.dispose():console.warn("Can't delete non-existent comment: "+e.commentId)}}},Cd=class extends Io{constructor(e,t,s){super(e),this.type=tr,e&&(this.oldContents_=typeof t>"u"?"":t,this.newContents_=typeof s>"u"?"":s)}toJson(){const e=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Cd),t.oldContents_=e.oldContents,t.newContents_=e.newContents,t}isNull(){return this.oldContents_===this.newContents_}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){var s=e?this.newContents_:this.oldContents_;if(s===void 0)throw Error(e?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");t.setText(s)}else console.warn("Can't change non-existent comment: "+this.commentId)}};c(ee.EVENT,tr,Cd);var Ld=class extends Io{constructor(e){super(e),this.type=lo,e&&(this.xml=zr(e),this.json=wi(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=ks(this.xml),e.json=this.json,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Ld),t.xml=o.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}run(e){Io.CommentCreateDeleteHelper(this,e)}};c(ee.EVENT,lo,Ld);var Ad=class extends Io{constructor(e){super(e),this.type=er,e&&(this.xml=zr(e),this.json=wi(e,{addCoordinates:!0}))}run(e){Io.CommentCreateDeleteHelper(this,!e)}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=ks(this.xml),e.json=this.json,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Ad),t.xml=o.textToDom$$module$build$src$core$utils$xml(e.xml),t.json=e.json,t}};c(ee.EVENT,er,Ad);var Md=class extends Io{constructor(e){super(e),this.type=co,e&&(this.comment_=e,this.oldCoordinate_=e.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(e){this.reason=e}setOldCoordinate(e){this.oldCoordinate_=e}toJson(){const e=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return e.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new Md),s=e.oldCoordinate.split(","),t.oldCoordinate_=new se(Number(s[0]),Number(s[1])),s=e.newCoordinate.split(","),t.newCoordinate_=new se(Number(s[0]),Number(s[1])),t}isNull(){return se.equals(this.oldCoordinate_,this.newCoordinate_)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newCoordinate_:this.oldCoordinate_,!e)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");t.moveTo(e)}else console.warn("Can't move non-existent comment: "+this.commentId)}};c(ee.EVENT,co,Md);var vd=class extends Io{constructor(e,t){super(e),this.newCollapsed=t,this.type=Zr}toJson(){const e=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");return e.newCollapsed=this.newCollapsed,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new vd),t.newCollapsed=e.newCollapsed,t}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(t=t.getCommentById(this.commentId))?t.setCollapsed(e?!!this.newCollapsed:!this.newCollapsed):console.warn("Can't collapse or uncollapse non-existent comment: "+this.commentId)}};c(ee.EVENT,Zr,vd);var yd=class extends Bs{constructor(e,t,s){super(s),this.type=Qi,this.oldItem=e??void 0,this.newItem=t??void 0}toJson(){const e=super.toJson();return e.oldItem=this.oldItem,e.newItem=this.newItem,e}static fromJson(e,t,s){return t=super.fromJson(e,t,s??new yd),t.oldItem=e.oldItem,t.newItem=e.newItem,t}};c(ee.EVENT,Qi,yd);var Vg=class extends sr{constructor(e){super(),this.isBlank=!0,this.recordUndo=!1,this.type=ri,this.isBlank=!!e,e&&(this.workspaceId=e.id)}};c(ee.EVENT,ri,Vg),o.CHANGE$$module$build$src$core$events$utils,o.CREATE$$module$build$src$core$events$utils,o.DELETE$$module$build$src$core$events$utils,o.MOVE$$module$build$src$core$events$utils,o.CHANGE$$module$build$src$core$events$utils,o.CREATE$$module$build$src$core$events$utils,o.DELETE$$module$build$src$core$events$utils,o.MOVE$$module$build$src$core$events$utils,o.disable$$module$build$src$core$events$utils,o.enable$$module$build$src$core$events$utils,o.getGroup$$module$build$src$core$events$utils,o.setGroup$$module$build$src$core$events$utils,o.setRecordUndo$$module$build$src$core$events$utils;var me={};me.Abstract=sr,me.BLOCK_CHANGE=o.CHANGE$$module$build$src$core$events$utils,me.BLOCK_CREATE=o.CREATE$$module$build$src$core$events$utils,me.BLOCK_DELETE=o.DELETE$$module$build$src$core$events$utils,me.BLOCK_DRAG=ii,me.BLOCK_FIELD_INTERMEDIATE_CHANGE=si,me.BLOCK_MOVE=o.MOVE$$module$build$src$core$events$utils,me.BUBBLE_OPEN=xs,me.BUMP_EVENTS=Gl,me.BlockBase=_i,me.BlockChange=pi,me.BlockCreate=Fh,me.BlockDelete=Zh,me.BlockDrag=Od,me.BlockFieldIntermediateChange=bd,me.BlockMove=Rd,me.BubbleOpen=Sd,me.BubbleType=Nd,me.CHANGE=o.CHANGE$$module$build$src$core$events$utils,me.CLICK=no,me.COMMENT_CHANGE=tr,me.COMMENT_CREATE=lo,me.COMMENT_DELETE=er,me.COMMENT_MOVE=co,me.CREATE=o.CREATE$$module$build$src$core$events$utils,me.Click=sh,me.ClickTarget=oh,me.CommentBase=Io,me.CommentChange=Cd,me.CommentCollapse=vd,me.CommentCreate=Ld,me.CommentDelete=Ad,me.CommentMove=Md,me.DELETE=o.DELETE$$module$build$src$core$events$utils,me.FINISHED_LOADING=ri,me.FinishedLoading=Vg,me.MARKER_MOVE=Ji,me.MOVE=o.MOVE$$module$build$src$core$events$utils,me.MarkerMove=ed,me.SELECTED=Ki,me.Selected=ud,me.THEME_CHANGE=Zi,me.TOOLBOX_ITEM_SELECT=Qi,me.TRASHCAN_OPEN=qi,me.ThemeChange=Uh,me.ToolboxItemSelect=yd,me.TrashcanOpen=cd,me.UI=Ul,me.UiBase=Bs,me.VAR_CREATE=ro,me.VAR_DELETE=oi,me.VAR_RENAME=ji,me.VIEWPORT_CHANGE=Do,me.VarBase=cn,me.VarCreate=ph,me.VarDelete=rd,me.VarRename=nd,me.ViewportChange=Hh,me.clearPendingUndo=ve,me.disable=o.disable$$module$build$src$core$events$utils,me.disableOrphans=Ot,me.enable=o.enable$$module$build$src$core$events$utils,me.filter=Se,me.fire=X,me.fromJson=He,me.get=$e,me.getDescendantIds=it,me.getGroup=o.getGroup$$module$build$src$core$events$utils,me.getRecordUndo=re,me.isEnabled=de,me.setGroup=o.setGroup$$module$build$src$core$events$utils,me.setRecordUndo=o.setRecordUndo$$module$build$src$core$events$utils;var Ns={};Ns.BottomRow=Mg,Ns.ConstantProvider=Lg,Ns.Drawer=Ag,Ns.MarkerSvg=Dg,Ns.PathObject=wg,Ns.RenderInfo=kg,Ns.Renderer=Ed,Ns.RightConnectionShape=vg,Ns.StatementInput=vc,Ns.TopRow=yg,Za();var yt={};yt.registerCleanup=xa,yt.registerCollapse=Fa,yt.registerCollapseExpandBlock=Ya,yt.registerComment=Wa,yt.registerCommentCreate=Qa,yt.registerCommentDelete=Ja,yt.registerCommentDuplicate=qa,yt.registerCommentOptions=Xp,yt.registerDefaultOptions=Za,yt.registerDelete=ja,yt.registerDeleteAll=Ga,yt.registerDisable=za,yt.registerDuplicate=Va,yt.registerExpand=Ua,yt.registerHelp=Ka,yt.registerInline=Xa,yt.registerRedo=Pa,yt.registerUndo=wa;var kc={};kc.CommentView=MT,kc.RenderedWorkspaceComment=hc,kc.WorkspaceComment=ec;var Mn={};Mn.Bubble=Ye,Mn.MiniWorkspaceBubble=po,Mn.TextBubble=Wh,Mn.TextInputBubble=og;var Wg=class extends fc{constructor(){super(),this.FIELD_TEXT_BASELINE_CENTER=!1,this.DARK_PATH_OFFSET=1,this.MAX_BOTTOM_WIDTH=30,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(e){return super.getCSS_(e).concat([`${e} .blocklyInsertionMarker>.blocklyPathLight,`,`${e} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},Xg=class{constructor(e){this.inlineSteps_=this.steps_="",this.info_=e,this.RTL_=this.info_.RTL,e=e.getRenderer(),this.constants_=e.getConstants(),this.highlightConstants_=e.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}getPath(){return this.steps_+` -`+this.inlineSteps_}drawTopCorner(e){this.steps_+=nt(e.xPos,this.info_.startY);for(let t=0,s;s=e.elements[t];t++)D.isLeftSquareCorner(s)?this.steps_+=this.highlightConstants_.START_POINT:D.isLeftRoundedCorner(s)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):D.isPreviousConnection(s)?this.steps_+=this.notchPaths_.pathLeft:D.isHat(s)?this.steps_+=this.startPaths_.path(this.RTL_):D.isSpacer(s)&&s.width!==0&&(this.steps_+=ge("H",s.xPos+s.width-this.highlightOffset));this.steps_+=ge("H",e.xPos+e.width-this.highlightOffset)}drawJaggedEdge_(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+ge("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(e){const t=e.getLastInput();if(this.RTL_){const s=e.height-t.connectionHeight;this.steps_+=At(t.xPos+t.width-this.highlightOffset,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+ge("v",s)}else this.steps_+=At(t.xPos+t.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(e){const t=e.getLastInput();if(t)if(this.RTL_){const s=e.height-2*this.insideCornerPaths_.height;this.steps_+=At(t.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+ge("v",s)+this.insideCornerPaths_.pathBottom(this.RTL_)+ws(e.width-t.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=At(t.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+ws(e.width-t.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(e){const t=e.xPos+e.width-this.highlightOffset;e instanceof qh&&e.followsStatement&&(this.steps_+=ge("H",t)),this.RTL_&&(this.steps_+=ge("H",t),e.height>this.highlightOffset&&(this.steps_+=ge("V",e.yPos+e.height-this.highlightOffset)))}drawBottomRow(e){if(this.RTL_)this.steps_+=ge("V",e.baseline-this.highlightOffset);else{const t=this.info_.bottomRow.elements[0];D.isLeftSquareCorner(t)?this.steps_+=At(e.xPos+this.highlightOffset,e.baseline-this.highlightOffset):D.isLeftRoundedCorner(t)&&(this.steps_+=At(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=At(this.info_.startX,e):(this.steps_+=At(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=ge("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,D.isLeftRoundedCorner(e.elements[0])?this.steps_+=ge("V",this.outsideCornerPaths_.height):this.steps_+=ge("V",e.capline+this.highlightOffset))}drawInlineInput(e){const t=this.highlightOffset,s=e.xPos+e.connectionWidth;var i=e.centerline-e.height/2;const r=e.width-e.connectionWidth,p=i+t;this.RTL_?(i=e.connectionOffsetY-t,e=e.height-(e.connectionOffsetY+e.connectionHeight)+t,this.inlineSteps_+=At(s-t,p)+ge("v",i)+this.puzzleTabPaths_.pathDown(this.RTL_)+ge("v",e)+ge("h",r)):this.inlineSteps_+=At(e.xPos+e.width+t,p)+ge("v",e.height)+ge("h",-r)+At(s,i+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},Yg=class extends Ic{constructor(e,t){super(e,t),this.highlighter_=new Xg(t)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const e=this.block_.pathObject;e.setPath(this.outlinePath_+` -`+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(e){this.highlighter_.drawJaggedEdge_(e),super.drawJaggedEdge_(e)}drawValueInput_(e){this.highlighter_.drawValueInput(e),super.drawValueInput_(e)}drawStatementInput_(e){this.highlighter_.drawStatementInput(e),super.drawStatementInput_(e)}drawRightSideRow_(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=ge("H",e.xPos+e.width)+ge("V",e.yPos+e.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(e){this.highlighter_.drawInlineInput(e),super.drawInlineInput_(e)}positionInlineInputConnection_(e){const t=e.centerline-e.height/2;if(e.connectionModel){let s=e.xPos+e.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(s*=-1),e.connectionModel.setOffsetInBlock(s,t+e.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(e){const t=e.getLastInput();if(t!=null&&t.connectionModel){let s=e.xPos+e.statementEdge+t.notchOffset;s=this.info_.RTL?-1*s:s+this.constants_.DARK_PATH_OFFSET,t.connectionModel.setOffsetInBlock(s,e.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(e){const t=e.getLastInput();if(t&&t.connectionModel){let s=e.xPos+e.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(s*=-1),t.connectionModel.setOffsetInBlock(s,e.yPos)}}positionNextConnection_(){const e=this.info_.bottomRow;if(e.connection){const t=e.connection,s=t.xPos;t.connectionModel.setOffsetInBlock((this.info_.RTL?-s:s)+this.constants_.DARK_PATH_OFFSET/2,e.baseline+this.constants_.DARK_PATH_OFFSET)}}},zg=class{constructor(e){this.OFFSET=.5,this.constantProvider=e,this.START_POINT=nt(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,s=(1-Math.SQRT1_2)*(e+t)-t,i=nt(s,s)+mt("a","0 0,0",e,Oe(-s-t,e-s)),r=mt("a","0 0,0",e+t,Oe(e+t,e+t)),p=nt(s,-s)+mt("a","0 0,0",e+t,Oe(e-s,s+t));return{width:e+t,height:e,pathTop(I){return I?i:""},pathBottom(I){return I?r:p}}}makeOutsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,s=(1-Math.SQRT1_2)*(e-t)+t,i=nt(s,s)+mt("a","0 0,1",e-t,Oe(e-s,-s+t)),r=nt(t,e)+mt("a","0 0,1",e-t,Oe(e,-e+t)),p=-s,I=nt(s,p)+mt("a","0 0,1",e-t,Oe(-s+t,-p-e));return{height:e,topLeft(S){return S?i:r},bottomLeft(){return I}}}makePuzzleTab(){const e=this.constantProvider.TAB_WIDTH,t=this.constantProvider.TAB_HEIGHT,s=nt(-2,-t+3.4)+ws(-.45*e,-2.1),i=ge("v",2.5)+nt(.97*-e,2.5)+Qt("q",[Oe(.05*-e,10),Oe(.3*e,9.5)])+nt(.67*e,-1.9)+ge("v",2.5),r=ge("v",-1.5)+nt(-.92*e,-.5)+Qt("q",[Oe(-.19*e,-5.5),Oe(0,-11)])+nt(.92*e,1),p=nt(-5,t-.7)+ws(.46*e,-2.1);return{width:e,height:t,pathUp(I){return I?s:r},pathDown(I){return I?i:p}}}makeNotch(){return{pathLeft:ge("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:ws(5.1,2.6)+nt(-10.2,6.8)+ws(5.1,2.6),height:12,width:10.2}}makeStartHat(){const e=this.constantProvider.START_HAT.height,t=nt(25,-8.7)+Qt("c",[Oe(29.7,-6.2),Oe(57.2,-.5),Oe(75,8.7)]),s=Qt("c",[Oe(17.8,-9.2),Oe(45.3,-14.9),Oe(75,-8.7)])+At(100.5,e+.5);return{path(i){return i?t:s}}}},jg=class extends Kh{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},Kg=class extends In{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},Jg=class extends Rn{constructor(e,t){super(e,t),this.renderer_=e}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof ns||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(e,t){this.isInline&&e instanceof o.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new jg(this.constants_,e)),t.hasInlineInput=!0):e instanceof ns?(t.elements.push(new Kg(this.constants_,e)),t.hasStatement=!0):e instanceof o.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new Ec(this.constants_,e)),t.hasExternalInput=!0):(e instanceof Gs||e instanceof fo)&&(t.minHeight=Math.max(t.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),this.isInline||t.align!==null||(t.align=e.align)}addElemSpacing_(){let e=!1;for(let s=0,i;i=this.rows[s];s++)i.hasExternalInput&&(e=!0);for(let s=0,i;i=this.rows[s];s++){var t=i.elements;if(i.elements=[],i.startsWithElemSpacer()&&i.elements.push(new rs(this.constants_,this.getInRowSpacing_(null,t[0]))),t.length){for(let r=0;r>>/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; -} -`),c(ee.TOOLBOX_ITEM,Cs.registrationName,Cs);var vn=class extends Dd{constructor(e,t){super(e,t),this.cssConfig_={container:"blocklyTreeSeparator"},this.htmlDiv_=null,Object.assign(this.cssConfig_,e.cssconfig||e.cssConfig)}init(){this.createDom_()}createDom_(){const e=document.createElement("div"),t=this.cssConfig_.container;return t&&U(e,t),this.htmlDiv_=e}getDiv(){return this.htmlDiv_}dispose(){$(this.htmlDiv_)}};vn.registrationName="sep",q(` -.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; -} -`),c(ee.TOOLBOX_ITEM,vn.registrationName,vn);var Sr=class extends Cs{constructor(e,t,s){super(e,t,s),this.subcategoriesDiv_=null,this.expanded_=!1,this.toolboxItems_=[]}makeDefaultCssConfig_(){const e=super.makeDefaultCssConfig_();return e.contents="blocklyToolboxContents",e}parseContents_(e){if("custom"in e)this.flyoutItems_=e.custom;else{const t=e.contents;if(t){this.flyoutItems_=[],e=!0;for(let s=0;s>>/handdelete.cur"), auto; -} - -.blocklyToolboxGrab { - cursor: url("<<>>/handclosed.cur"), auto; - cursor: grabbing; - cursor: -webkit-grabbing; -} - -/* Category tree in Toolbox. */ -.blocklyToolboxDiv { - background-color: #ddd; - overflow-x: visible; - overflow-y: auto; - padding: 4px 0 4px 0; - position: absolute; - z-index: 70; /* so blocks go under toolbox when dragging */ - -webkit-tap-highlight-color: transparent; /* issue #1345 */ -} - -.blocklyToolboxContents { - display: flex; - flex-wrap: wrap; - flex-direction: column; -} - -.blocklyToolboxContents:focus { - outline: none; -} -`),c(ee.TOOLBOX,Ps,tm);var Xf="11.1.1",Yf=Te.INPUT_VALUE,zf=Te.OUTPUT_VALUE,jf=Te.NEXT_STATEMENT,Kf=Te.PREVIOUS_STATEMENT,Jf=Ce.TOP,qf=Ce.BOTTOM,Qf=Ce.LEFT,Zf=Ce.RIGHT;fr.prototype.newBlock=function(e,t){return new Oi(this,e,t)},Es.prototype.newBlock=function(e,t){return new fs(this,e,t)},fr.prototype.newComment=function(e){return new ec(this,e)},Es.prototype.newComment=function(e){return new hc(this,e)},Es.newTrashcan=function(e){return new Og(e)},po.prototype.newWorkspaceSvg=function(e){return new Es(e)},o.Names$$module$build$src$core$names.prototype.populateProcedures=function(e){e=yl(e),e=e[0].concat(e[1]);for(let t=0;t{this.updateType_(O)}),this.appendValueInput("TEXT").appendField(g,"TYPE"),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?c.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:c.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});var Re=Object.assign({},be,{init:function(){this.mixin(Se);var g=[[c.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[c.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(c.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),g=c.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:g}),g.setValidator(O=>{this.updateType_(O)}),this.appendDummyInput().appendField(g,"TYPE").appendField(this.newQuote_(!0)).appendField(c.fromJson$$module$build$src$core$field_registry({type:"field_input",text:""}),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?c.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:c.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});re.text_prompt=Re,re.text_count={init:function(){this.jsonInit({message0:c.Msg$$module$build$src$core$msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:c.Msg$$module$build$src$core$msg.TEXT_COUNT_TOOLTIP,helpUrl:c.Msg$$module$build$src$core$msg.TEXT_COUNT_HELPURL})}},re.text_replace={init:function(){this.jsonInit({message0:c.Msg$$module$build$src$core$msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:c.Msg$$module$build$src$core$msg.TEXT_REPLACE_TOOLTIP,helpUrl:c.Msg$$module$build$src$core$msg.TEXT_REPLACE_HELPURL})}},re.text_reverse={init:function(){this.jsonInit({message0:c.Msg$$module$build$src$core$msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:c.Msg$$module$build$src$core$msg.TEXT_REVERSE_TOOLTIP,helpUrl:c.Msg$$module$build$src$core$msg.TEXT_REVERSE_HELPURL})}};var Se={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==",QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(g){for(let O=0,M;M=this.inputList[O];O++)for(let y=0,Y;Y=M.fieldRow[y];y++)if(g===Y.name){M.insertFieldAt(y,this.newQuote_(!0)),M.insertFieldAt(y+2,this.newQuote_(!1));return}console.warn('field named "'+g+'" not found in '+this.toDevString())},newQuote_:function(g){return g=this.RTL?!g:g,c.fromJson$$module$build$src$core$field_registry({type:"field_image",src:g?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH,height:this.QUOTE_IMAGE_HEIGHT,alt:g?"“":"”"})}},ve=function(){this.mixin(Se),this.quoteField_("TEXT")},de={itemCount_:0,mutationToDom:function(){const g=c.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("items",`${this.itemCount_}`),g},domToMutation:function(g){this.itemCount_=parseInt(g.getAttribute("items"),10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(g){this.itemCount_=g.itemCount,this.updateShape_()},decompose:function(g){const O=g.newBlock("text_create_join_container");O.initSvg();let M=O.getInput("STACK").connection;for(let y=0;yc.Msg$$module$build$src$core$msg.TEXT_INDEXOF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))},He={isAt_:!1,mutationToDom:function(){const g=c.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("at",`${this.isAt_}`),g},domToMutation:function(g){g=g.getAttribute("at")!=="false",this.updateAt_(g)},updateAt_:function(g){this.removeInput("AT",!0),this.removeInput("ORDINAL",!0),g&&(this.appendValueInput("AT").setCheck("Number"),c.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(c.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)),c.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(c.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL)),this.isAt_=g}},$e=function(){this.getField("WHERE").setValidator(function(g){g=g==="FROM_START"||g==="FROM_END";const O=this.getSourceBlock();g!==O.isAt_&&O.updateAt_(g)}),this.updateAt_(!0),this.setTooltip(()=>{var g=this.getFieldValue("WHERE");let O=c.Msg$$module$build$src$core$msg.TEXT_CHARAT_TOOLTIP;return(g==="FROM_START"||g==="FROM_END")&&(g=g==="FROM_START"?c.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:c.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(O+=" "+g.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),O})};c.register$$module$build$src$core$extensions("text_indexOf_tooltip",it),c.register$$module$build$src$core$extensions("text_quotes",ve),c.registerMixin$$module$build$src$core$extensions("quote_image_mixin",Se),c.registerMutator$$module$build$src$core$extensions("text_join_mutator",de,Ue),c.registerMutator$$module$build$src$core$extensions("text_charAt_mutator",He,$e),c.defineBlocks$$module$build$src$core$common(re);var Ot={blocks:re},Pe={},at={setStatements_:function(g){this.hasStatements_!==g&&(g?(this.appendStatementInput("STACK").appendField(c.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=g)},updateParams_:function(){let g="";this.arguments_.length&&(g=c.Msg$$module$build$src$core$msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),c.disable$$module$build$src$core$events$utils();try{this.setFieldValue(g,"PARAMS")}finally{c.enable$$module$build$src$core$events$utils()}},mutationToDom:function(g){const O=c.createElement$$module$build$src$core$utils$xml("mutation");g&&O.setAttribute("name",this.getFieldValue("NAME"));for(let M=0;M","GT"],["‏≥","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),G={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}"};c.register$$module$build$src$core$extensions("logic_op_tooltip",c.buildTooltipForDropdown$$module$build$src$core$extensions("OP",G));var Z={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const g=c.createElement$$module$build$src$core$utils$xml("mutation");return this.elseifCount_&&g.setAttribute("elseif",String(this.elseifCount_)),this.elseCount_&&g.setAttribute("else","1"),g},domToMutation:function(g){this.elseifCount_=parseInt(g.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(g.getAttribute("else"),10)||0,this.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const g=Object.create(null);return this.elseifCount_&&(g.elseIfCount=this.elseifCount_),this.elseCount_&&(g.hasElse=!0),g},loadExtraState:function(g){this.elseifCount_=g.elseIfCount||0,this.elseCount_=g.hasElse?1:0,this.updateShape_()},decompose:function(g){const O=g.newBlock("controls_if_if");O.initSvg();let M=O.nextConnection;for(let y=1;y<=this.elseifCount_;y++){const Y=g.newBlock("controls_if_elseif");Y.initSvg(),M.connect(Y.previousConnection),M=Y.nextConnection}return this.elseCount_&&(g=g.newBlock("controls_if_else"),g.initSvg(),M.connect(g.previousConnection)),O},compose:function(g){g=g.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;const O=[null],M=[null];let y=null;for(;g;){if(!g.isInsertionMarker())switch(g.type){case"controls_if_elseif":this.elseifCount_++,O.push(g.valueConnection_),M.push(g.statementConnection_);break;case"controls_if_else":this.elseCount_++,y=g.statementConnection_;break;default:throw TypeError("Unknown block type: "+g.type)}g=g.getNextBlock()}this.updateShape_(),this.reconnectChildBlocks_(O,M,y)},saveConnections:function(g){g=g.nextConnection.targetBlock();let O=1;for(;g;){if(!g.isInsertionMarker())switch(g.type){case"controls_if_elseif":var M=this.getInput("IF"+O);const y=this.getInput("DO"+O);g.valueConnection_=M&&M.connection.targetConnection,g.statementConnection_=y&&y.connection.targetConnection,O++;break;case"controls_if_else":M=this.getInput("ELSE"),g.statementConnection_=M&&M.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+g.type)}g=g.getNextBlock()}},rebuildShape_:function(){const g=[null],O=[null];let M=null;this.getInput("ELSE")&&(M=this.getInput("ELSE").connection.targetConnection);for(let y=1;this.getInput("IF"+y);y++){const Y=this.getInput("IF"+y),a=this.getInput("DO"+y);g.push(Y.connection.targetConnection),O.push(a.connection.targetConnection)}this.updateShape_(),this.reconnectChildBlocks_(g,O,M)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var g=1;this.getInput("IF"+g);g++)this.removeInput("IF"+g),this.removeInput("DO"+g);for(g=1;g<=this.elseifCount_;g++)this.appendValueInput("IF"+g).setCheck("Boolean").appendField(c.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+g).appendField(c.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(c.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(g,O,M){for(let y=1;y<=this.elseifCount_;y++){let Y;(Y=g[y])==null||Y.reconnect(this,"IF"+y);let a;(a=O[y])==null||a.reconnect(this,"DO"+y)}M==null||M.reconnect(this,"ELSE")}};c.registerMutator$$module$build$src$core$extensions("controls_if_mutator",Z,null,["controls_if_elseif","controls_if_else"]);var z=function(){this.setTooltip((function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return c.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return c.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return c.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_4}else return c.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_1;return""}).bind(this))};c.register$$module$build$src$core$extensions("controls_if_tooltip",z);var q={onchange:function(g){this.prevBlocks_||(this.prevBlocks_=[null,null]);var O=this.getInputTargetBlock("A");const M=this.getInputTargetBlock("B");O&&M&&!this.workspace.connectionChecker.doTypeChecks(O.outputConnection,M.outputConnection)&&(c.setGroup$$module$build$src$core$events$utils(g.group),g=this.prevBlocks_[0],g!==O&&(O.unplug(),!g||g.isDisposed()||g.isShadow()||this.getInput("A").connection.connect(g.outputConnection)),O=this.prevBlocks_[1],O!==M&&(M.unplug(),!O||O.isDisposed()||O.isShadow()||this.getInput("B").connection.connect(O.outputConnection)),this.bumpNeighbours(),c.setGroup$$module$build$src$core$events$utils(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}},ie=function(){this.mixin(q)};c.register$$module$build$src$core$extensions("logic_compare",ie);var A={prevParentConnection_:null,onchange:function(g){const O=this.getInputTargetBlock("THEN"),M=this.getInputTargetBlock("ELSE"),y=this.outputConnection.targetConnection;if((O||M)&&y)for(let Y=0;2>Y;Y++){const a=Y===1?O:M;a&&!a.workspace.connectionChecker.doTypeChecks(a.outputConnection,y)&&(c.setGroup$$module$build$src$core$events$utils(g.group),y===this.prevParentConnection_?(this.unplug(),y.getSourceBlock().bumpNeighbours()):(a.unplug(),a.bumpNeighbours()),c.setGroup$$module$build$src$core$events$utils(!1))}this.prevParentConnection_=y}};c.registerMixin$$module$build$src$core$extensions("logic_ternary",A),c.defineBlocks$$module$build$src$core$common(v);var U={blocks:v},K=c.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{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}"}]),oe={init:function(){this.setHelpUrl(c.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_HELPURL),this.setStyle("list_blocks"),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new c.MutatorIcon$$module$build$src$core$icons$mutator_icon(["lists_create_with_item"],this)),this.setTooltip(c.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){const g=c.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("items",String(this.itemCount_)),g},domToMutation:function(g){if(g=g.getAttribute("items"),!g)throw new TypeError("element did not have items");this.itemCount_=parseInt(g,10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(g){this.itemCount_=g.itemCount,this.updateShape_()},decompose:function(g){const O=g.newBlock("lists_create_with_container");O.initSvg();let M=O.getInput("STACK").connection;for(let y=0;yc.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))}};K.lists_indexOf=L;var le={init:function(){var g=[[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET,"GET"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_HELPURL),this.setStyle("list_blocks"),g=c.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:g}),g.setValidator(function(O){O=O==="REMOVE",this.getSourceBlock().updateStatement_(O)}),this.appendValueInput("VALUE").setCheck("Array").appendField(c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(g,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0),this.setTooltip(()=>{const O=this.getFieldValue("MODE"),M=this.getFieldValue("WHERE");let y="";switch(O+" "+M){case"GET FROM_START":case"GET FROM_END":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET FIRST":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case"GET LAST":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case"GET RANDOM":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE FIRST":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case"GET_REMOVE LAST":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case"GET_REMOVE RANDOM":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case"REMOVE FROM_START":case"REMOVE FROM_END":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case"REMOVE FIRST":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case"REMOVE LAST":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case"REMOVE RANDOM":y=c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}return(M==="FROM_START"||M==="FROM_END")&&(y+=" "+(M==="FROM_START"?c.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:c.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),y})},mutationToDom:function(){const g=c.createElement$$module$build$src$core$utils$xml("mutation");g.setAttribute("statement",String(!this.outputConnection));const O=this.getInput("AT")instanceof c.ValueInput$$module$build$src$core$inputs$value_input;return g.setAttribute("at",String(O)),g},domToMutation:function(g){const O=g.getAttribute("statement")==="true";this.updateStatement_(O),g=g.getAttribute("at")!=="false",this.updateAt_(g)},saveExtraState:function(){return this.outputConnection?null:{isStatement:!0}},loadExtraState:function(g){g.isStatement?this.updateStatement_(!0):typeof g=="string"&&this.domToMutation(c.textToDom$$module$build$src$core$utils$xml(g))},updateStatement_:function(g){g!==!this.outputConnection&&(this.unplug(!0,!0),g?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(g){this.removeInput("AT"),this.removeInput("ORDINAL",!0),g?(this.appendValueInput("AT").setCheck("Number"),c.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(c.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const O=c.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});O.setValidator(function(M){const y=M==="FROM_START"||M==="FROM_END";if(y!==g){const Y=this.getSourceBlock();return Y.updateAt_(y),Y.setFieldValue(M,"WHERE"),null}}),this.getInput("AT").appendField(O,"WHERE"),c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};K.lists_getIndex=le;var ce={init:function(){var g=[[c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_SET,"SET"],[c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[c.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_IN_LIST),g=c.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:g}),this.appendDummyInput().appendField(g,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0),this.setTooltip(()=>{const O=this.getFieldValue("MODE"),M=this.getFieldValue("WHERE");let y="";switch(O+" "+M){case"SET FROM_START":case"SET FROM_END":y=c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case"SET FIRST":y=c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case"SET LAST":y=c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case"SET RANDOM":y=c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case"INSERT FROM_START":case"INSERT FROM_END":y=c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case"INSERT FIRST":y=c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case"INSERT LAST":y=c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case"INSERT RANDOM":y=c.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}return(M==="FROM_START"||M==="FROM_END")&&(y+=" "+c.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),y})},mutationToDom:function(){const g=c.createElement$$module$build$src$core$utils$xml("mutation"),O=this.getInput("AT")instanceof c.ValueInput$$module$build$src$core$inputs$value_input;return g.setAttribute("at",String(O)),g},domToMutation:function(g){g=g.getAttribute("at")!=="false",this.updateAt_(g)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(g){this.removeInput("AT"),this.removeInput("ORDINAL",!0),g?(this.appendValueInput("AT").setCheck("Number"),c.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(c.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const O=c.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});O.setValidator(function(M){const y=M==="FROM_START"||M==="FROM_END";if(y!==g){const Y=this.getSourceBlock();return Y.updateAt_(y),Y.setFieldValue(M,"WHERE"),null}}),this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO"),this.getInput("AT").appendField(O,"WHERE")}};K.lists_setIndex=ce;var ue={init:function(){this.WHERE_OPTIONS_1=[[c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_INPUT_IN_LIST),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const g=c.createElement$$module$build$src$core$utils$xml("mutation");var O=this.getInput("AT1")instanceof c.ValueInput$$module$build$src$core$inputs$value_input;return g.setAttribute("at1",String(O)),O=this.getInput("AT2")instanceof c.ValueInput$$module$build$src$core$inputs$value_input,g.setAttribute("at2",String(O)),g},domToMutation:function(g){const O=g.getAttribute("at1")==="true";g=g.getAttribute("at2")==="true",this.updateAt_(1,O),this.updateAt_(2,g)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(g,O){this.removeInput("AT"+g),this.removeInput("ORDINAL"+g,!0),O?(this.appendValueInput("AT"+g).setCheck("Number"),c.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+g).appendField(c.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+g);const M=c.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+g]});M.setValidator(function(y){const Y=y==="FROM_START"||y==="FROM_END";if(Y!==O){const a=this.getSourceBlock();return a.updateAt_(g,Y),a.setFieldValue(y,"WHERE"+g),null}}),this.getInput("AT"+g).appendField(M,"WHERE"+g),g===1&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2")),c.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};K.lists_getSublist=ue,K.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}},K.lists_split={init:function(){const g=c.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:[[c.Msg$$module$build$src$core$msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[c.Msg$$module$build$src$core$msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]]});if(!g)throw Error("field_dropdown not found");g.setValidator(O=>{this.updateType_(O)}),this.setHelpUrl(c.Msg$$module$build$src$core$msg.LISTS_SPLIT_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("INPUT").setCheck("String").appendField(g,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(c.Msg$$module$build$src$core$msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(()=>{const O=this.getFieldValue("MODE");if(O==="SPLIT")return c.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(O==="JOIN")return c.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+O)})},updateType_:function(g){if(this.getFieldValue("MODE")!==g){const O=this.getInput("INPUT").connection;O.setShadowDom(null);const M=O.targetBlock();M&&(O.disconnect(),M.isShadow()?M.dispose(!1):this.bumpNeighbours())}g==="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const g=c.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("mode",this.getFieldValue("MODE")),g},domToMutation:function(g){this.updateType_(g.getAttribute("mode"))},saveExtraState:function(){return null},loadExtraState:function(){}},c.defineBlocks$$module$build$src$core$common(K);var he={blocks:K},Ie=Object.assign({},K,v,je,ze,Pe,re,F,m),Ee={blocks:Ie,lists:he,logic:U,loops:C,math:ct,procedures:Le,texts:Ot,variables:ae,variablesDynamic:k};return Ee.__namespace__=c,Ee})}(Jd)),Jd.exports}(function(n,h){(function(o,c){n.exports=c(Co(),Pb(),xb())})(hs,function(o,c,m){return o.setLocale(c),o})})(WE);var Bb=WE.exports;const Fb=VE(Bb),{ASTNode:ty,BasicCursor:sy,Block:oy,BlockSvg:iy,Blocks:ry,COLLAPSED_FIELD_NAME:ny,COLLAPSED_INPUT_NAME:ly,COLLAPSE_CHARS:cy,CodeGenerator:uy,CollapsibleToolboxCategory:ay,ComponentManager:hy,Connection:dy,ConnectionChecker:$y,ConnectionDB:_y,ConnectionType:py,ContextMenu:Ty,ContextMenuItems:gy,ContextMenuRegistry:my,Css:Ey,Cursor:fy,DELETE_VARIABLE_ID:Iy,DeleteArea:Oy,DragTarget:by,DropDownDiv:Ry,Events:Sy,Extensions:Ny,Field:Cy,FieldCheckbox:Ly,FieldDropdown:wn,FieldImage:Pn,FieldLabel:Ay,FieldLabelSerializable:My,FieldNumber:Hm,FieldTextInput:Ub,FieldVariable:vy,Flyout:yy,FlyoutButton:ky,FlyoutMetricsManager:Dy,Generator:wy,Gesture:Py,Grid:xy,HorizontalFlyout:By,INPUT_VALUE:Fy,Input:Uy,InsertionMarkerManager:Hy,InsertionMarkerPreviewer:Gy,Marker:Vy,MarkerManager:Wy,Menu:Xy,MenuItem:Yy,MetricsManager:zy,Msg:jy,NEXT_STATEMENT:Ky,Names:Jy,OPPOSITE_TYPE:qy,OUTPUT_VALUE:Qy,Options:Zy,PREVIOUS_STATEMENT:ek,PROCEDURE_CATEGORY_NAME:tk,Procedures:sk,RENAME_VARIABLE_ID:ok,RenderedConnection:ik,Scrollbar:rk,ScrollbarPair:nk,ShortcutItems:lk,ShortcutRegistry:ck,TOOLBOX_AT_BOTTOM:uk,TOOLBOX_AT_LEFT:ak,TOOLBOX_AT_RIGHT:hk,TOOLBOX_AT_TOP:dk,TabNavigateCursor:$k,Theme:_k,ThemeManager:pk,Themes:Tk,Toolbox:gk,ToolboxCategory:mk,ToolboxItem:Ek,ToolboxSeparator:fk,Tooltip:Ik,Touch:Ok,Trashcan:bk,UnattachedFieldError:Rk,VARIABLE_CATEGORY_NAME:Sk,VARIABLE_DYNAMIC_CATEGORY_NAME:Nk,VERSION:Ck,VariableMap:Lk,VariableModel:Ak,Variables:Mk,VariablesDynamic:vk,VerticalFlyout:yk,WidgetDiv:kk,Workspace:Dk,WorkspaceAudio:wk,WorkspaceDragger:Pk,WorkspaceSvg:xk,Xml:Hb,ZoomControls:Bk,blockAnimations:Fk,blockRendering:Uk,browserEvents:Hk,bubbles:Gk,bumpObjects:Vk,clipboard:Wk,comments:Xk,common:xn,config:Yk,constants:zk,defineBlocksWithJsonArray:jk,dialog:Kk,dragging:Jk,fieldRegistry:qk,geras:Qk,getMainWorkspace:Zk,getSelected:eD,hasBubble:tD,hideChaff:sD,icons:oD,inject:Gb,inputs:Gm,isCopyable:iD,isDeletable:rD,isDraggable:nD,isIcon:lD,isObservable:cD,isPaster:uD,isRenderedElement:aD,isSelectable:hD,isSerializable:dD,isVariableBackedParameterModel:$D,procedures:_D,registry:pD,renderManagement:TD,serialization:gD,setLocale:Vb,setParentContainer:mD,svgResize:ED,thrasos:fD,uiPosition:ID,utils:qd,zelos:OD}=Fb;var Q=Co();/** - * @license - * Copyright 2020 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */class Wb extends Q.ToolboxCategory{constructor(h,o){super(h,o)}createLabelDom_(h){const o=document.createElement("div");return o.setAttribute("id",this.getId()+".label"),o.textContent=h,o.classList.add(this.cssConfig_.label),o}createIconDom_(){const h=document.createElement("div");return h.classList.add("categoryBubble"),h.style.backgroundColor=this.colour_,h}addColourBorder_(){}setSelected(h){h?(this.rowDiv_.style.backgroundColor="gray",Q.utils.dom.addClass(this.rowDiv_,this.cssConfig_.selected)):(this.rowDiv_.style.backgroundColor="",Q.utils.dom.removeClass(this.rowDiv_,this.cssConfig_.selected)),Q.utils.aria.setState(this.htmlDiv_,Q.utils.aria.State.SELECTED,h)}}Q.registry.register(Q.registry.Type.TOOLBOX_ITEM,Q.ToolboxCategory.registrationName,Wb,!0);/** - * @license - * Copyright 2020 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */class Xb extends Q.Toolbox{constructor(h){super(h)}init(){super.init();const h=this.getFlyout();h.show(this.getInitialFlyoutContents_()),h.recordScrollPositions(),this.workspace_.addChangeListener(o=>{(o.type===Q.Events.BLOCK_CREATE||o.type===Q.Events.BLOCK_DELETE)&&this.refreshSelection()})}getFlyout(){return super.getFlyout()}getInitialFlyoutContents_(){let h=[];for(const o of this.contents_)if(o instanceof Q.ToolboxCategory){h.push({kind:"LABEL",text:o.getName()});let c=o.getContents();typeof c=="string"&&(c={custom:c,kind:"CATEGORY"}),h=h.concat(c)}return h}refreshSelection(){this.getFlyout().show(this.getInitialFlyoutContents_())}updateFlyout_(h,o){if(o){const c=this.getFlyout().getCategoryScrollPosition(o.name_).y;this.getFlyout().scrollTo(c)}}shouldDeselectItem_(h,o){return h&&h!==o}getCategoryByName(h){const o=this.contents_.find(c=>c instanceof Q.ToolboxCategory&&c.isSelectable()&&h===c.getName());return o||null}selectCategoryByName(h){const o=this.getCategoryByName(h);if(!o)return;const c=this.selectedItem_;this.shouldDeselectItem_(c,o)&&this.deselectItem_(c),this.shouldSelectItem_(c,o)&&this.selectItem_(c,o)}getClientRect(){const h=this.getFlyout();return h&&!h.autoClose?h.getClientRect():super.getClientRect()}}Q.Css.register(` -.categoryBubble { - margin: 0 auto 0.125rem; - border-radius: 100%; - border: 1px solid; - width: 1.25rem; - height: 1.25rem; -} -.blocklyTreeRow { - height: initial; - padding: 3px 0; -} -.blocklyTreeRowContentContainer { - display: flex; - flex-direction: column; -} -.blocklyTreeLabel { - margin: auto; -} -`);/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */class Yb extends Q.FlyoutMetricsManager{constructor(h,o){super(h,o)}getScrollMetrics(h=void 0,o=void 0,c=void 0){const m=super.getScrollMetrics(h,o,c),f=c||this.getContentMetrics(h),R=o||this.getViewMetrics(h);return m&&(m.height+=this.flyout_.calculateBottomPadding(f,R)),m}}/** - * @license - * Copyright 2020 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */class zb extends Q.VerticalFlyout{constructor(h){super(h),this.scrollPositions=[],this.scrollTarget=null,this.scrollAnimationFraction=.3,this.recyclingEnabled_=!0,this.workspace_.setMetricsManager(new Yb(this.workspace_,this)),this.workspace_.addChangeListener(o=>{o.type===Q.Events.VIEWPORT_CHANGE&&this.selectCategoryByScrollPosition_(-this.workspace_.scrollY)}),this.autoClose=!1}getParentToolbox_(){return this.targetWorkspace.getToolbox()}recordScrollPositions(){this.scrollPositions=[];const h=this.buttons_.filter(o=>o.isLabel()&&this.getParentToolbox_().getCategoryByName(o.getButtonText()));for(const[o,c]of h.entries())if(c.isLabel()){const m=c.getPosition(),f=new Q.utils.Coordinate(m.x,m.y-this.labelGaps[o]);this.scrollPositions.push({name:c.getButtonText(),position:f})}}getCategoryScrollPosition(h){for(const o of this.scrollPositions)if(o.name===h)return o.position;return console.warn(`Scroll position not recorded for category ${h}`),null}selectCategoryByScrollPosition_(h){if(this.scrollTarget!==null)return;const o=Math.round(h/this.workspace_.scale);for(let c=this.scrollPositions.length-1;c>=0;c--){const m=this.scrollPositions[c];if(o>=m.position.y){this.getParentToolbox_().selectCategoryByName(m.name);return}}}scrollTo(h){const o=this.workspace_.getMetrics();this.scrollTarget=Math.min(h*this.workspace_.scale,o.scrollHeight-o.viewHeight),this.stepScrollAnimation_()}stepScrollAnimation_(){if(this.scrollTarget===null)return;const h=-this.workspace_.scrollY,o=this.scrollTarget-h;if(Math.abs(o)<1){this.workspace_.scrollbar.setY(this.scrollTarget),this.scrollTarget=null;return}this.workspace_.scrollbar.setY(h+o*this.scrollAnimationFraction),requestAnimationFrame(this.stepScrollAnimation_.bind(this))}calculateBottomPadding(h,o){if(this.scrollPositions.length>0){const m=this.scrollPositions[this.scrollPositions.length-1].position.y*this.workspace_.scale,f=h.height-m;if(f{if(X.target.className.includes("selected")){X.target.parentElement.className=X.target.parentElement.className.replace(" sensor-port-pair--selected",""),X.target.style.color="#000000",X.target.className=X.target.className.replace(" selected","");const be=this.checkList.findIndex(Re=>Re===X.target.attributes["data-testid"].value);console.log(be),be>-1&&this.checkList.splice(be,1)}else X.target.parentElement.className+=" sensor-port-pair--selected",X.target.style.color=this.sourceBlock_.getColour(),X.target.className+=" selected",this.textContent_.nodeValue=X.target.attributes["data-testid"].value,this.checkList.push(X.target.attributes["data-testid"].value);console.log(this.checkList),this.checkList.length===2?(re.parentElement.className+=" sensor-port-pair--selected",re.style.color=this.sourceBlock_.getColour(),re.className+=" selected",this.textContent_.nodeValue="A + B"):(re.parentElement.className=re.parentElement.className.replace(" sensor-port-pair--selected",""),re.style.color="#000000",re.className=re.className.replace(" selected",""),this.textContent_.nodeValue=this.checkList[0])},c=document.createElement("div");c.className="customFieldsTurtleWidget blocklyNonSelectable";const m=document.createElement("div");m.className="lls-port-selector__hub-wrapper",c.appendChild(m);const f=document.createElement("div");f.className="lls-port-selector__hub",m.appendChild(f);const R=document.createElement("div");R.className="lls-port-selector__sensors lls-port-selector__sensors--left";const N=document.createElement("div");N.className="sensor-port-pair sensor-port-pair--dimmed",R.appendChild(N),f.appendChild(R);const k=document.createElement("div");k.className="button sensor-port-pair__port-button",k.textContent="A",k.setAttribute("data-testid","A"),k.addEventListener("click",o),N.appendChild(k);const F=document.createElement("div");F.className="lls-port-selector__sensors lls-port-selector__sensors--right";const w=document.createElement("div");w.className="sensor-port-pair sensor-port-pair--dimmed",F.appendChild(w);const P=document.createElement("div");P.className="button sensor-port-pair__port-button",P.textContent="B",P.setAttribute("data-testid","B"),P.addEventListener("click",o),w.appendChild(P),f.appendChild(F);const W=(X,be,Re)=>{X.target.className.includes("selected")?(X.target.parentElement.className=X.target.parentElement.className.replace(" sensor-port-pair--selected",""),X.target.style.color="#000000",X.target.className=X.target.className.replace(" selected",""),be.parentElement.className=be.parentElement.className.replace(" sensor-port-pair--selected",""),be.style.color="#000000",be.className=be.className.replace(" selected",""),Re.parentElement.className=Re.parentElement.className.replace(" sensor-port-pair--selected",""),Re.style.color="#000000",Re.className=Re.className.replace(" selected",""),this.checkList=[],this.textContent_.nodeValue="A"):(X.target.parentElement.className+=" sensor-port-pair--selected",X.target.style.color=this.sourceBlock_.getColour(),X.target.className+=" selected",this.textContent_.nodeValue="A + B",be.parentElement.className+=" sensor-port-pair--selected",be.style.color=this.sourceBlock_.getColour(),be.className+=" selected",Re.parentElement.className+=" sensor-port-pair--selected",Re.style.color=this.sourceBlock_.getColour(),Re.className+=" selected",this.checkList=["A","B"])},ae=document.createElement("div");ae.className="lls-port-selector__multiple-actions";const re=document.createElement("div");return re.className="button lls-port-selector__button-all",re.textContent="所有",re.setAttribute("data-testid","all"),re.addEventListener("click",X=>W(X,k,P)),ae.appendChild(re),c.appendChild(ae),c}dropdownDispose_(){for(const o of this.boundEvents_)Q.browserEvents.unbind(o);this.boundEvents_.length=0}applyColour(){this.sourceBlock_}createView_(){this.movableGroup_=Q.utils.dom.createSvgElement("g",{transform:"translate(0,5)"},this.fieldGroup_),this.defs_=Q.utils.dom.createSvgElement("defs",{},this.fieldGroup_),this.movableGroup_.appendChild(this.textElement_),this.textElement_.setAttribute("transform","translate("+this.TEXT_OFFSET_X+",15)")}}Q.fieldRegistry.register("field_turtle",YE);Q.Css.register(` - .customFieldsTurtleWidget { - height: 287px; - width: 290px; - } - .lls-port-selector__hub-wrapper { - padding-bottom: 52px; - display: flex; - justify-content: space-evenly; - } - .lls-port-selector__hub { - position: relative; - margin-top: 34px; - height: 144px; - width: 186px; - border: 2px solid #000; - border-radius: 5px; - box-sizing: content-box; - overflow: hidden; - } - .lls-port-selector__hub::after { - content: ""; - border: 2px solid #000; - position: absolute; - top: 15px; - height: 30px; - width: 30px; - left: 78px; - border-radius: 4px; - opacity: .6; - } - .sensor-port-pair { - display: flex; - flex-direction: column; - width: initial; - height: 72px; - justify-content: space-between; - align-items: center; - border-color: #000; - } - .sensor-port-pair--dimmed { - opacity: .6; - } - .sensor-port-pair--selected { - opacity: 1; - } - .button { - cursor: pointer; - color: #000; - border-style: solid; - border-color: #000; - border-width: 2px; - border-radius: 5px; - text-transform: uppercase; - text-align: center; - font-size: 16px; - line-height: 20px; - letter-spacing: -0.6px; - font-weight: 700; - } - .selected { - background: #000; - } - .sensor-port-pair__port-button { - display: flex; - justify-content: center; - border: #000; - border-style: solid; - border-radius: 2px; - border-width: 2px; - vertical-align: middle; - text-align: center; - align-items: center; - font-size: 16px; - line-height: 20px; - letter-spacing: -0.6px; - font-weight: 700; - width: 40px; - height: 33px; - line-height: 29px; - border-top-left-radius: 2px; - border-top-right-radius: 2px; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - } - .lls-port-selector__sensors--left { - left: 6px; - } - .lls-port-selector__sensors { - height: initial; - top: initial; - bottom: -41px; - width: 72px; - position: absolute; - display: flex; - flex-direction: column; - justify-content: space-between; -} - .lls-port-selector__sensors--right { - right: 6px; - left: initial; - } - .lls-port-selector__multiple-actions { - display: flex; - justify-content: center; - } - .lls-port-selector__multiple-actions .button { - line-height: 27px; - font-size: 14px; - line-height: 18px; - letter-spacing: -0.5px; - font-weight: 700; - min-width: 76px; - margin: 0 5px; - padding: 0 5px; -} - .lls-port-selector__button-all { - - } -`);/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */Q.Msg.BUTTON_LABEL_RANDOMIZE="Randomize";Q.Msg.BUTTON_LABEL_CLEAR="Clear";const jb=5,Kb=5,Yn=15,Jb={randomize:!0,clear:!0},Vc=["#d42da3","#b466e9","#3f8eee","#94e5fc","#5cc863","#4ba551","#fae475","#f0af3d","#ea3327","#ffffff","#5020b9"],qb={empty:"#fff",filled:Vc[0]};class zE extends Q.Field{constructor(o,c,m){super(o,c,m);et(this,"initialValue",null);et(this,"imgHeight");et(this,"imgWidth");et(this,"boundEvents",[]);et(this,"editorPixels",null);et(this,"blockDisplayPixels",null);et(this,"mouseIsDown",!1);et(this,"valToPaintWith");et(this,"buttonOptions");et(this,"pixelSize");et(this,"pixelColours");et(this,"fieldHeight");et(this,"selectPixels",null);this.value_=o,this.SERIALIZABLE=!0,this.CURSOR="default",this.buttonOptions={...Jb,...m==null?void 0:m.buttons},this.pixelColours={...qb,...m==null?void 0:m.colours};const f=this.getValue();f!==null?(this.imgHeight=f.length,this.imgWidth=f[0].length||0):(this.imgHeight=(m==null?void 0:m.height)??jb,this.imgWidth=(m==null?void 0:m.width)??Kb,this.setValue(this.getEmptyArray())),this.fieldHeight=m==null?void 0:m.fieldHeight,this.fieldHeight?this.pixelSize=this.fieldHeight/this.imgHeight:this.pixelSize=Yn}static fromJson(o){return new this(o.value??Q.Field.SKIP_SETUP,void 0,o)}getImageWidth(){return this.imgWidth}getImageHeight(){return this.imgHeight}doClassValidation_(o){return o}doValueUpdate_(o){super.doValueUpdate_(o),o&&(this.imgHeight=o.length,this.imgWidth=o[0]?o[0].length:0,this.fieldHeight?this.pixelSize=this.fieldHeight/this.imgHeight:this.pixelSize=Yn)}showEditor_(o){const c=this.dropdownCreate(),m=this.getColours();m&&m.border&&Q.DropDownDiv.setColour(m.primary,m.border),Q.DropDownDiv.getContentDiv().appendChild(c),Q.DropDownDiv.showPositionedByField(this,this.dropdownDispose.bind(this))}render_(){super.render_();const o=this.getValue();o&&this.blockDisplayPixels&&this.forAllCells((c,m)=>{const f=this.getPixel(c,m);this.blockDisplayPixels&&(this.blockDisplayPixels[c][m].style.fill=f?o[c][m].color:this.pixelColours.empty),this.editorPixels&&(this.editorPixels[c][m].style.background=f?o[c][m].color:"transparent")})}updateEditable(){const o=super.updateEditable(),c=this.getSvgRoot();return c&&(Q.utils.dom.removeClass(c,"blocklyNonEditableText"),Q.utils.dom.removeClass(c,"blocklyEditableText")),o}getScaledBBox(){var c;const o=(c=this.getSvgRoot())==null?void 0:c.getBoundingClientRect();if(!o)throw new Error("Tried to retrieve a bounding box without a rect");return new Q.utils.Rect(o.top,o.bottom,o.left,o.right)}dropdownCreate(){const o=this.createElementWithClassname("div","dropdownEditor");(this.buttonOptions.randomize||this.buttonOptions.clear)&&o.classList.add("has-buttons");const c=this.createElementWithClassname("div","pixelContainer"),m=this.createElementWithClassname("div","leftContainer"),f=this.createElementWithClassname("div","rightContainer"),R=this.createElementWithClassname("div","bottomContainer"),N=this.createElementWithClassname("div","clearButton"),k=this.createElementWithClassname("div","selectButton"),F=this.createElementWithClassname("div","colorContainer");o.appendChild(m),o.appendChild(f),m.appendChild(c),m.appendChild(R),f.appendChild(F),Q.DropDownDiv.getContentDiv().classList.add("contains-bitmap-editor"),this.bindEvent(o,"mouseup",this.onMouseUp),this.bindEvent(o,"mouseleave",this.onMouseUp),this.bindEvent(o,"dragstart",P=>{P.preventDefault()}),this.editorPixels=[],this.selectPixels=[];const w=this.getValue();for(let P=0;P(this.onMouseDownInPixel(P,X),!0)),this.bindEvent(be,"mouseenter",()=>{this.onMouseEnterPixel(P,X)})}c.appendChild(W),N.appendChild(ae),k.appendChild(re)}for(let P=0;P{this.pixelColours.filled=ae.target.attributes["data-color"].value,this.blockDisplayPixels&&this.forAllCells((re,X)=>{this.selectPixels&&(this.selectPixels[re][X].style.background=this.pixelColours.filled)})})}return this.buttonOptions.clear&&this.addControlButton(R,N,this.clearPixels),this.buttonOptions.randomize&&this.addControlButton(R,k,this.randomizePixels),this.blockDisplayPixels&&this.forAllCells((P,W)=>{const ae=this.getPixel(P,W);this.editorPixels&&(this.editorPixels[P][W].style.background=ae?w[P][W].color:"transparent")}),this.initialValue=this.getValue(),console.log(this.initialValue),o}initView(){this.blockDisplayPixels=[];for(let o=0;o{this.setPixel(o,c,1)})}clearPixels(){const o=this.getEmptyArray();this.fireIntermediateChangeEvent(o),this.setValue(o,!1)}setPixel(o,c,m){const f=JSON.parse(JSON.stringify(this.getValue()));f[o][c].value=m,f[o][c].color=this.pixelColours.filled,this.fireIntermediateChangeEvent(f),this.setValue(f,!1)}getPixel(o,c){const m=this.getValue();if(!m)throw new Error("Attempted to retrieve a pixel value when no value is set");return m[o][c].value}forAllCells(o){for(let c=0;c div { - display: flex; - justify-content: center; - align-items: center; - margin: 0 5px; -} - .colorContainer { - width: 50px; - height: 100%; - border-color: rgb(87, 28, 193); - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - } - .colorButton { - flex: 1 1; - width: 100%; - cursor: pointer; - } -`);var jE={exports:{}};/*! For license information please see index.js.LICENSE.txt */(function(n,h){(function(o,c){n.exports=c(Co())})(hs,o=>(()=>{var c={370:F=>{F.exports=o}},m={};function f(F){var w=m[F];if(w!==void 0)return w.exports;var P=m[F]={exports:{}};return c[F](P,P.exports,f),P.exports}f.n=F=>{var w=F&&F.__esModule?()=>F.default:()=>F;return f.d(w,{a:w}),w},f.d=(F,w)=>{for(var P in w)f.o(w,P)&&!f.o(F,P)&&Object.defineProperty(F,P,{enumerable:!0,get:w[P]})},f.o=(F,w)=>Object.prototype.hasOwnProperty.call(F,w),f.r=F=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var R={};f.r(R),f.d(R,{FieldGridDropdown:()=>k});var N=f(370);class k extends N.FieldDropdown{constructor(w,P,W){super(w,P,W),this.columns=3,W!=null&&W.columns&&this.setColumnsInternal(W.columns),W&&W.primaryColour&&(this.primaryColour=W.primaryColour),W&&W.borderColour&&(this.borderColour=W.borderColour)}static fromJson(w){if(!w.options)throw new Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(w.options,void 0,w)}setColumns(w){this.setColumnsInternal(w),this.updateColumnsStyling_()}setColumnsInternal(w){const P=typeof w=="string"?parseInt(w):w;!isNaN(P)&&P>=1&&(this.columns=P)}showEditor_(w){var P,W;super.showEditor_(w);const ae=this.getColours();ae&&ae.border&&N.DropDownDiv.setColour(ae.primary,ae.border);const re=(W=(P=this.menu_)===null||P===void 0?void 0:P.getElement())!==null&&W!==void 0?W:null;re&&N.utils.dom.addClass(re,"fieldGridDropDownContainer"),this.updateColumnsStyling_(),N.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this))}updateColumnsStyling_(){const w=this.menu_?this.menu_.getElement():null;w&&(w.style.gridTemplateColumns=`repeat(${this.columns}, min-content)`)}getColours(){var w,P;if(this.primaryColour&&this.borderColour)return{primary:this.primaryColour,border:this.borderColour};const W=this.getSourceBlock();if(!(W instanceof N.BlockSvg))return;const ae=W.isShadow()?W.getParent():W;return ae?{primary:(w=this.primaryColour)!==null&&w!==void 0?w:ae.getColour(),border:(P=this.borderColour)!==null&&P!==void 0?P:ae.getColourTertiary()}:void 0}}return N.fieldRegistry.register("field_grid_dropdown",k),N.Css.register(` - /** Setup grid layout of DropDown */ - .fieldGridDropDownContainer.blocklyMenu { - display: grid; - grid-gap: 7px; - } - /* Change look of cells (add border, sizing, padding, and text color) */ - .fieldGridDropDownContainer.blocklyMenu .blocklyMenuItem { - border: 1px solid rgba(1, 1, 1, 0.5); - border-radius: 4px; - color: white; - min-width: auto; - padding-left: 15px; /* override padding-left now that checkmark is hidden */ - } - /* Change look of selected cell */ - .fieldGridDropDownContainer .blocklyMenuItem .blocklyMenuItemCheckbox { - display: none; /* Hide checkmark */ - } - .fieldGridDropDownContainer .blocklyMenuItem.blocklyMenuItemSelected { - background-color: rgba(1, 1, 1, 0.25); - } - /* Change look of focus/highlighted cell */ - .fieldGridDropDownContainer .blocklyMenuItem.blocklyMenuItemHighlight { - box-shadow: 0 0 0 4px hsla(0, 0%, 100%, .2); - } - .fieldGridDropDownContainer .blocklyMenuItemHighlight { - /* Uses less selectors so as to not affect blocklyMenuItemSelected */ - background-color: inherit; - } - .fieldGridDropDownContainer { - margin: 7px; /* needed for highlight */ - } - `),R})())})(jE);var Qb=jE.exports,KE={exports:{}};(function(n,h){(function(o,c){n.exports=c()})(hs,function(){var o=o||{Msg:Object.create(null)};return o.Msg.ADD_COMMENT="添加注释",o.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE="不能删除变量“%1”,因为它是函数“%2”定义的一部分",o.Msg.CHANGE_VALUE_TITLE="更改值:",o.Msg.CLEAN_UP="整理块",o.Msg.COLLAPSED_WARNINGS_WARNING="已收起的信息块内包含警告。",o.Msg.COLLAPSE_ALL="折叠块",o.Msg.COLLAPSE_BLOCK="折叠块",o.Msg.COLOUR_BLEND_COLOUR1="颜色1",o.Msg.COLOUR_BLEND_COLOUR2="颜色2",o.Msg.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp",o.Msg.COLOUR_BLEND_RATIO="比例",o.Msg.COLOUR_BLEND_TITLE="混合",o.Msg.COLOUR_BLEND_TOOLTIP="把两种颜色以一个给定的比例(0.0-1.0)进行混合。",o.Msg.COLOUR_PICKER_HELPURL="https://zh.wikipedia.org/wiki/颜色",o.Msg.COLOUR_PICKER_TOOLTIP="从调色板中选择一种颜色。",o.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com",o.Msg.COLOUR_RANDOM_TITLE="随机颜色",o.Msg.COLOUR_RANDOM_TOOLTIP="随机选择一种颜色。",o.Msg.COLOUR_RGB_BLUE="蓝色",o.Msg.COLOUR_RGB_GREEN="绿色",o.Msg.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html",o.Msg.COLOUR_RGB_RED="红色",o.Msg.COLOUR_RGB_TITLE="颜色",o.Msg.COLOUR_RGB_TOOLTIP="通过指定红色、绿色和蓝色的量创建一种颜色。所有的值必须在0和100之间。",o.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks",o.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="跳出循环",o.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="继续下一轮循环",o.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="跳出包含它的循环。",o.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="跳过本轮循环的剩余部分,并继进行续下一轮循环。",o.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="警告:这个块只能在循环内使用。",o.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each",o.Msg.CONTROLS_FOREACH_TITLE="遍历列表 %2 里的每一项 %1",o.Msg.CONTROLS_FOREACH_TOOLTIP="遍历列表中的每一项,将变量“%1”设为所选项,并执行一些语句。",o.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with",o.Msg.CONTROLS_FOR_TITLE="变量 %1 从 %2 数到 %3 每次增加 %4",o.Msg.CONTROLS_FOR_TOOLTIP="让变量“%1”记录开始数到结束数之间指定间隔的值,并执行指定的块。",o.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="在这个if语句块中增加一个条件。",o.Msg.CONTROLS_IF_ELSE_TOOLTIP="在这个if语句块中添加一个最终的,包括所有其余情况的条件。",o.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse",o.Msg.CONTROLS_IF_IF_TOOLTIP="增加、删除或重新排列各节来重新配置这个if语句块。",o.Msg.CONTROLS_IF_MSG_ELSE="否则",o.Msg.CONTROLS_IF_MSG_ELSEIF="否则如果",o.Msg.CONTROLS_IF_MSG_IF="如果",o.Msg.CONTROLS_IF_TOOLTIP_1="如果值为真,执行一些语句。",o.Msg.CONTROLS_IF_TOOLTIP_2="如果值为真,则执行第一块语句。否则,则执行第二块语句。",o.Msg.CONTROLS_IF_TOOLTIP_3="如果第一个值为真,则执行第一块的语句。否则,如果第二个值为真,则执行第二块的语句。",o.Msg.CONTROLS_IF_TOOLTIP_4="如果第一个值为真,则执行第一块对语句。否则,如果第二个值为真,则执行语句的第二块。如果没有值为真,则执行最后一块的语句。",o.Msg.CONTROLS_REPEAT_HELPURL="https://zh.wikipedia.org/wiki/For循环",o.Msg.CONTROLS_REPEAT_INPUT_DO="执行",o.Msg.CONTROLS_REPEAT_TITLE="重复 %1 次",o.Msg.CONTROLS_REPEAT_TOOLTIP="多次执行一些语句。",o.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat",o.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="重复直到条件满足",o.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="当条件满足时重复",o.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="只要值为假,就一直循环执行一些语句。",o.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="只要值为真,就一直循环执行一些语句。",o.Msg.DELETE_ALL_BLOCKS="删除所有 %1 个块吗?",o.Msg.DELETE_BLOCK="删除块",o.Msg.DELETE_VARIABLE="删除变量“%1”",o.Msg.DELETE_VARIABLE_CONFIRMATION="要删除对变量“%2”的%1个引用吗?",o.Msg.DELETE_X_BLOCKS="删除 %1 个块",o.Msg.DIALOG_CANCEL="取消",o.Msg.DIALOG_OK="确认",o.Msg.DISABLE_BLOCK="禁用块",o.Msg.DUPLICATE_BLOCK="复制",o.Msg.DUPLICATE_COMMENT="复制注释",o.Msg.ENABLE_BLOCK="启用块",o.Msg.EXPAND_ALL="展开块",o.Msg.EXPAND_BLOCK="展开块",o.Msg.EXTERNAL_INPUTS="外部输入",o.Msg.HELP="帮助",o.Msg.INLINE_INPUTS="单行输入",o.Msg.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list",o.Msg.LISTS_CREATE_EMPTY_TITLE="创建空列表",o.Msg.LISTS_CREATE_EMPTY_TOOLTIP="返回一个列表,长度为 0,不包含任何数据记录",o.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="列表",o.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="增加、删除或重新排列各部分以此重新配置这个列表块。",o.Msg.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",o.Msg.LISTS_CREATE_WITH_INPUT_WITH="创建列表,内容:",o.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP="将一个项添加到列表中。",o.Msg.LISTS_CREATE_WITH_TOOLTIP="建立一个具有任意数量项目的列表。",o.Msg.LISTS_GET_INDEX_FIRST="第一项",o.Msg.LISTS_GET_INDEX_FROM_END="倒数第#项",o.Msg.LISTS_GET_INDEX_FROM_START="#",o.Msg.LISTS_GET_INDEX_GET="取得",o.Msg.LISTS_GET_INDEX_GET_REMOVE="取得并移除",o.Msg.LISTS_GET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list",o.Msg.LISTS_GET_INDEX_LAST="最后一项",o.Msg.LISTS_GET_INDEX_RANDOM="随机的一项",o.Msg.LISTS_GET_INDEX_REMOVE="移除",o.Msg.LISTS_GET_INDEX_TAIL="",o.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="返回列表中的第一项。",o.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM="返回在列表中的指定位置的项。",o.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST="返回列表中的最后一项。",o.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="返回列表中的随机一项。",o.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="移除并返回列表中的第一项。",o.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="移除并返回列表中的指定位置的项。",o.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="移除并返回列表中的最后一项。",o.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="移除并返回列表中的随机一项。",o.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="移除列表中的第一项",o.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="移除在列表中的指定位置的项。",o.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="移除列表中的最后一项",o.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="删除列表中的随机一项。",o.Msg.LISTS_GET_SUBLIST_END_FROM_END="到倒数第#项",o.Msg.LISTS_GET_SUBLIST_END_FROM_START="到第#项",o.Msg.LISTS_GET_SUBLIST_END_LAST="到最后一项",o.Msg.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist",o.Msg.LISTS_GET_SUBLIST_START_FIRST="获取子列表,从第一项",o.Msg.LISTS_GET_SUBLIST_START_FROM_END="获取子列表,从倒数第#项",o.Msg.LISTS_GET_SUBLIST_START_FROM_START="获取子列表,从第#项",o.Msg.LISTS_GET_SUBLIST_TAIL="",o.Msg.LISTS_GET_SUBLIST_TOOLTIP="复制列表中指定的部分。",o.Msg.LISTS_INDEX_FROM_END_TOOLTIP="%1是最后一项。",o.Msg.LISTS_INDEX_FROM_START_TOOLTIP="%1是第一项。",o.Msg.LISTS_INDEX_OF_FIRST="寻找第一次出现的项",o.Msg.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#finding-items-in-a-list",o.Msg.LISTS_INDEX_OF_LAST="寻找最后一次出现的项",o.Msg.LISTS_INDEX_OF_TOOLTIP="返回在列表中的第一/最后一个匹配项的索引值。如果找不到项目则返回%1。",o.Msg.LISTS_INLIST="在列表中",o.Msg.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty",o.Msg.LISTS_ISEMPTY_TITLE="%1是空的",o.Msg.LISTS_ISEMPTY_TOOLTIP="如果改列表为空,则返回真。",o.Msg.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of",o.Msg.LISTS_LENGTH_TITLE="%1的长度",o.Msg.LISTS_LENGTH_TOOLTIP="返回列表的长度。",o.Msg.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",o.Msg.LISTS_REPEAT_TITLE="建立列表使用项 %1 重复 %2 次",o.Msg.LISTS_REPEAT_TOOLTIP="建立包含指定重复次数的值的列表。",o.Msg.LISTS_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Lists#reversing-a-list",o.Msg.LISTS_REVERSE_MESSAGE0="倒转%1",o.Msg.LISTS_REVERSE_TOOLTIP="倒转一个列表,返回副本。",o.Msg.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set",o.Msg.LISTS_SET_INDEX_INPUT_TO="值为",o.Msg.LISTS_SET_INDEX_INSERT="插入在",o.Msg.LISTS_SET_INDEX_SET="设置",o.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="在列表的起始处添加该项。",o.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="在列表中指定位置插入项。",o.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="在列表的末尾处添加该项。",o.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="在列表的随机位置插入该项。",o.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="设置列表中的第一项。",o.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM="设置在列表中指定位置的项。",o.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST="设置列表中的最后一项。",o.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="设置列表中的随机一项。",o.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list",o.Msg.LISTS_SORT_ORDER_ASCENDING="升序",o.Msg.LISTS_SORT_ORDER_DESCENDING="降序",o.Msg.LISTS_SORT_TITLE="排序%1 %2 %3",o.Msg.LISTS_SORT_TOOLTIP="排序一个列表,返回副本。",o.Msg.LISTS_SORT_TYPE_IGNORECASE="按字母(忽略大小写)",o.Msg.LISTS_SORT_TYPE_NUMERIC="按数字",o.Msg.LISTS_SORT_TYPE_TEXT="按字母",o.Msg.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists",o.Msg.LISTS_SPLIT_LIST_FROM_TEXT="从文本制作列表",o.Msg.LISTS_SPLIT_TEXT_FROM_LIST="将列表合并为文本",o.Msg.LISTS_SPLIT_TOOLTIP_JOIN="加入文本列表至一个文本,由分隔符分隔。",o.Msg.LISTS_SPLIT_TOOLTIP_SPLIT="将文本按指定的分隔符拆分为文本组成的列表。",o.Msg.LISTS_SPLIT_WITH_DELIMITER="分隔符:",o.Msg.LOGIC_BOOLEAN_FALSE="false",o.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values",o.Msg.LOGIC_BOOLEAN_TOOLTIP="返回 true 或 false。",o.Msg.LOGIC_BOOLEAN_TRUE="true",o.Msg.LOGIC_COMPARE_HELPURL="https://zh.wikipedia.org/wiki/不等",o.Msg.LOGIC_COMPARE_TOOLTIP_EQ="如果两个输入结果相等,则返回真。",o.Msg.LOGIC_COMPARE_TOOLTIP_GT="如果第一个输入结果比第二个大,则返回真。",o.Msg.LOGIC_COMPARE_TOOLTIP_GTE="如果第一个输入结果大于或等于第二个输入结果,则返回真。",o.Msg.LOGIC_COMPARE_TOOLTIP_LT="如果第一个输入结果比第二个小,则返回真。",o.Msg.LOGIC_COMPARE_TOOLTIP_LTE="如果第一个输入结果小于或等于第二个输入结果,则返回真。",o.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="如果两个输入结果不相等,则返回真。",o.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not",o.Msg.LOGIC_NEGATE_TITLE="非 %1",o.Msg.LOGIC_NEGATE_TOOLTIP="如果输入结果为false,则返回true;如果输入结果为true,则返回false。",o.Msg.LOGIC_NULL="空",o.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type",o.Msg.LOGIC_NULL_TOOLTIP="返回空值。",o.Msg.LOGIC_OPERATION_AND="并且",o.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations",o.Msg.LOGIC_OPERATION_OR="或",o.Msg.LOGIC_OPERATION_TOOLTIP_AND="如果两个输入结果都为真,则返回真。",o.Msg.LOGIC_OPERATION_TOOLTIP_OR="如果至少有一个输入结果为真,则返回真。",o.Msg.LOGIC_TERNARY_CONDITION="断言",o.Msg.LOGIC_TERNARY_HELPURL="https://zh.wikipedia.org/wiki/条件运算符%3F:",o.Msg.LOGIC_TERNARY_IF_FALSE="如果为 false",o.Msg.LOGIC_TERNARY_IF_TRUE="如果为 true",o.Msg.LOGIC_TERNARY_TOOLTIP="检查“断言”里的条件语句。如果条件为真,则返回“如果为真”的值,否则,则返回“如果为假”的值。",o.Msg.MATH_ADDITION_SYMBOL="+",o.Msg.MATH_ARITHMETIC_HELPURL="https://zh.wikipedia.org/wiki/算术",o.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="返回两个数的和。",o.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="返回两个数的商。",o.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="返回两个数的差。",o.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="返回两个数的积。",o.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="返回第一个数的第二个数次幂。",o.Msg.MATH_ATAN2_HELPURL="https://zh.wikipedia.org/wiki/反正切2",o.Msg.MATH_ATAN2_TITLE="点(x:%1,y:%2)的方位角",o.Msg.MATH_ATAN2_TOOLTIP="返回点(X,Y)的反正切值,范围为-180到180度。",o.Msg.MATH_CHANGE_HELPURL="https://zh.wikipedia.org/wiki/加法",o.Msg.MATH_CHANGE_TITLE="给 %1 加 %2",o.Msg.MATH_CHANGE_TOOLTIP="把数加到变量“%1”。",o.Msg.MATH_CONSTANT_HELPURL="https://zh.wikipedia.org/wiki/数学常数",o.Msg.MATH_CONSTANT_TOOLTIP="返回一个以下常见常数:π (3.141…)、e (2.718…)、φ (1.618…)、根号2 (1.414…)、根号½ (0.707…)或∞ (无穷)。",o.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)",o.Msg.MATH_CONSTRAIN_TITLE="将 %1 限制在 最低 %2 到最高 %3 之间",o.Msg.MATH_CONSTRAIN_TOOLTIP="把一个数限制在指定的极限(含)之间。",o.Msg.MATH_DIVISION_SYMBOL="÷",o.Msg.MATH_IS_DIVISIBLE_BY="可整除被",o.Msg.MATH_IS_EVEN="是偶数",o.Msg.MATH_IS_NEGATIVE="是负数",o.Msg.MATH_IS_ODD="是奇数",o.Msg.MATH_IS_POSITIVE="是正数",o.Msg.MATH_IS_PRIME="是质数",o.Msg.MATH_IS_TOOLTIP="检查一个数是否是偶数、奇数、质数、整数、正数、负数,或者是否能被某数整除。返回真或假。",o.Msg.MATH_IS_WHOLE="是整数",o.Msg.MATH_MODULO_HELPURL="https://zh.wikipedia.org/wiki/模除",o.Msg.MATH_MODULO_TITLE="%1 ÷ %2 的余数",o.Msg.MATH_MODULO_TOOLTIP="返回两个数相除的余数。",o.Msg.MATH_MULTIPLICATION_SYMBOL="×",o.Msg.MATH_NUMBER_HELPURL="https://zh.wikipedia.org/wiki/数",o.Msg.MATH_NUMBER_TOOLTIP="一个数。",o.Msg.MATH_ONLIST_HELPURL="",o.Msg.MATH_ONLIST_OPERATOR_AVERAGE="列表的平均",o.Msg.MATH_ONLIST_OPERATOR_MAX="列表的最大数",o.Msg.MATH_ONLIST_OPERATOR_MEDIAN="列表的中位数",o.Msg.MATH_ONLIST_OPERATOR_MIN="列表的最小数",o.Msg.MATH_ONLIST_OPERATOR_MODE="列表的众数",o.Msg.MATH_ONLIST_OPERATOR_RANDOM="列表的随机项",o.Msg.MATH_ONLIST_OPERATOR_STD_DEV="列表的标准差",o.Msg.MATH_ONLIST_OPERATOR_SUM="列表的和",o.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="返回列表内数值的平均(算术平均)。",o.Msg.MATH_ONLIST_TOOLTIP_MAX="返回列表内的最大数。",o.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="返回列表内数的中位数。",o.Msg.MATH_ONLIST_TOOLTIP_MIN="返回列表内的最小数。",o.Msg.MATH_ONLIST_TOOLTIP_MODE="返回列表中的出现次数最多的项的列表。",o.Msg.MATH_ONLIST_TOOLTIP_RANDOM="返回列表内的一个随机元素。",o.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="返回列表的标准差。",o.Msg.MATH_ONLIST_TOOLTIP_SUM="返回列表内的所有数的和。",o.Msg.MATH_POWER_SYMBOL="^",o.Msg.MATH_RANDOM_FLOAT_HELPURL="https://zh.wikipedia.org/wiki/随机数生成器",o.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="随机小数",o.Msg.MATH_RANDOM_FLOAT_TOOLTIP="返回一个从0.0(含)到1.0(不含)之间的随机数。",o.Msg.MATH_RANDOM_INT_HELPURL="https://zh.wikipedia.org/wiki/随机数生成器",o.Msg.MATH_RANDOM_INT_TITLE="从 %1 到 %2 范围内的随机整数",o.Msg.MATH_RANDOM_INT_TOOLTIP="返回两个指定的极限(含)之间的随机整数。",o.Msg.MATH_ROUND_HELPURL="https://zh.wikipedia.org/wiki/数值修约",o.Msg.MATH_ROUND_OPERATOR_ROUND="四舍五入",o.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="向下舍入",o.Msg.MATH_ROUND_OPERATOR_ROUNDUP="向上舍入",o.Msg.MATH_ROUND_TOOLTIP="数向上或向下取整。",o.Msg.MATH_SINGLE_HELPURL="https://zh.wikipedia.org/wiki/平方根",o.Msg.MATH_SINGLE_OP_ABSOLUTE="绝对值",o.Msg.MATH_SINGLE_OP_ROOT="平方根",o.Msg.MATH_SINGLE_TOOLTIP_ABS="返回一个数的绝对值。",o.Msg.MATH_SINGLE_TOOLTIP_EXP="返回e的一个数次幂。",o.Msg.MATH_SINGLE_TOOLTIP_LN="返回一个数的自然对数。",o.Msg.MATH_SINGLE_TOOLTIP_LOG10="返回一个数的以10为底的对数。",o.Msg.MATH_SINGLE_TOOLTIP_NEG="返回一个数的相反数。",o.Msg.MATH_SINGLE_TOOLTIP_POW10="返回10的一个数次幂。",o.Msg.MATH_SINGLE_TOOLTIP_ROOT="返回一个数的平方根。",o.Msg.MATH_SUBTRACTION_SYMBOL="-",o.Msg.MATH_TRIG_ACOS="反余弦",o.Msg.MATH_TRIG_ASIN="反正弦",o.Msg.MATH_TRIG_ATAN="反正切",o.Msg.MATH_TRIG_COS="余弦",o.Msg.MATH_TRIG_HELPURL="https://zh.wikipedia.org/wiki/三角函数",o.Msg.MATH_TRIG_SIN="正弦",o.Msg.MATH_TRIG_TAN="正切",o.Msg.MATH_TRIG_TOOLTIP_ACOS="返回一个数的反余弦。",o.Msg.MATH_TRIG_TOOLTIP_ASIN="返回一个数的反正弦。",o.Msg.MATH_TRIG_TOOLTIP_ATAN="返回一个数的反正切。",o.Msg.MATH_TRIG_TOOLTIP_COS="返回角度(非弧度)的余弦。",o.Msg.MATH_TRIG_TOOLTIP_SIN="返回角度(非弧度)的正弦。",o.Msg.MATH_TRIG_TOOLTIP_TAN="返回角度(非弧度)的正切。",o.Msg.NEW_COLOUR_VARIABLE="创建颜色变量...",o.Msg.NEW_NUMBER_VARIABLE="创建数变量...",o.Msg.NEW_STRING_VARIABLE="创建字符串变量...",o.Msg.NEW_VARIABLE="创建变量...",o.Msg.NEW_VARIABLE_TITLE="新变量的名称:",o.Msg.NEW_VARIABLE_TYPE_TITLE="新变量的类型:",o.Msg.ORDINAL_NUMBER_SUFFIX="",o.Msg.PROCEDURES_ALLOW_STATEMENTS="允许声明",o.Msg.PROCEDURES_BEFORE_PARAMS="与:",o.Msg.PROCEDURES_CALLNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序",o.Msg.PROCEDURES_CALLNORETURN_TOOLTIP="运行用户定义的函数“%1”。",o.Msg.PROCEDURES_CALLRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序",o.Msg.PROCEDURES_CALLRETURN_TOOLTIP="运行用户定义的函数“%1”,并使用它的输出值。",o.Msg.PROCEDURES_CALL_BEFORE_PARAMS="与:",o.Msg.PROCEDURES_CALL_DISABLED_DEF_WARNING="Can't run the user-defined function '%1' because the definition block is disabled.",o.Msg.PROCEDURES_CREATE_DO="创建“%1”",o.Msg.PROCEDURES_DEFNORETURN_COMMENT="描述该功能...",o.Msg.PROCEDURES_DEFNORETURN_DO="",o.Msg.PROCEDURES_DEFNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序",o.Msg.PROCEDURES_DEFNORETURN_PROCEDURE="做点什么",o.Msg.PROCEDURES_DEFNORETURN_TITLE="至",o.Msg.PROCEDURES_DEFNORETURN_TOOLTIP="创建一个不带输出值的函数。",o.Msg.PROCEDURES_DEFRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序",o.Msg.PROCEDURES_DEFRETURN_RETURN="返回",o.Msg.PROCEDURES_DEFRETURN_TOOLTIP="创建一个有输出值的函数。",o.Msg.PROCEDURES_DEF_DUPLICATE_WARNING="警告:此函数具有重复参数。",o.Msg.PROCEDURES_HIGHLIGHT_DEF="突出显示函数定义",o.Msg.PROCEDURES_IFRETURN_HELPURL="https://c2.com/cgi/wiki?GuardClause",o.Msg.PROCEDURES_IFRETURN_TOOLTIP="如果值为真,则返回第二个值。",o.Msg.PROCEDURES_IFRETURN_WARNING="警告:这个块只能在函数内部使用。",o.Msg.PROCEDURES_MUTATORARG_TITLE="输入名称:",o.Msg.PROCEDURES_MUTATORARG_TOOLTIP="添加函数输入。",o.Msg.PROCEDURES_MUTATORCONTAINER_TITLE="输入",o.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP="添加、移除或重新排此函数的输入。",o.Msg.REDO="重做",o.Msg.REMOVE_COMMENT="删除注释",o.Msg.RENAME_VARIABLE="重命名变量...",o.Msg.RENAME_VARIABLE_TITLE="将所有“%1”变量重命名为:",o.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",o.Msg.TEXT_APPEND_TITLE="在%1之后加上文本%2",o.Msg.TEXT_APPEND_TOOLTIP="将一些文本追加到变量“%1”里。",o.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case",o.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="转为小写",o.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="转为首字母大写",o.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="转为大写",o.Msg.TEXT_CHANGECASE_TOOLTIP="用不同的大小写模式复制并返回这段文字。",o.Msg.TEXT_CHARAT_FIRST="获取第一个字符",o.Msg.TEXT_CHARAT_FROM_END="获取倒数第#个字符",o.Msg.TEXT_CHARAT_FROM_START="获取第#个字符",o.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text",o.Msg.TEXT_CHARAT_LAST="获取最后一个字符",o.Msg.TEXT_CHARAT_RANDOM="获取随机一个字符",o.Msg.TEXT_CHARAT_TAIL="",o.Msg.TEXT_CHARAT_TITLE="在文本%1 里 %2",o.Msg.TEXT_CHARAT_TOOLTIP="返回位于指定位置的字符。",o.Msg.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings",o.Msg.TEXT_COUNT_MESSAGE0="计算%1在%2里出现的次数",o.Msg.TEXT_COUNT_TOOLTIP="计算在一段文本中,某个部分文本重复出现了多少次。",o.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="将一个项添加到文本中。",o.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="拼接",o.Msg.TEXT_CREATE_JOIN_TOOLTIP="添加、移除或重新排列各节来重新配置这个文本块。",o.Msg.TEXT_GET_SUBSTRING_END_FROM_END="到倒数第#个字符",o.Msg.TEXT_GET_SUBSTRING_END_FROM_START="到第#个字符",o.Msg.TEXT_GET_SUBSTRING_END_LAST="到最后一个字符",o.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text",o.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="从文本",o.Msg.TEXT_GET_SUBSTRING_START_FIRST="获取子串,从第一个字符",o.Msg.TEXT_GET_SUBSTRING_START_FROM_END="获取子串,从倒数第#个字符",o.Msg.TEXT_GET_SUBSTRING_START_FROM_START="获取子串,从第#个字符",o.Msg.TEXT_GET_SUBSTRING_TAIL="",o.Msg.TEXT_GET_SUBSTRING_TOOLTIP="返回文本中指定的一部分。",o.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text",o.Msg.TEXT_INDEXOF_OPERATOR_FIRST="寻找第一次出现的文本",o.Msg.TEXT_INDEXOF_OPERATOR_LAST="寻找最后一次出现的文本",o.Msg.TEXT_INDEXOF_TITLE="在文本 %1 里 %2 %3",o.Msg.TEXT_INDEXOF_TOOLTIP="返回第一个文本段在第二个文本段中的第一/最后一个匹配项的起始位置。如果未找到,则返回%1。",o.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text",o.Msg.TEXT_ISEMPTY_TITLE="%1是空的",o.Msg.TEXT_ISEMPTY_TOOLTIP="如果给定的文本为空,则返回真。",o.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation",o.Msg.TEXT_JOIN_TITLE_CREATEWITH="创建文本,内容:",o.Msg.TEXT_JOIN_TOOLTIP="通过串起任意数量的项以建立一段文本。",o.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",o.Msg.TEXT_LENGTH_TITLE="%1的长度",o.Msg.TEXT_LENGTH_TOOLTIP="返回给定文本的字母数(包括空格)。",o.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text",o.Msg.TEXT_PRINT_TITLE="输出%1",o.Msg.TEXT_PRINT_TOOLTIP="打印指定的文字、数或其他值。",o.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user",o.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="提示用户输入一个数。",o.Msg.TEXT_PROMPT_TOOLTIP_TEXT="要求用户输入一些文本。",o.Msg.TEXT_PROMPT_TYPE_NUMBER="提示输入数并显示消息",o.Msg.TEXT_PROMPT_TYPE_TEXT="要求输入文本,并显示提示消息",o.Msg.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Text#replacing-substrings",o.Msg.TEXT_REPLACE_MESSAGE0="把%3中的%1替换为%2",o.Msg.TEXT_REPLACE_TOOLTIP="在一段文本中,将出现过的某部分文本都替换掉。",o.Msg.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Text#reversing-text",o.Msg.TEXT_REVERSE_MESSAGE0="倒转文本%1",o.Msg.TEXT_REVERSE_TOOLTIP="将文本中各个字符的顺序倒转。",o.Msg.TEXT_TEXT_HELPURL="https://zh.wikipedia.org/wiki/字符串",o.Msg.TEXT_TEXT_TOOLTIP="一个字、词或一行文本。",o.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces",o.Msg.TEXT_TRIM_OPERATOR_BOTH="消除其两侧的空格",o.Msg.TEXT_TRIM_OPERATOR_LEFT="消除其左侧的空格",o.Msg.TEXT_TRIM_OPERATOR_RIGHT="消除其右侧的空格",o.Msg.TEXT_TRIM_TOOLTIP="从某一端或同时从两端删除多余的空白,并返回这段文字的一个副本。",o.Msg.TODAY="今天",o.Msg.UNDO="撤销",o.Msg.UNNAMED_KEY="未命名",o.Msg.VARIABLES_DEFAULT_NAME="项目",o.Msg.VARIABLES_GET_CREATE_SET="创建“设定%1”",o.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get",o.Msg.VARIABLES_GET_TOOLTIP="返回此变量的值。",o.Msg.VARIABLES_SET="赋值 %1 为 %2",o.Msg.VARIABLES_SET_CREATE_GET="创建“获得%1”",o.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set",o.Msg.VARIABLES_SET_TOOLTIP="设置此变量,以使它和输入值相等。",o.Msg.VARIABLE_ALREADY_EXISTS="名字叫“%1”的变量已经存在了。",o.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="名字叫“%1”的变量已经有了另一个类型:“%2”。",o.Msg.VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER="名为“%1”的变量已经作为参数存在于流程“%2”中。",o.Msg.WORKSPACE_ARIA_LABEL="Blockly工作区",o.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT="说点什么...",o.Msg.CONTROLS_FOREACH_INPUT_DO=o.Msg.CONTROLS_REPEAT_INPUT_DO,o.Msg.CONTROLS_FOR_INPUT_DO=o.Msg.CONTROLS_REPEAT_INPUT_DO,o.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=o.Msg.CONTROLS_IF_MSG_ELSEIF,o.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=o.Msg.CONTROLS_IF_MSG_ELSE,o.Msg.CONTROLS_IF_IF_TITLE_IF=o.Msg.CONTROLS_IF_MSG_IF,o.Msg.CONTROLS_IF_MSG_THEN=o.Msg.CONTROLS_REPEAT_INPUT_DO,o.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=o.Msg.CONTROLS_REPEAT_INPUT_DO,o.Msg.LISTS_CREATE_WITH_ITEM_TITLE=o.Msg.VARIABLES_DEFAULT_NAME,o.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=o.Msg.LISTS_INLIST,o.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=o.Msg.LISTS_INLIST,o.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=o.Msg.LISTS_INLIST,o.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=o.Msg.LISTS_INLIST,o.Msg.MATH_CHANGE_TITLE_ITEM=o.Msg.VARIABLES_DEFAULT_NAME,o.Msg.PROCEDURES_DEFRETURN_COMMENT=o.Msg.PROCEDURES_DEFNORETURN_COMMENT,o.Msg.PROCEDURES_DEFRETURN_DO=o.Msg.PROCEDURES_DEFNORETURN_DO,o.Msg.PROCEDURES_DEFRETURN_PROCEDURE=o.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,o.Msg.PROCEDURES_DEFRETURN_TITLE=o.Msg.PROCEDURES_DEFNORETURN_TITLE,o.Msg.TEXT_APPEND_VARIABLE=o.Msg.VARIABLES_DEFAULT_NAME,o.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=o.Msg.VARIABLES_DEFAULT_NAME,o.Msg.COLOUR_HUE="20",o.Msg.LISTS_HUE="260",o.Msg.LOGIC_HUE="210",o.Msg.LOOPS_HUE="120",o.Msg.MATH_HUE="230",o.Msg.PROCEDURES_HUE="290",o.Msg.TEXTS_HUE="160",o.Msg.VARIABLES_DYNAMIC_HUE="310",o.Msg.VARIABLES_HUE="330",o.Msg})})(KE);var Zb=KE.exports;const eR=VE(Zb),{LOGIC_HUE:tR,LOOPS_HUE:sR,MATH_HUE:oR,TEXTS_HUE:iR,LISTS_HUE:rR,COLOUR_HUE:nR,VARIABLES_HUE:lR,VARIABLES_DYNAMIC_HUE:cR,PROCEDURES_HUE:uR,VARIABLES_DEFAULT_NAME:aR,UNNAMED_KEY:hR,TODAY:dR,DUPLICATE_BLOCK:$R,ADD_COMMENT:_R,REMOVE_COMMENT:pR,DUPLICATE_COMMENT:TR,EXTERNAL_INPUTS:gR,INLINE_INPUTS:mR,DELETE_BLOCK:ER,DELETE_X_BLOCKS:fR,DELETE_ALL_BLOCKS:IR,CLEAN_UP:OR,COLLAPSE_BLOCK:bR,COLLAPSE_ALL:RR,EXPAND_BLOCK:SR,EXPAND_ALL:NR,DISABLE_BLOCK:CR,ENABLE_BLOCK:LR,HELP:AR,UNDO:MR,REDO:vR,CHANGE_VALUE_TITLE:yR,RENAME_VARIABLE:kR,RENAME_VARIABLE_TITLE:DR,NEW_VARIABLE:wR,NEW_STRING_VARIABLE:PR,NEW_NUMBER_VARIABLE:xR,NEW_COLOUR_VARIABLE:BR,NEW_VARIABLE_TYPE_TITLE:FR,NEW_VARIABLE_TITLE:UR,VARIABLE_ALREADY_EXISTS:HR,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:GR,VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER:VR,DELETE_VARIABLE_CONFIRMATION:WR,CANNOT_DELETE_VARIABLE_PROCEDURE:XR,DELETE_VARIABLE:YR,COLOUR_PICKER_HELPURL:zR,COLOUR_PICKER_TOOLTIP:jR,COLOUR_RANDOM_HELPURL:KR,COLOUR_RANDOM_TITLE:JR,COLOUR_RANDOM_TOOLTIP:qR,COLOUR_RGB_HELPURL:QR,COLOUR_RGB_TITLE:ZR,COLOUR_RGB_RED:eS,COLOUR_RGB_GREEN:tS,COLOUR_RGB_BLUE:sS,COLOUR_RGB_TOOLTIP:oS,COLOUR_BLEND_HELPURL:iS,COLOUR_BLEND_TITLE:rS,COLOUR_BLEND_COLOUR1:nS,COLOUR_BLEND_COLOUR2:lS,COLOUR_BLEND_RATIO:cS,COLOUR_BLEND_TOOLTIP:uS,CONTROLS_REPEAT_HELPURL:aS,CONTROLS_REPEAT_TITLE:hS,CONTROLS_REPEAT_INPUT_DO:dS,CONTROLS_REPEAT_TOOLTIP:$S,CONTROLS_WHILEUNTIL_HELPURL:_S,CONTROLS_WHILEUNTIL_INPUT_DO:pS,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:TS,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:gS,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:mS,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:ES,CONTROLS_FOR_HELPURL:fS,CONTROLS_FOR_TOOLTIP:IS,CONTROLS_FOR_TITLE:OS,CONTROLS_FOR_INPUT_DO:bS,CONTROLS_FOREACH_HELPURL:RS,CONTROLS_FOREACH_TITLE:SS,CONTROLS_FOREACH_INPUT_DO:NS,CONTROLS_FOREACH_TOOLTIP:CS,CONTROLS_FLOW_STATEMENTS_HELPURL:LS,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:AS,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:MS,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:vS,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:yS,CONTROLS_FLOW_STATEMENTS_WARNING:kS,CONTROLS_IF_HELPURL:DS,CONTROLS_IF_TOOLTIP_1:wS,CONTROLS_IF_TOOLTIP_2:PS,CONTROLS_IF_TOOLTIP_3:xS,CONTROLS_IF_TOOLTIP_4:BS,CONTROLS_IF_MSG_IF:FS,CONTROLS_IF_MSG_ELSEIF:US,CONTROLS_IF_MSG_ELSE:HS,CONTROLS_IF_MSG_THEN:GS,CONTROLS_IF_IF_TITLE_IF:VS,CONTROLS_IF_IF_TOOLTIP:WS,CONTROLS_IF_ELSEIF_TITLE_ELSEIF:XS,CONTROLS_IF_ELSEIF_TOOLTIP:YS,CONTROLS_IF_ELSE_TITLE_ELSE:zS,CONTROLS_IF_ELSE_TOOLTIP:jS,LOGIC_COMPARE_HELPURL:KS,LOGIC_COMPARE_TOOLTIP_EQ:JS,LOGIC_COMPARE_TOOLTIP_NEQ:qS,LOGIC_COMPARE_TOOLTIP_LT:QS,LOGIC_COMPARE_TOOLTIP_LTE:ZS,LOGIC_COMPARE_TOOLTIP_GT:eN,LOGIC_COMPARE_TOOLTIP_GTE:tN,LOGIC_OPERATION_HELPURL:sN,LOGIC_OPERATION_TOOLTIP_AND:oN,LOGIC_OPERATION_AND:iN,LOGIC_OPERATION_TOOLTIP_OR:rN,LOGIC_OPERATION_OR:nN,LOGIC_NEGATE_HELPURL:lN,LOGIC_NEGATE_TITLE:cN,LOGIC_NEGATE_TOOLTIP:uN,LOGIC_BOOLEAN_HELPURL:aN,LOGIC_BOOLEAN_TRUE:hN,LOGIC_BOOLEAN_FALSE:dN,LOGIC_BOOLEAN_TOOLTIP:$N,LOGIC_NULL_HELPURL:_N,LOGIC_NULL:pN,LOGIC_NULL_TOOLTIP:TN,LOGIC_TERNARY_HELPURL:gN,LOGIC_TERNARY_CONDITION:mN,LOGIC_TERNARY_IF_TRUE:EN,LOGIC_TERNARY_IF_FALSE:fN,LOGIC_TERNARY_TOOLTIP:IN,MATH_NUMBER_HELPURL:ON,MATH_NUMBER_TOOLTIP:bN,MATH_ADDITION_SYMBOL:RN,MATH_SUBTRACTION_SYMBOL:SN,MATH_DIVISION_SYMBOL:NN,MATH_MULTIPLICATION_SYMBOL:CN,MATH_POWER_SYMBOL:LN,MATH_TRIG_SIN:AN,MATH_TRIG_COS:MN,MATH_TRIG_TAN:vN,MATH_TRIG_ASIN:yN,MATH_TRIG_ACOS:kN,MATH_TRIG_ATAN:DN,MATH_ARITHMETIC_HELPURL:wN,MATH_ARITHMETIC_TOOLTIP_ADD:PN,MATH_ARITHMETIC_TOOLTIP_MINUS:xN,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:BN,MATH_ARITHMETIC_TOOLTIP_DIVIDE:FN,MATH_ARITHMETIC_TOOLTIP_POWER:UN,MATH_SINGLE_HELPURL:HN,MATH_SINGLE_OP_ROOT:GN,MATH_SINGLE_TOOLTIP_ROOT:VN,MATH_SINGLE_OP_ABSOLUTE:WN,MATH_SINGLE_TOOLTIP_ABS:XN,MATH_SINGLE_TOOLTIP_NEG:YN,MATH_SINGLE_TOOLTIP_LN:zN,MATH_SINGLE_TOOLTIP_LOG10:jN,MATH_SINGLE_TOOLTIP_EXP:KN,MATH_SINGLE_TOOLTIP_POW10:JN,MATH_TRIG_HELPURL:qN,MATH_TRIG_TOOLTIP_SIN:QN,MATH_TRIG_TOOLTIP_COS:ZN,MATH_TRIG_TOOLTIP_TAN:eC,MATH_TRIG_TOOLTIP_ASIN:tC,MATH_TRIG_TOOLTIP_ACOS:sC,MATH_TRIG_TOOLTIP_ATAN:oC,MATH_CONSTANT_HELPURL:iC,MATH_CONSTANT_TOOLTIP:rC,MATH_IS_EVEN:nC,MATH_IS_ODD:lC,MATH_IS_PRIME:cC,MATH_IS_WHOLE:uC,MATH_IS_POSITIVE:aC,MATH_IS_NEGATIVE:hC,MATH_IS_DIVISIBLE_BY:dC,MATH_IS_TOOLTIP:$C,MATH_CHANGE_HELPURL:_C,MATH_CHANGE_TITLE:pC,MATH_CHANGE_TITLE_ITEM:TC,MATH_CHANGE_TOOLTIP:gC,MATH_ROUND_HELPURL:mC,MATH_ROUND_TOOLTIP:EC,MATH_ROUND_OPERATOR_ROUND:fC,MATH_ROUND_OPERATOR_ROUNDUP:IC,MATH_ROUND_OPERATOR_ROUNDDOWN:OC,MATH_ONLIST_HELPURL:bC,MATH_ONLIST_OPERATOR_SUM:RC,MATH_ONLIST_TOOLTIP_SUM:SC,MATH_ONLIST_OPERATOR_MIN:NC,MATH_ONLIST_TOOLTIP_MIN:CC,MATH_ONLIST_OPERATOR_MAX:LC,MATH_ONLIST_TOOLTIP_MAX:AC,MATH_ONLIST_OPERATOR_AVERAGE:MC,MATH_ONLIST_TOOLTIP_AVERAGE:vC,MATH_ONLIST_OPERATOR_MEDIAN:yC,MATH_ONLIST_TOOLTIP_MEDIAN:kC,MATH_ONLIST_OPERATOR_MODE:DC,MATH_ONLIST_TOOLTIP_MODE:wC,MATH_ONLIST_OPERATOR_STD_DEV:PC,MATH_ONLIST_TOOLTIP_STD_DEV:xC,MATH_ONLIST_OPERATOR_RANDOM:BC,MATH_ONLIST_TOOLTIP_RANDOM:FC,MATH_MODULO_HELPURL:UC,MATH_MODULO_TITLE:HC,MATH_MODULO_TOOLTIP:GC,MATH_CONSTRAIN_HELPURL:VC,MATH_CONSTRAIN_TITLE:WC,MATH_CONSTRAIN_TOOLTIP:XC,MATH_RANDOM_INT_HELPURL:YC,MATH_RANDOM_INT_TITLE:zC,MATH_RANDOM_INT_TOOLTIP:jC,MATH_RANDOM_FLOAT_HELPURL:KC,MATH_RANDOM_FLOAT_TITLE_RANDOM:JC,MATH_RANDOM_FLOAT_TOOLTIP:qC,MATH_ATAN2_HELPURL:QC,MATH_ATAN2_TITLE:ZC,MATH_ATAN2_TOOLTIP:eL,TEXT_TEXT_HELPURL:tL,TEXT_TEXT_TOOLTIP:sL,TEXT_JOIN_HELPURL:oL,TEXT_JOIN_TITLE_CREATEWITH:iL,TEXT_JOIN_TOOLTIP:rL,TEXT_CREATE_JOIN_TITLE_JOIN:nL,TEXT_CREATE_JOIN_TOOLTIP:lL,TEXT_CREATE_JOIN_ITEM_TITLE_ITEM:cL,TEXT_CREATE_JOIN_ITEM_TOOLTIP:uL,TEXT_APPEND_HELPURL:aL,TEXT_APPEND_TITLE:hL,TEXT_APPEND_VARIABLE:dL,TEXT_APPEND_TOOLTIP:$L,TEXT_LENGTH_HELPURL:_L,TEXT_LENGTH_TITLE:pL,TEXT_LENGTH_TOOLTIP:TL,TEXT_ISEMPTY_HELPURL:gL,TEXT_ISEMPTY_TITLE:mL,TEXT_ISEMPTY_TOOLTIP:EL,TEXT_INDEXOF_HELPURL:fL,TEXT_INDEXOF_TOOLTIP:IL,TEXT_INDEXOF_TITLE:OL,TEXT_INDEXOF_OPERATOR_FIRST:bL,TEXT_INDEXOF_OPERATOR_LAST:RL,TEXT_CHARAT_HELPURL:SL,TEXT_CHARAT_TITLE:NL,TEXT_CHARAT_FROM_START:CL,TEXT_CHARAT_FROM_END:LL,TEXT_CHARAT_FIRST:AL,TEXT_CHARAT_LAST:ML,TEXT_CHARAT_RANDOM:vL,TEXT_CHARAT_TAIL:yL,TEXT_CHARAT_TOOLTIP:kL,TEXT_GET_SUBSTRING_TOOLTIP:DL,TEXT_GET_SUBSTRING_HELPURL:wL,TEXT_GET_SUBSTRING_INPUT_IN_TEXT:PL,TEXT_GET_SUBSTRING_START_FROM_START:xL,TEXT_GET_SUBSTRING_START_FROM_END:BL,TEXT_GET_SUBSTRING_START_FIRST:FL,TEXT_GET_SUBSTRING_END_FROM_START:UL,TEXT_GET_SUBSTRING_END_FROM_END:HL,TEXT_GET_SUBSTRING_END_LAST:GL,TEXT_GET_SUBSTRING_TAIL:VL,TEXT_CHANGECASE_HELPURL:WL,TEXT_CHANGECASE_TOOLTIP:XL,TEXT_CHANGECASE_OPERATOR_UPPERCASE:YL,TEXT_CHANGECASE_OPERATOR_LOWERCASE:zL,TEXT_CHANGECASE_OPERATOR_TITLECASE:jL,TEXT_TRIM_HELPURL:KL,TEXT_TRIM_TOOLTIP:JL,TEXT_TRIM_OPERATOR_BOTH:qL,TEXT_TRIM_OPERATOR_LEFT:QL,TEXT_TRIM_OPERATOR_RIGHT:ZL,TEXT_PRINT_HELPURL:eA,TEXT_PRINT_TITLE:tA,TEXT_PRINT_TOOLTIP:sA,TEXT_PROMPT_HELPURL:oA,TEXT_PROMPT_TYPE_TEXT:iA,TEXT_PROMPT_TYPE_NUMBER:rA,TEXT_PROMPT_TOOLTIP_NUMBER:nA,TEXT_PROMPT_TOOLTIP_TEXT:lA,TEXT_COUNT_MESSAGE0:cA,TEXT_COUNT_HELPURL:uA,TEXT_COUNT_TOOLTIP:aA,TEXT_REPLACE_MESSAGE0:hA,TEXT_REPLACE_HELPURL:dA,TEXT_REPLACE_TOOLTIP:$A,TEXT_REVERSE_MESSAGE0:_A,TEXT_REVERSE_HELPURL:pA,TEXT_REVERSE_TOOLTIP:TA,LISTS_CREATE_EMPTY_HELPURL:gA,LISTS_CREATE_EMPTY_TITLE:mA,LISTS_CREATE_EMPTY_TOOLTIP:EA,LISTS_CREATE_WITH_HELPURL:fA,LISTS_CREATE_WITH_TOOLTIP:IA,LISTS_CREATE_WITH_INPUT_WITH:OA,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:bA,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:RA,LISTS_CREATE_WITH_ITEM_TITLE:SA,LISTS_CREATE_WITH_ITEM_TOOLTIP:NA,LISTS_REPEAT_HELPURL:CA,LISTS_REPEAT_TOOLTIP:LA,LISTS_REPEAT_TITLE:AA,LISTS_LENGTH_HELPURL:MA,LISTS_LENGTH_TITLE:vA,LISTS_LENGTH_TOOLTIP:yA,LISTS_ISEMPTY_HELPURL:kA,LISTS_ISEMPTY_TITLE:DA,LISTS_ISEMPTY_TOOLTIP:wA,LISTS_INLIST:PA,LISTS_INDEX_OF_HELPURL:xA,LISTS_INDEX_OF_INPUT_IN_LIST:BA,LISTS_INDEX_OF_FIRST:FA,LISTS_INDEX_OF_LAST:UA,LISTS_INDEX_OF_TOOLTIP:HA,LISTS_GET_INDEX_HELPURL:GA,LISTS_GET_INDEX_GET:VA,LISTS_GET_INDEX_GET_REMOVE:WA,LISTS_GET_INDEX_REMOVE:XA,LISTS_GET_INDEX_FROM_START:YA,LISTS_GET_INDEX_FROM_END:zA,LISTS_GET_INDEX_FIRST:jA,LISTS_GET_INDEX_LAST:KA,LISTS_GET_INDEX_RANDOM:JA,LISTS_GET_INDEX_TAIL:qA,LISTS_GET_INDEX_INPUT_IN_LIST:QA,LISTS_INDEX_FROM_START_TOOLTIP:ZA,LISTS_INDEX_FROM_END_TOOLTIP:eM,LISTS_GET_INDEX_TOOLTIP_GET_FROM:tM,LISTS_GET_INDEX_TOOLTIP_GET_FIRST:sM,LISTS_GET_INDEX_TOOLTIP_GET_LAST:oM,LISTS_GET_INDEX_TOOLTIP_GET_RANDOM:iM,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM:rM,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST:nM,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST:lM,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM:cM,LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM:uM,LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST:aM,LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST:hM,LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM:dM,LISTS_SET_INDEX_HELPURL:$M,LISTS_SET_INDEX_INPUT_IN_LIST:_M,LISTS_SET_INDEX_SET:pM,LISTS_SET_INDEX_INSERT:TM,LISTS_SET_INDEX_INPUT_TO:gM,LISTS_SET_INDEX_TOOLTIP_SET_FROM:mM,LISTS_SET_INDEX_TOOLTIP_SET_FIRST:EM,LISTS_SET_INDEX_TOOLTIP_SET_LAST:fM,LISTS_SET_INDEX_TOOLTIP_SET_RANDOM:IM,LISTS_SET_INDEX_TOOLTIP_INSERT_FROM:OM,LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST:bM,LISTS_SET_INDEX_TOOLTIP_INSERT_LAST:RM,LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM:SM,LISTS_GET_SUBLIST_HELPURL:NM,LISTS_GET_SUBLIST_INPUT_IN_LIST:CM,LISTS_GET_SUBLIST_START_FROM_START:LM,LISTS_GET_SUBLIST_START_FROM_END:AM,LISTS_GET_SUBLIST_START_FIRST:MM,LISTS_GET_SUBLIST_END_FROM_START:vM,LISTS_GET_SUBLIST_END_FROM_END:yM,LISTS_GET_SUBLIST_END_LAST:kM,LISTS_GET_SUBLIST_TAIL:DM,LISTS_GET_SUBLIST_TOOLTIP:wM,LISTS_SORT_HELPURL:PM,LISTS_SORT_TITLE:xM,LISTS_SORT_TOOLTIP:BM,LISTS_SORT_ORDER_ASCENDING:FM,LISTS_SORT_ORDER_DESCENDING:UM,LISTS_SORT_TYPE_NUMERIC:HM,LISTS_SORT_TYPE_TEXT:GM,LISTS_SORT_TYPE_IGNORECASE:VM,LISTS_SPLIT_HELPURL:WM,LISTS_SPLIT_LIST_FROM_TEXT:XM,LISTS_SPLIT_TEXT_FROM_LIST:YM,LISTS_SPLIT_WITH_DELIMITER:zM,LISTS_SPLIT_TOOLTIP_SPLIT:jM,LISTS_SPLIT_TOOLTIP_JOIN:KM,LISTS_REVERSE_HELPURL:JM,LISTS_REVERSE_MESSAGE0:qM,LISTS_REVERSE_TOOLTIP:QM,ORDINAL_NUMBER_SUFFIX:ZM,VARIABLES_GET_HELPURL:ev,VARIABLES_GET_TOOLTIP:tv,VARIABLES_GET_CREATE_SET:sv,VARIABLES_SET_HELPURL:ov,VARIABLES_SET:iv,VARIABLES_SET_TOOLTIP:rv,VARIABLES_SET_CREATE_GET:nv,PROCEDURES_DEFNORETURN_HELPURL:lv,PROCEDURES_DEFNORETURN_TITLE:cv,PROCEDURES_DEFNORETURN_PROCEDURE:uv,PROCEDURES_BEFORE_PARAMS:av,PROCEDURES_CALL_BEFORE_PARAMS:hv,PROCEDURES_CALL_DISABLED_DEF_WARNING:dv,PROCEDURES_DEFNORETURN_DO:$v,PROCEDURES_DEFNORETURN_TOOLTIP:_v,PROCEDURES_DEFNORETURN_COMMENT:pv,PROCEDURES_DEFRETURN_HELPURL:Tv,PROCEDURES_DEFRETURN_TITLE:gv,PROCEDURES_DEFRETURN_PROCEDURE:mv,PROCEDURES_DEFRETURN_DO:Ev,PROCEDURES_DEFRETURN_COMMENT:fv,PROCEDURES_DEFRETURN_RETURN:Iv,PROCEDURES_DEFRETURN_TOOLTIP:Ov,PROCEDURES_ALLOW_STATEMENTS:bv,PROCEDURES_DEF_DUPLICATE_WARNING:Rv,PROCEDURES_CALLNORETURN_HELPURL:Sv,PROCEDURES_CALLNORETURN_TOOLTIP:Nv,PROCEDURES_CALLRETURN_HELPURL:Cv,PROCEDURES_CALLRETURN_TOOLTIP:Lv,PROCEDURES_MUTATORCONTAINER_TITLE:Av,PROCEDURES_MUTATORCONTAINER_TOOLTIP:Mv,PROCEDURES_MUTATORARG_TITLE:vv,PROCEDURES_MUTATORARG_TOOLTIP:yv,PROCEDURES_HIGHLIGHT_DEF:kv,PROCEDURES_CREATE_DO:Dv,PROCEDURES_IFRETURN_TOOLTIP:wv,PROCEDURES_IFRETURN_HELPURL:Pv,PROCEDURES_IFRETURN_WARNING:xv,WORKSPACE_COMMENT_DEFAULT_TEXT:Bv,WORKSPACE_ARIA_LABEL:Fv,COLLAPSED_WARNINGS_WARNING:Uv,DIALOG_OK:Hv,DIALOG_CANCEL:Gv}=eR,Vv=Object.freeze(Object.defineProperty({__proto__:null,ADD_COMMENT:_R,CANNOT_DELETE_VARIABLE_PROCEDURE:XR,CHANGE_VALUE_TITLE:yR,CLEAN_UP:OR,COLLAPSED_WARNINGS_WARNING:Uv,COLLAPSE_ALL:RR,COLLAPSE_BLOCK:bR,COLOUR_BLEND_COLOUR1:nS,COLOUR_BLEND_COLOUR2:lS,COLOUR_BLEND_HELPURL:iS,COLOUR_BLEND_RATIO:cS,COLOUR_BLEND_TITLE:rS,COLOUR_BLEND_TOOLTIP:uS,COLOUR_HUE:nR,COLOUR_PICKER_HELPURL:zR,COLOUR_PICKER_TOOLTIP:jR,COLOUR_RANDOM_HELPURL:KR,COLOUR_RANDOM_TITLE:JR,COLOUR_RANDOM_TOOLTIP:qR,COLOUR_RGB_BLUE:sS,COLOUR_RGB_GREEN:tS,COLOUR_RGB_HELPURL:QR,COLOUR_RGB_RED:eS,COLOUR_RGB_TITLE:ZR,COLOUR_RGB_TOOLTIP:oS,CONTROLS_FLOW_STATEMENTS_HELPURL:LS,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:AS,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:MS,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:vS,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:yS,CONTROLS_FLOW_STATEMENTS_WARNING:kS,CONTROLS_FOREACH_HELPURL:RS,CONTROLS_FOREACH_INPUT_DO:NS,CONTROLS_FOREACH_TITLE:SS,CONTROLS_FOREACH_TOOLTIP:CS,CONTROLS_FOR_HELPURL:fS,CONTROLS_FOR_INPUT_DO:bS,CONTROLS_FOR_TITLE:OS,CONTROLS_FOR_TOOLTIP:IS,CONTROLS_IF_ELSEIF_TITLE_ELSEIF:XS,CONTROLS_IF_ELSEIF_TOOLTIP:YS,CONTROLS_IF_ELSE_TITLE_ELSE:zS,CONTROLS_IF_ELSE_TOOLTIP:jS,CONTROLS_IF_HELPURL:DS,CONTROLS_IF_IF_TITLE_IF:VS,CONTROLS_IF_IF_TOOLTIP:WS,CONTROLS_IF_MSG_ELSE:HS,CONTROLS_IF_MSG_ELSEIF:US,CONTROLS_IF_MSG_IF:FS,CONTROLS_IF_MSG_THEN:GS,CONTROLS_IF_TOOLTIP_1:wS,CONTROLS_IF_TOOLTIP_2:PS,CONTROLS_IF_TOOLTIP_3:xS,CONTROLS_IF_TOOLTIP_4:BS,CONTROLS_REPEAT_HELPURL:aS,CONTROLS_REPEAT_INPUT_DO:dS,CONTROLS_REPEAT_TITLE:hS,CONTROLS_REPEAT_TOOLTIP:$S,CONTROLS_WHILEUNTIL_HELPURL:_S,CONTROLS_WHILEUNTIL_INPUT_DO:pS,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:gS,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:TS,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:ES,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:mS,DELETE_ALL_BLOCKS:IR,DELETE_BLOCK:ER,DELETE_VARIABLE:YR,DELETE_VARIABLE_CONFIRMATION:WR,DELETE_X_BLOCKS:fR,DIALOG_CANCEL:Gv,DIALOG_OK:Hv,DISABLE_BLOCK:CR,DUPLICATE_BLOCK:$R,DUPLICATE_COMMENT:TR,ENABLE_BLOCK:LR,EXPAND_ALL:NR,EXPAND_BLOCK:SR,EXTERNAL_INPUTS:gR,HELP:AR,INLINE_INPUTS:mR,LISTS_CREATE_EMPTY_HELPURL:gA,LISTS_CREATE_EMPTY_TITLE:mA,LISTS_CREATE_EMPTY_TOOLTIP:EA,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:bA,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:RA,LISTS_CREATE_WITH_HELPURL:fA,LISTS_CREATE_WITH_INPUT_WITH:OA,LISTS_CREATE_WITH_ITEM_TITLE:SA,LISTS_CREATE_WITH_ITEM_TOOLTIP:NA,LISTS_CREATE_WITH_TOOLTIP:IA,LISTS_GET_INDEX_FIRST:jA,LISTS_GET_INDEX_FROM_END:zA,LISTS_GET_INDEX_FROM_START:YA,LISTS_GET_INDEX_GET:VA,LISTS_GET_INDEX_GET_REMOVE:WA,LISTS_GET_INDEX_HELPURL:GA,LISTS_GET_INDEX_INPUT_IN_LIST:QA,LISTS_GET_INDEX_LAST:KA,LISTS_GET_INDEX_RANDOM:JA,LISTS_GET_INDEX_REMOVE:XA,LISTS_GET_INDEX_TAIL:qA,LISTS_GET_INDEX_TOOLTIP_GET_FIRST:sM,LISTS_GET_INDEX_TOOLTIP_GET_FROM:tM,LISTS_GET_INDEX_TOOLTIP_GET_LAST:oM,LISTS_GET_INDEX_TOOLTIP_GET_RANDOM:iM,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST:nM,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM:rM,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST:lM,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM:cM,LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST:aM,LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM:uM,LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST:hM,LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM:dM,LISTS_GET_SUBLIST_END_FROM_END:yM,LISTS_GET_SUBLIST_END_FROM_START:vM,LISTS_GET_SUBLIST_END_LAST:kM,LISTS_GET_SUBLIST_HELPURL:NM,LISTS_GET_SUBLIST_INPUT_IN_LIST:CM,LISTS_GET_SUBLIST_START_FIRST:MM,LISTS_GET_SUBLIST_START_FROM_END:AM,LISTS_GET_SUBLIST_START_FROM_START:LM,LISTS_GET_SUBLIST_TAIL:DM,LISTS_GET_SUBLIST_TOOLTIP:wM,LISTS_HUE:rR,LISTS_INDEX_FROM_END_TOOLTIP:eM,LISTS_INDEX_FROM_START_TOOLTIP:ZA,LISTS_INDEX_OF_FIRST:FA,LISTS_INDEX_OF_HELPURL:xA,LISTS_INDEX_OF_INPUT_IN_LIST:BA,LISTS_INDEX_OF_LAST:UA,LISTS_INDEX_OF_TOOLTIP:HA,LISTS_INLIST:PA,LISTS_ISEMPTY_HELPURL:kA,LISTS_ISEMPTY_TITLE:DA,LISTS_ISEMPTY_TOOLTIP:wA,LISTS_LENGTH_HELPURL:MA,LISTS_LENGTH_TITLE:vA,LISTS_LENGTH_TOOLTIP:yA,LISTS_REPEAT_HELPURL:CA,LISTS_REPEAT_TITLE:AA,LISTS_REPEAT_TOOLTIP:LA,LISTS_REVERSE_HELPURL:JM,LISTS_REVERSE_MESSAGE0:qM,LISTS_REVERSE_TOOLTIP:QM,LISTS_SET_INDEX_HELPURL:$M,LISTS_SET_INDEX_INPUT_IN_LIST:_M,LISTS_SET_INDEX_INPUT_TO:gM,LISTS_SET_INDEX_INSERT:TM,LISTS_SET_INDEX_SET:pM,LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST:bM,LISTS_SET_INDEX_TOOLTIP_INSERT_FROM:OM,LISTS_SET_INDEX_TOOLTIP_INSERT_LAST:RM,LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM:SM,LISTS_SET_INDEX_TOOLTIP_SET_FIRST:EM,LISTS_SET_INDEX_TOOLTIP_SET_FROM:mM,LISTS_SET_INDEX_TOOLTIP_SET_LAST:fM,LISTS_SET_INDEX_TOOLTIP_SET_RANDOM:IM,LISTS_SORT_HELPURL:PM,LISTS_SORT_ORDER_ASCENDING:FM,LISTS_SORT_ORDER_DESCENDING:UM,LISTS_SORT_TITLE:xM,LISTS_SORT_TOOLTIP:BM,LISTS_SORT_TYPE_IGNORECASE:VM,LISTS_SORT_TYPE_NUMERIC:HM,LISTS_SORT_TYPE_TEXT:GM,LISTS_SPLIT_HELPURL:WM,LISTS_SPLIT_LIST_FROM_TEXT:XM,LISTS_SPLIT_TEXT_FROM_LIST:YM,LISTS_SPLIT_TOOLTIP_JOIN:KM,LISTS_SPLIT_TOOLTIP_SPLIT:jM,LISTS_SPLIT_WITH_DELIMITER:zM,LOGIC_BOOLEAN_FALSE:dN,LOGIC_BOOLEAN_HELPURL:aN,LOGIC_BOOLEAN_TOOLTIP:$N,LOGIC_BOOLEAN_TRUE:hN,LOGIC_COMPARE_HELPURL:KS,LOGIC_COMPARE_TOOLTIP_EQ:JS,LOGIC_COMPARE_TOOLTIP_GT:eN,LOGIC_COMPARE_TOOLTIP_GTE:tN,LOGIC_COMPARE_TOOLTIP_LT:QS,LOGIC_COMPARE_TOOLTIP_LTE:ZS,LOGIC_COMPARE_TOOLTIP_NEQ:qS,LOGIC_HUE:tR,LOGIC_NEGATE_HELPURL:lN,LOGIC_NEGATE_TITLE:cN,LOGIC_NEGATE_TOOLTIP:uN,LOGIC_NULL:pN,LOGIC_NULL_HELPURL:_N,LOGIC_NULL_TOOLTIP:TN,LOGIC_OPERATION_AND:iN,LOGIC_OPERATION_HELPURL:sN,LOGIC_OPERATION_OR:nN,LOGIC_OPERATION_TOOLTIP_AND:oN,LOGIC_OPERATION_TOOLTIP_OR:rN,LOGIC_TERNARY_CONDITION:mN,LOGIC_TERNARY_HELPURL:gN,LOGIC_TERNARY_IF_FALSE:fN,LOGIC_TERNARY_IF_TRUE:EN,LOGIC_TERNARY_TOOLTIP:IN,LOOPS_HUE:sR,MATH_ADDITION_SYMBOL:RN,MATH_ARITHMETIC_HELPURL:wN,MATH_ARITHMETIC_TOOLTIP_ADD:PN,MATH_ARITHMETIC_TOOLTIP_DIVIDE:FN,MATH_ARITHMETIC_TOOLTIP_MINUS:xN,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:BN,MATH_ARITHMETIC_TOOLTIP_POWER:UN,MATH_ATAN2_HELPURL:QC,MATH_ATAN2_TITLE:ZC,MATH_ATAN2_TOOLTIP:eL,MATH_CHANGE_HELPURL:_C,MATH_CHANGE_TITLE:pC,MATH_CHANGE_TITLE_ITEM:TC,MATH_CHANGE_TOOLTIP:gC,MATH_CONSTANT_HELPURL:iC,MATH_CONSTANT_TOOLTIP:rC,MATH_CONSTRAIN_HELPURL:VC,MATH_CONSTRAIN_TITLE:WC,MATH_CONSTRAIN_TOOLTIP:XC,MATH_DIVISION_SYMBOL:NN,MATH_HUE:oR,MATH_IS_DIVISIBLE_BY:dC,MATH_IS_EVEN:nC,MATH_IS_NEGATIVE:hC,MATH_IS_ODD:lC,MATH_IS_POSITIVE:aC,MATH_IS_PRIME:cC,MATH_IS_TOOLTIP:$C,MATH_IS_WHOLE:uC,MATH_MODULO_HELPURL:UC,MATH_MODULO_TITLE:HC,MATH_MODULO_TOOLTIP:GC,MATH_MULTIPLICATION_SYMBOL:CN,MATH_NUMBER_HELPURL:ON,MATH_NUMBER_TOOLTIP:bN,MATH_ONLIST_HELPURL:bC,MATH_ONLIST_OPERATOR_AVERAGE:MC,MATH_ONLIST_OPERATOR_MAX:LC,MATH_ONLIST_OPERATOR_MEDIAN:yC,MATH_ONLIST_OPERATOR_MIN:NC,MATH_ONLIST_OPERATOR_MODE:DC,MATH_ONLIST_OPERATOR_RANDOM:BC,MATH_ONLIST_OPERATOR_STD_DEV:PC,MATH_ONLIST_OPERATOR_SUM:RC,MATH_ONLIST_TOOLTIP_AVERAGE:vC,MATH_ONLIST_TOOLTIP_MAX:AC,MATH_ONLIST_TOOLTIP_MEDIAN:kC,MATH_ONLIST_TOOLTIP_MIN:CC,MATH_ONLIST_TOOLTIP_MODE:wC,MATH_ONLIST_TOOLTIP_RANDOM:FC,MATH_ONLIST_TOOLTIP_STD_DEV:xC,MATH_ONLIST_TOOLTIP_SUM:SC,MATH_POWER_SYMBOL:LN,MATH_RANDOM_FLOAT_HELPURL:KC,MATH_RANDOM_FLOAT_TITLE_RANDOM:JC,MATH_RANDOM_FLOAT_TOOLTIP:qC,MATH_RANDOM_INT_HELPURL:YC,MATH_RANDOM_INT_TITLE:zC,MATH_RANDOM_INT_TOOLTIP:jC,MATH_ROUND_HELPURL:mC,MATH_ROUND_OPERATOR_ROUND:fC,MATH_ROUND_OPERATOR_ROUNDDOWN:OC,MATH_ROUND_OPERATOR_ROUNDUP:IC,MATH_ROUND_TOOLTIP:EC,MATH_SINGLE_HELPURL:HN,MATH_SINGLE_OP_ABSOLUTE:WN,MATH_SINGLE_OP_ROOT:GN,MATH_SINGLE_TOOLTIP_ABS:XN,MATH_SINGLE_TOOLTIP_EXP:KN,MATH_SINGLE_TOOLTIP_LN:zN,MATH_SINGLE_TOOLTIP_LOG10:jN,MATH_SINGLE_TOOLTIP_NEG:YN,MATH_SINGLE_TOOLTIP_POW10:JN,MATH_SINGLE_TOOLTIP_ROOT:VN,MATH_SUBTRACTION_SYMBOL:SN,MATH_TRIG_ACOS:kN,MATH_TRIG_ASIN:yN,MATH_TRIG_ATAN:DN,MATH_TRIG_COS:MN,MATH_TRIG_HELPURL:qN,MATH_TRIG_SIN:AN,MATH_TRIG_TAN:vN,MATH_TRIG_TOOLTIP_ACOS:sC,MATH_TRIG_TOOLTIP_ASIN:tC,MATH_TRIG_TOOLTIP_ATAN:oC,MATH_TRIG_TOOLTIP_COS:ZN,MATH_TRIG_TOOLTIP_SIN:QN,MATH_TRIG_TOOLTIP_TAN:eC,NEW_COLOUR_VARIABLE:BR,NEW_NUMBER_VARIABLE:xR,NEW_STRING_VARIABLE:PR,NEW_VARIABLE:wR,NEW_VARIABLE_TITLE:UR,NEW_VARIABLE_TYPE_TITLE:FR,ORDINAL_NUMBER_SUFFIX:ZM,PROCEDURES_ALLOW_STATEMENTS:bv,PROCEDURES_BEFORE_PARAMS:av,PROCEDURES_CALLNORETURN_HELPURL:Sv,PROCEDURES_CALLNORETURN_TOOLTIP:Nv,PROCEDURES_CALLRETURN_HELPURL:Cv,PROCEDURES_CALLRETURN_TOOLTIP:Lv,PROCEDURES_CALL_BEFORE_PARAMS:hv,PROCEDURES_CALL_DISABLED_DEF_WARNING:dv,PROCEDURES_CREATE_DO:Dv,PROCEDURES_DEFNORETURN_COMMENT:pv,PROCEDURES_DEFNORETURN_DO:$v,PROCEDURES_DEFNORETURN_HELPURL:lv,PROCEDURES_DEFNORETURN_PROCEDURE:uv,PROCEDURES_DEFNORETURN_TITLE:cv,PROCEDURES_DEFNORETURN_TOOLTIP:_v,PROCEDURES_DEFRETURN_COMMENT:fv,PROCEDURES_DEFRETURN_DO:Ev,PROCEDURES_DEFRETURN_HELPURL:Tv,PROCEDURES_DEFRETURN_PROCEDURE:mv,PROCEDURES_DEFRETURN_RETURN:Iv,PROCEDURES_DEFRETURN_TITLE:gv,PROCEDURES_DEFRETURN_TOOLTIP:Ov,PROCEDURES_DEF_DUPLICATE_WARNING:Rv,PROCEDURES_HIGHLIGHT_DEF:kv,PROCEDURES_HUE:uR,PROCEDURES_IFRETURN_HELPURL:Pv,PROCEDURES_IFRETURN_TOOLTIP:wv,PROCEDURES_IFRETURN_WARNING:xv,PROCEDURES_MUTATORARG_TITLE:vv,PROCEDURES_MUTATORARG_TOOLTIP:yv,PROCEDURES_MUTATORCONTAINER_TITLE:Av,PROCEDURES_MUTATORCONTAINER_TOOLTIP:Mv,REDO:vR,REMOVE_COMMENT:pR,RENAME_VARIABLE:kR,RENAME_VARIABLE_TITLE:DR,TEXTS_HUE:iR,TEXT_APPEND_HELPURL:aL,TEXT_APPEND_TITLE:hL,TEXT_APPEND_TOOLTIP:$L,TEXT_APPEND_VARIABLE:dL,TEXT_CHANGECASE_HELPURL:WL,TEXT_CHANGECASE_OPERATOR_LOWERCASE:zL,TEXT_CHANGECASE_OPERATOR_TITLECASE:jL,TEXT_CHANGECASE_OPERATOR_UPPERCASE:YL,TEXT_CHANGECASE_TOOLTIP:XL,TEXT_CHARAT_FIRST:AL,TEXT_CHARAT_FROM_END:LL,TEXT_CHARAT_FROM_START:CL,TEXT_CHARAT_HELPURL:SL,TEXT_CHARAT_LAST:ML,TEXT_CHARAT_RANDOM:vL,TEXT_CHARAT_TAIL:yL,TEXT_CHARAT_TITLE:NL,TEXT_CHARAT_TOOLTIP:kL,TEXT_COUNT_HELPURL:uA,TEXT_COUNT_MESSAGE0:cA,TEXT_COUNT_TOOLTIP:aA,TEXT_CREATE_JOIN_ITEM_TITLE_ITEM:cL,TEXT_CREATE_JOIN_ITEM_TOOLTIP:uL,TEXT_CREATE_JOIN_TITLE_JOIN:nL,TEXT_CREATE_JOIN_TOOLTIP:lL,TEXT_GET_SUBSTRING_END_FROM_END:HL,TEXT_GET_SUBSTRING_END_FROM_START:UL,TEXT_GET_SUBSTRING_END_LAST:GL,TEXT_GET_SUBSTRING_HELPURL:wL,TEXT_GET_SUBSTRING_INPUT_IN_TEXT:PL,TEXT_GET_SUBSTRING_START_FIRST:FL,TEXT_GET_SUBSTRING_START_FROM_END:BL,TEXT_GET_SUBSTRING_START_FROM_START:xL,TEXT_GET_SUBSTRING_TAIL:VL,TEXT_GET_SUBSTRING_TOOLTIP:DL,TEXT_INDEXOF_HELPURL:fL,TEXT_INDEXOF_OPERATOR_FIRST:bL,TEXT_INDEXOF_OPERATOR_LAST:RL,TEXT_INDEXOF_TITLE:OL,TEXT_INDEXOF_TOOLTIP:IL,TEXT_ISEMPTY_HELPURL:gL,TEXT_ISEMPTY_TITLE:mL,TEXT_ISEMPTY_TOOLTIP:EL,TEXT_JOIN_HELPURL:oL,TEXT_JOIN_TITLE_CREATEWITH:iL,TEXT_JOIN_TOOLTIP:rL,TEXT_LENGTH_HELPURL:_L,TEXT_LENGTH_TITLE:pL,TEXT_LENGTH_TOOLTIP:TL,TEXT_PRINT_HELPURL:eA,TEXT_PRINT_TITLE:tA,TEXT_PRINT_TOOLTIP:sA,TEXT_PROMPT_HELPURL:oA,TEXT_PROMPT_TOOLTIP_NUMBER:nA,TEXT_PROMPT_TOOLTIP_TEXT:lA,TEXT_PROMPT_TYPE_NUMBER:rA,TEXT_PROMPT_TYPE_TEXT:iA,TEXT_REPLACE_HELPURL:dA,TEXT_REPLACE_MESSAGE0:hA,TEXT_REPLACE_TOOLTIP:$A,TEXT_REVERSE_HELPURL:pA,TEXT_REVERSE_MESSAGE0:_A,TEXT_REVERSE_TOOLTIP:TA,TEXT_TEXT_HELPURL:tL,TEXT_TEXT_TOOLTIP:sL,TEXT_TRIM_HELPURL:KL,TEXT_TRIM_OPERATOR_BOTH:qL,TEXT_TRIM_OPERATOR_LEFT:QL,TEXT_TRIM_OPERATOR_RIGHT:ZL,TEXT_TRIM_TOOLTIP:JL,TODAY:dR,UNDO:MR,UNNAMED_KEY:hR,VARIABLES_DEFAULT_NAME:aR,VARIABLES_DYNAMIC_HUE:cR,VARIABLES_GET_CREATE_SET:sv,VARIABLES_GET_HELPURL:ev,VARIABLES_GET_TOOLTIP:tv,VARIABLES_HUE:lR,VARIABLES_SET:iv,VARIABLES_SET_CREATE_GET:nv,VARIABLES_SET_HELPURL:ov,VARIABLES_SET_TOOLTIP:rv,VARIABLE_ALREADY_EXISTS:HR,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:GR,VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER:VR,WORKSPACE_ARIA_LABEL:Fv,WORKSPACE_COMMENT_DEFAULT_TEXT:Bv},Symbol.toStringTag,{value:"Module"}));/** - * @license - * Copyright 2023 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */class k$ extends Q.Field{constructor(o,c,m){super(Q.Field.SKIP_SETUP);et(this,"picker",null);et(this,"highlightedIndex",null);et(this,"boundEvents",[]);et(this,"SERIALIZABLE",!0);et(this,"CURSOR","default");et(this,"isDirty_",!1);et(this,"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"]);et(this,"titles",[]);et(this,"columns",7);o!==Q.Field.SKIP_SETUP&&(m&&this.configure_(m),this.setValue(o),c&&this.setValidator(c))}configure_(o){super.configure_(o),o.colourOptions&&(this.colours=o.colourOptions),o.colourTitles&&(this.titles=o.colourTitles),o.columns&&(this.columns=o.columns)}initView(){const o=this.getConstants();if(!o)throw Error("Constants not found");this.size_=new Q.utils.Size(o.FIELD_COLOUR_DEFAULT_WIDTH,o.FIELD_COLOUR_DEFAULT_HEIGHT),this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1",this.getBorderRect().setAttribute("stroke","#fff"),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){if(!this.getSourceBlock())throw new Q.UnattachedFieldError;const c=this.getConstants();return this.blockIsSimpleReporter()&&!!(c!=null&&c.FIELD_COLOUR_FULL_BLOCK)}blockIsSimpleReporter(){const o=this.getSourceBlock();if(!o)throw new Q.UnattachedFieldError;if(!o.outputConnection)return!1;for(const c of o.inputList)if(c.connection||c.fieldRow.length>1)return!1;return!0}applyColour(){const o=this.getSourceBlock();if(!o)throw new Q.UnattachedFieldError;if(!this.fieldGroup_)return;const c=this.borderRect_;if(!c)throw new Error("The border rect has not been initialized");this.isFullBlockField()?(c.style.display="none",o.pathObject.svgPath.setAttribute("fill",this.getValue()),o.pathObject.svgPath.setAttribute("stroke","#fff")):(c.style.display="block",c.style.fill=this.getValue())}getSize(){var o;return(o=this.getConstants())!=null&&o.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();const o=this.getSourceBlock();if(!o)throw new Q.UnattachedFieldError;o.applyColour()}updateSize_(o){const c=this.getConstants();if(!c)return;let m,f;this.isFullBlockField()?(m=(o??0)*2,f=c.FIELD_TEXT_HEIGHT):(m=c.FIELD_COLOUR_DEFAULT_WIDTH,f=c.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=f,this.size_.width=m,this.positionBorderRect_()}doClassValidation_(o){return typeof o!="string"?null:Q.utils.colour.parse(o)}getText(){let o=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(o)&&(o="#"+o[1]+o[3]+o[5]),o}setColours(o,c){return this.colours=o,c&&(this.titles=c),this}setColumns(o){return this.columns=o,this}showEditor_(){if(this.dropdownCreate(),!this.picker)throw Error("Picker not found");Q.DropDownDiv.getContentDiv().appendChild(this.picker),Q.DropDownDiv.showPositionedByField(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(o){const c=o.target,m=c&&c.getAttribute("data-colour");m!==null&&(this.setValue(m==="transparent"?"#ffffff":m),Q.DropDownDiv.hideIfOwner(this))}onKeyDown(o){let c=!0,m;switch(o.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":if(m=this.getHighlighted(),m){const f=m.getAttribute("data-colour");f!==null&&this.setValue(f)}Q.DropDownDiv.hideWithoutAnimation();break;default:c=!1}c&&o.stopPropagation()}moveHighlightBy(o,c){if(!this.highlightedIndex)return;const m=this.colours,f=this.columns;let R=this.highlightedIndex%f,N=Math.floor(this.highlightedIndex/f);R+=o,N+=c,o<0?R<0&&N>0?(R=f-1,N--):R<0&&(R=0):o>0?R>f-1&&Nf-1&&R--:c<0?N<0&&(N=0):c>0&&N>Math.floor(m.length/f)-1&&(N=Math.floor(m.length/f)-1);const k=this.picker.childNodes[N].childNodes[R],F=N*f+R;this.setHighlightedCell(k,F)}onMouseMove(o){const c=o.target,m=c&&Number(c.getAttribute("data-index"));m!==null&&m!==this.highlightedIndex&&this.setHighlightedCell(c,m)}onMouseEnter(){var o;(o=this.picker)==null||o.focus({preventScroll:!0})}onMouseLeave(){var c;(c=this.picker)==null||c.blur();const o=this.getHighlighted();o&&Q.utils.dom.removeClass(o,"blocklyColourHighlighted")}getHighlighted(){var f;if(!this.highlightedIndex)return null;const o=this.highlightedIndex%this.columns,c=Math.floor(this.highlightedIndex/this.columns),m=(f=this.picker)==null?void 0:f.childNodes[c];return m?m.childNodes[o]:null}setHighlightedCell(o,c){const m=this.getHighlighted();m&&Q.utils.dom.removeClass(m,"blocklyColourHighlighted"),Q.utils.dom.addClass(o,"blocklyColourHighlighted"),this.highlightedIndex=c;const f=o.getAttribute("id");f&&this.picker&&Q.utils.aria.setState(this.picker,Q.utils.aria.State.ACTIVEDESCENDANT,f)}dropdownCreate(){const o=this.columns,c=this.colours,m=this.getValue(),f=document.createElement("table");f.className="blocklyColourTable",f.tabIndex=0,f.dir="ltr",Q.utils.aria.setRole(f,Q.utils.aria.Role.GRID),Q.utils.aria.setState(f,Q.utils.aria.State.EXPANDED,!0),Q.utils.aria.setState(f,Q.utils.aria.State.ROWCOUNT,Math.floor(c.length/o)),Q.utils.aria.setState(f,Q.utils.aria.State.COLCOUNT,o);let R=null;for(let N=0;Ntr>td { - border: 0.5px solid #888; - box-sizing: border-box; - cursor: pointer; - display: inline-block; - height: 42px; - padding: 0; - border-radius: 50%; - margin: 4px; - width: 42px; -} - -.blocklyColourTable>tr>td.blocklyColourHighlighted { - border-color: #eee; - box-shadow: 2px 2px 7px 2px rgba(0, 0, 0, 0.3); - position: relative; -} - -.blocklyColourSelected, .blocklyColourSelected:hover { - border-color: #eee !important; - outline: 1px solid #333; - position: relative; -} -`);var JE={exports:{}};(function(n,h){(function(o,c){n.exports=c(Co())})(hs,function(o){var c=o.__namespace__,m=function(l,_){return["[]",$.ATOMIC]},f=function(l,_){const E=Array(l.itemCount_);for(let b=0;b String(b) ? 1 : -1; }, - 'IGNORE_CASE': function(a, b) { - return String(a).toLowerCase() > String(b).toLowerCase() ? 1 : -1; }, - }; - var compare = compareFuncs[type]; - return function(a, b) { return compare(a, b) * direction; }; -} - `),[E+".slice().sort("+_+'("'+l+'", '+b+"))",$.FUNCTION_CALL]},re=function(l,_){let E=_.valueToCode(l,"INPUT",$.MEMBER);if(_=_.valueToCode(l,"DELIM",$.NONE)||"''",l=l.getFieldValue("MODE"),l==="SPLIT")E||(E="''"),l="split";else if(l==="JOIN")E||(E="[]"),l="join";else throw Error("Unknown mode: "+l);return[E+"."+l+"("+_+")",$.FUNCTION_CALL]},X=function(l,_){return[(_.valueToCode(l,"LIST",$.FUNCTION_CALL)||"[]")+".slice().reverse()",$.FUNCTION_CALL]},be=function(l,_){var E=0;let b="";_.STATEMENT_PREFIX&&(b+=_.injectId(_.STATEMENT_PREFIX,l));do{const B=_.valueToCode(l,"IF"+E,$.NONE)||"false";let te=_.statementToCode(l,"DO"+E);_.STATEMENT_SUFFIX&&(te=_.prefixLines(_.injectId(_.STATEMENT_SUFFIX,l),_.INDENT)+te),b+=(0",GTE:">="}[l.getFieldValue("OP")],b=E==="=="||E==="!="?$.EQUALITY:$.RELATIONAL,B=_.valueToCode(l,"A",b)||"0";return l=_.valueToCode(l,"B",b)||"0",[B+" "+E+" "+l,b]},Se=function(l,_){const E=l.getFieldValue("OP")==="AND"?"&&":"||",b=E==="&&"?$.LOGICAL_AND:$.LOGICAL_OR;let B=_.valueToCode(l,"A",b);return l=_.valueToCode(l,"B",b),B||l?(_=E==="&&"?"true":"false",B||(B=_),l||(l=_)):l=B="false",[B+" "+E+" "+l,b]},ve=function(l,_){const E=$.LOGICAL_NOT;return["!"+(_.valueToCode(l,"BOOL",E)||"true"),E]},de=function(l,_){return[l.getFieldValue("BOOL")==="TRUE"?"true":"false",$.ATOMIC]},Ue=function(l,_){return["null",$.ATOMIC]},it=function(l,_){const E=_.valueToCode(l,"IF",$.CONDITIONAL)||"false",b=_.valueToCode(l,"THEN",$.CONDITIONAL)||"null";return l=_.valueToCode(l,"ELSE",$.CONDITIONAL)||"null",[E+" ? "+b+" : "+l,$.CONDITIONAL]},He=function(l,_){let E;E=l.getField("TIMES")?String(Number(l.getFieldValue("TIMES"))):_.valueToCode(l,"TIMES",$.ASSIGNMENT)||"0";let b=_.statementToCode(l,"DO");b=_.addLoopTrap(b,l),l="";const B=_.nameDB_.getDistinctName("count",c.NameType$$module$build$src$core$names.VARIABLE);let te=E;return E.match(/^\w+$/)||c.isNumber$$module$build$src$core$utils$string(E)||(te=_.nameDB_.getDistinctName("repeat_end",c.NameType$$module$build$src$core$names.VARIABLE),l+="var "+te+" = "+E+`; -`),l+("for (var "+B+" = 0; "+B+" < "+te+"; "+B+`++) { -`+b+`} -`)},$e=function(l,_){const E=l.getFieldValue("MODE")==="UNTIL";let b=_.valueToCode(l,"BOOL",E?$.LOGICAL_NOT:$.NONE)||"false",B=_.statementToCode(l,"DO");return B=_.addLoopTrap(B,l),E&&(b="!"+b),"while ("+b+`) { -`+B+`} -`},Ot=function(l,_){var E=_.getVariableName(l.getFieldValue("VAR")),b=_.valueToCode(l,"FROM",$.ASSIGNMENT)||"0",B=_.valueToCode(l,"TO",$.ASSIGNMENT)||"0";const te=_.valueToCode(l,"BY",$.ASSIGNMENT)||"1";let fe=_.statementToCode(l,"DO");if(fe=_.addLoopTrap(fe,l),c.isNumber$$module$build$src$core$utils$string(b)&&c.isNumber$$module$build$src$core$utils$string(B)&&c.isNumber$$module$build$src$core$utils$string(te))_=Number(b)<=Number(B),l="for ("+E+" = "+b+"; "+E+(_?" <= ":" >= ")+B+"; "+E,E=Math.abs(Number(te)),l=E===1?l+(_?"++":"--"):l+((_?" += ":" -= ")+E),l+=`) { -`+fe+`} -`;else{l="";let Ge=b;b.match(/^\w+$/)||c.isNumber$$module$build$src$core$utils$string(b)||(Ge=_.nameDB_.getDistinctName(E+"_start",c.NameType$$module$build$src$core$names.VARIABLE),l+="var "+Ge+" = "+b+`; -`),b=B,B.match(/^\w+$/)||c.isNumber$$module$build$src$core$utils$string(B)||(b=_.nameDB_.getDistinctName(E+"_end",c.NameType$$module$build$src$core$names.VARIABLE),l+="var "+b+" = "+B+`; -`),B=_.nameDB_.getDistinctName(E+"_inc",c.NameType$$module$build$src$core$names.VARIABLE),l+="var "+B+" = ",l=c.isNumber$$module$build$src$core$utils$string(te)?l+(Math.abs(Number(te))+`; -`):l+("Math.abs("+te+`); -`),l+="if ("+Ge+" > "+b+`) { -`,l+=_.INDENT+B+" = -"+B+`; -`,l=l+`} -for (`+(E+" = "+Ge+"; "+B+" >= 0 ? "+E+" <= "+b+" : "+E+" >= "+b+"; "+E+" += "+B+`) { -`+fe+`} -`)}return l},Pe=function(l,_){const E=_.getVariableName(l.getFieldValue("VAR"));var b=_.valueToCode(l,"LIST",$.ASSIGNMENT)||"[]";let B=_.statementToCode(l,"DO");B=_.addLoopTrap(B,l),l="";let te=b;return b.match(/^\w+$/)||(te=_.nameDB_.getDistinctName(E+"_list",c.NameType$$module$build$src$core$names.VARIABLE),l+="var "+te+" = "+b+`; -`),b=_.nameDB_.getDistinctName(E+"_index",c.NameType$$module$build$src$core$names.VARIABLE),B=_.INDENT+E+" = "+te+"["+b+`]; -`+B,l+("for (var "+b+" in "+te+`) { -`+B+`} -`)},at=function(l,_){let E="";if(_.STATEMENT_PREFIX&&(E+=_.injectId(_.STATEMENT_PREFIX,l)),_.STATEMENT_SUFFIX&&(E+=_.injectId(_.STATEMENT_SUFFIX,l)),_.STATEMENT_PREFIX){const b=l.getSurroundLoop();b&&!b.suppressPrefixSuffix&&(E+=_.injectId(_.STATEMENT_PREFIX,b))}switch(l.getFieldValue("FLOW")){case"BREAK":return E+`break; -`;case"CONTINUE":return E+`continue; -`}throw Error("Unknown flow statement.")},bt=function(l,_){return l=Number(l.getFieldValue("NUM")),[String(l),0<=l?$.ATOMIC:$.UNARY_NEGATION]},Rt=function(l,_){var E={ADD:[" + ",$.ADDITION],MINUS:[" - ",$.SUBTRACTION],MULTIPLY:[" * ",$.MULTIPLICATION],DIVIDE:[" / ",$.DIVISION],POWER:[null,$.NONE]}[l.getFieldValue("OP")];const b=E[0];E=E[1];const B=_.valueToCode(l,"A",E)||"0";return l=_.valueToCode(l,"B",E)||"0",b?[B+b+l,E]:["Math.pow("+B+", "+l+")",$.FUNCTION_CALL]},xe=function(l,_){const E=l.getFieldValue("OP");let b;if(E==="NEG")return l=_.valueToCode(l,"NUM",$.UNARY_NEGATION)||"0",l[0]==="-"&&(l=" "+l),["-"+l,$.UNARY_NEGATION];switch(l=E==="SIN"||E==="COS"||E==="TAN"?_.valueToCode(l,"NUM",$.DIVISION)||"0":_.valueToCode(l,"NUM",$.NONE)||"0",E){case"ABS":b="Math.abs("+l+")";break;case"ROOT":b="Math.sqrt("+l+")";break;case"LN":b="Math.log("+l+")";break;case"EXP":b="Math.exp("+l+")";break;case"POW10":b="Math.pow(10,"+l+")";break;case"ROUND":b="Math.round("+l+")";break;case"ROUNDUP":b="Math.ceil("+l+")";break;case"ROUNDDOWN":b="Math.floor("+l+")";break;case"SIN":b="Math.sin("+l+" / 180 * Math.PI)";break;case"COS":b="Math.cos("+l+" / 180 * Math.PI)";break;case"TAN":b="Math.tan("+l+" / 180 * Math.PI)"}if(b)return[b,$.FUNCTION_CALL];switch(E){case"LOG10":b="Math.log("+l+") / Math.log(10)";break;case"ASIN":b="Math.asin("+l+") / Math.PI * 180";break;case"ACOS":b="Math.acos("+l+") / Math.PI * 180";break;case"ATAN":b="Math.atan("+l+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+E)}return[b,$.DIVISION]},dt=function(l,_){return{PI:["Math.PI",$.MEMBER],E:["Math.E",$.MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",$.DIVISION],SQRT2:["Math.SQRT2",$.MEMBER],SQRT1_2:["Math.SQRT1_2",$.MEMBER],INFINITY:["Infinity",$.ATOMIC]}[l.getFieldValue("CONSTANT")]},Ne=function(l,_){var E={EVEN:[" % 2 === 0",$.MODULUS,$.EQUALITY],ODD:[" % 2 === 1",$.MODULUS,$.EQUALITY],WHOLE:[" % 1 === 0",$.MODULUS,$.EQUALITY],POSITIVE:[" > 0",$.RELATIONAL,$.RELATIONAL],NEGATIVE:[" < 0",$.RELATIONAL,$.RELATIONAL],DIVISIBLE_BY:[null,$.MODULUS,$.EQUALITY],PRIME:[null,$.NONE,$.FUNCTION_CALL]};const b=l.getFieldValue("PROPERTY"),[B,te,fe]=E[b];return E=_.valueToCode(l,"NUMBER_TO_CHECK",te)||"0",b==="PRIME"?l=_.provideFunction_("mathIsPrime",` -function ${_.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; -} -`)+"("+E+")":b==="DIVISIBLE_BY"?(l=_.valueToCode(l,"DIVISOR",$.MODULUS)||"0",l=E+" % "+l+" === 0"):l=E+B,[l,fe]},ye=function(l,_){const E=_.valueToCode(l,"DELTA",$.ADDITION)||"0";return l=_.getVariableName(l.getFieldValue("VAR")),l+" = (typeof "+l+" === 'number' ? "+l+" : 0) + "+E+`; -`},Le=function(l,_){var E=l.getFieldValue("OP");switch(E){case"SUM":l=_.valueToCode(l,"LIST",$.MEMBER)||"[]",l+=".reduce(function(x, y) {return x + y;}, 0)";break;case"MIN":l=_.valueToCode(l,"LIST",$.NONE)||"[]",l="Math.min.apply(null, "+l+")";break;case"MAX":l=_.valueToCode(l,"LIST",$.NONE)||"[]",l="Math.max.apply(null, "+l+")";break;case"AVERAGE":E=_.provideFunction_("mathMean",` -function ${_.FUNCTION_NAME_PLACEHOLDER_}(myList) { - return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length; -} -`),l=_.valueToCode(l,"LIST",$.NONE)||"[]",l=E+"("+l+")";break;case"MEDIAN":E=_.provideFunction_("mathMedian",` -function ${_.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]; - } -} -`),l=_.valueToCode(l,"LIST",$.NONE)||"[]",l=E+"("+l+")";break;case"MODE":E=_.provideFunction_("mathModes",` -function ${_.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; -} -`),l=_.valueToCode(l,"LIST",$.NONE)||"[]",l=E+"("+l+")";break;case"STD_DEV":E=_.provideFunction_("mathStandardDeviation",` -function ${_.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 /= n; - return Math.sqrt(variance); -} -`),l=_.valueToCode(l,"LIST",$.NONE)||"[]",l=E+"("+l+")";break;case"RANDOM":E=_.provideFunction_("mathRandomList",` -function ${_.FUNCTION_NAME_PLACEHOLDER_}(list) { - var x = Math.floor(Math.random() * list.length); - return list[x]; -} -`),l=_.valueToCode(l,"LIST",$.NONE)||"[]",l=E+"("+l+")";break;default:throw Error("Unknown operator: "+E)}return[l,$.FUNCTION_CALL]},ze=function(l,_){const E=_.valueToCode(l,"DIVIDEND",$.MODULUS)||"0";return l=_.valueToCode(l,"DIVISOR",$.MODULUS)||"0",[E+" % "+l,$.MODULUS]},$t=function(l,_){const E=_.valueToCode(l,"VALUE",$.NONE)||"0",b=_.valueToCode(l,"LOW",$.NONE)||"0";return l=_.valueToCode(l,"HIGH",$.NONE)||"Infinity",["Math.min(Math.max("+E+", "+b+"), "+l+")",$.FUNCTION_CALL]},_t=function(l,_){const E=_.valueToCode(l,"FROM",$.NONE)||"0";return l=_.valueToCode(l,"TO",$.NONE)||"0",[_.provideFunction_("mathRandomInt",` -function ${_.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); -} -`)+"("+E+", "+l+")",$.FUNCTION_CALL]},rt=function(l,_){return["Math.random()",$.FUNCTION_CALL]},xt=function(l,_){const E=_.valueToCode(l,"X",$.NONE)||"0";return["Math.atan2("+(_.valueToCode(l,"Y",$.NONE)||"0")+", "+E+") / Math.PI * 180",$.DIVISION]},It=function(l,_){const E=_.getProcedureName(l.getFieldValue("NAME"));var b="";_.STATEMENT_PREFIX&&(b+=_.injectId(_.STATEMENT_PREFIX,l)),_.STATEMENT_SUFFIX&&(b+=_.injectId(_.STATEMENT_SUFFIX,l)),b&&(b=_.prefixLines(b,_.INDENT));let B="";_.INFINITE_LOOP_TRAP&&(B=_.prefixLines(_.injectId(_.INFINITE_LOOP_TRAP,l),_.INDENT));let te="";l.getInput("STACK")&&(te=_.statementToCode(l,"STACK"));let fe="";l.getInput("RETURN")&&(fe=_.valueToCode(l,"RETURN",$.NONE)||"");let Ge="";te&&fe&&(Ge=b),fe&&(fe=_.INDENT+"return "+fe+`; -`);const ut=[],St=l.getVars();for(let Zs=0;ZsE?fe=$.SUBTRACTION:b&&(fe=$.UNARY_NEGATION),l=this.valueToCode(l,_,fe)||te,E===0&&!b?l:c.isNumber$$module$build$src$core$utils$string(l)?(l=String(Number(l)+E),b&&(l=String(-Number(l))),l):(0E&&(l=`${l} - ${-E}`),b&&(l=E?`-(${l})`:`-${l}`),Math.floor(B)>=Math.floor(fe)&&(l=`(${l})`),l)}},le=function(l,_,E){return _==="FIRST"?"0":_==="FROM_END"?l+".length - 1 - "+E:_==="LAST"?l+".length - 1":E},ce={};ce.lists_create_empty=m,ce.lists_create_with=f,ce.lists_getIndex=w,ce.lists_getSublist=W,ce.lists_indexOf=F,ce.lists_isEmpty=k,ce.lists_length=N,ce.lists_repeat=R,ce.lists_reverse=X,ce.lists_setIndex=P,ce.lists_sort=ae,ce.lists_split=re;var ue={};ue.controls_if=be,ue.controls_ifelse=be,ue.logic_boolean=de,ue.logic_compare=Re,ue.logic_negate=ve,ue.logic_null=Ue,ue.logic_operation=Se,ue.logic_ternary=it;var he={};he.controls_flow_statements=at,he.controls_for=Ot,he.controls_forEach=Pe,he.controls_repeat=He,he.controls_repeat_ext=He,he.controls_whileUntil=$e;var Ie={};Ie.math_arithmetic=Rt,Ie.math_atan2=xt,Ie.math_change=ye,Ie.math_constant=dt,Ie.math_constrain=$t,Ie.math_modulo=ze,Ie.math_number=bt,Ie.math_number_property=Ne,Ie.math_on_list=Le,Ie.math_random_float=rt,Ie.math_random_int=_t,Ie.math_round=xe,Ie.math_single=xe,Ie.math_trig=xe;var Ee={};Ee.procedures_callnoreturn=je,Ee.procedures_callreturn=ct,Ee.procedures_defnoreturn=It,Ee.procedures_defreturn=It,Ee.procedures_ifreturn=pt;var g=/^\s*'([^']|\\')*'\s*$/,O=function(l){return g.test(l)?[l,$.ATOMIC]:["String("+l+")",$.FUNCTION_CALL]},M=function(l,_,E){return _==="FIRST"?"0":_==="FROM_END"?l+".length - 1 - "+E:_==="LAST"?l+".length - 1":E},y={};y.text=Tt,y.text_append=pe,y.text_changeCase=Z,y.text_charAt=v,y.text_count=A,y.text_getSubstring=G,y.text_indexOf=C,y.text_isEmpty=Ae,y.text_join=kt,y.text_length=Je,y.text_print=q,y.text_prompt=ie,y.text_prompt_ext=ie,y.text_replace=U,y.text_reverse=K,y.text_trim=z;var Y={};Y.variables_get=oe,Y.variables_set=ne;var a={};a.variables_get_dynamic=oe,a.variables_set_dynamic=ne;var T=new L,d=Object.assign({},ce,ue,he,Ie,Ee,y,Y,a);for(const l in d)T.forBlock[l]=d[l];var u={};return u.JavascriptGenerator=L,u.Order=$,u.javascriptGenerator=T,u.__namespace__=c,u})})(JE);var bD=JE.exports,qE={exports:{}};(function(n,h){(function(o,c){n.exports=c(Co())})(hs,function(o){var c=o.__namespace__,m=function(a,T){return["[]",$.ATOMIC]},f=function(a,T){const d=Array(a.itemCount_);for(let u=0;u (direction * a.compareTo(b)).toInt(), - 'TEXT': (a, b) => direction * a.toString().compareTo(b.toString()), - 'IGNORE_CASE': - (a, b) => direction * - a.toString().toLowerCase().compareTo(b.toString().toLowerCase()) - }; - list = new List.from(list); - var compare = compareFuncs[type]; - list.sort(compare); - return list; -} -`)+"("+d+', "'+a+'", '+u+")",$.UNARY_POSTFIX]},re=function(a,T){let d=T.valueToCode(a,"INPUT",$.UNARY_POSTFIX);if(T=T.valueToCode(a,"DELIM",$.NONE)||"''",a=a.getFieldValue("MODE"),a==="SPLIT")d||(d="''"),a="split";else if(a==="JOIN")d||(d="[]"),a="join";else throw Error("Unknown mode: "+a);return[d+"."+a+"("+T+")",$.UNARY_POSTFIX]},X=function(a,T){return["new List.from("+(T.valueToCode(a,"LIST",$.NONE)||"[]")+".reversed)",$.UNARY_POSTFIX]},be=function(a,T){let d=0,u="",l,_;T.STATEMENT_PREFIX&&(u+=T.injectId(T.STATEMENT_PREFIX,a));do _=T.valueToCode(a,"IF"+d,$.NONE)||"false",l=T.statementToCode(a,"DO"+d),T.STATEMENT_SUFFIX&&(l=T.prefixLines(T.injectId(T.STATEMENT_SUFFIX,a),T.INDENT)+l),u+=(0",GTE:">="}[a.getFieldValue("OP")],u=d==="=="||d==="!="?$.EQUALITY:$.RELATIONAL,l=T.valueToCode(a,"A",u)||"0";return a=T.valueToCode(a,"B",u)||"0",[l+" "+d+" "+a,u]},Se=function(a,T){const d=a.getFieldValue("OP")==="AND"?"&&":"||",u=d==="&&"?$.LOGICAL_AND:$.LOGICAL_OR;let l=T.valueToCode(a,"A",u);return a=T.valueToCode(a,"B",u),l||a?(T=d==="&&"?"true":"false",l||(l=T),a||(a=T)):a=l="false",[l+" "+d+" "+a,u]},ve=function(a,T){const d=$.UNARY_PREFIX;return["!"+(T.valueToCode(a,"BOOL",d)||"true"),d]},de=function(a,T){return[a.getFieldValue("BOOL")==="TRUE"?"true":"false",$.ATOMIC]},Ue=function(a,T){return["null",$.ATOMIC]},it=function(a,T){const d=T.valueToCode(a,"IF",$.CONDITIONAL)||"false",u=T.valueToCode(a,"THEN",$.CONDITIONAL)||"null";return a=T.valueToCode(a,"ELSE",$.CONDITIONAL)||"null",[d+" ? "+u+" : "+a,$.CONDITIONAL]},He=function(a,T){let d;d=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):T.valueToCode(a,"TIMES",$.ASSIGNMENT)||"0";let u=T.statementToCode(a,"DO");u=T.addLoopTrap(u,a),a="";const l=T.nameDB_.getDistinctName("count",c.NameType$$module$build$src$core$names.VARIABLE);let _=d;return d.match(/^\w+$/)||c.isNumber$$module$build$src$core$utils$string(d)||(_=T.nameDB_.getDistinctName("repeat_end",c.NameType$$module$build$src$core$names.VARIABLE),a+="var "+_+" = "+d+`; -`),a+("for (int "+l+" = 0; "+l+" < "+_+"; "+l+`++) { -`+u+`} -`)},$e=function(a,T){const d=a.getFieldValue("MODE")==="UNTIL";let u=T.valueToCode(a,"BOOL",d?$.UNARY_PREFIX:$.NONE)||"false",l=T.statementToCode(a,"DO");return l=T.addLoopTrap(l,a),d&&(u="!"+u),"while ("+u+`) { -`+l+`} -`},Ot=function(a,T){var d=T.getVariableName(a.getFieldValue("VAR")),u=T.valueToCode(a,"FROM",$.ASSIGNMENT)||"0",l=T.valueToCode(a,"TO",$.ASSIGNMENT)||"0";const _=T.valueToCode(a,"BY",$.ASSIGNMENT)||"1";let E=T.statementToCode(a,"DO");if(E=T.addLoopTrap(E,a),c.isNumber$$module$build$src$core$utils$string(u)&&c.isNumber$$module$build$src$core$utils$string(l)&&c.isNumber$$module$build$src$core$utils$string(_))T=Number(u)<=Number(l),a="for ("+d+" = "+u+"; "+d+(T?" <= ":" >= ")+l+"; "+d,d=Math.abs(Number(_)),a=d===1?a+(T?"++":"--"):a+((T?" += ":" -= ")+d),a+=`) { -`+E+`} -`;else{a="";let b=u;u.match(/^\w+$/)||c.isNumber$$module$build$src$core$utils$string(u)||(b=T.nameDB_.getDistinctName(d+"_start",c.NameType$$module$build$src$core$names.VARIABLE),a+="var "+b+" = "+u+`; -`),u=l,l.match(/^\w+$/)||c.isNumber$$module$build$src$core$utils$string(l)||(u=T.nameDB_.getDistinctName(d+"_end",c.NameType$$module$build$src$core$names.VARIABLE),a+="var "+u+" = "+l+`; -`),l=T.nameDB_.getDistinctName(d+"_inc",c.NameType$$module$build$src$core$names.VARIABLE),a+="num "+l+" = ",a=c.isNumber$$module$build$src$core$utils$string(_)?a+(Math.abs(Number(_))+`; -`):a+("("+_+`).abs(); -`),a+="if ("+b+" > "+u+`) { -`,a+=T.INDENT+l+" = -"+l+`; -`,a=a+`} -for (`+(d+" = "+b+"; "+l+" >= 0 ? "+d+" <= "+u+" : "+d+" >= "+u+"; "+d+" += "+l+`) { -`+E+`} -`)}return a},Pe=function(a,T){const d=T.getVariableName(a.getFieldValue("VAR")),u=T.valueToCode(a,"LIST",$.ASSIGNMENT)||"[]";let l=T.statementToCode(a,"DO");return l=T.addLoopTrap(l,a),"for (var "+d+" in "+u+`) { -`+l+`} -`},at=function(a,T){let d="";if(T.STATEMENT_PREFIX&&(d+=T.injectId(T.STATEMENT_PREFIX,a)),T.STATEMENT_SUFFIX&&(d+=T.injectId(T.STATEMENT_SUFFIX,a)),T.STATEMENT_PREFIX){const u=a.getSurroundLoop();u&&!u.suppressPrefixSuffix&&(d+=T.injectId(T.STATEMENT_PREFIX,u))}switch(a.getFieldValue("FLOW")){case"BREAK":return d+`break; -`;case"CONTINUE":return d+`continue; -`}throw Error("Unknown flow statement.")},bt=function(a,T){return a=Number(a.getFieldValue("NUM")),a===1/0?["double.infinity",$.UNARY_POSTFIX]:a===-1/0?["-double.infinity",$.UNARY_PREFIX]:[String(a),0>a?$.UNARY_PREFIX:$.ATOMIC]},Rt=function(a,T){var d={ADD:[" + ",$.ADDITIVE],MINUS:[" - ",$.ADDITIVE],MULTIPLY:[" * ",$.MULTIPLICATIVE],DIVIDE:[" / ",$.MULTIPLICATIVE],POWER:[null,$.NONE]}[a.getFieldValue("OP")];const u=d[0];d=d[1];const l=T.valueToCode(a,"A",d)||"0";return a=T.valueToCode(a,"B",d)||"0",u?[l+u+a,d]:(T.definitions_.import_dart_math="import 'dart:math' as Math;",["Math.pow("+l+", "+a+")",$.UNARY_POSTFIX])},xe=function(a,T){const d=a.getFieldValue("OP");let u;if(d==="NEG")return a=T.valueToCode(a,"NUM",$.UNARY_PREFIX)||"0",a[0]==="-"&&(a=" "+a),["-"+a,$.UNARY_PREFIX];switch(T.definitions_.import_dart_math="import 'dart:math' as Math;",a=d==="ABS"||d.substring(0,5)==="ROUND"?T.valueToCode(a,"NUM",$.UNARY_POSTFIX)||"0":d==="SIN"||d==="COS"||d==="TAN"?T.valueToCode(a,"NUM",$.MULTIPLICATIVE)||"0":T.valueToCode(a,"NUM",$.NONE)||"0",d){case"ABS":u=a+".abs()";break;case"ROOT":u="Math.sqrt("+a+")";break;case"LN":u="Math.log("+a+")";break;case"EXP":u="Math.exp("+a+")";break;case"POW10":u="Math.pow(10,"+a+")";break;case"ROUND":u=a+".round()";break;case"ROUNDUP":u=a+".ceil()";break;case"ROUNDDOWN":u=a+".floor()";break;case"SIN":u="Math.sin("+a+" / 180 * Math.pi)";break;case"COS":u="Math.cos("+a+" / 180 * Math.pi)";break;case"TAN":u="Math.tan("+a+" / 180 * Math.pi)"}if(u)return[u,$.UNARY_POSTFIX];switch(d){case"LOG10":u="Math.log("+a+") / Math.log(10)";break;case"ASIN":u="Math.asin("+a+") / Math.pi * 180";break;case"ACOS":u="Math.acos("+a+") / Math.pi * 180";break;case"ATAN":u="Math.atan("+a+") / Math.pi * 180";break;default:throw Error("Unknown math operator: "+d)}return[u,$.MULTIPLICATIVE]},dt=function(a,T){const d={PI:["Math.pi",$.UNARY_POSTFIX],E:["Math.e",$.UNARY_POSTFIX],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",$.MULTIPLICATIVE],SQRT2:["Math.sqrt2",$.UNARY_POSTFIX],SQRT1_2:["Math.sqrt1_2",$.UNARY_POSTFIX],INFINITY:["double.infinity",$.ATOMIC]};return a=a.getFieldValue("CONSTANT"),a!=="INFINITY"&&(T.definitions_.import_dart_math="import 'dart:math' as Math;"),d[a]},Ne=function(a,T){var d={EVEN:[" % 2 == 0",$.MULTIPLICATIVE,$.EQUALITY],ODD:[" % 2 == 1",$.MULTIPLICATIVE,$.EQUALITY],WHOLE:[" % 1 == 0",$.MULTIPLICATIVE,$.EQUALITY],POSITIVE:[" > 0",$.RELATIONAL,$.RELATIONAL],NEGATIVE:[" < 0",$.RELATIONAL,$.RELATIONAL],DIVISIBLE_BY:[null,$.MULTIPLICATIVE,$.EQUALITY],PRIME:[null,$.NONE,$.UNARY_POSTFIX]};const u=a.getFieldValue("PROPERTY"),[l,_,E]=d[u];if(d=T.valueToCode(a,"NUMBER_TO_CHECK",_)||"0",u==="PRIME")T.definitions_.import_dart_math="import 'dart:math' as Math;",a=T.provideFunction_("math_isPrime",` -bool ${T.FUNCTION_NAME_PLACEHOLDER_}(n) { - // https://en.wikipedia.org/wiki/Primality_test#Naive_methods - if (n == 2 || n == 3) { - return true; - } - // False if n is null, negative, is 1, or not whole. - // And false if n is divisible by 2 or 3. - if (n == null || 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; -} -`)+"("+d+")";else if(u==="DIVISIBLE_BY"){if(a=T.valueToCode(a,"DIVISOR",$.MULTIPLICATIVE)||"0",a==="0")return["false",$.ATOMIC];a=d+" % "+a+" == 0"}else a=d+l;return[a,E]},ye=function(a,T){const d=T.valueToCode(a,"DELTA",$.ADDITIVE)||"0";return a=T.getVariableName(a.getFieldValue("VAR")),a+" = ("+a+" is num ? "+a+" : 0) + "+d+`; -`},Le=function(a,T){const d=a.getFieldValue("OP");switch(a=T.valueToCode(a,"LIST",$.NONE)||"[]",d){case"SUM":T=T.provideFunction_("math_sum",` -num ${T.FUNCTION_NAME_PLACEHOLDER_}(List myList) { - num sumVal = 0; - myList.forEach((num entry) {sumVal += entry;}); - return sumVal; -} -`)+"("+a+")";break;case"MIN":T.definitions_.import_dart_math="import 'dart:math' as Math;",T=T.provideFunction_("math_min",` -num ${T.FUNCTION_NAME_PLACEHOLDER_}(List myList) { - if (myList.isEmpty) return null; - num minVal = myList[0]; - myList.forEach((num entry) {minVal = Math.min(minVal, entry);}); - return minVal; -} -`)+"("+a+")";break;case"MAX":T.definitions_.import_dart_math="import 'dart:math' as Math;",T=T.provideFunction_("math_max",` -num ${T.FUNCTION_NAME_PLACEHOLDER_}(List myList) { - if (myList.isEmpty) return null; - num maxVal = myList[0]; - myList.forEach((num entry) {maxVal = Math.max(maxVal, entry);}); - return maxVal; -} -`)+"("+a+")";break;case"AVERAGE":T=T.provideFunction_("math_mean",` -num ${T.FUNCTION_NAME_PLACEHOLDER_}(List myList) { - // First filter list for numbers only. - List localList = new List.from(myList); - localList.removeWhere((a) => a is! num); - if (localList.isEmpty) return null; - num sumVal = 0; - localList.forEach((var entry) {sumVal += entry;}); - return sumVal / localList.length; -} -`)+"("+a+")";break;case"MEDIAN":T=T.provideFunction_("math_median",` -num ${T.FUNCTION_NAME_PLACEHOLDER_}(List myList) { - // First filter list for numbers only, then sort, then return middle value - // or the average of two middle values if list has an even number of elements. - List localList = new List.from(myList); - localList.removeWhere((a) => a is! num); - if (localList.isEmpty) return null; - localList.sort((a, b) => (a - b)); - int index = localList.length ~/ 2; - if (localList.length % 2 == 1) { - return localList[index]; - } else { - return (localList[index - 1] + localList[index]) / 2; - } -} -`)+"("+a+")";break;case"MODE":T.definitions_.import_dart_math="import 'dart:math' as Math;",T=T.provideFunction_("math_modes",` -List ${T.FUNCTION_NAME_PLACEHOLDER_}(List values) { - List modes = []; - List counts = []; - int maxCount = 0; - for (int i = 0; i < values.length; i++) { - var value = values[i]; - bool found = false; - int thisCount; - for (int j = 0; j < counts.length; j++) { - if (counts[j][0] == value) { - thisCount = ++counts[j][1]; - found = true; - break; - } - } - if (!found) { - counts.add([value, 1]); - thisCount = 1; - } - maxCount = Math.max(thisCount, maxCount); - } - for (int j = 0; j < counts.length; j++) { - if (counts[j][1] == maxCount) { - modes.add(counts[j][0]); - } - } - return modes; -} -`)+"("+a+")";break;case"STD_DEV":T.definitions_.import_dart_math="import 'dart:math' as Math;",T=T.provideFunction_("math_standard_deviation",` -num ${T.FUNCTION_NAME_PLACEHOLDER_}(List myList) { - // First filter list for numbers only. - List numbers = new List.from(myList); - numbers.removeWhere((a) => a is! num); - if (numbers.isEmpty) return null; - num n = numbers.length; - num sum = 0; - numbers.forEach((x) => sum += x); - num mean = sum / n; - num sumSquare = 0; - numbers.forEach((x) => sumSquare += Math.pow(x - mean, 2)); - return Math.sqrt(sumSquare / n); -} -`)+"("+a+")";break;case"RANDOM":T.definitions_.import_dart_math="import 'dart:math' as Math;",T=T.provideFunction_("math_random_item",` -dynamic ${T.FUNCTION_NAME_PLACEHOLDER_}(List myList) { - int x = new Math.Random().nextInt(myList.length); - return myList[x]; -} -`)+"("+a+")";break;default:throw Error("Unknown operator: "+d)}return[T,$.UNARY_POSTFIX]},ze=function(a,T){const d=T.valueToCode(a,"DIVIDEND",$.MULTIPLICATIVE)||"0";return a=T.valueToCode(a,"DIVISOR",$.MULTIPLICATIVE)||"0",[d+" % "+a,$.MULTIPLICATIVE]},$t=function(a,T){T.definitions_.import_dart_math="import 'dart:math' as Math;";const d=T.valueToCode(a,"VALUE",$.NONE)||"0",u=T.valueToCode(a,"LOW",$.NONE)||"0";return a=T.valueToCode(a,"HIGH",$.NONE)||"double.infinity",["Math.min(Math.max("+d+", "+u+"), "+a+")",$.UNARY_POSTFIX]},_t=function(a,T){T.definitions_.import_dart_math="import 'dart:math' as Math;";const d=T.valueToCode(a,"FROM",$.NONE)||"0";return a=T.valueToCode(a,"TO",$.NONE)||"0",[T.provideFunction_("math_random_int",` -int ${T.FUNCTION_NAME_PLACEHOLDER_}(num a, num b) { - if (a > b) { - // Swap a and b to ensure a is smaller. - num c = a; - a = b; - b = c; - } - return new Math.Random().nextInt(b - a + 1) + a; -} -`)+"("+d+", "+a+")",$.UNARY_POSTFIX]},rt=function(a,T){return T.definitions_.import_dart_math="import 'dart:math' as Math;",["new Math.Random().nextDouble()",$.UNARY_POSTFIX]},xt=function(a,T){T.definitions_.import_dart_math="import 'dart:math' as Math;";const d=T.valueToCode(a,"X",$.NONE)||"0";return["Math.atan2("+(T.valueToCode(a,"Y",$.NONE)||"0")+", "+d+") / Math.pi * 180",$.MULTIPLICATIVE]},It=function(a,T){const d=T.getProcedureName(a.getFieldValue("NAME"));var u="";T.STATEMENT_PREFIX&&(u+=T.injectId(T.STATEMENT_PREFIX,a)),T.STATEMENT_SUFFIX&&(u+=T.injectId(T.STATEMENT_SUFFIX,a)),u&&(u=T.prefixLines(u,T.INDENT));let l="";T.INFINITE_LOOP_TRAP&&(l=T.prefixLines(T.injectId(T.INFINITE_LOOP_TRAP,a),T.INDENT));let _="";a.getInput("STACK")&&(_=T.statementToCode(a,"STACK"));let E="";a.getInput("RETURN")&&(E=T.valueToCode(a,"RETURN",$.NONE)||"");let b="";_&&E&&(b=u),E&&(E=T.INDENT+"return "+E+`; -`);const B=E?"dynamic":"void",te=[],fe=a.getVars();for(let Ge=0;Ge list = str.split(exp); - final title = new StringBuffer(); - for (String part in list) { - if (part.length > 0) { - title.write(part[0].toUpperCase()); - if (part.length > 0) { - title.write(part.substring(1).toLowerCase()); - } - } - } - return title.toString(); -} -`)+"("+a+")",$.UNARY_POSTFIX]},z=function(a,T){const d={LEFT:".replaceFirst(new RegExp(r'^\\s+'), '')",RIGHT:".replaceFirst(new RegExp(r'\\s+$'), '')",BOTH:".trim()"}[a.getFieldValue("MODE")];return[(T.valueToCode(a,"TEXT",$.UNARY_POSTFIX)||"''")+d,$.UNARY_POSTFIX]},q=function(a,T){return"print("+(T.valueToCode(a,"TEXT",$.NONE)||"''")+`); -`},ie=function(a,T){T.definitions_.import_dart_html="import 'dart:html' as Html;";let d="Html.window.prompt("+(a.getField("TEXT")?T.quote_(a.getFieldValue("TEXT")):T.valueToCode(a,"TEXT",$.NONE)||"''")+", '')";return a.getFieldValue("TYPE")==="NUMBER"&&(T.definitions_.import_dart_math="import 'dart:math' as Math;",d="Math.parseDouble("+d+")"),[d,$.UNARY_POSTFIX]},A=function(a,T){const d=T.valueToCode(a,"TEXT",$.NONE)||"''";return a=T.valueToCode(a,"SUB",$.NONE)||"''",[T.provideFunction_("text_count",` -int ${T.FUNCTION_NAME_PLACEHOLDER_}(String haystack, String needle) { - if (needle.length == 0) { - return haystack.length + 1; - } - int index = 0; - int count = 0; - while (index != -1) { - index = haystack.indexOf(needle, index); - if (index != -1) { - count++; - index += needle.length; - } - } - return count; -} -`)+"("+d+", "+a+")",$.UNARY_POSTFIX]},U=function(a,T){const d=T.valueToCode(a,"TEXT",$.UNARY_POSTFIX)||"''",u=T.valueToCode(a,"FROM",$.NONE)||"''";return a=T.valueToCode(a,"TO",$.NONE)||"''",[d+".replaceAll("+u+", "+a+")",$.UNARY_POSTFIX]},K=function(a,T){return["new String.fromCharCodes("+(T.valueToCode(a,"TEXT",$.UNARY_POSTFIX)||"''")+".runes.toList().reversed)",$.UNARY_PREFIX]},oe=function(a,T){return[T.getVariableName(a.getFieldValue("VAR")),$.ATOMIC]},ne=function(a,T){const d=T.valueToCode(a,"VALUE",$.ASSIGNMENT)||"0";return T.getVariableName(a.getFieldValue("VAR"))+" = "+d+`; -`},$;(function(a){a[a.ATOMIC=0]="ATOMIC",a[a.UNARY_POSTFIX=1]="UNARY_POSTFIX",a[a.UNARY_PREFIX=2]="UNARY_PREFIX",a[a.MULTIPLICATIVE=3]="MULTIPLICATIVE",a[a.ADDITIVE=4]="ADDITIVE",a[a.SHIFT=5]="SHIFT",a[a.BITWISE_AND=6]="BITWISE_AND",a[a.BITWISE_XOR=7]="BITWISE_XOR",a[a.BITWISE_OR=8]="BITWISE_OR",a[a.RELATIONAL=9]="RELATIONAL",a[a.EQUALITY=10]="EQUALITY",a[a.LOGICAL_AND=11]="LOGICAL_AND",a[a.LOGICAL_OR=12]="LOGICAL_OR",a[a.IF_NULL=13]="IF_NULL",a[a.CONDITIONAL=14]="CONDITIONAL",a[a.CASCADE=15]="CASCADE",a[a.ASSIGNMENT=16]="ASSIGNMENT",a[a.NONE=99]="NONE"})($||($={}));var L=class extends c.CodeGenerator$$module$build$src$core$generator{constructor(a="Dart"){super(a),this.isInitialized=!1;for(const T in $)a=$[T],typeof a!="string"&&(this["ORDER_"+T]=a);this.addReservedWords("assert,break,case,catch,class,const,continue,default,do,else,enum,extends,false,final,finally,for,if,in,is,new,null,rethrow,return,super,switch,this,throw,true,try,var,void,while,with,print,identityHashCode,identical,BidirectionalIterator,Comparable,double,Function,int,Invocation,Iterable,Iterator,List,Map,Match,num,Pattern,RegExp,Set,StackTrace,String,StringSink,Type,bool,DateTime,Deprecated,Duration,Expando,Null,Object,RuneIterator,Runes,Stopwatch,StringBuffer,Symbol,Uri,Comparator,AbstractClassInstantiationError,ArgumentError,AssertionError,CastError,ConcurrentModificationError,CyclicInitializationError,Error,Exception,FallThroughError,FormatException,IntegerDivisionByZeroException,NoSuchMethodError,NullThrownError,OutOfMemoryError,RangeError,StackOverflowError,StateError,TypeError,UnimplementedError,UnsupportedError")}init(a){super.init(a),this.nameDB_?this.nameDB_.reset():this.nameDB_=new c.Names$$module$build$src$core$names(this.RESERVED_WORDS_),this.nameDB_.setVariableMap(a.getVariableMap()),this.nameDB_.populateVariables(a),this.nameDB_.populateProcedures(a);const T=[];var d=c.allDeveloperVariables$$module$build$src$core$variables(a);for(let u=0;ud&&(a=`${a} - ${-d}`),u&&(a=d?`-(${a})`:`-${a}`),Math.floor(l)>=Math.floor(E)&&(a=`(${a})`),a)}},le={};le.lists_create_empty=m,le.lists_create_with=f,le.lists_getIndex=w,le.lists_getSublist=W,le.lists_indexOf=F,le.lists_isEmpty=k,le.lists_length=N,le.lists_repeat=R,le.lists_reverse=X,le.lists_setIndex=P,le.lists_sort=ae,le.lists_split=re;var ce={};ce.controls_if=be,ce.controls_ifelse=be,ce.logic_boolean=de,ce.logic_compare=Re,ce.logic_negate=ve,ce.logic_null=Ue,ce.logic_operation=Se,ce.logic_ternary=it;var ue={};ue.controls_flow_statements=at,ue.controls_for=Ot,ue.controls_forEach=Pe,ue.controls_repeat=He,ue.controls_repeat_ext=He,ue.controls_whileUntil=$e;var he={};he.math_arithmetic=Rt,he.math_atan2=xt,he.math_change=ye,he.math_constant=dt,he.math_constrain=$t,he.math_modulo=ze,he.math_number=bt,he.math_number_property=Ne,he.math_on_list=Le,he.math_random_float=rt,he.math_random_int=_t,he.math_round=xe,he.math_single=xe,he.math_trig=xe;var Ie={};Ie.procedures_callnoreturn=je,Ie.procedures_callreturn=ct,Ie.procedures_defnoreturn=It,Ie.procedures_defreturn=It,Ie.procedures_ifreturn=pt;var Ee={};Ee.text=Tt,Ee.text_append=pe,Ee.text_changeCase=Z,Ee.text_charAt=v,Ee.text_count=A,Ee.text_getSubstring=G,Ee.text_indexOf=C,Ee.text_isEmpty=Ae,Ee.text_join=kt,Ee.text_length=Je,Ee.text_print=q,Ee.text_prompt=ie,Ee.text_prompt_ext=ie,Ee.text_replace=U,Ee.text_reverse=K,Ee.text_trim=z;var g={};g.variables_get=oe,g.variables_set=ne;var O={};O.variables_get_dynamic=oe,O.variables_set_dynamic=ne;var M=new L;M.addReservedWords("Html,Math");var y=Object.assign({},le,ce,ue,he,Ie,Ee,g,O);for(const a in y)M.forBlock[a]=y[a];var Y={};return Y.DartGenerator=L,Y.Order=$,Y.dartGenerator=M,Y.__namespace__=c,Y})})(qE);var RD=qE.exports,QE={exports:{}};(function(n,h){(function(o,c){n.exports=c(Co())})(hs,function(o){var c=o.__namespace__,m=function(u,l){return["{}",L.HIGH]},f=function(u,l){const _=Array(u.itemCount_);for(let E=0;E",GTE:">="}[u.getFieldValue("OP")],E=l.valueToCode(u,"A",L.RELATIONAL)||"0";return u=l.valueToCode(u,"B",L.RELATIONAL)||"0",[E+" "+_+" "+u,L.RELATIONAL]},Se=function(u,l){const _=u.getFieldValue("OP")==="AND"?"and":"or",E=_==="and"?L.AND:L.OR;let b=l.valueToCode(u,"A",E);return u=l.valueToCode(u,"B",E),b||u?(l=_==="and"?"true":"false",b||(b=l),u||(u=l)):u=b="false",[b+" "+_+" "+u,E]},ve=function(u,l){return["not "+(l.valueToCode(u,"BOOL",L.UNARY)||"true"),L.UNARY]},de=function(u,l){return[u.getFieldValue("BOOL")==="TRUE"?"true":"false",L.ATOMIC]},Ue=function(u,l){return["nil",L.ATOMIC]},it=function(u,l){const _=l.valueToCode(u,"IF",L.AND)||"false",E=l.valueToCode(u,"THEN",L.AND)||"nil";return u=l.valueToCode(u,"ELSE",L.OR)||"nil",[_+" and "+E+" or "+u,L.OR]},He=function(u,l){return u.includes(Ie)?u+l+`::continue:: -`:u},$e=function(u,l){let _;_=u.getField("TIMES")?String(Number(u.getFieldValue("TIMES"))):l.valueToCode(u,"TIMES",L.NONE)||"0",_=c.isNumber$$module$build$src$core$utils$string(_)?parseInt(_,10):"math.floor("+_+")";let E=l.statementToCode(u,"DO");return E=l.addLoopTrap(E,u),E=He(E,l.INDENT),"for "+l.nameDB_.getDistinctName("count",c.NameType$$module$build$src$core$names.VARIABLE)+" = 1, "+_+` do -`+E+`end -`},Ot=function(u,l){const _=u.getFieldValue("MODE")==="UNTIL";let E=l.valueToCode(u,"BOOL",_?L.UNARY:L.NONE)||"false",b=l.statementToCode(u,"DO");return b=l.addLoopTrap(b,u),b=He(b,l.INDENT),_&&(E="not "+E),"while "+E+` do -`+b+`end -`},Pe=function(u,l){const _=l.getVariableName(u.getFieldValue("VAR")),E=l.valueToCode(u,"FROM",L.NONE)||"0",b=l.valueToCode(u,"TO",L.NONE)||"0",B=l.valueToCode(u,"BY",L.NONE)||"1";let te=l.statementToCode(u,"DO");te=l.addLoopTrap(te,u),te=He(te,l.INDENT),u="";let fe;return c.isNumber$$module$build$src$core$utils$string(E)&&c.isNumber$$module$build$src$core$utils$string(b)&&c.isNumber$$module$build$src$core$utils$string(B)?fe=(Number(E)<=Number(b)?"":"-")+Math.abs(Number(B)):(u="",fe=l.nameDB_.getDistinctName(_+"_inc",c.NameType$$module$build$src$core$names.VARIABLE),u+=fe+" = ",u=c.isNumber$$module$build$src$core$utils$string(B)?u+(Math.abs(B)+` -`):u+("math.abs("+B+`) -`),u=u+("if ("+E+") > ("+b+`) then -`)+(l.INDENT+fe+" = -"+fe+` -`),u+=`end -`),u+("for "+_+" = "+E+", "+b+", "+fe)+(` do -`+te+`end -`)},at=function(u,l){const _=l.getVariableName(u.getFieldValue("VAR")),E=l.valueToCode(u,"LIST",L.NONE)||"{}";let b=l.statementToCode(u,"DO");return b=l.addLoopTrap(b,u),b=He(b,l.INDENT),"for _, "+_+" in ipairs("+E+`) do -`+b+`end -`},bt=function(u,l){let _="";if(l.STATEMENT_PREFIX&&(_+=l.injectId(l.STATEMENT_PREFIX,u)),l.STATEMENT_SUFFIX&&(_+=l.injectId(l.STATEMENT_SUFFIX,u)),l.STATEMENT_PREFIX){const E=u.getSurroundLoop();E&&!E.suppressPrefixSuffix&&(_+=l.injectId(l.STATEMENT_PREFIX,E))}switch(u.getFieldValue("FLOW")){case"BREAK":return _+`break -`;case"CONTINUE":return _+Ie}throw Error("Unknown flow statement.")},Rt=function(u,l){return u=Number(u.getFieldValue("NUM")),[String(u),0>u?L.UNARY:L.ATOMIC]},xe=function(u,l){var _={ADD:[" + ",L.ADDITIVE],MINUS:[" - ",L.ADDITIVE],MULTIPLY:[" * ",L.MULTIPLICATIVE],DIVIDE:[" / ",L.MULTIPLICATIVE],POWER:[" ^ ",L.EXPONENTIATION]}[u.getFieldValue("OP")];const E=_[0];_=_[1];const b=l.valueToCode(u,"A",_)||"0";return u=l.valueToCode(u,"B",_)||"0",[b+E+u,_]},dt=function(u,l){var _=u.getFieldValue("OP");if(_==="NEG")return u=l.valueToCode(u,"NUM",L.UNARY)||"0",["-"+u,L.UNARY];if(_==="POW10")return u=l.valueToCode(u,"NUM",L.EXPONENTIATION)||"0",["10 ^ "+u,L.EXPONENTIATION];switch(u=_==="ROUND"?l.valueToCode(u,"NUM",L.ADDITIVE)||"0":l.valueToCode(u,"NUM",L.NONE)||"0",_){case"ABS":_="math.abs("+u+")";break;case"ROOT":_="math.sqrt("+u+")";break;case"LN":_="math.log("+u+")";break;case"LOG10":_="math.log("+u+", 10)";break;case"EXP":_="math.exp("+u+")";break;case"ROUND":_="math.floor("+u+" + .5)";break;case"ROUNDUP":_="math.ceil("+u+")";break;case"ROUNDDOWN":_="math.floor("+u+")";break;case"SIN":_="math.sin(math.rad("+u+"))";break;case"COS":_="math.cos(math.rad("+u+"))";break;case"TAN":_="math.tan(math.rad("+u+"))";break;case"ASIN":_="math.deg(math.asin("+u+"))";break;case"ACOS":_="math.deg(math.acos("+u+"))";break;case"ATAN":_="math.deg(math.atan("+u+"))";break;default:throw Error("Unknown math operator: "+_)}return[_,L.HIGH]},Ne=function(u,l){return{PI:["math.pi",L.HIGH],E:["math.exp(1)",L.HIGH],GOLDEN_RATIO:["(1 + math.sqrt(5)) / 2",L.MULTIPLICATIVE],SQRT2:["math.sqrt(2)",L.HIGH],SQRT1_2:["math.sqrt(1 / 2)",L.HIGH],INFINITY:["math.huge",L.HIGH]}[u.getFieldValue("CONSTANT")]},ye=function(u,l){var _={EVEN:[" % 2 == 0",L.MULTIPLICATIVE,L.RELATIONAL],ODD:[" % 2 == 1",L.MULTIPLICATIVE,L.RELATIONAL],WHOLE:[" % 1 == 0",L.MULTIPLICATIVE,L.RELATIONAL],POSITIVE:[" > 0",L.RELATIONAL,L.RELATIONAL],NEGATIVE:[" < 0",L.RELATIONAL,L.RELATIONAL],DIVISIBLE_BY:[null,L.MULTIPLICATIVE,L.RELATIONAL],PRIME:[null,L.NONE,L.HIGH]};const E=u.getFieldValue("PROPERTY"),[b,B,te]=_[E];if(_=l.valueToCode(u,"NUMBER_TO_CHECK",B)||"0",E==="PRIME")u=l.provideFunction_("math_isPrime",` -function ${l.FUNCTION_NAME_PLACEHOLDER_}(n) - -- https://en.wikipedia.org/wiki/Primality_test#Naive_methods - if n == 2 or n == 3 then - return true - end - -- False if n is NaN, negative, is 1, or not whole. - -- And false if n is divisible by 2 or 3. - if not(n > 1) or n % 1 ~= 0 or n % 2 == 0 or n % 3 == 0 then - return false - end - -- Check all the numbers of form 6k +/- 1, up to sqrt(n). - for x = 6, math.sqrt(n) + 1.5, 6 do - if n % (x - 1) == 0 or n % (x + 1) == 0 then - return false - end - end - return true -end -`)+"("+_+")";else if(E==="DIVISIBLE_BY"){if(u=l.valueToCode(u,"DIVISOR",L.MULTIPLICATIVE)||"0",u==="0")return["nil",L.ATOMIC];u=_+" % "+u+" == 0"}else u=_+b;return[u,te]},Le=function(u,l){const _=l.valueToCode(u,"DELTA",L.ADDITIVE)||"0";return u=l.getVariableName(u.getFieldValue("VAR")),u+" = "+u+" + "+_+` -`},ze=function(u,l){function _(){return l.provideFunction_("math_sum",` -function ${l.FUNCTION_NAME_PLACEHOLDER_}(t) - local result = 0 - for _, v in ipairs(t) do - result = result + v - end - return result -end -`)}var E=u.getFieldValue("OP");switch(u=l.valueToCode(u,"LIST",L.NONE)||"{}",E){case"SUM":E=_();break;case"MIN":E=l.provideFunction_("math_min",` -function ${l.FUNCTION_NAME_PLACEHOLDER_}(t) - if #t == 0 then - return 0 - end - local result = math.huge - for _, v in ipairs(t) do - if v < result then - result = v - end - end - return result -end -`);break;case"AVERAGE":E=l.provideFunction_("math_average",` -function ${l.FUNCTION_NAME_PLACEHOLDER_}(t) - if #t == 0 then - return 0 - end - return ${_()}(t) / #t -end -`);break;case"MAX":E=l.provideFunction_("math_max",` -function ${l.FUNCTION_NAME_PLACEHOLDER_}(t) - if #t == 0 then - return 0 - end - local result = -math.huge - for _, v in ipairs(t) do - if v > result then - result = v - end - end - return result -end -`);break;case"MEDIAN":E=l.provideFunction_("math_median",` -function ${l.FUNCTION_NAME_PLACEHOLDER_}(t) - -- Source: http://lua-users.org/wiki/SimpleStats - if #t == 0 then - return 0 - end - local temp = {} - for _, v in ipairs(t) do - if type(v) == 'number' then - table.insert(temp, v) - end - end - table.sort(temp) - if #temp % 2 == 0 then - return (temp[#temp / 2] + temp[(#temp / 2) + 1]) / 2 - else - return temp[math.ceil(#temp / 2)] - end -end -`);break;case"MODE":E=l.provideFunction_("math_modes",` -function ${l.FUNCTION_NAME_PLACEHOLDER_}(t) - -- Source: http://lua-users.org/wiki/SimpleStats - local counts = {} - for _, v in ipairs(t) do - if counts[v] == nil then - counts[v] = 1 - else - counts[v] = counts[v] + 1 - end - end - local biggestCount = 0 - for _, v in pairs(counts) do - if v > biggestCount then - biggestCount = v - end - end - local temp = {} - for k, v in pairs(counts) do - if v == biggestCount then - table.insert(temp, k) - end - end - return temp -end -`);break;case"STD_DEV":E=l.provideFunction_("math_standard_deviation",` -function ${l.FUNCTION_NAME_PLACEHOLDER_}(t) - local m - local vm - local total = 0 - local count = 0 - local result - m = #t == 0 and 0 or ${_()}(t) / #t - for _, v in ipairs(t) do - if type(v) == 'number' then - vm = v - m - total = total + (vm * vm) - count = count + 1 - end - end - result = math.sqrt(total / (count-1)) - return result -end -`);break;case"RANDOM":E=l.provideFunction_("math_random_list",` -function ${l.FUNCTION_NAME_PLACEHOLDER_}(t) - if #t == 0 then - return nil - end - return t[math.random(#t)] -end -`);break;default:throw Error("Unknown operator: "+E)}return[E+"("+u+")",L.HIGH]},$t=function(u,l){const _=l.valueToCode(u,"DIVIDEND",L.MULTIPLICATIVE)||"0";return u=l.valueToCode(u,"DIVISOR",L.MULTIPLICATIVE)||"0",[_+" % "+u,L.MULTIPLICATIVE]},_t=function(u,l){const _=l.valueToCode(u,"VALUE",L.NONE)||"0",E=l.valueToCode(u,"LOW",L.NONE)||"-math.huge";return u=l.valueToCode(u,"HIGH",L.NONE)||"math.huge",["math.min(math.max("+_+", "+E+"), "+u+")",L.HIGH]},rt=function(u,l){const _=l.valueToCode(u,"FROM",L.NONE)||"0";return u=l.valueToCode(u,"TO",L.NONE)||"0",["math.random("+_+", "+u+")",L.HIGH]},xt=function(u,l){return["math.random()",L.HIGH]},It=function(u,l){const _=l.valueToCode(u,"X",L.NONE)||"0";return["math.deg(math.atan2("+(l.valueToCode(u,"Y",L.NONE)||"0")+", "+_+"))",L.HIGH]},ct=function(u,l){const _=l.getProcedureName(u.getFieldValue("NAME"));var E="";l.STATEMENT_PREFIX&&(E+=l.injectId(l.STATEMENT_PREFIX,u)),l.STATEMENT_SUFFIX&&(E+=l.injectId(l.STATEMENT_SUFFIX,u)),E&&(E=l.prefixLines(E,l.INDENT));let b="";l.INFINITE_LOOP_TRAP&&(b=l.prefixLines(l.injectId(l.INFINITE_LOOP_TRAP,u),l.INDENT));let B="";u.getInput("STACK")&&(B=l.statementToCode(u,"STACK"));let te="";u.getInput("RETURN")&&(te=l.valueToCode(u,"RETURN",L.NONE)||"");let fe="";B&&te&&(fe=E),te?te=l.INDENT+"return "+te+` -`:B||(B="");const Ge=[],ut=u.getVars();for(let St=0;St 'strnatcasecmp', - 'TEXT' => 'strcmp', - 'IGNORE_CASE' => 'strcasecmp' - ); - $sortCmp = $sortCmpFuncs[$type]; - $list2 = $list; - usort($list2, $sortCmp); - if ($direction == -1) { - $list2 = array_reverse($list2); - } - return $list2; -} -`)+"("+d+', "'+a+'", '+u+")",$.FUNCTION_CALL]},re=function(a,T){let d=T.valueToCode(a,"INPUT",$.NONE);if(T=T.valueToCode(a,"DELIM",$.NONE)||"''",a=a.getFieldValue("MODE"),a==="SPLIT")d||(d="''"),a="explode";else if(a==="JOIN")d||(d="array()"),a="implode";else throw Error("Unknown mode: "+a);return[a+"("+T+", "+d+")",$.FUNCTION_CALL]},X=function(a,T){return["array_reverse("+(T.valueToCode(a,"LIST",$.NONE)||"[]")+")",$.FUNCTION_CALL]},be=function(a,T){let d=0,u="",l,_;T.STATEMENT_PREFIX&&(u+=T.injectId(T.STATEMENT_PREFIX,a));do _=T.valueToCode(a,"IF"+d,$.NONE)||"false",l=T.statementToCode(a,"DO"+d),T.STATEMENT_SUFFIX&&(l=T.prefixLines(T.injectId(T.STATEMENT_SUFFIX,a),T.INDENT)+l),u+=(0",GTE:">="}[a.getFieldValue("OP")],u=d==="=="||d==="!="?$.EQUALITY:$.RELATIONAL,l=T.valueToCode(a,"A",u)||"0";return a=T.valueToCode(a,"B",u)||"0",[l+" "+d+" "+a,u]},Se=function(a,T){const d=a.getFieldValue("OP")==="AND"?"&&":"||",u=d==="&&"?$.LOGICAL_AND:$.LOGICAL_OR;let l=T.valueToCode(a,"A",u);return a=T.valueToCode(a,"B",u),l||a?(T=d==="&&"?"true":"false",l||(l=T),a||(a=T)):a=l="false",[l+" "+d+" "+a,u]},ve=function(a,T){const d=$.LOGICAL_NOT;return["!"+(T.valueToCode(a,"BOOL",d)||"true"),d]},de=function(a,T){return[a.getFieldValue("BOOL")==="TRUE"?"true":"false",$.ATOMIC]},Ue=function(a,T){return["null",$.ATOMIC]},it=function(a,T){const d=T.valueToCode(a,"IF",$.CONDITIONAL)||"false",u=T.valueToCode(a,"THEN",$.CONDITIONAL)||"null";return a=T.valueToCode(a,"ELSE",$.CONDITIONAL)||"null",[d+" ? "+u+" : "+a,$.CONDITIONAL]},He=function(a,T){let d;d=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):T.valueToCode(a,"TIMES",$.ASSIGNMENT)||"0";let u=T.statementToCode(a,"DO");u=T.addLoopTrap(u,a),a="";const l=T.nameDB_.getDistinctName("count",c.NameType$$module$build$src$core$names.VARIABLE);let _=d;return d.match(/^\w+$/)||c.isNumber$$module$build$src$core$utils$string(d)||(_=T.nameDB_.getDistinctName("repeat_end",c.NameType$$module$build$src$core$names.VARIABLE),a+=_+" = "+d+`; -`),a+("for ("+l+" = 0; "+l+" < "+_+"; "+l+`++) { -`+u+`} -`)},$e=function(a,T){const d=a.getFieldValue("MODE")==="UNTIL";let u=T.valueToCode(a,"BOOL",d?$.LOGICAL_NOT:$.NONE)||"false",l=T.statementToCode(a,"DO");return l=T.addLoopTrap(l,a),d&&(u="!"+u),"while ("+u+`) { -`+l+`} -`},Ot=function(a,T){var d=T.getVariableName(a.getFieldValue("VAR")),u=T.valueToCode(a,"FROM",$.ASSIGNMENT)||"0",l=T.valueToCode(a,"TO",$.ASSIGNMENT)||"0";const _=T.valueToCode(a,"BY",$.ASSIGNMENT)||"1";let E=T.statementToCode(a,"DO");if(E=T.addLoopTrap(E,a),c.isNumber$$module$build$src$core$utils$string(u)&&c.isNumber$$module$build$src$core$utils$string(l)&&c.isNumber$$module$build$src$core$utils$string(_))T=Number(u)<=Number(l),a="for ("+d+" = "+u+"; "+d+(T?" <= ":" >= ")+l+"; "+d,d=Math.abs(Number(_)),a=d===1?a+(T?"++":"--"):a+((T?" += ":" -= ")+d),a+=`) { -`+E+`} -`;else{a="";let b=u;u.match(/^\w+$/)||c.isNumber$$module$build$src$core$utils$string(u)||(b=T.nameDB_.getDistinctName(d+"_start",c.NameType$$module$build$src$core$names.VARIABLE),a+=b+" = "+u+`; -`),u=l,l.match(/^\w+$/)||c.isNumber$$module$build$src$core$utils$string(l)||(u=T.nameDB_.getDistinctName(d+"_end",c.NameType$$module$build$src$core$names.VARIABLE),a+=u+" = "+l+`; -`),l=T.nameDB_.getDistinctName(d+"_inc",c.NameType$$module$build$src$core$names.VARIABLE),a+=l+" = ",a=c.isNumber$$module$build$src$core$utils$string(_)?a+(Math.abs(Number(_))+`; -`):a+("abs("+_+`); -`),a+="if ("+b+" > "+u+`) { -`,a+=T.INDENT+l+" = -"+l+`; -`,a=a+`} -for (`+(d+" = "+b+"; "+l+" >= 0 ? "+d+" <= "+u+" : "+d+" >= "+u+"; "+d+" += "+l+`) { -`+E+`} -`)}return a},Pe=function(a,T){const d=T.getVariableName(a.getFieldValue("VAR")),u=T.valueToCode(a,"LIST",$.ASSIGNMENT)||"[]";let l=T.statementToCode(a,"DO");return l=T.addLoopTrap(l,a),"foreach ("+u+" as "+d+`) { -`+l+`} -`},at=function(a,T){let d="";if(T.STATEMENT_PREFIX&&(d+=T.injectId(T.STATEMENT_PREFIX,a)),T.STATEMENT_SUFFIX&&(d+=T.injectId(T.STATEMENT_SUFFIX,a)),T.STATEMENT_PREFIX){const u=a.getSurroundLoop();u&&!u.suppressPrefixSuffix&&(d+=T.injectId(T.STATEMENT_PREFIX,u))}switch(a.getFieldValue("FLOW")){case"BREAK":return d+`break; -`;case"CONTINUE":return d+`continue; -`}throw Error("Unknown flow statement.")},bt=function(a,T){return a=Number(a.getFieldValue("NUM")),a===1/0?["INF",$.ATOMIC]:a===-1/0?["-INF",$.UNARY_NEGATION]:[String(a),0<=a?$.ATOMIC:$.UNARY_NEGATION]},Rt=function(a,T){var d={ADD:[" + ",$.ADDITION],MINUS:[" - ",$.SUBTRACTION],MULTIPLY:[" * ",$.MULTIPLICATION],DIVIDE:[" / ",$.DIVISION],POWER:[" ** ",$.POWER]}[a.getFieldValue("OP")];const u=d[0];d=d[1];const l=T.valueToCode(a,"A",d)||"0";return a=T.valueToCode(a,"B",d)||"0",[l+u+a,d]},xe=function(a,T){const d=a.getFieldValue("OP");let u;if(d==="NEG")return a=T.valueToCode(a,"NUM",$.UNARY_NEGATION)||"0",a[0]==="-"&&(a=" "+a),["-"+a,$.UNARY_NEGATION];switch(a=d==="SIN"||d==="COS"||d==="TAN"?T.valueToCode(a,"NUM",$.DIVISION)||"0":T.valueToCode(a,"NUM",$.NONE)||"0",d){case"ABS":u="abs("+a+")";break;case"ROOT":u="sqrt("+a+")";break;case"LN":u="log("+a+")";break;case"EXP":u="exp("+a+")";break;case"POW10":u="pow(10,"+a+")";break;case"ROUND":u="round("+a+")";break;case"ROUNDUP":u="ceil("+a+")";break;case"ROUNDDOWN":u="floor("+a+")";break;case"SIN":u="sin("+a+" / 180 * pi())";break;case"COS":u="cos("+a+" / 180 * pi())";break;case"TAN":u="tan("+a+" / 180 * pi())"}if(u)return[u,$.FUNCTION_CALL];switch(d){case"LOG10":u="log("+a+") / log(10)";break;case"ASIN":u="asin("+a+") / pi() * 180";break;case"ACOS":u="acos("+a+") / pi() * 180";break;case"ATAN":u="atan("+a+") / pi() * 180";break;default:throw Error("Unknown math operator: "+d)}return[u,$.DIVISION]},dt=function(a,T){return{PI:["M_PI",$.ATOMIC],E:["M_E",$.ATOMIC],GOLDEN_RATIO:["(1 + sqrt(5)) / 2",$.DIVISION],SQRT2:["M_SQRT2",$.ATOMIC],SQRT1_2:["M_SQRT1_2",$.ATOMIC],INFINITY:["INF",$.ATOMIC]}[a.getFieldValue("CONSTANT")]},Ne=function(a,T){var d={EVEN:[""," % 2 == 0",$.MODULUS,$.EQUALITY],ODD:[""," % 2 == 1",$.MODULUS,$.EQUALITY],WHOLE:["is_int(",")",$.NONE,$.FUNCTION_CALL],POSITIVE:[""," > 0",$.RELATIONAL,$.RELATIONAL],NEGATIVE:[""," < 0",$.RELATIONAL,$.RELATIONAL],DIVISIBLE_BY:[null,null,$.MODULUS,$.EQUALITY],PRIME:[null,null,$.NONE,$.FUNCTION_CALL]};const u=a.getFieldValue("PROPERTY"),[l,_,E,b]=d[u];if(d=T.valueToCode(a,"NUMBER_TO_CHECK",E)||"0",u==="PRIME")a=T.provideFunction_("math_isPrime",` -function ${T.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 (!is_numeric($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 ($x = 6; $x <= sqrt($n) + 1; $x += 6) { - if ($n % ($x - 1) == 0 || $n % ($x + 1) == 0) { - return false; - } - } - return true; -} -`)+"("+d+")";else if(u==="DIVISIBLE_BY"){if(a=T.valueToCode(a,"DIVISOR",$.MODULUS)||"0",a==="0")return["false",$.ATOMIC];a=d+" % "+a+" == 0"}else a=l+d+_;return[a,b]},ye=function(a,T){const d=T.valueToCode(a,"DELTA",$.ADDITION)||"0";return T.getVariableName(a.getFieldValue("VAR"))+" += "+d+`; -`},Le=function(a,T){var d=a.getFieldValue("OP");switch(d){case"SUM":a=T.valueToCode(a,"LIST",$.FUNCTION_CALL)||"array()",a="array_sum("+a+")";break;case"MIN":a=T.valueToCode(a,"LIST",$.FUNCTION_CALL)||"array()",a="min("+a+")";break;case"MAX":a=T.valueToCode(a,"LIST",$.FUNCTION_CALL)||"array()",a="max("+a+")";break;case"AVERAGE":d=T.provideFunction_("math_mean",` -function ${T.FUNCTION_NAME_PLACEHOLDER_}($myList) { - return array_sum($myList) / count($myList); -} -`),a=T.valueToCode(a,"LIST",$.NONE)||"array()",a=d+"("+a+")";break;case"MEDIAN":d=T.provideFunction_("math_median",` -function ${T.FUNCTION_NAME_PLACEHOLDER_}($arr) { - sort($arr,SORT_NUMERIC); - return (count($arr) % 2) ? $arr[floor(count($arr) / 2)] : - ($arr[floor(count($arr) / 2)] + $arr[floor(count($arr) / 2) - 1]) / 2; -} -`),a=T.valueToCode(a,"LIST",$.NONE)||"[]",a=d+"("+a+")";break;case"MODE":d=T.provideFunction_("math_modes",` -function ${T.FUNCTION_NAME_PLACEHOLDER_}($values) { - if (empty($values)) return array(); - $counts = array_count_values($values); - arsort($counts); // Sort counts in descending order - $modes = array_keys($counts, current($counts), true); - return $modes; -} -`),a=T.valueToCode(a,"LIST",$.NONE)||"[]",a=d+"("+a+")";break;case"STD_DEV":d=T.provideFunction_("math_standard_deviation",` -function ${T.FUNCTION_NAME_PLACEHOLDER_}($numbers) { - $n = count($numbers); - if (!$n) return null; - $mean = array_sum($numbers) / count($numbers); - foreach($numbers as $key => $num) $devs[$key] = pow($num - $mean, 2); - return sqrt(array_sum($devs) / (count($devs) - 1)); -} -`),a=T.valueToCode(a,"LIST",$.NONE)||"[]",a=d+"("+a+")";break;case"RANDOM":d=T.provideFunction_("math_random_list",` -function ${T.FUNCTION_NAME_PLACEHOLDER_}($list) { - $x = rand(0, count($list)-1); - return $list[$x]; -} -`),a=T.valueToCode(a,"LIST",$.NONE)||"[]",a=d+"("+a+")";break;default:throw Error("Unknown operator: "+d)}return[a,$.FUNCTION_CALL]},ze=function(a,T){const d=T.valueToCode(a,"DIVIDEND",$.MODULUS)||"0";return a=T.valueToCode(a,"DIVISOR",$.MODULUS)||"0",[d+" % "+a,$.MODULUS]},$t=function(a,T){const d=T.valueToCode(a,"VALUE",$.NONE)||"0",u=T.valueToCode(a,"LOW",$.NONE)||"0";return a=T.valueToCode(a,"HIGH",$.NONE)||"Infinity",["min(max("+d+", "+u+"), "+a+")",$.FUNCTION_CALL]},_t=function(a,T){const d=T.valueToCode(a,"FROM",$.NONE)||"0";return a=T.valueToCode(a,"TO",$.NONE)||"0",[T.provideFunction_("math_random_int",` -function ${T.FUNCTION_NAME_PLACEHOLDER_}($a, $b) { - if ($a > $b) { - return rand($b, $a); - } - return rand($a, $b); -} -`)+"("+d+", "+a+")",$.FUNCTION_CALL]},rt=function(a,T){return["(float)rand()/(float)getrandmax()",$.FUNCTION_CALL]},xt=function(a,T){const d=T.valueToCode(a,"X",$.NONE)||"0";return["atan2("+(T.valueToCode(a,"Y",$.NONE)||"0")+", "+d+") / pi() * 180",$.DIVISION]},It=function(a,T){var d=[],u=a.workspace,l=c.allUsedVarModels$$module$build$src$core$variables(u)||[];for(var _ of l)l=_.name,a.getVars().includes(l)||d.push(T.getVariableName(l));for(u=c.allDeveloperVariables$$module$build$src$core$variables(u),_=0;_d?E=$.SUBTRACTION:u&&(E=$.UNARY_NEGATION),a=this.valueToCode(a,T,E)||_,d===0&&!u?a:c.isNumber$$module$build$src$core$utils$string(a)?(a=String(Number(a)+d),u&&(a=String(-Number(a))),a):(0d&&(a=`${a} - ${-d}`),u&&(a=d?`-(${a})`:`-${a}`),Math.floor(l)>=Math.floor(E)&&(a=`(${a})`),a)}},le={};le.lists_create_empty=m,le.lists_create_with=f,le.lists_getIndex=w,le.lists_getSublist=W,le.lists_indexOf=F,le.lists_isEmpty=k,le.lists_length=N,le.lists_repeat=R,le.lists_reverse=X,le.lists_setIndex=P,le.lists_sort=ae,le.lists_split=re;var ce={};ce.controls_if=be,ce.controls_ifelse=be,ce.logic_boolean=de,ce.logic_compare=Re,ce.logic_negate=ve,ce.logic_null=Ue,ce.logic_operation=Se,ce.logic_ternary=it;var ue={};ue.controls_flow_statements=at,ue.controls_for=Ot,ue.controls_forEach=Pe,ue.controls_repeat=He,ue.controls_repeat_ext=He,ue.controls_whileUntil=$e;var he={};he.math_arithmetic=Rt,he.math_atan2=xt,he.math_change=ye,he.math_constant=dt,he.math_constrain=$t,he.math_modulo=ze,he.math_number=bt,he.math_number_property=Ne,he.math_on_list=Le,he.math_random_float=rt,he.math_random_int=_t,he.math_round=xe,he.math_single=xe,he.math_trig=xe;var Ie={};Ie.procedures_callnoreturn=je,Ie.procedures_callreturn=ct,Ie.procedures_defnoreturn=It,Ie.procedures_defreturn=It,Ie.procedures_ifreturn=pt;var Ee={};Ee.text=Tt,Ee.text_append=pe,Ee.text_changeCase=Z,Ee.text_charAt=v,Ee.text_count=A,Ee.text_getSubstring=G,Ee.text_indexOf=C,Ee.text_isEmpty=Ae,Ee.text_join=kt,Ee.text_length=Je,Ee.text_print=q,Ee.text_prompt=ie,Ee.text_prompt_ext=ie,Ee.text_replace=U,Ee.text_reverse=K,Ee.text_trim=z;var g={};g.variables_get=oe,g.variables_set=ne;var O={};O.variables_get_dynamic=oe,O.variables_set_dynamic=ne;var M=new L,y=Object.assign({},le,ce,ue,he,Ie,Ee,g,O);for(const a in y)M.forBlock[a]=y[a];var Y={};return Y.Order=$,Y.PhpGenerator=L,Y.phpGenerator=M,Y.__namespace__=c,Y})})(ZE);var ND=ZE.exports,ef={exports:{}};(function(n,h){(function(o,c){n.exports=c(Co())})(hs,function(o){var c=o.__namespace__,m=function(d,u){return["[]",$.ATOMIC]},f=function(d,u){const l=Array(d.itemCount_);for(let _=0;_",GTE:">="}[d.getFieldValue("OP")],_=$.RELATIONAL,E=u.valueToCode(d,"A",_)||"0";return d=u.valueToCode(d,"B",_)||"0",[E+" "+l+" "+d,_]},Se=function(d,u){const l=d.getFieldValue("OP")==="AND"?"and":"or",_=l==="and"?$.LOGICAL_AND:$.LOGICAL_OR;let E=u.valueToCode(d,"A",_);return d=u.valueToCode(d,"B",_),E||d?(u=l==="and"?"True":"False",E||(E=u),d||(d=u)):d=E="False",[E+" "+l+" "+d,_]},ve=function(d,u){return["not "+(u.valueToCode(d,"BOOL",$.LOGICAL_NOT)||"True"),$.LOGICAL_NOT]},de=function(d,u){return[d.getFieldValue("BOOL")==="TRUE"?"True":"False",$.ATOMIC]},Ue=function(d,u){return["None",$.ATOMIC]},it=function(d,u){const l=u.valueToCode(d,"IF",$.CONDITIONAL)||"False",_=u.valueToCode(d,"THEN",$.CONDITIONAL)||"None";return d=u.valueToCode(d,"ELSE",$.CONDITIONAL)||"None",[_+" if "+l+" else "+d,$.CONDITIONAL]},He=function(d,u){let l;l=d.getField("TIMES")?String(parseInt(d.getFieldValue("TIMES"),10)):u.valueToCode(d,"TIMES",$.NONE)||"0",l=c.isNumber$$module$build$src$core$utils$string(l)?parseInt(l,10):"int("+l+")";let _=u.statementToCode(d,"DO");return _=u.addLoopTrap(_,d)||u.PASS,"for "+u.nameDB_.getDistinctName("count",c.NameType$$module$build$src$core$names.VARIABLE)+" in range("+l+`): -`+_},$e=function(d,u){const l=d.getFieldValue("MODE")==="UNTIL";let _=u.valueToCode(d,"BOOL",l?$.LOGICAL_NOT:$.NONE)||"False",E=u.statementToCode(d,"DO");return E=u.addLoopTrap(E,d)||u.PASS,l&&(_="not "+_),"while "+_+`: -`+E},Ot=function(d,u){const l=u.getVariableName(d.getFieldValue("VAR"));var _=u.valueToCode(d,"FROM",$.NONE)||"0",E=u.valueToCode(d,"TO",$.NONE)||"0",b=u.valueToCode(d,"BY",$.NONE)||"1";let B=u.statementToCode(d,"DO");B=u.addLoopTrap(B,d)||u.PASS;let te="";d=function(){return u.provideFunction_("upRange",` -def ${u.FUNCTION_NAME_PLACEHOLDER_}(start, stop, step): - while start <= stop: - yield start - start += abs(step) -`)};const fe=function(){return u.provideFunction_("downRange",` -def ${u.FUNCTION_NAME_PLACEHOLDER_}(start, stop, step): - while start >= stop: - yield start - start -= abs(step) -`)};if(c.isNumber$$module$build$src$core$utils$string(_)&&c.isNumber$$module$build$src$core$utils$string(E)&&c.isNumber$$module$build$src$core$utils$string(b))_=Number(_),E=Number(E),b=Math.abs(Number(b)),_%1===0&&E%1===0&&b%1===0?(_<=E?(E++,d=_===0&&b===1?E:_+", "+E,b!==1&&(d+=", "+b)):(E--,d=_+", "+E+", -"+b),d="range("+d+")"):(d=_d?$.UNARY_SIGN:$.ATOMIC]},Rt=function(d,u){var l={ADD:[" + ",$.ADDITIVE],MINUS:[" - ",$.ADDITIVE],MULTIPLY:[" * ",$.MULTIPLICATIVE],DIVIDE:[" / ",$.MULTIPLICATIVE],POWER:[" ** ",$.EXPONENTIATION]}[d.getFieldValue("OP")];const _=l[0];l=l[1];const E=u.valueToCode(d,"A",l)||"0";return d=u.valueToCode(d,"B",l)||"0",[E+_+d,l]},xe=function(d,u){const l=d.getFieldValue("OP");let _;if(l==="NEG")return _=u.valueToCode(d,"NUM",$.UNARY_SIGN)||"0",["-"+_,$.UNARY_SIGN];switch(u.definitions_.import_math="import math",d=l==="SIN"||l==="COS"||l==="TAN"?u.valueToCode(d,"NUM",$.MULTIPLICATIVE)||"0":u.valueToCode(d,"NUM",$.NONE)||"0",l){case"ABS":_="math.fabs("+d+")";break;case"ROOT":_="math.sqrt("+d+")";break;case"LN":_="math.log("+d+")";break;case"LOG10":_="math.log10("+d+")";break;case"EXP":_="math.exp("+d+")";break;case"POW10":_="math.pow(10,"+d+")";break;case"ROUND":_="round("+d+")";break;case"ROUNDUP":_="math.ceil("+d+")";break;case"ROUNDDOWN":_="math.floor("+d+")";break;case"SIN":_="math.sin("+d+" / 180.0 * math.pi)";break;case"COS":_="math.cos("+d+" / 180.0 * math.pi)";break;case"TAN":_="math.tan("+d+" / 180.0 * math.pi)"}if(_)return[_,$.FUNCTION_CALL];switch(l){case"ASIN":_="math.asin("+d+") / math.pi * 180";break;case"ACOS":_="math.acos("+d+") / math.pi * 180";break;case"ATAN":_="math.atan("+d+") / math.pi * 180";break;default:throw Error("Unknown math operator: "+l)}return[_,$.MULTIPLICATIVE]},dt=function(d,u){const l={PI:["math.pi",$.MEMBER],E:["math.e",$.MEMBER],GOLDEN_RATIO:["(1 + math.sqrt(5)) / 2",$.MULTIPLICATIVE],SQRT2:["math.sqrt(2)",$.MEMBER],SQRT1_2:["math.sqrt(1.0 / 2)",$.MEMBER],INFINITY:["float('inf')",$.ATOMIC]};return d=d.getFieldValue("CONSTANT"),d!=="INFINITY"&&(u.definitions_.import_math="import math"),l[d]},Ne=function(d,u){var l={EVEN:[" % 2 == 0",$.MULTIPLICATIVE,$.RELATIONAL],ODD:[" % 2 == 1",$.MULTIPLICATIVE,$.RELATIONAL],WHOLE:[" % 1 == 0",$.MULTIPLICATIVE,$.RELATIONAL],POSITIVE:[" > 0",$.RELATIONAL,$.RELATIONAL],NEGATIVE:[" < 0",$.RELATIONAL,$.RELATIONAL],DIVISIBLE_BY:[null,$.MULTIPLICATIVE,$.RELATIONAL],PRIME:[null,$.NONE,$.FUNCTION_CALL]};const _=d.getFieldValue("PROPERTY"),[E,b,B]=l[_];if(l=u.valueToCode(d,"NUMBER_TO_CHECK",b)||"0",_==="PRIME")u.definitions_.import_math="import math",u.definitions_.from_numbers_import_Number="from numbers import Number",d=u.provideFunction_("math_isPrime",` -def ${u.FUNCTION_NAME_PLACEHOLDER_}(n): - # https://en.wikipedia.org/wiki/Primality_test#Naive_methods - # If n is not a number but a string, try parsing it. - if not isinstance(n, Number): - try: - n = float(n) - except: - return False - if n == 2 or n == 3: - return True - # False if n is negative, is 1, or not whole, or if n is divisible by 2 or 3. - if n <= 1 or n % 1 != 0 or n % 2 == 0 or n % 3 == 0: - return False - # Check all the numbers of form 6k +/- 1, up to sqrt(n). - for x in range(6, int(math.sqrt(n)) + 2, 6): - if n % (x - 1) == 0 or n % (x + 1) == 0: - return False - return True -`)+"("+l+")";else if(_==="DIVISIBLE_BY"){if(d=u.valueToCode(d,"DIVISOR",$.MULTIPLICATIVE)||"0",d==="0")return["False",$.ATOMIC];d=l+" % "+d+" == 0"}else d=l+E;return[d,B]},ye=function(d,u){u.definitions_.from_numbers_import_Number="from numbers import Number";const l=u.valueToCode(d,"DELTA",$.ADDITIVE)||"0";return d=u.getVariableName(d.getFieldValue("VAR")),d+" = ("+d+" if isinstance("+d+", Number) else 0) + "+l+` -`},Le=function(d,u){const l=d.getFieldValue("OP");switch(d=u.valueToCode(d,"LIST",$.NONE)||"[]",l){case"SUM":u="sum("+d+")";break;case"MIN":u="min("+d+")";break;case"MAX":u="max("+d+")";break;case"AVERAGE":u.definitions_.from_numbers_import_Number="from numbers import Number",u=u.provideFunction_("math_mean",` -def ${u.FUNCTION_NAME_PLACEHOLDER_}(myList): - localList = [e for e in myList if isinstance(e, Number)] - if not localList: return - return float(sum(localList)) / len(localList) -`)+"("+d+")";break;case"MEDIAN":u.definitions_.from_numbers_import_Number="from numbers import Number",u=u.provideFunction_("math_median",` -def ${u.FUNCTION_NAME_PLACEHOLDER_}(myList): - localList = sorted([e for e in myList if isinstance(e, Number)]) - if not localList: return - if len(localList) % 2 == 0: - return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0 - else: - return localList[(len(localList) - 1) // 2] -`)+"("+d+")";break;case"MODE":u=u.provideFunction_("math_modes",` -def ${u.FUNCTION_NAME_PLACEHOLDER_}(some_list): - modes = [] - # Using a lists of [item, count] to keep count rather than dict - # to avoid "unhashable" errors when the counted item is itself a list or dict. - counts = [] - maxCount = 1 - for item in some_list: - found = False - for count in counts: - if count[0] == item: - count[1] += 1 - maxCount = max(maxCount, count[1]) - found = True - if not found: - counts.append([item, 1]) - for counted_item, item_count in counts: - if item_count == maxCount: - modes.append(counted_item) - return modes -`)+"("+d+")";break;case"STD_DEV":u.definitions_.import_math="import math",u=u.provideFunction_("math_standard_deviation",` -def ${u.FUNCTION_NAME_PLACEHOLDER_}(numbers): - n = len(numbers) - if n == 0: return - mean = float(sum(numbers)) / n - variance = sum((x - mean) ** 2 for x in numbers) / n - return math.sqrt(variance) -`)+"("+d+")";break;case"RANDOM":u.definitions_.import_random="import random",u="random.choice("+d+")";break;default:throw Error("Unknown operator: "+l)}return[u,$.FUNCTION_CALL]},ze=function(d,u){const l=u.valueToCode(d,"DIVIDEND",$.MULTIPLICATIVE)||"0";return d=u.valueToCode(d,"DIVISOR",$.MULTIPLICATIVE)||"0",[l+" % "+d,$.MULTIPLICATIVE]},$t=function(d,u){const l=u.valueToCode(d,"VALUE",$.NONE)||"0",_=u.valueToCode(d,"LOW",$.NONE)||"0";return d=u.valueToCode(d,"HIGH",$.NONE)||"float('inf')",["min(max("+l+", "+_+"), "+d+")",$.FUNCTION_CALL]},_t=function(d,u){u.definitions_.import_random="import random";const l=u.valueToCode(d,"FROM",$.NONE)||"0";return d=u.valueToCode(d,"TO",$.NONE)||"0",["random.randint("+l+", "+d+")",$.FUNCTION_CALL]},rt=function(d,u){return u.definitions_.import_random="import random",["random.random()",$.FUNCTION_CALL]},xt=function(d,u){u.definitions_.import_math="import math";const l=u.valueToCode(d,"X",$.NONE)||"0";return["math.atan2("+(u.valueToCode(d,"Y",$.NONE)||"0")+", "+l+") / math.pi * 180",$.MULTIPLICATIVE]},It=function(d,u){var l=[],_=d.workspace,E=c.allUsedVarModels$$module$build$src$core$variables(_)||[];for(var b of E)E=b.name,d.getVars().includes(E)||l.push(u.getVariableName(E));for(_=c.allDeveloperVariables$$module$build$src$core$variables(_),b=0;b<_.length;b++)l.push(u.nameDB_.getName(_[b],c.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE));_=l.length?u.INDENT+"global "+l.join(", ")+` -`:"",l=u.getProcedureName(d.getFieldValue("NAME")),b="",u.STATEMENT_PREFIX&&(b+=u.injectId(u.STATEMENT_PREFIX,d)),u.STATEMENT_SUFFIX&&(b+=u.injectId(u.STATEMENT_SUFFIX,d)),b&&(b=u.prefixLines(b,u.INDENT)),E="",u.INFINITE_LOOP_TRAP&&(E=u.prefixLines(u.injectId(u.INFINITE_LOOP_TRAP,d),u.INDENT));let B="";d.getInput("STACK")&&(B=u.statementToCode(d,"STACK"));let te="";d.getInput("RETURN")&&(te=u.valueToCode(d,"RETURN",$.NONE)||"");let fe="";B&&te&&(fe=b),te?te=u.INDENT+"return "+te+` -`:B||(B=u.PASS);const Ge=[],ut=d.getVars();for(let St=0;Stl?"int("+d+" - "+-l+")":"int("+d+")",_&&(d="-"+d)),d}},le={};le.lists_create_empty=m,le.lists_create_with=f,le.lists_getIndex=w,le.lists_getSublist=W,le.lists_indexOf=F,le.lists_isEmpty=k,le.lists_length=N,le.lists_repeat=R,le.lists_reverse=X,le.lists_setIndex=P,le.lists_sort=ae,le.lists_split=re;var ce={};ce.controls_if=be,ce.controls_ifelse=be,ce.logic_boolean=de,ce.logic_compare=Re,ce.logic_negate=ve,ce.logic_null=Ue,ce.logic_operation=Se,ce.logic_ternary=it;var ue={};ue.controls_flow_statements=at,ue.controls_for=Ot,ue.controls_forEach=Pe,ue.controls_repeat=He,ue.controls_repeat_ext=He,ue.controls_whileUntil=$e;var he={};he.math_arithmetic=Rt,he.math_atan2=xt,he.math_change=ye,he.math_constant=dt,he.math_constrain=$t,he.math_modulo=ze,he.math_number=bt,he.math_number_property=Ne,he.math_on_list=Le,he.math_random_float=rt,he.math_random_int=_t,he.math_round=xe,he.math_single=xe,he.math_trig=xe;var Ie={};Ie.procedures_callnoreturn=je,Ie.procedures_callreturn=ct,Ie.procedures_defnoreturn=It,Ie.procedures_defreturn=It,Ie.procedures_ifreturn=pt;var Ee=/^\s*'([^']|\\')*'\s*$/,g=function(d){return Ee.test(d)?[d,$.ATOMIC]:["str("+d+")",$.FUNCTION_CALL]},O={};O.text=Tt,O.text_append=pe,O.text_changeCase=Z,O.text_charAt=v,O.text_count=A,O.text_getSubstring=G,O.text_indexOf=C,O.text_isEmpty=Ae,O.text_join=kt,O.text_length=Je,O.text_print=q,O.text_prompt=ie,O.text_prompt_ext=ie,O.text_replace=U,O.text_reverse=K,O.text_trim=z;var M={};M.variables_get=oe,M.variables_set=ne;var y={};y.variables_get_dynamic=oe,y.variables_set_dynamic=ne;var Y=new L;Y.addReservedWords("math,random,Number");var a=Object.assign({},le,ce,ue,he,Ie,O,M,y);for(const d in a)Y.forBlock[d]=a[d];var T={};return T.Order=$,T.PythonGenerator=L,T.pythonGenerator=Y,T.__namespace__=c,T})})(ef);var CD=ef.exports;/** - * @license - * Copyright 2024 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const tf="colour_picker",Xv={type:tf,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"]},Yv=Q.common.createBlockDefinitionsFromJsonArray([Xv]);Yv[tf];/** - * @license - * Copyright 2024 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const sf="colour_random",zv={type:sf,message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"},jv=Q.common.createBlockDefinitionsFromJsonArray([zv]);jv[sf];/** - * @license - * Copyright 2024 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const of="colour_rgb",Kv={type:of,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}"},Jv=Q.common.createBlockDefinitionsFromJsonArray([Kv]);Jv[of];/** - * @license - * Copyright 2024 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const rf="colour_blend",qv={type:rf,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}"},Qv=Q.common.createBlockDefinitionsFromJsonArray([qv]);Qv[rf];const Zv={__name:"App",setup(n){let h=null;fE(()=>{hE(()=>{Wv(),w()})}),Vb(Vv);const o={init:function(){this.appendEndRowInput("NAME").setAlign(Gm.Align.CENTRE).appendField(new Pn("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCIgaWQ9ImRzbUljb24iPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIgMikiIGlkPSJJY29uLzQ4L21vdG9yIiBzdHJva2Utd2lkdGg9IjEiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PGNpcmNsZSBpZD0iQmciIGZpbGw9IiNGRkYiIGN4PSIyMiIgY3k9IjIyIiByPSIyMSIvPjxwYXRoIGQ9Ik0yMiAwYzEyLjE1IDAgMjIgOS44NSAyMiAyMnMtOS44NSAyMi0yMiAyMlMwIDM0LjE1IDAgMjIgOS44NSAwIDIyIDB6bTAgMS41QzEwLjY5NiAxLjUgMS41IDEwLjY5NiAxLjUgMjJTMTAuNjk2IDQyLjUgMjIgNDIuNSA0Mi41IDMzLjMwNCA0Mi41IDIyIDMzLjMwNCAxLjUgMjIgMS41em0wIDI2Ljc1YTUuNzUgNS43NSAwIDExMCAxMS41IDUuNzUgNS43NSAwIDAxMC0xMS41em0tMTItMTJhNS43NSA1Ljc1IDAgMTEwIDExLjUgNS43NSA1Ljc1IDAgMDEwLTExLjV6bTI0IDBhNS43NSA1Ljc1IDAgMTEwIDExLjUgNS43NSA1Ljc1IDAgMDEwLTExLjV6bS0xMi4xMzIgMS43NTdsLjExNi0uMDA3YTEgMSAwIDAxLjk5NC44ODNsLjAwNi4xMTd2MS45N0gyNWExIDEgMCAwMS45OTMuODg0bC4wMDcuMTE3YTEgMSAwIDAxLS44ODMuOTkzbC0uMTE3LjAwNy0yLjAxNi0uMDAxVjI1YTEgMSAwIDAxLS44ODMuOTkzbC0uMTE3LjAwN2ExIDEgMCAwMS0uOTkzLS44ODNMMjAuOTg0IDI1di0yLjAzaC0yLjAxNWExIDEgMCAwMS0uOTkzLS44ODNsLS4wMDctLjExNmExIDEgMCAwMS44ODMtLjk5NGwuMTE3LS4wMDYgMi4wMTUtLjAwMVYxOWExIDEgMCAwMS44ODQtLjk5M2wuMTE2LS4wMDd6TTIyIDQuMjVhNS43NSA1Ljc1IDAgMTEwIDExLjUgNS43NSA1Ljc1IDAgMDEwLTExLjV6IiBpZD0iQ29tYmluZWQtU2hhcGUiIGZpbGw9IiMwMDc4Q0MiLz48L2c+PC9zdmc+",25,25,{alt:"*",flipRtl:"FALSE"})).appendField(new YE,"c").appendField(new wn([["向左","left"],["向右","right"]]),"direction").appendField("运行").appendField(new Hm(1),"num").appendField(new wn([["圈","1"],["度","2"],["秒","3"]]),"type"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setHelpUrl(""),this.setColour(qd.colour.rgbToHex(63,142,238))}},c={init:function(){this.appendEndRowInput("action").setAlign(Gm.Align.CENTRE).appendField(new Pn("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCIgaWQ9ImRzbUljb24iPjxnIGlkPSJJY29uLzQ4L3BsYXktYmxvY2stb3V0bGluZWQiIHN0cm9rZS13aWR0aD0iMSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMzUuMzc2IDI0TDEzLjI1IDM4LjM4MlY5LjYxOEwzNS4zNzYgMjR6IiBpZD0iQ29tYmluZWQtU2hhcGUiIHN0cm9rZT0iI0NFQUMwMSIgc3Ryb2tlLXdpZHRoPSIxLjUiIGZpbGw9IiNGRkZGRkYiLz48L2c+PC9zdmc+",25,25,{alt:"*",flipRtl:"FALSE"})).appendField("当程序启动时"),this.setInputsInline(!1),this.setNextStatement(!0,null),this.setTooltip(""),this.setHelpUrl(""),this.setColour(qd.colour.rgbToHex(237,198,67))}},m={init:function(){this.appendEndRowInput("NAME").appendField(new Pn("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCIgaWQ9ImRzbUljb24iPjxnIGlkPSJJY29uLzQ4L21vdmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNOS45MzEgMzguMDY5QTIwLjQwNSAyMC40MDUgMCAwMDIwLjUgNDFDMzEuODIyIDQxIDQxIDMxLjgyMiA0MSAyMC41YzAtMy44NjYtMS4wNy03LjQ4My0yLjkzMS0xMC41NjlDNDQuMDIgMTMuNTE5IDQ4IDIwLjA0NSA0OCAyNy41IDQ4IDM4LjgyMiAzOC44MjIgNDggMjcuNSA0OGMtNy40NTUgMC0xMy45ODEtMy45OC0xNy41NjktOS45MzF6IiBpZD0iQmctMiIgZmlsbD0iI0ZGRiIvPjxwYXRoIGQ9Ik0yNy41IDMzLjMyNGE1LjM1OCA1LjM1OCAwIDExMCAxMC43MTYgNS4zNTggNS4zNTggMCAwMTAtMTAuNzE2ek00NC4wNCAyNy41YTUuMzU4IDUuMzU4IDAgMTEtMTAuNzE2IDAgNS4zNTggNS4zNTggMCAwMTEwLjcxNiAwek0yNy41IDQ4QzM4LjgyMiA0OCA0OCAzOC44MjIgNDggMjcuNVMzOC44MjIgNyAyNy41IDcgNyAxNi4xNzggNyAyNy41IDE2LjE3OCA0OCAyNy41IDQ4em0wLTEuNWMtMTAuNDkzIDAtMTktOC41MDctMTktMTlzOC41MDctMTkgMTktMTkgMTkgOC41MDcgMTkgMTktOC41MDcgMTktMTkgMTl6IiBpZD0iQ29tYmluZWQtU2hhcGUtMiIgZmlsbD0iI0M4MDA5MCIvPjxjaXJjbGUgaWQ9IkJnLTEiIGZpbGw9IiNGRkYiIGN4PSIyMC41IiBjeT0iMjAuNSIgcj0iMjAuNSIvPjxwYXRoIGQ9Ik0xNC42NzYgMjAuNWE1LjM1OCA1LjM1OCAwIDExLTEwLjcxNiAwIDUuMzU4IDUuMzU4IDAgMDExMC43MTYgMHptMjIuMzY0IDBhNS4zNTggNS4zNTggMCAxMS0xMC43MTYgMCA1LjM1OCA1LjM1OCAwIDAxMTAuNzE2IDB6bS0xNy41NTUuOTczaC0xLjgxYTEgMSAwIDAxMC0yaDEuODF2LTEuNzY4YTEgMSAwIDAxMiAwdjEuNzY4aDEuODFhMSAxIDAgMDEwIDJoLTEuODF2MS44MjJhMSAxIDAgMDEtMiAwdi0xLjgyMnptMS4wMTUgNC44NWE1LjM1OCA1LjM1OCAwIDExMCAxMC43MTcgNS4zNTggNS4zNTggMCAwMTAtMTAuNzE2em0wLTIyLjM2M2E1LjM1OCA1LjM1OCAwIDExMCAxMC43MTYgNS4zNTggNS4zNTggMCAwMTAtMTAuNzE2em0wIDM3LjA0QzMxLjgyMiA0MSA0MSAzMS44MjIgNDEgMjAuNVMzMS44MjIgMCAyMC41IDAgMCA5LjE3OCAwIDIwLjUgOS4xNzggNDEgMjAuNSA0MXptMC0xLjVjLTEwLjQ5MyAwLTE5LTguNTA3LTE5LTE5czguNTA3LTE5IDE5LTE5IDE5IDguNTA3IDE5IDE5LTguNTA3IDE5LTE5IDE5eiIgaWQ9IkNvbWJpbmVkLVNoYXBlLTEiIGZpbGw9IiNDODAwOTAiLz48L2c+PC9zdmc+",25,25,{alt:"*",flipRtl:"FALSE"})).appendField(new wn([["向上","up"],["向下","down"]]),"direction").appendField("移动").appendField(new Ub("10"),"num").appendField(new wn([["圈","1"],["度","2"],["秒","3"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setHelpUrl(""),this.setColour(qd.colour.rgbToHex(236,90,200))}},f={init:function(){this.appendEndRowInput("NAME").appendField(new Pn("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCIgaWQ9ImRzbUljb24iPjxnIGlkPSJJY29uLzQ4LzN4M21hdHJpeCIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0zOS42MTMgNDIuNzAzSDcuODlBMy4wOSAzLjA5IDAgMDE0LjggMzkuNjE0VjcuODlBMy4wOSAzLjA5IDAgMDE3Ljg4OSA0LjhoMzEuNzI0YTMuMDkgMy4wOSAwIDAxMy4wODkgMy4wOXYzMS43MjRhMy4wODkgMy4wODkgMCAwMS0zLjA4OSAzLjA5IiBpZD0iQm9yZGVyIiBmaWxsPSIjNjkxRkYwIi8+PHBhdGggZD0iTTE2LjA2IDE2Ljc3Mkg3LjkxOGEuNzkyLjc5MiAwIDAxLS43OTItLjc5M1Y3LjgzOGMwLS40MzguMzU1LS43OTMuNzkyLS43OTNoOC4xNDJjLjQzOCAwIC43OTMuMzU1Ljc5My43OTN2OC4xNGMwIC40NC0uMzU1Ljc5NC0uNzkzLjc5NCIgaWQ9IjEiIGZpbGw9IiNGRkYiLz48cGF0aCBkPSJNMjcuODIyIDE2Ljc3MkgxOS42OGEuNzkzLjc5MyAwIDAxLS43OTMtLjc5M1Y3LjgzOGMwLS40MzguMzU1LS43OTMuNzkzLS43OTNoOC4xNGMuNDM5IDAgLjc5NC4zNTUuNzk0Ljc5M3Y4LjE0YzAgLjQ0LS4zNTUuNzk0LS43OTMuNzk0IiBpZD0iMiIgZmlsbD0iI0ZGRiIvPjxwYXRoIGQ9Ik0zOS41ODQgMTYuNzcyaC04LjE0YS43OTMuNzkzIDAgMDEtLjc5NC0uNzkzVjcuODM4YzAtLjQzOC4zNTUtLjc5My43OTMtLjc5M2g4LjE0Yy40MzkgMCAuNzk0LjM1NS43OTQuNzkzdjguMTRjMCAuNDQtLjM1NS43OTQtLjc5My43OTQiIGlkPSIzIiBmaWxsPSIjRkZGIi8+PHBhdGggZD0iTTE2LjA2IDI4LjYxNUg3LjkxOGEuNzkzLjc5MyAwIDAxLS43OTItLjc5M1YxOS42OGMwLS40MzguMzU1LS43OTIuNzkyLS43OTJoOC4xNDJjLjQzOCAwIC43OTMuMzU0Ljc5My43OTJ2OC4xNDJhLjc5My43OTMgMCAwMS0uNzkzLjc5MyIgaWQ9IjQiIGZpbGw9IiNGRkYiLz48cGF0aCBkPSJNMjcuODIyIDI4LjYxNUgxOS42OGEuNzkzLjc5MyAwIDAxLS43OTMtLjc5M1YxOS42OGMwLS40MzguMzU1LS43OTIuNzkzLS43OTJoOC4xNGMuNDM5IDAgLjc5NC4zNTQuNzk0Ljc5MnY4LjE0MmEuNzkzLjc5MyAwIDAxLS43OTMuNzkzIiBpZD0iNSIgZmlsbD0iI0ZGRiIvPjxwYXRoIGQ9Ik0zOS41ODQgMjguNjE1aC04LjE0YS43OTMuNzkzIDAgMDEtLjc5NC0uNzkzVjE5LjY4YzAtLjQzOC4zNTUtLjc5Mi43OTMtLjc5Mmg4LjE0Yy40MzkgMCAuNzk0LjM1NC43OTQuNzkydjguMTQyYS43OTMuNzkzIDAgMDEtLjc5My43OTMiIGlkPSI2IiBmaWxsPSIjRkZGIi8+PHBhdGggZD0iTTE2LjA2IDQwLjQ1OEg3LjkxOGEuNzkzLjc5MyAwIDAxLS43OTItLjc5M3YtOC4xNGMwLS40MzkuMzU1LS43OTQuNzkyLS43OTRoOC4xNDJjLjQzOCAwIC43OTMuMzU1Ljc5My43OTN2OC4xNDFhLjc5My43OTMgMCAwMS0uNzkzLjc5MyIgaWQ9IjciIGZpbGw9IiNGRkYiLz48cGF0aCBkPSJNMjcuODIyIDQwLjQ1OEgxOS42OGEuNzkzLjc5MyAwIDAxLS43OTMtLjc5M3YtOC4xNGMwLS40MzkuMzU1LS43OTQuNzkzLS43OTRoOC4xNGMuNDM5IDAgLjc5NC4zNTUuNzk0Ljc5M3Y4LjE0MWEuNzkzLjc5MyAwIDAxLS43OTMuNzkzIiBpZD0iOCIgZmlsbD0iI0ZGRiIvPjxwYXRoIGQ9Ik0zOS41ODQgNDAuNDU4aC04LjE0YS43OTMuNzkzIDAgMDEtLjc5NC0uNzkzdi04LjE0YzAtLjQzOS4zNTUtLjc5NC43OTMtLjc5NGg4LjE0Yy40MzkgMCAuNzk0LjM1NS43OTQuNzkzdjguMTQxYS43OTMuNzkzIDAgMDEtLjc5My43OTMiIGlkPSI5IiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==",25,25,{alt:"*",flipRtl:"FALSE"})).appendField(new wn([["A","a"],["B","b"],["A + B","c"]]),"c").appendField("点亮").appendField(new zE([[{value:0,color:""},{value:0,color:""},{value:0,color:""},{value:0,color:""}],[{value:0,color:""},{value:0,color:""},{value:0,color:""},{value:0,color:""}],[{value:0,color:""},{value:0,color:""},{value:0,color:""},{value:0,color:""}],[{value:0,color:""},{value:0,color:""},{value:0,color:""},{value:0,color:""}]],P=>{},{width:1,height:1,fieldHeight:20}),"FIELDNAME").appendField(new Hm(1),"num").appendField("秒"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(""),this.setHelpUrl(""),this.setColour("rgb(148, 108, 238)")}},R={init:function(){this.appendEndRowInput("NAME").appendField(new Pn("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCIgaWQ9ImRzbUljb24iPjxnIGlkPSJJY29uLzQ4L2NvbG9yLXNlbnNvciIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0zOCA1LjVjMi40ODEgMCA0LjUgMi4wMTkgNC41IDQuNXYyOGMwIDIuNDgxLTIuMDE5IDQuNS00LjUgNC41SDEwQTQuNTA1IDQuNTA1IDAgMDE1LjUgMzhWMTBjMC0yLjQ4MSAyLjAxOS00LjUgNC41LTQuNWgyOCIgaWQ9IkJnIiBmaWxsPSIjRkZGIi8+PHBhdGggZD0iTTM0IDI0YzAgNS41MjItNC40NzcgMTAtMTAgMTBzLTEwLTQuNDc4LTEwLTEwIDQuNDc3LTEwIDEwLTEwIDEwIDQuNDc4IDEwIDEwem00LTIwYTYgNiAwIDAxNiA2djI4YTYgNiAwIDAxLTYgNkgxMGE2IDYgMCAwMS02LTZWMTBhNiA2IDAgMDE2LTZoMjh6bTAgMS41SDEwQTQuNTA1IDQuNTA1IDAgMDA1LjUgMTB2MjhjMCAyLjQ4MSAyLjAxOSA0LjUgNC41IDQuNWgyOGMyLjQ4MSAwIDQuNS0yLjAxOSA0LjUtNC41VjEwYzAtMi40ODEtMi4wMTktNC41LTQuNS00LjV6TTI0IDljOC4yNzEgMCAxNSA2LjcyOSAxNSAxNXMtNi43MjkgMTUtMTUgMTVTOSAzMi4yNzEgOSAyNCAxNS43MjkgOSAyNCA5em0wIDJjLTcuMTggMC0xMyA1LjgyLTEzIDEzczUuODIgMTMgMTMgMTMgMTMtNS44MiAxMy0xMy01LjgyLTEzLTEzLTEzeiIgaWQ9IkNvbWJpbmVkLVNoYXBlIiBmaWxsPSIjMDBBOEM5Ii8+PC9nPjwvc3ZnPg==",25,25,{alt:"*",flipRtl:"FALSE"})).appendField(new Qb.FieldGridDropdown([["A","a"],["B","b"],["A + B","c"]]),"c").appendField("颜色是否为").appendField(new k$("#e700a7",null,{colourOptions:["#e700a7","#0090f5","#77e8ff","#00a845","#ffe360","#ff000c","#ffffff","#000000","transparent"],columns:3}),"NAME").appendField("?"),this.setTooltip(""),this.setHelpUrl(""),this.setColour("#34ccf1")}};xn.defineBlocks({my_block:R}),xn.defineBlocks({light:f}),xn.defineBlocks({sport01:m}),xn.defineBlocks({rotate:o}),xn.defineBlocks({start:c});function N(){var P=document.getElementById("workspace-blocks");P.firstElementChild&&Hb.appendDomToWorkspace(P,h)}function k(P,W){h=Gb(P,W),N()}const F={kind:"categoryToolbox",contents:[{kind:"category",name:"电机",colour:"#3f8eee",contents:[{kind:"block",type:"rotate"}]},{kind:"category",name:"运动",colour:"#ec5ac8",contents:[{kind:"block",type:"sport01"}]},{kind:"category",name:"灯光",colour:"#f9c440",contents:[{kind:"block",type:"light"}]},{kind:"category",name:"传感器",colour:"#34ccf1",contents:[{kind:"block",type:"my_block"}]}]},w=()=>{k("blocklyDiv",{toolbox:F,plugins:{toolbox:Xb,flyoutsVerticalToolbox:zb,metricsManager:XE}})};return(P,W)=>{const ae=_m("block"),re=_m("xml");return WO(),zO(js,null,[W[0]||(W[0]=M$("div",{id:"blocklyDiv",style:{height:"100vh",width:"100vw"}},null,-1)),So(re,{xmlns:"https://developers.google.com/blockly/xml",id:"workspace-blocks",style:{display:"none"}},{default:TE(()=>[So(ae,{type:"start"})]),_:1})],64)}}};kb(Zv).mount("#app"); diff --git a/docs/assets/index-pCPnhimn.js b/docs/assets/index-pCPnhimn.js new file mode 100644 index 00000000..5efaf25a --- /dev/null +++ b/docs/assets/index-pCPnhimn.js @@ -0,0 +1,17 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function s(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(r){if(r.ep)return;r.ep=!0;const o=s(r);fetch(r.href,o)}})();/** +* @vue/shared v3.5.6 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function ws(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const U={},Ge=[],ye=()=>{},Pr=()=>!1,Ut=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),xs=e=>e.startsWith("onUpdate:"),X=Object.assign,Cs=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},Mr=Object.prototype.hasOwnProperty,F=(e,t)=>Mr.call(e,t),A=Array.isArray,lt=e=>Bt(e)==="[object Map]",Rr=e=>Bt(e)==="[object Set]",H=e=>typeof e=="function",G=e=>typeof e=="string",Qe=e=>typeof e=="symbol",W=e=>e!==null&&typeof e=="object",Tn=e=>(W(e)||H(e))&&H(e.then)&&H(e.catch),Fr=Object.prototype.toString,Bt=e=>Fr.call(e),Dr=e=>Bt(e).slice(8,-1),Lr=e=>Bt(e)==="[object Object]",Es=e=>G(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ct=ws(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Vt=e=>{const t=Object.create(null);return s=>t[s]||(t[s]=e(s))},Nr=/-(\w)/g,Ve=Vt(e=>e.replace(Nr,(t,s)=>s?s.toUpperCase():"")),kr=/\B([A-Z])/g,We=Vt(e=>e.replace(kr,"-$1").toLowerCase()),An=Vt(e=>e.charAt(0).toUpperCase()+e.slice(1)),Zt=Vt(e=>e?`on${An(e)}`:""),Ke=(e,t)=>!Object.is(e,t),Qt=(e,...t)=>{for(let s=0;s{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},jr=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Ys;const Pn=()=>Ys||(Ys=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Os(e){if(A(e)){const t={};for(let s=0;s{if(s){const n=s.split(Ur);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Ss(e){let t="";if(G(e))t=e;else if(A(e))for(let s=0;s0)return;let e;for(;ft;){let t=ft;for(ft=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function Ln(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Nn(e){let t,s=e.depsTail,n=s;for(;n;){const r=n.prevDep;n.version===-1?(n===s&&(s=r),As(n),Gr(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=r}e.deps=t,e.depsTail=s}function us(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(kn(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function kn(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===pt))return;e.globalVersion=pt;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!us(e)){e.flags&=-3;return}const s=k,n=ae;k=e,ae=!0;try{Ln(e);const r=e.fn(e._value);(t.version===0||Ke(r,e._value))&&(e._value=r,t.version++)}catch(r){throw t.version++,r}finally{k=s,ae=n,Nn(e),e.flags&=-3}}function As(e){const{dep:t,prevSub:s,nextSub:n}=e;if(s&&(s.nextSub=n,e.prevSub=void 0),n&&(n.prevSub=s,e.nextSub=void 0),t.subs===e&&(t.subs=s),!t.subs&&t.computed){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)As(r)}}function Gr(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let ae=!0;const jn=[];function Re(){jn.push(ae),ae=!1}function Fe(){const e=jn.pop();ae=e===void 0?!0:e}function Zs(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=k;k=void 0;try{t()}finally{k=s}}}let pt=0;class Jr{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class $n{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0}track(t){if(!k||!ae||k===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==k)s=this.activeLink=new Jr(k,this),k.deps?(s.prevDep=k.depsTail,k.depsTail.nextDep=s,k.depsTail=s):k.deps=k.depsTail=s,k.flags&4&&Un(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=k.depsTail,s.nextDep=void 0,k.depsTail.nextDep=s,k.depsTail=s,k.deps===s&&(k.deps=n)}return s}trigger(t){this.version++,pt++,this.notify(t)}notify(t){Is();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Ts()}}}function Un(e){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Un(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}const as=new WeakMap,Ue=Symbol(""),ds=Symbol(""),gt=Symbol("");function Y(e,t,s){if(ae&&k){let n=as.get(e);n||as.set(e,n=new Map);let r=n.get(s);r||n.set(s,r=new $n),r.track()}}function Oe(e,t,s,n,r,o){const i=as.get(e);if(!i){pt++;return}const f=u=>{u&&u.trigger()};if(Is(),t==="clear")i.forEach(f);else{const u=A(e),h=u&&Es(s);if(u&&s==="length"){const a=Number(n);i.forEach((p,y)=>{(y==="length"||y===gt||!Qe(y)&&y>=a)&&f(p)})}else switch(s!==void 0&&f(i.get(s)),h&&f(i.get(gt)),t){case"add":u?h&&f(i.get("length")):(f(i.get(Ue)),lt(e)&&f(i.get(ds)));break;case"delete":u||(f(i.get(Ue)),lt(e)&&f(i.get(ds)));break;case"set":lt(e)&&f(i.get(Ue));break}}Ts()}function ze(e){const t=L(e);return t===e?t:(Y(t,"iterate",gt),ve(e)?t:t.map(ce))}function Hs(e){return Y(e=L(e),"iterate",gt),e}const Xr={__proto__:null,[Symbol.iterator](){return ts(this,Symbol.iterator,ce)},concat(...e){return ze(this).concat(...e.map(t=>A(t)?ze(t):t))},entries(){return ts(this,"entries",e=>(e[1]=ce(e[1]),e))},every(e,t){return xe(this,"every",e,t,void 0,arguments)},filter(e,t){return xe(this,"filter",e,t,s=>s.map(ce),arguments)},find(e,t){return xe(this,"find",e,t,ce,arguments)},findIndex(e,t){return xe(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return xe(this,"findLast",e,t,ce,arguments)},findLastIndex(e,t){return xe(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return xe(this,"forEach",e,t,void 0,arguments)},includes(...e){return ss(this,"includes",e)},indexOf(...e){return ss(this,"indexOf",e)},join(e){return ze(this).join(e)},lastIndexOf(...e){return ss(this,"lastIndexOf",e)},map(e,t){return xe(this,"map",e,t,void 0,arguments)},pop(){return rt(this,"pop")},push(...e){return rt(this,"push",e)},reduce(e,...t){return Qs(this,"reduce",e,t)},reduceRight(e,...t){return Qs(this,"reduceRight",e,t)},shift(){return rt(this,"shift")},some(e,t){return xe(this,"some",e,t,void 0,arguments)},splice(...e){return rt(this,"splice",e)},toReversed(){return ze(this).toReversed()},toSorted(e){return ze(this).toSorted(e)},toSpliced(...e){return ze(this).toSpliced(...e)},unshift(...e){return rt(this,"unshift",e)},values(){return ts(this,"values",ce)}};function ts(e,t,s){const n=Hs(e),r=n[t]();return n!==e&&!ve(e)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.value&&(o.value=s(o.value)),o}),r}const Yr=Array.prototype;function xe(e,t,s,n,r,o){const i=Hs(e),f=i!==e&&!ve(e),u=i[t];if(u!==Yr[t]){const p=u.apply(e,o);return f?ce(p):p}let h=s;i!==e&&(f?h=function(p,y){return s.call(this,ce(p),y,e)}:s.length>2&&(h=function(p,y){return s.call(this,p,y,e)}));const a=u.call(i,h,n);return f&&r?r(a):a}function Qs(e,t,s,n){const r=Hs(e);let o=s;return r!==e&&(ve(e)?s.length>3&&(o=function(i,f,u){return s.call(this,i,f,u,e)}):o=function(i,f,u){return s.call(this,i,ce(f),u,e)}),r[t](o,...n)}function ss(e,t,s){const n=L(e);Y(n,"iterate",gt);const r=n[t](...s);return(r===-1||r===!1)&&Ds(s[0])?(s[0]=L(s[0]),n[t](...s)):r}function rt(e,t,s=[]){Re(),Is();const n=L(e)[t].apply(e,s);return Ts(),Fe(),n}const Zr=ws("__proto__,__v_isRef,__isVue"),Bn=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Qe));function Qr(e){Qe(e)||(e=String(e));const t=L(this);return Y(t,"has",e),t.hasOwnProperty(e)}class Vn{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){const r=this._isReadonly,o=this._isShallow;if(s==="__v_isReactive")return!r;if(s==="__v_isReadonly")return r;if(s==="__v_isShallow")return o;if(s==="__v_raw")return n===(r?o?ho:qn:o?zn:Wn).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const i=A(t);if(!r){let u;if(i&&(u=Xr[s]))return u;if(s==="hasOwnProperty")return Qr}const f=Reflect.get(t,s,se(t)?t:n);return(Qe(s)?Bn.has(s):Zr(s))||(r||Y(t,"get",s),o)?f:se(f)?i&&Es(s)?f:f.value:W(f)?r?Gn(f):Rs(f):f}}class Kn extends Vn{constructor(t=!1){super(!1,t)}set(t,s,n,r){let o=t[s];if(!this._isShallow){const u=Ye(o);if(!ve(n)&&!Ye(n)&&(o=L(o),n=L(n)),!A(t)&&se(o)&&!se(n))return u?!1:(o.value=n,!0)}const i=A(t)&&Es(s)?Number(s)e,Kt=e=>Reflect.getPrototypeOf(e);function It(e,t,s=!1,n=!1){e=e.__v_raw;const r=L(e),o=L(t);s||(Ke(t,o)&&Y(r,"get",t),Y(r,"get",o));const{has:i}=Kt(r),f=n?Ps:s?Ls:ce;if(i.call(r,t))return f(e.get(t));if(i.call(r,o))return f(e.get(o));e!==r&&e.get(t)}function Tt(e,t=!1){const s=this.__v_raw,n=L(s),r=L(e);return t||(Ke(e,r)&&Y(n,"has",e),Y(n,"has",r)),e===r?s.has(e):s.has(e)||s.has(r)}function At(e,t=!1){return e=e.__v_raw,!t&&Y(L(e),"iterate",Ue),Reflect.get(e,"size",e)}function en(e,t=!1){!t&&!ve(e)&&!Ye(e)&&(e=L(e));const s=L(this);return Kt(s).has.call(s,e)||(s.add(e),Oe(s,"add",e,e)),this}function tn(e,t,s=!1){!s&&!ve(t)&&!Ye(t)&&(t=L(t));const n=L(this),{has:r,get:o}=Kt(n);let i=r.call(n,e);i||(e=L(e),i=r.call(n,e));const f=o.call(n,e);return n.set(e,t),i?Ke(t,f)&&Oe(n,"set",e,t):Oe(n,"add",e,t),this}function sn(e){const t=L(this),{has:s,get:n}=Kt(t);let r=s.call(t,e);r||(e=L(e),r=s.call(t,e)),n&&n.call(t,e);const o=t.delete(e);return r&&Oe(t,"delete",e,void 0),o}function nn(){const e=L(this),t=e.size!==0,s=e.clear();return t&&Oe(e,"clear",void 0,void 0),s}function Ht(e,t){return function(n,r){const o=this,i=o.__v_raw,f=L(i),u=t?Ps:e?Ls:ce;return!e&&Y(f,"iterate",Ue),i.forEach((h,a)=>n.call(r,u(h),u(a),o))}}function Pt(e,t,s){return function(...n){const r=this.__v_raw,o=L(r),i=lt(o),f=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,h=r[e](...n),a=s?Ps:t?Ls:ce;return!t&&Y(o,"iterate",u?ds:Ue),{next(){const{value:p,done:y}=h.next();return y?{value:p,done:y}:{value:f?[a(p[0]),a(p[1])]:a(p),done:y}},[Symbol.iterator](){return this}}}}function Ae(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ro(){const e={get(o){return It(this,o)},get size(){return At(this)},has:Tt,add:en,set:tn,delete:sn,clear:nn,forEach:Ht(!1,!1)},t={get(o){return It(this,o,!1,!0)},get size(){return At(this)},has:Tt,add(o){return en.call(this,o,!0)},set(o,i){return tn.call(this,o,i,!0)},delete:sn,clear:nn,forEach:Ht(!1,!0)},s={get(o){return It(this,o,!0)},get size(){return At(this,!0)},has(o){return Tt.call(this,o,!0)},add:Ae("add"),set:Ae("set"),delete:Ae("delete"),clear:Ae("clear"),forEach:Ht(!0,!1)},n={get(o){return It(this,o,!0,!0)},get size(){return At(this,!0)},has(o){return Tt.call(this,o,!0)},add:Ae("add"),set:Ae("set"),delete:Ae("delete"),clear:Ae("clear"),forEach:Ht(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=Pt(o,!1,!1),s[o]=Pt(o,!0,!1),t[o]=Pt(o,!1,!0),n[o]=Pt(o,!0,!0)}),[e,s,t,n]}const[oo,io,lo,co]=ro();function Ms(e,t){const s=t?e?co:lo:e?io:oo;return(n,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?n:Reflect.get(F(s,r)&&r in n?s:n,r,o)}const fo={get:Ms(!1,!1)},uo={get:Ms(!1,!0)},ao={get:Ms(!0,!1)};const Wn=new WeakMap,zn=new WeakMap,qn=new WeakMap,ho=new WeakMap;function po(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function go(e){return e.__v_skip||!Object.isExtensible(e)?0:po(Dr(e))}function Rs(e){return Ye(e)?e:Fs(e,!1,to,fo,Wn)}function mo(e){return Fs(e,!1,no,uo,zn)}function Gn(e){return Fs(e,!0,so,ao,qn)}function Fs(e,t,s,n,r){if(!W(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=r.get(e);if(o)return o;const i=go(e);if(i===0)return e;const f=new Proxy(e,i===2?n:s);return r.set(e,f),f}function ut(e){return Ye(e)?ut(e.__v_raw):!!(e&&e.__v_isReactive)}function Ye(e){return!!(e&&e.__v_isReadonly)}function ve(e){return!!(e&&e.__v_isShallow)}function Ds(e){return e?!!e.__v_raw:!1}function L(e){const t=e&&e.__v_raw;return t?L(t):e}function _o(e){return!F(e,"__v_skip")&&Object.isExtensible(e)&&Hn(e,"__v_skip",!0),e}const ce=e=>W(e)?Rs(e):e,Ls=e=>W(e)?Gn(e):e;function se(e){return e?e.__v_isRef===!0:!1}function bo(e){return se(e)?e.value:e}const yo={get:(e,t,s)=>t==="__v_raw"?e:bo(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const r=e[t];return se(r)&&!se(s)?(r.value=s,!0):Reflect.set(e,t,s,n)}};function Jn(e){return ut(e)?e:new Proxy(e,yo)}class vo{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new $n(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=pt-1,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&k!==this)return Dn(this),!0}get value(){const t=this.dep.track();return kn(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function wo(e,t,s=!1){let n,r;return H(e)?n=e:(n=e.get,r=e.set),new vo(n,r,s)}const Mt={},Nt=new WeakMap;let $e;function xo(e,t=!1,s=$e){if(s){let n=Nt.get(s);n||Nt.set(s,n=[]),n.push(e)}}function Co(e,t,s=U){const{immediate:n,deep:r,once:o,scheduler:i,augmentJob:f,call:u}=s,h=I=>r?I:ve(I)||r===!1||r===0?Me(I,1):Me(I);let a,p,y,S,P=!1,R=!1;if(se(e)?(p=()=>e.value,P=ve(e)):ut(e)?(p=()=>h(e),P=!0):A(e)?(R=!0,P=e.some(I=>ut(I)||ve(I)),p=()=>e.map(I=>{if(se(I))return I.value;if(ut(I))return h(I);if(H(I))return u?u(I,2):I()})):H(e)?t?p=u?()=>u(e,2):e:p=()=>{if(y){Re();try{y()}finally{Fe()}}const I=$e;$e=a;try{return u?u(e,3,[S]):e(S)}finally{$e=I}}:p=ye,t&&r){const I=p,z=r===!0?1/0:r;p=()=>Me(I(),z)}const q=qr(),N=()=>{a.stop(),q&&Cs(q.effects,a)};if(o&&t){const I=t;t=(...z)=>{I(...z),N()}}let V=R?new Array(e.length).fill(Mt):Mt;const K=I=>{if(!(!(a.flags&1)||!a.dirty&&!I))if(t){const z=a.run();if(r||P||(R?z.some((Ie,de)=>Ke(Ie,V[de])):Ke(z,V))){y&&y();const Ie=$e;$e=a;try{const de=[z,V===Mt?void 0:R&&V[0]===Mt?[]:V,S];u?u(t,3,de):t(...de),V=z}finally{$e=Ie}}}else a.run()};return f&&f(K),a=new Rn(p),a.scheduler=i?()=>i(K,!1):K,S=I=>xo(I,!1,a),y=a.onStop=()=>{const I=Nt.get(a);if(I){if(u)u(I,4);else for(const z of I)z();Nt.delete(a)}},t?n?K(!0):V=a.run():i?i(K.bind(null,!0),!0):a.run(),N.pause=a.pause.bind(a),N.resume=a.resume.bind(a),N.stop=N,N}function Me(e,t=1/0,s){if(t<=0||!W(e)||e.__v_skip||(s=s||new Set,s.has(e)))return e;if(s.add(e),t--,se(e))Me(e.value,t,s);else if(A(e))for(let n=0;n{Me(n,t,s)});else if(Lr(e)){for(const n in e)Me(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Me(e[n],t,s)}return e}/** +* @vue/runtime-core v3.5.6 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function vt(e,t,s,n){try{return n?e(...n):e()}catch(r){Wt(r,t,s)}}function we(e,t,s,n){if(H(e)){const r=vt(e,t,s,n);return r&&Tn(r)&&r.catch(o=>{Wt(o,t,s)}),r}if(A(e)){const r=[];for(let o=0;o>>1,r=ee[n],o=_t(r);o=_t(s)?ee.push(e):ee.splice(Oo(t),0,e),e.flags|=1,Zn()}}function Zn(){!mt&&!hs&&(hs=!0,Ns=Xn.then(er))}function So(e){A(e)?Je.push(...e):He&&e.id===-1?He.splice(qe+1,0,e):e.flags&1||(Je.push(e),e.flags|=1),Zn()}function rn(e,t,s=mt?me+1:0){for(;s_t(s)-_t(n));if(Je.length=0,He){He.push(...t);return}for(He=t,qe=0;qee.id==null?e.flags&2?-1:1/0:e.id;function er(e){hs=!1,mt=!0;try{for(me=0;me{n._d&&hn(-1);const o=kt(t);let i;try{i=e(...r)}finally{kt(o),n._d&&hn(1)}return i};return n._n=!0,n._c=!0,n._d=!0,n}function ke(e,t,s,n){const r=e.dirs,o=t&&t.dirs;for(let i=0;ie.__isTeleport;function js(e,t){e.shapeFlag&6&&e.component?(e.transition=t,js(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function sr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ps(e,t,s,n,r=!1){if(A(e)){e.forEach((P,R)=>ps(P,t&&(A(t)?t[R]:t),s,n,r));return}if(at(n)&&!r)return;const o=n.shapeFlag&4?Vs(n.component):n.el,i=r?null:o,{i:f,r:u}=e,h=t&&t.r,a=f.refs===U?f.refs={}:f.refs,p=f.setupState,y=L(p),S=p===U?()=>!1:P=>F(y,P);if(h!=null&&h!==u&&(G(h)?(a[h]=null,S(h)&&(p[h]=null)):se(h)&&(h.value=null)),H(u))vt(u,f,12,[i,a]);else{const P=G(u),R=se(u);if(P||R){const q=()=>{if(e.f){const N=P?S(u)?p[u]:a[u]:u.value;r?A(N)&&Cs(N,o):A(N)?N.includes(o)||N.push(o):P?(a[u]=[o],S(u)&&(p[u]=a[u])):(u.value=[o],e.k&&(a[e.k]=u.value))}else P?(a[u]=i,S(u)&&(p[u]=i)):R&&(u.value=i,e.k&&(a[e.k]=i))};i?(q.id=-1,ie(q,s)):q()}}}const at=e=>!!e.type.__asyncLoader,nr=e=>e.type.__isKeepAlive;function Ho(e,t){rr(e,"a",t)}function Po(e,t){rr(e,"da",t)}function rr(e,t,s=te){const n=e.__wdc||(e.__wdc=()=>{let r=s;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(zt(t,n,s),s){let r=s.parent;for(;r&&r.parent;)nr(r.parent.vnode)&&Mo(n,t,s,r),r=r.parent}}function Mo(e,t,s,n){const r=zt(t,e,n,!0);ir(()=>{Cs(n[t],r)},s)}function zt(e,t,s=te,n=!1){if(s){const r=s[e]||(s[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Re();const f=wt(s),u=we(t,s,e,i);return f(),Fe(),u});return n?r.unshift(o):r.push(o),o}}const Se=e=>(t,s=te)=>{(!Jt||e==="sp")&&zt(e,(...n)=>t(...n),s)},Ro=Se("bm"),or=Se("m"),Fo=Se("bu"),Do=Se("u"),Lo=Se("bum"),ir=Se("um"),No=Se("sp"),ko=Se("rtg"),jo=Se("rtc");function $o(e,t=te){zt("ec",e,t)}const Uo=Symbol.for("v-ndc"),gs=e=>e?Sr(e)?Vs(e):gs(e.parent):null,dt=X(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>gs(e.parent),$root:e=>gs(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>$s(e),$forceUpdate:e=>e.f||(e.f=()=>{ks(e.update)}),$nextTick:e=>e.n||(e.n=Yn.bind(e.proxy)),$watch:e=>fi.bind(e)}),ns=(e,t)=>e!==U&&!e.__isScriptSetup&&F(e,t),Bo={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:r,props:o,accessCache:i,type:f,appContext:u}=e;let h;if(t[0]!=="$"){const S=i[t];if(S!==void 0)switch(S){case 1:return n[t];case 2:return r[t];case 4:return s[t];case 3:return o[t]}else{if(ns(n,t))return i[t]=1,n[t];if(r!==U&&F(r,t))return i[t]=2,r[t];if((h=e.propsOptions[0])&&F(h,t))return i[t]=3,o[t];if(s!==U&&F(s,t))return i[t]=4,s[t];ms&&(i[t]=0)}}const a=dt[t];let p,y;if(a)return t==="$attrs"&&Y(e.attrs,"get",""),a(e);if((p=f.__cssModules)&&(p=p[t]))return p;if(s!==U&&F(s,t))return i[t]=4,s[t];if(y=u.config.globalProperties,F(y,t))return y[t]},set({_:e},t,s){const{data:n,setupState:r,ctx:o}=e;return ns(r,t)?(r[t]=s,!0):n!==U&&F(n,t)?(n[t]=s,!0):F(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:r,propsOptions:o}},i){let f;return!!s[i]||e!==U&&F(e,i)||ns(t,i)||(f=o[0])&&F(f,i)||F(n,i)||F(dt,i)||F(r.config.globalProperties,i)},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:F(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function on(e){return A(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let ms=!0;function Vo(e){const t=$s(e),s=e.proxy,n=e.ctx;ms=!1,t.beforeCreate&&ln(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:i,watch:f,provide:u,inject:h,created:a,beforeMount:p,mounted:y,beforeUpdate:S,updated:P,activated:R,deactivated:q,beforeDestroy:N,beforeUnmount:V,destroyed:K,unmounted:I,render:z,renderTracked:Ie,renderTriggered:de,errorCaptured:Te,serverPrefetch:xt,expose:De,inheritAttrs:et,components:Ct,directives:Et,filters:Xt}=t;if(h&&Ko(h,n,null),i)for(const B in i){const j=i[B];H(j)&&(n[B]=j.bind(s))}if(r){const B=r.call(s,s);W(B)&&(e.data=Rs(B))}if(ms=!0,o)for(const B in o){const j=o[B],Le=H(j)?j.bind(s,s):H(j.get)?j.get.bind(s,s):ye,Ot=!H(j)&&H(j.set)?j.set.bind(s):ye,Ne=Fi({get:Le,set:Ot});Object.defineProperty(n,B,{enumerable:!0,configurable:!0,get:()=>Ne.value,set:he=>Ne.value=he})}if(f)for(const B in f)lr(f[B],n,s,B);if(u){const B=H(u)?u.call(s):u;Reflect.ownKeys(B).forEach(j=>{Xo(j,B[j])})}a&&ln(a,e,"c");function Z(B,j){A(j)?j.forEach(Le=>B(Le.bind(s))):j&&B(j.bind(s))}if(Z(Ro,p),Z(or,y),Z(Fo,S),Z(Do,P),Z(Ho,R),Z(Po,q),Z($o,Te),Z(jo,Ie),Z(ko,de),Z(Lo,V),Z(ir,I),Z(No,xt),A(De))if(De.length){const B=e.exposed||(e.exposed={});De.forEach(j=>{Object.defineProperty(B,j,{get:()=>s[j],set:Le=>s[j]=Le})})}else e.exposed||(e.exposed={});z&&e.render===ye&&(e.render=z),et!=null&&(e.inheritAttrs=et),Ct&&(e.components=Ct),Et&&(e.directives=Et),xt&&sr(e)}function Ko(e,t,s=ye){A(e)&&(e=_s(e));for(const n in e){const r=e[n];let o;W(r)?"default"in r?o=Ft(r.from||n,r.default,!0):o=Ft(r.from||n):o=Ft(r),se(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[n]=o}}function ln(e,t,s){we(A(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function lr(e,t,s,n){let r=n.includes(".")?wr(s,n):()=>s[n];if(G(e)){const o=t[e];H(o)&&os(r,o)}else if(H(e))os(r,e.bind(s));else if(W(e))if(A(e))e.forEach(o=>lr(o,t,s,n));else{const o=H(e.handler)?e.handler.bind(s):t[e.handler];H(o)&&os(r,o,e)}}function $s(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,f=o.get(t);let u;return f?u=f:!r.length&&!s&&!n?u=t:(u={},r.length&&r.forEach(h=>jt(u,h,i,!0)),jt(u,t,i)),W(t)&&o.set(t,u),u}function jt(e,t,s,n=!1){const{mixins:r,extends:o}=t;o&&jt(e,o,s,!0),r&&r.forEach(i=>jt(e,i,s,!0));for(const i in t)if(!(n&&i==="expose")){const f=Wo[i]||s&&s[i];e[i]=f?f(e[i],t[i]):t[i]}return e}const Wo={data:cn,props:fn,emits:fn,methods:it,computed:it,beforeCreate:Q,created:Q,beforeMount:Q,mounted:Q,beforeUpdate:Q,updated:Q,beforeDestroy:Q,beforeUnmount:Q,destroyed:Q,unmounted:Q,activated:Q,deactivated:Q,errorCaptured:Q,serverPrefetch:Q,components:it,directives:it,watch:qo,provide:cn,inject:zo};function cn(e,t){return t?e?function(){return X(H(e)?e.call(this,this):e,H(t)?t.call(this,this):t)}:t:e}function zo(e,t){return it(_s(e),_s(t))}function _s(e){if(A(e)){const t={};for(let s=0;s1)return s&&H(t)?t.call(n&&n.proxy):t}}const fr={},ur=()=>Object.create(fr),ar=e=>Object.getPrototypeOf(e)===fr;function Yo(e,t,s,n=!1){const r={},o=ur();e.propsDefaults=Object.create(null),dr(e,t,r,o);for(const i in e.propsOptions[0])i in r||(r[i]=void 0);s?e.props=n?r:mo(r):e.type.props?e.props=r:e.props=o,e.attrs=o}function Zo(e,t,s,n){const{props:r,attrs:o,vnode:{patchFlag:i}}=e,f=L(r),[u]=e.propsOptions;let h=!1;if((n||i>0)&&!(i&16)){if(i&8){const a=e.vnode.dynamicProps;for(let p=0;p{u=!0;const[y,S]=hr(p,t,!0);X(i,y),S&&f.push(...S)};!s&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}if(!o&&!u)return W(e)&&n.set(e,Ge),Ge;if(A(o))for(let a=0;ae[0]==="_"||e==="$stable",Us=e=>A(e)?e.map(_e):[_e(e)],ei=(e,t,s)=>{if(t._n)return t;const n=Io((...r)=>Us(t(...r)),s);return n._c=!1,n},gr=(e,t,s)=>{const n=e._ctx;for(const r in e){if(pr(r))continue;const o=e[r];if(H(o))t[r]=ei(r,o,n);else if(o!=null){const i=Us(o);t[r]=()=>i}}},mr=(e,t)=>{const s=Us(t);e.slots.default=()=>s},_r=(e,t,s)=>{for(const n in t)(s||n!=="_")&&(e[n]=t[n])},ti=(e,t,s)=>{const n=e.slots=ur();if(e.vnode.shapeFlag&32){const r=t._;r?(_r(n,t,s),s&&Hn(n,"_",r,!0)):gr(t,n)}else t&&mr(e,t)},si=(e,t,s)=>{const{vnode:n,slots:r}=e;let o=!0,i=U;if(n.shapeFlag&32){const f=t._;f?s&&f===1?o=!1:_r(r,t,s):(o=!t.$stable,gr(t,r)),i=t}else t&&(mr(e,t),i={default:1});if(o)for(const f in r)!pr(f)&&i[f]==null&&delete r[f]},ie=mi;function ni(e){return ri(e)}function ri(e,t){const s=Pn();s.__VUE__=!0;const{insert:n,remove:r,patchProp:o,createElement:i,createText:f,createComment:u,setText:h,setElementText:a,parentNode:p,nextSibling:y,setScopeId:S=ye,insertStaticContent:P}=e,R=(l,c,d,_=null,g=null,m=null,x=void 0,w=null,v=!!c.dynamicChildren)=>{if(l===c)return;l&&!ot(l,c)&&(_=St(l),he(l,g,m,!0),l=null),c.patchFlag===-2&&(v=!1,c.dynamicChildren=null);const{type:b,ref:O,shapeFlag:C}=c;switch(b){case Gt:q(l,c,d,_);break;case bt:N(l,c,d,_);break;case ls:l==null&&V(c,d,_,x);break;case Ee:Ct(l,c,d,_,g,m,x,w,v);break;default:C&1?z(l,c,d,_,g,m,x,w,v):C&6?Et(l,c,d,_,g,m,x,w,v):(C&64||C&128)&&b.process(l,c,d,_,g,m,x,w,v,st)}O!=null&&g&&ps(O,l&&l.ref,m,c||l,!c)},q=(l,c,d,_)=>{if(l==null)n(c.el=f(c.children),d,_);else{const g=c.el=l.el;c.children!==l.children&&h(g,c.children)}},N=(l,c,d,_)=>{l==null?n(c.el=u(c.children||""),d,_):c.el=l.el},V=(l,c,d,_)=>{[l.el,l.anchor]=P(l.children,c,d,_,l.el,l.anchor)},K=({el:l,anchor:c},d,_)=>{let g;for(;l&&l!==c;)g=y(l),n(l,d,_),l=g;n(c,d,_)},I=({el:l,anchor:c})=>{let d;for(;l&&l!==c;)d=y(l),r(l),l=d;r(c)},z=(l,c,d,_,g,m,x,w,v)=>{c.type==="svg"?x="svg":c.type==="math"&&(x="mathml"),l==null?Ie(c,d,_,g,m,x,w,v):xt(l,c,g,m,x,w,v)},Ie=(l,c,d,_,g,m,x,w)=>{let v,b;const{props:O,shapeFlag:C,transition:E,dirs:T}=l;if(v=l.el=i(l.type,m,O&&O.is,O),C&8?a(v,l.children):C&16&&Te(l.children,v,null,_,g,rs(l,m),x,w),T&&ke(l,null,_,"created"),de(v,l,l.scopeId,x,_),O){for(const $ in O)$!=="value"&&!ct($)&&o(v,$,null,O[$],m,_);"value"in O&&o(v,"value",null,O.value,m),(b=O.onVnodeBeforeMount)&&ge(b,_,l)}T&&ke(l,null,_,"beforeMount");const M=oi(g,E);M&&E.beforeEnter(v),n(v,c,d),((b=O&&O.onVnodeMounted)||M||T)&&ie(()=>{b&&ge(b,_,l),M&&E.enter(v),T&&ke(l,null,_,"mounted")},g)},de=(l,c,d,_,g)=>{if(d&&S(l,d),_)for(let m=0;m<_.length;m++)S(l,_[m]);if(g){let m=g.subTree;if(c===m||Cr(m.type)&&(m.ssContent===c||m.ssFallback===c)){const x=g.vnode;de(l,x,x.scopeId,x.slotScopeIds,g.parent)}}},Te=(l,c,d,_,g,m,x,w,v=0)=>{for(let b=v;b{const w=c.el=l.el;let{patchFlag:v,dynamicChildren:b,dirs:O}=c;v|=l.patchFlag&16;const C=l.props||U,E=c.props||U;let T;if(d&&je(d,!1),(T=E.onVnodeBeforeUpdate)&&ge(T,d,c,l),O&&ke(c,l,d,"beforeUpdate"),d&&je(d,!0),(C.innerHTML&&E.innerHTML==null||C.textContent&&E.textContent==null)&&a(w,""),b?De(l.dynamicChildren,b,w,d,_,rs(c,g),m):x||j(l,c,w,null,d,_,rs(c,g),m,!1),v>0){if(v&16)et(w,C,E,d,g);else if(v&2&&C.class!==E.class&&o(w,"class",null,E.class,g),v&4&&o(w,"style",C.style,E.style,g),v&8){const M=c.dynamicProps;for(let $=0;${T&&ge(T,d,c,l),O&&ke(c,l,d,"updated")},_)},De=(l,c,d,_,g,m,x)=>{for(let w=0;w{if(c!==d){if(c!==U)for(const m in c)!ct(m)&&!(m in d)&&o(l,m,c[m],null,g,_);for(const m in d){if(ct(m))continue;const x=d[m],w=c[m];x!==w&&m!=="value"&&o(l,m,w,x,g,_)}"value"in d&&o(l,"value",c.value,d.value,g)}},Ct=(l,c,d,_,g,m,x,w,v)=>{const b=c.el=l?l.el:f(""),O=c.anchor=l?l.anchor:f("");let{patchFlag:C,dynamicChildren:E,slotScopeIds:T}=c;T&&(w=w?w.concat(T):T),l==null?(n(b,d,_),n(O,d,_),Te(c.children||[],d,O,g,m,x,w,v)):C>0&&C&64&&E&&l.dynamicChildren?(De(l.dynamicChildren,E,d,g,m,x,w),(c.key!=null||g&&c===g.subTree)&&br(l,c,!0)):j(l,c,d,O,g,m,x,w,v)},Et=(l,c,d,_,g,m,x,w,v)=>{c.slotScopeIds=w,l==null?c.shapeFlag&512?g.ctx.activate(c,d,_,x,v):Xt(c,d,_,g,m,x,v):Ks(l,c,v)},Xt=(l,c,d,_,g,m,x)=>{const w=l.component=Ti(l,_,g);if(nr(l)&&(w.ctx.renderer=st),Ai(w,!1,x),w.asyncDep){if(g&&g.registerDep(w,Z,x),!l.el){const v=w.subTree=Be(bt);N(null,v,c,d)}}else Z(w,l,c,d,g,m,x)},Ks=(l,c,d)=>{const _=c.component=l.component;if(pi(l,c,d))if(_.asyncDep&&!_.asyncResolved){B(_,c,d);return}else _.next=c,_.update();else c.el=l.el,_.vnode=c},Z=(l,c,d,_,g,m,x)=>{const w=()=>{if(l.isMounted){let{next:C,bu:E,u:T,parent:M,vnode:$}=l;{const re=yr(l);if(re){C&&(C.el=$.el,B(l,C,x)),re.asyncDep.then(()=>{l.isUnmounted||w()});return}}let D=C,ne;je(l,!1),C?(C.el=$.el,B(l,C,x)):C=$,E&&Qt(E),(ne=C.props&&C.props.onVnodeBeforeUpdate)&&ge(ne,M,C,$),je(l,!0);const J=is(l),ue=l.subTree;l.subTree=J,R(ue,J,p(ue.el),St(ue),l,g,m),C.el=J.el,D===null&&gi(l,J.el),T&&ie(T,g),(ne=C.props&&C.props.onVnodeUpdated)&&ie(()=>ge(ne,M,C,$),g)}else{let C;const{el:E,props:T}=c,{bm:M,m:$,parent:D,root:ne,type:J}=l,ue=at(c);if(je(l,!1),M&&Qt(M),!ue&&(C=T&&T.onVnodeBeforeMount)&&ge(C,D,c),je(l,!0),E&&Gs){const re=()=>{l.subTree=is(l),Gs(E,l.subTree,l,g,null)};ue&&J.__asyncHydrate?J.__asyncHydrate(E,l,re):re()}else{ne.ce&&ne.ce._injectChildStyle(J);const re=l.subTree=is(l);R(null,re,d,_,l,g,m),c.el=re.el}if($&&ie($,g),!ue&&(C=T&&T.onVnodeMounted)){const re=c;ie(()=>ge(C,D,re),g)}(c.shapeFlag&256||D&&at(D.vnode)&&D.vnode.shapeFlag&256)&&l.a&&ie(l.a,g),l.isMounted=!0,c=d=_=null}};l.scope.on();const v=l.effect=new Rn(w);l.scope.off();const b=l.update=v.run.bind(v),O=l.job=v.runIfDirty.bind(v);O.i=l,O.id=l.uid,v.scheduler=()=>ks(O),je(l,!0),b()},B=(l,c,d)=>{c.component=l;const _=l.vnode.props;l.vnode=c,l.next=null,Zo(l,c.props,_,d),si(l,c.children,d),Re(),rn(l),Fe()},j=(l,c,d,_,g,m,x,w,v=!1)=>{const b=l&&l.children,O=l?l.shapeFlag:0,C=c.children,{patchFlag:E,shapeFlag:T}=c;if(E>0){if(E&128){Ot(b,C,d,_,g,m,x,w,v);return}else if(E&256){Le(b,C,d,_,g,m,x,w,v);return}}T&8?(O&16&&tt(b,g,m),C!==b&&a(d,C)):O&16?T&16?Ot(b,C,d,_,g,m,x,w,v):tt(b,g,m,!0):(O&8&&a(d,""),T&16&&Te(C,d,_,g,m,x,w,v))},Le=(l,c,d,_,g,m,x,w,v)=>{l=l||Ge,c=c||Ge;const b=l.length,O=c.length,C=Math.min(b,O);let E;for(E=0;EO?tt(l,g,m,!0,!1,C):Te(c,d,_,g,m,x,w,v,C)},Ot=(l,c,d,_,g,m,x,w,v)=>{let b=0;const O=c.length;let C=l.length-1,E=O-1;for(;b<=C&&b<=E;){const T=l[b],M=c[b]=v?Pe(c[b]):_e(c[b]);if(ot(T,M))R(T,M,d,null,g,m,x,w,v);else break;b++}for(;b<=C&&b<=E;){const T=l[C],M=c[E]=v?Pe(c[E]):_e(c[E]);if(ot(T,M))R(T,M,d,null,g,m,x,w,v);else break;C--,E--}if(b>C){if(b<=E){const T=E+1,M=TE)for(;b<=C;)he(l[b],g,m,!0),b++;else{const T=b,M=b,$=new Map;for(b=M;b<=E;b++){const oe=c[b]=v?Pe(c[b]):_e(c[b]);oe.key!=null&&$.set(oe.key,b)}let D,ne=0;const J=E-M+1;let ue=!1,re=0;const nt=new Array(J);for(b=0;b=J){he(oe,g,m,!0);continue}let pe;if(oe.key!=null)pe=$.get(oe.key);else for(D=M;D<=E;D++)if(nt[D-M]===0&&ot(oe,c[D])){pe=D;break}pe===void 0?he(oe,g,m,!0):(nt[pe-M]=b+1,pe>=re?re=pe:ue=!0,R(oe,c[pe],d,null,g,m,x,w,v),ne++)}const Js=ue?ii(nt):Ge;for(D=Js.length-1,b=J-1;b>=0;b--){const oe=M+b,pe=c[oe],Xs=oe+1{const{el:m,type:x,transition:w,children:v,shapeFlag:b}=l;if(b&6){Ne(l.component.subTree,c,d,_);return}if(b&128){l.suspense.move(c,d,_);return}if(b&64){x.move(l,c,d,st);return}if(x===Ee){n(m,c,d);for(let C=0;Cw.enter(m),g);else{const{leave:C,delayLeave:E,afterLeave:T}=w,M=()=>n(m,c,d),$=()=>{C(m,()=>{M(),T&&T()})};E?E(m,M,$):$()}else n(m,c,d)},he=(l,c,d,_=!1,g=!1)=>{const{type:m,props:x,ref:w,children:v,dynamicChildren:b,shapeFlag:O,patchFlag:C,dirs:E,cacheIndex:T}=l;if(C===-2&&(g=!1),w!=null&&ps(w,null,d,l,!0),T!=null&&(c.renderCache[T]=void 0),O&256){c.ctx.deactivate(l);return}const M=O&1&&E,$=!at(l);let D;if($&&(D=x&&x.onVnodeBeforeUnmount)&&ge(D,c,l),O&6)Hr(l.component,d,_);else{if(O&128){l.suspense.unmount(d,_);return}M&&ke(l,null,c,"beforeUnmount"),O&64?l.type.remove(l,c,d,st,_):b&&!b.hasOnce&&(m!==Ee||C>0&&C&64)?tt(b,c,d,!1,!0):(m===Ee&&C&384||!g&&O&16)&&tt(v,c,d),_&&Ws(l)}($&&(D=x&&x.onVnodeUnmounted)||M)&&ie(()=>{D&&ge(D,c,l),M&&ke(l,null,c,"unmounted")},d)},Ws=l=>{const{type:c,el:d,anchor:_,transition:g}=l;if(c===Ee){Ar(d,_);return}if(c===ls){I(l);return}const m=()=>{r(d),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(l.shapeFlag&1&&g&&!g.persisted){const{leave:x,delayLeave:w}=g,v=()=>x(d,m);w?w(l.el,m,v):v()}else m()},Ar=(l,c)=>{let d;for(;l!==c;)d=y(l),r(l),l=d;r(c)},Hr=(l,c,d)=>{const{bum:_,scope:g,job:m,subTree:x,um:w,m:v,a:b}=l;an(v),an(b),_&&Qt(_),g.stop(),m&&(m.flags|=8,he(x,l,c,d)),w&&ie(w,c),ie(()=>{l.isUnmounted=!0},c),c&&c.pendingBranch&&!c.isUnmounted&&l.asyncDep&&!l.asyncResolved&&l.suspenseId===c.pendingId&&(c.deps--,c.deps===0&&c.resolve())},tt=(l,c,d,_=!1,g=!1,m=0)=>{for(let x=m;x{if(l.shapeFlag&6)return St(l.component.subTree);if(l.shapeFlag&128)return l.suspense.next();const c=y(l.anchor||l.el),d=c&&c[To];return d?y(d):c};let Yt=!1;const zs=(l,c,d)=>{l==null?c._vnode&&he(c._vnode,null,null,!0):R(c._vnode||null,l,c,null,null,null,d),c._vnode=l,Yt||(Yt=!0,rn(),Qn(),Yt=!1)},st={p:R,um:he,m:Ne,r:Ws,mt:Xt,mc:Te,pc:j,pbc:De,n:St,o:e};let qs,Gs;return{render:zs,hydrate:qs,createApp:Jo(zs,qs)}}function rs({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function je({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function oi(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function br(e,t,s=!1){const n=e.children,r=t.children;if(A(n)&&A(r))for(let o=0;o>1,e[s[f]]0&&(t[n]=s[o-1]),s[o]=n)}}for(o=s.length,i=s[o-1];o-- >0;)s[o]=i,i=t[i];return s}function yr(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:yr(t)}function an(e){if(e)for(let t=0;tFt(li);function os(e,t,s){return vr(e,t,s)}function vr(e,t,s=U){const{immediate:n,deep:r,flush:o,once:i}=s,f=X({},s);let u;if(Jt)if(o==="sync"){const y=ci();u=y.__watcherHandles||(y.__watcherHandles=[])}else if(!t||n)f.once=!0;else{const y=()=>{};return y.stop=ye,y.resume=ye,y.pause=ye,y}const h=te;f.call=(y,S,P)=>we(y,h,S,P);let a=!1;o==="post"?f.scheduler=y=>{ie(y,h&&h.suspense)}:o!=="sync"&&(a=!0,f.scheduler=(y,S)=>{S?y():ks(y)}),f.augmentJob=y=>{t&&(y.flags|=4),a&&(y.flags|=2,h&&(y.id=h.uid,y.i=h))};const p=Co(e,t,f);return u&&u.push(p),p}function fi(e,t,s){const n=this.proxy,r=G(e)?e.includes(".")?wr(n,e):()=>n[e]:e.bind(n,n);let o;H(t)?o=t:(o=t.handler,s=t);const i=wt(this),f=vr(r,o.bind(n),s);return i(),f}function wr(e,t){const s=t.split(".");return()=>{let n=e;for(let r=0;rt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ve(t)}Modifiers`]||e[`${We(t)}Modifiers`];function ai(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||U;let r=s;const o=t.startsWith("update:"),i=o&&ui(n,t.slice(7));i&&(i.trim&&(r=s.map(a=>G(a)?a.trim():a)),i.number&&(r=s.map(jr)));let f,u=n[f=Zt(t)]||n[f=Zt(Ve(t))];!u&&o&&(u=n[f=Zt(We(t))]),u&&we(u,e,6,r);const h=n[f+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[f])return;e.emitted[f]=!0,we(h,e,6,r)}}function xr(e,t,s=!1){const n=t.emitsCache,r=n.get(e);if(r!==void 0)return r;const o=e.emits;let i={},f=!1;if(!H(e)){const u=h=>{const a=xr(h,t,!0);a&&(f=!0,X(i,a))};!s&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!o&&!f?(W(e)&&n.set(e,null),null):(A(o)?o.forEach(u=>i[u]=null):X(i,o),W(e)&&n.set(e,i),i)}function qt(e,t){return!e||!Ut(t)?!1:(t=t.slice(2).replace(/Once$/,""),F(e,t[0].toLowerCase()+t.slice(1))||F(e,We(t))||F(e,t))}function is(e){const{type:t,vnode:s,proxy:n,withProxy:r,propsOptions:[o],slots:i,attrs:f,emit:u,render:h,renderCache:a,props:p,data:y,setupState:S,ctx:P,inheritAttrs:R}=e,q=kt(e);let N,V;try{if(s.shapeFlag&4){const I=r||n,z=I;N=_e(h.call(z,I,a,p,S,y,P)),V=f}else{const I=t;N=_e(I.length>1?I(p,{attrs:f,slots:i,emit:u}):I(p,null)),V=t.props?f:di(f)}}catch(I){ht.length=0,Wt(I,e,1),N=Be(bt)}let K=N;if(V&&R!==!1){const I=Object.keys(V),{shapeFlag:z}=K;I.length&&z&7&&(o&&I.some(xs)&&(V=hi(V,o)),K=Ze(K,V,!1,!0))}return s.dirs&&(K=Ze(K,null,!1,!0),K.dirs=K.dirs?K.dirs.concat(s.dirs):s.dirs),s.transition&&js(K,s.transition),N=K,kt(q),N}const di=e=>{let t;for(const s in e)(s==="class"||s==="style"||Ut(s))&&((t||(t={}))[s]=e[s]);return t},hi=(e,t)=>{const s={};for(const n in e)(!xs(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function pi(e,t,s){const{props:n,children:r,component:o}=e,{props:i,children:f,patchFlag:u}=t,h=o.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&u>=0){if(u&1024)return!0;if(u&16)return n?dn(n,i,h):!!i;if(u&8){const a=t.dynamicProps;for(let p=0;pe.__isSuspense;function mi(e,t){t&&t.pendingBranch?A(e)?t.effects.push(...e):t.effects.push(e):So(e)}const Ee=Symbol.for("v-fgt"),Gt=Symbol.for("v-txt"),bt=Symbol.for("v-cmt"),ls=Symbol.for("v-stc"),ht=[];let fe=null;function _i(e=!1){ht.push(fe=e?null:[])}function bi(){ht.pop(),fe=ht[ht.length-1]||null}let yt=1;function hn(e){yt+=e,e<0&&fe&&(fe.hasOnce=!0)}function yi(e){return e.dynamicChildren=yt>0?fe||Ge:null,bi(),yt>0&&fe&&fe.push(e),e}function vi(e,t,s,n,r,o){return yi(Or(e,t,s,n,r,o,!0))}function wi(e){return e?e.__v_isVNode===!0:!1}function ot(e,t){return e.type===t.type&&e.key===t.key}const Er=({key:e})=>e??null,Dt=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?G(e)||se(e)||H(e)?{i:be,r:e,k:t,f:!!s}:e:null);function Or(e,t=null,s=null,n=0,r=null,o=e===Ee?0:1,i=!1,f=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Er(t),ref:t&&Dt(t),scopeId:tr,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:be};return f?(Bs(u,s),o&128&&e.normalize(u)):s&&(u.shapeFlag|=G(s)?8:16),yt>0&&!i&&fe&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&fe.push(u),u}const Be=xi;function xi(e,t=null,s=null,n=0,r=null,o=!1){if((!e||e===Uo)&&(e=bt),wi(e)){const f=Ze(e,t,!0);return s&&Bs(f,s),yt>0&&!o&&fe&&(f.shapeFlag&6?fe[fe.indexOf(e)]=f:fe.push(f)),f.patchFlag=-2,f}if(Ri(e)&&(e=e.__vccOpts),t){t=Ci(t);let{class:f,style:u}=t;f&&!G(f)&&(t.class=Ss(f)),W(u)&&(Ds(u)&&!A(u)&&(u=X({},u)),t.style=Os(u))}const i=G(e)?1:Cr(e)?128:Ao(e)?64:W(e)?4:H(e)?2:0;return Or(e,t,s,n,r,i,o,!0)}function Ci(e){return e?Ds(e)||ar(e)?X({},e):e:null}function Ze(e,t,s=!1,n=!1){const{props:r,ref:o,patchFlag:i,children:f,transition:u}=e,h=t?Oi(r||{},t):r,a={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&Er(h),ref:t&&t.ref?s&&o?A(o)?o.concat(Dt(t)):[o,Dt(t)]:Dt(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:f,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ee?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ze(e.ssContent),ssFallback:e.ssFallback&&Ze(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&n&&js(a,u.clone(a)),a}function Ei(e=" ",t=0){return Be(Gt,null,e,t)}function _e(e){return e==null||typeof e=="boolean"?Be(bt):A(e)?Be(Ee,null,e.slice()):typeof e=="object"?Pe(e):Be(Gt,null,String(e))}function Pe(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ze(e)}function Bs(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(A(t))s=16;else if(typeof t=="object")if(n&65){const r=t.default;r&&(r._c&&(r._d=!1),Bs(e,r()),r._c&&(r._d=!0));return}else{s=32;const r=t._;!r&&!ar(t)?t._ctx=be:r===3&&be&&(be.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else H(t)?(t={default:t,_ctx:be},s=32):(t=String(t),n&64?(s=16,t=[Ei(t)]):s=8);e.children=t,e.shapeFlag|=s}function Oi(...e){const t={};for(let s=0;s{let r;return(r=e[s])||(r=e[s]=[]),r.push(n),o=>{r.length>1?r.forEach(i=>i(o)):r[0](o)}};$t=t("__VUE_INSTANCE_SETTERS__",s=>te=s),ys=t("__VUE_SSR_SETTERS__",s=>Jt=s)}const wt=e=>{const t=te;return $t(e),e.scope.on(),()=>{e.scope.off(),$t(t)}},pn=()=>{te&&te.scope.off(),$t(null)};function Sr(e){return e.vnode.shapeFlag&4}let Jt=!1;function Ai(e,t=!1,s=!1){t&&ys(t);const{props:n,children:r}=e.vnode,o=Sr(e);Yo(e,n,o,t),ti(e,r,s);const i=o?Hi(e,t):void 0;return t&&ys(!1),i}function Hi(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Bo);const{setup:n}=s;if(n){const r=e.setupContext=n.length>1?Mi(e):null,o=wt(e);Re();const i=vt(n,e,0,[e.props,r]);if(Fe(),o(),Tn(i)){if(at(e)||sr(e),i.then(pn,pn),t)return i.then(f=>{gn(e,f,t)}).catch(f=>{Wt(f,e,0)});e.asyncDep=i}else gn(e,i,t)}else Ir(e,t)}function gn(e,t,s){H(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:W(t)&&(e.setupState=Jn(t)),Ir(e,s)}let mn;function Ir(e,t,s){const n=e.type;if(!e.render){if(!t&&mn&&!n.render){const r=n.template||$s(e).template;if(r){const{isCustomElement:o,compilerOptions:i}=e.appContext.config,{delimiters:f,compilerOptions:u}=n,h=X(X({isCustomElement:o,delimiters:f},i),u);n.render=mn(r,h)}}e.render=n.render||ye}{const r=wt(e);Re();try{Vo(e)}finally{Fe(),r()}}}const Pi={get(e,t){return Y(e,"get",""),e[t]}};function Mi(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,Pi),slots:e.slots,emit:e.emit,expose:t}}function Vs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Jn(_o(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in dt)return dt[s](e)},has(t,s){return s in t||s in dt}})):e.proxy}function Ri(e){return H(e)&&"__vccOpts"in e}const Fi=(e,t)=>wo(e,t,Jt),Di="3.5.6";/** +* @vue/runtime-dom v3.5.6 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let vs;const _n=typeof window<"u"&&window.trustedTypes;if(_n)try{vs=_n.createPolicy("vue",{createHTML:e=>e})}catch{}const Tr=vs?e=>vs.createHTML(e):e=>e,Li="http://www.w3.org/2000/svg",Ni="http://www.w3.org/1998/Math/MathML",Ce=typeof document<"u"?document:null,bn=Ce&&Ce.createElement("template"),ki={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const r=t==="svg"?Ce.createElementNS(Li,e):t==="mathml"?Ce.createElementNS(Ni,e):s?Ce.createElement(e,{is:s}):Ce.createElement(e);return e==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:e=>Ce.createTextNode(e),createComment:e=>Ce.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ce.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,r,o){const i=s?s.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===o||!(r=r.nextSibling)););else{bn.innerHTML=Tr(n==="svg"?`${e}`:n==="mathml"?`${e}`:e);const f=bn.content;if(n==="svg"||n==="mathml"){const u=f.firstChild;for(;u.firstChild;)f.appendChild(u.firstChild);f.removeChild(u)}t.insertBefore(f,s)}return[i?i.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},ji=Symbol("_vtc");function $i(e,t,s){const n=e[ji];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const yn=Symbol("_vod"),Ui=Symbol("_vsh"),Bi=Symbol(""),Vi=/(^|;)\s*display\s*:/;function Ki(e,t,s){const n=e.style,r=G(s);let o=!1;if(s&&!r){if(t)if(G(t))for(const i of t.split(";")){const f=i.slice(0,i.indexOf(":")).trim();s[f]==null&&Lt(n,f,"")}else for(const i in t)s[i]==null&&Lt(n,i,"");for(const i in s)i==="display"&&(o=!0),Lt(n,i,s[i])}else if(r){if(t!==s){const i=n[Bi];i&&(s+=";"+i),n.cssText=s,o=Vi.test(s)}}else t&&e.removeAttribute("style");yn in e&&(e[yn]=o?n.display:"",e[Ui]&&(n.display="none"))}const vn=/\s*!important$/;function Lt(e,t,s){if(A(s))s.forEach(n=>Lt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Wi(e,t);vn.test(s)?e.setProperty(We(n),s.replace(vn,""),"important"):e[n]=s}}const wn=["Webkit","Moz","ms"],cs={};function Wi(e,t){const s=cs[t];if(s)return s;let n=Ve(t);if(n!=="filter"&&n in e)return cs[t]=n;n=An(n);for(let r=0;rfs||(Yi.then(()=>fs=0),fs=Date.now());function Qi(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;we(el(n,s.value),t,5,[n])};return s.value=e,s.attached=Zi(),s}function el(e,t){if(A(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>r=>!r._stopped&&n&&n(r))}else return t}const Sn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,tl=(e,t,s,n,r,o)=>{const i=r==="svg";t==="class"?$i(e,n,i):t==="style"?Ki(e,s,n):Ut(t)?xs(t)||Ji(e,t,s,n,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):sl(e,t,n,i))?(zi(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Cn(e,t,n,i,o,t!=="value")):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Cn(e,t,n,i))};function sl(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Sn(t)&&H(s));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Sn(t)&&G(s)?!1:!!(t in e||e._isVueCE&&(/[A-Z]/.test(t)||!G(s)))}const nl=X({patchProp:tl},ki);let In;function rl(){return In||(In=ni(nl))}const ol=(...e)=>{const t=rl().createApp(...e),{mount:s}=t;return t.mount=n=>{const r=ll(n);if(!r)return;const o=t._component;!H(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const i=s(r,!1,il(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t};function il(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ll(e){return G(e)?document.querySelector(e):e}const cl={id:"blocklyDiv",style:{height:"100vh",width:"100vw"}},Rt='