@vtj/renderer 0.9.0 → 0.9.1

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,19 +1,19 @@
1
- import { Base as xe, BUILT_IN_COMPONENTS as ke, ProjectModel as T, HistoryModel as ue } from "@vtj/core";
2
- import { isUrl as Ce, url as P, dedupArray as Fe, isString as S, isFunction as z, logger as D, createRequest as Ae, merge as Ie, pathToRegexp as Oe, pathToRegexpMatch as Me, formDataToJson as Te, storage as L, cookie as q, toArray as ne, unRSA as re, delay as de, camelCase as $, upperFirst as De, pick as He, jsonp as Be, loadScript as oe, Request as Ne, Storage as Ue, mapToObject as Y } from "@vtj/utils";
1
+ import { Base as Ae, BUILT_IN_COMPONENTS as Te, ProjectModel as M, HistoryModel as de } from "@vtj/core";
2
+ import { isUrl as Ie, url as x, dedupArray as De, isString as j, isFunction as K, logger as O, createRequest as Me, merge as Oe, pathToRegexp as He, pathToRegexpMatch as Be, formDataToJson as Ne, storage as q, cookie as J, toArray as oe, unRSA as ie, delay as fe, camelCase as $, upperFirst as Ue, pick as Le, jsonp as qe, loadScript as ae, Request as Je, Storage as Ve, mapToObject as Q } from "@vtj/utils";
3
3
  import * as B from "vue";
4
- import { inject as pe, toRef as Le, readonly as qe, customRef as Je, ref as C, onBeforeUnmount as Ve, getCurrentScope as ze, onScopeDispose as Ke, unref as We, getCurrentInstance as fe, watch as he, computed as me, onMounted as Ge, defineComponent as Q, h as K, openBlock as Ye, createElementBlock as Qe, createElementVNode as b, toDisplayString as J, defineAsyncComponent as ie, watchEffect as Xe } from "vue";
5
- import { ElNotification as N, ElLoading as Ze } from "element-plus";
6
- import { useRoute as ge } from "vue-router";
4
+ import { inject as he, toRef as ze, readonly as Ke, customRef as We, ref as F, onBeforeUnmount as Ge, getCurrentScope as Ye, onScopeDispose as Qe, unref as Xe, getCurrentInstance as me, watch as ge, computed as ve, onMounted as Ze, defineComponent as X, h as W, openBlock as et, createElementBlock as tt, createElementVNode as E, toDisplayString as V, defineAsyncComponent as ce, watchEffect as st } from "vue";
5
+ import { ElNotification as N, ElLoading as nt } from "element-plus";
6
+ import { useRoute as ye } 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
11
+ * @version 0.9.1
12
12
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
13
  */
