x-block-lib 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="x-block-lib",o.appendChild(document.createTextNode(".blocklyToolboxDiv{overflow-x:hidden;width:56px}.blocklyMainBackground{stroke-width:0}.blocklyToolboxCategory{margin-bottom:10px}.blocklyTreeRow{height:28px;display:flex;align-items:center;border-left-width:6px!important;border-right-width:6px!important}.blocklyTreeIcon{display:none!important}.blocklyFlyout{z-index:21}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- var xe = Object.defineProperty;
3
- var Ye = (e, o, t) => o in e ? xe(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
4
- var L = (e, o, t) => Ye(e, typeof o != "symbol" ? o + "" : o, t);
5
- import { defineComponent as z, resolveComponent as C, openBlock as I, createBlock as S, unref as Y, useModel as le, computed as $, ref as j, onMounted as Le, onUnmounted as Ke, withCtx as U, createVNode as R, mergeProps as Fe, createElementVNode as ae, normalizeStyle as X, createElementBlock as x, Fragment as He, renderList as we, createTextVNode as Ge, toDisplayString as $e, mergeModels as Ee, onBeforeUnmount as je, watch as V, resolveDirective as Xe, withDirectives as We, createCommentVNode as te } from "vue";
6
- import { d as _, j as s, O as l, u, X as Je, B as O, E, M as h, i as Q, a as b, b as d, C as ye, F as Te, c as ze, P as re, N as de, V as W, e as Qe, f as Ce, s as qe, g as M, S as m, h as oe, k as B, l as K, m as ne, n as P, o as N, p as he, G as ie, q as Ze, r as et, t as se, U as F, D as H, v as k, w as tt, T as q, x as Ae, y as ot, z as nt } from "./blockly-jgwpd4oo.js";
7
- import { storeToRefs as it } from "pinia";
8
- import { openConfirmDlg as st, openPromptDlg as lt, eventBus as ce, useGlobalStore as at, useViewStack as rt } from "x-essential-lib";
9
- var ct = "M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z", _t = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", ut = "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z", pt = "M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z", Tt = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
2
+ var $e = Object.defineProperty;
3
+ var je = (e, o, t) => o in e ? $e(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
4
+ var L = (e, o, t) => je(e, typeof o != "symbol" ? o + "" : o, t);
5
+ import { defineComponent as q, resolveComponent as v, openBlock as I, createBlock as U, unref as F, useModel as re, computed as X, ref as W, onMounted as Ne, onUnmounted as Xe, withCtx as P, createVNode as M, mergeProps as We, createElementVNode as ce, normalizeStyle as J, createElementBlock as K, Fragment as Je, renderList as ze, createTextVNode as Qe, toDisplayString as qe, mergeModels as ye, onBeforeUnmount as Ze, watch as D, resolveDirective as et, withDirectives as tt, createCommentVNode as ne } from "vue";
6
+ import { d as _, j as s, O as l, u, X as ot, B as O, E, M as h, i as Z, a as N, b as f, C as Be, F as Te, c as nt, P as _e, N as de, V as z, e as it, f as Re, s as st, g as V, S as m, h as ie, k as S, l as H, m as se, n as x, o as B, p as Ce, G as le, q as lt, r as at, t as ae, U as w, D as G, v as R, w as rt, T as ee, x as Se, y as ct, z as _t } from "./blockly-jgwpd4oo.js";
7
+ import { storeToRefs as ut } from "pinia";
8
+ import { openConfirmDlg as pt, openPromptDlg as Tt, eventBus as ue, useGlobalStore as dt, useViewStack as ft } from "x-essential-lib";
9
+ var Et = "M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z", ht = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", mt = "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z", Ot = "M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z", It = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
10
10
  _([
11
11
  {
12
12
  type: "color_blend_v1",
@@ -149,7 +149,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
149
149
  `
150
150
  )}(${o}, ${t}, ${n})`, l.FUNCTION_CALL];
151
151
  };
152
- const dt = function() {
152
+ const gt = function() {
153
153
  if (!window.blocklyState) {
154
154
  const e = {
155
155
  runtime: {
@@ -179,7 +179,7 @@ const dt = function() {
179
179
  }
180
180
  return window.blocklyState;
181
181
  }();
182
- function w(e) {
182
+ function $(e) {
183
183
  let o = "";
184
184
  if (e.type === "string") {
185
185
  let t = "";
@@ -194,11 +194,11 @@ function w(e) {
194
194
  console.assert(!1, "invalid param type", e.type);
195
195
  return u.xml.textToDom(o);
196
196
  }
197
- function ve(e, o, t) {
198
- const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = Je.domToWorkspace(i, e);
197
+ function Me(e, o, t) {
198
+ const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = ot.domToWorkspace(i, e);
199
199
  return e.getBlockById(a[0]);
200
200
  }
201
- const ft = u.xml, Et = [
201
+ const Lt = u.xml, yt = [
202
202
  {
203
203
  type: "call_func_v1",
204
204
  prefixInputs: ["OUTPUT"]
@@ -228,17 +228,17 @@ const ft = u.xml, Et = [
228
228
  prefixInputs: ["ARG"]
229
229
  }
230
230
  ];
231
- function ht(e, o) {
231
+ function Ct(e, o) {
232
232
  var n, i;
233
- const t = Et.find((a) => a.type === e);
233
+ const t = yt.find((a) => a.type === e);
234
234
  return t ? !!((n = t.prefixInputs) != null && n.some((a) => o.startsWith(a)) || (i = t.inputs) != null && i.some((a) => a === o)) : !1;
235
235
  }
236
- const mt = {
236
+ const At = {
237
237
  init: function() {
238
238
  this.key = "", this.name = "", this.appendDummyInput().appendField("", "LABEL"), this.setOutput(!0), this.setColour(220);
239
239
  },
240
240
  mutationToDom: function() {
241
- const e = ft.createElement("mutation");
241
+ const e = Lt.createElement("mutation");
242
242
  return e.setAttribute("key", this.key), e.setAttribute("name", this.name), e;
243
243
  },
244
244
  domToMutation: function(e) {
@@ -267,12 +267,12 @@ const mt = {
267
267
  tryDuplicate_: function(e) {
268
268
  var t;
269
269
  const o = this.workspace.getBlockById(e.oldParentId);
270
- if (o && ht(o.type, e.oldInputName))
270
+ if (o && Ct(o.type, e.oldInputName))
271
271
  try {
272
272
  E.disable();
273
273
  const n = (t = o.getInput(e.oldInputName)) == null ? void 0 : t.connection;
274
274
  if (n) {
275
- const i = ve(this.workspace, this.key, this.name);
275
+ const i = Me(this.workspace, this.key, this.name);
276
276
  n.connect(i.outputConnection);
277
277
  }
278
278
  } finally {
@@ -283,33 +283,33 @@ const mt = {
283
283
  this.name ? this.setFieldValue(h[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
284
284
  }
285
285
  };
286
- O.parameter_v1 = mt;
286
+ O.parameter_v1 = At;
287
287
  s.forBlock.parameter_v1 = function(e) {
288
288
  return [e.key, l.ATOMIC];
289
289
  };
290
- const Ot = u.xml, It = {
290
+ const vt = u.xml, bt = {
291
291
  init: function() {
292
292
  this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_CONTAINER_TITLE}"), this.appendStatementInput("STACK"), this.setStyle("list_blocks"), this.contextMenu = !1;
293
293
  }
294
294
  };
295
- O.list_create_container_v1 = It;
296
- const gt = {
295
+ O.list_create_container_v1 = bt;
296
+ const kt = {
297
297
  init: function() {
298
298
  this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("list_blocks"), this.contextMenu = !1;
299
299
  }
300
300
  };
301
- O.list_create_item_v1 = gt;
302
- const Lt = {
301
+ O.list_create_item_v1 = kt;
302
+ const Nt = {
303
303
  init: function() {
304
304
  this.itemCount_ = 0, this.setMutator(
305
- new Q.MutatorIcon(
305
+ new Z.MutatorIcon(
306
306
  ["list_create_item_v1"],
307
307
  this
308
308
  )
309
309
  ), this.setOutput(!0, "Array"), this.setStyle("list_blocks"), this.setTooltip("%{BKY_LIST_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_LIST_V1_CREATE_HELPURL}");
310
310
  },
311
311
  mutationToDom: function() {
312
- const e = Ot.createElement("mutation");
312
+ const e = vt.createElement("mutation");
313
313
  return e.setAttribute("items", String(this.itemCount_)), e;
314
314
  },
315
315
  domToMutation: function(e) {
@@ -377,13 +377,13 @@ const Lt = {
377
377
  for (let e = 0; e < this.itemCount_; e++)
378
378
  if (!this.getInput("ADD" + e)) {
379
379
  const o = this.appendValueInput("ADD" + e);
380
- e === 0 && (o.setAlign(b.Align.RIGHT), o.appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
380
+ e === 0 && (o.setAlign(N.Align.RIGHT), o.appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
381
381
  }
382
382
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
383
383
  this.removeInput("ADD" + e);
384
384
  }
385
385
  };
386
- O.list_create_v1 = Lt;
386
+ O.list_create_v1 = Nt;
387
387
  s.forBlock.list_create_v1 = function(e) {
388
388
  const o = e, t = new Array(o.itemCount_);
389
389
  for (let i = 0; i < o.itemCount_; i++)
@@ -599,7 +599,7 @@ s.forBlock.list_set_v1 = function(e) {
599
599
  return `${o}[${t}] = ${n};
600
600
  `;
601
601
  };
602
- const yt = {
602
+ const Bt = {
603
603
  // logic_compare
604
604
  EQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_EQ}",
605
605
  NEQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_NEQ}",
@@ -611,9 +611,9 @@ const yt = {
611
611
  AND: "%{BKY_LOGIC_V1_OPERATION_TOOLTIP_AND}",
612
612
  OR: "%{BKY_LOGIC_V1_OPERATION_TOOLTIP_OR}"
613
613
  };
614
- d.register(
614
+ f.register(
615
615
  "logic_op_tooltip_v1",
616
- d.buildTooltipForDropdown("OP", yt)
616
+ f.buildTooltipForDropdown("OP", Bt)
617
617
  );
618
618
  _([
619
619
  {
@@ -638,7 +638,7 @@ _([
638
638
  s.forBlock.logic_boolean_v1 = function(e) {
639
639
  return [e.getFieldValue("BOOL") === "TRUE" ? "true" : "false", l.ATOMIC];
640
640
  };
641
- const Ct = {
641
+ const Rt = {
642
642
  onchange: function(e) {
643
643
  this.prevBlocks_ || (this.prevBlocks_ = [null, null]);
644
644
  const o = this.getInputTargetBlock("A"), t = this.getInputTargetBlock("B");
@@ -655,10 +655,10 @@ const Ct = {
655
655
  this.prevBlocks_[0] = this.getInputTargetBlock("A"), this.prevBlocks_[1] = this.getInputTargetBlock("B");
656
656
  }
657
657
  };
658
- d.register(
658
+ f.register(
659
659
  "logic_compare_v1",
660
660
  function() {
661
- this.mixin(Ct);
661
+ this.mixin(Rt);
662
662
  }
663
663
  );
664
664
  _([
@@ -708,7 +708,7 @@ s.forBlock.logic_compare_v1 = function(e) {
708
708
  const i = s.valueToCode(e, "A", n) || "0", a = s.valueToCode(e, "B", n) || "0";
709
709
  return [`${i} ${t} ${a}`, n];
710
710
  };
711
- const At = {
711
+ const St = {
712
712
  elseIfCount_: 0,
713
713
  hasElse_: !1,
714
714
  mutationToDom: function() {
@@ -834,9 +834,9 @@ const At = {
834
834
  t == null || t.reconnect(this, "ELSE");
835
835
  }
836
836
  };
837
- d.registerMutator(
837
+ f.registerMutator(
838
838
  "logic_if_v1_mutator",
839
- At,
839
+ St,
840
840
  void 0,
841
841
  ["logic_if_else_if_v1", "logic_if_else_v1"]
842
842
  );
@@ -982,7 +982,7 @@ s.forBlock.logic_operation_v1 = function(e) {
982
982
  }
983
983
  return [`${n} ${o} ${i}`, t];
984
984
  };
985
- const vt = {
985
+ const Mt = {
986
986
  prevParentConnection_: null,
987
987
  onchange: function(e) {
988
988
  const o = this.getInputTargetBlock("THEN"), t = this.getInputTargetBlock("ELSE"), n = this.outputConnection.targetConnection;
@@ -997,7 +997,7 @@ const vt = {
997
997
  this.prevParentConnection_ = n;
998
998
  }
999
999
  };
1000
- d.registerMixin("logic_ternary_v1", vt);
1000
+ f.registerMixin("logic_ternary_v1", Mt);
1001
1001
  _([
1002
1002
  {
1003
1003
  type: "logic_ternary_v1",
@@ -1034,7 +1034,7 @@ s.forBlock.logic_ternary_v1 = function(e) {
1034
1034
  const o = s.valueToCode(e, "IF", l.CONDITIONAL) || "false", t = s.valueToCode(e, "THEN", l.CONDITIONAL) || "null", n = s.valueToCode(e, "ELSE", l.CONDITIONAL) || "null";
1035
1035
  return [o + " ? " + t + " : " + n, l.CONDITIONAL];
1036
1036
  };
1037
- const bt = {
1037
+ const Ut = {
1038
1038
  customContextMenu: function(e) {
1039
1039
  if (this.isInFlyout)
1040
1040
  return;
@@ -1049,32 +1049,32 @@ const bt = {
1049
1049
  e.push({
1050
1050
  enabled: !0,
1051
1051
  text: h.VARIABLES_SET_CREATE_GET.replace("%1", n),
1052
- callback: ye.callbackFactory(this, i)
1052
+ callback: Be.callbackFactory(this, i)
1053
1053
  });
1054
1054
  }
1055
1055
  }
1056
1056
  };
1057
- d.registerMixin(
1057
+ f.registerMixin(
1058
1058
  "contextMenu_newGetVariableBlock_v1",
1059
- bt
1059
+ Ut
1060
1060
  );
1061
- d.register(
1061
+ f.register(
1062
1062
  "flow_control_tooltip_v1",
1063
- d.buildTooltipForDropdown("MODE", {
1063
+ f.buildTooltipForDropdown("MODE", {
1064
1064
  BREAK: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_BREAK}",
1065
1065
  CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
1066
1066
  })
1067
1067
  );
1068
- const Nt = /* @__PURE__ */ new Set([
1068
+ const Vt = /* @__PURE__ */ new Set([
1069
1069
  "repeat_v1",
1070
1070
  "for_each_v1",
1071
1071
  "for_v1",
1072
1072
  "while_until_v1"
1073
- ]), kt = {
1073
+ ]), Pt = {
1074
1074
  getSurroundLoop: function() {
1075
1075
  let e = this;
1076
1076
  do {
1077
- if (Nt.has(e.type))
1077
+ if (Vt.has(e.type))
1078
1078
  return !0;
1079
1079
  e = e == null ? void 0 : e.getSurroundParent();
1080
1080
  } while (e);
@@ -1095,9 +1095,9 @@ const Nt = /* @__PURE__ */ new Set([
1095
1095
  }
1096
1096
  }
1097
1097
  };
1098
- d.registerMixin(
1098
+ f.registerMixin(
1099
1099
  "flow_control_in_loop_check_v1",
1100
- kt
1100
+ Pt
1101
1101
  );
1102
1102
  _([
1103
1103
  {
@@ -1120,9 +1120,9 @@ _([
1120
1120
  extensions: ["flow_control_tooltip_v1", "flow_control_in_loop_check_v1"]
1121
1121
  }
1122
1122
  ]);
1123
- d.register(
1123
+ f.register(
1124
1124
  "for_tooltip_v1",
1125
- d.buildTooltipWithFieldText(
1125
+ f.buildTooltipWithFieldText(
1126
1126
  "%{BKY_LOOP_V1_FOR_TOOLTIP}",
1127
1127
  "VAR"
1128
1128
  )
@@ -1171,9 +1171,9 @@ _([
1171
1171
  extensions: ["contextMenu_newGetVariableBlock_v1", "for_tooltip_v1"]
1172
1172
  }
1173
1173
  ]);
1174
- d.register(
1174
+ f.register(
1175
1175
  "for_each_tooltip_v1",
1176
- d.buildTooltipWithFieldText(
1176
+ f.buildTooltipWithFieldText(
1177
1177
  "%{BKY_LOOP_V1_FOR_EACH_TOOLTIP}",
1178
1178
  "VAR"
1179
1179
  )
@@ -1208,9 +1208,9 @@ _([
1208
1208
  extensions: ["contextMenu_newGetVariableBlock_v1", "for_each_tooltip_v1"]
1209
1209
  }
1210
1210
  ]);
1211
- d.register(
1211
+ f.register(
1212
1212
  "loop_while_until_tooltip_v1",
1213
- d.buildTooltipForDropdown("MODE", {
1213
+ f.buildTooltipForDropdown("MODE", {
1214
1214
  WHILE: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE}",
1215
1215
  UNTIL: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL}"
1216
1216
  })
@@ -1262,7 +1262,7 @@ ${n}
1262
1262
  }
1263
1263
  `;
1264
1264
  };
1265
- const Bt = {
1265
+ const Dt = {
1266
1266
  // math_arithmetic
1267
1267
  ADD: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_ADD}",
1268
1268
  SUBTRACT: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_SUBTRACT}",
@@ -1294,9 +1294,9 @@ const Bt = {
1294
1294
  STD_DEV: "%{BKY_MATH_V1_ON_LIST_TOOLTIP_STD_DEV}",
1295
1295
  RANDOM: "%{BKY_MATH_V1_ON_LIST_TOOLTIP_RANDOM}"
1296
1296
  };
1297
- d.register(
1297
+ f.register(
1298
1298
  "math_op_tooltip_v1",
1299
- d.buildTooltipForDropdown("OP", Bt)
1299
+ f.buildTooltipForDropdown("OP", Dt)
1300
1300
  );
1301
1301
  _([
1302
1302
  {
@@ -1899,31 +1899,31 @@ s.forBlock.math_trig_v1 = function(e) {
1899
1899
  }
1900
1900
  return [n, l.DIVISION];
1901
1901
  };
1902
- const Rt = u.xml, St = {
1902
+ const xt = u.xml, Yt = {
1903
1903
  init: function() {
1904
1904
  this.appendDummyInput().appendField(
1905
1905
  "%{BKY_OBJECT_V1_CREATE_CONTAINER_TITLE}"
1906
1906
  ), this.appendStatementInput("STACK"), this.setStyle("object_blocks"), this.contextMenu = !1;
1907
1907
  }
1908
1908
  };
1909
- O.object_create_container_v1 = St;
1910
- const Mt = {
1909
+ O.object_create_container_v1 = Yt;
1910
+ const Kt = {
1911
1911
  init: function() {
1912
1912
  this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("object_blocks"), this.contextMenu = !1;
1913
1913
  }
1914
1914
  };
1915
- O.object_create_item_v1 = Mt;
1916
- const Ut = {
1915
+ O.object_create_item_v1 = Kt;
1916
+ const Ft = {
1917
1917
  init: function() {
1918
1918
  this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
1919
- new Q.MutatorIcon(
1919
+ new Z.MutatorIcon(
1920
1920
  ["object_create_item_v1"],
1921
1921
  this
1922
1922
  )
1923
1923
  ), this.setOutput(!0, "Object"), this.setStyle("object_blocks"), this.setTooltip("%{BKY_OBJECT_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_OBJECT_V1_CREATE_HELPURL}");
1924
1924
  },
1925
1925
  mutationToDom: function() {
1926
- const e = Rt.createElement("mutation");
1926
+ const e = xt.createElement("mutation");
1927
1927
  return e.setAttribute("items", String(this.itemCount_)), e;
1928
1928
  },
1929
1929
  domToMutation: function(e) {
@@ -1988,12 +1988,12 @@ const Ut = {
1988
1988
  },
1989
1989
  updateShape_: function() {
1990
1990
  for (let e = 0; e < this.itemCount_; e++)
1991
- this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(b.Align.RIGHT).appendField(new Te("key"), "KEY" + e);
1991
+ this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(N.Align.RIGHT).appendField(new Te("key"), "KEY" + e);
1992
1992
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
1993
1993
  this.removeInput("ADD" + e);
1994
1994
  }
1995
1995
  };
1996
- O.object_create_v1 = Ut;
1996
+ O.object_create_v1 = Ft;
1997
1997
  s.forBlock.object_create_v1 = function(e) {
1998
1998
  const o = e;
1999
1999
  let t = "{";
@@ -2251,15 +2251,15 @@ _([
2251
2251
  s.forBlock.object_to_json_v1 = function(e) {
2252
2252
  return [`__jsonStringifyV1__(${s.valueToCode(e, "OBJECT", l.NONE) || "null"})`, l.FUNCTION_CALL];
2253
2253
  };
2254
- const me = u.xml, Vt = {
2254
+ const Ae = u.xml, Ht = {
2255
2255
  init: function() {
2256
- this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new ze(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
2256
+ this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new nt(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
2257
2257
  }
2258
2258
  };
2259
- O.procedure_def_container_v1 = Vt;
2260
- const Pt = {
2259
+ O.procedure_def_container_v1 = Ht;
2260
+ const wt = {
2261
2261
  init: function() {
2262
- const e = new Te(re.DEFAULT_ARG);
2262
+ const e = new Te(_e.DEFAULT_ARG);
2263
2263
  e.setValidator(this.validator_), this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_ITEM_TITLE}").appendField(e, "NAME"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("procedure_blocks"), this.contextMenu = !1;
2264
2264
  },
2265
2265
  validator_: function(e) {
@@ -2279,24 +2279,24 @@ const Pt = {
2279
2279
  return e;
2280
2280
  }
2281
2281
  };
2282
- O.procedure_def_item_v1 = Pt;
2283
- const Dt = {
2282
+ O.procedure_def_item_v1 = wt;
2283
+ const Gt = {
2284
2284
  init: function() {
2285
2285
  this.withReturn = !1, this.args = [];
2286
2286
  const e = new Te(
2287
- re.findLegalName("", this)
2287
+ _e.findLegalName("", this)
2288
2288
  );
2289
- e.setValidator(re.rename), e.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(e, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
2290
- new Q.MutatorIcon(
2289
+ e.setValidator(_e.rename), e.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(e, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
2290
+ new Z.MutatorIcon(
2291
2291
  ["procedure_def_item_v1"],
2292
2292
  this
2293
2293
  )
2294
2294
  ), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_DEF_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_DEF_HELPURL}");
2295
2295
  },
2296
2296
  mutationToDom: function() {
2297
- const e = me.createElement("mutation");
2297
+ const e = Ae.createElement("mutation");
2298
2298
  return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), this.args.forEach((o) => {
2299
- const t = me.createElement("arg");
2299
+ const t = Ae.createElement("arg");
2300
2300
  t.setAttribute("name", o.name), t.setAttribute("id", o.id), e.appendChild(t);
2301
2301
  }), e;
2302
2302
  },
@@ -2373,20 +2373,20 @@ const Dt = {
2373
2373
  n.setKeyName(o.name, "");
2374
2374
  else
2375
2375
  try {
2376
- E.disable(), n = ve(this.workspace, o.name, ""), n.outputConnection.connect(t);
2376
+ E.disable(), n = Me(this.workspace, o.name, ""), n.outputConnection.connect(t);
2377
2377
  } finally {
2378
2378
  E.enable();
2379
2379
  }
2380
2380
  }
2381
2381
  }
2382
2382
  };
2383
- O.procedure_def_v1 = Dt;
2384
- const xt = u.xml, Yt = {
2383
+ O.procedure_def_v1 = Gt;
2384
+ const $t = u.xml, jt = {
2385
2385
  init: function() {
2386
2386
  this.withReturn = !1, this.appendDummyInput("DUMMY").appendField("%{BKY_PROCEDURE_RETURN}"), this.appendValueInput("VALUE").appendField("%{BKY_PROCEDURE_RETURN}").setVisible(!1), this.setPreviousStatement(!0), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_RETURN_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_RETURN_HELPURL}");
2387
2387
  },
2388
2388
  mutationToDom: function() {
2389
- const e = xt.createElement("mutation");
2389
+ const e = $t.createElement("mutation");
2390
2390
  return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), e;
2391
2391
  },
2392
2392
  domToMutation: function(e) {
@@ -2437,7 +2437,7 @@ const xt = u.xml, Yt = {
2437
2437
  e.type === "procedure_def_v1" || e.type === "func_entry_v1" ? this.setWarningText(null) : this.setWarningText("the block can only be used in procedure block");
2438
2438
  }
2439
2439
  };
2440
- O.procedure_return_v1 = Yt;
2440
+ O.procedure_return_v1 = jt;
2441
2441
  s.forBlock.procedure_return_v1 = function(e) {
2442
2442
  const o = e;
2443
2443
  return o.withReturn ? `return ${s.valueToCode(o, "VALUE", l.NONE) || "null"};
@@ -2465,13 +2465,13 @@ _([
2465
2465
  s.forBlock.text_v1 = function(e) {
2466
2466
  return [s.quote_(e.getFieldValue("TEXT")), l.ATOMIC];
2467
2467
  };
2468
- const Kt = /^\s*'([^']|\\')*'\s*$/;
2469
- function J(e) {
2470
- return Kt.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
2468
+ const Xt = /^\s*'([^']|\\')*'\s*$/;
2469
+ function Q(e) {
2470
+ return Xt.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
2471
2471
  }
2472
- d.register(
2472
+ f.register(
2473
2473
  "text_append_tooltip_v1",
2474
- d.buildTooltipWithFieldText(
2474
+ f.buildTooltipWithFieldText(
2475
2475
  "%{BKY_TEXT_V1_APPEND_TOOLTIP}",
2476
2476
  "VAR"
2477
2477
  )
@@ -2503,7 +2503,7 @@ s.forBlock.text_append_v1 = function(e) {
2503
2503
  e.getFieldValue("VAR"),
2504
2504
  de.NameType.VARIABLE
2505
2505
  ), t = s.valueToCode(e, "TEXT", l.NONE) || "''";
2506
- return `${o} += ${J(t)};
2506
+ return `${o} += ${Q(t)};
2507
2507
  `;
2508
2508
  };
2509
2509
  _([
@@ -2672,10 +2672,10 @@ _([
2672
2672
  s.forBlock.text_is_empty_v1 = function(e) {
2673
2673
  return [`!${s.valueToCode(e, "VALUE", l.MEMBER) || "''"}.length`, l.LOGICAL_NOT];
2674
2674
  };
2675
- const Ft = u.xml, Ht = {
2675
+ const Wt = u.xml, Jt = {
2676
2676
  itemCount_: 0,
2677
2677
  mutationToDom: function() {
2678
- const e = Ft.createElement("mutation");
2678
+ const e = Wt.createElement("mutation");
2679
2679
  return e.setAttribute("items", `${this.itemCount_}`), e;
2680
2680
  },
2681
2681
  domToMutation: function(e) {
@@ -2740,20 +2740,20 @@ const Ft = u.xml, Ht = {
2740
2740
  for (let e = 0; e < this.itemCount_; e++)
2741
2741
  if (!this.getInput("ADD" + e)) {
2742
2742
  const o = this.appendValueInput("ADD" + e).setAlign(
2743
- b.Align.RIGHT
2743
+ N.Align.RIGHT
2744
2744
  );
2745
2745
  e === 0 && o.appendField("%{BKY_TEXT_V1_JOIN_TITLE}");
2746
2746
  }
2747
2747
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
2748
2748
  this.removeInput("ADD" + e);
2749
2749
  }
2750
- }, wt = function() {
2751
- this.itemCount_ = 2, this.updateShape_(), this.setMutator(new Q.MutatorIcon(["text_join_item_v1"], this));
2750
+ }, zt = function() {
2751
+ this.itemCount_ = 2, this.updateShape_(), this.setMutator(new Z.MutatorIcon(["text_join_item_v1"], this));
2752
2752
  };
2753
- d.registerMutator(
2753
+ f.registerMutator(
2754
2754
  "text_join_mutator_v1",
2755
- Ht,
2756
- wt
2755
+ Jt,
2756
+ zt
2757
2757
  );
2758
2758
  _([
2759
2759
  {
@@ -2796,11 +2796,11 @@ s.forBlock.text_join_v1 = function(e) {
2796
2796
  return ["''", l.ATOMIC];
2797
2797
  case 1: {
2798
2798
  const t = s.valueToCode(o, "ADD0", l.NONE) || "''";
2799
- return J(t);
2799
+ return Q(t);
2800
2800
  }
2801
2801
  case 2: {
2802
2802
  const t = s.valueToCode(o, "ADD0", l.NONE) || "''", n = s.valueToCode(o, "ADD1", l.NONE) || "''";
2803
- return [J(t)[0] + " + " + J(n)[0], l.ADDITION];
2803
+ return [Q(t)[0] + " + " + Q(n)[0], l.ADDITION];
2804
2804
  }
2805
2805
  default: {
2806
2806
  const t = new Array(o.itemCount_);
@@ -2985,7 +2985,7 @@ s.forBlock.text_trim_v1 = function(e) {
2985
2985
  }[e.getFieldValue("MODE")];
2986
2986
  return [`__trimV1__(${o}, ${n})`, l.ATOMIC];
2987
2987
  };
2988
- const Gt = {
2988
+ const Qt = {
2989
2989
  init: function() {
2990
2990
  this.appendDummyInput().appendField("%{BKY_TIME_V1_CREATE_TIMER_TITLE}"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("time_blocks"), this.setTooltip("%{BKY_TIME_V1_CREATE_TIMER_TOOLTIP}"), this.setHelpUrl("%{BKY_TIME_V1_CREATE_TIMER_HELPURL}");
2991
2991
  },
@@ -2996,22 +2996,22 @@ const Gt = {
2996
2996
  this.updateShape_(), this.updateShadow_();
2997
2997
  },
2998
2998
  updateShape_: function() {
2999
- this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_INTERVAL_MS}"), this.moveInputBefore("INTERVAL", "LOOP"));
2999
+ this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(N.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(N.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(N.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(N.Align.RIGHT).appendField("%{BKY_TIME_INTERVAL_MS}"), this.moveInputBefore("INTERVAL", "LOOP"));
3000
3000
  },
3001
3001
  updateShadow_: function() {
3002
3002
  var e, o, t, n, i, a, r, c;
3003
3003
  this.isInsertionMarker() || ((o = (e = this.getInput("INTERVAL")) == null ? void 0 : e.connection) == null || o.setShadowDom(
3004
- w({ type: "number", default: 1e3 })
3004
+ $({ type: "number", default: 1e3 })
3005
3005
  ), (n = (t = this.getInput("LOOP")) == null ? void 0 : t.connection) == null || n.setShadowDom(
3006
- w({ type: "boolean", default: !1 })
3006
+ $({ type: "boolean", default: !1 })
3007
3007
  ), (a = (i = this.getInput("COUNT")) == null ? void 0 : i.connection) == null || a.setShadowDom(
3008
- w({ type: "number", default: 1 })
3008
+ $({ type: "number", default: 1 })
3009
3009
  ), (c = (r = this.getInput("IMMEDIATE")) == null ? void 0 : r.connection) == null || c.setShadowDom(
3010
- w({ type: "boolean", default: !1 })
3010
+ $({ type: "boolean", default: !1 })
3011
3011
  ));
3012
3012
  }
3013
3013
  };
3014
- O.create_timer_v1 = Gt;
3014
+ O.create_timer_v1 = Qt;
3015
3015
  s.forBlock.create_timer_v1 = function(e) {
3016
3016
  const o = s.valueToCode(e, "INTERVAL", l.ATOMIC) || "1000", t = s.valueToCode(e, "LOOP", l.ATOMIC) || "false", n = s.valueToCode(e, "COUNT", l.ATOMIC) || "1", i = s.valueToCode(e, "IMMEDIATE", l.ATOMIC) || "false", a = s.statementToCode(e, "CALLBACK");
3017
3017
  return `__createTimerV1__(${o}, ${t}, ${n}, ${i}, function() {
@@ -3041,18 +3041,18 @@ s.forBlock.delay_v1 = function(e) {
3041
3041
  return `__delayV1__(${s.valueToCode(e, "MS", l.ATOMIC) || "0"});
3042
3042
  `;
3043
3043
  };
3044
- const $t = {
3044
+ const qt = {
3045
3045
  customContextMenu: function(e) {
3046
3046
  if (this.isInFlyout) {
3047
3047
  if (this.type === "variables_get_v1" || this.type === "variables_get_v1_reporter") {
3048
3048
  const o = {
3049
3049
  text: h.RENAME_VARIABLE,
3050
3050
  enabled: !0,
3051
- callback: jt(this)
3051
+ callback: Zt(this)
3052
3052
  }, t = this.getField("VAR").getText(), n = {
3053
3053
  text: h.DELETE_VARIABLE.replace("%1", t),
3054
3054
  enabled: !0,
3055
- callback: Xt(this)
3055
+ callback: eo(this)
3056
3056
  };
3057
3057
  e.unshift(o), e.unshift(n);
3058
3058
  }
@@ -3066,24 +3066,24 @@ const $t = {
3066
3066
  e.push({
3067
3067
  enabled: this.workspace.remainingCapacity() > 0,
3068
3068
  text: t.replace("%1", n.getText()),
3069
- callback: ye.callbackFactory(this, i)
3069
+ callback: Be.callbackFactory(this, i)
3070
3070
  });
3071
3071
  }
3072
3072
  }
3073
- }, jt = function(e) {
3073
+ }, Zt = function(e) {
3074
3074
  return function() {
3075
3075
  const o = e.workspace, n = e.getField("VAR").getVariable();
3076
- W.renameVariable(o, n);
3076
+ z.renameVariable(o, n);
3077
3077
  };
3078
- }, Xt = function(e) {
3078
+ }, eo = function(e) {
3079
3079
  return function() {
3080
3080
  const o = e.workspace, n = e.getField("VAR").getVariable();
3081
3081
  o.deleteVariableById(n.getId()), o.refreshToolboxSelection();
3082
3082
  };
3083
3083
  };
3084
- d.registerMixin(
3084
+ f.registerMixin(
3085
3085
  "context_menu_variable_v1",
3086
- $t
3086
+ qt
3087
3087
  );
3088
3088
  _([
3089
3089
  {
@@ -3139,36 +3139,36 @@ s.forBlock.variable_set_v1 = function(e) {
3139
3139
  return `${o} = ${t};
3140
3140
  `;
3141
3141
  };
3142
- const Oe = u.xml;
3143
- function Wt() {
3142
+ const ve = u.xml;
3143
+ function to() {
3144
3144
  const e = [];
3145
3145
  {
3146
- const o = Oe.createElement("label");
3146
+ const o = ve.createElement("label");
3147
3147
  o.setAttribute("text", h.LABEL_ASSET_LAYER), e.push(o);
3148
3148
  }
3149
3149
  {
3150
- const o = Oe.createElement("block");
3150
+ const o = ve.createElement("block");
3151
3151
  o.setAttribute("type", "upload_asset_v1"), e.push(o);
3152
3152
  }
3153
3153
  return e;
3154
3154
  }
3155
- const Jt = {
3155
+ const oo = {
3156
3156
  name: "INTERFACE_CATEGORY",
3157
- callback: Wt
3158
- }, D = u.xml;
3159
- function zt() {
3157
+ callback: to
3158
+ }, Y = u.xml;
3159
+ function no() {
3160
3160
  const e = [];
3161
3161
  {
3162
- const o = D.createElement("label");
3162
+ const o = Y.createElement("label");
3163
3163
  o.setAttribute("text", "%{BKY_LABEL_PROCEDURE}"), e.push(o);
3164
3164
  }
3165
3165
  {
3166
- const o = D.createElement("block");
3166
+ const o = Y.createElement("block");
3167
3167
  o.setAttribute("type", "procedure_def_v1");
3168
3168
  {
3169
- const t = D.createElement("field");
3169
+ const t = Y.createElement("field");
3170
3170
  t.setAttribute("name", "NAME");
3171
- const n = D.createTextNode(
3171
+ const n = Y.createTextNode(
3172
3172
  h.PROCEDURE_DEFAULT_NAME
3173
3173
  );
3174
3174
  t.appendChild(n), o.appendChild(t);
@@ -3176,44 +3176,44 @@ function zt() {
3176
3176
  e.push(o);
3177
3177
  }
3178
3178
  {
3179
- const o = D.createElement("block");
3179
+ const o = Y.createElement("block");
3180
3180
  o.setAttribute("type", "procedure_return_v1"), e.push(o);
3181
3181
  }
3182
3182
  return e;
3183
3183
  }
3184
- const _e = {
3184
+ const C = {
3185
3185
  name: "PROCEDURE_CATEGORY",
3186
- callback: zt
3186
+ callback: no
3187
3187
  };
3188
- function Qt() {
3189
- const { args: e } = dt.app.view, o = [];
3188
+ function io() {
3189
+ const { args: e } = gt.app.view, o = [];
3190
3190
  return e == null || e.forEach(({ id: t, name: n, type: i }) => {
3191
3191
  o.push({ id: t, name: n, type: i });
3192
3192
  }), o;
3193
3193
  }
3194
- const Ie = u.xml;
3195
- function qt() {
3194
+ const be = u.xml;
3195
+ function so() {
3196
3196
  const e = [];
3197
- if (Qt().length > 0) {
3197
+ if (io().length > 0) {
3198
3198
  {
3199
- const o = Ie.createElement("label");
3199
+ const o = be.createElement("label");
3200
3200
  o.setAttribute("text", "%{BKY_LABEL_ARGUMENT}"), e.push(o);
3201
3201
  }
3202
3202
  {
3203
- const o = Ie.createElement("block");
3203
+ const o = be.createElement("block");
3204
3204
  o.setAttribute("type", "get_arg_v1"), e.push(o);
3205
3205
  }
3206
3206
  }
3207
3207
  return e;
3208
3208
  }
3209
- const ue = {
3209
+ const pe = {
3210
3210
  name: "UI_CATEGORY",
3211
- callback: qt
3212
- }, G = u.xml;
3213
- function Zt(e) {
3211
+ callback: so
3212
+ }, j = u.xml;
3213
+ function lo(e) {
3214
3214
  const o = [];
3215
3215
  {
3216
- const n = G.createElement("label");
3216
+ const n = j.createElement("label");
3217
3217
  n.setAttribute("text", "%{BKY_LABEL_VARIABLE}"), o.push(n);
3218
3218
  }
3219
3219
  {
@@ -3221,7 +3221,7 @@ function Zt(e) {
3221
3221
  n.setAttribute("text", "%{BKY_NEW_VARIABLE}"), n.setAttribute("callbackKey", "CREATE_VARIABLE"), e.registerButtonCallback(
3222
3222
  "CREATE_VARIABLE",
3223
3223
  function(i) {
3224
- W.createVariableButtonHandler(
3224
+ z.createVariableButtonHandler(
3225
3225
  i.getTargetWorkspace()
3226
3226
  );
3227
3227
  }
@@ -3230,41 +3230,41 @@ function Zt(e) {
3230
3230
  const t = e.getVariablesOfType("");
3231
3231
  if (t.length <= 0)
3232
3232
  return o;
3233
- t.sort(Qe.compareByName);
3233
+ t.sort(it.compareByName);
3234
3234
  {
3235
- const n = G.createElement("label");
3235
+ const n = j.createElement("label");
3236
3236
  n.setAttribute("text", h.LABEL_CREATED), o.push(n);
3237
3237
  }
3238
3238
  return t.forEach((n) => {
3239
3239
  {
3240
- const i = G.createElement("block");
3241
- i.setAttribute("type", "variable_get_v1"), i.appendChild(W.generateVariableFieldDom(n)), o.push(i);
3240
+ const i = j.createElement("block");
3241
+ i.setAttribute("type", "variable_get_v1"), i.appendChild(z.generateVariableFieldDom(n)), o.push(i);
3242
3242
  }
3243
3243
  {
3244
- const i = G.createElement("block");
3245
- i.setAttribute("type", "variable_set_v1"), i.appendChild(W.generateVariableFieldDom(n)), o.push(i);
3244
+ const i = j.createElement("block");
3245
+ i.setAttribute("type", "variable_set_v1"), i.appendChild(z.generateVariableFieldDom(n)), o.push(i);
3246
3246
  }
3247
3247
  }), o;
3248
3248
  }
3249
- const pe = {
3249
+ const A = {
3250
3250
  name: "VARIABLE_CATEGORY",
3251
- callback: Zt
3251
+ callback: lo
3252
3252
  };
3253
- Ce.setConfirm(async (e, o) => {
3254
- const t = await st({
3253
+ Re.setConfirm(async (e, o) => {
3254
+ const t = await pt({
3255
3255
  title: "",
3256
3256
  text: e
3257
3257
  });
3258
3258
  o(!!t);
3259
3259
  });
3260
- Ce.setPrompt(async (e, o, t) => {
3261
- const n = await lt({
3260
+ Re.setPrompt(async (e, o, t) => {
3261
+ const n = await Tt({
3262
3262
  title: "",
3263
3263
  value: o
3264
3264
  });
3265
3265
  t(String(n));
3266
3266
  });
3267
- const eo = (e, o, t) => {
3267
+ const ao = (e, o, t) => {
3268
3268
  const n = e[o];
3269
3269
  return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, a) => {
3270
3270
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
@@ -3277,12 +3277,12 @@ const eo = (e, o, t) => {
3277
3277
  );
3278
3278
  });
3279
3279
  };
3280
- async function ge(e) {
3281
- const o = await eo(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./zhHans-kgty7l19.js") }), `./msg/${e}.ts`, 3);
3282
- qe(o.default);
3280
+ async function ke(e) {
3281
+ const o = await ao(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./zhHans-kgty7l19.js") }), `./msg/${e}.ts`, 3);
3282
+ st(o.default);
3283
3283
  }
3284
- function be(e) {
3285
- const o = M();
3284
+ function Ue(e) {
3285
+ const o = V();
3286
3286
  if (!o)
3287
3287
  return;
3288
3288
  const t = o.getBlockById(e);
@@ -3294,25 +3294,25 @@ function be(e) {
3294
3294
  const i = n.getRelativeToSurfaceXY(), a = i.x * o.scale, r = i.y * o.scale;
3295
3295
  o.scroll(-a, -r);
3296
3296
  }
3297
- function to() {
3297
+ function ro() {
3298
3298
  var t;
3299
- const e = M();
3299
+ const e = V();
3300
3300
  if (!e)
3301
3301
  return;
3302
3302
  const o = (t = e.getTopBlocks(!0)) == null ? void 0 : t[0];
3303
- o && be(o.id);
3303
+ o && Ue(o.id);
3304
3304
  }
3305
- class oo {
3305
+ class co {
3306
3306
  init({ contextMenu: o = !0, shortcut: t = !0 } = {
3307
3307
  contextMenu: !0,
3308
3308
  shortcut: !0
3309
3309
  }) {
3310
3310
  o && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), t && (m.registry.unregister(
3311
- oe.names.COPY
3311
+ ie.names.COPY
3312
3312
  ), m.registry.unregister(
3313
- oe.names.CUT
3313
+ ie.names.CUT
3314
3314
  ), m.registry.unregister(
3315
- oe.names.PASTE
3315
+ ie.names.PASTE
3316
3316
  ), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
3317
3317
  }
3318
3318
  blockCopyToStorageContextMenu() {
@@ -3321,8 +3321,8 @@ class oo {
3321
3321
  return h.CROSS_TAB_COPY ? h.CROSS_TAB_COPY : "Copy";
3322
3322
  },
3323
3323
  preconditionFn: function() {
3324
- const t = B();
3325
- return !t || !K(t) || !t.isDeletable() || !ne(t) || !t.isMovable() || !P(t) ? "disabled" : "enabled";
3324
+ const t = S();
3325
+ return !t || !H(t) || !t.isDeletable() || !se(t) || !t.isMovable() || !x(t) ? "disabled" : "enabled";
3326
3326
  },
3327
3327
  callback: function(t) {
3328
3328
  var n;
@@ -3331,11 +3331,11 @@ class oo {
3331
3331
  JSON.stringify((n = t.block) == null ? void 0 : n.toCopyData())
3332
3332
  );
3333
3333
  },
3334
- scopeType: N.ScopeType.BLOCK,
3334
+ scopeType: B.ScopeType.BLOCK,
3335
3335
  id: "blockCopyToStorage",
3336
3336
  weight: 0
3337
3337
  };
3338
- N.registry.register(o);
3338
+ B.registry.register(o);
3339
3339
  }
3340
3340
  blockPasteFromStorageContextMenu() {
3341
3341
  const o = {
@@ -3355,13 +3355,13 @@ class oo {
3355
3355
  if (!n)
3356
3356
  return;
3357
3357
  const i = JSON.parse(n);
3358
- i && t.workspace && he.paste(i, t.workspace);
3358
+ i && t.workspace && Ce.paste(i, t.workspace);
3359
3359
  },
3360
- scopeType: N.ScopeType.WORKSPACE,
3360
+ scopeType: B.ScopeType.WORKSPACE,
3361
3361
  id: "blockPasteFromStorage",
3362
3362
  weight: 0
3363
3363
  };
3364
- N.registry.register(o);
3364
+ B.registry.register(o);
3365
3365
  }
3366
3366
  blockCopyToStorageShortcut() {
3367
3367
  const o = m.registry.createSerializedKey(
@@ -3376,15 +3376,15 @@ class oo {
3376
3376
  ), i = {
3377
3377
  name: "copy",
3378
3378
  preconditionFn: function(a) {
3379
- if (a.options.readOnly || ie.inProgress())
3379
+ if (a.options.readOnly || le.inProgress())
3380
3380
  return !1;
3381
- const r = B();
3382
- return !(!r || !K(r) || !r.isDeletable() || !ne(r) || !r.isMovable() || !P(r));
3381
+ const r = S();
3382
+ return !(!r || !H(r) || !r.isDeletable() || !se(r) || !r.isMovable() || !x(r));
3383
3383
  },
3384
3384
  callback: function(a, r) {
3385
3385
  r.preventDefault();
3386
- const c = B();
3387
- if (!c || !P(c))
3386
+ const c = S();
3387
+ if (!c || !x(c))
3388
3388
  return !1;
3389
3389
  const p = c.toCopyData();
3390
3390
  return p ? (a.hideChaff(), localStorage.setItem("blocklyStash", JSON.stringify(p)), !0) : !1;
@@ -3406,18 +3406,18 @@ class oo {
3406
3406
  ), i = {
3407
3407
  name: "cut",
3408
3408
  preconditionFn: function(a) {
3409
- if (a.options.readOnly || ie.inProgress())
3409
+ if (a.options.readOnly || le.inProgress())
3410
3410
  return !1;
3411
- const r = B();
3412
- return !(!r || !K(r) || !r.isDeletable() || !ne(r) || !r.isMovable() || !P(r) || r.workspace.isFlyout);
3411
+ const r = S();
3412
+ return !(!r || !H(r) || !r.isDeletable() || !se(r) || !r.isMovable() || !x(r) || r.workspace.isFlyout);
3413
3413
  },
3414
3414
  callback: function(a, r) {
3415
3415
  r.preventDefault();
3416
- const c = B();
3417
- if (!c || !K(c) || !c.isDeletable() || !P(c))
3416
+ const c = S();
3417
+ if (!c || !H(c) || !c.isDeletable() || !x(c))
3418
3418
  return !1;
3419
3419
  const p = c.toCopyData();
3420
- return p ? (localStorage.setItem("blocklyStash", JSON.stringify(p)), c instanceof Ze ? c.checkAndDelete() : c.dispose(), !0) : !1;
3420
+ return p ? (localStorage.setItem("blocklyStash", JSON.stringify(p)), c instanceof lt ? c.checkAndDelete() : c.dispose(), !0) : !1;
3421
3421
  },
3422
3422
  keyCodes: [o, t, n]
3423
3423
  };
@@ -3436,7 +3436,7 @@ class oo {
3436
3436
  ), i = {
3437
3437
  name: "paste",
3438
3438
  preconditionFn: function(a) {
3439
- if (a.options.readOnly || ie.inProgress())
3439
+ if (a.options.readOnly || le.inProgress())
3440
3440
  return !1;
3441
3441
  const r = localStorage.getItem("blocklyStash");
3442
3442
  if (!r)
@@ -3450,16 +3450,16 @@ class oo {
3450
3450
  if (!c)
3451
3451
  return !1;
3452
3452
  const p = JSON.parse(c);
3453
- return p ? (he.paste(p, a), !0) : !1;
3453
+ return p ? (Ce.paste(p, a), !0) : !1;
3454
3454
  },
3455
3455
  keyCodes: [o, t, n]
3456
3456
  };
3457
3457
  m.registry.register(i);
3458
3458
  }
3459
3459
  }
3460
- class no {
3460
+ class _o {
3461
3461
  init() {
3462
- const o = N.registry.getItem("cleanWorkspace");
3462
+ const o = B.registry.getItem("cleanWorkspace");
3463
3463
  o && (o.callback = function(t) {
3464
3464
  const n = t.workspace;
3465
3465
  if (!n)
@@ -3477,22 +3477,22 @@ class no {
3477
3477
  });
3478
3478
  }
3479
3479
  }
3480
- function Ne(e) {
3480
+ function Ve(e) {
3481
3481
  const o = e.getParent();
3482
- return o && Ne(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
3482
+ return o && Ve(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
3483
3483
  }
3484
- class io {
3484
+ class uo {
3485
3485
  init() {
3486
- const o = N.registry.getItem("blockDisable");
3486
+ const o = B.registry.getItem("blockDisable");
3487
3487
  o && (o.preconditionFn = function(t) {
3488
3488
  const n = t.block;
3489
- return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || Ne(n) ? "disabled" : "enabled" : "hidden";
3489
+ return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || Ve(n) ? "disabled" : "enabled" : "hidden";
3490
3490
  });
3491
3491
  }
3492
3492
  }
3493
- class ke extends se {
3493
+ class Pe extends ae {
3494
3494
  constructor(t, n, i) {
3495
- super(se.SKIP_SETUP);
3495
+ super(ae.SKIP_SETUP);
3496
3496
  /** The field's colour picker element. */
3497
3497
  L(this, "picker", null);
3498
3498
  /** Index of the currently highlighted element. */
@@ -4087,7 +4087,7 @@ class ke extends se {
4087
4087
  * Number of columns in the palette.
4088
4088
  */
4089
4089
  L(this, "columns", 14);
4090
- t !== se.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
4090
+ t !== ae.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
4091
4091
  }
4092
4092
  configure_(t) {
4093
4093
  super.configure_(t), t.colourOptions && (this.colours = t.colourOptions), t.colourTitles && (this.titles = t.colourTitles), t.columns && (this.columns = t.columns);
@@ -4101,13 +4101,13 @@ class ke extends se {
4101
4101
  ), this.createBorderRect_(), this.getBorderRect().style.fillOpacity = "1", this.getBorderRect().setAttribute("stroke", "#fff"), this.isFullBlockField() && (this.clickTarget_ = this.sourceBlock_.getSvgRoot());
4102
4102
  }
4103
4103
  isFullBlockField() {
4104
- if (!this.getSourceBlock()) throw new F();
4104
+ if (!this.getSourceBlock()) throw new w();
4105
4105
  const n = this.getConstants();
4106
4106
  return this.blockIsSimpleReporter() && !!(n != null && n.FIELD_COLOUR_FULL_BLOCK);
4107
4107
  }
4108
4108
  blockIsSimpleReporter() {
4109
4109
  const t = this.getSourceBlock();
4110
- if (!t) throw new F();
4110
+ if (!t) throw new w();
4111
4111
  if (!t.outputConnection) return !1;
4112
4112
  for (const n of t.inputList)
4113
4113
  if (n.connection || n.fieldRow.length > 1) return !1;
@@ -4115,7 +4115,7 @@ class ke extends se {
4115
4115
  }
4116
4116
  applyColour() {
4117
4117
  const t = this.getSourceBlock();
4118
- if (!t) throw new F();
4118
+ if (!t) throw new w();
4119
4119
  if (!this.fieldGroup_) return;
4120
4120
  const n = this.borderRect_;
4121
4121
  if (!n)
@@ -4129,7 +4129,7 @@ class ke extends se {
4129
4129
  render_() {
4130
4130
  super.render_();
4131
4131
  const t = this.getSourceBlock();
4132
- if (!t) throw new F();
4132
+ if (!t) throw new w();
4133
4133
  t.applyColour();
4134
4134
  }
4135
4135
  updateSize_(t) {
@@ -4154,14 +4154,14 @@ class ke extends se {
4154
4154
  showEditor_() {
4155
4155
  if (this.dropdownCreate(), !this.picker)
4156
4156
  throw Error("Picker not found");
4157
- H.getContentDiv().appendChild(this.picker), H.showPositionedByField(
4157
+ G.getContentDiv().appendChild(this.picker), G.showPositionedByField(
4158
4158
  this,
4159
4159
  this.dropdownDispose.bind(this)
4160
4160
  ), this.picker.focus({ preventScroll: !0 });
4161
4161
  }
4162
4162
  onClick(t) {
4163
4163
  const n = t.target, i = n && n.getAttribute("data-colour");
4164
- i !== null && (this.setValue(i), H.hideIfOwner(this));
4164
+ i !== null && (this.setValue(i), G.hideIfOwner(this));
4165
4165
  }
4166
4166
  onKeyDown(t) {
4167
4167
  let n = !0, i;
@@ -4183,7 +4183,7 @@ class ke extends se {
4183
4183
  const a = i.getAttribute("data-colour");
4184
4184
  a !== null && this.setValue(a);
4185
4185
  }
4186
- H.hideWithoutAnimation();
4186
+ G.hideWithoutAnimation();
4187
4187
  break;
4188
4188
  default:
4189
4189
  n = !1;
@@ -4256,7 +4256,7 @@ class ke extends se {
4256
4256
  ), p.style.backgroundColor = n[c], n[c] === i && (p.className = "blocklyColourSelected", this.highlightedIndex = c);
4257
4257
  }
4258
4258
  this.boundEvents.push(
4259
- k.conditionalBind(
4259
+ R.conditionalBind(
4260
4260
  a,
4261
4261
  "pointerdown",
4262
4262
  this,
@@ -4264,7 +4264,7 @@ class ke extends se {
4264
4264
  !0
4265
4265
  )
4266
4266
  ), this.boundEvents.push(
4267
- k.conditionalBind(
4267
+ R.conditionalBind(
4268
4268
  a,
4269
4269
  "pointermove",
4270
4270
  this,
@@ -4272,7 +4272,7 @@ class ke extends se {
4272
4272
  !0
4273
4273
  )
4274
4274
  ), this.boundEvents.push(
4275
- k.conditionalBind(
4275
+ R.conditionalBind(
4276
4276
  a,
4277
4277
  "pointerenter",
4278
4278
  this,
@@ -4280,7 +4280,7 @@ class ke extends se {
4280
4280
  !0
4281
4281
  )
4282
4282
  ), this.boundEvents.push(
4283
- k.conditionalBind(
4283
+ R.conditionalBind(
4284
4284
  a,
4285
4285
  "pointerleave",
4286
4286
  this,
@@ -4288,7 +4288,7 @@ class ke extends se {
4288
4288
  !0
4289
4289
  )
4290
4290
  ), this.boundEvents.push(
4291
- k.conditionalBind(
4291
+ R.conditionalBind(
4292
4292
  a,
4293
4293
  "keydown",
4294
4294
  this,
@@ -4300,15 +4300,15 @@ class ke extends se {
4300
4300
  /** Disposes of events and DOM-references belonging to the colour editor. */
4301
4301
  dropdownDispose() {
4302
4302
  for (const t of this.boundEvents)
4303
- k.unbind(t);
4303
+ R.unbind(t);
4304
4304
  this.boundEvents.length = 0, this.picker = null, this.highlightedIndex = null;
4305
4305
  }
4306
4306
  static fromJson(t) {
4307
4307
  return new this(t.colour, void 0, t);
4308
4308
  }
4309
4309
  }
4310
- ke.prototype.DEFAULT_VALUE = "#ffffff";
4311
- et.register(`
4310
+ Pe.prototype.DEFAULT_VALUE = "#ffffff";
4311
+ at.register(`
4312
4312
  .blocklyColourTable {
4313
4313
  border-collapse: collapse;
4314
4314
  display: block;
@@ -4335,17 +4335,17 @@ et.register(`
4335
4335
  position: relative;
4336
4336
  }
4337
4337
  `);
4338
- function so() {
4339
- tt.register("field_colour", ke);
4338
+ function po() {
4339
+ rt.register("field_colour", Pe);
4340
4340
  }
4341
- const lo = new oo();
4342
- lo.init({ contextMenu: !0, shortcut: !0 });
4343
- const ao = new no();
4344
- ao.init();
4345
- const ro = new io();
4346
- ro.init();
4347
- so();
4348
- q.Classic.blockStyles = {
4341
+ const To = new co();
4342
+ To.init({ contextMenu: !0, shortcut: !0 });
4343
+ const fo = new _o();
4344
+ fo.init();
4345
+ const Eo = new uo();
4346
+ Eo.init();
4347
+ po();
4348
+ ee.Classic.blockStyles = {
4349
4349
  color_blocks: {
4350
4350
  colourPrimary: "#a5745b",
4351
4351
  colourSecondary: "#ede3de",
@@ -4419,7 +4419,7 @@ q.Classic.blockStyles = {
4419
4419
  hat: ""
4420
4420
  }
4421
4421
  };
4422
- q.Classic.categoryStyles = {
4422
+ ee.Classic.categoryStyles = {
4423
4423
  calc_category: {
4424
4424
  colour: "#757575"
4425
4425
  },
@@ -4469,9 +4469,9 @@ q.Classic.categoryStyles = {
4469
4469
  colour: "#a55b80"
4470
4470
  }
4471
4471
  };
4472
- const co = Ae.defineTheme("light", {
4472
+ const ho = Se.defineTheme("light", {
4473
4473
  name: "light",
4474
- base: q.Classic,
4474
+ base: ee.Classic,
4475
4475
  componentStyles: {
4476
4476
  workspaceBackgroundColour: "#ffffff",
4477
4477
  toolboxBackgroundColour: "#eeeeee",
@@ -4485,9 +4485,9 @@ const co = Ae.defineTheme("light", {
4485
4485
  scrollbarOpacity: 0.4,
4486
4486
  cursorColour: ""
4487
4487
  }
4488
- }), _o = Ae.defineTheme("dark", {
4488
+ }), mo = Se.defineTheme("dark", {
4489
4489
  name: "dark",
4490
- base: q.Classic,
4490
+ base: ee.Classic,
4491
4491
  componentStyles: {
4492
4492
  workspaceBackgroundColour: "#1e1e1e",
4493
4493
  toolboxBackgroundColour: "#272727",
@@ -4502,18 +4502,18 @@ const co = Ae.defineTheme("light", {
4502
4502
  cursorColour: ""
4503
4503
  }
4504
4504
  });
4505
- function uo(e) {
4506
- const o = M();
4505
+ function Oo(e) {
4506
+ const o = V();
4507
4507
  switch (console.log(o), e) {
4508
4508
  case "light":
4509
- o.setTheme(co);
4509
+ o.setTheme(ho);
4510
4510
  break;
4511
4511
  case "dark":
4512
- o.setTheme(_o);
4512
+ o.setTheme(mo);
4513
4513
  break;
4514
4514
  }
4515
4515
  }
4516
- const po = {
4516
+ const fe = {
4517
4517
  kind: "category",
4518
4518
  name: "%{BKY_CATEGORY_COLOR}",
4519
4519
  categorystyle: "color_category",
@@ -4587,7 +4587,7 @@ const po = {
4587
4587
  }
4588
4588
  }
4589
4589
  ]
4590
- }, To = {
4590
+ }, Ee = {
4591
4591
  kind: "category",
4592
4592
  name: "%{BKY_CATEGORY_LIST}",
4593
4593
  categorystyle: "list_category",
@@ -4702,7 +4702,7 @@ const po = {
4702
4702
  type: "list_reverse_v1"
4703
4703
  }
4704
4704
  ]
4705
- }, fo = {
4705
+ }, he = {
4706
4706
  kind: "category",
4707
4707
  name: "%{BKY_CATEGORY_LOGIC}",
4708
4708
  categorystyle: "logic_category",
@@ -4744,7 +4744,7 @@ const po = {
4744
4744
  type: "logic_ternary_v1"
4745
4745
  }
4746
4746
  ]
4747
- }, Eo = {
4747
+ }, me = {
4748
4748
  kind: "category",
4749
4749
  name: "%{BKY_CATEGORY_LOOP}",
4750
4750
  categorystyle: "loop_category",
@@ -4766,7 +4766,7 @@ const po = {
4766
4766
  type: "for_each_v1"
4767
4767
  }
4768
4768
  ]
4769
- }, ho = {
4769
+ }, Oe = {
4770
4770
  kind: "category",
4771
4771
  name: "%{BKY_CATEGORY_MATH}",
4772
4772
  categorystyle: "math_category",
@@ -4921,7 +4921,7 @@ const po = {
4921
4921
  type: "math_on_list_v1"
4922
4922
  }
4923
4923
  ]
4924
- }, mo = {
4924
+ }, Ie = {
4925
4925
  kind: "category",
4926
4926
  name: "%{BKY_CATEGORY_OBJECT}",
4927
4927
  categorystyle: "object_category",
@@ -4989,7 +4989,7 @@ const po = {
4989
4989
  }
4990
4990
  }
4991
4991
  ]
4992
- }, Oo = {
4992
+ }, ge = {
4993
4993
  kind: "category",
4994
4994
  name: "%{BKY_CATEGORY_TEXT}",
4995
4995
  categorystyle: "text_category",
@@ -5183,57 +5183,103 @@ const po = {
5183
5183
  kind: "category",
5184
5184
  name: "%{BKY_CATEGORY_UI}",
5185
5185
  categorystyle: "ui_category",
5186
- custom: ue.name
5186
+ custom: pe.name
5187
5187
  },
5188
- Eo,
5189
- fo,
5190
- ho,
5191
- Oo,
5192
- To,
5193
- mo,
5194
- po,
5188
+ me,
5189
+ he,
5190
+ Oe,
5191
+ ge,
5192
+ Ee,
5193
+ Ie,
5194
+ fe,
5195
5195
  Io,
5196
5196
  {
5197
5197
  kind: "category",
5198
5198
  name: "%{BKY_CATEGORY_VARIABLE}",
5199
5199
  categorystyle: "variable_category",
5200
- custom: pe.name
5200
+ custom: A.name
5201
5201
  },
5202
5202
  {
5203
5203
  kind: "category",
5204
5204
  name: "%{BKY_CATEGORY_PROCEDURE}",
5205
5205
  categorystyle: "procedure_category",
5206
- custom: _e.name
5206
+ custom: C.name
5207
5207
  },
5208
5208
  {
5209
5209
  kind: "category",
5210
5210
  name: "%{BKY_CATEGORY_INTERFACE}",
5211
5211
  categorystyle: "interface_category",
5212
- custom: Jt.name
5212
+ custom: oo.name
5213
+ }
5214
+ ]
5215
+ }, Lo = {
5216
+ kind: "categoryToolbox",
5217
+ contents: [
5218
+ me,
5219
+ he,
5220
+ Oe,
5221
+ ge,
5222
+ Ee,
5223
+ Ie,
5224
+ fe,
5225
+ {
5226
+ kind: "category",
5227
+ name: "%{BKY_CATEGORY_VARIABLE}",
5228
+ categorystyle: "variable_category",
5229
+ custom: A.name
5230
+ },
5231
+ {
5232
+ kind: "category",
5233
+ name: "%{BKY_CATEGORY_PROCEDURE}",
5234
+ categorystyle: "procedure_category",
5235
+ custom: C.name
5236
+ }
5237
+ ]
5238
+ }, yo = {
5239
+ kind: "categoryToolbox",
5240
+ contents: [
5241
+ me,
5242
+ he,
5243
+ Oe,
5244
+ ge,
5245
+ Ee,
5246
+ Ie,
5247
+ fe,
5248
+ {
5249
+ kind: "category",
5250
+ name: "%{BKY_CATEGORY_VARIABLE}",
5251
+ categorystyle: "variable_category",
5252
+ custom: A.name
5253
+ },
5254
+ {
5255
+ kind: "category",
5256
+ name: "%{BKY_CATEGORY_PROCEDURE}",
5257
+ categorystyle: "procedure_category",
5258
+ custom: C.name
5213
5259
  }
5214
5260
  ]
5215
- }, Lo = /* @__PURE__ */ z({
5261
+ }, Co = /* @__PURE__ */ q({
5216
5262
  __name: "cleanup",
5217
5263
  setup(e) {
5218
5264
  const o = () => {
5219
- const t = M();
5265
+ const t = V();
5220
5266
  if (!t)
5221
5267
  return;
5222
- const n = N.registry.getItem("cleanWorkspace");
5268
+ const n = B.registry.getItem("cleanWorkspace");
5223
5269
  n && n.callback({ workspace: t }, new PointerEvent("dummy"));
5224
5270
  };
5225
5271
  return (t, n) => {
5226
- const i = C("v-btn");
5227
- return I(), S(i, {
5272
+ const i = v("v-btn");
5273
+ return I(), U(i, {
5228
5274
  class: "mr-3",
5229
5275
  variant: "outlined",
5230
5276
  density: "comfortable",
5231
- icon: Y(ct),
5277
+ icon: F(Et),
5232
5278
  onClick: o
5233
5279
  }, null, 8, ["icon"]);
5234
5280
  };
5235
5281
  }
5236
- }), yo = /* @__PURE__ */ z({
5282
+ }), Ao = /* @__PURE__ */ q({
5237
5283
  __name: "lock",
5238
5284
  props: {
5239
5285
  modelValue: { type: Boolean, required: !0 },
@@ -5241,93 +5287,93 @@ const po = {
5241
5287
  },
5242
5288
  emits: ["update:modelValue"],
5243
5289
  setup(e) {
5244
- const o = le(e, "modelValue");
5290
+ const o = re(e, "modelValue");
5245
5291
  return (t, n) => {
5246
- const i = C("v-btn");
5247
- return I(), S(i, {
5292
+ const i = v("v-btn");
5293
+ return I(), U(i, {
5248
5294
  class: "mr-3",
5249
5295
  variant: "outlined",
5250
5296
  density: "comfortable",
5251
- icon: o.value ? Y(ut) : Y(pt),
5297
+ icon: o.value ? F(mt) : F(Ot),
5252
5298
  onClick: n[0] || (n[0] = (a) => o.value = !o.value)
5253
5299
  }, null, 8, ["icon"]);
5254
5300
  };
5255
5301
  }
5256
- }), Co = {
5302
+ }), vo = {
5257
5303
  key: 1,
5258
5304
  class: "text-caption text-grey"
5259
- }, Ao = /* @__PURE__ */ z({
5305
+ }, bo = /* @__PURE__ */ q({
5260
5306
  __name: "navigator",
5261
5307
  setup(e) {
5262
- const o = $(() => ({
5308
+ const o = X(() => ({
5263
5309
  maxHeight: "calc(100vh - 200px)"
5264
- })), t = j([]), n = () => {
5310
+ })), t = W([]), n = () => {
5265
5311
  var y;
5266
- const a = M();
5312
+ const a = V();
5267
5313
  if (!a) {
5268
5314
  t.value = [];
5269
5315
  return;
5270
5316
  }
5271
- const r = [], c = a.getTopBlocks(!0), p = ((y = B()) == null ? void 0 : y.id) ?? "";
5272
- c.forEach((v) => {
5273
- const g = v;
5317
+ const r = [], c = a.getTopBlocks(!0), p = ((y = S()) == null ? void 0 : y.id) ?? "";
5318
+ c.forEach((k) => {
5319
+ const g = k;
5274
5320
  if (g.type.startsWith("on_node_event_v"))
5275
5321
  console.log("1");
5276
5322
  else if (g.type.startsWith("procedure_def_v"))
5277
5323
  console.log("2");
5278
5324
  else {
5279
- const f = g.getRelativeToSurfaceXY();
5325
+ const T = g.getRelativeToSurfaceXY();
5280
5326
  r.push({
5281
5327
  id: g.id,
5282
5328
  name: h.fffff,
5283
- x: f.x,
5284
- y: f.y,
5329
+ x: T.x,
5330
+ y: T.y,
5285
5331
  active: g.id === p
5286
5332
  });
5287
5333
  }
5288
5334
  }), t.value = r;
5289
5335
  }, i = (a) => {
5290
- const r = M();
5336
+ const r = V();
5291
5337
  if (!r)
5292
5338
  return;
5293
5339
  const c = r.getBlockById(a.id);
5294
- c && (be(a.id), c.select());
5340
+ c && (Ue(a.id), c.select());
5295
5341
  };
5296
- return Le(() => {
5297
- ce.on("codeUpdate", n);
5298
- }), Ke(() => {
5299
- ce.off("codeUpdate", n);
5342
+ return Ne(() => {
5343
+ ue.on("codeUpdate", n);
5344
+ }), Xe(() => {
5345
+ ue.off("codeUpdate", n);
5300
5346
  }), (a, r) => {
5301
- const c = C("v-btn"), p = C("v-list-item-title"), y = C("v-list-item"), v = C("v-list"), g = C("v-menu");
5302
- return I(), S(g, {
5347
+ const c = v("v-btn"), p = v("v-list-item-title"), y = v("v-list-item"), k = v("v-list"), g = v("v-menu");
5348
+ return I(), U(g, {
5303
5349
  "close-on-content-click": !1,
5304
5350
  transition: "slide-y-transition",
5305
5351
  "offset-y": ""
5306
5352
  }, {
5307
- activator: U(({ props: f }) => [
5308
- R(c, Fe(f, {
5353
+ activator: P(({ props: T }) => [
5354
+ M(c, We(T, {
5309
5355
  variant: "outlined",
5310
5356
  density: "comfortable",
5311
- icon: Y(Tt)
5357
+ icon: F(It)
5312
5358
  }), null, 16, ["icon"])
5313
5359
  ]),
5314
- default: U(() => [
5315
- ae("div", {
5360
+ default: P(() => [
5361
+ ce("div", {
5316
5362
  class: "overflow-auto",
5317
- style: X(o.value)
5363
+ style: J(o.value)
5318
5364
  }, [
5319
- t.value.length > 0 ? (I(), S(v, { key: 0 }, {
5320
- default: U(() => [
5321
- (I(!0), x(He, null, we(t.value, (f) => (I(), S(y, {
5322
- key: f.id,
5365
+ t.value.length > 0 ? (I(), U(k, { key: 0 }, {
5366
+ default: P(() => [
5367
+ (I(!0), K(Je, null, ze(t.value, (T) => (I(), U(y, {
5368
+ key: T.id,
5323
5369
  class: "d-flex justify-start",
5324
- active: f.active,
5370
+ active: T.active,
5325
5371
  onClick: i
5326
5372
  }, {
5327
- default: U(() => [
5328
- R(p, null, {
5329
- default: U(() => [
5330
- Ge($e(f.name), 1)
5373
+ default: P(() => [
5374
+ M(p, null, {
5375
+ default: P(() => [
5376
+ Qe(qe(T.name), 1)
5331
5377
  ]),
5332
5378
  _: 2
5333
5379
  }, 1024)
@@ -5336,16 +5382,16 @@ const po = {
5336
5382
  }, 1032, ["active"]))), 128))
5337
5383
  ]),
5338
5384
  _: 1
5339
- })) : (I(), x("span", Co, "xxxxxxxxxx"))
5385
+ })) : (I(), K("span", vo, "xxxxxxxxxx"))
5340
5386
  ], 4)
5341
5387
  ]),
5342
5388
  _: 1
5343
5389
  });
5344
5390
  };
5345
5391
  }
5346
- }), vo = { class: "position-relative w-100 h-100" }, bo = /* @__PURE__ */ z({
5392
+ }), ko = { class: "position-relative w-100 h-100" }, No = /* @__PURE__ */ q({
5347
5393
  __name: "index",
5348
- props: /* @__PURE__ */ Ee({
5394
+ props: /* @__PURE__ */ ye({
5349
5395
  type: {},
5350
5396
  version: {},
5351
5397
  active: { type: Boolean }
@@ -5355,9 +5401,9 @@ const po = {
5355
5401
  scale: { required: !0 },
5356
5402
  scaleModifiers: {}
5357
5403
  }),
5358
- emits: /* @__PURE__ */ Ee(["ready", "change"], ["update:lock", "update:scale"]),
5404
+ emits: /* @__PURE__ */ ye(["ready", "change"], ["update:lock", "update:scale"]),
5359
5405
  setup(e, { emit: o }) {
5360
- const t = at(), { locale: n, dark: i } = it(t), { open: a } = rt("blocklyEditorFlyout"), r = le(e, "lock"), c = le(e, "scale"), p = e, y = o, v = j(), g = {
5406
+ const t = dt(), { locale: n, dark: i } = ut(t), { open: a } = ft("blocklyEditorFlyout"), r = re(e, "lock"), c = re(e, "scale"), p = e, y = o, k = W(), g = {
5361
5407
  grid: {
5362
5408
  length: 2,
5363
5409
  snap: !0,
@@ -5380,8 +5426,8 @@ const po = {
5380
5426
  wheel: !0
5381
5427
  }
5382
5428
  };
5383
- let f;
5384
- const Z = j(!1), ee = j(!1), Be = $(() => ({
5429
+ let T;
5430
+ const te = W(!1), oe = W(!1), De = X(() => ({
5385
5431
  position: "absolute",
5386
5432
  background: i.value ? "#0000007f" : "#ffffff7f",
5387
5433
  top: "1px",
@@ -5390,7 +5436,7 @@ const po = {
5390
5436
  height: "calc(100% - 1px)",
5391
5437
  pointerEvents: "none",
5392
5438
  zIndex: 999
5393
- })), Re = $(() => ({
5439
+ })), xe = X(() => ({
5394
5440
  position: "absolute",
5395
5441
  background: i.value ? "#0000007f" : "#ffffff7f",
5396
5442
  top: "0px",
@@ -5398,109 +5444,112 @@ const po = {
5398
5444
  width: "100%",
5399
5445
  height: "100%",
5400
5446
  pointerEvents: "none"
5401
- })), Se = $(() => ({
5447
+ })), Ye = X(() => ({
5402
5448
  position: "absolute",
5403
5449
  top: "0px",
5404
5450
  right: "0px",
5405
5451
  zIndex: 20
5406
5452
  }));
5407
- Le(async () => {
5408
- if (!v.value)
5453
+ Ne(async () => {
5454
+ if (!k.value)
5409
5455
  return;
5410
- await ge(n.value);
5411
- let T;
5412
- if (p.type === "app" && p.version === "v1" && (T = go), g.toolbox = T, f = ot(v.value, g), p.type === "app")
5413
- switch (p.version) {
5414
- case "v1":
5415
- f.registerToolboxCategoryCallback(
5416
- ue.name,
5417
- ue.callback
5418
- ), f.registerToolboxCategoryCallback(
5419
- _e.name,
5420
- _e.callback
5421
- ), f.registerToolboxCategoryCallback(
5422
- pe.name,
5423
- pe.callback
5424
- );
5425
- break;
5426
- }
5427
- f.addChangeListener(E.disableOrphans), f.addChangeListener(Me), y("ready", f);
5428
- }), je(() => {
5456
+ await ke(n.value);
5457
+ let d;
5458
+ p.type === "app" ? p.version === "v1" && (d = go) : p.type === "func" ? p.version === "v1" && (d = yo) : p.type === "flow" && p.version === "v1" && (d = Lo), g.toolbox = d, T = ct(k.value, g), p.type === "app" ? p.version === "v1" && (T.registerToolboxCategoryCallback(
5459
+ pe.name,
5460
+ pe.callback
5461
+ ), T.registerToolboxCategoryCallback(
5462
+ C.name,
5463
+ C.callback
5464
+ ), T.registerToolboxCategoryCallback(
5465
+ A.name,
5466
+ A.callback
5467
+ )) : p.type === "func" ? p.version === "v1" && (T.registerToolboxCategoryCallback(
5468
+ C.name,
5469
+ C.callback
5470
+ ), T.registerToolboxCategoryCallback(
5471
+ A.name,
5472
+ A.callback
5473
+ )) : p.type === "flow" && p.version === "v1" && (T.registerToolboxCategoryCallback(
5474
+ C.name,
5475
+ C.callback
5476
+ ), T.registerToolboxCategoryCallback(
5477
+ A.name,
5478
+ A.callback
5479
+ )), T.addChangeListener(E.disableOrphans), T.addChangeListener(Ke), y("ready", T);
5480
+ }), Ze(() => {
5429
5481
  a.value = !1;
5430
5482
  });
5431
- function fe() {
5432
- f && nt(f);
5483
+ function Le() {
5484
+ T && _t(T);
5433
5485
  }
5434
- function Me(T) {
5435
- if (T.type === E.FINISHED_LOADING) {
5436
- to(), ce.emit("codeUpdate"), Z.value = !1;
5486
+ function Ke(d) {
5487
+ if (d.type === E.FINISHED_LOADING) {
5488
+ ro(), ue.emit("codeUpdate"), te.value = !1;
5437
5489
  return;
5438
5490
  }
5439
- Z.value || (T.type === E.BLOCK_DRAG && (T.isStart ? ee.value = !0 : ee.value = !1), y("change", T));
5491
+ te.value || (d.type === E.BLOCK_DRAG && (d.isStart ? oe.value = !0 : oe.value = !1), y("change", d));
5440
5492
  }
5441
- return V(n, (T) => {
5442
- ge(T);
5443
- }), V(i, (T) => {
5444
- uo(T ? "dark" : "light");
5445
- }), V(a, (T) => {
5446
- var A;
5447
- T || (A = f.getToolbox()) == null || A.clearSelection();
5448
- }), V(
5493
+ return D(n, (d) => {
5494
+ ke(d);
5495
+ }), D(i, (d) => {
5496
+ Oo(d ? "dark" : "light");
5497
+ }), D(a, (d) => {
5498
+ var b;
5499
+ d || (b = T.getToolbox()) == null || b.clearSelection();
5500
+ }), D(
5449
5501
  () => p.active,
5450
- (T) => {
5451
- T && setTimeout(() => fe(), 1);
5452
- }
5453
- ), V(
5454
- c,
5455
- (T) => {
5456
- f.setScale(T);
5502
+ (d) => {
5503
+ d && setTimeout(() => Le(), 1);
5457
5504
  }
5458
- ), (T, A) => {
5459
- const Ue = C("v-icon"), Ve = C("x-loading"), Pe = Xe("resize");
5460
- return I(), x("div", vo, [
5461
- We(ae("div", {
5505
+ ), D(c, (d) => {
5506
+ T.setScale(d);
5507
+ }), (d, b) => {
5508
+ const Fe = v("v-icon"), He = v("x-loading"), we = et("resize");
5509
+ return I(), K("div", ko, [
5510
+ tt(ce("div", {
5462
5511
  id: "blocklyEditor",
5463
5512
  ref_key: "blocklyDiv",
5464
- ref: v,
5513
+ ref: k,
5465
5514
  class: "w-100 h-100"
5466
5515
  }, null, 512), [
5467
- [Pe, fe]
5516
+ [we, Le]
5468
5517
  ]),
5469
- ee.value ? (I(), x("div", {
5518
+ oe.value ? (I(), K("div", {
5470
5519
  key: 0,
5471
5520
  class: "d-flex flex-column align-center justify-center",
5472
- style: X(Be.value)
5521
+ style: J(De.value)
5473
5522
  }, [
5474
- R(Ue, {
5475
- icon: Y(_t),
5523
+ M(Fe, {
5524
+ icon: F(ht),
5476
5525
  size: "x-large"
5477
5526
  }, null, 8, ["icon"])
5478
- ], 4)) : te("", !0),
5479
- r.value ? (I(), x("div", {
5527
+ ], 4)) : ne("", !0),
5528
+ r.value ? (I(), K("div", {
5480
5529
  key: 1,
5481
- style: X(Re.value)
5482
- }, null, 4)) : te("", !0),
5483
- ae("div", {
5530
+ style: J(xe.value)
5531
+ }, null, 4)) : ne("", !0),
5532
+ ce("div", {
5484
5533
  class: "d-flex align-end pt-3 pr-3",
5485
- style: X(Se.value)
5534
+ style: J(Ye.value)
5486
5535
  }, [
5487
- R(Lo),
5488
- R(yo, {
5536
+ M(Co),
5537
+ M(Ao, {
5489
5538
  modelValue: r.value,
5490
- "onUpdate:modelValue": A[0] || (A[0] = (De) => r.value = De)
5539
+ "onUpdate:modelValue": b[0] || (b[0] = (Ge) => r.value = Ge)
5491
5540
  }, null, 8, ["modelValue"]),
5492
- R(Ao)
5541
+ M(bo)
5493
5542
  ], 4),
5494
- Z.value ? (I(), S(Ve, {
5543
+ te.value ? (I(), U(He, {
5495
5544
  key: 2,
5496
5545
  "z-index": 99
5497
- })) : te("", !0)
5546
+ })) : ne("", !0)
5498
5547
  ]);
5499
5548
  };
5500
5549
  }
5501
- }), No = (e) => {
5502
- e.component("XBlockly", bo);
5503
- }, Uo = { install: No };
5550
+ }), Bo = (e) => {
5551
+ e.component("XBlockly", No);
5552
+ }, Po = { install: Bo };
5504
5553
  export {
5505
- Uo as default
5554
+ Po as default
5506
5555
  };