@vtj/renderer 0.9.0-alpha.11 → 0.9.0-alpha.13

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.mjs CHANGED
@@ -1,18 +1,18 @@
1
1
  import { Base as xe, BUILT_IN_COMPONENTS as Re, ProjectModel as A, HistoryModel as ce } from "@vtj/core";
2
- import { isUrl as ke, url as x, dedupArray as Ce, isString as j, isFunction as ee, logger as I, createRequest as Fe, merge as Ae, pathToRegexp as Ie, pathToRegexpMatch as Oe, formDataToJson as Me, storage as B, cookie as U, toArray as te, unRSA as ne, delay as le, camelCase as $, upperFirst as Te, pick as De, jsonp as He, loadScript as se, Request as Be, Storage as Ue, mapToObject as z } from "@vtj/utils";
2
+ import { isUrl as ke, url as x, dedupArray as Ce, isString as j, isFunction as q, logger as I, createRequest as Fe, merge as Ae, pathToRegexp as Ie, pathToRegexpMatch as Oe, formDataToJson as Me, storage as B, cookie as U, toArray as te, unRSA as se, delay as le, camelCase as $, upperFirst as Te, pick as De, jsonp as He, loadScript as ne, Request as Be, Storage as Ue, mapToObject as K } from "@vtj/utils";
3
3
  import * as T from "vue";
4
- import { inject as ue, toRef as Ne, readonly as Le, customRef as qe, ref as O, onBeforeUnmount as Je, getCurrentScope as Ve, onScopeDispose as ze, unref as Ke, getCurrentInstance as de, watch as pe, computed as fe, onMounted as We, defineComponent as K, h as q, openBlock as Ge, createElementBlock as Ye, createElementVNode as b, toDisplayString as N, defineAsyncComponent as re, watchEffect as Qe } from "vue";
4
+ import { inject as ue, toRef as Ne, readonly as Le, customRef as qe, ref as O, onBeforeUnmount as Je, getCurrentScope as Ve, onScopeDispose as ze, unref as Ke, getCurrentInstance as de, watch as pe, computed as fe, onMounted as We, defineComponent as W, h as J, openBlock as Ge, createElementBlock as Ye, createElementVNode as b, toDisplayString as N, defineAsyncComponent as re, watchEffect as Qe } from "vue";
5
5
  import { ElNotification as D, ElLoading as Xe } from "element-plus";
6
6
  import { useRoute as he } from "vue-router";
7
7
  /**!
8
8
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
9
9
  * @name @vtj/renderer
10
10
  * @author CHC chenhuachun1549@dingtalk.com
11
- * @version 0.9.0-alpha.11
11
+ * @version 0.9.0-alpha.13
12
12
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
13
  */