14
- const x = "0.9.0";
15
- var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
16
- const ae = [
14
+ const k = "0.9.1";
15
+ var y = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(y || {});
16
+ const le = [
17
17
  "$el",
18
18
  "$emit",
19
19
  "$nextTick",
@@ -25,7 +25,7 @@ const ae = [
25
25
  "$props",
26
26
  "$options",
27
27
  "$forceUpdate"
28
- ], ws = [
28
+ ], Cs = [
29
29
  "beforeCreate",
30
30
  "created",
31
31
  "beforeMount",
@@ -39,7 +39,7 @@ const ae = [
39
39
  "renderTriggered",
40
40
  "activated",
41
41
  "deactivated"
42
- ], et = ["vIf", "vShow", "vModel", "vFor", "vBind"], tt = {
42
+ ], rt = ["vIf", "vShow", "vModel", "vFor", "vBind"], ot = {
43
43
  String,
44
44
  Number,
45
45
  Boolean,
@@ -47,65 +47,67 @@ const ae = [
47
47
  Object,
48
48
  Function,
49
49
  Date
50
- }, k = "VtjPage", M = "VtjHomepage";
51
- function I(n, e) {
52
- return n.map((t) => Ce(t) || t.startsWith("/") ? t : `${e}${t}`);
50
+ }, C = "VtjPage", D = "VtjHomepage", it = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot".split(
51
+ ","
52
+ ), at = "component,slot".split(",");
53
+ function T(n, e) {
54
+ return n.map((t) => Ie(t) || t.startsWith("/") ? t : `${e}${t}`);
53
55
  }
54
- function X(n) {
56
+ function Z(n) {
55
57
  return /\.css$/.test(n);
56
58
  }
57
- function Z(n) {
59
+ function ee(n) {
58
60
  return /\.js$/.test(n);
59
61
  }
60
- function st(n) {
62
+ function ct(n) {
61
63
  return /\.json$/.test(n);
62
64
  }
63
- function Ss(n) {
65
+ function Fs(n) {
64
66
  return n.map(
65
- (e) => `<script src="${P.append(e, { v: x })}"><\/script>`
67
+ (e) => `<script src="${x.append(e, { v: k })}"><\/script>`
66
68
  ).join("");
67
69
  }
68
- function js(n = []) {
70
+ function As(n = []) {
69
71
  return n.map(
70
- (e) => `<link rel="stylesheet" href="${P.append(e, { v: x })}" />`
72
+ (e) => `<link rel="stylesheet" href="${x.append(e, { v: k })}" />`
71
73
  ).join("");
72
74
  }
73
- function nt(n, e = !1) {
75
+ function lt(n, e = !1) {
74
76
  return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
75
77
  }
76
- function rt(n, e, t = !1) {
77
- const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], u = {};
78
+ function ut(n, e, t = !1) {
79
+ const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], c = {}, l = {}, f = [], u = {};
78
80
  return s.forEach(
79
- ({ urls: p, assetsUrl: d, library: h, assetsLibrary: m, localeLibrary: v }) => {
81
+ ({ urls: p, assetsUrl: h, library: m, assetsLibrary: d, localeLibrary: w }) => {
80
82
  p?.forEach((g) => {
81
- Z(g) && r.push(nt(g, t)), X(g) && o.push(g);
82
- }), h && (i.push(h), l[h] = I(p || [], e), v && (c[h] = v)), d && a.push(d), m && f.push(m), h && m && (u[m] = h);
83
+ ee(g) && r.push(lt(g, t)), Z(g) && o.push(g);
84
+ }), m && (i.push(m), c[m] = T(p || [], e), w && (l[m] = w)), h && a.push(h), d && f.push(d), m && d && (u[d] = m);
83
85
  }
84
86
  ), {
85
- scripts: I(r, e),
86
- css: I(o, e),
87
- materials: I(a, e),
87
+ scripts: T(r, e),
88
+ css: T(o, e),
89
+ materials: T(a, e),
88
90
  libraryExports: i,
89
- materialExports: Fe(f),
91
+ materialExports: De(f),
90
92
  materialMapLibrary: u,
91
- libraryMap: l,
92
- libraryLocaleMap: c
93
+ libraryMap: c,
94
+ libraryLocaleMap: l
93
95
  };
94
96
  }
95
- function ot(n, e) {
97
+ function pt(n, e) {
96
98
  const { name: t, parent: s, alias: r } = n;
97
99
  return s ? e[s]?.[r || t] : e[r || t];
98
100
  }
99
- function ve(n) {
100
- return S(n) ? n : JSON.stringify(n);
101
+ function _e(n) {
102
+ return j(n) ? n : JSON.stringify(n);
101
103
  }
102
- function ye(n, e, t) {
104
+ function we(n, e, t) {
103
105
  const s = n.CSSStyleSheet;
104
106
  if (s.prototype.replaceSync) {
105
107
  const r = new s();
106
108
  r.id = e, r.replaceSync(t);
107
109
  const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
108
- (l) => l.id !== e
110
+ (c) => c.id !== e
109
111
  );
110
112
  o.adoptedStyleSheets = [...i, r];
111
113
  } else {
@@ -114,11 +116,11 @@ function ye(n, e, t) {
114
116
  o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
115
117
  }
116
118
  }
117
- async function it(n, e) {
119
+ async function dt(n, e) {
118
120
  const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
119
- t && ye(window, n, t);
121
+ t && we(window, n, t);
120
122
  }
121
- function at(n, e = window) {
123
+ function ft(n, e = window) {
122
124
  const t = e.document, s = e.document.head;
123
125
  for (const r of n)
124
126
  if (!t.getElementById(r)) {
@@ -126,40 +128,46 @@ function at(n, e = window) {
126
128
  a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
127
129
  }
128
130
  }
129
- async function ct(n, e, t = window) {
131
+ async function ht(n, e, t = window) {
130
132
  const s = t.document, r = t.document.head;
131
133
  let o = t[e];
132
134
  return o ? o.default || o : new Promise((a, i) => {
133
- for (const l of n) {
134
- const c = s.createElement("script");
135
- c.src = l, c.onload = () => {
135
+ for (const c of n) {
136
+ const l = s.createElement("script");
137
+ l.src = c, l.onload = () => {
136
138
  o = t[e], o ? a(o.default || o) : i(null);
137
- }, c.onerror = (f) => {
139
+ }, l.onerror = (f) => {
138
140
  i(f);
139
- }, r.appendChild(c);
141
+ }, r.appendChild(l);
140
142
  }
141
143
  });
142
144
  }
143
- function lt(n) {
144
- return z(n) || z(n?.install);
145
+ function mt(n) {
146
+ return K(n) || K(n?.install);
147
+ }
148
+ function gt(n) {
149
+ return at.includes(n);
150
+ }
151
+ function vt(n) {
152
+ return it.includes(n);
145
153
  }
146
- function F(n, e, t = !1, s = !1) {
154
+ function A(n, e, t = !1, s = !1) {
147
155
  try {
148
156
  const r = ['"use strict";', "var __self = arguments[0];"];
149
157
  r.push("return ");
150
158
  let o = (n.value || "").trim();
151
- o = o.replace(/this(\W|$)/g, (i, l) => `__self${l}`), o = r.join(`
159
+ o = o.replace(/this(\W|$)/g, (i, c) => `__self${c}`), o = r.join(`
152
160
  `) + o;
153
161
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
154
162
  return new Function("$scope", a)(e);
155
163
  } catch (r) {
156
- if (D.error("parseExpression.error", r, n, e?.__self ?? e), s)
164
+ if (O.error("parseExpression.error", r, n, e?.__self ?? e), s)
157
165
  throw r;
158
166
  }
159
167
  }
160
- function ce(n, e, t = !1, s = !1) {
161
- const r = F(n, e, t, s);
162
- if (typeof r != "function" && (D.error(
168
+ function ue(n, e, t = !1, s = !1) {
169
+ const r = A(n, e, t, s);
170
+ if (typeof r != "function" && (O.error(
163
171
  "parseFunction.error",
164
172
  "not a function",
165
173
  n,
@@ -168,20 +176,20 @@ function ce(n, e, t = !1, s = !1) {
168
176
  throw new Error(`"${n.value}" not a function`);
169
177
  return r;
170
178
  }
171
- function w(n) {
179
+ function _(n) {
172
180
  return n && n.type === "JSExpression";
173
181
  }
174
182
  function U(n) {
175
183
  return typeof n == "object" && n && n.type === "JSFunction";
176
184
  }
177
- function ut(n) {
178
- return w(n) || U(n);
185
+ function yt(n) {
186
+ return _(n) || U(n);
179
187
  }
180
- function $s(n) {
181
- return ut(n) ? n.value : JSON.stringify(n);
188
+ function Ts(n) {
189
+ return yt(n) ? n.value : JSON.stringify(n);
182
190
  }
183
- let E = null;
184
- const dt = Ae({
191
+ let R = null;
192
+ const _t = Me({
185
193
  settings: {
186
194
  type: "form",
187
195
  validSuccess: !0,
@@ -195,19 +203,19 @@ const dt = Ae({
195
203
  });
196
204
  },
197
205
  showLoading: () => {
198
- E && E.close(), E = Ze.service({
206
+ R && R.close(), R = nt.service({
199
207
  lock: !0,
200
208
  text: "Loading",
201
209
  background: "rgba(0, 0, 0, 0.05)"
202
210
  });
203
211
  },
204
212
  hideLoading: () => {
205
- E && (E.close(), E = null);
213
+ R && (R.close(), R = null);
206
214
  }
207
215
  }
208
216
  });
209
- let R;
210
- function pt(n, e) {
217
+ let P;
218
+ function wt(n, e) {
211
219
  const { jsonp: t, request: s } = e;
212
220
  if (n.method === "jsonp")
213
221
  return (r = {}) => t(n.url, {
@@ -215,7 +223,7 @@ function pt(n, e) {
215
223
  query: r
216
224
  });
217
225
  {
218
- const r = n.headers ? F(n.headers, {}, !0) : void 0, o = {
226
+ const r = n.headers ? A(n.headers, {}, !0) : void 0, o = {
219
227
  url: n.url,
220
228
  method: n.method,
221
229
  settings: {
@@ -223,10 +231,10 @@ function pt(n, e) {
223
231
  headers: r
224
232
  }
225
233
  };
226
- return (a, i) => (delete o.data, s.send(Ie(o, i || {}, { data: a })));
234
+ return (a, i) => (delete o.data, s.send(Oe(o, i || {}, { data: a })));
227
235
  }
228
236
  }
229
- function ft(n, e) {
237
+ function St(n, e) {
230
238
  const { metaQuery: t } = e;
231
239
  if (!t) return;
232
240
  const { code: s, queryCode: r } = n;
@@ -238,34 +246,34 @@ function ft(n, e) {
238
246
  return t(s, r, o, a);
239
247
  };
240
248
  }
241
- function ht(n = [], e = [], t) {
249
+ function bt(n = [], e = [], t) {
242
250
  const s = {};
243
251
  for (const r of n)
244
- s[r.id] = pt(r, t);
252
+ s[r.id] = wt(r, t);
245
253
  for (const r of e)
246
- s[r.id] = ft(r, t);
254
+ s[r.id] = St(r, t);
247
255
  return s;
248
256
  }
249
- async function mt(n = []) {
250
- R = await import("mockjs").then((e) => e.default || e), R && (R.setup({
257
+ async function jt(n = []) {
258
+ P = await import("mockjs").then((e) => e.default || e), P && (P.setup({
251
259
  timeout: "50-500"
252
- }), _e(), n.forEach((e) => gt(R, e)));
260
+ }), Se(), n.forEach((e) => $t(P, e)));
253
261
  }
254
- function gt(n, e) {
262
+ function $t(n, e) {
255
263
  if (!e.mock) return;
256
264
  const { url: t, mockTemplate: s } = e;
257
265
  if (t && s) {
258
- const r = Oe(`${t}(.*)`), o = Me(t, { decode: decodeURIComponent }), a = F(s, {}, !0);
266
+ const r = He(`${t}(.*)`), o = Be(t, { decode: decodeURIComponent }), a = A(s, {}, !0);
259
267
  n.mock(r, (i) => {
260
- const l = P.parse(i.url) || {}, c = i.body instanceof FormData ? Te(i.body) : i.body, f = o(i.url)?.params;
261
- return Object.assign(i, { data: c, params: l, query: f }), n.mock(a(i));
268
+ const c = x.parse(i.url) || {}, l = i.body instanceof FormData ? Ne(i.body) : i.body, f = o(i.url)?.params;
269
+ return Object.assign(i, { data: l, params: c, query: f }), n.mock(a(i));
262
270
  });
263
271
  }
264
272
  }
265
- function _e() {
266
- R && (R._mocked = {});
273
+ function Se() {
274
+ P && (P._mocked = {});
267
275
  }
268
- const vt = {
276
+ const Et = {
269
277
  session: !1,
270
278
  authKey: "Authorization",
271
279
  storageKey: "ACCESS_STORAGE",
@@ -277,31 +285,31 @@ const vt = {
277
285
  unauthorizedMessage: "登录已经失效,请重新登录!",
278
286
  noPermissionMessage: "无权限访问该页面",
279
287
  appName: ""
280
- }, we = Symbol("access");
281
- class bs {
288
+ }, be = Symbol("access");
289
+ class Is {
282
290
  options;
283
291
  data = null;
284
- mode = _.Raw;
292
+ mode = y.Raw;
285
293
  constructor(e) {
286
- this.options = Object.assign({}, vt, e), this.loadData();
294
+ this.options = Object.assign({}, Et, e), this.loadData();
287
295
  }
288
296
  connect(e) {
289
297
  const { mode: t, router: s, request: r } = e;
290
- this.mode = t, s && this.mode === _.Raw && this.setGuard(s), r && this.setRequest(r);
298
+ this.mode = t, s && this.mode === y.Raw && this.setGuard(s), r && this.setRequest(r);
291
299
  }
292
300
  login(e) {
293
301
  const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
294
- this.setData(e), this.data && (L.save(t, e, {
302
+ this.setData(e), this.data && (q.save(t, e, {
295
303
  type: "local",
296
304
  prefix: s
297
- }), r && q.set(o, this.data.token));
305
+ }), r && J.set(o, this.data.token));
298
306
  }
299
307
  clear() {
300
308
  const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
301
- this.data = null, L.remove(e, {
309
+ this.data = null, q.remove(e, {
302
310
  type: "local",
303
311
  prefix: t
304
- }), s && q.remove(r);
312
+ }), s && J.remove(r);
305
313
  }
306
314
  logout() {
307
315
  this.clear(), this.toLogin();
@@ -314,14 +322,14 @@ class bs {
314
322
  }
315
323
  can(e) {
316
324
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
317
- return typeof e == "function" ? e(s) : ne(e).every((o) => s[o] || s[t + "." + o]);
325
+ return typeof e == "function" ? e(s) : oe(e).every((o) => s[o] || s[t + "." + o]);
318
326
  }
319
327
  some(e) {
320
328
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
321
- return ne(e).some((o) => s[o] || s[t + "." + o]);
329
+ return oe(e).some((o) => s[o] || s[t + "." + o]);
322
330
  }
323
331
  install(e) {
324
- e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(we, this);
332
+ e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(be, this);
325
333
  }
326
334
  isAuthPath(e) {
327
335
  const { auth: t, isAuth: s } = this.options;
@@ -342,13 +350,13 @@ class bs {
342
350
  setData(e) {
343
351
  const { privateKey: t } = this.options;
344
352
  if (Array.isArray(e) && t) {
345
- const s = e.map((r) => re(r, t));
353
+ const s = e.map((r) => ie(r, t));
346
354
  this.data = JSON.parse(s.join(""));
347
355
  return;
348
356
  }
349
357
  if (typeof e == "string")
350
358
  try {
351
- const s = t ? re(e, t) : e;
359
+ const s = t ? ie(e, t) : e;
352
360
  s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
353
361
  } catch (s) {
354
362
  console.warn(s);
@@ -357,7 +365,7 @@ class bs {
357
365
  this.data = e;
358
366
  }
359
367
  loadData() {
360
- const { storageKey: e, storagePrefix: t } = this.options, s = L.get(e, {
368
+ const { storageKey: e, storagePrefix: t } = this.options, s = q.get(e, {
361
369
  type: "local",
362
370
  prefix: t
363
371
  });
@@ -365,10 +373,10 @@ class bs {
365
373
  }
366
374
  isLogined() {
367
375
  const { session: e, authKey: t } = this.options;
368
- return e && t ? !!q.get(t) : !!this.getToken();
376
+ return e && t ? !!J.get(t) : !!this.getToken();
369
377
  }
370
378
  hasRoutePermission(e) {
371
- if (e.name === k) {
379
+ if (e.name === C) {
372
380
  const t = e.params.id;
373
381
  return t && this.can(t);
374
382
  }
@@ -385,7 +393,7 @@ class bs {
385
393
  return t();
386
394
  {
387
395
  const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
388
- return await this.showTip(s), z(r) ? (r(), t(!1)) : S(r) ? t(r) : t(!1);
396
+ return await this.showTip(s), K(r) ? (r(), t(!1)) : j(r) ? t(r) : t(!1);
389
397
  }
390
398
  }
391
399
  t(!1), this.toLogin();
@@ -404,7 +412,7 @@ class bs {
404
412
  }
405
413
  async showTip(e) {
406
414
  const { alert: t } = this.options;
407
- return t ? (await de(150), await t(e, {
415
+ return t ? (await fe(150), await t(e, {
408
416
  title: "提示",
409
417
  type: "warning"
410
418
  }).catch(() => !1)) : !1;
@@ -419,10 +427,10 @@ class bs {
419
427
  );
420
428
  }
421
429
  }
422
- function yt() {
423
- return pe(we, null);
430
+ function Rt() {
431
+ return he(be, null);
424
432
  }
425
- class _t {
433
+ class Pt {
426
434
  __id = null;
427
435
  __mode;
428
436
  __instance = null;
@@ -465,41 +473,41 @@ class _t {
465
473
  });
466
474
  }
467
475
  __proxy() {
468
- this.__instance && ae.forEach((e) => {
476
+ this.__instance && le.forEach((e) => {
469
477
  this[e] = this.__instance?.[e];
470
478
  });
471
479
  }
472
480
  __cleanup() {
473
- ae.forEach((e) => {
481
+ le.forEach((e) => {
474
482
  this[e] = null;
475
483
  });
476
484
  }
477
485
  __parseFunction(e) {
478
486
  if (e)
479
- if (this.__mode === _.Runtime) {
487
+ if (this.__mode === y.Runtime) {
480
488
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
481
- return ce({ type: s, value: r }, this);
489
+ return ue({ type: s, value: r }, this);
482
490
  } else
483
- return ce(e, this);
491
+ return ue(e, this);
484
492
  }
485
493
  __parseExpression(e) {
486
494
  if (e)
487
- if (this.__mode === _.Runtime) {
495
+ if (this.__mode === y.Runtime) {
488
496
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
489
- return F({ type: s, value: r }, this);
497
+ return A({ type: s, value: r }, this);
490
498
  } else
491
- return F(e, this);
499
+ return A(e, this);
492
500
  }
493
501
  __ref(e = null, t) {
494
- if (this.__mode !== _.VNode)
502
+ if (this.__mode !== y.VNode)
495
503
  return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
496
- await de(0);
504
+ await fe(0);
497
505
  let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
498
506
  if (!r) {
499
507
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
500
508
  return;
501
509
  }
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")
510
+ if (r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, y.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = s), typeof t == "function")
503
511
  t(s);
504
512
  else if (t) {
505
513
  const o = this.$refs[t];
@@ -520,72 +528,72 @@ class _t {
520
528
  return s.context.__proto__ = this.context, s.__proto__ = this, s;
521
529
  }
522
530
  }
523
- function W(n) {
531
+ function G(n) {
524
532
  const {
525
533
  Vue: e = B,
526
- mode: t = _.Runtime,
534
+ mode: t = y.Runtime,
527
535
  components: s = {},
528
536
  libs: r = {},
529
537
  apis: o = {},
530
538
  loader: a
531
- } = n, i = e.computed(() => n.dsl), l = {
539
+ } = n, i = e.computed(() => n.dsl), c = {
532
540
  $components: s,
533
541
  $libs: r,
534
542
  $apis: o
535
- }, c = new _t({
543
+ }, l = new Pt({
536
544
  mode: t,
537
545
  dsl: i.value,
538
- attrs: l
546
+ attrs: c
539
547
  }), f = e.defineComponent({
540
548
  name: i.value.name,
541
549
  props: {
542
- ...St(i.value.props ?? [], c)
550
+ ...kt(i.value.props ?? [], l)
543
551
  },
544
552
  setup(u) {
545
- c.$props = u, c.props = u, i.value.id && ye(
553
+ l.$props = u, l.props = u, i.value.id && we(
546
554
  n.window || window,
547
555
  i.value.id,
548
556
  i.value.css || ""
549
- ), c.state = jt(e, i.value.state ?? {}, c);
550
- const p = $t(e, i.value.computed ?? {}, c), d = bt(i.value.methods ?? {}, c), h = Et(e, i.value.inject, c), m = Rt(
557
+ ), l.state = Ct(e, i.value.state ?? {}, l);
558
+ const p = Ft(e, i.value.computed ?? {}, l), h = At(i.value.methods ?? {}, l), m = Tt(e, i.value.inject, l), d = It(
551
559
  i.value.dataSources || {},
552
- c
553
- ), v = {
554
- ...h,
560
+ l
561
+ ), w = {
562
+ ...m,
555
563
  ...p,
556
- ...d,
557
- ...m
564
+ ...h,
565
+ ...d
558
566
  };
559
- return c.setup(v, e), Pt(e, i.value.watch ?? [], c), {
560
- vtj: c
567
+ return l.setup(w, e), Dt(e, i.value.watch ?? [], l), {
568
+ vtj: l
561
569
  };
562
570
  },
563
- emits: wt(i.value.emits),
571
+ emits: xt(i.value.emits),
564
572
  expose: ["vtj"],
565
573
  render() {
566
574
  if (!i.value.nodes) return null;
567
575
  const u = i.value.nodes || [];
568
- return u.length === 1 ? H(u[0], c, e, a) : u.map((p) => H(p, c, e, a));
576
+ return u.length === 1 ? H(u[0], l, e, a) : u.map((p) => H(p, l, e, a));
569
577
  },
570
- ...xt(i.value.lifeCycles ?? {}, c)
578
+ ...Mt(i.value.lifeCycles ?? {}, l)
571
579
  });
572
580
  return {
573
581
  renderer: e.markRaw(f),
574
- context: c
582
+ context: l
575
583
  };
576
584
  }
577
- function wt(n = []) {
578
- return n.map((e) => S(e) ? e : e.name);
585
+ function xt(n = []) {
586
+ return n.map((e) => j(e) ? e : e.name);
579
587
  }
580
- function St(n = [], e) {
581
- const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => tt[o]) : void 0;
582
- return n.map((s) => S(s) ? {
588
+ function kt(n = [], e) {
589
+ const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => ot[o]) : void 0;
590
+ return n.map((s) => j(s) ? {
583
591
  name: s
584
592
  } : {
585
593
  name: s.name,
586
594
  type: s.type,
587
595
  required: s.required,
588
- default: w(s.default) ? e.__parseExpression(s.default) : s.default
596
+ default: _(s.default) ? e.__parseExpression(s.default) : s.default
589
597
  }).reduce(
590
598
  (s, r) => (s[r.name] = {
591
599
  type: t(r.type),
@@ -595,53 +603,53 @@ function St(n = [], e) {
595
603
  {}
596
604
  );
597
605
  }
598
- function jt(n, e, t) {
606
+ function Ct(n, e, t) {
599
607
  return n.reactive(
600
608
  Object.keys(e || {}).reduce(
601
609
  (s, r) => {
602
610
  let o = e[r];
603
- return w(o) ? o = t.__parseExpression(o) : U(o) && (o = t.__parseFunction(o)), s[r] = o, s;
611
+ return _(o) ? o = t.__parseExpression(o) : U(o) && (o = t.__parseFunction(o)), s[r] = o, s;
604
612
  },
605
613
  {}
606
614
  )
607
615
  );
608
616
  }
609
- function $t(n, e, t) {
617
+ function Ft(n, e, t) {
610
618
  return Object.entries(e ?? {}).reduce(
611
619
  (s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
612
620
  {}
613
621
  );
614
622
  }
615
- function bt(n, e) {
623
+ function At(n, e) {
616
624
  return Object.entries(n ?? {}).reduce(
617
625
  (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
618
626
  {}
619
627
  );
620
628
  }
621
- function Et(n, e = [], t) {
629
+ function Tt(n, e = [], t) {
622
630
  return e.reduce(
623
631
  (s, r) => {
624
632
  const { name: o, from: a } = r || {};
625
633
  r.default;
626
- const i = w(a) ? t.__parseExpression(a) || o : a ?? o, l = w(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
627
- return s[o] = n.inject(i, l), s;
634
+ const i = _(a) ? t.__parseExpression(a) || o : a ?? o, c = _(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
635
+ return s[o] = n.inject(i, c), s;
628
636
  },
629
637
  {}
630
638
  );
631
639
  }
632
- function Rt(n, e) {
640
+ function It(n, e) {
633
641
  return Object.keys(n).reduce(
634
642
  (t, s) => {
635
643
  const r = n[s], o = e.$apis[r.ref], a = U(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
636
644
  return t[s] = async (...i) => {
637
- const l = await o.apply(e, i);
638
- return a ? a(l) : l;
645
+ const c = await o.apply(e, i);
646
+ return a ? a(c) : c;
639
647
  }, t;
640
648
  },
641
649
  {}
642
650
  );
643
651
  }
644
- function Pt(n, e = [], t) {
652
+ function Dt(n, e = [], t) {
645
653
  e.forEach((s) => {
646
654
  n.watch(
647
655
  t.__parseExpression(s.source),
@@ -653,111 +661,127 @@ function Pt(n, e = [], t) {
653
661
  );
654
662
  });
655
663
  }
656
- function xt(n, e) {
664
+ function Mt(n, e) {
657
665
  return Object.entries(n ?? {}).reduce(
658
666
  (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
659
667
  {}
660
668
  );
661
669
  }
662
- let V = [];
663
- const kt = (n) => n;
664
- async function Se(n, e = window) {
665
- const { urls: t = [], library: s } = n, r = t.filter((i) => Z(i));
670
+ let z = [];
671
+ const Ot = (n) => n;
672
+ async function je(n, e = window) {
673
+ const { urls: t = [], library: s } = n, r = t.filter((i) => ee(i));
666
674
  if (r.length === 0 || !s) return null;
667
- const o = t.filter((i) => X(i));
668
- return o.length && at(o, e), await ct(r, s, e).catch(
675
+ const o = t.filter((i) => Z(i));
676
+ return o.length && ft(o, e), await ht(r, s, e).catch(
669
677
  (i) => (console.warn("loadScriptUrl error", r, s, i), null)
670
678
  );
671
679
  }
672
- function G(n) {
680
+ function Y(n) {
673
681
  const { getDsl: e, getDslByUrl: t, options: s } = n;
674
- return s.window && (V.forEach((r) => {
682
+ return s.window && (z.forEach((r) => {
675
683
  delete s.window[r];
676
- }), V = []), (r, o, a = B) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
684
+ }), z = []), (r, o, a = B) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
677
685
  const i = await e(o.id);
678
- return i && (i.name = r), i ? W({
686
+ return i && (i.name = r), i ? G({
679
687
  ...s,
680
688
  Vue: a,
681
689
  dsl: i,
682
- mode: _.Runtime,
683
- loader: G(n)
690
+ mode: y.Runtime,
691
+ loader: Y(n)
684
692
  }).renderer : null;
685
693
  }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
686
694
  const i = await t(o.url);
687
- return i && (i.name = r), i ? W({
695
+ return i && (i.name = r), i ? G({
688
696
  ...s,
689
697
  Vue: a,
690
698
  dsl: i,
691
- mode: _.Runtime,
692
- loader: G(n)
699
+ mode: y.Runtime,
700
+ loader: Y(n)
693
701
  }).renderer : null;
694
- }) : o.type === "Plugin" ? (o.library && V.push(o.library), a.defineAsyncComponent(async () => {
695
- const i = await Se(o, s.window);
702
+ }) : o.type === "Plugin" ? (o.library && z.push(o.library), a.defineAsyncComponent(async () => {
703
+ const i = await je(o, s.window);
696
704
  return i || (console.warn("getPlugin result is null", o), null);
697
705
  })) : r;
698
706
  }
699
- function H(n, e, t = B, s = kt) {
707
+ function H(n, e, t = B, s = Ot) {
700
708
  if (!n || !n.name || n.invisible) return null;
701
- const r = t.getCurrentInstance()?.appContext, { id: o = null, directives: a = [] } = n, { vIf: i, vFor: l, vShow: c, vModels: f, vBind: u } = Ct(a);
702
- if (i && !Ft(i, e))
709
+ const r = t.getCurrentInstance()?.appContext, { id: o = null, directives: a = [] } = n, { vIf: i, vFor: c, vShow: l, vModels: f, vBind: u, vHtml: p, others: h } = Bt(a);
710
+ if (i && !Nt(i, e))
703
711
  return null;
704
- const p = (d) => {
705
- const h = d.$components, m = (() => {
712
+ const m = (d) => {
713
+ const w = d.$components, g = (() => {
706
714
  if (n.name === "component")
707
- return At(d, n.props?.is);
715
+ return Ut(d, n.props?.is);
708
716
  if (n.name === "slot") return n.name;
709
- const j = s(n.name, n.from, t);
710
- return S(j) ? h[j] ?? r?.app?.component(j) ?? j : j;
711
- })(), v = It(o, n.props ?? {}, d), g = Ot(t, n.events ?? {}, d);
717
+ const b = s(n.name, n.from, t);
718
+ return j(b) ? gt(b) || vt(b) ? b : w[b] ?? r?.app?.component(b) ?? b : b;
719
+ })(), S = Lt(o, n.props ?? {}, d), Ce = qt(t, n.events ?? {}, d);
712
720
  if (n.name === "slot")
713
- return Mt(t, n, v, d, s);
714
- u && Object.assign(v, d.__parseExpression(u.value)), c && (v.style = Object.assign(
715
- v.style ?? {},
716
- Dt(c, d)
717
- )), f.forEach((j) => {
718
- Object.assign(v, Ht(t, j, d));
721
+ return Jt(t, n, S, d, s);
722
+ u && Object.assign(S, d.__parseExpression(u.value)), l && (S.style = Object.assign(
723
+ S.style ?? {},
724
+ zt(l, d)
725
+ )), p && Object.assign(S, Kt(p, d)), f.forEach((b) => {
726
+ Object.assign(S, Wt(t, b, d));
719
727
  });
720
- const A = Bt(
728
+ const Fe = Gt(
721
729
  t,
722
730
  n.children ?? [],
723
731
  d,
724
732
  s,
725
733
  n
726
734
  );
727
- return t.createVNode(m, { ...v, ...g }, A);
735
+ let L = t.createVNode(g, { ...S, ...Ce }, Fe);
736
+ const re = r ? Ht(r, h, d) : [];
737
+ return re.length && (L = t.withDirectives(L, re)), L;
728
738
  };
729
- return l ? Lt(l, p, e) : p(e);
739
+ return c ? Xt(c, m, e) : m(e);
730
740
  }
731
- function Ct(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
- (i) => !et.includes($(i.name))
741
+ function Ht(n, e, t) {
742
+ const s = n.app;
743
+ return e.map((r) => {
744
+ const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
745
+ if (!o) return null;
746
+ const a = [o];
747
+ return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(
748
+ _(r.modifiers) ? t.__parseExpression(r.modifiers) : r.modifiers
749
+ ), a;
750
+ }).filter((r) => !!r);
751
+ }
752
+ function Bt(n = []) {
753
+ const e = n.find((c) => $(c.name) === "vIf"), t = n.find((c) => $(c.name) === "vFor"), s = n.find((c) => $(c.name) === "vShow"), r = n.find((c) => $(c.name) === "vBind"), o = n.find((c) => $(c.name) === "vHtml"), a = n.filter(
754
+ (c) => $(c.name) === "vModel"
755
+ ), i = n.filter(
756
+ (c) => !rt.includes($(c.name))
734
757
  );
735
758
  return {
736
759
  vIf: e,
737
760
  vFor: t,
738
761
  vShow: s,
739
- vModels: o,
762
+ vModels: a,
740
763
  vBind: r,
741
- others: a
764
+ others: i,
765
+ vHtml: o
742
766
  };
743
767
  }
744
- function Ft(n, e) {
768
+ function Nt(n, e) {
745
769
  return !!e.__parseExpression(n.value);
746
770
  }
747
- function At(n, e) {
748
- return e ? w(e) ? n.__parseExpression(e) : e : "div";
771
+ function Ut(n, e) {
772
+ return e ? _(e) ? n.__parseExpression(e) : e : "div";
749
773
  }
750
- function It(n, e, t) {
774
+ function Lt(n, e, t) {
751
775
  const s = Object.keys(e || {}).reduce(
752
776
  (r, o) => {
753
777
  let a = e[o];
754
- return w(a) ? a = t.__parseExpression(a) : U(a) && (a = t.__parseFunction(a)), r[o] = a, r;
778
+ return _(a) ? a = t.__parseExpression(a) : U(a) && (a = t.__parseFunction(a)), r[o] = a, r;
755
779
  },
756
780
  {}
757
781
  );
758
782
  return s.ref = t.__ref(n, s.ref), s;
759
783
  }
760
- function Ot(n, e, t) {
784
+ function qt(n, e, t) {
761
785
  const s = ["passive", "capture", "once"], r = {
762
786
  capture: "Capture",
763
787
  once: "Once",
@@ -765,70 +789,77 @@ function Ot(n, e, t) {
765
789
  };
766
790
  return Object.keys(e || {}).reduce(
767
791
  (o, a) => {
768
- const i = e[a], l = je(i.modifiers), c = l.find((p) => s.includes(p)), f = "on" + De(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
769
- return u && (o[f] = n.withModifiers(u, l)), o;
792
+ const i = e[a], c = $e(i.modifiers), l = c.find((p) => s.includes(p)), f = "on" + Ue(a) + (l && r[l] || ""), u = t.__parseFunction(i.handler);
793
+ return u && (o[f] = n.withModifiers(u, c)), o;
770
794
  },
771
795
  {}
772
796
  );
773
797
  }
774
- function je(n = {}, e = !1) {
798
+ function $e(n = {}, e = !1) {
775
799
  const t = Object.keys(n);
776
800
  return e ? t.map((s) => "." + s) : t;
777
801
  }
778
- function Mt(n, e, t, s, r) {
779
- const { children: o } = e, a = Tt(e, s), i = s.$slots?.[a.name];
780
- return i ? i(t) : o ? S(o) ? n.createTextVNode(o) : w(o) ? n.createTextVNode(
781
- ve(s.__parseExpression(o))
802
+ function Jt(n, e, t, s, r) {
803
+ const { children: o } = e, a = Vt(e, s), i = s.$slots?.[a.name];
804
+ return i ? i(t) : o ? j(o) ? n.createTextVNode(o) : _(o) ? n.createTextVNode(
805
+ _e(s.__parseExpression(o))
782
806
  ) : Array.isArray(o) ? o.map(
783
- (l) => H(l, s, n, r)
807
+ (c) => H(c, s, n, r)
784
808
  ) : null : null;
785
809
  }
786
- function Tt(n, e) {
810
+ function Vt(n, e) {
787
811
  const { props: t } = n, s = t?.name || "default";
788
812
  return {
789
- name: w(s) ? e.__parseExpression(s) : s,
813
+ name: _(s) ? e.__parseExpression(s) : s,
790
814
  params: []
791
815
  };
792
816
  }
793
- function Dt(n, e) {
817
+ function zt(n, e) {
794
818
  return e.__parseExpression(n.value) ? {} : {
795
819
  display: "none"
796
820
  };
797
821
  }
798
- function Ht(n, e, t) {
822
+ function Kt(n, e) {
823
+ return {
824
+ innerHTML: e.__parseExpression(n.value) || ""
825
+ };
826
+ }
827
+ function Wt(n, e, t) {
799
828
  const s = {
800
829
  type: "JSFunction",
801
830
  value: e.value?.value ? `(v) => {
802
831
  ${e.value.value} = v;
803
832
  }` : "(v) => {}"
804
- }, r = t.__parseFunction(s), o = je(e.modifiers), a = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
833
+ }, r = t.__parseFunction(s), o = $e(
834
+ _(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
835
+ ), a = _(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
805
836
  return {
806
837
  [a]: t.__parseExpression(e.value),
807
838
  [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
808
839
  };
809
840
  }
810
- function Bt(n, e, t, s, r) {
841
+ function Gt(n, e, t, s, r) {
811
842
  if (!e) return null;
812
- if (S(e))
843
+ if (j(e))
813
844
  return { default: () => e };
814
- if (w(e))
845
+ if (_(e))
815
846
  return {
816
- default: () => ve(t.__parseExpression(e))
847
+ default: () => _e(t.__parseExpression(e))
817
848
  };
818
849
  if (Array.isArray(e) && e.length > 0) {
819
- const o = Nt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
850
+ const o = Yt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
820
851
  [`scope_${r.id}`]: i
821
852
  } : {};
822
- return Object.entries(o).reduce((i, [l, { nodes: c, params: f }]) => (i[l] = (u) => {
823
- const p = f.length ? He(u ?? {}, f) : a(u);
824
- return c.map(
825
- (d) => H(d, t.__clone(p), n, s)
853
+ return Object.entries(o).reduce((i, [c, { nodes: l, params: f }]) => (i[c] = (u) => {
854
+ const p = f.length ? Le(u ?? {}, f) : a(u);
855
+ return l.map(
856
+ (h) => H(h, t.__clone(p), n, s)
826
857
  );
827
858
  }, i), {});
828
859
  }
829
860
  return null;
830
861
  }
831
- function Nt(n) {
862
+ function Yt(n) {
832
863
  const e = {
833
864
  default: {
834
865
  params: [],
@@ -836,7 +867,7 @@ function Nt(n) {
836
867
  }
837
868
  };
838
869
  for (const t of n) {
839
- const s = Ut(t.slot), r = s.name;
870
+ const s = Qt(t.slot), r = s.name;
840
871
  e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
841
872
  nodes: [t],
842
873
  params: s.params
@@ -844,111 +875,111 @@ function Nt(n) {
844
875
  }
845
876
  return e;
846
877
  }
847
- function Ut(n = "default") {
848
- return S(n) ? { name: n, params: [] } : { params: [], ...n };
878
+ function Qt(n = "default") {
879
+ return j(n) ? { name: n, params: [] } : { params: [], ...n };
849
880
  }
850
- function Lt(n, e, t) {
881
+ function Xt(n, e, t) {
851
882
  const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
852
883
  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`), []);
884
+ return Number.isInteger(i) && (i = new Array(i).fill(!0).map((c, l) => l + 1)), Array.isArray(i) ? i.map((c, l) => e(t.__clone({ [o]: c, [a]: l }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
854
885
  }
855
- function qt(n) {
856
- return ze() ? (Ke(n), !0) : !1;
886
+ function Zt(n) {
887
+ return Ye() ? (Qe(n), !0) : !1;
857
888
  }
858
- function ee(n) {
859
- return typeof n == "function" ? n() : We(n);
889
+ function te(n) {
890
+ return typeof n == "function" ? n() : Xe(n);
860
891
  }
861
- const $e = typeof window < "u" && typeof document < "u";
892
+ const Ee = typeof window < "u" && typeof document < "u";
862
893
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
863
- const Jt = (n) => n != null, Vt = () => {
894
+ const es = (n) => n != null, ts = () => {
864
895
  };
865
- function zt(n) {
866
- return fe();
896
+ function ss(n) {
897
+ return me();
867
898
  }
868
- function Kt(...n) {
899
+ function ns(...n) {
869
900
  if (n.length !== 1)
870
- return Le(...n);
901
+ return ze(...n);
871
902
  const e = n[0];
872
- return typeof e == "function" ? qe(Je(() => ({ get: e, set: Vt }))) : C(e);
903
+ return typeof e == "function" ? Ke(We(() => ({ get: e, set: ts }))) : F(e);
873
904
  }
874
- function Wt(n, e) {
875
- zt() && Ve(n, e);
905
+ function rs(n, e) {
906
+ ss() && Ge(n, e);
876
907
  }
877
- const Gt = $e ? window : void 0, Yt = $e ? window.document : void 0;
878
- function Qt(n) {
908
+ const os = Ee ? window : void 0, is = Ee ? window.document : void 0;
909
+ function as(n) {
879
910
  var e;
880
- const t = ee(n);
911
+ const t = te(n);
881
912
  return (e = t?.$el) != null ? e : t;
882
913
  }
883
- function Xt() {
884
- const n = C(!1), e = fe();
885
- return e && Ge(() => {
914
+ function cs() {
915
+ const n = F(!1), e = me();
916
+ return e && Ze(() => {
886
917
  n.value = !0;
887
918
  }, e), n;
888
919
  }
889
- function Zt(n) {
890
- const e = Xt();
891
- return me(() => (e.value, !!n()));
920
+ function ls(n) {
921
+ const e = cs();
922
+ return ve(() => (e.value, !!n()));
892
923
  }
893
- function es(n, e, t = {}) {
894
- const { window: s = Gt, ...r } = t;
924
+ function us(n, e, t = {}) {
925
+ const { window: s = os, ...r } = t;
895
926
  let o;
896
- const a = Zt(() => s && "MutationObserver" in s), i = () => {
927
+ const a = ls(() => s && "MutationObserver" in s), i = () => {
897
928
  o && (o.disconnect(), o = void 0);
898
- }, l = me(() => {
899
- const p = ee(n), d = (Array.isArray(p) ? p : [p]).map(Qt).filter(Jt);
900
- return new Set(d);
901
- }), c = he(
902
- () => l.value,
929
+ }, c = ve(() => {
930
+ const p = te(n), h = (Array.isArray(p) ? p : [p]).map(as).filter(es);
931
+ return new Set(h);
932
+ }), l = ge(
933
+ () => c.value,
903
934
  (p) => {
904
- i(), a.value && p.size && (o = new MutationObserver(e), p.forEach((d) => o.observe(d, r)));
935
+ i(), a.value && p.size && (o = new MutationObserver(e), p.forEach((h) => o.observe(h, r)));
905
936
  },
906
937
  { immediate: !0, flush: "post" }
907
938
  ), f = () => o?.takeRecords(), u = () => {
908
- c(), i();
939
+ l(), i();
909
940
  };
910
- return qt(u), {
941
+ return Zt(u), {
911
942
  isSupported: a,
912
943
  stop: u,
913
944
  takeRecords: f
914
945
  };
915
946
  }
916
- function ts(n = null, e = {}) {
947
+ function ps(n = null, e = {}) {
917
948
  var t, s, r;
918
949
  const {
919
- document: o = Yt,
950
+ document: o = is,
920
951
  restoreOnUnmount: a = (u) => u
921
- } = e, i = (t = o?.title) != null ? t : "", l = Kt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
952
+ } = e, i = (t = o?.title) != null ? t : "", c = ns((s = n ?? o?.title) != null ? s : null), l = n && typeof n == "function";
922
953
  function f(u) {
923
954
  if (!("titleTemplate" in e))
924
955
  return u;
925
956
  const p = e.titleTemplate || "%s";
926
- return typeof p == "function" ? p(u) : ee(p).replace(/%s/g, u);
957
+ return typeof p == "function" ? p(u) : te(p).replace(/%s/g, u);
927
958
  }
928
- return he(
929
- l,
959
+ return ge(
960
+ c,
930
961
  (u, p) => {
931
962
  u !== p && o && (o.title = f(typeof u == "string" ? u : ""));
932
963
  },
933
964
  { immediate: !0 }
934
- ), e.observe && !e.titleTemplate && o && !c && es(
965
+ ), e.observe && !e.titleTemplate && o && !l && us(
935
966
  (r = o.head) == null ? void 0 : r.querySelector("title"),
936
967
  () => {
937
- o && o.title !== l.value && (l.value = f(o.title));
968
+ o && o.title !== c.value && (c.value = f(o.title));
938
969
  },
939
970
  { childList: !0 }
940
- ), Wt(() => {
971
+ ), rs(() => {
941
972
  if (a) {
942
- const u = a(i, l.value || "");
973
+ const u = a(i, c.value || "");
943
974
  u != null && o && (o.title = u);
944
975
  }
945
- }), l;
976
+ }), c;
946
977
  }
947
- const le = Q({
978
+ const pe = X({
948
979
  name: "VtjPageContainer",
949
980
  async setup() {
950
- const n = Ee(), e = ge(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = C(Symbol());
951
- return s && (Object.assign(e.meta, s.meta || {}, { cache: s.cache }), ts(s.title || "VTJ")), {
981
+ const n = Pe(), e = ye(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = F(Symbol());
982
+ return s && (Object.assign(e.meta, s.meta || {}, { cache: s.cache }), ps(s.title || "VTJ")), {
952
983
  provider: n,
953
984
  component: r,
954
985
  file: s,
@@ -960,27 +991,27 @@ const le = Q({
960
991
  },
961
992
  render() {
962
993
  const { component: n, query: e, sid: t } = this;
963
- return n ? K(n, { ...e, key: t }) : K("div", "页面不存在");
994
+ return n ? W(n, { ...e, key: t }) : W("div", "页面不存在");
964
995
  },
965
996
  activated() {
966
997
  this.meta.cache === !1 && (this.sid = Symbol());
967
998
  }
968
- }), ss = {
999
+ }), ds = {
969
1000
  "data-l-h6o7ki7": "",
970
1001
  class: "vtj-startup__wrapper"
971
- }, ns = {
1002
+ }, fs = {
972
1003
  "data-l-h6o7ki7": "",
973
1004
  class: "vtj-startup"
974
- }, rs = {
1005
+ }, hs = {
975
1006
  "data-l-h6o7ki7": "",
976
1007
  class: "vtj-startup__name"
977
- }, os = { "data-l-h6o7ki7": "" }, is = {
1008
+ }, ms = { "data-l-h6o7ki7": "" }, gs = {
978
1009
  "data-l-h6o7ki7": "",
979
1010
  class: "vtj-startup__tagline"
980
- }, as = {
1011
+ }, vs = {
981
1012
  "data-l-h6o7ki7": "",
982
1013
  class: "vtj-startup__actions"
983
- }, cs = /* @__PURE__ */ Q({
1014
+ }, ys = /* @__PURE__ */ X({
984
1015
  __name: "Startup",
985
1016
  props: {
986
1017
  name: { default: "VTJ.PRO" },
@@ -1068,53 +1099,53 @@ const le = Q({
1068
1099
  window.location.href = o;
1069
1100
  }
1070
1101
  };
1071
- return (r, o) => (Ye(), Qe("div", ss, [
1072
- b("div", ns, [
1073
- b("h1", rs, [
1074
- b("span", os, J(t.name), 1)
1102
+ return (r, o) => (et(), tt("div", ds, [
1103
+ E("div", fs, [
1104
+ E("h1", hs, [
1105
+ E("span", ms, V(t.name), 1)
1075
1106
  ]),
1076
- b("div", is, J(t.tagline), 1),
1077
- b("div", as, [
1078
- b("button", {
1107
+ E("div", gs, V(t.tagline), 1),
1108
+ E("div", vs, [
1109
+ E("button", {
1079
1110
  "data-l-h6o7ki7": "",
1080
1111
  onClick: s
1081
- }, J(t.actionText), 1)
1112
+ }, V(t.actionText), 1)
1082
1113
  ])
1083
1114
  ])
1084
1115
  ]));
1085
1116
  }
1086
- }), ls = Q({
1117
+ }), _s = X({
1087
1118
  name: "VtjStartupContainer",
1088
1119
  render() {
1089
- return K(cs);
1120
+ return W(ys);
1090
1121
  }
1091
- }), be = Symbol("Provider");
1092
- var us = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(us || {});
1093
- class ds extends xe {
1122
+ }), Re = Symbol("Provider");
1123
+ var ws = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(ws || {});
1124
+ class Ss extends Ae {
1094
1125
  constructor(e) {
1095
1126
  super(), this.options = e;
1096
1127
  const {
1097
1128
  service: t,
1098
- mode: s = _.Raw,
1129
+ mode: s = y.Raw,
1099
1130
  dependencies: r,
1100
1131
  materials: o,
1101
1132
  project: a = {},
1102
1133
  adapter: i = {},
1103
- globals: l = {},
1104
- modules: c = {},
1134
+ globals: c = {},
1135
+ modules: l = {},
1105
1136
  router: f = null,
1106
1137
  materialPath: u = "./",
1107
1138
  nodeEnv: p = "development"
1108
1139
  /* Development */
1109
1140
  } = e;
1110
- this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i);
1111
- const { access: d, request: h } = this.adapter;
1112
- d && d.connect({ mode: s, router: f, request: h }), a && s !== _.Design ? this.load(a) : this.project = a;
1141
+ this.mode = s, this.modules = l, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, c), Object.assign(this.adapter, i);
1142
+ const { access: h, request: m } = this.adapter;
1143
+ h && h.connect({ mode: s, router: f, request: m }), a && s !== y.Design ? this.load(a) : this.project = a;
1113
1144
  }
1114
1145
  mode;
1115
1146
  globals = {};
1116
1147
  modules = {};
1117
- adapter = { request: dt, jsonp: Be };
1148
+ adapter = { request: _t, jsonp: qe };
1118
1149
  apis = {};
1119
1150
  dependencies = {};
1120
1151
  materials = {};
@@ -1131,7 +1162,7 @@ class ds extends xe {
1131
1162
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
1132
1163
  throw new Error("project is null");
1133
1164
  const { apis: s = [], meta: r = [] } = this.project, o = window;
1134
- o.CKEDITOR_VERSION = void 0, this.mode === _.Raw ? await this.loadDependencies(o) : await this.loadAssets(o), this.apis = ht(s, r, this.adapter), _e(), this.project.config?.mock && mt(s), this.initRouter(), this.triggerReady();
1165
+ o.CKEDITOR_VERSION = void 0, this.mode === y.Raw ? await this.loadDependencies(o) : await this.loadAssets(o), this.apis = bt(s, r, this.adapter), Se(), this.project.config?.mock && jt(s), this.initRouter(), this.triggerReady();
1135
1166
  }
1136
1167
  async loadDependencies(e) {
1137
1168
  const t = Object.entries(this.dependencies);
@@ -1140,44 +1171,44 @@ class ds extends xe {
1140
1171
  }
1141
1172
  async loadAssets(e) {
1142
1173
  const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1143
- libraryExports: l,
1144
- libraryMap: c,
1174
+ libraryExports: c,
1175
+ libraryMap: l,
1145
1176
  materials: f,
1146
1177
  materialExports: u,
1147
1178
  materialMapLibrary: p
1148
- } = rt(
1179
+ } = ut(
1149
1180
  t,
1150
1181
  a,
1151
1182
  i === "development"
1152
1183
  /* Development */
1153
1184
  );
1154
- for (const d of l) {
1155
- const h = s[d], m = e[d];
1156
- if (m)
1157
- r[d] = m;
1158
- else if (h)
1159
- e[d] = r[d] = await h();
1185
+ for (const h of c) {
1186
+ const m = s[h], d = e[h];
1187
+ if (d)
1188
+ r[h] = d;
1189
+ else if (m)
1190
+ e[h] = r[h] = await m();
1160
1191
  else {
1161
- const v = c[d] || [];
1162
- for (const g of v)
1163
- X(g) && await it(d, P.append(g, { v: x })), Z(g) && await oe(P.append(g, { v: x }));
1164
- r[d] = e[d];
1192
+ const w = l[h] || [];
1193
+ for (const g of w)
1194
+ Z(g) && await dt(h, x.append(g, { v: k })), ee(g) && await ae(x.append(g, { v: k }));
1195
+ r[h] = e[h];
1165
1196
  }
1166
1197
  }
1167
1198
  if (i === "development") {
1168
- for (const h of f)
1169
- await oe(P.append(h, { v: x }));
1170
- const d = this.materials || {};
1171
- for (const h of u) {
1172
- const m = e[p[h]], v = ke[h];
1173
- if (v)
1174
- m && v.forEach((g) => {
1175
- o[g] = m[g];
1199
+ for (const m of f)
1200
+ await ae(x.append(m, { v: k }));
1201
+ const h = this.materials || {};
1202
+ for (const m of u) {
1203
+ const d = e[p[m]], w = Te[m];
1204
+ if (w)
1205
+ d && w.forEach((g) => {
1206
+ o[g] = d[g];
1176
1207
  });
1177
1208
  else {
1178
- const g = d[h] ? (await d[h]()).default : e[h];
1179
- g && m && (g.components || []).forEach((A) => {
1180
- o[A.name] = ot(A, m);
1209
+ const g = h[m] ? (await h[m]()).default : e[m];
1210
+ g && d && (g.components || []).forEach((S) => {
1211
+ o[S.name] = pt(S, d);
1181
1212
  });
1182
1213
  }
1183
1214
  }
@@ -1186,24 +1217,24 @@ class ds extends xe {
1186
1217
  initRouter() {
1187
1218
  const { router: e, project: t, options: s, adapter: r } = this;
1188
1219
  if (!e) return;
1189
- const { routeAppendTo: o, pageRouteName: a = "page", routeMeta: i } = s, l = o ? "" : "/", c = {
1190
- path: `${l}${a}/:id`,
1191
- name: k,
1192
- component: le
1220
+ const { routeAppendTo: o, pageRouteName: a = "page", routeMeta: i } = s, c = o ? "" : "/", l = {
1221
+ path: `${c}${a}/:id`,
1222
+ name: C,
1223
+ component: pe
1193
1224
  }, f = {
1194
- path: l,
1195
- name: M,
1196
- component: t?.homepage ? le : r.startupComponent || ls,
1225
+ path: c,
1226
+ name: D,
1227
+ component: t?.homepage ? pe : r.startupComponent || _s,
1197
1228
  meta: i
1198
1229
  };
1199
- e.hasRoute(k) && e.removeRoute(k), e.hasRoute(M) && e.removeRoute(M), o ? (e.addRoute(o, c), e.addRoute(o, f)) : (e.addRoute(c), e.addRoute(f));
1230
+ e.hasRoute(C) && e.removeRoute(C), e.hasRoute(D) && e.removeRoute(D), o ? (e.addRoute(o, l), e.addRoute(o, f)) : (e.addRoute(l), e.addRoute(f));
1200
1231
  }
1201
1232
  install(e) {
1202
1233
  const t = e.config.globalProperties.installed || {};
1203
1234
  for (const [s, r] of Object.entries(this.library))
1204
- !t[s] && lt(r) && (e.use(r), t[s] = !0);
1205
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(be, this), e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
1206
- const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", l = `[ ${a} ] ${i} ${o}`;
1235
+ !t[s] && mt(r) && (e.use(r), t[s] = !0);
1236
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Re, this), e.config.globalProperties.installed = t, this.mode === y.Design && (e.config.errorHandler = (s, r, o) => {
1237
+ const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", c = `[ ${a} ] ${i} ${o}`;
1207
1238
  console.error(
1208
1239
  "[VTJ Error]:",
1209
1240
  {
@@ -1214,7 +1245,7 @@ class ds extends xe {
1214
1245
  s?.stack
1215
1246
  ), N.error({
1216
1247
  title: "未处理的异常:请在控制台查看详情",
1217
- message: l
1248
+ message: c
1218
1249
  });
1219
1250
  });
1220
1251
  }
@@ -1264,47 +1295,47 @@ class ds extends xe {
1264
1295
  apis: a,
1265
1296
  window,
1266
1297
  ...t
1267
- }, l = G({
1268
- getDsl: async (c) => await this.getDsl(c) || null,
1269
- getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
1298
+ }, c = Y({
1299
+ getDsl: async (l) => await this.getDsl(l) || null,
1300
+ getDslByUrl: async (l) => await this.getDslByUrl(l) || null,
1270
1301
  options: i
1271
1302
  });
1272
- return W({
1303
+ return G({
1273
1304
  ...i,
1274
1305
  dsl: e,
1275
- loader: l
1306
+ loader: c
1276
1307
  });
1277
1308
  }
1278
1309
  async getRenderComponent(e, t) {
1279
1310
  const s = this.getFile(e);
1280
1311
  if (!s)
1281
- return D.warn(`Can not find file: ${e}`), null;
1312
+ return O.warn(`Can not find file: ${e}`), null;
1282
1313
  t && t(s);
1283
1314
  const r = `.vtj/vue/${e}.vue`, o = this.modules[r];
1284
1315
  if (o)
1285
1316
  return (await o())?.default;
1286
1317
  const a = await this.getDsl(s.id);
1287
- return a ? this.createDslRenderer(a).renderer : (D.warn(`Can not find dsl: ${e}`), null);
1318
+ return a ? this.createDslRenderer(a).renderer : (O.warn(`Can not find dsl: ${e}`), null);
1288
1319
  }
1289
1320
  defineUrlSchemaComponent(e, t) {
1290
- return ie(async () => {
1321
+ return ce(async () => {
1291
1322
  const s = await this.getDslByUrl(e);
1292
1323
  return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1293
1324
  });
1294
1325
  }
1295
1326
  definePluginComponent(e) {
1296
- return ie(async () => await Se(e, window));
1327
+ return ce(async () => await je(e, window));
1297
1328
  }
1298
1329
  }
1299
- function Es(n) {
1300
- const e = new ds(n);
1330
+ function Ds(n) {
1331
+ const e = new Ss(n);
1301
1332
  return {
1302
1333
  provider: e,
1303
1334
  onReady: (s) => e.ready(s)
1304
1335
  };
1305
1336
  }
1306
- function Ee(n = {}) {
1307
- const e = pe(be);
1337
+ function Pe(n = {}) {
1338
+ const e = he(Re);
1308
1339
  if (!e)
1309
1340
  throw new Error("Can not find provider");
1310
1341
  if (e.nodeEnv === "development") {
@@ -1319,7 +1350,7 @@ function Ee(n = {}) {
1319
1350
  }
1320
1351
  return e;
1321
1352
  }
1322
- const te = new Ne({
1353
+ const se = new Je({
1323
1354
  settings: {
1324
1355
  type: "json",
1325
1356
  validSuccess: !0,
@@ -1332,7 +1363,7 @@ const te = new Ne({
1332
1363
  });
1333
1364
  }
1334
1365
  }
1335
- }), ps = (n = "/__vtj__/api/:type.json") => (e, t) => te.send({
1366
+ }), bs = (n = "/__vtj__/api/:type.json") => (e, t) => se.send({
1336
1367
  url: n,
1337
1368
  method: "post",
1338
1369
  params: { type: e },
@@ -1340,7 +1371,7 @@ const te = new Ne({
1340
1371
  type: e,
1341
1372
  data: t
1342
1373
  }
1343
- }), fs = (n = "/__vtj__/api/uploader.json") => async (e, t) => await te.send({
1374
+ }), js = (n = "/__vtj__/api/uploader.json") => async (e, t) => await se.send({
1344
1375
  url: n,
1345
1376
  method: "post",
1346
1377
  data: {
@@ -1351,12 +1382,12 @@ const te = new Ne({
1351
1382
  type: "data"
1352
1383
  }
1353
1384
  }).then((s) => s && s[0] ? s[0] : null).catch(() => null);
1354
- class se {
1385
+ class ne {
1355
1386
  api;
1356
1387
  pluginCaches = {};
1357
1388
  uploader;
1358
1389
  constructor() {
1359
- this.api = ps(), this.uploader = fs();
1390
+ this.api = bs(), this.uploader = js();
1360
1391
  }
1361
1392
  async getExtension() {
1362
1393
  console.log("BaseService.getExtension");
@@ -1429,10 +1460,10 @@ class se {
1429
1460
  return await this.api("clearStaticFiles", e).catch(() => "");
1430
1461
  }
1431
1462
  async getPluginMaterial(e) {
1432
- const { urls: t = [] } = e, s = t.filter((o) => st(o))[0];
1463
+ const { urls: t = [] } = e, s = t.filter((o) => ct(o))[0];
1433
1464
  if (!s) return null;
1434
1465
  const r = this.pluginCaches[s];
1435
- return r || (this.pluginCaches[s] = te.send({
1466
+ return r || (this.pluginCaches[s] = se.send({
1436
1467
  url: s,
1437
1468
  method: "get",
1438
1469
  settings: {
@@ -1445,77 +1476,77 @@ class se {
1445
1476
  return console.log("BaseService.genSource", e), "";
1446
1477
  }
1447
1478
  }
1448
- const y = new Ue({
1479
+ const v = new Ve({
1449
1480
  type: "local",
1450
1481
  expired: 0,
1451
1482
  prefix: "__VTJ_"
1452
1483
  });
1453
- class Rs extends se {
1484
+ class Ms extends ne {
1454
1485
  init(e) {
1455
- const t = new T(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1456
- return y.save(`project_${t.id}`, r), Promise.resolve(r);
1486
+ const t = new M(e), s = v.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1487
+ return v.save(`project_${t.id}`, r), Promise.resolve(r);
1457
1488
  }
1458
1489
  saveProject(e) {
1459
- const t = new T(e);
1460
- return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1490
+ const t = new M(e);
1491
+ return v.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1461
1492
  }
1462
1493
  saveMaterials(e, t) {
1463
- return y.save(`materials_${e.id}`, Y(t)), Promise.resolve(!0);
1494
+ return v.save(`materials_${e.id}`, Q(t)), Promise.resolve(!0);
1464
1495
  }
1465
1496
  saveFile(e) {
1466
- return y.save(`file_${e.id}`, e), Promise.resolve(!0);
1497
+ return v.save(`file_${e.id}`, e), Promise.resolve(!0);
1467
1498
  }
1468
1499
  getFile(e) {
1469
- const t = y.get(`file_${e}`);
1500
+ const t = v.get(`file_${e}`);
1470
1501
  return t ? Promise.resolve(t) : Promise.reject(null);
1471
1502
  }
1472
1503
  removeFile(e) {
1473
- return y.remove(`file_${e}`), Promise.resolve(!0);
1504
+ return v.remove(`file_${e}`), Promise.resolve(!0);
1474
1505
  }
1475
1506
  saveHistory(e) {
1476
- return y.save(`history_${e.id}`, e), Promise.resolve(!0);
1507
+ return v.save(`history_${e.id}`, e), Promise.resolve(!0);
1477
1508
  }
1478
1509
  removeHistory(e) {
1479
- const t = y.get(`history_${e}`);
1510
+ const t = v.get(`history_${e}`);
1480
1511
  if (t) {
1481
1512
  const r = (t.items || []).map((o) => o.id);
1482
- this.removeHistoryItem(e, r), y.remove(`history_${e}`);
1513
+ this.removeHistoryItem(e, r), v.remove(`history_${e}`);
1483
1514
  }
1484
1515
  return Promise.resolve(!0);
1485
1516
  }
1486
1517
  getHistory(e) {
1487
- const t = y.get(`history_${e}`), s = new ue(t || { id: e });
1518
+ const t = v.get(`history_${e}`), s = new de(t || { id: e });
1488
1519
  return Promise.resolve(s.toDsl());
1489
1520
  }
1490
1521
  getHistoryItem(e, t) {
1491
- const s = y.get(`history_${e}_${t}`);
1522
+ const s = v.get(`history_${e}_${t}`);
1492
1523
  return Promise.resolve(s);
1493
1524
  }
1494
1525
  saveHistoryItem(e, t) {
1495
- return y.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1526
+ return v.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1496
1527
  }
1497
1528
  removeHistoryItem(e, t) {
1498
1529
  return t.forEach((s) => {
1499
- y.remove(`history_${e}_${s}`);
1530
+ v.remove(`history_${e}_${s}`);
1500
1531
  }), Promise.resolve(!0);
1501
1532
  }
1502
1533
  }
1503
- class hs extends se {
1534
+ class $s extends ne {
1504
1535
  projects = {};
1505
1536
  materials = {};
1506
1537
  files = {};
1507
1538
  histories = {};
1508
1539
  historyItems = {};
1509
1540
  init(e) {
1510
- const t = new T(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1541
+ const t = new M(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1511
1542
  return this.projects[r.id] = r, Promise.resolve(r);
1512
1543
  }
1513
1544
  saveProject(e) {
1514
- const t = new T(e);
1545
+ const t = new M(e);
1515
1546
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1516
1547
  }
1517
1548
  saveMaterials(e, t) {
1518
- return e.id && (this.materials[e.id] = Y(t)), Promise.resolve(!0);
1549
+ return e.id && (this.materials[e.id] = Q(t)), Promise.resolve(!0);
1519
1550
  }
1520
1551
  saveFile(e) {
1521
1552
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1539,7 +1570,7 @@ class hs extends se {
1539
1570
  return Promise.resolve(!0);
1540
1571
  }
1541
1572
  getHistory(e) {
1542
- const t = this.histories[e], s = new ue(t || { id: e });
1573
+ const t = this.histories[e], s = new de(t || { id: e });
1543
1574
  return Promise.resolve(s);
1544
1575
  }
1545
1576
  getHistoryItem(e, t) {
@@ -1557,11 +1588,11 @@ class hs extends se {
1557
1588
  }), Promise.resolve(!0);
1558
1589
  }
1559
1590
  }
1560
- let O = null;
1561
- function Ps() {
1562
- return O || (O = new hs(), O);
1591
+ let I = null;
1592
+ function Os() {
1593
+ return I || (I = new $s(), I);
1563
1594
  }
1564
- class xs extends se {
1595
+ class Hs extends ne {
1565
1596
  getFileCaches = {};
1566
1597
  async getExtension() {
1567
1598
  return await this.api("getExtension", {}).catch(() => {
@@ -1576,7 +1607,7 @@ class xs extends se {
1576
1607
  async saveMaterials(e, t) {
1577
1608
  return !!await this.api("saveMaterials", {
1578
1609
  project: e,
1579
- materials: Y(t)
1610
+ materials: Q(t)
1580
1611
  }).catch(() => !1);
1581
1612
  }
1582
1613
  async saveFile(e) {
@@ -1616,118 +1647,122 @@ class xs extends se {
1616
1647
  );
1617
1648
  }
1618
1649
  }
1619
- function Re(n, e, t = []) {
1650
+ function xe(n, e, t = []) {
1620
1651
  return t.map((s) => {
1621
- const { id: r, title: o, icon: a, children: i, hidden: l } = s;
1652
+ const { id: r, title: o, icon: a, children: i, hidden: c } = s;
1622
1653
  return {
1623
1654
  id: r,
1624
1655
  title: o,
1625
1656
  icon: a,
1626
- hidden: l,
1657
+ hidden: c,
1627
1658
  url: `${n}/${e}/${r}`,
1628
- children: i && i.length ? Re(n, e, i) : void 0
1659
+ children: i && i.length ? xe(n, e, i) : void 0
1629
1660
  };
1630
1661
  });
1631
1662
  }
1632
- function Pe(n, e) {
1663
+ function ke(n, e) {
1633
1664
  if (!e) return n;
1634
1665
  let t = [];
1635
1666
  for (const s of n)
1636
1667
  if (s.children && s.children.length) {
1637
- const r = Pe(s.children, e);
1668
+ const r = ke(s.children, e);
1638
1669
  r.length && (s.children = r, t.push(s));
1639
1670
  } else
1640
1671
  e.can(s.id.toString()) && t.push(s);
1641
1672
  return t;
1642
1673
  }
1643
- function ks(n) {
1674
+ function Bs(n) {
1644
1675
  const {
1645
1676
  menuPathPrefix: e = "",
1646
1677
  pageRouteName: t = "page",
1647
1678
  disableMenusFilter: s = !1
1648
- } = n || {}, r = Ee(), o = ge(), a = yt(), i = C(!1), l = C(!1), c = r.project;
1649
- Xe(() => {
1650
- const { name: p, params: d, meta: h } = o;
1651
- if (p === k) {
1652
- const m = r.getPage(d.id);
1653
- i.value = !m?.mask, l.value = !!m?.pure;
1654
- } else if (p === M) {
1655
- const m = r.getHomepage();
1656
- i.value = !m?.mask, l.value = !!m?.pure;
1679
+ } = n || {}, r = Pe(), o = ye(), a = Rt(), i = F(!1), c = F(!1), l = r.project;
1680
+ st(() => {
1681
+ const { name: p, params: h, meta: m } = o;
1682
+ if (p === C) {
1683
+ const d = r.getPage(h.id);
1684
+ i.value = !d?.mask, c.value = !!d?.pure;
1685
+ } else if (p === D) {
1686
+ const d = r.getHomepage();
1687
+ i.value = !d?.mask, c.value = !!d?.pure;
1657
1688
  } else
1658
- i.value = !h.mask, l.value = !!h.pure;
1689
+ i.value = !m.mask, c.value = !!m.pure;
1659
1690
  });
1660
- const f = Re(
1691
+ const f = xe(
1661
1692
  e,
1662
1693
  t,
1663
- c?.pages
1664
- ), u = c?.config;
1694
+ l?.pages
1695
+ ), u = l?.config;
1665
1696
  return {
1666
1697
  disabled: i,
1667
1698
  logo: u?.logo,
1668
1699
  themeSwitchable: u?.themeSwitchable,
1669
- title: u?.title || c?.description || c?.name || "VTJ App",
1670
- menus: s ? f : Pe(f, a),
1671
- pure: l
1700
+ title: u?.title || l?.description || l?.name || "VTJ App",
1701
+ menus: s ? f : ke(f, a),
1702
+ pure: c
1672
1703
  };
1673
1704
  }
1674
1705
  export {
1675
- we as ACCESS_KEY,
1676
- bs as Access,
1677
- et as BUILT_IN_DIRECTIVES,
1678
- se as BaseService,
1679
- ae as CONTEXT_HOST,
1680
- _t as Context,
1681
- _ as ContextMode,
1682
- tt as DATA_TYPES,
1683
- M as HOMEPAGE_ROUTE_NAME,
1684
- $s as JSCodeToString,
1685
- ws as LIFE_CYCLES_LIST,
1686
- xs as LocalService,
1687
- hs as MemoryService,
1688
- us as NodeEnv,
1689
- k as PAGE_ROUTE_NAME,
1690
- ds as Provider,
1691
- cs as Startup,
1692
- Rs as StorageService,
1693
- x as VTJ_RENDERER_VERSION,
1694
- ye as adoptedStyleSheets,
1695
- Ss as createAssetScripts,
1696
- js as createAssetsCss,
1697
- Rt as createDataSources,
1698
- G as createLoader,
1699
- Ps as createMemoryService,
1700
- ft as createMetaApi,
1701
- Es as createProvider,
1702
- W as createRenderer,
1703
- pt as createSchemaApi,
1704
- ht as createSchemaApis,
1705
- kt as defaultLoader,
1706
- I as fillBasePath,
1707
- je as getModifiers,
1708
- Se as getPlugin,
1709
- ot as getRawComponent,
1710
- X as isCSSUrl,
1711
- ut as isJSCode,
1712
- w as isJSExpression,
1706
+ be as ACCESS_KEY,
1707
+ Is as Access,
1708
+ at as BUILD_IN_TAGS,
1709
+ rt as BUILT_IN_DIRECTIVES,
1710
+ ne as BaseService,
1711
+ le as CONTEXT_HOST,
1712
+ Pt as Context,
1713
+ y as ContextMode,
1714
+ ot as DATA_TYPES,
1715
+ D as HOMEPAGE_ROUTE_NAME,
1716
+ it as HTML_TAGS,
1717
+ Ts as JSCodeToString,
1718
+ Cs as LIFE_CYCLES_LIST,
1719
+ Hs as LocalService,
1720
+ $s as MemoryService,
1721
+ ws as NodeEnv,
1722
+ C as PAGE_ROUTE_NAME,
1723
+ Ss as Provider,
1724
+ ys as Startup,
1725
+ Ms as StorageService,
1726
+ k as VTJ_RENDERER_VERSION,
1727
+ we as adoptedStyleSheets,
1728
+ Fs as createAssetScripts,
1729
+ As as createAssetsCss,
1730
+ It as createDataSources,
1731
+ Y as createLoader,
1732
+ Os as createMemoryService,
1733
+ St as createMetaApi,
1734
+ Ds as createProvider,
1735
+ G as createRenderer,
1736
+ wt as createSchemaApi,
1737
+ bt as createSchemaApis,
1738
+ Ot as defaultLoader,
1739
+ T as fillBasePath,
1740
+ $e as getModifiers,
1741
+ je as getPlugin,
1742
+ pt as getRawComponent,
1743
+ gt as isBuiltInTag,
1744
+ Z as isCSSUrl,
1745
+ yt as isJSCode,
1746
+ _ as isJSExpression,
1713
1747
  U as isJSFunction,
1714
- st as isJSON,
1715
- Z as isJSUrl,
1716
- lt as isVuePlugin,
1717
- it as loadCss,
1718
- at as loadCssUrl,
1719
- ct as loadScriptUrl,
1720
- gt as mockApi,
1721
- mt as mockApis,
1722
- _e as mockCleanup,
1748
+ ct as isJSON,
1749
+ ee as isJSUrl,
1750
+ vt as isNativeTag,
1751
+ mt as isVuePlugin,
1752
+ dt as loadCss,
1753
+ ft as loadCssUrl,
1754
+ ht as loadScriptUrl,
1755
+ $t as mockApi,
1756
+ jt as mockApis,
1757
+ Se as mockCleanup,
1723
1758
  H as nodeRender,
1724
- rt as parseDeps,
1725
- F as parseExpression,
1726
- ce as parseFunction,
1727
- be as providerKey,
1728
- nt as removeProdFlag,
1729
- ve as toString,
1730
- yt as useAccess,
1731
- ks as useMask,
1732
- Ee as useProvider
1759
+ ut as parseDeps,
1760
+ A as parseExpression,
1761
+ ue as parseFunction,
1762
+ Re as providerKey,
1763
+ lt as removeProdFlag,
1764
+ _e as toString,
1765
+ Rt as useAccess,
1766
+ Bs as useMask,
1767
+ Pe as useProvider
1733
1768
  };