@vtj/renderer 0.8.169 → 0.8.171

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,20 +1,20 @@
1
- import { Base as $e, BUILT_IN_COMPONENTS as je, ProjectModel as I, HistoryModel as ne } from "@vtj/core";
2
- import { isUrl as Ee, url as b, dedupArray as Pe, isString as $, isFunction as Y, logger as D, createRequest as be, merge as Ce, pathToRegexp as Re, pathToRegexpMatch as Fe, formDataToJson as xe, storage as k, cookie as T, toArray as Q, unAES as Ie, MD5 as De, delay as re, camelCase as j, upperFirst as Ae, pick as Oe, jsonp as He, loadScript as X, Request as Me, Storage as ke, mapToObject as q } from "@vtj/utils";
3
- import * as O from "vue";
4
- import { inject as oe, toRef as Te, readonly as Be, customRef as Ue, ref as J, onBeforeUnmount as Ne, getCurrentScope as Le, onScopeDispose as qe, unref as Je, getCurrentInstance as ie, watch as ae, computed as ce, onMounted as Ve, defineComponent as ue, h as U, defineAsyncComponent as Z, watchEffect as ze } from "vue";
5
- import { useRoute as le } from "vue-router";
1
+ import { Base as Ee, BUILT_IN_COMPONENTS as Pe, ProjectModel as I, HistoryModel as re } from "@vtj/core";
2
+ import { isUrl as Re, url as R, dedupArray as be, isString as $, isFunction as Y, logger as O, createRequest as Ce, merge as Fe, pathToRegexp as Ae, pathToRegexpMatch as Ie, formDataToJson as Oe, storage as T, cookie as k, toArray as Q, unRSA as X, delay as oe, camelCase as j, upperFirst as xe, pick as De, jsonp as He, loadScript as Z, Request as Me, Storage as Te, mapToObject as q } from "@vtj/utils";
3
+ import * as D from "vue";
4
+ import { inject as ie, toRef as ke, readonly as Ue, customRef as Be, ref as J, onBeforeUnmount as Ne, getCurrentScope as Le, onScopeDispose as qe, unref as Je, getCurrentInstance as ae, watch as ce, computed as ue, onMounted as Ve, defineComponent as le, h as B, defineAsyncComponent as ee, watchEffect as ze } from "vue";
5
+ import { useRoute as fe } from "vue-router";
6
6
  import { ElNotification as H, ElLoading as Ke } from "element-plus";
7
7
  import { XStartup as We } from "@vtj/ui";
8
8
  /**!
9
9
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
10
10
  * @name @vtj/renderer
11
11
  * @author CHC chenhuachun1549@dingtalk.com
12
- * @version 0.8.169
12
+ * @version 0.8.171
13
13
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
14
14
  */
15
- const C = "0.8.169";
15
+ const b = "0.8.171";
16
16
  var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
