@vtj/renderer 0.8.129 → 0.8.131

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,5 +1,5 @@
1
1
  import { Base as he, BUILT_IN_COMPONENTS as ve, ProjectModel as I, HistoryModel as ee } from "@vtj/core";
2
- import { isUrl as ye, url as b, dedupArray as ge, isString as S, isFunction as K, logger as H, createRequest as _e, merge as we, pathToRegexp as Se, pathToRegexpMatch as $e, formDataToJson as je, delay as Ee, camelCase as j, upperFirst as be, pick as Pe, jsonp as Ce, loadScript as Q, Request as Re, Storage as Fe, mapToObject as N } from "@vtj/utils";
2
+ import { isUrl as ye, url as b, dedupArray as ge, isString as $, isFunction as K, logger as H, createRequest as _e, merge as we, pathToRegexp as Se, pathToRegexpMatch as $e, formDataToJson as je, delay as Ee, camelCase as j, upperFirst as be, pick as Pe, jsonp as Ce, loadScript as Q, Request as Re, Storage as Fe, mapToObject as N } from "@vtj/utils";
3
3
  import * as M from "vue";
4
4
  import { toRef as Ie, readonly as He, customRef as xe, ref as q, onBeforeUnmount as Oe, getCurrentScope as Me, onScopeDispose as De, unref as ke, getCurrentInstance as te, watch as ne, computed as re, onMounted as Te, defineComponent as se, h as A, inject as Ae, defineAsyncComponent as X, watchEffect as Be } from "vue";
5
5
  import { useRoute as oe } from "vue-router";
@@ -10,11 +10,11 @@ import { XStartup as Ne } from "@vtj/ui";
10
10
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
11
11
  * @name @vtj/renderer
12
12
  * @author CHC chenhuachun1549@dingtalk.com
13
- * @version 0.8.129
13
+ * @version 0.8.131
14
14
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
15
15
  */