14
- const R = "0.9.0-alpha.11";
15
- var _ = /* @__PURE__ */ ((s) => (s.Runtime = "Runtime", s.Design = "Design", s.Raw = "Raw", s.VNode = "VNode", s))(_ || {});
14
+ const R = "0.9.0-alpha.13";
15
+ var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
16
16
  const oe = [
17
17
  "$el",
18
18
  "$emit",
@@ -25,7 +25,7 @@ const oe = [
25
25
  "$props",
26
26
  "$options",
27
27
  "$forceUpdate"
28
- ], wn = [
28
+ ], _s = [
29
29
  "beforeCreate",
30
30
  "created",
31
31
  "beforeMount",
@@ -47,38 +47,38 @@ const oe = [
47
47
  Object,
48
48
  Function,
49
49
  Date
50
- }, W = "VtjPage", me = "VtjHomepage";
51
- function C(s, e) {
52
- return s.map((t) => ke(t) || t.startsWith("/") ? t : `${e}${t}`);
50
+ }, G = "VtjPage", me = "VtjHomepage";
51
+ function C(n, e) {
52
+ return n.map((t) => ke(t) || t.startsWith("/") ? t : `${e}${t}`);
53
53
  }
54
- function G(s) {
55
- return /\.css$/.test(s);
54
+ function Y(n) {
55
+ return /\.css$/.test(n);
56
56
  }
57
- function Y(s) {
58
- return /\.js$/.test(s);
57
+ function Q(n) {
58
+ return /\.js$/.test(n);
59
59
  }
60
- function tt(s) {
61
- return /\.json$/.test(s);
60
+ function tt(n) {
61
+ return /\.json$/.test(n);
62
62
  }
63
- function Sn(s) {
64
- return s.map(
63
+ function ws(n) {
64
+ return n.map(
65
65
  (e) => `<script src="${x.append(e, { v: R })}"><\/script>`
66
66
  ).join("");
67
67
  }
68
- function jn(s = []) {
69
- return s.map(
68
+ function Ss(n = []) {
69
+ return n.map(
70
70
  (e) => `<link rel="stylesheet" href="${x.append(e, { v: R })}" />`
71
71
  ).join("");
72
72
  }
73
- function nt(s, e = !1) {
74
- return e && s.endsWith(".prod.js") ? s.replace(".prod.js", ".js") : s;
73
+ function st(n, e = !1) {
74
+ return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
75
75
  }
76
- function st(s, e, t = !1) {
77
- const n = s.filter((u) => !!u.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], d = {};
78
- return n.forEach(
76
+ function nt(n, e, t = !1) {
77
+ const s = n.filter((u) => !!u.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], d = {};
78
+ return s.forEach(
79
79
  ({ urls: u, assetsUrl: h, library: p, assetsLibrary: m, localeLibrary: w }) => {
80
80
  u?.forEach((g) => {
81
- Y(g) && r.push(nt(g, t)), G(g) && o.push(g);
81
+ Q(g) && r.push(st(g, t)), Y(g) && o.push(g);
82
82
  }), p && (i.push(p), l[p] = C(u || [], e), w && (c[p] = w)), h && a.push(h), m && f.push(m), p && m && (d[m] = p);
83
83
  }
84
84
  ), {
@@ -92,46 +92,46 @@ function st(s, e, t = !1) {
92
92
  libraryLocaleMap: c
93
93
  };
94
94
  }
95
- function rt(s, e) {
96
- const { name: t, parent: n, alias: r } = s;
97
- return n ? e[n]?.[r || t] : e[r || t];
95
+ function rt(n, e) {
96
+ const { name: t, parent: s, alias: r } = n;
97
+ return s ? e[s]?.[r || t] : e[r || t];
98
98
  }
99
- function ge(s) {
100
- return j(s) ? s : JSON.stringify(s);
99
+ function ge(n) {
100
+ return j(n) ? n : JSON.stringify(n);
101
101
  }
102
- function ve(s, e, t) {
103
- const n = s.CSSStyleSheet;
104
- if (n.prototype.replaceSync) {
105
- const r = new n();
102
+ function ve(n, e, t) {
103
+ const s = n.CSSStyleSheet;
104
+ if (s.prototype.replaceSync) {
105
+ const r = new s();
106
106
  r.id = e, r.replaceSync(t);
107
- const o = s.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
107
+ const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
108
108
  (l) => l.id !== e
109
109
  );
110
110
  o.adoptedStyleSheets = [...i, r];
111
111
  } else {
112
- const r = s.document;
112
+ const r = n.document;
113
113
  let o = r.getElementById(e);
114
114
  o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
115
115
  }
116
116
  }
117
- async function ot(s, e) {
118
- const t = await window.fetch(e).then((n) => n.text()).catch(() => "");
119
- t && ve(window, s, t);
117
+ async function ot(n, e) {
118
+ const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
119
+ t && ve(window, n, t);
120
120
  }
121
- function it(s, e = window) {
122
- const t = e.document, n = e.document.head;
123
- for (const r of s)
121
+ function it(n, e = window) {
122
+ const t = e.document, s = e.document.head;
123
+ for (const r of n)
124
124
  if (!t.getElementById(r)) {
125
125
  const a = t.createElement("link");
126
- a.rel = "stylesheet", a.id = r, a.href = r, n.appendChild(a);
126
+ a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
127
127
  }
128
128
  }
129
- async function at(s, e, t = window) {
130
- const n = t.document, r = t.document.head;
129
+ async function at(n, e, t = window) {
130
+ const s = t.document, r = t.document.head;
131
131
  let o = t[e];
132
132
  return o ? o.default || o : new Promise((a, i) => {
133
- for (const l of s) {
134
- const c = n.createElement("script");
133
+ for (const l of n) {
134
+ const c = s.createElement("script");
135
135
  c.src = l, c.onload = () => {
136
136
  o = t[e], o ? a(o.default || o) : i(null);
137
137
  }, c.onerror = (f) => {
@@ -140,45 +140,45 @@ async function at(s, e, t = window) {
140
140
  }
141
141
  });
142
142
  }
143
- function ct(s) {
144
- return ee(s) || ee(s?.install);
143
+ function ct(n) {
144
+ return q(n) || q(n?.install);
145
145
  }
146
- function k(s, e, t = !1, n = !1) {
146
+ function k(n, e, t = !1, s = !1) {
147
147
  try {
148
148
  const r = ['"use strict";', "var __self = arguments[0];"];
149
149
  r.push("return ");
150
- let o = (s.value || "").trim();
150
+ let o = (n.value || "").trim();
151
151
  o = o.replace(/this(\W|$)/g, (i, l) => `__self${l}`), o = r.join(`
152
152
  `) + o;
153
153
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
154
154
  return new Function("$scope", a)(e);
155
155
  } catch (r) {
156
- if (I.error("parseExpression.error", r, s, e?.__self ?? e), n)
156
+ if (I.error("parseExpression.error", r, n, e?.__self ?? e), s)
157
157
  throw r;
158
158
  }
159
159
  }
160
- function ie(s, e, t = !1, n = !1) {
161
- const r = k(s, e, t, n);
160
+ function ie(n, e, t = !1, s = !1) {
161
+ const r = k(n, e, t, s);
162
162
  if (typeof r != "function" && (I.error(
163
163
  "parseFunction.error",
164
164
  "not a function",
165
- s,
165
+ n,
166
166
  e?.__self ?? e
167
- ), n))
168
- throw new Error(`"${s.value}" not a function`);
167
+ ), s))
168
+ throw new Error(`"${n.value}" not a function`);
169
169
  return r;
170
170
  }
171
- function S(s) {
172
- return s && s.type === "JSExpression";
171
+ function S(n) {
172
+ return n && n.type === "JSExpression";
173
173
  }
174
- function H(s) {
175
- return typeof s == "object" && s && s.type === "JSFunction";
174
+ function H(n) {
175
+ return typeof n == "object" && n && n.type === "JSFunction";
176
176
  }
177
- function lt(s) {
178
- return S(s) || H(s);
177
+ function lt(n) {
178
+ return S(n) || H(n);
179
179
  }
180
- function $n(s) {
181
- return lt(s) ? s.value : JSON.stringify(s);
180
+ function js(n) {
181
+ return lt(n) ? n.value : JSON.stringify(n);
182
182
  }
183
183
  let E = null;
184
184
  const ut = Fe({
@@ -187,11 +187,11 @@ const ut = Fe({
187
187
  validSuccess: !0,
188
188
  originResponse: !1,
189
189
  loading: !0,
190
- validate: (s) => s.data?.code === 0 || !!s.data?.success,
190
+ validate: (n) => n.data?.code === 0 || !!n.data?.success,
191
191
  failMessage: !0,
192
- showError: (s) => {
192
+ showError: (n) => {
193
193
  D.error({
194
- message: s || "未知错误"
194
+ message: n || "未知错误"
195
195
  });
196
196
  },
197
197
  showLoading: () => {
@@ -207,58 +207,58 @@ const ut = Fe({
207
207
  }
208
208
  });
209
209
  let P;
210
- function dt(s, e) {
211
- const { jsonp: t, request: n } = e;
212
- if (s.method === "jsonp")
213
- return (r = {}) => t(s.url, {
214
- ...s.jsonpOptions,
210
+ function dt(n, e) {
211
+ const { jsonp: t, request: s } = e;
212
+ if (n.method === "jsonp")
213
+ return (r = {}) => t(n.url, {
214
+ ...n.jsonpOptions,
215
215
  query: r
216
216
  });
217
217
  {
218
- const r = s.headers ? k(s.headers, {}, !0) : void 0, o = {
219
- url: s.url,
220
- method: s.method,
218
+ const r = n.headers ? k(n.headers, {}, !0) : void 0, o = {
219
+ url: n.url,
220
+ method: n.method,
221
221
  settings: {
222
- ...s.settings,
222
+ ...n.settings,
223
223
  headers: r
224
224
  }
225
225
  };
226
- return (a, i) => (delete o.data, n.send(Ae(o, i || {}, { data: a })));
226
+ return (a, i) => (delete o.data, s.send(Ae(o, i || {}, { data: a })));
227
227
  }
228
228
  }
229
- function pt(s, e) {
229
+ function pt(n, e) {
230
230
  const { metaQuery: t } = e;
231
231
  if (!t) return;
232
- const { code: n, queryCode: r } = s;
232
+ const { code: s, queryCode: r } = n;
233
233
  return (o, a) => {
234
234
  if (!t) {
235
235
  console.warn("adapter.metaQuery is not defined!");
236
236
  return;
237
237
  }
238
- return t(n, r, o, a);
238
+ return t(s, r, o, a);
239
239
  };
240
240
  }
241
- function ft(s = [], e = [], t) {
242
- const n = {};
243
- for (const r of s)
244
- n[r.id] = dt(r, t);
241
+ function ft(n = [], e = [], t) {
242
+ const s = {};
243
+ for (const r of n)
244
+ s[r.id] = dt(r, t);
245
245
  for (const r of e)
246
- n[r.id] = pt(r, t);
247
- return n;
246
+ s[r.id] = pt(r, t);
247
+ return s;
248
248
  }
249
- async function ht(s = []) {
249
+ async function ht(n = []) {
250
250
  P = await import("mockjs").then((e) => e.default || e), P && (P.setup({
251
251
  timeout: "50-500"
252
- }), ye(), s.forEach((e) => mt(P, e)));
252
+ }), ye(), n.forEach((e) => mt(P, e)));
253
253
  }
254
- function mt(s, e) {
254
+ function mt(n, e) {
255
255
  if (!e.mock) return;
256
- const { url: t, mockTemplate: n } = e;
257
- if (t && n) {
258
- const r = Ie(`${t}(.*)`), o = Oe(t, { decode: decodeURIComponent }), a = k(n, {}, !0);
259
- s.mock(r, (i) => {
256
+ const { url: t, mockTemplate: s } = e;
257
+ if (t && s) {
258
+ const r = Ie(`${t}(.*)`), o = Oe(t, { decode: decodeURIComponent }), a = k(s, {}, !0);
259
+ n.mock(r, (i) => {
260
260
  const l = x.parse(i.url) || {}, c = i.body instanceof FormData ? Me(i.body) : i.body, f = o(i.url)?.params;
261
- return Object.assign(i, { data: c, params: l, query: f }), s.mock(a(i));
261
+ return Object.assign(i, { data: c, params: l, query: f }), n.mock(a(i));
262
262
  });
263
263
  }
264
264
  }
@@ -270,7 +270,7 @@ const gt = {
270
270
  authKey: "Authorization",
271
271
  storageKey: "ACCESS_STORAGE",
272
272
  storagePrefix: "__VTJ_",
273
- unauthorized: "/unauthorized",
273
+ unauthorized: void 0,
274
274
  auth: "/#/login",
275
275
  redirectParam: "r",
276
276
  unauthorizedCode: 401,
@@ -278,7 +278,7 @@ const gt = {
278
278
  noPermissionMessage: "无权限访问该页面",
279
279
  keyPrefix: ""
280
280
  }, _e = Symbol("access");
281
- class bn {
281
+ class $s {
282
282
  options;
283
283
  data = null;
284
284
  mode = _.Raw;
@@ -286,22 +286,22 @@ class bn {
286
286
  this.options = Object.assign({}, gt, e), this.loadData();
287
287
  }
288
288
  connect(e) {
289
- const { mode: t, router: n, request: r } = e;
290
- this.mode = t, n && t === _.Raw && this.setGuard(n), r && this.setRequest(r);
289
+ const { mode: t, router: s, request: r } = e;
290
+ this.mode = t, s && t === _.Raw && this.setGuard(s), r && this.setRequest(r);
291
291
  }
292
292
  login(e) {
293
- const { storageKey: t, storagePrefix: n, session: r, authKey: o } = this.options;
293
+ const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
294
294
  this.setData(e), this.data && (B.save(t, e, {
295
295
  type: "local",
296
- prefix: n
296
+ prefix: s
297
297
  }), r && U.set(o, this.data.token));
298
298
  }
299
299
  clear() {
300
- const { storageKey: e, storagePrefix: t, session: n, authKey: r } = this.options;
300
+ const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
301
301
  this.data = null, B.remove(e, {
302
302
  type: "local",
303
303
  prefix: t
304
- }), n && U.remove(r);
304
+ }), s && U.remove(r);
305
305
  }
306
306
  logout() {
307
307
  this.clear(), this.toLogin();
@@ -313,20 +313,20 @@ class bn {
313
313
  return this.data?.token;
314
314
  }
315
315
  can(e) {
316
- const { keyPrefix: t } = this.options, { permissions: n = {} } = this.data || {};
317
- return typeof e == "function" ? e(n) : te(e).every((o) => n[o] || n[t + o]);
316
+ const { keyPrefix: t } = this.options, { permissions: s = {} } = this.data || {};
317
+ return typeof e == "function" ? e(s) : te(e).every((o) => s[o] || s[t + o]);
318
318
  }
319
319
  some(e) {
320
- const { keyPrefix: t } = this.options, { permissions: n = {} } = this.data || {};
321
- return te(e).some((o) => n[o] || n[t + o]);
320
+ const { keyPrefix: t } = this.options, { permissions: s = {} } = this.data || {};
321
+ return te(e).some((o) => s[o] || s[t + o]);
322
322
  }
323
323
  install(e) {
324
324
  e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(_e, this);
325
325
  }
326
326
  isAuthPath(e) {
327
- const { auth: t, isAuth: n } = this.options;
328
- if (n)
329
- return n(e);
327
+ const { auth: t, isAuth: s } = this.options;
328
+ if (s)
329
+ return s(e);
330
330
  if (e.path && typeof t == "string") {
331
331
  const r = t.split("#")[1] || t;
332
332
  return e.path === r;
@@ -336,46 +336,46 @@ class bn {
336
336
  toLogin() {
337
337
  const { auth: e, redirectParam: t } = this.options;
338
338
  if (!e || this.mode !== _.Raw) return;
339
- const n = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
340
- typeof e == "function" ? e(n) : location.href = t ? `${e}${n}` : e;
339
+ const s = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
340
+ typeof e == "function" ? e(s) : location.href = t ? `${e}${s}` : e;
341
341
  }
342
342
  setData(e) {
343
343
  const { privateKey: t } = this.options;
344
344
  if (Array.isArray(e) && t) {
345
- const n = e.map((r) => ne(r, t));
346
- this.data = JSON.parse(n.join(""));
345
+ const s = e.map((r) => se(r, t));
346
+ this.data = JSON.parse(s.join(""));
347
347
  return;
348
348
  }
349
349
  if (typeof e == "string")
350
350
  try {
351
- const n = t ? ne(e, t) : e;
352
- n ? this.data = JSON.parse(n) : console.warn("RSA解密失败或登录信息缺失");
353
- } catch (n) {
354
- console.warn(n);
351
+ const s = t ? se(e, t) : e;
352
+ s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
353
+ } catch (s) {
354
+ console.warn(s);
355
355
  }
356
356
  else
357
357
  this.data = e;
358
358
  }
359
359
  loadData() {
360
- const { storageKey: e, storagePrefix: t } = this.options, n = B.get(e, {
360
+ const { storageKey: e, storagePrefix: t } = this.options, s = B.get(e, {
361
361
  type: "local",
362
362
  prefix: t
363
363
  });
364
- this.setData(n);
364
+ this.setData(s);
365
365
  }
366
366
  isLogined() {
367
367
  const { session: e, authKey: t } = this.options;
368
368
  return e && t ? !!U.get(t) : !!this.data;
369
369
  }
370
370
  hasRoutePermission(e) {
371
- if (e.name === W) {
371
+ if (e.name === G) {
372
372
  const t = e.params.id;
373
373
  return t && this.can(t);
374
374
  }
375
375
  return !0;
376
376
  }
377
377
  setGuard(e) {
378
- e.beforeEach((t, n, r) => this.guard(t, r));
378
+ e.beforeEach((t, s, r) => this.guard(t, r));
379
379
  }
380
380
  guard(e, t) {
381
381
  if (this.isWhiteList(e) || this.isAuthPath(e))
@@ -384,15 +384,15 @@ class bn {
384
384
  if (this.hasRoutePermission(e))
385
385
  return t();
386
386
  {
387
- const n = this.options.noPermissionMessage || "无权限访问";
388
- return this.showTip(n), t(!1);
387
+ const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
388
+ return this.showTip(s), q(r) ? (r(), t(!1)) : j(r) ? t(r) : t(!1);
389
389
  }
390
390
  }
391
391
  t(!1), this.toLogin();
392
392
  }
393
393
  isWhiteList(e) {
394
394
  const { whiteList: t } = this.options;
395
- return t ? Array.isArray(t) ? t.some((n) => e.fullPath.startsWith(n)) : t(e) : !1;
395
+ return t ? Array.isArray(t) ? t.some((s) => e.fullPath.startsWith(s)) : t(e) : !1;
396
396
  }
397
397
  isUnauthorized(e) {
398
398
  const { unauthorizedCode: t = 401 } = this.options;
@@ -404,17 +404,17 @@ class bn {
404
404
  }
405
405
  async showTip(e) {
406
406
  const { alert: t } = this.options;
407
- t && (await le(150), await t(e, {
407
+ return t ? (await le(150), await t(e, {
408
408
  title: "提示",
409
409
  type: "warning"
410
- }).catch((n) => n));
410
+ }).catch(() => !1)) : !1;
411
411
  }
412
412
  setRequest(e) {
413
413
  e.useRequest((t) => (this.data?.token && (t.headers[this.options.authKey] = this.data?.token), t)), e.useResponse(
414
414
  async (t) => (await this.showUnauthorizedAlert(t), t),
415
415
  async (t) => {
416
- const n = t.response || t || {};
417
- return await this.showUnauthorizedAlert(n), Promise.reject(t);
416
+ const s = t.response || t || {};
417
+ return await this.showUnauthorizedAlert(s), Promise.reject(t);
418
418
  }
419
419
  );
420
420
  }
@@ -448,14 +448,14 @@ class yt {
448
448
  $apis = {};
449
449
  __transform = {};
450
450
  constructor(e) {
451
- const { mode: t, dsl: n, attrs: r } = e;
452
- this.__mode = t, n && (this.__id = n.id || null, this.__transform = n.transform || {}), r && Object.assign(this, r);
451
+ const { mode: t, dsl: s, attrs: r } = e;
452
+ this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
453
453
  }
454
454
  setup(e, t = T) {
455
- const n = t.getCurrentInstance();
456
- if (!n) return;
457
- this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = n.proxy;
458
- const r = n.appContext.config.globalProperties;
455
+ const s = t.getCurrentInstance();
456
+ if (!s) return;
457
+ this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
458
+ const r = s.appContext.config.globalProperties;
459
459
  Object.assign(this, r), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
460
460
  this.__proxy();
461
461
  }), t.onUnmounted(() => {
@@ -477,59 +477,59 @@ class yt {
477
477
  __parseFunction(e) {
478
478
  if (e)
479
479
  if (this.__mode === _.Runtime) {
480
- const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
481
- return ie({ type: n, value: r }, this);
480
+ const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
481
+ return ie({ type: s, value: r }, this);
482
482
  } else
483
483
  return ie(e, this);
484
484
  }
485
485
  __parseExpression(e) {
486
486
  if (e)
487
487
  if (this.__mode === _.Runtime) {
488
- const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
489
- return k({ type: n, value: r }, this);
488
+ const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
489
+ return k({ type: s, value: r }, this);
490
490
  } else
491
491
  return k(e, this);
492
492
  }
493
493
  __ref(e = null, t) {
494
494
  if (this.__mode !== _.VNode)
495
- return e && e !== this.__id && (this.__contextRefs[e] = this), async (n) => {
495
+ return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
496
496
  await le(0);
497
- let r = n?.$vtjEl || n?.$el || n?._?.vnode?.el || n;
497
+ let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
498
498
  if (!r) {
499
499
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
500
500
  return;
501
501
  }
502
- if (r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, _.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = n), typeof t == "function")
503
- t(n);
502
+ if (r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, _.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = s), typeof t == "function")
503
+ t(s);
504
504
  else if (t) {
505
505
  const o = this.$refs[t];
506
- if (o && n !== o) {
507
- const a = new Set([].concat(o, n));
506
+ if (o && s !== o) {
507
+ const a = new Set([].concat(o, s));
508
508
  this.$refs[t] = Array.from(a);
509
509
  } else
510
- this.$refs[t] = n;
510
+ this.$refs[t] = s;
511
511
  }
512
- return n;
512
+ return s;
513
513
  };
514
514
  }
515
515
  __clone(e = {}) {
516
- const t = { ...this.context, ...e }, n = {
516
+ const t = { ...this.context, ...e }, s = {
517
517
  ...t,
518
518
  context: t
519
519
  };
520
- return n.context.__proto__ = this.context, n.__proto__ = this, n;
520
+ return s.context.__proto__ = this.context, s.__proto__ = this, s;
521
521
  }
522
522
  }
523
- function J(s) {
523
+ function V(n) {
524
524
  const {
525
525
  Vue: e = T,
526
526
  mode: t = _.Runtime,
527
- components: n = {},
527
+ components: s = {},
528
528
  libs: r = {},
529
529
  apis: o = {},
530
530
  loader: a
531
- } = s, i = e.computed(() => s.dsl), l = {
532
- $components: n,
531
+ } = n, i = e.computed(() => n.dsl), l = {
532
+ $components: s,
533
533
  $libs: r,
534
534
  $apis: o
535
535
  }, c = new yt({
@@ -543,7 +543,7 @@ function J(s) {
543
543
  },
544
544
  setup(d) {
545
545
  c.$props = d, c.props = d, i.value.id && ve(
546
- s.window || window,
546
+ n.window || window,
547
547
  i.value.id,
548
548
  i.value.css || ""
549
549
  ), c.state = St(e, i.value.state ?? {}, c);
@@ -574,66 +574,66 @@ function J(s) {
574
574
  context: c
575
575
  };
576
576
  }
577
- function _t(s = []) {
578
- return s.map((e) => j(e) ? e : e.name);
577
+ function _t(n = []) {
578
+ return n.map((e) => j(e) ? e : e.name);
579
579
  }
580
- function wt(s = [], e) {
581
- const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((o) => et[o]) : void 0;
582
- return s.map((n) => j(n) ? {
583
- name: n
580
+ function wt(n = [], e) {
581
+ const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => et[o]) : void 0;
582
+ return n.map((s) => j(s) ? {
583
+ name: s
584
584
  } : {
585
- name: n.name,
586
- type: n.type,
587
- required: n.required,
588
- default: S(n.default) ? e.__parseExpression(n.default) : n.default
585
+ name: s.name,
586
+ type: s.type,
587
+ required: s.required,
588
+ default: S(s.default) ? e.__parseExpression(s.default) : s.default
589
589
  }).reduce(
590
- (n, r) => (n[r.name] = {
590
+ (s, r) => (s[r.name] = {
591
591
  type: t(r.type),
592
592
  required: r.required,
593
593
  default: r.default
594
- }, n),
594
+ }, s),
595
595
  {}
596
596
  );
597
597
  }
598
- function St(s, e, t) {
599
- return s.reactive(
598
+ function St(n, e, t) {
599
+ return n.reactive(
600
600
  Object.keys(e || {}).reduce(
601
- (n, r) => {
601
+ (s, r) => {
602
602
  let o = e[r];
603
- return S(o) ? o = t.__parseExpression(o) : H(o) && (o = t.__parseFunction(o)), n[r] = o, n;
603
+ return S(o) ? o = t.__parseExpression(o) : H(o) && (o = t.__parseFunction(o)), s[r] = o, s;
604
604
  },
605
605
  {}
606
606
  )
607
607
  );
608
608
  }
609
- function jt(s, e, t) {
609
+ function jt(n, e, t) {
610
610
  return Object.entries(e ?? {}).reduce(
611
- (n, [r, o]) => (n[r] = s.computed(t.__parseFunction(o)), n),
611
+ (s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
612
612
  {}
613
613
  );
614
614
  }
615
- function $t(s, e) {
616
- return Object.entries(s ?? {}).reduce(
617
- (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
615
+ function $t(n, e) {
616
+ return Object.entries(n ?? {}).reduce(
617
+ (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
618
618
  {}
619
619
  );
620
620
  }
621
- function bt(s, e = [], t) {
621
+ function bt(n, e = [], t) {
622
622
  return e.reduce(
623
- (n, r) => {
623
+ (s, r) => {
624
624
  const { name: o, from: a } = r || {};
625
625
  r.default;
626
626
  const i = S(a) ? t.__parseExpression(a) || o : a ?? o, l = S(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
627
- return n[o] = s.inject(i, l), n;
627
+ return s[o] = n.inject(i, l), s;
628
628
  },
629
629
  {}
630
630
  );
631
631
  }
632
- function Et(s, e) {
633
- return Object.keys(s).reduce(
634
- (t, n) => {
635
- const r = s[n], o = e.$apis[r.ref], a = H(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
636
- return t[n] = async (...i) => {
632
+ function Et(n, e) {
633
+ return Object.keys(n).reduce(
634
+ (t, s) => {
635
+ const r = n[s], o = e.$apis[r.ref], a = H(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
636
+ return t[s] = async (...i) => {
637
637
  const l = await o.apply(e, i);
638
638
  return a ? a(l) : l;
639
639
  }, t;
@@ -641,76 +641,76 @@ function Et(s, e) {
641
641
  {}
642
642
  );
643
643
  }
644
- function Pt(s, e = [], t) {
645
- e.forEach((n) => {
646
- s.watch(
647
- t.__parseExpression(n.source),
648
- t.__parseFunction(n.handler),
644
+ function Pt(n, e = [], t) {
645
+ e.forEach((s) => {
646
+ n.watch(
647
+ t.__parseExpression(s.source),
648
+ t.__parseFunction(s.handler),
649
649
  {
650
- deep: n.deep,
651
- immediate: n.immediate
650
+ deep: s.deep,
651
+ immediate: s.immediate
652
652
  }
653
653
  );
654
654
  });
655
655
  }
656
- function xt(s, e) {
657
- return Object.entries(s ?? {}).reduce(
658
- (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
656
+ function xt(n, e) {
657
+ return Object.entries(n ?? {}).reduce(
658
+ (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
659
659
  {}
660
660
  );
661
661
  }
662
662
  let L = [];
663
- const Rt = (s) => s;
664
- async function we(s, e = window) {
665
- const { urls: t = [], library: n } = s, r = t.filter((i) => Y(i));
666
- if (r.length === 0 || !n) return null;
667
- const o = t.filter((i) => G(i));
668
- return o.length && it(o, e), await at(r, n, e).catch(
669
- (i) => (console.warn("loadScriptUrl error", r, n, i), null)
663
+ const Rt = (n) => n;
664
+ async function we(n, e = window) {
665
+ const { urls: t = [], library: s } = n, r = t.filter((i) => Q(i));
666
+ if (r.length === 0 || !s) return null;
667
+ const o = t.filter((i) => Y(i));
668
+ return o.length && it(o, e), await at(r, s, e).catch(
669
+ (i) => (console.warn("loadScriptUrl error", r, s, i), null)
670
670
  );
671
671
  }
672
- function V(s) {
673
- const { getDsl: e, getDslByUrl: t, options: n } = s;
674
- return n.window && (L.forEach((r) => {
675
- delete n.window[r];
672
+ function z(n) {
673
+ const { getDsl: e, getDslByUrl: t, options: s } = n;
674
+ return s.window && (L.forEach((r) => {
675
+ delete s.window[r];
676
676
  }), L = []), (r, o, a = T) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
677
677
  const i = await e(o.id);
678
- return i && (i.name = r), i ? J({
679
- ...n,
678
+ return i && (i.name = r), i ? V({
679
+ ...s,
680
680
  Vue: a,
681
681
  dsl: i,
682
682
  mode: _.Runtime,
683
- loader: V(s)
683
+ loader: z(n)
684
684
  }).renderer : null;
685
685
  }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
686
686
  const i = await t(o.url);
687
- return i && (i.name = r), i ? J({
688
- ...n,
687
+ return i && (i.name = r), i ? V({
688
+ ...s,
689
689
  Vue: a,
690
690
  dsl: i,
691
691
  mode: _.Runtime,
692
- loader: V(s)
692
+ loader: z(n)
693
693
  }).renderer : null;
694
694
  }) : o.type === "Plugin" ? (o.library && L.push(o.library), a.defineAsyncComponent(async () => {
695
- const i = await we(o, n.window);
695
+ const i = await we(o, s.window);
696
696
  return i || (console.warn("getPlugin result is null", o), null);
697
697
  })) : r;
698
698
  }
699
- function M(s, e, t = T, n = Rt) {
700
- if (!s || !s.name || s.invisible) return null;
701
- const { id: r = null, directives: o = [] } = s, { vIf: a, vFor: i, vShow: l, vModels: c, vBind: f } = kt(o);
699
+ function M(n, e, t = T, s = Rt) {
700
+ if (!n || !n.name || n.invisible) return null;
701
+ const { id: r = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: l, vModels: c, vBind: f } = kt(o);
702
702
  if (a && !Ct(a, e))
703
703
  return null;
704
704
  const d = (u) => {
705
705
  const h = u.$components, p = (() => {
706
- if (s.name === "component")
707
- return Ft(u, s.props?.is);
708
- if (s.name === "slot") return s.name;
709
- const v = n(s.name, s.from, t);
706
+ if (n.name === "component")
707
+ return Ft(u, n.props?.is);
708
+ if (n.name === "slot") return n.name;
709
+ const v = s(n.name, n.from, t);
710
710
  return j(v) ? h[v] ?? v : v;
711
- })(), m = At(r, s.props ?? {}, u), w = It(t, s.events ?? {}, u);
712
- if (s.name === "slot")
713
- return Ot(t, s, m, u, n);
711
+ })(), m = At(r, n.props ?? {}, u), w = It(t, n.events ?? {}, u);
712
+ if (n.name === "slot")
713
+ return Ot(t, n, m, u, s);
714
714
  f && Object.assign(m, u.__parseExpression(f.value)), l && (m.style = Object.assign(
715
715
  m.style ?? {},
716
716
  Tt(l, u)
@@ -719,95 +719,95 @@ function M(s, e, t = T, n = Rt) {
719
719
  });
720
720
  const g = Ht(
721
721
  t,
722
- s.children ?? [],
722
+ n.children ?? [],
723
723
  u,
724
- n,
725
- s
724
+ s,
725
+ n
726
726
  );
727
727
  return t.createVNode(p, { ...m, ...w }, g);
728
728
  };
729
729
  return i ? Nt(i, d, e) : d(e);
730
730
  }
731
- function kt(s = []) {
732
- const e = s.find((i) => $(i.name) === "vIf"), t = s.find((i) => $(i.name) === "vFor"), n = s.find((i) => $(i.name) === "vShow"), r = s.find((i) => $(i.name) === "vBind"), o = s.filter((i) => $(i.name) === "vModel"), a = s.filter(
731
+ function kt(n = []) {
732
+ const e = n.find((i) => $(i.name) === "vIf"), t = n.find((i) => $(i.name) === "vFor"), s = n.find((i) => $(i.name) === "vShow"), r = n.find((i) => $(i.name) === "vBind"), o = n.filter((i) => $(i.name) === "vModel"), a = n.filter(
733
733
  (i) => !Ze.includes($(i.name))
734
734
  );
735
735
  return {
736
736
  vIf: e,
737
737
  vFor: t,
738
- vShow: n,
738
+ vShow: s,
739
739
  vModels: o,
740
740
  vBind: r,
741
741
  others: a
742
742
  };
743
743
  }
744
- function Ct(s, e) {
745
- return !!e.__parseExpression(s.value);
744
+ function Ct(n, e) {
745
+ return !!e.__parseExpression(n.value);
746
746
  }
747
- function Ft(s, e) {
748
- return e ? S(e) ? s.__parseExpression(e) : e : "div";
747
+ function Ft(n, e) {
748
+ return e ? S(e) ? n.__parseExpression(e) : e : "div";
749
749
  }
750
- function At(s, e, t) {
751
- const n = Object.keys(e || {}).reduce(
750
+ function At(n, e, t) {
751
+ const s = Object.keys(e || {}).reduce(
752
752
  (r, o) => {
753
753
  let a = e[o];
754
754
  return S(a) ? a = t.__parseExpression(a) : H(a) && (a = t.__parseFunction(a)), r[o] = a, r;
755
755
  },
756
756
  {}
757
757
  );
758
- return n.ref = t.__ref(s, n.ref), n;
758
+ return s.ref = t.__ref(n, s.ref), s;
759
759
  }
760
- function It(s, e, t) {
761
- const n = ["passive", "capture", "once"], r = {
760
+ function It(n, e, t) {
761
+ const s = ["passive", "capture", "once"], r = {
762
762
  capture: "Capture",
763
763
  once: "Once",
764
764
  passive: "OnceCapture"
765
765
  };
766
766
  return Object.keys(e || {}).reduce(
767
767
  (o, a) => {
768
- const i = e[a], l = Se(i.modifiers), c = l.find((u) => n.includes(u)), f = "on" + Te(a) + (c && r[c] || ""), d = t.__parseFunction(i.handler);
769
- return d && (o[f] = s.withModifiers(d, l)), o;
768
+ const i = e[a], l = Se(i.modifiers), c = l.find((u) => s.includes(u)), f = "on" + Te(a) + (c && r[c] || ""), d = t.__parseFunction(i.handler);
769
+ return d && (o[f] = n.withModifiers(d, l)), o;
770
770
  },
771
771
  {}
772
772
  );
773
773
  }
774
- function Se(s = {}, e = !1) {
775
- const t = Object.keys(s);
776
- return e ? t.map((n) => "." + n) : t;
774
+ function Se(n = {}, e = !1) {
775
+ const t = Object.keys(n);
776
+ return e ? t.map((s) => "." + s) : t;
777
777
  }
778
- function Ot(s, e, t, n, r) {
779
- const { children: o } = e, a = Mt(e, n), i = n.$slots?.[a.name];
780
- return i ? i(t) : o ? j(o) ? s.createTextVNode(o) : S(o) ? s.createTextVNode(
781
- ge(n.__parseExpression(o))
778
+ function Ot(n, e, t, s, r) {
779
+ const { children: o } = e, a = Mt(e, s), i = s.$slots?.[a.name];
780
+ return i ? i(t) : o ? j(o) ? n.createTextVNode(o) : S(o) ? n.createTextVNode(
781
+ ge(s.__parseExpression(o))
782
782
  ) : Array.isArray(o) ? o.map(
783
- (l) => M(l, n, s, r)
783
+ (l) => M(l, s, n, r)
784
784
  ) : null : null;
785
785
  }
786
- function Mt(s, e) {
787
- const { props: t } = s, n = t?.name || "default";
786
+ function Mt(n, e) {
787
+ const { props: t } = n, s = t?.name || "default";
788
788
  return {
789
- name: S(n) ? e.__parseExpression(n) : n,
789
+ name: S(s) ? e.__parseExpression(s) : s,
790
790
  params: []
791
791
  };
792
792
  }
793
- function Tt(s, e) {
794
- return e.__parseExpression(s.value) ? {} : {
793
+ function Tt(n, e) {
794
+ return e.__parseExpression(n.value) ? {} : {
795
795
  display: "none"
796
796
  };
797
797
  }
798
- function Dt(s, e, t) {
799
- const n = {
798
+ function Dt(n, e, t) {
799
+ const s = {
800
800
  type: "JSFunction",
801
801
  value: e.value?.value ? `(v) => {
802
802
  ${e.value.value} = v;
803
803
  }` : "(v) => {}"
804
- }, r = t.__parseFunction(n), o = Se(e.modifiers), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
804
+ }, r = t.__parseFunction(s), o = Se(e.modifiers), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
805
805
  return {
806
806
  [a]: t.__parseExpression(e.value),
807
- [`onUpdate:${a}`]: o.length && r ? s.withModifiers(r, o) : r
807
+ [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
808
808
  };
809
809
  }
810
- function Ht(s, e, t, n, r) {
810
+ function Ht(n, e, t, s, r) {
811
811
  if (!e) return null;
812
812
  if (j(e))
813
813
  return { default: () => e };
@@ -822,81 +822,81 @@ function Ht(s, e, t, n, r) {
822
822
  return Object.entries(o).reduce((i, [l, { nodes: c, params: f }]) => (i[l] = (d) => {
823
823
  const u = f.length ? De(d ?? {}, f) : a(d);
824
824
  return c.map(
825
- (h) => M(h, t.__clone(u), s, n)
825
+ (h) => M(h, t.__clone(u), n, s)
826
826
  );
827
827
  }, i), {});
828
828
  }
829
829
  return null;
830
830
  }
831
- function Bt(s) {
831
+ function Bt(n) {
832
832
  const e = {
833
833
  default: {
834
834
  params: [],
835
835
  nodes: []
836
836
  }
837
837
  };
838
- for (const t of s) {
839
- const n = Ut(t.slot), r = n.name;
840
- e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(n.params)) : e[r] = {
838
+ for (const t of n) {
839
+ const s = Ut(t.slot), r = s.name;
840
+ e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
841
841
  nodes: [t],
842
- params: n.params
842
+ params: s.params
843
843
  };
844
844
  }
845
845
  return e;
846
846
  }
847
- function Ut(s = "default") {
848
- return j(s) ? { name: s, params: [] } : { params: [], ...s };
847
+ function Ut(n = "default") {
848
+ return j(n) ? { name: n, params: [] } : { params: [], ...n };
849
849
  }
850
- function Nt(s, e, t) {
851
- const { value: n, iterator: r } = s, { item: o = "item", index: a = "index" } = r || {};
852
- let i = t.__parseExpression(n) || [];
853
- return Number.isInteger(i) && (i = new Array(i).fill(!0).map((l, c) => c + 1)), Array.isArray(i) ? i.map((l, c) => e(t.__clone({ [o]: l, [a]: c }))) : (console.warn("[vForRender]:", `${n?.value} is not a Arrary`), []);
850
+ function Nt(n, e, t) {
851
+ const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
852
+ let i = t.__parseExpression(s) || [];
853
+ return Number.isInteger(i) && (i = new Array(i).fill(!0).map((l, c) => c + 1)), Array.isArray(i) ? i.map((l, c) => e(t.__clone({ [o]: l, [a]: c }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
854
854
  }
855
- function Lt(s) {
856
- return Ve() ? (ze(s), !0) : !1;
855
+ function Lt(n) {
856
+ return Ve() ? (ze(n), !0) : !1;
857
857
  }
858
- function Q(s) {
859
- return typeof s == "function" ? s() : Ke(s);
858
+ function X(n) {
859
+ return typeof n == "function" ? n() : Ke(n);
860
860
  }
861
861
  const je = typeof window < "u" && typeof document < "u";
862
862
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
863
- const qt = (s) => s != null, Jt = () => {
863
+ const qt = (n) => n != null, Jt = () => {
864
864
  };
865
- function Vt(s) {
865
+ function Vt(n) {
866
866
  return de();
867
867
  }
868
- function zt(...s) {
869
- if (s.length !== 1)
870
- return Ne(...s);
871
- const e = s[0];
868
+ function zt(...n) {
869
+ if (n.length !== 1)
870
+ return Ne(...n);
871
+ const e = n[0];
872
872
  return typeof e == "function" ? Le(qe(() => ({ get: e, set: Jt }))) : O(e);
873
873
  }
874
- function Kt(s, e) {
875
- Vt() && Je(s, e);
874
+ function Kt(n, e) {
875
+ Vt() && Je(n, e);
876
876
  }
877
877
  const Wt = je ? window : void 0, Gt = je ? window.document : void 0;
878
- function Yt(s) {
878
+ function Yt(n) {
879
879
  var e;
880
- const t = Q(s);
880
+ const t = X(n);
881
881
  return (e = t?.$el) != null ? e : t;
882
882
  }
883
883
  function Qt() {
884
- const s = O(!1), e = de();
884
+ const n = O(!1), e = de();
885
885
  return e && We(() => {
886
- s.value = !0;
887
- }, e), s;
886
+ n.value = !0;
887
+ }, e), n;
888
888
  }
889
- function Xt(s) {
889
+ function Xt(n) {
890
890
  const e = Qt();
891
- return fe(() => (e.value, !!s()));
891
+ return fe(() => (e.value, !!n()));
892
892
  }
893
- function Zt(s, e, t = {}) {
894
- const { window: n = Wt, ...r } = t;
893
+ function Zt(n, e, t = {}) {
894
+ const { window: s = Wt, ...r } = t;
895
895
  let o;
896
- const a = Xt(() => n && "MutationObserver" in n), i = () => {
896
+ const a = Xt(() => s && "MutationObserver" in s), i = () => {
897
897
  o && (o.disconnect(), o = void 0);
898
898
  }, l = fe(() => {
899
- const u = Q(s), h = (Array.isArray(u) ? u : [u]).map(Yt).filter(qt);
899
+ const u = X(n), h = (Array.isArray(u) ? u : [u]).map(Yt).filter(qt);
900
900
  return new Set(h);
901
901
  }), c = pe(
902
902
  () => l.value,
@@ -913,17 +913,17 @@ function Zt(s, e, t = {}) {
913
913
  takeRecords: f
914
914
  };
915
915
  }
916
- function en(s = null, e = {}) {
917
- var t, n, r;
916
+ function es(n = null, e = {}) {
917
+ var t, s, r;
918
918
  const {
919
919
  document: o = Gt,
920
920
  restoreOnUnmount: a = (d) => d
921
- } = e, i = (t = o?.title) != null ? t : "", l = zt((n = s ?? o?.title) != null ? n : null), c = s && typeof s == "function";
921
+ } = e, i = (t = o?.title) != null ? t : "", l = zt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
922
922
  function f(d) {
923
923
  if (!("titleTemplate" in e))
924
924
  return d;
925
925
  const u = e.titleTemplate || "%s";
926
- return typeof u == "function" ? u(d) : Q(u).replace(/%s/g, d);
926
+ return typeof u == "function" ? u(d) : X(u).replace(/%s/g, d);
927
927
  }
928
928
  return pe(
929
929
  l,
@@ -944,45 +944,45 @@ function en(s = null, e = {}) {
944
944
  }
945
945
  }), l;
946
946
  }
947
- const ae = K({
947
+ const ae = W({
948
948
  name: "VtjPageContainer",
949
949
  async setup() {
950
- const s = be(), e = he(), t = e.params.id, n = t ? s.getPage(t) : s.getHomepage(), r = n ? await s.getRenderComponent(n.id) : null;
951
- return n && (Object.assign(e.meta, n.meta || {}), en(n.title || "VTJ")), {
952
- provider: s,
950
+ const n = be(), e = he(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null;
951
+ return s && (Object.assign(e.meta, s.meta || {}), es(s.title || "VTJ")), {
952
+ provider: n,
953
953
  component: r,
954
- file: n,
954
+ file: s,
955
955
  query: e.query,
956
- meta: n?.meta
956
+ meta: s?.meta
957
957
  };
958
958
  },
959
959
  render() {
960
- const { component: s, query: e } = this;
961
- return s ? q(s, e) : q("div", "页面不存在");
960
+ const { component: n, query: e } = this;
961
+ return n ? J(n, e) : J("div", "页面不存在");
962
962
  }
963
- }), tn = {
963
+ }), ts = {
964
964
  "data-l-h6o7ki7": "",
965
965
  class: "vtj-startup__wrapper"
966
- }, nn = {
966
+ }, ss = {
967
967
  "data-l-h6o7ki7": "",
968
968
  class: "vtj-startup"
969
- }, sn = {
969
+ }, ns = {
970
970
  "data-l-h6o7ki7": "",
971
971
  class: "vtj-startup__name"
972
- }, rn = { "data-l-h6o7ki7": "" }, on = {
972
+ }, rs = { "data-l-h6o7ki7": "" }, os = {
973
973
  "data-l-h6o7ki7": "",
974
974
  class: "vtj-startup__tagline"
975
- }, an = {
975
+ }, is = {
976
976
  "data-l-h6o7ki7": "",
977
977
  class: "vtj-startup__actions"
978
- }, cn = /* @__PURE__ */ K({
978
+ }, as = /* @__PURE__ */ W({
979
979
  __name: "Startup",
980
980
  props: {
981
981
  name: { default: "VTJ.PRO" },
982
982
  tagline: { default: "基于 Vue3 + TypeScript 快速打造高生产力的低代码研发平台" },
983
983
  actionText: { default: "开始设计" }
984
984
  },
985
- setup(s) {
985
+ setup(n) {
986
986
  ((r, o) => {
987
987
  let a = document.getElementById("h6o7ki7");
988
988
  a || (a = document.createElement("style"), a.id = "h6o7ki7", document.head.appendChild(a), a.innerHTML = o);
@@ -1052,40 +1052,40 @@ const ae = K({
1052
1052
  .vtj-startup__actions button[data-l-h6o7ki7]:hover{
1053
1053
  opacity: 0.7;
1054
1054
  }`);
1055
- const t = s, n = () => {
1055
+ const t = n, s = () => {
1056
1056
  if (typeof window < "u") {
1057
1057
  let o = (window.__VTJ_LINK__ || {}).href || window.location.pathname + "__vtj__/#/";
1058
1058
  window.location.href = o;
1059
1059
  }
1060
1060
  };
1061
- return (r, o) => (Ge(), Ye("div", tn, [
1062
- b("div", nn, [
1063
- b("h1", sn, [
1064
- b("span", rn, N(t.name), 1)
1061
+ return (r, o) => (Ge(), Ye("div", ts, [
1062
+ b("div", ss, [
1063
+ b("h1", ns, [
1064
+ b("span", rs, N(t.name), 1)
1065
1065
  ]),
1066
- b("div", on, N(t.tagline), 1),
1067
- b("div", an, [
1066
+ b("div", os, N(t.tagline), 1),
1067
+ b("div", is, [
1068
1068
  b("button", {
1069
1069
  "data-l-h6o7ki7": "",
1070
- onClick: n
1070
+ onClick: s
1071
1071
  }, N(t.actionText), 1)
1072
1072
  ])
1073
1073
  ])
1074
1074
  ]));
1075
1075
  }
1076
- }), ln = K({
1076
+ }), cs = W({
1077
1077
  name: "VtjStartupContainer",
1078
1078
  render() {
1079
- return q(cn);
1079
+ return J(as);
1080
1080
  }
1081
1081
  }), $e = Symbol("Provider");
1082
- var un = /* @__PURE__ */ ((s) => (s.Production = "production", s.Development = "development", s))(un || {});
1083
- class dn extends xe {
1082
+ var ls = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(ls || {});
1083
+ class us extends xe {
1084
1084
  constructor(e) {
1085
1085
  super(), this.options = e;
1086
1086
  const {
1087
1087
  service: t,
1088
- mode: n = _.Raw,
1088
+ mode: s = _.Raw,
1089
1089
  dependencies: r,
1090
1090
  materials: o,
1091
1091
  project: a = {},
@@ -1097,9 +1097,9 @@ class dn extends xe {
1097
1097
  nodeEnv: u = "development"
1098
1098
  /* Development */
1099
1099
  } = e;
1100
- this.mode = n, this.modules = c, this.service = t, this.router = f, this.materialPath = d, this.nodeEnv = u, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i);
1100
+ this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = d, this.nodeEnv = u, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i);
1101
1101
  const { access: h, request: p } = this.adapter;
1102
- h && h.connect({ mode: n, router: f, request: p }), n !== _.Design && this.load(a);
1102
+ h && h.connect({ mode: s, router: f, request: p }), s !== _.Design && this.load(a);
1103
1103
  }
1104
1104
  mode;
1105
1105
  globals = {};
@@ -1120,29 +1120,29 @@ class dn extends xe {
1120
1120
  const t = this.modules[`.vtj/projects/${e.id}.json`];
1121
1121
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
1122
1122
  throw new Error("project is null");
1123
- const { apis: n = [], meta: r = [] } = this.project, o = window;
1124
- o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = ft(n, r, this.adapter), ye(), this.project.config?.mock && ht(n), this.initRouter(), this.triggerReady();
1123
+ const { apis: s = [], meta: r = [] } = this.project, o = window;
1124
+ o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = ft(s, r, this.adapter), ye(), this.project.config?.mock && ht(s), this.initRouter(), this.triggerReady();
1125
1125
  }
1126
1126
  async loadDependencies(e) {
1127
1127
  const t = Object.entries(this.dependencies);
1128
- for (const [n, r] of t)
1129
- e[n] || (e[n] = await r());
1128
+ for (const [s, r] of t)
1129
+ e[s] || (e[s] = await r());
1130
1130
  }
1131
1131
  async loadAssets(e) {
1132
- const { dependencies: t = [] } = this.project, { dependencies: n, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1132
+ const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1133
1133
  libraryExports: l,
1134
1134
  libraryMap: c,
1135
1135
  materials: f,
1136
1136
  materialExports: d,
1137
1137
  materialMapLibrary: u
1138
- } = st(
1138
+ } = nt(
1139
1139
  t,
1140
1140
  a,
1141
1141
  i === "development"
1142
1142
  /* Development */
1143
1143
  );
1144
1144
  for (const p of l) {
1145
- const m = n[p], w = e[p];
1145
+ const m = s[p], w = e[p];
1146
1146
  if (w)
1147
1147
  r[p] = w;
1148
1148
  else if (m)
@@ -1150,12 +1150,12 @@ class dn extends xe {
1150
1150
  else {
1151
1151
  const g = c[p] || [];
1152
1152
  for (const v of g)
1153
- G(v) && await ot(p, x.append(v, { v: R })), Y(v) && await se(x.append(v, { v: R }));
1153
+ Y(v) && await ot(p, x.append(v, { v: R })), Q(v) && await ne(x.append(v, { v: R }));
1154
1154
  r[p] = e[p];
1155
1155
  }
1156
1156
  }
1157
1157
  for (const p of f)
1158
- await se(x.append(p, { v: R }));
1158
+ await ne(x.append(p, { v: R }));
1159
1159
  const h = this.materials || {};
1160
1160
  for (const p of d) {
1161
1161
  const m = e[u[p]], w = Re[p];
@@ -1172,34 +1172,34 @@ class dn extends xe {
1172
1172
  }
1173
1173
  }
1174
1174
  initRouter() {
1175
- const { router: e, project: t, options: n } = this;
1175
+ const { router: e, project: t, options: s } = this;
1176
1176
  if (!e) return;
1177
- const { routeParentName: r, pageRouteName: o = "page", routeMeta: a } = n, i = {
1177
+ const { routeParentName: r, pageRouteName: o = "page", routeMeta: a } = s, i = {
1178
1178
  path: `/${o}/:id`,
1179
- name: W,
1179
+ name: G,
1180
1180
  component: ae
1181
1181
  }, l = {
1182
1182
  path: "/",
1183
1183
  name: me,
1184
- component: t?.homepage ? ae : ln,
1184
+ component: t?.homepage ? ae : cs,
1185
1185
  meta: a
1186
1186
  };
1187
1187
  r ? (e.addRoute(r, i), e.addRoute(r, l)) : (e.addRoute(i), e.addRoute(l));
1188
1188
  }
1189
1189
  install(e) {
1190
1190
  const t = e.config.globalProperties.installed || {};
1191
- for (const [n, r] of Object.entries(this.library))
1192
- !t[n] && ct(r) && (e.use(r), t[n] = !0);
1193
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide($e, this), e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (n, r, o) => {
1194
- const a = r?.$options.name, i = typeof n == "string" ? n : n?.message || n?.msg || "未知错误", l = `[ ${a} ] ${i} ${o}`;
1191
+ for (const [s, r] of Object.entries(this.library))
1192
+ !t[s] && ct(r) && (e.use(r), t[s] = !0);
1193
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide($e, this), e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
1194
+ const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", l = `[ ${a} ] ${i} ${o}`;
1195
1195
  console.error(
1196
1196
  "[VTJ Error]:",
1197
1197
  {
1198
- err: n,
1198
+ err: s,
1199
1199
  instance: r,
1200
1200
  info: o
1201
1201
  },
1202
- n?.stack
1202
+ s?.stack
1203
1203
  ), D.error({
1204
1204
  title: "未处理的异常:请在控制台查看详情",
1205
1205
  message: l
@@ -1208,21 +1208,21 @@ class dn extends xe {
1208
1208
  }
1209
1209
  getFile(e) {
1210
1210
  const { blocks: t = [] } = this.project || {};
1211
- return this.getPage(e) || t.find((n) => n.id === e) || null;
1211
+ return this.getPage(e) || t.find((s) => s.id === e) || null;
1212
1212
  }
1213
1213
  getPage(e) {
1214
- const { pages: t = [] } = this.project || {}, n = (r, o = []) => {
1214
+ const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
1215
1215
  for (const a of o) {
1216
1216
  if (a.id === r)
1217
1217
  return a;
1218
1218
  if (a.children && a.children.length) {
1219
- const i = n(r, a.children);
1219
+ const i = s(r, a.children);
1220
1220
  if (i)
1221
1221
  return i;
1222
1222
  }
1223
1223
  }
1224
1224
  };
1225
- return n(e, t) || null;
1225
+ return s(e, t) || null;
1226
1226
  }
1227
1227
  getHomepage() {
1228
1228
  const { homepage: e } = this.project || {};
@@ -1241,65 +1241,65 @@ class dn extends xe {
1241
1241
  validSuccess: !1,
1242
1242
  originResponse: !0
1243
1243
  }
1244
- }).then((n) => n.data).catch(() => null));
1244
+ }).then((s) => s.data).catch(() => null));
1245
1245
  }
1246
1246
  createDslRenderer(e, t = {}) {
1247
- const { library: n, components: r, mode: o, apis: a } = this, i = {
1247
+ const { library: s, components: r, mode: o, apis: a } = this, i = {
1248
1248
  mode: o,
1249
- Vue: n.Vue,
1249
+ Vue: s.Vue,
1250
1250
  components: r,
1251
- libs: n,
1251
+ libs: s,
1252
1252
  apis: a,
1253
1253
  window,
1254
1254
  ...t
1255
- }, l = V({
1255
+ }, l = z({
1256
1256
  getDsl: async (c) => await this.getDsl(c) || null,
1257
1257
  getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
1258
1258
  options: i
1259
1259
  });
1260
- return J({
1260
+ return V({
1261
1261
  ...i,
1262
1262
  dsl: e,
1263
1263
  loader: l
1264
1264
  });
1265
1265
  }
1266
1266
  async getRenderComponent(e, t) {
1267
- const n = this.getFile(e);
1268
- if (!n)
1267
+ const s = this.getFile(e);
1268
+ if (!s)
1269
1269
  return I.warn(`Can not find file: ${e}`), null;
1270
- t && t(n);
1270
+ t && t(s);
1271
1271
  const r = `.vtj/vue/${e}.vue`, o = this.modules[r];
1272
1272
  if (o)
1273
1273
  return (await o())?.default;
1274
- const a = await this.getDsl(n.id);
1274
+ const a = await this.getDsl(s.id);
1275
1275
  return a ? this.createDslRenderer(a).renderer : (I.warn(`Can not find dsl: ${e}`), null);
1276
1276
  }
1277
1277
  defineUrlSchemaComponent(e, t) {
1278
1278
  return re(async () => {
1279
- const n = await this.getDslByUrl(e);
1280
- return n ? (n.name = t || n.name, this.createDslRenderer(n).renderer) : null;
1279
+ const s = await this.getDslByUrl(e);
1280
+ return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1281
1281
  });
1282
1282
  }
1283
1283
  definePluginComponent(e) {
1284
1284
  return re(async () => await we(e, window));
1285
1285
  }
1286
1286
  }
1287
- function En(s) {
1288
- const e = new dn(s);
1287
+ function bs(n) {
1288
+ const e = new us(n);
1289
1289
  return {
1290
1290
  provider: e,
1291
- onReady: (n) => e.ready(n)
1291
+ onReady: (s) => e.ready(s)
1292
1292
  };
1293
1293
  }
1294
- function be(s = {}) {
1294
+ function be(n = {}) {
1295
1295
  const e = ue($e);
1296
1296
  if (!e)
1297
1297
  throw new Error("Can not find provider");
1298
1298
  if (e.nodeEnv === "development") {
1299
- const { id: t, version: n } = s;
1300
- t && n && (async () => {
1299
+ const { id: t, version: s } = n;
1300
+ t && s && (async () => {
1301
1301
  const r = await e.getDsl(t);
1302
- r?.__VERSION__ !== n && D.warning({
1302
+ r?.__VERSION__ !== s && D.warning({
1303
1303
  title: r?.name,
1304
1304
  message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
1305
1305
  });
@@ -1307,29 +1307,29 @@ function be(s = {}) {
1307
1307
  }
1308
1308
  return e;
1309
1309
  }
1310
- const X = new Be({
1310
+ const Z = new Be({
1311
1311
  settings: {
1312
1312
  type: "json",
1313
1313
  validSuccess: !0,
1314
1314
  originResponse: !1,
1315
1315
  failMessage: !0,
1316
- validate: (s) => s.data?.code === 0,
1317
- showError: (s) => {
1316
+ validate: (n) => n.data?.code === 0,
1317
+ showError: (n) => {
1318
1318
  D.error({
1319
- message: s || "未知错误"
1319
+ message: n || "未知错误"
1320
1320
  });
1321
1321
  }
1322
1322
  }
1323
- }), pn = (s = "/__vtj__/api/:type.json") => (e, t) => X.send({
1324
- url: s,
1323
+ }), ds = (n = "/__vtj__/api/:type.json") => (e, t) => Z.send({
1324
+ url: n,
1325
1325
  method: "post",
1326
1326
  params: { type: e },
1327
1327
  data: {
1328
1328
  type: e,
1329
1329
  data: t
1330
1330
  }
1331
- }), fn = (s = "/__vtj__/api/uploader.json") => async (e, t) => await X.send({
1332
- url: s,
1331
+ }), ps = (n = "/__vtj__/api/uploader.json") => async (e, t) => await Z.send({
1332
+ url: n,
1333
1333
  method: "post",
1334
1334
  data: {
1335
1335
  files: e,
@@ -1338,13 +1338,13 @@ const X = new Be({
1338
1338
  settings: {
1339
1339
  type: "data"
1340
1340
  }
1341
- }).then((n) => n && n[0] ? n[0] : null).catch(() => null);
1342
- class Z {
1341
+ }).then((s) => s && s[0] ? s[0] : null).catch(() => null);
1342
+ class ee {
1343
1343
  api;
1344
1344
  pluginCaches = {};
1345
1345
  uploader;
1346
1346
  constructor() {
1347
- this.api = pn(), this.uploader = fn();
1347
+ this.api = ds(), this.uploader = ps();
1348
1348
  }
1349
1349
  async getExtension() {
1350
1350
  console.log("BaseService.getExtension");
@@ -1417,11 +1417,11 @@ class Z {
1417
1417
  return await this.api("clearStaticFiles", e).catch(() => "");
1418
1418
  }
1419
1419
  async getPluginMaterial(e) {
1420
- const { urls: t = [] } = e, n = t.filter((o) => tt(o))[0];
1421
- if (!n) return null;
1422
- const r = this.pluginCaches[n];
1423
- return r || (this.pluginCaches[n] = X.send({
1424
- url: n,
1420
+ const { urls: t = [] } = e, s = t.filter((o) => tt(o))[0];
1421
+ if (!s) return null;
1422
+ const r = this.pluginCaches[s];
1423
+ return r || (this.pluginCaches[s] = Z.send({
1424
+ url: s,
1425
1425
  method: "get",
1426
1426
  settings: {
1427
1427
  validSuccess: !1,
@@ -1435,9 +1435,9 @@ const y = new Ue({
1435
1435
  expired: 0,
1436
1436
  prefix: "__VTJ_"
1437
1437
  });
1438
- class Pn extends Z {
1438
+ class Es extends ee {
1439
1439
  init(e) {
1440
- const t = new A(e), n = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), n || {});
1440
+ const t = new A(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1441
1441
  return y.save(`project_${t.id}`, r), Promise.resolve(r);
1442
1442
  }
1443
1443
  saveProject(e) {
@@ -1445,7 +1445,7 @@ class Pn extends Z {
1445
1445
  return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1446
1446
  }
1447
1447
  saveMaterials(e, t) {
1448
- return y.save(`materials_${e.id}`, z(t)), Promise.resolve(!0);
1448
+ return y.save(`materials_${e.id}`, K(t)), Promise.resolve(!0);
1449
1449
  }
1450
1450
  saveFile(e) {
1451
1451
  return y.save(`file_${e.id}`, e), Promise.resolve(!0);
@@ -1469,30 +1469,30 @@ class Pn extends Z {
1469
1469
  return Promise.resolve(!0);
1470
1470
  }
1471
1471
  getHistory(e) {
1472
- const t = y.get(`history_${e}`), n = new ce(t || { id: e });
1473
- return Promise.resolve(n.toDsl());
1472
+ const t = y.get(`history_${e}`), s = new ce(t || { id: e });
1473
+ return Promise.resolve(s.toDsl());
1474
1474
  }
1475
1475
  getHistoryItem(e, t) {
1476
- const n = y.get(`history_${e}_${t}`);
1477
- return Promise.resolve(n);
1476
+ const s = y.get(`history_${e}_${t}`);
1477
+ return Promise.resolve(s);
1478
1478
  }
1479
1479
  saveHistoryItem(e, t) {
1480
1480
  return y.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1481
1481
  }
1482
1482
  removeHistoryItem(e, t) {
1483
- return t.forEach((n) => {
1484
- y.remove(`history_${e}_${n}`);
1483
+ return t.forEach((s) => {
1484
+ y.remove(`history_${e}_${s}`);
1485
1485
  }), Promise.resolve(!0);
1486
1486
  }
1487
1487
  }
1488
- class hn extends Z {
1488
+ class fs extends ee {
1489
1489
  projects = {};
1490
1490
  materials = {};
1491
1491
  files = {};
1492
1492
  histories = {};
1493
1493
  historyItems = {};
1494
1494
  init(e) {
1495
- const t = new A(e), n = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), n);
1495
+ const t = new A(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1496
1496
  return this.projects[r.id] = r, Promise.resolve(r);
1497
1497
  }
1498
1498
  saveProject(e) {
@@ -1500,7 +1500,7 @@ class hn extends Z {
1500
1500
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1501
1501
  }
1502
1502
  saveMaterials(e, t) {
1503
- return e.id && (this.materials[e.id] = z(t)), Promise.resolve(!0);
1503
+ return e.id && (this.materials[e.id] = K(t)), Promise.resolve(!0);
1504
1504
  }
1505
1505
  saveFile(e) {
1506
1506
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1524,29 +1524,29 @@ class hn extends Z {
1524
1524
  return Promise.resolve(!0);
1525
1525
  }
1526
1526
  getHistory(e) {
1527
- const t = this.histories[e], n = new ce(t || { id: e });
1528
- return Promise.resolve(n);
1527
+ const t = this.histories[e], s = new ce(t || { id: e });
1528
+ return Promise.resolve(s);
1529
1529
  }
1530
1530
  getHistoryItem(e, t) {
1531
- const n = `${e}_${t}`, r = this.historyItems[n] || {};
1531
+ const s = `${e}_${t}`, r = this.historyItems[s] || {};
1532
1532
  return Promise.resolve(r);
1533
1533
  }
1534
1534
  saveHistoryItem(e, t) {
1535
- const n = `${e}_${t.id}`;
1536
- return this.historyItems[n] = t, Promise.resolve(!0);
1535
+ const s = `${e}_${t.id}`;
1536
+ return this.historyItems[s] = t, Promise.resolve(!0);
1537
1537
  }
1538
1538
  removeHistoryItem(e, t) {
1539
- return t.forEach((n) => {
1540
- const r = `${e}_${n}`;
1539
+ return t.forEach((s) => {
1540
+ const r = `${e}_${s}`;
1541
1541
  delete this.historyItems[r];
1542
1542
  }), Promise.resolve(!0);
1543
1543
  }
1544
1544
  }
1545
1545
  let F = null;
1546
- function xn() {
1547
- return F || (F = new hn(), F);
1546
+ function Ps() {
1547
+ return F || (F = new fs(), F);
1548
1548
  }
1549
- class Rn extends Z {
1549
+ class xs extends ee {
1550
1550
  getFileCaches = {};
1551
1551
  async getExtension() {
1552
1552
  return await this.api("getExtension", {}).catch(() => {
@@ -1561,7 +1561,7 @@ class Rn extends Z {
1561
1561
  async saveMaterials(e, t) {
1562
1562
  return !!await this.api("saveMaterials", {
1563
1563
  project: e,
1564
- materials: z(t)
1564
+ materials: K(t)
1565
1565
  }).catch(() => !1);
1566
1566
  }
1567
1567
  async saveFile(e) {
@@ -1601,35 +1601,35 @@ class Rn extends Z {
1601
1601
  );
1602
1602
  }
1603
1603
  }
1604
- function Ee(s, e = []) {
1604
+ function Ee(n, e = []) {
1605
1605
  return e.map((t) => {
1606
- const { id: n, title: r, icon: o, children: a, hidden: i } = t;
1606
+ const { id: s, title: r, icon: o, children: a, hidden: i } = t;
1607
1607
  return {
1608
- id: n,
1608
+ id: s,
1609
1609
  title: r,
1610
1610
  icon: o,
1611
1611
  hidden: i,
1612
- url: `${s}/${n}`,
1613
- children: a && a.length ? Ee(s, a) : void 0
1612
+ url: `${n}/${s}`,
1613
+ children: a && a.length ? Ee(n, a) : void 0
1614
1614
  };
1615
1615
  });
1616
1616
  }
1617
- function Pe(s, e) {
1618
- if (!e) return s;
1617
+ function Pe(n, e) {
1618
+ if (!e) return n;
1619
1619
  let t = [];
1620
- for (const n of s)
1621
- if (n.children && n.children.length) {
1622
- const r = Pe(n.children, e);
1623
- r.length && (n.children = r, t.push(n));
1620
+ for (const s of n)
1621
+ if (s.children && s.children.length) {
1622
+ const r = Pe(s.children, e);
1623
+ r.length && (s.children = r, t.push(s));
1624
1624
  } else
1625
- e.can(n.id.toString()) && t.push(n);
1625
+ e.can(s.id.toString()) && t.push(s);
1626
1626
  return t;
1627
1627
  }
1628
- function kn(s) {
1629
- const { menuBasePath: e = "/page" } = s || {}, t = be(), n = he(), r = vt(), o = O(!1), a = O(!1), i = t.project;
1628
+ function Rs(n) {
1629
+ const { menuBasePath: e = "/page" } = n || {}, t = be(), s = he(), r = vt(), o = O(!1), a = O(!1), i = t.project;
1630
1630
  Qe(() => {
1631
- const { name: f, params: d, meta: u } = n;
1632
- if (f === W) {
1631
+ const { name: f, params: d, meta: u } = s;
1632
+ if (f === G) {
1633
1633
  const h = t.getPage(d.id);
1634
1634
  o.value = !h?.mask, a.value = !!h?.pure;
1635
1635
  } else if (f === me) {
@@ -1650,33 +1650,33 @@ function kn(s) {
1650
1650
  }
1651
1651
  export {
1652
1652
  _e as ACCESS_KEY,
1653
- bn as Access,
1653
+ $s as Access,
1654
1654
  Ze as BUILT_IN_DIRECTIVES,
1655
- Z as BaseService,
1655
+ ee as BaseService,
1656
1656
  oe as CONTEXT_HOST,
1657
1657
  yt as Context,
1658
1658
  _ as ContextMode,
1659
1659
  et as DATA_TYPES,
1660
1660
  me as HOMEPAGE_ROUTE_NAME,
1661
- $n as JSCodeToString,
1662
- wn as LIFE_CYCLES_LIST,
1663
- Rn as LocalService,
1664
- hn as MemoryService,
1665
- un as NodeEnv,
1666
- W as PAGE_ROUTE_NAME,
1667
- dn as Provider,
1668
- cn as Startup,
1669
- Pn as StorageService,
1661
+ js as JSCodeToString,
1662
+ _s as LIFE_CYCLES_LIST,
1663
+ xs as LocalService,
1664
+ fs as MemoryService,
1665
+ ls as NodeEnv,
1666
+ G as PAGE_ROUTE_NAME,
1667
+ us as Provider,
1668
+ as as Startup,
1669
+ Es as StorageService,
1670
1670
  R as VTJ_RENDERER_VERSION,
1671
1671
  ve as adoptedStyleSheets,
1672
- Sn as createAssetScripts,
1673
- jn as createAssetsCss,
1672
+ ws as createAssetScripts,
1673
+ Ss as createAssetsCss,
1674
1674
  Et as createDataSources,
1675
- V as createLoader,
1676
- xn as createMemoryService,
1675
+ z as createLoader,
1676
+ Ps as createMemoryService,
1677
1677
  pt as createMetaApi,
1678
- En as createProvider,
1679
- J as createRenderer,
1678
+ bs as createProvider,
1679
+ V as createRenderer,
1680
1680
  dt as createSchemaApi,
1681
1681
  ft as createSchemaApis,
1682
1682
  Rt as defaultLoader,
@@ -1684,12 +1684,12 @@ export {
1684
1684
  Se as getModifiers,
1685
1685
  we as getPlugin,
1686
1686
  rt as getRawComponent,
1687
- G as isCSSUrl,
1687
+ Y as isCSSUrl,
1688
1688
  lt as isJSCode,
1689
1689
  S as isJSExpression,
1690
1690
  H as isJSFunction,
1691
1691
  tt as isJSON,
1692
- Y as isJSUrl,
1692
+ Q as isJSUrl,
1693
1693
  ct as isVuePlugin,
1694
1694
  ot as loadCss,
1695
1695
  it as loadCssUrl,
@@ -1698,13 +1698,13 @@ export {
1698
1698
  ht as mockApis,
1699
1699
  ye as mockCleanup,
1700
1700
  M as nodeRender,
1701
- st as parseDeps,
1701
+ nt as parseDeps,
1702
1702
  k as parseExpression,
1703
1703
  ie as parseFunction,
1704
1704
  $e as providerKey,
1705
- nt as removeProdFlag,
1705
+ st as removeProdFlag,
1706
1706
  ge as toString,
1707
1707
  vt as useAccess,
1708
- kn as useMask,
1708
+ Rs as useMask,
1709
1709
  be as useProvider
1710
1710
  };