17
- const ee = [
17
+ const te = [
18
18
  "$el",
19
19
  "$emit",
20
20
  "$nextTick",
@@ -26,7 +26,7 @@ const ee = [
26
26
  "$props",
27
27
  "$options",
28
28
  "$forceUpdate"
29
- ], us = [
29
+ ], ls = [
30
30
  "beforeCreate",
31
31
  "created",
32
32
  "beforeMount",
@@ -48,9 +48,9 @@ const ee = [
48
48
  Object,
49
49
  Function,
50
50
  Date
51
- };
51
+ }, de = "VtjPage", Qe = "VtjHomepage";
52
52
  function F(n, e) {
53
- return n.map((t) => Ee(t) || t.startsWith("/") ? t : `${e}${t}`);
53
+ return n.map((t) => Re(t) || t.startsWith("/") ? t : `${e}${t}`);
54
54
  }
55
55
  function V(n) {
56
56
  return /\.css$/.test(n);
@@ -58,28 +58,28 @@ function V(n) {
58
58
  function z(n) {
59
59
  return /\.js$/.test(n);
60
60
  }
61
- function Qe(n) {
61
+ function Xe(n) {
62
62
  return /\.json$/.test(n);
63
63
  }
64
- function ls(n) {
64
+ function fs(n) {
65
65
  return n.map(
66
- (e) => `<script src="${b.append(e, { v: C })}"><\/script>`
66
+ (e) => `<script src="${R.append(e, { v: b })}"><\/script>`
67
67
  ).join("");
68
68
  }
69
- function fs(n = []) {
69
+ function ds(n = []) {
70
70
  return n.map(
71
- (e) => `<link rel="stylesheet" href="${b.append(e, { v: C })}" />`
71
+ (e) => `<link rel="stylesheet" href="${R.append(e, { v: b })}" />`
72
72
  ).join("");
73
73
  }
74
- function Xe(n, e = !1) {
74
+ function Ze(n, e = !1) {
75
75
  return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
76
76
  }
77
- function Ze(n, e, t = !1) {
77
+ function et(n, e, t = !1) {
78
78
  const s = n.filter((f) => !!f.enabled), r = [], o = [], a = [], i = [], u = {}, c = {}, p = [], l = {};
79
79
  return s.forEach(
80
80
  ({ urls: f, assetsUrl: m, library: d, assetsLibrary: h, localeLibrary: w }) => {
81
81
  f?.forEach((v) => {
82
- z(v) && r.push(Xe(v, t)), V(v) && o.push(v);
82
+ z(v) && r.push(Ze(v, t)), V(v) && o.push(v);
83
83
  }), d && (i.push(d), u[d] = F(f || [], e), w && (c[d] = w)), m && a.push(m), h && p.push(h), d && h && (l[h] = d);
84
84
  }
85
85
  ), {
@@ -87,20 +87,20 @@ function Ze(n, e, t = !1) {
87
87
  css: F(o, e),
88
88
  materials: F(a, e),
89
89
  libraryExports: i,
90
- materialExports: Pe(p),
90
+ materialExports: be(p),
91
91
  materialMapLibrary: l,
92
92
  libraryMap: u,
93
93
  libraryLocaleMap: c
94
94
  };
95
95
  }
96
- function et(n, e) {
96
+ function tt(n, e) {
97
97
  const { name: t, parent: s, alias: r } = n;
98
98
  return s ? e[s]?.[r || t] : e[r || t];
99
99
  }
100
- function fe(n) {
100
+ function pe(n) {
101
101
  return $(n) ? n : JSON.stringify(n);
102
102
  }
103
- function de(n, e, t) {
103
+ function he(n, e, t) {
104
104
  const s = n.CSSStyleSheet;
105
105
  if (s.prototype.replaceSync) {
106
106
  const r = new s();
@@ -115,11 +115,11 @@ function de(n, e, t) {
115
115
  o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
116
116
  }
117
117
  }
118
- async function tt(n, e) {
118
+ async function st(n, e) {
119
119
  const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
120
- t && de(window, n, t);
120
+ t && he(window, n, t);
121
121
  }
122
- function st(n, e = window) {
122
+ function nt(n, e = window) {
123
123
  const t = e.document, s = e.document.head;
124
124
  for (const r of n)
125
125
  if (!t.getElementById(r)) {
@@ -127,7 +127,7 @@ function st(n, e = window) {
127
127
  a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
128
128
  }
129
129
  }
130
- async function nt(n, e, t = window) {
130
+ async function rt(n, e, t = window) {
131
131
  const s = t.document, r = t.document.head;
132
132
  let o = t[e];
133
133
  return o ? o.default || o : new Promise((a, i) => {
@@ -141,10 +141,10 @@ async function nt(n, e, t = window) {
141
141
  }
142
142
  });
143
143
  }
144
- function rt(n) {
144
+ function ot(n) {
145
145
  return Y(n) || Y(n?.install);
146
146
  }
147
- function R(n, e, t = !1, s = !1) {
147
+ function C(n, e, t = !1, s = !1) {
148
148
  try {
149
149
  const r = ['"use strict";', "var __self = arguments[0];"];
150
150
  r.push("return ");
@@ -154,13 +154,13 @@ function R(n, e, t = !1, s = !1) {
154
154
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
155
155
  return new Function("$scope", a)(e);
156
156
  } catch (r) {
157
- if (D.error("parseExpression.error", r, n, e?.__self ?? e), s)
157
+ if (O.error("parseExpression.error", r, n, e?.__self ?? e), s)
158
158
  throw r;
159
159
  }
160
160
  }
161
- function te(n, e, t = !1, s = !1) {
162
- const r = R(n, e, t, s);
163
- if (typeof r != "function" && (D.error(
161
+ function se(n, e, t = !1, s = !1) {
162
+ const r = C(n, e, t, s);
163
+ if (typeof r != "function" && (O.error(
164
164
  "parseFunction.error",
165
165
  "not a function",
166
166
  n,
@@ -175,14 +175,14 @@ function S(n) {
175
175
  function M(n) {
176
176
  return typeof n == "object" && n && n.type === "JSFunction";
177
177
  }
178
- function ot(n) {
178
+ function it(n) {
179
179
  return S(n) || M(n);
180
180
  }
181
- function ds(n) {
182
- return ot(n) ? n.value : JSON.stringify(n);
181
+ function ps(n) {
182
+ return it(n) ? n.value : JSON.stringify(n);
183
183
  }
184
184
  let E = null;
185
- const it = be({
185
+ const at = Ce({
186
186
  settings: {
187
187
  type: "form",
188
188
  validSuccess: !0,
@@ -208,7 +208,7 @@ const it = be({
208
208
  }
209
209
  });
210
210
  let P;
211
- function at(n, e) {
211
+ function ct(n, e) {
212
212
  const { jsonp: t, request: s } = e;
213
213
  if (n.method === "jsonp")
214
214
  return (r = {}) => t(n.url, {
@@ -216,7 +216,7 @@ function at(n, e) {
216
216
  query: r
217
217
  });
218
218
  {
219
- const r = n.headers ? R(n.headers, {}, !0) : void 0, o = {
219
+ const r = n.headers ? C(n.headers, {}, !0) : void 0, o = {
220
220
  url: n.url,
221
221
  method: n.method,
222
222
  settings: {
@@ -224,10 +224,10 @@ function at(n, e) {
224
224
  headers: r
225
225
  }
226
226
  };
227
- return (a, i) => (delete o.data, s.send(Ce(o, i || {}, { data: a })));
227
+ return (a, i) => (delete o.data, s.send(Fe(o, i || {}, { data: a })));
228
228
  }
229
229
  }
230
- function ct(n, e) {
230
+ function ut(n, e) {
231
231
  const { metaQuery: t } = e;
232
232
  if (!t) return;
233
233
  const { code: s, queryCode: r } = n;
@@ -239,34 +239,34 @@ function ct(n, e) {
239
239
  return t(s, r, o, a);
240
240
  };
241
241
  }
242
- function ut(n = [], e = [], t) {
242
+ function lt(n = [], e = [], t) {
243
243
  const s = {};
244
244
  for (const r of n)
245
- s[r.id] = at(r, t);
246
- for (const r of e)
247
245
  s[r.id] = ct(r, t);
246
+ for (const r of e)
247
+ s[r.id] = ut(r, t);
248
248
  return s;
249
249
  }
250
- async function lt(n = []) {
250
+ async function ft(n = []) {
251
251
  P = await import("mockjs").then((e) => e.default || e), P && (P.setup({
252
252
  timeout: "50-500"
253
- }), pe(), n.forEach((e) => ft(P, e)));
253
+ }), me(), n.forEach((e) => dt(P, e)));
254
254
  }
255
- function ft(n, e) {
255
+ function dt(n, e) {
256
256
  if (!e.mock) return;
257
257
  const { url: t, mockTemplate: s } = e;
258
258
  if (t && s) {
259
- const r = Re(`${t}(.*)`), o = Fe(t, { decode: decodeURIComponent }), a = R(s, {}, !0);
259
+ const r = Ae(`${t}(.*)`), o = Ie(t, { decode: decodeURIComponent }), a = C(s, {}, !0);
260
260
  n.mock(r, (i) => {
261
- const u = b.parse(i.url) || {}, c = i.body instanceof FormData ? xe(i.body) : i.body, p = o(i.url)?.params;
261
+ const u = R.parse(i.url) || {}, c = i.body instanceof FormData ? Oe(i.body) : i.body, p = o(i.url)?.params;
262
262
  return Object.assign(i, { data: c, params: u, query: p }), n.mock(a(i));
263
263
  });
264
264
  }
265
265
  }
266
- function pe() {
266
+ function me() {
267
267
  P && (P._mocked = {});
268
268
  }
269
- const dt = {
269
+ const pt = {
270
270
  session: !1,
271
271
  authKey: "Authorization",
272
272
  storageKey: "ACCESS_STORAGE",
@@ -276,13 +276,13 @@ const dt = {
276
276
  redirectParam: "r",
277
277
  unauthorizedCode: 401,
278
278
  unauthorizedMessage: "登录已经失效,请重新登录!"
279
- }, he = Symbol("access");
280
- class ps {
279
+ }, ve = Symbol("access");
280
+ class hs {
281
281
  options;
282
282
  data = null;
283
283
  mode = _.Raw;
284
284
  constructor(e) {
285
- this.options = Object.assign({}, dt, e), this.loadData();
285
+ this.options = Object.assign({}, pt, e), this.loadData();
286
286
  }
287
287
  connect(e) {
288
288
  const { mode: t, router: s, request: r } = e;
@@ -290,17 +290,17 @@ class ps {
290
290
  }
291
291
  login(e) {
292
292
  const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
293
- this.setData(e), this.data && (k.save(t, e, {
293
+ this.setData(e), this.data && (T.save(t, e, {
294
294
  type: "local",
295
295
  prefix: s
296
- }), r && T.set(o, this.data.token));
296
+ }), r && k.set(o, this.data.token));
297
297
  }
298
298
  clear() {
299
299
  const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
300
- this.data = null, k.remove(e, {
300
+ this.data = null, T.remove(e, {
301
301
  type: "local",
302
302
  prefix: t
303
- }), s && T.remove(r);
303
+ }), s && k.remove(r);
304
304
  }
305
305
  logout() {
306
306
  this.clear(), this.toLogin();
@@ -317,7 +317,7 @@ class ps {
317
317
  return Q(e).some((r) => t[r]);
318
318
  }
319
319
  install(e) {
320
- e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(he, this);
320
+ e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(ve, this);
321
321
  }
322
322
  isAuthPath(e) {
323
323
  const { auth: t, isAuth: s } = this.options;
@@ -336,12 +336,16 @@ class ps {
336
336
  typeof e == "function" ? e(s) : location.href = t ? `${e}${s}` : e;
337
337
  }
338
338
  setData(e) {
339
- const { crypto: t } = this.options;
339
+ const { privateKey: t } = this.options;
340
+ if (Array.isArray(e) && t) {
341
+ const s = e.map((r) => X(r, t));
342
+ this.data = JSON.parse(s.join(""));
343
+ return;
344
+ }
340
345
  if (typeof e == "string")
341
346
  try {
342
- this.data = JSON.parse(
343
- t ? Ie(e, De(t.toLowerCase())) : e
344
- );
347
+ const s = t ? X(e, t) : e;
348
+ s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
345
349
  } catch (s) {
346
350
  console.warn(s);
347
351
  }
@@ -349,7 +353,7 @@ class ps {
349
353
  this.data = e;
350
354
  }
351
355
  loadData() {
352
- const { storageKey: e, storagePrefix: t } = this.options, s = k.get(e, {
356
+ const { storageKey: e, storagePrefix: t } = this.options, s = T.get(e, {
353
357
  type: "local",
354
358
  prefix: t
355
359
  });
@@ -357,14 +361,23 @@ class ps {
357
361
  }
358
362
  isLogined() {
359
363
  const { session: e, authKey: t } = this.options;
360
- return e && t ? !!T.get(t) : !!this.data;
364
+ return e && t ? !!k.get(t) : !!this.data;
365
+ }
366
+ hasRoutePermission(e) {
367
+ if (e.name === de) {
368
+ const t = e.params.id;
369
+ return t && this.can(t);
370
+ }
371
+ return !0;
361
372
  }
362
373
  setGuard(e) {
363
374
  e.beforeEach((t, s, r) => this.guard(t, r));
364
375
  }
365
376
  guard(e, t) {
366
- if (this.isWhiteList(e) || this.isLogined() || this.isAuthPath(e))
377
+ if (this.isWhiteList(e) || this.isAuthPath(e))
367
378
  return t();
379
+ if (this.isLogined())
380
+ return this.hasRoutePermission(e) ? t() : (this.showTip("无权限访问该页面"), t(!1));
368
381
  t(!1), this.toLogin();
369
382
  }
370
383
  isWhiteList(e) {
@@ -376,11 +389,15 @@ class ps {
376
389
  return e.status === t || e.data.code === t;
377
390
  }
378
391
  async showUnauthorizedAlert(e) {
379
- const { alert: t, unauthorizedMessage: s = "登录已失效" } = this.options;
380
- this.isUnauthorized(e) && t && (await re(150), await t(s, {
392
+ const { unauthorizedMessage: t = "登录已失效" } = this.options;
393
+ this.isUnauthorized(e) && (await this.showTip(t), this.toLogin());
394
+ }
395
+ async showTip(e) {
396
+ const { alert: t } = this.options;
397
+ t && (await oe(150), await t(e, {
381
398
  title: "提示",
382
399
  type: "warning"
383
- }).catch((r) => r), this.toLogin());
400
+ }).catch((s) => s));
384
401
  }
385
402
  setRequest(e) {
386
403
  e.useRequest((t) => (this.data?.token && (t.headers[this.options.authKey] = this.data?.token), t)), e.useResponse(
@@ -392,10 +409,10 @@ class ps {
392
409
  );
393
410
  }
394
411
  }
395
- function pt() {
396
- return oe(he, null);
412
+ function ht() {
413
+ return ie(ve, null);
397
414
  }
398
- class ht {
415
+ class mt {
399
416
  __id = null;
400
417
  __mode;
401
418
  __instance = null;
@@ -424,7 +441,7 @@ class ht {
424
441
  const { mode: t, dsl: s, attrs: r } = e;
425
442
  this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
426
443
  }
427
- setup(e, t = O) {
444
+ setup(e, t = D) {
428
445
  const s = t.getCurrentInstance();
429
446
  if (!s) return;
430
447
  this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
@@ -438,12 +455,12 @@ class ht {
438
455
  });
439
456
  }
440
457
  __proxy() {
441
- this.__instance && ee.forEach((e) => {
458
+ this.__instance && te.forEach((e) => {
442
459
  this[e] = this.__instance?.[e];
443
460
  });
444
461
  }
445
462
  __cleanup() {
446
- ee.forEach((e) => {
463
+ te.forEach((e) => {
447
464
  this[e] = null;
448
465
  });
449
466
  }
@@ -451,22 +468,22 @@ class ht {
451
468
  if (e)
452
469
  if (this.__mode === _.Runtime) {
453
470
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
454
- return te({ type: s, value: r }, this);
471
+ return se({ type: s, value: r }, this);
455
472
  } else
456
- return te(e, this);
473
+ return se(e, this);
457
474
  }
458
475
  __parseExpression(e) {
459
476
  if (e)
460
477
  if (this.__mode === _.Runtime) {
461
478
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
462
- return R({ type: s, value: r }, this);
479
+ return C({ type: s, value: r }, this);
463
480
  } else
464
- return R(e, this);
481
+ return C(e, this);
465
482
  }
466
483
  __ref(e = null, t) {
467
484
  if (this.__mode !== _.VNode)
468
485
  return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
469
- await re(0);
486
+ await oe(0);
470
487
  let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
471
488
  if (!r) {
472
489
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
@@ -495,7 +512,7 @@ class ht {
495
512
  }
496
513
  function N(n) {
497
514
  const {
498
- Vue: e = O,
515
+ Vue: e = D,
499
516
  mode: t = _.Runtime,
500
517
  components: s = {},
501
518
  libs: r = {},
@@ -505,22 +522,22 @@ function N(n) {
505
522
  $components: s,
506
523
  $libs: r,
507
524
  $apis: o
508
- }, c = new ht({
525
+ }, c = new mt({
509
526
  mode: t,
510
527
  dsl: i.value,
511
528
  attrs: u
512
529
  }), p = e.defineComponent({
513
530
  name: i.value.name,
514
531
  props: {
515
- ...vt(i.value.props ?? [], c)
532
+ ...gt(i.value.props ?? [], c)
516
533
  },
517
534
  setup(l) {
518
- c.$props = l, c.props = l, i.value.id && de(
535
+ c.$props = l, c.props = l, i.value.id && he(
519
536
  n.window || window,
520
537
  i.value.id,
521
538
  i.value.css || ""
522
- ), c.state = gt(e, i.value.state ?? {}, c);
523
- const f = yt(e, i.value.computed ?? {}, c), m = _t(i.value.methods ?? {}, c), d = wt(e, i.value.inject, c), h = St(
539
+ ), c.state = yt(e, i.value.state ?? {}, c);
540
+ const f = _t(e, i.value.computed ?? {}, c), m = wt(i.value.methods ?? {}, c), d = St(e, i.value.inject, c), h = $t(
524
541
  i.value.dataSources || {},
525
542
  c
526
543
  ), w = {
@@ -529,28 +546,28 @@ function N(n) {
529
546
  ...m,
530
547
  ...h
531
548
  };
532
- return c.setup(w, e), $t(e, i.value.watch ?? [], c), {
549
+ return c.setup(w, e), jt(e, i.value.watch ?? [], c), {
533
550
  vtj: c
534
551
  };
535
552
  },
536
- emits: mt(i.value.emits),
553
+ emits: vt(i.value.emits),
537
554
  expose: ["vtj"],
538
555
  render() {
539
556
  if (!i.value.nodes) return null;
540
557
  const l = i.value.nodes || [];
541
- return l.length === 1 ? A(l[0], c, e, a) : l.map((f) => A(f, c, e, a));
558
+ return l.length === 1 ? x(l[0], c, e, a) : l.map((f) => x(f, c, e, a));
542
559
  },
543
- ...jt(i.value.lifeCycles ?? {}, c)
560
+ ...Et(i.value.lifeCycles ?? {}, c)
544
561
  });
545
562
  return {
546
563
  renderer: e.markRaw(p),
547
564
  context: c
548
565
  };
549
566
  }
550
- function mt(n = []) {
567
+ function vt(n = []) {
551
568
  return n.map((e) => $(e) ? e : e.name);
552
569
  }
553
- function vt(n = [], e) {
570
+ function gt(n = [], e) {
554
571
  const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => Ye[o]) : void 0;
555
572
  return n.map((s) => $(s) ? {
556
573
  name: s
@@ -568,7 +585,7 @@ function vt(n = [], e) {
568
585
  {}
569
586
  );
570
587
  }
571
- function gt(n, e, t) {
588
+ function yt(n, e, t) {
572
589
  return n.reactive(
573
590
  Object.keys(e || {}).reduce(
574
591
  (s, r) => {
@@ -579,19 +596,19 @@ function gt(n, e, t) {
579
596
  )
580
597
  );
581
598
  }
582
- function yt(n, e, t) {
599
+ function _t(n, e, t) {
583
600
  return Object.entries(e ?? {}).reduce(
584
601
  (s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
585
602
  {}
586
603
  );
587
604
  }
588
- function _t(n, e) {
605
+ function wt(n, e) {
589
606
  return Object.entries(n ?? {}).reduce(
590
607
  (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
591
608
  {}
592
609
  );
593
610
  }
594
- function wt(n, e = [], t) {
611
+ function St(n, e = [], t) {
595
612
  return e.reduce(
596
613
  (s, r) => {
597
614
  const { name: o, from: a } = r || {};
@@ -602,7 +619,7 @@ function wt(n, e = [], t) {
602
619
  {}
603
620
  );
604
621
  }
605
- function St(n, e) {
622
+ function $t(n, e) {
606
623
  return Object.keys(n).reduce(
607
624
  (t, s) => {
608
625
  const r = n[s], o = e.$apis[r.ref], a = M(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
@@ -614,7 +631,7 @@ function St(n, e) {
614
631
  {}
615
632
  );
616
633
  }
617
- function $t(n, e = [], t) {
634
+ function jt(n, e = [], t) {
618
635
  e.forEach((s) => {
619
636
  n.watch(
620
637
  t.__parseExpression(s.source),
@@ -626,27 +643,27 @@ function $t(n, e = [], t) {
626
643
  );
627
644
  });
628
645
  }
629
- function jt(n, e) {
646
+ function Et(n, e) {
630
647
  return Object.entries(n ?? {}).reduce(
631
648
  (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
632
649
  {}
633
650
  );
634
651
  }
635
- let B = [];
636
- const Et = (n) => n;
637
- async function me(n, e = window) {
652
+ let U = [];
653
+ const Pt = (n) => n;
654
+ async function ge(n, e = window) {
638
655
  const { urls: t = [], library: s } = n, r = t.filter((i) => z(i));
639
656
  if (r.length === 0 || !s) return null;
640
657
  const o = t.filter((i) => V(i));
641
- return o.length && st(o, e), await nt(r, s, e).catch(
658
+ return o.length && nt(o, e), await rt(r, s, e).catch(
642
659
  (i) => (console.warn("loadScriptUrl error", r, s, i), null)
643
660
  );
644
661
  }
645
662
  function L(n) {
646
663
  const { getDsl: e, getDslByUrl: t, options: s } = n;
647
- return s.window && (B.forEach((r) => {
664
+ return s.window && (U.forEach((r) => {
648
665
  delete s.window[r];
649
- }), B = []), (r, o, a = O) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
666
+ }), U = []), (r, o, a = D) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
650
667
  const i = await e(o.id);
651
668
  return i && (i.name = r), i ? N({
652
669
  ...s,
@@ -664,14 +681,14 @@ function L(n) {
664
681
  mode: _.Runtime,
665
682
  loader: L(n)
666
683
  }).renderer : null;
667
- }) : o.type === "Plugin" ? (o.library && B.push(o.library), a.defineAsyncComponent(async () => {
668
- const i = await me(o, s.window);
684
+ }) : o.type === "Plugin" ? (o.library && U.push(o.library), a.defineAsyncComponent(async () => {
685
+ const i = await ge(o, s.window);
669
686
  return i || (console.warn("getPlugin result is null", o), null);
670
687
  })) : r;
671
688
  }
672
- function A(n, e, t = O, s = Et) {
689
+ function x(n, e, t = D, s = Pt) {
673
690
  if (!n || !n.name || n.invisible) return null;
674
- const { id: r = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: u, vModels: c, vBind: p } = Pt(o);
691
+ const { id: r = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: u, vModels: c, vBind: p } = Rt(o);
675
692
  if (a && !bt(a, e))
676
693
  return null;
677
694
  const l = (f) => {
@@ -681,16 +698,16 @@ function A(n, e, t = O, s = Et) {
681
698
  if (n.name === "slot") return n.name;
682
699
  const g = s(n.name, n.from, t);
683
700
  return $(g) ? m[g] ?? g : g;
684
- })(), h = Rt(r, n.props ?? {}, f), w = Ft(t, n.events ?? {}, f);
701
+ })(), h = Ft(r, n.props ?? {}, f), w = At(t, n.events ?? {}, f);
685
702
  if (n.name === "slot")
686
- return xt(t, n, h, f, s);
703
+ return It(t, n, h, f, s);
687
704
  p && Object.assign(h, f.__parseExpression(p.value)), u && (h.style = Object.assign(
688
705
  h.style ?? {},
689
- Dt(u, f)
706
+ xt(u, f)
690
707
  )), c.forEach((g) => {
691
- Object.assign(h, At(t, g, f));
708
+ Object.assign(h, Dt(t, g, f));
692
709
  });
693
- const v = Ot(
710
+ const v = Ht(
694
711
  t,
695
712
  n.children ?? [],
696
713
  f,
@@ -701,7 +718,7 @@ function A(n, e, t = O, s = Et) {
701
718
  };
702
719
  return i ? kt(i, l, e) : l(e);
703
720
  }
704
- function Pt(n = []) {
721
+ function Rt(n = []) {
705
722
  const e = n.find((i) => j(i.name) === "vIf"), t = n.find((i) => j(i.name) === "vFor"), s = n.find((i) => j(i.name) === "vShow"), r = n.find((i) => j(i.name) === "vBind"), o = n.filter((i) => j(i.name) === "vModel"), a = n.filter(
706
723
  (i) => !Ge.includes(j(i.name))
707
724
  );
@@ -720,7 +737,7 @@ function bt(n, e) {
720
737
  function Ct(n, e) {
721
738
  return e ? S(e) ? n.__parseExpression(e) : e : "div";
722
739
  }
723
- function Rt(n, e, t) {
740
+ function Ft(n, e, t) {
724
741
  const s = Object.keys(e || {}).reduce(
725
742
  (r, o) => {
726
743
  let a = e[o];
@@ -730,7 +747,7 @@ function Rt(n, e, t) {
730
747
  );
731
748
  return s.ref = t.__ref(n, s.ref), s;
732
749
  }
733
- function Ft(n, e, t) {
750
+ function At(n, e, t) {
734
751
  const s = ["passive", "capture", "once"], r = {
735
752
  capture: "Capture",
736
753
  once: "Once",
@@ -738,70 +755,70 @@ function Ft(n, e, t) {
738
755
  };
739
756
  return Object.keys(e || {}).reduce(
740
757
  (o, a) => {
741
- const i = e[a], u = ve(i.modifiers), c = u.find((f) => s.includes(f)), p = "on" + Ae(a) + (c && r[c] || ""), l = t.__parseFunction(i.handler);
758
+ const i = e[a], u = ye(i.modifiers), c = u.find((f) => s.includes(f)), p = "on" + xe(a) + (c && r[c] || ""), l = t.__parseFunction(i.handler);
742
759
  return l && (o[p] = n.withModifiers(l, u)), o;
743
760
  },
744
761
  {}
745
762
  );
746
763
  }
747
- function ve(n = {}, e = !1) {
764
+ function ye(n = {}, e = !1) {
748
765
  const t = Object.keys(n);
749
766
  return e ? t.map((s) => "." + s) : t;
750
767
  }
751
- function xt(n, e, t, s, r) {
752
- const { children: o } = e, a = It(e, s), i = s.$slots?.[a.name];
768
+ function It(n, e, t, s, r) {
769
+ const { children: o } = e, a = Ot(e, s), i = s.$slots?.[a.name];
753
770
  return i ? i(t) : o ? $(o) ? n.createTextVNode(o) : S(o) ? n.createTextVNode(
754
- fe(s.__parseExpression(o))
771
+ pe(s.__parseExpression(o))
755
772
  ) : Array.isArray(o) ? o.map(
756
- (u) => A(u, s, n, r)
773
+ (u) => x(u, s, n, r)
757
774
  ) : null : null;
758
775
  }
759
- function It(n, e) {
776
+ function Ot(n, e) {
760
777
  const { props: t } = n, s = t?.name || "default";
761
778
  return {
762
779
  name: S(s) ? e.__parseExpression(s) : s,
763
780
  params: []
764
781
  };
765
782
  }
766
- function Dt(n, e) {
783
+ function xt(n, e) {
767
784
  return e.__parseExpression(n.value) ? {} : {
768
785
  display: "none"
769
786
  };
770
787
  }
771
- function At(n, e, t) {
788
+ function Dt(n, e, t) {
772
789
  const s = {
773
790
  type: "JSFunction",
774
791
  value: e.value?.value ? `(v) => {
775
792
  ${e.value.value} = v;
776
793
  }` : "(v) => {}"
777
- }, r = t.__parseFunction(s), o = ve(e.modifiers), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
794
+ }, r = t.__parseFunction(s), o = ye(e.modifiers), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
778
795
  return {
779
796
  [a]: t.__parseExpression(e.value),
780
797
  [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
781
798
  };
782
799
  }
783
- function Ot(n, e, t, s, r) {
800
+ function Ht(n, e, t, s, r) {
784
801
  if (!e) return null;
785
802
  if ($(e))
786
803
  return { default: () => e };
787
804
  if (S(e))
788
805
  return {
789
- default: () => fe(t.__parseExpression(e))
806
+ default: () => pe(t.__parseExpression(e))
790
807
  };
791
808
  if (Array.isArray(e) && e.length > 0) {
792
- const o = Ht(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
809
+ const o = Mt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
793
810
  [`scope_${r.id}`]: i
794
811
  } : {};
795
812
  return Object.entries(o).reduce((i, [u, { nodes: c, params: p }]) => (i[u] = (l) => {
796
- const f = p.length ? Oe(l ?? {}, p) : a(l);
813
+ const f = p.length ? De(l ?? {}, p) : a(l);
797
814
  return c.map(
798
- (m) => A(m, t.__clone(f), n, s)
815
+ (m) => x(m, t.__clone(f), n, s)
799
816
  );
800
817
  }, i), {});
801
818
  }
802
819
  return null;
803
820
  }
804
- function Ht(n) {
821
+ function Mt(n) {
805
822
  const e = {
806
823
  default: {
807
824
  params: [],
@@ -809,7 +826,7 @@ function Ht(n) {
809
826
  }
810
827
  };
811
828
  for (const t of n) {
812
- const s = Mt(t.slot), r = s.name;
829
+ const s = Tt(t.slot), r = s.name;
813
830
  e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
814
831
  nodes: [t],
815
832
  params: s.params
@@ -817,7 +834,7 @@ function Ht(n) {
817
834
  }
818
835
  return e;
819
836
  }
820
- function Mt(n = "default") {
837
+ function Tt(n = "default") {
821
838
  return $(n) ? { name: n, params: [] } : { params: [], ...n };
822
839
  }
823
840
  function kt(n, e, t) {
@@ -825,53 +842,53 @@ function kt(n, e, t) {
825
842
  let i = t.__parseExpression(s) || [];
826
843
  return Number.isInteger(i) && (i = new Array(i).fill(!0).map((u, c) => c + 1)), Array.isArray(i) ? i.map((u, c) => e(t.__clone({ [o]: u, [a]: c }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
827
844
  }
828
- function Tt(n) {
845
+ function Ut(n) {
829
846
  return Le() ? (qe(n), !0) : !1;
830
847
  }
831
848
  function K(n) {
832
849
  return typeof n == "function" ? n() : Je(n);
833
850
  }
834
- const ge = typeof window < "u" && typeof document < "u";
851
+ const _e = typeof window < "u" && typeof document < "u";
835
852
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
836
- const Bt = (n) => n != null, Ut = () => {
853
+ const Bt = (n) => n != null, Nt = () => {
837
854
  };
838
- function Nt(n) {
839
- return ie();
855
+ function Lt(n) {
856
+ return ae();
840
857
  }
841
- function Lt(...n) {
858
+ function qt(...n) {
842
859
  if (n.length !== 1)
843
- return Te(...n);
860
+ return ke(...n);
844
861
  const e = n[0];
845
- return typeof e == "function" ? Be(Ue(() => ({ get: e, set: Ut }))) : J(e);
862
+ return typeof e == "function" ? Ue(Be(() => ({ get: e, set: Nt }))) : J(e);
846
863
  }
847
- function qt(n, e) {
848
- Nt() && Ne(n, e);
864
+ function Jt(n, e) {
865
+ Lt() && Ne(n, e);
849
866
  }
850
- const Jt = ge ? window : void 0, Vt = ge ? window.document : void 0;
851
- function zt(n) {
867
+ const Vt = _e ? window : void 0, zt = _e ? window.document : void 0;
868
+ function Kt(n) {
852
869
  var e;
853
870
  const t = K(n);
854
871
  return (e = t?.$el) != null ? e : t;
855
872
  }
856
- function Kt() {
857
- const n = J(!1), e = ie();
873
+ function Wt() {
874
+ const n = J(!1), e = ae();
858
875
  return e && Ve(() => {
859
876
  n.value = !0;
860
877
  }, e), n;
861
878
  }
862
- function Wt(n) {
863
- const e = Kt();
864
- return ce(() => (e.value, !!n()));
879
+ function Gt(n) {
880
+ const e = Wt();
881
+ return ue(() => (e.value, !!n()));
865
882
  }
866
- function Gt(n, e, t = {}) {
867
- const { window: s = Jt, ...r } = t;
883
+ function Yt(n, e, t = {}) {
884
+ const { window: s = Vt, ...r } = t;
868
885
  let o;
869
- const a = Wt(() => s && "MutationObserver" in s), i = () => {
886
+ const a = Gt(() => s && "MutationObserver" in s), i = () => {
870
887
  o && (o.disconnect(), o = void 0);
871
- }, u = ce(() => {
872
- const f = K(n), m = (Array.isArray(f) ? f : [f]).map(zt).filter(Bt);
888
+ }, u = ue(() => {
889
+ const f = K(n), m = (Array.isArray(f) ? f : [f]).map(Kt).filter(Bt);
873
890
  return new Set(m);
874
- }), c = ae(
891
+ }), c = ce(
875
892
  () => u.value,
876
893
  (f) => {
877
894
  i(), a.value && f.size && (o = new MutationObserver(e), f.forEach((m) => o.observe(m, r)));
@@ -880,48 +897,48 @@ function Gt(n, e, t = {}) {
880
897
  ), p = () => o?.takeRecords(), l = () => {
881
898
  c(), i();
882
899
  };
883
- return Tt(l), {
900
+ return Ut(l), {
884
901
  isSupported: a,
885
902
  stop: l,
886
903
  takeRecords: p
887
904
  };
888
905
  }
889
- function Yt(n = null, e = {}) {
906
+ function Qt(n = null, e = {}) {
890
907
  var t, s, r;
891
908
  const {
892
- document: o = Vt,
909
+ document: o = zt,
893
910
  restoreOnUnmount: a = (l) => l
894
- } = e, i = (t = o?.title) != null ? t : "", u = Lt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
911
+ } = e, i = (t = o?.title) != null ? t : "", u = qt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
895
912
  function p(l) {
896
913
  if (!("titleTemplate" in e))
897
914
  return l;
898
915
  const f = e.titleTemplate || "%s";
899
916
  return typeof f == "function" ? f(l) : K(f).replace(/%s/g, l);
900
917
  }
901
- return ae(
918
+ return ce(
902
919
  u,
903
920
  (l, f) => {
904
921
  l !== f && o && (o.title = p(typeof l == "string" ? l : ""));
905
922
  },
906
923
  { immediate: !0 }
907
- ), e.observe && !e.titleTemplate && o && !c && Gt(
924
+ ), e.observe && !e.titleTemplate && o && !c && Yt(
908
925
  (r = o.head) == null ? void 0 : r.querySelector("title"),
909
926
  () => {
910
927
  o && o.title !== u.value && (u.value = p(o.title));
911
928
  },
912
929
  { childList: !0 }
913
- ), qt(() => {
930
+ ), Jt(() => {
914
931
  if (a) {
915
932
  const l = a(i, u.value || "");
916
933
  l != null && o && (o.title = l);
917
934
  }
918
935
  }), u;
919
936
  }
920
- const se = ue({
937
+ const ne = le({
921
938
  name: "VtjPageContainer",
922
939
  async setup() {
923
- const n = _e(), e = le(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null;
924
- return s && Yt(s.title || "VTJ"), {
940
+ const n = Se(), e = fe(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null;
941
+ return s && Qt(s.title || "VTJ"), {
925
942
  provider: n,
926
943
  component: r,
927
944
  file: s,
@@ -929,16 +946,16 @@ const se = ue({
929
946
  };
930
947
  },
931
948
  render() {
932
- return this.component ? U(this.component, this.query) : U("div", "页面不存在");
949
+ return this.component ? B(this.component, this.query) : B("div", "页面不存在");
933
950
  }
934
- }), Qt = ue({
951
+ }), Xt = le({
935
952
  name: "VtjStartupContainer",
936
953
  render() {
937
- return U(We);
954
+ return B(We);
938
955
  }
939
- }), ye = Symbol("Provider");
940
- var Xt = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(Xt || {});
941
- class Zt extends $e {
956
+ }), we = Symbol("Provider");
957
+ var Zt = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(Zt || {});
958
+ class es extends Ee {
942
959
  constructor(e) {
943
960
  super(), this.options = e;
944
961
  const {
@@ -962,7 +979,7 @@ class Zt extends $e {
962
979
  mode;
963
980
  globals = {};
964
981
  modules = {};
965
- adapter = { request: it, jsonp: He };
982
+ adapter = { request: at, jsonp: He };
966
983
  apis = {};
967
984
  dependencies = {};
968
985
  materials = {};
@@ -979,7 +996,7 @@ class Zt extends $e {
979
996
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
980
997
  throw new Error("project is null");
981
998
  const { apis: s = [], meta: r = [] } = this.project, o = window;
982
- o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = ut(s, r, this.adapter), pe(), this.project.config?.mock && lt(s), this.initRouter(), this.triggerReady();
999
+ o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = lt(s, r, this.adapter), me(), this.project.config?.mock && ft(s), this.initRouter(), this.triggerReady();
983
1000
  }
984
1001
  async loadDependencies(e) {
985
1002
  const t = Object.entries(this.dependencies);
@@ -993,7 +1010,7 @@ class Zt extends $e {
993
1010
  materials: p,
994
1011
  materialExports: l,
995
1012
  materialMapLibrary: f
996
- } = Ze(
1013
+ } = et(
997
1014
  t,
998
1015
  a,
999
1016
  i === "development"
@@ -1008,15 +1025,15 @@ class Zt extends $e {
1008
1025
  else {
1009
1026
  const v = c[d] || [];
1010
1027
  for (const g of v)
1011
- V(g) && await tt(d, b.append(g, { v: C })), z(g) && await X(b.append(g, { v: C }));
1028
+ V(g) && await st(d, R.append(g, { v: b })), z(g) && await Z(R.append(g, { v: b }));
1012
1029
  r[d] = e[d];
1013
1030
  }
1014
1031
  }
1015
1032
  for (const d of p)
1016
- await X(b.append(d, { v: C }));
1033
+ await Z(R.append(d, { v: b }));
1017
1034
  const m = this.materials || {};
1018
1035
  for (const d of l) {
1019
- const h = e[f[d]], w = je[d];
1036
+ const h = e[f[d]], w = Pe[d];
1020
1037
  if (w)
1021
1038
  h && w.forEach((v) => {
1022
1039
  o[v] = h[v];
@@ -1024,7 +1041,7 @@ class Zt extends $e {
1024
1041
  else {
1025
1042
  const v = m[d] ? (await m[d]()).default : e[d];
1026
1043
  v && h && (v.components || []).forEach((g) => {
1027
- o[g.name] = et(g, h);
1044
+ o[g.name] = tt(g, h);
1028
1045
  });
1029
1046
  }
1030
1047
  }
@@ -1033,19 +1050,19 @@ class Zt extends $e {
1033
1050
  const { router: e, project: t } = this;
1034
1051
  e && (e.addRoute({
1035
1052
  path: "/page/:id",
1036
- name: "VtjPage",
1037
- component: se
1053
+ name: de,
1054
+ component: ne
1038
1055
  }), e.addRoute({
1039
1056
  path: "/",
1040
- name: "VtjHomepage",
1041
- component: t?.homepage ? se : Qt
1057
+ name: Qe,
1058
+ component: t?.homepage ? ne : Xt
1042
1059
  }));
1043
1060
  }
1044
1061
  install(e) {
1045
1062
  const t = e.config.globalProperties.installed || {};
1046
1063
  for (const [s, r] of Object.entries(this.library))
1047
- !t[s] && rt(r) && (e.use(r), t[s] = !0);
1048
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(ye, this), e.config.globalProperties.installed = t, this.nodeEnv === "development" && (e.config.errorHandler = (s, r, o) => {
1064
+ !t[s] && ot(r) && (e.use(r), t[s] = !0);
1065
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(we, this), e.config.globalProperties.installed = t, this.nodeEnv === "development" && (e.config.errorHandler = (s, r, o) => {
1049
1066
  const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", u = `[ ${a} ] ${i} ${o}`;
1050
1067
  console.error(
1051
1068
  "[VTJ Error]:",
@@ -1056,7 +1073,7 @@ class Zt extends $e {
1056
1073
  },
1057
1074
  s?.stack
1058
1075
  ), H.error({
1059
- title: "运行时错误:请在控制台查看详情",
1076
+ title: "未处理的异常:请在控制台查看详情",
1060
1077
  message: u
1061
1078
  });
1062
1079
  });
@@ -1121,32 +1138,32 @@ class Zt extends $e {
1121
1138
  async getRenderComponent(e) {
1122
1139
  const t = this.getFile(e);
1123
1140
  if (!t)
1124
- return D.warn(`Can not find file: ${e}`), null;
1141
+ return O.warn(`Can not find file: ${e}`), null;
1125
1142
  const s = `.vtj/vue/${e}.vue`, r = this.modules[s];
1126
1143
  if (r)
1127
1144
  return (await r())?.default;
1128
1145
  const o = await this.getDsl(t.id);
1129
- return o ? this.createDslRenderer(o).renderer : (D.warn(`Can not find dsl: ${e}`), null);
1146
+ return o ? this.createDslRenderer(o).renderer : (O.warn(`Can not find dsl: ${e}`), null);
1130
1147
  }
1131
1148
  defineUrlSchemaComponent(e, t) {
1132
- return Z(async () => {
1149
+ return ee(async () => {
1133
1150
  const s = await this.getDslByUrl(e);
1134
1151
  return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1135
1152
  });
1136
1153
  }
1137
1154
  definePluginComponent(e) {
1138
- return Z(async () => await me(e, window));
1155
+ return ee(async () => await ge(e, window));
1139
1156
  }
1140
1157
  }
1141
- function hs(n) {
1142
- const e = new Zt(n);
1158
+ function ms(n) {
1159
+ const e = new es(n);
1143
1160
  return {
1144
1161
  provider: e,
1145
1162
  onReady: (s) => e.ready(s)
1146
1163
  };
1147
1164
  }
1148
- function _e(n = {}) {
1149
- const e = oe(ye);
1165
+ function Se(n = {}) {
1166
+ const e = ie(we);
1150
1167
  if (!e)
1151
1168
  throw new Error("Can not find provider");
1152
1169
  if (e.nodeEnv === "development") {
@@ -1174,7 +1191,7 @@ const W = new Me({
1174
1191
  });
1175
1192
  }
1176
1193
  }
1177
- }), es = (n = "/__vtj__/api/:type.json") => (e, t) => W.send({
1194
+ }), ts = (n = "/__vtj__/api/:type.json") => (e, t) => W.send({
1178
1195
  url: n,
1179
1196
  method: "post",
1180
1197
  params: { type: e },
@@ -1182,7 +1199,7 @@ const W = new Me({
1182
1199
  type: e,
1183
1200
  data: t
1184
1201
  }
1185
- }), ts = (n = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
1202
+ }), ss = (n = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
1186
1203
  url: n,
1187
1204
  method: "post",
1188
1205
  data: {
@@ -1198,7 +1215,7 @@ class G {
1198
1215
  pluginCaches = {};
1199
1216
  uploader;
1200
1217
  constructor() {
1201
- this.api = es(), this.uploader = ts();
1218
+ this.api = ts(), this.uploader = ss();
1202
1219
  }
1203
1220
  async getExtension() {
1204
1221
  console.log("BaseService.getExtension");
@@ -1271,7 +1288,7 @@ class G {
1271
1288
  return await this.api("clearStaticFiles", e).catch(() => "");
1272
1289
  }
1273
1290
  async getPluginMaterial(e) {
1274
- const { urls: t = [] } = e, s = t.filter((o) => Qe(o))[0];
1291
+ const { urls: t = [] } = e, s = t.filter((o) => Xe(o))[0];
1275
1292
  if (!s) return null;
1276
1293
  const r = this.pluginCaches[s];
1277
1294
  return r || (this.pluginCaches[s] = W.send({
@@ -1284,12 +1301,12 @@ class G {
1284
1301
  }).then((o) => o.data).catch(() => null));
1285
1302
  }
1286
1303
  }
1287
- const y = new ke({
1304
+ const y = new Te({
1288
1305
  type: "local",
1289
1306
  expired: 0,
1290
1307
  prefix: "__VTJ_"
1291
1308
  });
1292
- class ms extends G {
1309
+ class vs extends G {
1293
1310
  init(e) {
1294
1311
  const t = new I(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1295
1312
  return y.save(`project_${t.id}`, r), Promise.resolve(r);
@@ -1323,7 +1340,7 @@ class ms extends G {
1323
1340
  return Promise.resolve(!0);
1324
1341
  }
1325
1342
  getHistory(e) {
1326
- const t = y.get(`history_${e}`), s = new ne(t || { id: e });
1343
+ const t = y.get(`history_${e}`), s = new re(t || { id: e });
1327
1344
  return Promise.resolve(s.toDsl());
1328
1345
  }
1329
1346
  getHistoryItem(e, t) {
@@ -1339,7 +1356,7 @@ class ms extends G {
1339
1356
  }), Promise.resolve(!0);
1340
1357
  }
1341
1358
  }
1342
- class ss extends G {
1359
+ class ns extends G {
1343
1360
  projects = {};
1344
1361
  materials = {};
1345
1362
  files = {};
@@ -1378,7 +1395,7 @@ class ss extends G {
1378
1395
  return Promise.resolve(!0);
1379
1396
  }
1380
1397
  getHistory(e) {
1381
- const t = this.histories[e], s = new ne(t || { id: e });
1398
+ const t = this.histories[e], s = new re(t || { id: e });
1382
1399
  return Promise.resolve(s);
1383
1400
  }
1384
1401
  getHistoryItem(e, t) {
@@ -1396,11 +1413,11 @@ class ss extends G {
1396
1413
  }), Promise.resolve(!0);
1397
1414
  }
1398
1415
  }
1399
- let x = null;
1400
- function vs() {
1401
- return x || (x = new ss(), x);
1416
+ let A = null;
1417
+ function gs() {
1418
+ return A || (A = new ns(), A);
1402
1419
  }
1403
- class gs extends G {
1420
+ class ys extends G {
1404
1421
  getFileCaches = {};
1405
1422
  async getExtension() {
1406
1423
  return await this.api("getExtension", {}).catch(() => {
@@ -1455,7 +1472,7 @@ class gs extends G {
1455
1472
  );
1456
1473
  }
1457
1474
  }
1458
- function we(n = []) {
1475
+ function $e(n = []) {
1459
1476
  return n.map((e) => {
1460
1477
  const { id: t, title: s, icon: r, children: o, hidden: a } = e;
1461
1478
  return {
@@ -1464,23 +1481,23 @@ function we(n = []) {
1464
1481
  icon: r,
1465
1482
  hidden: a,
1466
1483
  url: `/page/${t}`,
1467
- children: o && o.length ? we(o) : void 0
1484
+ children: o && o.length ? $e(o) : void 0
1468
1485
  };
1469
1486
  });
1470
1487
  }
1471
- function Se(n, e) {
1488
+ function je(n, e) {
1472
1489
  if (!e) return n;
1473
1490
  let t = [];
1474
1491
  for (const s of n)
1475
1492
  if (s.children && s.children.length) {
1476
- const r = Se(s.children, e);
1493
+ const r = je(s.children, e);
1477
1494
  r.length && (s.children = r, t.push(s));
1478
1495
  } else
1479
1496
  e[s.id] && t.push(s);
1480
1497
  return t;
1481
1498
  }
1482
- function ys() {
1483
- const n = _e(), e = le(), t = pt(), s = J(!1), r = t?.getData(), o = n.project;
1499
+ function _s() {
1500
+ const n = Se(), e = fe(), t = ht(), s = J(!1), r = t?.getData(), o = n.project;
1484
1501
  ze(() => {
1485
1502
  const { name: u, params: c, meta: p } = e;
1486
1503
  if (u === "VtjPage") {
@@ -1492,69 +1509,71 @@ function ys() {
1492
1509
  } else
1493
1510
  s.value = !p.mask;
1494
1511
  });
1495
- const a = we(o?.pages), i = o?.config;
1512
+ const a = $e(o?.pages), i = o?.config;
1496
1513
  return {
1497
1514
  disabled: s,
1498
1515
  logo: i?.logo,
1499
1516
  themeSwitchable: i?.themeSwitchable,
1500
1517
  title: i?.title || o?.description || o?.name || "VTJ App",
1501
- menus: Se(a, r?.permissions)
1518
+ menus: je(a, r?.permissions)
1502
1519
  };
1503
1520
  }
1504
1521
  export {
1505
- he as ACCESS_KEY,
1506
- ps as Access,
1522
+ ve as ACCESS_KEY,
1523
+ hs as Access,
1507
1524
  Ge as BUILT_IN_DIRECTIVES,
1508
1525
  G as BaseService,
1509
- ee as CONTEXT_HOST,
1510
- ht as Context,
1526
+ te as CONTEXT_HOST,
1527
+ mt as Context,
1511
1528
  _ as ContextMode,
1512
1529
  Ye as DATA_TYPES,
1513
- ds as JSCodeToString,
1514
- us as LIFE_CYCLES_LIST,
1515
- gs as LocalService,
1516
- ss as MemoryService,
1517
- Xt as NodeEnv,
1518
- Zt as Provider,
1519
- ms as StorageService,
1520
- C as VTJ_RENDERER_VERSION,
1521
- de as adoptedStyleSheets,
1522
- ls as createAssetScripts,
1523
- fs as createAssetsCss,
1524
- St as createDataSources,
1530
+ Qe as HOMEPAGE_ROUTE_NAME,
1531
+ ps as JSCodeToString,
1532
+ ls as LIFE_CYCLES_LIST,
1533
+ ys as LocalService,
1534
+ ns as MemoryService,
1535
+ Zt as NodeEnv,
1536
+ de as PAGE_ROUTE_NAME,
1537
+ es as Provider,
1538
+ vs as StorageService,
1539
+ b as VTJ_RENDERER_VERSION,
1540
+ he as adoptedStyleSheets,
1541
+ fs as createAssetScripts,
1542
+ ds as createAssetsCss,
1543
+ $t as createDataSources,
1525
1544
  L as createLoader,
1526
- vs as createMemoryService,
1527
- ct as createMetaApi,
1528
- hs as createProvider,
1545
+ gs as createMemoryService,
1546
+ ut as createMetaApi,
1547
+ ms as createProvider,
1529
1548
  N as createRenderer,
1530
- at as createSchemaApi,
1531
- ut as createSchemaApis,
1532
- Et as defaultLoader,
1549
+ ct as createSchemaApi,
1550
+ lt as createSchemaApis,
1551
+ Pt as defaultLoader,
1533
1552
  F as fillBasePath,
1534
- ve as getModifiers,
1535
- me as getPlugin,
1536
- et as getRawComponent,
1553
+ ye as getModifiers,
1554
+ ge as getPlugin,
1555
+ tt as getRawComponent,
1537
1556
  V as isCSSUrl,
1538
- ot as isJSCode,
1557
+ it as isJSCode,
1539
1558
  S as isJSExpression,
1540
1559
  M as isJSFunction,
1541
- Qe as isJSON,
1560
+ Xe as isJSON,
1542
1561
  z as isJSUrl,
1543
- rt as isVuePlugin,
1544
- tt as loadCss,
1545
- st as loadCssUrl,
1546
- nt as loadScriptUrl,
1547
- ft as mockApi,
1548
- lt as mockApis,
1549
- pe as mockCleanup,
1550
- A as nodeRender,
1551
- Ze as parseDeps,
1552
- R as parseExpression,
1553
- te as parseFunction,
1554
- ye as providerKey,
1555
- Xe as removeProdFlag,
1556
- fe as toString,
1557
- pt as useAccess,
1558
- ys as useMask,
1559
- _e as useProvider
1562
+ ot as isVuePlugin,
1563
+ st as loadCss,
1564
+ nt as loadCssUrl,
1565
+ rt as loadScriptUrl,
1566
+ dt as mockApi,
1567
+ ft as mockApis,
1568
+ me as mockCleanup,
1569
+ x as nodeRender,
1570
+ et as parseDeps,
1571
+ C as parseExpression,
1572
+ se as parseFunction,
1573
+ we as providerKey,
1574
+ Ze as removeProdFlag,
1575
+ pe as toString,
1576
+ ht as useAccess,
1577
+ _s as useMask,
1578
+ Se as useProvider
1560
1579
  };