16
- const P = "0.8.129";
17
- var _ = /* @__PURE__ */ ((r) => (r.Runtime = "Runtime", r.Design = "Design", r.Raw = "Raw", r.VNode = "VNode", r))(_ || {});
16
+ const P = "0.8.131";
17
+ var S = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(S || {});
18
18
  const Y = [
19
19
  "$el",
20
20
  "$emit",
@@ -27,7 +27,7 @@ const Y = [
27
27
  "$props",
28
28
  "$options",
29
29
  "$forceUpdate"
30
- ], Zt = [
30
+ ], tn = [
31
31
  "beforeCreate",
32
32
  "created",
33
33
  "beforeMount",
@@ -50,87 +50,90 @@ const Y = [
50
50
  Function,
51
51
  Date
52
52
  };
53
- function R(r, e) {
54
- return r.map((t) => ye(t) || t.startsWith("/") ? t : `${e}${t}`);
53
+ function R(n, e) {
54
+ return n.map((t) => ye(t) || t.startsWith("/") ? t : `${e}${t}`);
55
55
  }
56
- function J(r) {
57
- return /\.css$/.test(r);
56
+ function J(n) {
57
+ return /\.css$/.test(n);
58
58
  }
59
- function L(r) {
60
- return /\.js$/.test(r);
59
+ function L(n) {
60
+ return /\.js$/.test(n);
61
61
  }
62
- function Le(r) {
63
- return /\.json$/.test(r);
62
+ function Le(n) {
63
+ return /\.json$/.test(n);
64
64
  }
65
- function en(r) {
66
- return r.map(
65
+ function nn(n) {
66
+ return n.map(
67
67
  (e) => `<script src="${b.append(e, { v: P })}"><\/script>`
68
68
  ).join("");
69
69
  }
70
- function tn(r = []) {
71
- return r.map(
70
+ function rn(n = []) {
71
+ return n.map(
72
72
  (e) => `<link rel="stylesheet" href="${b.append(e, { v: P })}" />`
73
73
  ).join("");
74
74
  }
75
- function Ve(r, e) {
76
- const t = r.filter((u) => !!u.enabled), n = [], s = [], o = [], a = [], i = {}, l = {}, c = [], d = {};
77
- return t.forEach(
78
- ({ urls: u, assetsUrl: f, library: p, assetsLibrary: h, localeLibrary: m }) => {
75
+ function Ve(n, e = !1) {
76
+ return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
77
+ }
78
+ function We(n, e, t = !1) {
79
+ const r = n.filter((u) => !!u.enabled), s = [], o = [], a = [], i = [], l = {}, c = {}, d = [], f = {};
80
+ return r.forEach(
81
+ ({ urls: u, assetsUrl: h, library: p, assetsLibrary: m, localeLibrary: _ }) => {
79
82
  u?.forEach((v) => {
80
- L(v) && n.push(v), J(v) && s.push(v);
81
- }), p && (a.push(p), i[p] = R(u || [], e), m && (l[p] = m)), f && o.push(f), h && c.push(h), p && h && (d[h] = p);
83
+ L(v) && s.push(Ve(v, t)), J(v) && o.push(v);
84
+ }), p && (i.push(p), l[p] = R(u || [], e), _ && (c[p] = _)), h && a.push(h), m && d.push(m), p && m && (f[m] = p);
82
85
  }
83
86
  ), {
84
- scripts: R(n, e),
85
- css: R(s, e),
86
- materials: R(o, e),
87
- libraryExports: a,
88
- materialExports: ge(c),
89
- materialMapLibrary: d,
90
- libraryMap: i,
91
- libraryLocaleMap: l
87
+ scripts: R(s, e),
88
+ css: R(o, e),
89
+ materials: R(a, e),
90
+ libraryExports: i,
91
+ materialExports: ge(d),
92
+ materialMapLibrary: f,
93
+ libraryMap: l,
94
+ libraryLocaleMap: c
92
95
  };
93
96
  }
94
- function We(r, e) {
95
- const { name: t, parent: n, alias: s } = r;
96
- return n ? e[n]?.[s || t] : e[s || t];
97
+ function Ge(n, e) {
98
+ const { name: t, parent: r, alias: s } = n;
99
+ return r ? e[r]?.[s || t] : e[s || t];
97
100
  }
98
- function ie(r) {
99
- return S(r) ? r : JSON.stringify(r);
101
+ function ie(n) {
102
+ return $(n) ? n : JSON.stringify(n);
100
103
  }
101
- function ae(r, e, t) {
102
- const n = r.CSSStyleSheet;
103
- if (n.prototype.replaceSync) {
104
- const s = new n();
104
+ function ae(n, e, t) {
105
+ const r = n.CSSStyleSheet;
106
+ if (r.prototype.replaceSync) {
107
+ const s = new r();
105
108
  s.id = e, s.replaceSync(t);
106
- const o = r.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
109
+ const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
107
110
  (l) => l.id !== e
108
111
  );
109
112
  o.adoptedStyleSheets = [...i, s];
110
113
  } else {
111
- const s = r.document;
114
+ const s = n.document;
112
115
  let o = s.getElementById(e);
113
116
  o ? o.innerHTML = t : (o = s.createElement("style"), o.id = e, o.innerHTML = t, s.head.appendChild(o));
114
117
  }
115
118
  }
116
- async function Ge(r, e) {
117
- const t = await window.fetch(e).then((n) => n.text()).catch(() => "");
118
- t && ae(window, r, t);
119
+ async function Ke(n, e) {
120
+ const t = await window.fetch(e).then((r) => r.text()).catch(() => "");
121
+ t && ae(window, n, t);
119
122
  }
120
- function Ke(r, e = window) {
121
- const t = e.document, n = e.document.head;
122
- for (const s of r)
123
+ function Qe(n, e = window) {
124
+ const t = e.document, r = e.document.head;
125
+ for (const s of n)
123
126
  if (!t.getElementById(s)) {
124
127
  const a = t.createElement("link");
125
- a.rel = "stylesheet", a.id = s, a.href = s, n.appendChild(a);
128
+ a.rel = "stylesheet", a.id = s, a.href = s, r.appendChild(a);
126
129
  }
127
130
  }
128
- async function Qe(r, e, t = window) {
129
- const n = t.document, s = t.document.head;
131
+ async function Xe(n, e, t = window) {
132
+ const r = t.document, s = t.document.head;
130
133
  let o = t[e];
131
134
  return o ? o.default || o : new Promise((a, i) => {
132
- for (const l of r) {
133
- const c = n.createElement("script");
135
+ for (const l of n) {
136
+ const c = r.createElement("script");
134
137
  c.src = l, c.onload = () => {
135
138
  o = t[e], o ? a(o.default || o) : i(null);
136
139
  }, c.onerror = (d) => {
@@ -139,58 +142,58 @@ async function Qe(r, e, t = window) {
139
142
  }
140
143
  });
141
144
  }
142
- function Xe(r) {
143
- return K(r) || K(r?.install);
145
+ function Ye(n) {
146
+ return K(n) || K(n?.install);
144
147
  }
145
- function C(r, e, t = !1, n = !1) {
148
+ function C(n, e, t = !1, r = !1) {
146
149
  try {
147
150
  const s = ['"use strict";', "var __self = arguments[0];"];
148
151
  s.push("return ");
149
- let o = (r.value || "").trim();
152
+ let o = (n.value || "").trim();
150
153
  o = o.replace(/this(\W|$)/g, (i, l) => `__self${l}`), o = s.join(`
151
154
  `) + o;
152
155
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
153
156
  return new Function("$scope", a)(e);
154
157
  } catch (s) {
155
- if (H.error("parseExpression.error", s, r, e?.__self ?? e), n)
158
+ if (H.error("parseExpression.error", s, n, e?.__self ?? e), r)
156
159
  throw s;
157
160
  }
158
161
  }
159
- function z(r, e, t = !1, n = !1) {
160
- const s = C(r, e, t, n);
162
+ function z(n, e, t = !1, r = !1) {
163
+ const s = C(n, e, t, r);
161
164
  if (typeof s != "function" && (H.error(
162
165
  "parseFunction.error",
163
166
  "not a function",
164
- r,
167
+ n,
165
168
  e?.__self ?? e
166
- ), n))
167
- throw new Error(`"${r.value}" not a function`);
169
+ ), r))
170
+ throw new Error(`"${n.value}" not a function`);
168
171
  return s;
169
172
  }
170
- function g(r) {
171
- return r && r.type === "JSExpression";
173
+ function w(n) {
174
+ return n && n.type === "JSExpression";
172
175
  }
173
- function k(r) {
174
- return typeof r == "object" && r && r.type === "JSFunction";
176
+ function k(n) {
177
+ return typeof n == "object" && n && n.type === "JSFunction";
175
178
  }
176
- function Ye(r) {
177
- return g(r) || k(r);
179
+ function ze(n) {
180
+ return w(n) || k(n);
178
181
  }
179
- function nn(r) {
180
- return Ye(r) ? r.value : JSON.stringify(r);
182
+ function sn(n) {
183
+ return ze(n) ? n.value : JSON.stringify(n);
181
184
  }
182
185
  let E = null;
183
- const ze = _e({
186
+ const Ze = _e({
184
187
  settings: {
185
188
  type: "form",
186
189
  validSuccess: !0,
187
190
  originResponse: !1,
188
191
  loading: !0,
189
- validate: (r) => r.data?.code === 0 || !!r.data?.success,
192
+ validate: (n) => n.data?.code === 0 || !!n.data?.success,
190
193
  failMessage: !0,
191
- showError: (r) => {
194
+ showError: (n) => {
192
195
  D.error({
193
- message: r || "未知错误"
196
+ message: n || "未知错误"
194
197
  });
195
198
  },
196
199
  showLoading: () => {
@@ -205,56 +208,56 @@ const ze = _e({
205
208
  }
206
209
  }
207
210
  });
208
- function Ze(r, e) {
209
- const { jsonp: t, request: n } = e;
210
- if (r.method === "jsonp")
211
- return (s = {}) => t(r.url, {
212
- ...r.jsonpOptions,
211
+ function et(n, e) {
212
+ const { jsonp: t, request: r } = e;
213
+ if (n.method === "jsonp")
214
+ return (s = {}) => t(n.url, {
215
+ ...n.jsonpOptions,
213
216
  query: s
214
217
  });
215
218
  {
216
- const s = r.headers ? C(r.headers, {}, !0) : void 0, o = {
217
- url: r.url,
218
- method: r.method,
219
+ const s = n.headers ? C(n.headers, {}, !0) : void 0, o = {
220
+ url: n.url,
221
+ method: n.method,
219
222
  settings: {
220
- ...r.settings,
223
+ ...n.settings,
221
224
  headers: s
222
225
  }
223
226
  };
224
- return (a, i) => n.send(we(o, i || {}, { data: a }));
227
+ return (a, i) => r.send(we(o, i || {}, { data: a }));
225
228
  }
226
229
  }
227
- function et(r, e) {
230
+ function tt(n, e) {
228
231
  const { metaQuery: t } = e;
229
232
  if (!t) return;
230
- const { code: n, queryCode: s } = r;
233
+ const { code: r, queryCode: s } = n;
231
234
  return (o, a) => {
232
235
  if (!t) {
233
236
  console.warn("adapter.metaQuery is not defined!");
234
237
  return;
235
238
  }
236
- return t(n, s, o, a);
239
+ return t(r, s, o, a);
237
240
  };
238
241
  }
239
- function tt(r = [], e = [], t) {
240
- const n = {};
241
- for (const s of r)
242
- n[s.id] = Ze(s, t);
242
+ function nt(n = [], e = [], t) {
243
+ const r = {};
244
+ for (const s of n)
245
+ r[s.id] = et(s, t);
243
246
  for (const s of e)
244
- n[s.id] = et(s, t);
245
- return n;
247
+ r[s.id] = tt(s, t);
248
+ return r;
246
249
  }
247
- function nt(r = []) {
250
+ function rt(n = []) {
248
251
  x.setup({
249
252
  timeout: "50-500"
250
- }), ce(), r.forEach((e) => rt(e));
253
+ }), ce(), n.forEach((e) => st(e));
251
254
  }
252
- function rt(r) {
253
- if (!r.mock) return;
254
- const { url: e, mockTemplate: t } = r;
255
+ function st(n) {
256
+ if (!n.mock) return;
257
+ const { url: e, mockTemplate: t } = n;
255
258
  if (e && t) {
256
- const n = Se(`${e}(.*)`), s = $e(e, { decode: decodeURIComponent }), o = C(t, {}, !0);
257
- x.mock(n, (a) => {
259
+ const r = Se(`${e}(.*)`), s = $e(e, { decode: decodeURIComponent }), o = C(t, {}, !0);
260
+ x.mock(r, (a) => {
258
261
  const i = b.parse(a.url) || {}, l = a.body instanceof FormData ? je(a.body) : a.body, c = s(a.url)?.params;
259
262
  return Object.assign(a, { data: l, params: i, query: c }), x.mock(o(a));
260
263
  });
@@ -263,7 +266,7 @@ function rt(r) {
263
266
  function ce() {
264
267
  x._mocked = {};
265
268
  }
266
- class st {
269
+ class ot {
267
270
  __id = null;
268
271
  __mode;
269
272
  __instance = null;
@@ -289,14 +292,14 @@ class st {
289
292
  $apis = {};
290
293
  __transform = {};
291
294
  constructor(e) {
292
- const { mode: t, dsl: n, attrs: s } = e;
293
- this.__mode = t, n && (this.__id = n.id || null, this.__transform = n.transform || {}), s && Object.assign(this, s);
295
+ const { mode: t, dsl: r, attrs: s } = e;
296
+ this.__mode = t, r && (this.__id = r.id || null, this.__transform = r.transform || {}), s && Object.assign(this, s);
294
297
  }
295
298
  setup(e, t = M) {
296
- const n = t.getCurrentInstance();
297
- if (!n) return;
298
- this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = n.proxy;
299
- const s = n.appContext.config.globalProperties;
299
+ const r = t.getCurrentInstance();
300
+ if (!r) return;
301
+ this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = r.proxy;
302
+ const s = r.appContext.config.globalProperties;
300
303
  Object.assign(this, s), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
301
304
  this.__proxy();
302
305
  }), t.onUnmounted(() => {
@@ -317,164 +320,164 @@ class st {
317
320
  }
318
321
  __parseFunction(e) {
319
322
  if (e)
320
- if (this.__mode === _.Runtime) {
321
- const { id: t, type: n } = e, s = t ? this.__transform[t] ?? e.value : e.value;
322
- return z({ type: n, value: s }, this);
323
+ if (this.__mode === S.Runtime) {
324
+ const { id: t, type: r } = e, s = t ? this.__transform[t] ?? e.value : e.value;
325
+ return z({ type: r, value: s }, this);
323
326
  } else
324
327
  return z(e, this);
325
328
  }
326
329
  __parseExpression(e) {
327
330
  if (e)
328
- if (this.__mode === _.Runtime) {
329
- const { id: t, type: n } = e, s = t ? this.__transform[t] ?? e.value : e.value;
330
- return C({ type: n, value: s }, this);
331
+ if (this.__mode === S.Runtime) {
332
+ const { id: t, type: r } = e, s = t ? this.__transform[t] ?? e.value : e.value;
333
+ return C({ type: r, value: s }, this);
331
334
  } else
332
335
  return C(e, this);
333
336
  }
334
337
  __ref(e = null, t) {
335
- if (this.__mode !== _.VNode)
336
- return e && e !== this.__id && (this.__contextRefs[e] = this), async (n) => {
338
+ if (this.__mode !== S.VNode)
339
+ return e && e !== this.__id && (this.__contextRefs[e] = this), async (r) => {
337
340
  await Ee(0);
338
- let s = n?.$vtjEl || n?.$el || n?._?.vnode?.el || n;
341
+ let s = r?.$vtjEl || r?.$el || r?._?.vnode?.el || r;
339
342
  if (!s) {
340
343
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
341
344
  return;
342
345
  }
343
- if (s.nodeType === 3 && s.nextSibling && (s = s.nextSibling), s.__vtj__ = e, _.Design === this.__mode && (s.__context__ = this), e && (this.__refs[e] = n), typeof t == "function")
344
- t(n);
346
+ if (s.nodeType === 3 && s.nextSibling && (s = s.nextSibling), s.__vtj__ = e, S.Design === this.__mode && (s.__context__ = this), e && (this.__refs[e] = r), typeof t == "function")
347
+ t(r);
345
348
  else if (t) {
346
349
  const o = this.$refs[t];
347
350
  if (o) {
348
- const a = new Set([].concat(o, n));
351
+ const a = new Set([].concat(o, r));
349
352
  this.$refs[t] = Array.from(a);
350
353
  } else
351
- this.$refs[t] = n;
354
+ this.$refs[t] = r;
352
355
  }
353
- return n;
356
+ return r;
354
357
  };
355
358
  }
356
359
  __clone(e = {}) {
357
- const t = { ...this.context, ...e }, n = {
360
+ const t = { ...this.context, ...e }, r = {
358
361
  ...t,
359
362
  context: t
360
363
  };
361
- return n.context.__proto__ = this.context, n.__proto__ = this, n;
364
+ return r.context.__proto__ = this.context, r.__proto__ = this, r;
362
365
  }
363
366
  }
364
- function B(r) {
367
+ function B(n) {
365
368
  const {
366
369
  Vue: e = M,
367
- mode: t = _.Runtime,
368
- components: n = {},
370
+ mode: t = S.Runtime,
371
+ components: r = {},
369
372
  libs: s = {},
370
373
  apis: o = {},
371
374
  loader: a
372
- } = r, i = e.computed(() => r.dsl), l = {
373
- $components: n,
375
+ } = n, i = e.computed(() => n.dsl), l = {
376
+ $components: r,
374
377
  $libs: s,
375
378
  $apis: o
376
- }, c = new st({
379
+ }, c = new ot({
377
380
  mode: t,
378
381
  dsl: i.value,
379
382
  attrs: l
380
383
  }), d = e.defineComponent({
381
384
  name: i.value.name,
382
385
  props: {
383
- ...it(i.value.props ?? [], c)
386
+ ...at(i.value.props ?? [], c)
384
387
  },
385
- setup(u) {
386
- c.$props = u, c.props = u, i.value.id && ae(
387
- r.window || window,
388
+ setup(f) {
389
+ c.$props = f, c.props = f, i.value.id && ae(
390
+ n.window || window,
388
391
  i.value.id,
389
392
  i.value.css || ""
390
- ), c.state = at(e, i.value.state ?? {}, c);
391
- const f = ct(e, i.value.computed ?? {}, c), p = lt(i.value.methods ?? {}, c), h = ut(e, i.value.inject, c), m = ft(
393
+ ), c.state = ct(e, i.value.state ?? {}, c);
394
+ const u = lt(e, i.value.computed ?? {}, c), h = ut(i.value.methods ?? {}, c), p = ft(e, i.value.inject, c), m = pt(
392
395
  i.value.dataSources || {},
393
396
  c
394
- ), v = {
395
- ...h,
396
- ...f,
397
+ ), _ = {
397
398
  ...p,
399
+ ...u,
400
+ ...h,
398
401
  ...m
399
402
  };
400
- return c.setup(v, e), pt(e, i.value.watch ?? [], c), {
403
+ return c.setup(_, e), dt(e, i.value.watch ?? [], c), {
401
404
  vtj: c
402
405
  };
403
406
  },
404
- emits: ot(i.value.emits),
407
+ emits: it(i.value.emits),
405
408
  expose: ["vtj"],
406
409
  render() {
407
410
  if (!i.value.nodes) return null;
408
- const u = i.value.nodes || [];
409
- return u.length === 1 ? O(u[0], c, e, a) : u.map((f) => O(f, c, e, a));
411
+ const f = i.value.nodes || [];
412
+ return f.length === 1 ? O(f[0], c, e, a) : f.map((u) => O(u, c, e, a));
410
413
  },
411
- ...dt(i.value.lifeCycles ?? {}, c)
414
+ ...mt(i.value.lifeCycles ?? {}, c)
412
415
  });
413
416
  return {
414
417
  renderer: e.markRaw(d),
415
418
  context: c
416
419
  };
417
420
  }
418
- function ot(r = []) {
419
- return r.map((e) => S(e) ? e : e.name);
421
+ function it(n = []) {
422
+ return n.map((e) => $(e) ? e : e.name);
420
423
  }
421
- function it(r = [], e) {
422
- const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((o) => Je[o]) : void 0;
423
- return r.map((n) => S(n) ? {
424
- name: n
424
+ function at(n = [], e) {
425
+ const t = (r) => r ? (Array.isArray(r) ? r : [r]).map((o) => Je[o]) : void 0;
426
+ return n.map((r) => $(r) ? {
427
+ name: r
425
428
  } : {
426
- name: n.name,
427
- type: n.type,
428
- required: n.required,
429
- default: g(n.default) ? e.__parseExpression(n.default) : n.default
429
+ name: r.name,
430
+ type: r.type,
431
+ required: r.required,
432
+ default: w(r.default) ? e.__parseExpression(r.default) : r.default
430
433
  }).reduce(
431
- (n, s) => (n[s.name] = {
434
+ (r, s) => (r[s.name] = {
432
435
  type: t(s.type),
433
436
  required: s.required,
434
437
  default: s.default
435
- }, n),
438
+ }, r),
436
439
  {}
437
440
  );
438
441
  }
439
- function at(r, e, t) {
440
- return r.reactive(
442
+ function ct(n, e, t) {
443
+ return n.reactive(
441
444
  Object.keys(e || {}).reduce(
442
- (n, s) => {
445
+ (r, s) => {
443
446
  let o = e[s];
444
- return g(o) ? o = t.__parseExpression(o) : k(o) && (o = t.__parseFunction(o)), n[s] = o, n;
447
+ return w(o) ? o = t.__parseExpression(o) : k(o) && (o = t.__parseFunction(o)), r[s] = o, r;
445
448
  },
446
449
  {}
447
450
  )
448
451
  );
449
452
  }
450
- function ct(r, e, t) {
453
+ function lt(n, e, t) {
451
454
  return Object.entries(e ?? {}).reduce(
452
- (n, [s, o]) => (n[s] = r.computed(t.__parseFunction(o)), n),
455
+ (r, [s, o]) => (r[s] = n.computed(t.__parseFunction(o)), r),
453
456
  {}
454
457
  );
455
458
  }
456
- function lt(r, e) {
457
- return Object.entries(r ?? {}).reduce(
458
- (t, [n, s]) => (t[n] = e.__parseFunction(s), t),
459
+ function ut(n, e) {
460
+ return Object.entries(n ?? {}).reduce(
461
+ (t, [r, s]) => (t[r] = e.__parseFunction(s), t),
459
462
  {}
460
463
  );
461
464
  }
462
- function ut(r, e = [], t) {
465
+ function ft(n, e = [], t) {
463
466
  return e.reduce(
464
- (n, s) => {
467
+ (r, s) => {
465
468
  const { name: o, from: a } = s || {};
466
469
  s.default;
467
- const i = g(a) ? t.__parseExpression(a) || o : a ?? o, l = g(s.default) ? t.__parseExpression(s.default) : s.default ?? null;
468
- return n[o] = r.inject(i, l), n;
470
+ const i = w(a) ? t.__parseExpression(a) || o : a ?? o, l = w(s.default) ? t.__parseExpression(s.default) : s.default ?? null;
471
+ return r[o] = n.inject(i, l), r;
469
472
  },
470
473
  {}
471
474
  );
472
475
  }
473
- function ft(r, e) {
474
- return Object.keys(r).reduce(
475
- (t, n) => {
476
- const s = r[n], o = e.$apis[s.ref], a = k(s.transform) ? s.transform.value ? e.__parseFunction(s.transform) : void 0 : s.transform;
477
- return t[n] = async (...i) => {
476
+ function pt(n, e) {
477
+ return Object.keys(n).reduce(
478
+ (t, r) => {
479
+ const s = n[r], o = e.$apis[s.ref], a = k(s.transform) ? s.transform.value ? e.__parseFunction(s.transform) : void 0 : s.transform;
480
+ return t[r] = async (...i) => {
478
481
  const l = await o.apply(e, i);
479
482
  return a ? a(l) : l;
480
483
  }, t;
@@ -482,335 +485,336 @@ function ft(r, e) {
482
485
  {}
483
486
  );
484
487
  }
485
- function pt(r, e = [], t) {
486
- e.forEach((n) => {
487
- r.watch(
488
- t.__parseExpression(n.source),
489
- t.__parseFunction(n.handler),
488
+ function dt(n, e = [], t) {
489
+ e.forEach((r) => {
490
+ n.watch(
491
+ t.__parseExpression(r.source),
492
+ t.__parseFunction(r.handler),
490
493
  {
491
- deep: n.deep,
492
- immediate: n.immediate
494
+ deep: r.deep,
495
+ immediate: r.immediate
493
496
  }
494
497
  );
495
498
  });
496
499
  }
497
- function dt(r, e) {
498
- return Object.entries(r ?? {}).reduce(
499
- (t, [n, s]) => (t[n] = e.__parseFunction(s), t),
500
+ function mt(n, e) {
501
+ return Object.entries(n ?? {}).reduce(
502
+ (t, [r, s]) => (t[r] = e.__parseFunction(s), t),
500
503
  {}
501
504
  );
502
505
  }
503
506
  let T = [];
504
- const mt = (r) => r;
505
- async function le(r, e = window) {
506
- const { urls: t = [], library: n } = r, s = t.filter((i) => L(i));
507
- if (s.length === 0 || !n) return null;
507
+ const ht = (n) => n;
508
+ async function le(n, e = window) {
509
+ const { urls: t = [], library: r } = n, s = t.filter((i) => L(i));
510
+ if (s.length === 0 || !r) return null;
508
511
  const o = t.filter((i) => J(i));
509
- return o.length && Ke(o, e), await Qe(s, n, e).catch(
510
- (i) => (console.warn("loadScriptUrl error", s, n, i), null)
512
+ return o.length && Qe(o, e), await Xe(s, r, e).catch(
513
+ (i) => (console.warn("loadScriptUrl error", s, r, i), null)
511
514
  );
512
515
  }
513
- function U(r) {
514
- const { getDsl: e, getDslByUrl: t, options: n } = r;
515
- return n.window && (T.forEach((s) => {
516
- delete n.window[s];
516
+ function U(n) {
517
+ const { getDsl: e, getDslByUrl: t, options: r } = n;
518
+ return r.window && (T.forEach((s) => {
519
+ delete r.window[s];
517
520
  }), T = []), (s, o, a = M) => !o || typeof o == "string" ? s : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
518
521
  const i = await e(o.id);
519
522
  return i && (i.name = s), i ? B({
520
- ...n,
523
+ ...r,
521
524
  Vue: a,
522
525
  dsl: i,
523
- mode: _.Runtime,
524
- loader: U(r)
526
+ mode: S.Runtime,
527
+ loader: U(n)
525
528
  }).renderer : null;
526
529
  }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
527
530
  const i = await t(o.url);
528
531
  return i && (i.name = s), i ? B({
529
- ...n,
532
+ ...r,
530
533
  Vue: a,
531
534
  dsl: i,
532
- mode: _.Runtime,
533
- loader: U(r)
535
+ mode: S.Runtime,
536
+ loader: U(n)
534
537
  }).renderer : null;
535
538
  }) : o.type === "Plugin" ? (o.library && T.push(o.library), a.defineAsyncComponent(async () => {
536
- const i = await le(o, n.window);
539
+ const i = await le(o, r.window);
537
540
  return i || (console.warn("getPlugin result is null", o), null);
538
541
  })) : s;
539
542
  }
540
- function O(r, e, t = M, n = mt) {
541
- if (!r || !r.name || r.invisible) return null;
542
- const { id: s = null, directives: o = [] } = r, { vIf: a, vFor: i, vShow: l, vModels: c, vBind: d } = ht(o);
543
- if (a && !vt(a, e))
543
+ function O(n, e, t = M, r = ht) {
544
+ if (!n || !n.name || n.invisible) return null;
545
+ const { id: s = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: l, vModels: c, vBind: d } = vt(o);
546
+ if (a && !yt(a, e))
544
547
  return null;
545
- const u = (f) => {
546
- const p = f.$components, h = (() => {
547
- if (r.name === "component")
548
- return yt(f, r.props?.is);
549
- if (r.name === "slot") return r.name;
550
- const $ = n(r.name, r.from, t);
551
- return S($) ? p[$] ?? $ : $;
552
- })(), m = gt(s, r.props ?? {}, f), v = _t(t, r.events ?? {}, f);
553
- if (r.name === "slot")
554
- return wt(t, r, m, f, n);
555
- d && Object.assign(m, f.__parseExpression(d.value)), l && (m.style = Object.assign(
548
+ const f = (u) => {
549
+ const h = u.$components, p = (() => {
550
+ if (n.name === "component")
551
+ return gt(u, n.props?.is);
552
+ if (n.name === "slot") return n.name;
553
+ const y = r(n.name, n.from, t);
554
+ return $(y) ? h[y] ?? y : y;
555
+ })(), m = _t(s, n.props ?? {}, u), _ = wt(t, n.events ?? {}, u);
556
+ if (n.name === "slot")
557
+ return St(t, n, m, u, r);
558
+ d && Object.assign(m, u.__parseExpression(d.value)), l && (m.style = Object.assign(
556
559
  m.style ?? {},
557
- $t(l, f)
558
- )), c.forEach(($) => {
559
- Object.assign(m, jt(t, $, f));
560
+ jt(l, u)
561
+ )), c.forEach((y) => {
562
+ Object.assign(m, Et(t, y, u));
560
563
  });
561
- const w = Et(
564
+ const v = bt(
562
565
  t,
563
- r.children ?? [],
564
- f,
565
- n,
566
- r
566
+ n.children ?? [],
567
+ u,
568
+ r,
569
+ n
567
570
  );
568
- return t.createVNode(h, { ...m, ...v }, w);
571
+ return t.createVNode(p, { ...m, ..._ }, v);
569
572
  };
570
- return i ? Ct(i, u, e) : u(e);
573
+ return i ? Rt(i, f, e) : f(e);
571
574
  }
572
- function ht(r = []) {
573
- const e = r.find((i) => j(i.name) === "vIf"), t = r.find((i) => j(i.name) === "vFor"), n = r.find((i) => j(i.name) === "vShow"), s = r.find((i) => j(i.name) === "vBind"), o = r.filter((i) => j(i.name) === "vModel"), a = r.filter(
575
+ function vt(n = []) {
576
+ const e = n.find((i) => j(i.name) === "vIf"), t = n.find((i) => j(i.name) === "vFor"), r = n.find((i) => j(i.name) === "vShow"), s = n.find((i) => j(i.name) === "vBind"), o = n.filter((i) => j(i.name) === "vModel"), a = n.filter(
574
577
  (i) => !qe.includes(j(i.name))
575
578
  );
576
579
  return {
577
580
  vIf: e,
578
581
  vFor: t,
579
- vShow: n,
582
+ vShow: r,
580
583
  vModels: o,
581
584
  vBind: s,
582
585
  others: a
583
586
  };
584
587
  }
585
- function vt(r, e) {
586
- return !!e.__parseExpression(r.value);
588
+ function yt(n, e) {
589
+ return !!e.__parseExpression(n.value);
587
590
  }
588
- function yt(r, e) {
589
- return e ? g(e) ? r.__parseExpression(e) : e : "div";
591
+ function gt(n, e) {
592
+ return e ? w(e) ? n.__parseExpression(e) : e : "div";
590
593
  }
591
- function gt(r, e, t) {
592
- const n = Object.keys(e || {}).reduce(
594
+ function _t(n, e, t) {
595
+ const r = Object.keys(e || {}).reduce(
593
596
  (s, o) => {
594
597
  let a = e[o];
595
- return g(a) ? a = t.__parseExpression(a) : k(a) && (a = t.__parseFunction(a)), s[o] = a, s;
598
+ return w(a) ? a = t.__parseExpression(a) : k(a) && (a = t.__parseFunction(a)), s[o] = a, s;
596
599
  },
597
600
  {}
598
601
  );
599
- return n.ref = t.__ref(r, n.ref), n;
602
+ return r.ref = t.__ref(n, r.ref), r;
600
603
  }
601
- function _t(r, e, t) {
602
- const n = ["passive", "capture", "once"], s = {
604
+ function wt(n, e, t) {
605
+ const r = ["passive", "capture", "once"], s = {
603
606
  capture: "Capture",
604
607
  once: "Once",
605
608
  passive: "OnceCapture"
606
609
  };
607
610
  return Object.keys(e || {}).reduce(
608
611
  (o, a) => {
609
- const i = e[a], l = ue(i.modifiers), c = l.find((f) => n.includes(f)), d = "on" + be(a) + (c && s[c] || ""), u = t.__parseFunction(i.handler);
610
- return u && (o[d] = r.withModifiers(u, l)), o;
612
+ const i = e[a], l = ue(i.modifiers), c = l.find((u) => r.includes(u)), d = "on" + be(a) + (c && s[c] || ""), f = t.__parseFunction(i.handler);
613
+ return f && (o[d] = n.withModifiers(f, l)), o;
611
614
  },
612
615
  {}
613
616
  );
614
617
  }
615
- function ue(r = {}, e = !1) {
616
- const t = Object.keys(r);
617
- return e ? t.map((n) => "." + n) : t;
618
+ function ue(n = {}, e = !1) {
619
+ const t = Object.keys(n);
620
+ return e ? t.map((r) => "." + r) : t;
618
621
  }
619
- function wt(r, e, t, n, s) {
620
- const { children: o } = e, a = St(e, n), i = n.$slots?.[a.name];
621
- return i ? i(t) : o ? S(o) ? r.createTextVNode(o) : g(o) ? r.createTextVNode(
622
- ie(n.__parseExpression(o))
622
+ function St(n, e, t, r, s) {
623
+ const { children: o } = e, a = $t(e, r), i = r.$slots?.[a.name];
624
+ return i ? i(t) : o ? $(o) ? n.createTextVNode(o) : w(o) ? n.createTextVNode(
625
+ ie(r.__parseExpression(o))
623
626
  ) : Array.isArray(o) ? o.map(
624
- (l) => O(l, n, r, s)
627
+ (l) => O(l, r, n, s)
625
628
  ) : null : null;
626
629
  }
627
- function St(r, e) {
628
- const { props: t } = r, n = t?.name || "default";
630
+ function $t(n, e) {
631
+ const { props: t } = n, r = t?.name || "default";
629
632
  return {
630
- name: g(n) ? e.__parseExpression(n) : n,
633
+ name: w(r) ? e.__parseExpression(r) : r,
631
634
  params: []
632
635
  };
633
636
  }
634
- function $t(r, e) {
635
- return e.__parseExpression(r.value) ? {} : {
637
+ function jt(n, e) {
638
+ return e.__parseExpression(n.value) ? {} : {
636
639
  display: "none"
637
640
  };
638
641
  }
639
- function jt(r, e, t) {
640
- const n = {
642
+ function Et(n, e, t) {
643
+ const r = {
641
644
  type: "JSFunction",
642
645
  value: e.value?.value ? `(v) => {
643
646
  ${e.value.value} = v;
644
647
  }` : "(v) => {}"
645
- }, s = t.__parseFunction(n), o = ue(e.modifiers), a = g(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
648
+ }, s = t.__parseFunction(r), o = ue(e.modifiers), a = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
646
649
  return {
647
650
  [a]: t.__parseExpression(e.value),
648
- [`onUpdate:${a}`]: o.length && s ? r.withModifiers(s, o) : s
651
+ [`onUpdate:${a}`]: o.length && s ? n.withModifiers(s, o) : s
649
652
  };
650
653
  }
651
- function Et(r, e, t, n, s) {
654
+ function bt(n, e, t, r, s) {
652
655
  if (!e) return null;
653
- if (S(e))
656
+ if ($(e))
654
657
  return { default: () => e };
655
- if (g(e))
658
+ if (w(e))
656
659
  return {
657
660
  default: () => ie(t.__parseExpression(e))
658
661
  };
659
662
  if (Array.isArray(e) && e.length > 0) {
660
- const o = bt(e), a = (i) => !i || !s ? {} : s?.id && Object.keys(i).length ? {
663
+ const o = Pt(e), a = (i) => !i || !s ? {} : s?.id && Object.keys(i).length ? {
661
664
  [`scope_${s.id}`]: i
662
665
  } : {};
663
- return Object.entries(o).reduce((i, [l, { nodes: c, params: d }]) => (i[l] = (u) => {
664
- const f = d.length ? Pe(u ?? {}, d) : a(u);
666
+ return Object.entries(o).reduce((i, [l, { nodes: c, params: d }]) => (i[l] = (f) => {
667
+ const u = d.length ? Pe(f ?? {}, d) : a(f);
665
668
  return c.map(
666
- (p) => O(p, t.__clone(f), r, n)
669
+ (h) => O(h, t.__clone(u), n, r)
667
670
  );
668
671
  }, i), {});
669
672
  }
670
673
  return null;
671
674
  }
672
- function bt(r) {
675
+ function Pt(n) {
673
676
  const e = {
674
677
  default: {
675
678
  params: [],
676
679
  nodes: []
677
680
  }
678
681
  };
679
- for (const t of r) {
680
- const n = Pt(t.slot), s = n.name;
681
- e[s] ? (e[s].nodes.push(t), e[s].params = e[s].params.concat(n.params)) : e[s] = {
682
+ for (const t of n) {
683
+ const r = Ct(t.slot), s = r.name;
684
+ e[s] ? (e[s].nodes.push(t), e[s].params = e[s].params.concat(r.params)) : e[s] = {
682
685
  nodes: [t],
683
- params: n.params
686
+ params: r.params
684
687
  };
685
688
  }
686
689
  return e;
687
690
  }
688
- function Pt(r = "default") {
689
- return S(r) ? { name: r, params: [] } : { params: [], ...r };
691
+ function Ct(n = "default") {
692
+ return $(n) ? { name: n, params: [] } : { params: [], ...n };
690
693
  }
691
- function Ct(r, e, t) {
692
- const { value: n, iterator: s } = r, { item: o = "item", index: a = "index" } = s || {};
693
- let i = t.__parseExpression(n) || [];
694
- return Number.isInteger(i) && (i = new Array(i).fill(!0).map((l, c) => c + 1)), Array.isArray(i) ? i.map((l, c) => e(t.__clone({ [o]: l, [a]: c }))) : (console.warn("[vForRender]:", `${n?.value} is not a Arrary`), []);
694
+ function Rt(n, e, t) {
695
+ const { value: r, iterator: s } = n, { item: o = "item", index: a = "index" } = s || {};
696
+ let i = t.__parseExpression(r) || [];
697
+ 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]:", `${r?.value} is not a Arrary`), []);
695
698
  }
696
- function Rt(r) {
697
- return Me() ? (De(r), !0) : !1;
699
+ function Ft(n) {
700
+ return Me() ? (De(n), !0) : !1;
698
701
  }
699
- function V(r) {
700
- return typeof r == "function" ? r() : ke(r);
702
+ function V(n) {
703
+ return typeof n == "function" ? n() : ke(n);
701
704
  }
702
705
  const fe = typeof window < "u" && typeof document < "u";
703
706
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
704
- const Ft = (r) => r != null, It = () => {
707
+ const It = (n) => n != null, Ht = () => {
705
708
  };
706
- function Ht(r) {
709
+ function xt(n) {
707
710
  return te();
708
711
  }
709
- function xt(...r) {
710
- if (r.length !== 1)
711
- return Ie(...r);
712
- const e = r[0];
713
- return typeof e == "function" ? He(xe(() => ({ get: e, set: It }))) : q(e);
712
+ function Ot(...n) {
713
+ if (n.length !== 1)
714
+ return Ie(...n);
715
+ const e = n[0];
716
+ return typeof e == "function" ? He(xe(() => ({ get: e, set: Ht }))) : q(e);
714
717
  }
715
- function Ot(r, e) {
716
- Ht() && Oe(r, e);
718
+ function Mt(n, e) {
719
+ xt() && Oe(n, e);
717
720
  }
718
- function Mt(r) {
721
+ function Dt(n) {
719
722
  var e;
720
- const t = V(r);
723
+ const t = V(n);
721
724
  return (e = t?.$el) != null ? e : t;
722
725
  }
723
- const Dt = fe ? window : void 0, kt = fe ? window.document : void 0;
724
- function Tt() {
725
- const r = q(!1), e = te();
726
+ const kt = fe ? window : void 0, Tt = fe ? window.document : void 0;
727
+ function At() {
728
+ const n = q(!1), e = te();
726
729
  return e && Te(() => {
727
- r.value = !0;
728
- }, e), r;
730
+ n.value = !0;
731
+ }, e), n;
729
732
  }
730
- function At(r) {
731
- const e = Tt();
732
- return re(() => (e.value, !!r()));
733
+ function Bt(n) {
734
+ const e = At();
735
+ return re(() => (e.value, !!n()));
733
736
  }
734
- function Bt(r, e, t = {}) {
735
- const { window: n = Dt, ...s } = t;
737
+ function Ut(n, e, t = {}) {
738
+ const { window: r = kt, ...s } = t;
736
739
  let o;
737
- const a = At(() => n && "MutationObserver" in n), i = () => {
740
+ const a = Bt(() => r && "MutationObserver" in r), i = () => {
738
741
  o && (o.disconnect(), o = void 0);
739
742
  }, l = re(() => {
740
- const f = V(r), p = (Array.isArray(f) ? f : [f]).map(Mt).filter(Ft);
741
- return new Set(p);
743
+ const u = V(n), h = (Array.isArray(u) ? u : [u]).map(Dt).filter(It);
744
+ return new Set(h);
742
745
  }), c = ne(
743
746
  () => l.value,
744
- (f) => {
745
- i(), a.value && f.size && (o = new MutationObserver(e), f.forEach((p) => o.observe(p, s)));
747
+ (u) => {
748
+ i(), a.value && u.size && (o = new MutationObserver(e), u.forEach((h) => o.observe(h, s)));
746
749
  },
747
750
  { immediate: !0, flush: "post" }
748
- ), d = () => o?.takeRecords(), u = () => {
751
+ ), d = () => o?.takeRecords(), f = () => {
749
752
  c(), i();
750
753
  };
751
- return Rt(u), {
754
+ return Ft(f), {
752
755
  isSupported: a,
753
- stop: u,
756
+ stop: f,
754
757
  takeRecords: d
755
758
  };
756
759
  }
757
- function Ut(r = null, e = {}) {
758
- var t, n, s;
760
+ function Nt(n = null, e = {}) {
761
+ var t, r, s;
759
762
  const {
760
- document: o = kt,
761
- restoreOnUnmount: a = (u) => u
762
- } = e, i = (t = o?.title) != null ? t : "", l = xt((n = r ?? o?.title) != null ? n : null), c = r && typeof r == "function";
763
- function d(u) {
763
+ document: o = Tt,
764
+ restoreOnUnmount: a = (f) => f
765
+ } = e, i = (t = o?.title) != null ? t : "", l = Ot((r = n ?? o?.title) != null ? r : null), c = n && typeof n == "function";
766
+ function d(f) {
764
767
  if (!("titleTemplate" in e))
765
- return u;
766
- const f = e.titleTemplate || "%s";
767
- return typeof f == "function" ? f(u) : V(f).replace(/%s/g, u);
768
+ return f;
769
+ const u = e.titleTemplate || "%s";
770
+ return typeof u == "function" ? u(f) : V(u).replace(/%s/g, f);
768
771
  }
769
772
  return ne(
770
773
  l,
771
- (u, f) => {
772
- u !== f && o && (o.title = d(typeof u == "string" ? u : ""));
774
+ (f, u) => {
775
+ f !== u && o && (o.title = d(typeof f == "string" ? f : ""));
773
776
  },
774
777
  { immediate: !0 }
775
- ), e.observe && !e.titleTemplate && o && !c && Bt(
778
+ ), e.observe && !e.titleTemplate && o && !c && Ut(
776
779
  (s = o.head) == null ? void 0 : s.querySelector("title"),
777
780
  () => {
778
781
  o && o.title !== l.value && (l.value = d(o.title));
779
782
  },
780
783
  { childList: !0 }
781
- ), Ot(() => {
784
+ ), Mt(() => {
782
785
  if (a) {
783
- const u = a(i, l.value || "");
784
- u != null && o && (o.title = u);
786
+ const f = a(i, l.value || "");
787
+ f != null && o && (o.title = f);
785
788
  }
786
789
  }), l;
787
790
  }
788
791
  const Z = se({
789
792
  name: "VtjPageContainer",
790
793
  async setup() {
791
- const r = de(), e = oe(), t = e.params.id, n = t ? r.getPage(t) : r.getHomepage(), s = n ? await r.getRenderComponent(n.id) : null;
792
- return n && Ut(n.title || "VTJ"), {
793
- provider: r,
794
+ const n = de(), e = oe(), t = e.params.id, r = t ? n.getPage(t) : n.getHomepage(), s = r ? await n.getRenderComponent(r.id) : null;
795
+ return r && Nt(r.title || "VTJ"), {
796
+ provider: n,
794
797
  component: s,
795
- file: n,
798
+ file: r,
796
799
  query: e.query
797
800
  };
798
801
  },
799
802
  render() {
800
803
  return this.component ? A(this.component, this.query) : A("div", "页面不存在");
801
804
  }
802
- }), Nt = se({
805
+ }), qt = se({
803
806
  name: "VtjStartupContainer",
804
807
  render() {
805
808
  return A(Ne);
806
809
  }
807
810
  }), pe = Symbol("Provider");
808
- class qt extends he {
811
+ var Jt = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(Jt || {});
812
+ class Lt extends he {
809
813
  constructor(e) {
810
814
  super(), this.options = e;
811
815
  const {
812
816
  service: t,
813
- mode: n = _.Raw,
817
+ mode: r = S.Raw,
814
818
  dependencies: s,
815
819
  materials: o,
816
820
  project: a = {},
@@ -818,15 +822,16 @@ class qt extends he {
818
822
  globals: l = {},
819
823
  modules: c = {},
820
824
  router: d = null,
821
- materialPath: u = "./",
822
- nodeEnv: f = "development"
825
+ materialPath: f = "./",
826
+ nodeEnv: u = "development"
827
+ /* Development */
823
828
  } = e;
824
- this.mode = n, this.modules = c, this.service = t, this.router = d, this.materialPath = u, this.nodeEnv = f, s && (this.dependencies = s), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i), n !== _.Design && this.load(a);
829
+ this.mode = r, this.modules = c, this.service = t, this.router = d, this.materialPath = f, this.nodeEnv = u, s && (this.dependencies = s), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i), r !== S.Design && this.load(a);
825
830
  }
826
831
  mode;
827
832
  globals = {};
828
833
  modules = {};
829
- adapter = { request: ze, jsonp: Ce };
834
+ adapter = { request: Ze, jsonp: Ce };
830
835
  apis = {};
831
836
  dependencies = {};
832
837
  materials = {};
@@ -842,48 +847,53 @@ class qt extends he {
842
847
  const t = this.modules[`.vtj/projects/${e.id}.json`];
843
848
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
844
849
  throw new Error("project is null");
845
- const { apis: n = [], meta: s = [] } = this.project, o = window;
846
- o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = tt(n, s, this.adapter), ce(), this.project.config?.mock && nt(n), this.initRouter(), this.triggerReady();
850
+ const { apis: r = [], meta: s = [] } = this.project, o = window;
851
+ o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = nt(r, s, this.adapter), ce(), this.project.config?.mock && rt(r), this.initRouter(), this.triggerReady();
847
852
  }
848
853
  async loadDependencies(e) {
849
854
  const t = Object.entries(this.dependencies);
850
- for (const [n, s] of t)
851
- e[n] || (e[n] = await s());
855
+ for (const [r, s] of t)
856
+ e[r] || (e[r] = await s());
852
857
  }
853
858
  async loadAssets(e) {
854
- const { dependencies: t = [] } = this.project, { dependencies: n, library: s, components: o, materialPath: a } = this, {
855
- libraryExports: i,
856
- libraryMap: l,
857
- materials: c,
858
- materialExports: d,
859
+ const { dependencies: t = [] } = this.project, { dependencies: r, library: s, components: o, materialPath: a, nodeEnv: i } = this, {
860
+ libraryExports: l,
861
+ libraryMap: c,
862
+ materials: d,
863
+ materialExports: f,
859
864
  materialMapLibrary: u
860
- } = Ve(t, a);
861
- for (const p of i) {
862
- const h = n[p], m = e[p];
863
- if (m)
864
- s[p] = m;
865
- else if (h)
866
- e[p] = s[p] = await h();
865
+ } = We(
866
+ t,
867
+ a,
868
+ i === "development"
869
+ /* Development */
870
+ );
871
+ for (const p of l) {
872
+ const m = r[p], _ = e[p];
873
+ if (_)
874
+ s[p] = _;
875
+ else if (m)
876
+ e[p] = s[p] = await m();
867
877
  else {
868
- const v = l[p] || [];
869
- for (const w of v)
870
- J(w) && await Ge(p, b.append(w, { v: P })), L(w) && await Q(b.append(w, { v: P }));
878
+ const v = c[p] || [];
879
+ for (const y of v)
880
+ J(y) && await Ke(p, b.append(y, { v: P })), L(y) && await Q(b.append(y, { v: P }));
871
881
  s[p] = e[p];
872
882
  }
873
883
  }
874
- for (const p of c)
884
+ for (const p of d)
875
885
  await Q(b.append(p, { v: P }));
876
- const f = this.materials || {};
877
- for (const p of d) {
878
- const h = e[u[p]], m = ve[p];
879
- if (m)
880
- h && m.forEach((v) => {
881
- o[v] = h[v];
886
+ const h = this.materials || {};
887
+ for (const p of f) {
888
+ const m = e[u[p]], _ = ve[p];
889
+ if (_)
890
+ m && _.forEach((v) => {
891
+ o[v] = m[v];
882
892
  });
883
893
  else {
884
- const v = f[p] ? (await f[p]()).default : e[p];
885
- v && h && (v.components || []).forEach((w) => {
886
- o[w.name] = We(w, h);
894
+ const v = h[p] ? (await h[p]()).default : e[p];
895
+ v && m && (v.components || []).forEach((y) => {
896
+ o[y.name] = Ge(y, m);
887
897
  });
888
898
  }
889
899
  }
@@ -897,23 +907,23 @@ class qt extends he {
897
907
  }), e.addRoute({
898
908
  path: "/",
899
909
  name: "VtjHomepage",
900
- component: t?.homepage ? Z : Nt
910
+ component: t?.homepage ? Z : qt
901
911
  }));
902
912
  }
903
913
  install(e) {
904
914
  const t = e.config.globalProperties.installed || {};
905
- for (const [n, s] of Object.entries(this.library))
906
- !t[n] && Xe(s) && (e.use(s), t[n] = !0);
907
- this.options.install && e.use(this.options.install), e.provide(pe, this), e.config.globalProperties.installed = t, this.nodeEnv === "development" && (e.config.errorHandler = (n, s, o) => {
908
- const a = s?.$options.name, i = n?.message || n?.msg || "未知错误", l = `[ ${a} ] ${i}`;
915
+ for (const [r, s] of Object.entries(this.library))
916
+ !t[r] && Ye(s) && (e.use(s), t[r] = !0);
917
+ this.options.install && e.use(this.options.install), e.provide(pe, this), e.config.globalProperties.installed = t, this.nodeEnv === "development" && (e.config.errorHandler = (r, s, o) => {
918
+ const a = s?.$options.name, i = r?.message || r?.msg || "未知错误", l = `[ ${a} ] ${i}`;
909
919
  console.error(
910
920
  "[VTJ Error]:",
911
921
  {
912
- err: n,
922
+ err: r,
913
923
  instance: s,
914
924
  info: o
915
925
  },
916
- n?.stack
926
+ r?.stack
917
927
  ), D.error({
918
928
  title: "运行时错误:请在控制台查看详情",
919
929
  message: l
@@ -922,21 +932,21 @@ class qt extends he {
922
932
  }
923
933
  getFile(e) {
924
934
  const { blocks: t = [] } = this.project || {};
925
- return this.getPage(e) || t.find((n) => n.id === e) || null;
935
+ return this.getPage(e) || t.find((r) => r.id === e) || null;
926
936
  }
927
937
  getPage(e) {
928
- const { pages: t = [] } = this.project || {}, n = (s, o = []) => {
938
+ const { pages: t = [] } = this.project || {}, r = (s, o = []) => {
929
939
  for (const a of o) {
930
940
  if (a.id === s)
931
941
  return a;
932
942
  if (a.children && a.children.length) {
933
- const i = n(s, a.children);
943
+ const i = r(s, a.children);
934
944
  if (i)
935
945
  return i;
936
946
  }
937
947
  }
938
948
  };
939
- return n(e, t) || null;
949
+ return r(e, t) || null;
940
950
  }
941
951
  getHomepage() {
942
952
  const { homepage: e } = this.project || {};
@@ -955,14 +965,14 @@ class qt extends he {
955
965
  validSuccess: !1,
956
966
  originResponse: !0
957
967
  }
958
- }).then((n) => n.data).catch(() => null));
968
+ }).then((r) => r.data).catch(() => null));
959
969
  }
960
970
  createDslRenderer(e, t = {}) {
961
- const { library: n, components: s, mode: o, apis: a } = this, i = {
971
+ const { library: r, components: s, mode: o, apis: a } = this, i = {
962
972
  mode: o,
963
- Vue: n.Vue,
973
+ Vue: r.Vue,
964
974
  components: s,
965
- libs: n,
975
+ libs: r,
966
976
  apis: a,
967
977
  window,
968
978
  ...t
@@ -981,7 +991,7 @@ class qt extends he {
981
991
  const t = this.getFile(e);
982
992
  if (!t)
983
993
  return H.warn(`Can not find file: ${e}`), null;
984
- const n = `.vtj/vue/${e}.vue`, s = this.modules[n];
994
+ const r = `.vtj/vue/${e}.vue`, s = this.modules[r];
985
995
  if (s)
986
996
  return (await s())?.default;
987
997
  const o = await this.getDsl(t.id);
@@ -989,30 +999,30 @@ class qt extends he {
989
999
  }
990
1000
  defineUrlSchemaComponent(e, t) {
991
1001
  return X(async () => {
992
- const n = await this.getDslByUrl(e);
993
- return n ? (n.name = t || n.name, this.createDslRenderer(n).renderer) : null;
1002
+ const r = await this.getDslByUrl(e);
1003
+ return r ? (r.name = t || r.name, this.createDslRenderer(r).renderer) : null;
994
1004
  });
995
1005
  }
996
1006
  definePluginComponent(e) {
997
1007
  return X(async () => await le(e, window));
998
1008
  }
999
1009
  }
1000
- function rn(r) {
1001
- const e = new qt(r);
1010
+ function on(n) {
1011
+ const e = new Lt(n);
1002
1012
  return {
1003
1013
  provider: e,
1004
- onReady: (n) => e.ready(n)
1014
+ onReady: (r) => e.ready(r)
1005
1015
  };
1006
1016
  }
1007
- function de(r = {}) {
1017
+ function de(n = {}) {
1008
1018
  const e = Ae(pe);
1009
1019
  if (!e)
1010
1020
  throw new Error("Can not find provider");
1011
1021
  if (e.nodeEnv === "development") {
1012
- const { id: t, version: n } = r;
1013
- t && n && (async () => {
1022
+ const { id: t, version: r } = n;
1023
+ t && r && (async () => {
1014
1024
  const s = await e.getDsl(t);
1015
- s?.__VERSION__ !== n && D.warning({
1025
+ s?.__VERSION__ !== r && D.warning({
1016
1026
  title: s?.name,
1017
1027
  message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
1018
1028
  });
@@ -1026,23 +1036,23 @@ const W = new Re({
1026
1036
  validSuccess: !0,
1027
1037
  originResponse: !1,
1028
1038
  failMessage: !0,
1029
- validate: (r) => r.data?.code === 0,
1030
- showError: (r) => {
1039
+ validate: (n) => n.data?.code === 0,
1040
+ showError: (n) => {
1031
1041
  D.error({
1032
- message: r || "未知错误"
1042
+ message: n || "未知错误"
1033
1043
  });
1034
1044
  }
1035
1045
  }
1036
- }), Jt = (r = "/vtj/local/repository/:type.json") => (e, t) => W.send({
1037
- url: r,
1046
+ }), Vt = (n = "/__vtj__/api/:type.json") => (e, t) => W.send({
1047
+ url: n,
1038
1048
  method: "post",
1039
1049
  params: { type: e },
1040
1050
  data: {
1041
1051
  type: e,
1042
1052
  data: t
1043
1053
  }
1044
- }), Lt = (r = "/vtj/local/repository/uploader.json") => async (e, t) => await W.send({
1045
- url: r,
1054
+ }), Wt = (n = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
1055
+ url: n,
1046
1056
  method: "post",
1047
1057
  data: {
1048
1058
  files: e,
@@ -1051,13 +1061,13 @@ const W = new Re({
1051
1061
  settings: {
1052
1062
  type: "data"
1053
1063
  }
1054
- }).then((n) => n && n[0] ? n[0] : null).catch(() => null);
1064
+ }).then((r) => r && r[0] ? r[0] : null).catch(() => null);
1055
1065
  class G {
1056
1066
  api;
1057
1067
  pluginCaches = {};
1058
1068
  uploader;
1059
1069
  constructor() {
1060
- this.api = Jt(), this.uploader = Lt();
1070
+ this.api = Vt(), this.uploader = Wt();
1061
1071
  }
1062
1072
  async getExtension() {
1063
1073
  console.log("BaseService.getExtension");
@@ -1130,11 +1140,11 @@ class G {
1130
1140
  return await this.api("clearStaticFiles", e).catch(() => "");
1131
1141
  }
1132
1142
  async getPluginMaterial(e) {
1133
- const { urls: t = [] } = e, n = t.filter((o) => Le(o))[0];
1134
- if (!n) return null;
1135
- const s = this.pluginCaches[n];
1136
- return s || (this.pluginCaches[n] = W.send({
1137
- url: n,
1143
+ const { urls: t = [] } = e, r = t.filter((o) => Le(o))[0];
1144
+ if (!r) return null;
1145
+ const s = this.pluginCaches[r];
1146
+ return s || (this.pluginCaches[r] = W.send({
1147
+ url: r,
1138
1148
  method: "get",
1139
1149
  settings: {
1140
1150
  validSuccess: !1,
@@ -1143,69 +1153,69 @@ class G {
1143
1153
  }).then((o) => o.data).catch(() => null));
1144
1154
  }
1145
1155
  }
1146
- const y = new Fe({
1156
+ const g = new Fe({
1147
1157
  type: "local",
1148
1158
  expired: 0,
1149
1159
  prefix: "__VTJ_"
1150
1160
  });
1151
- class sn extends G {
1161
+ class an extends G {
1152
1162
  init(e) {
1153
- const t = new I(e), n = y.get(`project_${t.id}`), s = Object.assign(t.toDsl(), n || {});
1154
- return y.save(`project_${t.id}`, s), Promise.resolve(s);
1163
+ const t = new I(e), r = g.get(`project_${t.id}`), s = Object.assign(t.toDsl(), r || {});
1164
+ return g.save(`project_${t.id}`, s), Promise.resolve(s);
1155
1165
  }
1156
1166
  saveProject(e) {
1157
1167
  const t = new I(e);
1158
- return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1168
+ return g.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1159
1169
  }
1160
1170
  saveMaterials(e, t) {
1161
- return y.save(`materials_${e.id}`, N(t)), Promise.resolve(!0);
1171
+ return g.save(`materials_${e.id}`, N(t)), Promise.resolve(!0);
1162
1172
  }
1163
1173
  saveFile(e) {
1164
- return y.save(`file_${e.id}`, e), Promise.resolve(!0);
1174
+ return g.save(`file_${e.id}`, e), Promise.resolve(!0);
1165
1175
  }
1166
1176
  getFile(e) {
1167
- const t = y.get(`file_${e}`);
1177
+ const t = g.get(`file_${e}`);
1168
1178
  return t ? Promise.resolve(t) : Promise.reject(null);
1169
1179
  }
1170
1180
  removeFile(e) {
1171
- return y.remove(`file_${e}`), Promise.resolve(!0);
1181
+ return g.remove(`file_${e}`), Promise.resolve(!0);
1172
1182
  }
1173
1183
  saveHistory(e) {
1174
- return y.save(`history_${e.id}`, e), Promise.resolve(!0);
1184
+ return g.save(`history_${e.id}`, e), Promise.resolve(!0);
1175
1185
  }
1176
1186
  removeHistory(e) {
1177
- const t = y.get(`history_${e}`);
1187
+ const t = g.get(`history_${e}`);
1178
1188
  if (t) {
1179
1189
  const s = (t.items || []).map((o) => o.id);
1180
- this.removeHistoryItem(e, s), y.remove(`history_${e}`);
1190
+ this.removeHistoryItem(e, s), g.remove(`history_${e}`);
1181
1191
  }
1182
1192
  return Promise.resolve(!0);
1183
1193
  }
1184
1194
  getHistory(e) {
1185
- const t = y.get(`history_${e}`), n = new ee(t || { id: e });
1186
- return Promise.resolve(n.toDsl());
1195
+ const t = g.get(`history_${e}`), r = new ee(t || { id: e });
1196
+ return Promise.resolve(r.toDsl());
1187
1197
  }
1188
1198
  getHistoryItem(e, t) {
1189
- const n = y.get(`history_${e}_${t}`);
1190
- return Promise.resolve(n);
1199
+ const r = g.get(`history_${e}_${t}`);
1200
+ return Promise.resolve(r);
1191
1201
  }
1192
1202
  saveHistoryItem(e, t) {
1193
- return y.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1203
+ return g.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1194
1204
  }
1195
1205
  removeHistoryItem(e, t) {
1196
- return t.forEach((n) => {
1197
- y.remove(`history_${e}_${n}`);
1206
+ return t.forEach((r) => {
1207
+ g.remove(`history_${e}_${r}`);
1198
1208
  }), Promise.resolve(!0);
1199
1209
  }
1200
1210
  }
1201
- class Vt extends G {
1211
+ class Gt extends G {
1202
1212
  projects = {};
1203
1213
  materials = {};
1204
1214
  files = {};
1205
1215
  histories = {};
1206
1216
  historyItems = {};
1207
1217
  init(e) {
1208
- const t = new I(e), n = this.projects[t.id] || {}, s = Object.assign(t.toDsl(), n);
1218
+ const t = new I(e), r = this.projects[t.id] || {}, s = Object.assign(t.toDsl(), r);
1209
1219
  return this.projects[s.id] = s, Promise.resolve(s);
1210
1220
  }
1211
1221
  saveProject(e) {
@@ -1237,29 +1247,29 @@ class Vt extends G {
1237
1247
  return Promise.resolve(!0);
1238
1248
  }
1239
1249
  getHistory(e) {
1240
- const t = this.histories[e], n = new ee(t || { id: e });
1241
- return Promise.resolve(n);
1250
+ const t = this.histories[e], r = new ee(t || { id: e });
1251
+ return Promise.resolve(r);
1242
1252
  }
1243
1253
  getHistoryItem(e, t) {
1244
- const n = `${e}_${t}`, s = this.historyItems[n] || {};
1254
+ const r = `${e}_${t}`, s = this.historyItems[r] || {};
1245
1255
  return Promise.resolve(s);
1246
1256
  }
1247
1257
  saveHistoryItem(e, t) {
1248
- const n = `${e}_${t.id}`;
1249
- return this.historyItems[n] = t, Promise.resolve(!0);
1258
+ const r = `${e}_${t.id}`;
1259
+ return this.historyItems[r] = t, Promise.resolve(!0);
1250
1260
  }
1251
1261
  removeHistoryItem(e, t) {
1252
- return t.forEach((n) => {
1253
- const s = `${e}_${n}`;
1262
+ return t.forEach((r) => {
1263
+ const s = `${e}_${r}`;
1254
1264
  delete this.historyItems[s];
1255
1265
  }), Promise.resolve(!0);
1256
1266
  }
1257
1267
  }
1258
1268
  let F = null;
1259
- function on() {
1260
- return F || (F = new Vt(), F);
1269
+ function cn() {
1270
+ return F || (F = new Gt(), F);
1261
1271
  }
1262
- class an extends G {
1272
+ class ln extends G {
1263
1273
  getFileCaches = {};
1264
1274
  async getExtension() {
1265
1275
  return await this.api("getExtension", {}).catch(() => {
@@ -1314,12 +1324,12 @@ class an extends G {
1314
1324
  );
1315
1325
  }
1316
1326
  }
1317
- function me(r = []) {
1318
- return r.map((e) => {
1319
- const { id: t, title: n, icon: s, children: o, hidden: a } = e;
1327
+ function me(n = []) {
1328
+ return n.map((e) => {
1329
+ const { id: t, title: r, icon: s, children: o, hidden: a } = e;
1320
1330
  return {
1321
1331
  id: t,
1322
- title: n,
1332
+ title: r,
1323
1333
  icon: s,
1324
1334
  hidden: a,
1325
1335
  url: `/page/${t}`,
@@ -1327,25 +1337,25 @@ function me(r = []) {
1327
1337
  };
1328
1338
  });
1329
1339
  }
1330
- function cn() {
1331
- const r = de(), e = oe(), t = q(!1), n = r.project;
1340
+ function un() {
1341
+ const n = de(), e = oe(), t = q(!1), r = n.project;
1332
1342
  Be(() => {
1333
1343
  const { name: a, params: i, meta: l } = e;
1334
1344
  if (a === "VtjPage") {
1335
- const c = r.getPage(i.id);
1345
+ const c = n.getPage(i.id);
1336
1346
  t.value = !c?.mask;
1337
1347
  } else if (a === "VtjHomepage") {
1338
- const c = r.getHomepage();
1348
+ const c = n.getHomepage();
1339
1349
  t.value = !c?.mask;
1340
1350
  } else
1341
1351
  t.value = !l.mask;
1342
1352
  });
1343
- const s = me(n?.pages), o = n?.config;
1353
+ const s = me(r?.pages), o = r?.config;
1344
1354
  return {
1345
1355
  disabled: t,
1346
1356
  logo: o?.logo,
1347
1357
  themeSwitchable: o?.themeSwitchable,
1348
- title: o?.title || n?.description || n?.name || "VTJ App",
1358
+ title: o?.title || r?.description || r?.name || "VTJ App",
1349
1359
  menus: s
1350
1360
  };
1351
1361
  }
@@ -1353,51 +1363,53 @@ export {
1353
1363
  qe as BUILT_IN_DIRECTIVES,
1354
1364
  G as BaseService,
1355
1365
  Y as CONTEXT_HOST,
1356
- st as Context,
1357
- _ as ContextMode,
1366
+ ot as Context,
1367
+ S as ContextMode,
1358
1368
  Je as DATA_TYPES,
1359
- nn as JSCodeToString,
1360
- Zt as LIFE_CYCLES_LIST,
1361
- an as LocalService,
1362
- Vt as MemoryService,
1363
- qt as Provider,
1364
- sn as StorageService,
1369
+ sn as JSCodeToString,
1370
+ tn as LIFE_CYCLES_LIST,
1371
+ ln as LocalService,
1372
+ Gt as MemoryService,
1373
+ Jt as NodeEnv,
1374
+ Lt as Provider,
1375
+ an as StorageService,
1365
1376
  P as VTJ_RENDERER_VERSION,
1366
1377
  ae as adoptedStyleSheets,
1367
- en as createAssetScripts,
1368
- tn as createAssetsCss,
1369
- ft as createDataSources,
1378
+ nn as createAssetScripts,
1379
+ rn as createAssetsCss,
1380
+ pt as createDataSources,
1370
1381
  U as createLoader,
1371
- on as createMemoryService,
1372
- et as createMetaApi,
1373
- rn as createProvider,
1382
+ cn as createMemoryService,
1383
+ tt as createMetaApi,
1384
+ on as createProvider,
1374
1385
  B as createRenderer,
1375
- Ze as createSchemaApi,
1376
- tt as createSchemaApis,
1377
- mt as defaultLoader,
1386
+ et as createSchemaApi,
1387
+ nt as createSchemaApis,
1388
+ ht as defaultLoader,
1378
1389
  R as fillBasePath,
1379
1390
  ue as getModifiers,
1380
1391
  le as getPlugin,
1381
- We as getRawComponent,
1392
+ Ge as getRawComponent,
1382
1393
  J as isCSSUrl,
1383
- Ye as isJSCode,
1384
- g as isJSExpression,
1394
+ ze as isJSCode,
1395
+ w as isJSExpression,
1385
1396
  k as isJSFunction,
1386
1397
  Le as isJSON,
1387
1398
  L as isJSUrl,
1388
- Xe as isVuePlugin,
1389
- Ge as loadCss,
1390
- Ke as loadCssUrl,
1391
- Qe as loadScriptUrl,
1392
- rt as mockApi,
1393
- nt as mockApis,
1399
+ Ye as isVuePlugin,
1400
+ Ke as loadCss,
1401
+ Qe as loadCssUrl,
1402
+ Xe as loadScriptUrl,
1403
+ st as mockApi,
1404
+ rt as mockApis,
1394
1405
  ce as mockCleanup,
1395
1406
  O as nodeRender,
1396
- Ve as parseDeps,
1407
+ We as parseDeps,
1397
1408
  C as parseExpression,
1398
1409
  z as parseFunction,
1399
1410
  pe as providerKey,
1411
+ Ve as removeProdFlag,
1400
1412
  ie as toString,
1401
- cn as useMask,
1413
+ un as useMask,
1402
1414
  de as useProvider
1403
1415
  };