@vtj/renderer 0.12.70 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,18 +1,18 @@
1
- import { Base as Ke, BUILT_IN_COMPONENTS as ze, ProjectModel as U, HistoryModel as Se } from "@vtj/core";
2
- import { isUrl as Ge, url as A, dedupArray as Ve, isString as b, isFunction as L, logger as I, storage as W, cookie as Q, toArray as me, unRSA as ge, delay as ce, createRequest as $e, jsonp as je, merge as We, pathToRegexp as Qe, pathToRegexpMatch as Xe, formDataToJson as Ye, Queue as Ze, cloneDeep as ve, camelCase as R, isObject as et, upperFirst as tt, pick as st, request as ee, loadScript as ye, Storage as nt, mapToObject as le } from "@vtj/utils";
3
- import * as q from "vue";
4
- import { inject as Ee, defineComponent as Re, h as te, ref as se, watchEffect as rt, defineAsyncComponent as _e } from "vue";
5
- import { useRoute as be } from "vue-router";
1
+ import { Base as Ke, BUILT_IN_COMPONENTS as ze, ProjectModel as L, HistoryModel as je } from "@vtj/core";
2
+ import { isUrl as Ge, url as F, dedupArray as Ve, isString as C, isFunction as q, logger as k, storage as X, cookie as Y, toArray as ve, unRSA as ye, delay as J, createRequest as Ee, jsonp as be, merge as Qe, pathToRegexp as We, pathToRegexpMatch as Xe, formDataToJson as Ye, Queue as Ze, cloneDeep as _e, camelCase as P, isObject as et, upperFirst as tt, pick as st, request as se, loadScript as we, Storage as nt, mapToObject as ue } from "@vtj/utils";
3
+ import * as z from "vue";
4
+ import { inject as Re, defineComponent as Pe, h as ne, ref as re, watchEffect as rt, defineAsyncComponent as Se } from "vue";
5
+ import { useRoute as Ce } from "vue-router";
6
6
  /**!
7
7
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
8
8
  * @name @vtj/renderer
9
9
  * @author CHC chenhuachun1549@dingtalk.com
10
- * @version 0.12.70
10
+ * @version 0.13.0
11
11
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
12
12
  */
13
- const k = "0.12.70";
14
- var w = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(w || {});
15
- const we = [
13
+ const O = "0.13.0";
14
+ var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
15
+ const $e = [
16
16
  "$el",
17
17
  "$emit",
18
18
  "$nextTick",
@@ -24,7 +24,7 @@ const we = [
24
24
  "$props",
25
25
  "$options",
26
26
  "$forceUpdate"
27
- ], us = [
27
+ ], gs = [
28
28
  "beforeCreate",
29
29
  "created",
30
30
  "beforeMount",
@@ -55,9 +55,9 @@ const we = [
55
55
  Object,
56
56
  Function,
57
57
  Date
58
- }, M = "VtjPage", N = "VtjHomepage", at = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(
58
+ }, D = "VtjPage", U = "VtjHomepage", at = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(
59
59
  ","
60
- ), ct = "component,slot".split(","), ps = [
60
+ ), ct = "component,slot".split(","), vs = [
61
61
  "h",
62
62
  "t",
63
63
  "t",
@@ -78,7 +78,7 @@ const we = [
78
78
  "p",
79
79
  "r",
80
80
  "o"
81
- ].join(""), fs = {
81
+ ].join(""), ys = {
82
82
  auth: [
83
83
  "h",
84
84
  "t",
@@ -139,56 +139,56 @@ const we = [
139
139
  ].join(""),
140
140
  privateKey: "MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"
141
141
  };
142
- function x(n, e) {
142
+ function B(n, e) {
143
143
  return n.map((t) => Ge(t) || t.startsWith("/") ? t : `${e}${t}`);
144
144
  }
145
- function K(n) {
145
+ function G(n) {
146
146
  return /\.css$/.test(n);
147
147
  }
148
- function z(n) {
148
+ function V(n) {
149
149
  return /\.js$/.test(n);
150
150
  }
151
- function lt(n) {
151
+ function ut(n) {
152
152
  return /\.json$/.test(n);
153
153
  }
154
- function ds(n) {
154
+ function _s(n) {
155
155
  return n.map(
156
- (e) => `<script src="${A.append(e, { v: k })}"><\/script>`
156
+ (e) => `<script src="${F.append(e, { v: O })}"><\/script>`
157
157
  ).join("");
158
158
  }
159
- function hs(n = []) {
159
+ function ws(n = []) {
160
160
  return n.map(
161
- (e) => `<link rel="stylesheet" href="${A.append(e, { v: k })}" />`
161
+ (e) => `<link rel="stylesheet" href="${F.append(e, { v: O })}" />`
162
162
  ).join("");
163
163
  }
164
- function ut(n, e = !1) {
164
+ function lt(n, e = !1) {
165
165
  return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
166
166
  }
167
- function pt(n, e, t = !1) {
168
- const s = n.filter((h) => !!h.enabled), r = [], o = [], a = [], i = [], p = {}, c = {}, l = [], u = {};
167
+ function ft(n, e, t = !1) {
168
+ const s = n.filter((h) => !!h.enabled), r = [], o = [], i = [], a = [], f = {}, c = {}, u = [], l = {};
169
169
  return s.forEach(
170
- ({ urls: h, assetsUrl: f, library: d, assetsLibrary: v, localeLibrary: g }) => {
170
+ ({ urls: h, assetsUrl: p, library: d, assetsLibrary: v, localeLibrary: g }) => {
171
171
  h?.forEach((m) => {
172
- z(m) && r.push(ut(m, t)), K(m) && o.push(m);
173
- }), d && (i.push(d), p[d] = x(h || [], e), g && (c[d] = g)), f && a.push(f), v && l.push(v), d && v && (u[v] = d);
172
+ V(m) && r.push(lt(m, t)), G(m) && o.push(m);
173
+ }), d && (a.push(d), f[d] = B(h || [], e), g && (c[d] = g)), p && i.push(p), v && u.push(v), d && v && (l[v] = d);
174
174
  }
175
175
  ), {
176
- scripts: x(r, e),
177
- css: x(o, e),
178
- materials: x(a, e),
179
- libraryExports: i,
180
- materialExports: Ve(l),
181
- materialMapLibrary: u,
182
- libraryMap: p,
176
+ scripts: B(r, e),
177
+ css: B(o, e),
178
+ materials: B(i, e),
179
+ libraryExports: a,
180
+ materialExports: Ve(u),
181
+ materialMapLibrary: l,
182
+ libraryMap: f,
183
183
  libraryLocaleMap: c
184
184
  };
185
185
  }
186
- function ft(n, e) {
186
+ function pt(n, e) {
187
187
  const { name: t, parent: s, alias: r } = n;
188
188
  return s ? e[s]?.[r || t] : e[r || t];
189
189
  }
190
190
  function dt(n = []) {
191
- const e = n.filter((s) => K(s)), t = n.filter((s) => z(s));
191
+ const e = n.filter((s) => G(s)), t = n.filter((s) => V(s));
192
192
  return {
193
193
  css: e,
194
194
  js: t
@@ -196,164 +196,164 @@ function dt(n = []) {
196
196
  }
197
197
  function ht(n, e) {
198
198
  const t = (c) => {
199
- const l = [];
200
- let u = 0;
201
- for (; u < c.length; ) {
202
- if (/\s/.test(c[u])) {
203
- u++;
199
+ const u = [];
200
+ let l = 0;
201
+ for (; l < c.length; ) {
202
+ if (/\s/.test(c[l])) {
203
+ l++;
204
204
  continue;
205
205
  }
206
- if (c.substring(u, u + 2) === "/*") {
207
- const m = c.indexOf("*/", u + 2);
206
+ if (c.substring(l, l + 2) === "/*") {
207
+ const m = c.indexOf("*/", l + 2);
208
208
  if (m !== -1) {
209
- u = m + 2;
209
+ l = m + 2;
210
210
  continue;
211
211
  }
212
212
  }
213
- if (c[u] === "@") {
214
- const m = u;
215
- for (; u < c.length && c[u] !== "{" && c[u] !== ";"; )
216
- u++;
217
- const j = c.substring(m, u).trim(), y = j.includes("@keyframes");
218
- if (c[u] === ";")
219
- l.push({
213
+ if (c[l] === "@") {
214
+ const m = l;
215
+ for (; l < c.length && c[l] !== "{" && c[l] !== ";"; )
216
+ l++;
217
+ const b = c.substring(m, l).trim(), y = b.includes("@keyframes");
218
+ if (c[l] === ";")
219
+ u.push({
220
220
  type: "simple-at-rule",
221
- content: c.substring(m, u + 1)
222
- }), u++;
223
- else if (c[u] === "{") {
224
- const H = u + 1;
225
- let P = 1;
226
- for (u++; u < c.length && P > 0; )
227
- c[u] === "{" ? P++ : c[u] === "}" && P--, u++;
228
- const G = c.substring(m, u), E = c.substring(H, u - 1);
229
- l.push({
221
+ content: c.substring(m, l + 1)
222
+ }), l++;
223
+ else if (c[l] === "{") {
224
+ const x = l + 1;
225
+ let A = 1;
226
+ for (l++; l < c.length && A > 0; )
227
+ c[l] === "{" ? A++ : c[l] === "}" && A--, l++;
228
+ const Q = c.substring(m, l), R = c.substring(x, l - 1);
229
+ u.push({
230
230
  type: y ? "keyframes" : "at-rule",
231
- rule: j,
232
- content: G,
233
- inner: E
231
+ rule: b,
232
+ content: Q,
233
+ inner: R
234
234
  });
235
235
  }
236
236
  continue;
237
237
  }
238
- const h = u;
239
- for (; u < c.length && c[u] !== "{"; )
240
- u++;
241
- if (u >= c.length) break;
242
- const f = c.substring(h, u).trim();
243
- if (!f) {
244
- u++;
238
+ const h = l;
239
+ for (; l < c.length && c[l] !== "{"; )
240
+ l++;
241
+ if (l >= c.length) break;
242
+ const p = c.substring(h, l).trim();
243
+ if (!p) {
244
+ l++;
245
245
  continue;
246
246
  }
247
- const d = u + 1;
247
+ const d = l + 1;
248
248
  let v = 1;
249
- for (u++; u < c.length && v > 0; )
250
- c[u] === "{" ? v++ : c[u] === "}" && v--, u++;
251
- const g = c.substring(d, u - 1);
252
- l.push({
249
+ for (l++; l < c.length && v > 0; )
250
+ c[l] === "{" ? v++ : c[l] === "}" && v--, l++;
251
+ const g = c.substring(d, l - 1);
252
+ u.push({
253
253
  type: "rule",
254
- selector: f,
254
+ selector: p,
255
255
  content: g.trim()
256
256
  });
257
257
  }
258
- return l;
258
+ return u;
259
259
  }, s = (c) => {
260
- const l = c.trim();
261
- return /^(from|to|\d+(\.\d+)?%)$/.test(l);
262
- }, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (l, u, h) => {
263
- const f = u.trim(), d = h.trim();
264
- return f ? `${f}[${e}] ${d}` : d;
260
+ const u = c.trim();
261
+ return /^(from|to|\d+(\.\d+)?%)$/.test(u);
262
+ }, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (u, l, h) => {
263
+ const p = l.trim(), d = h.trim();
264
+ return p ? `${p}[${e}] ${d}` : d;
265
265
  }), o = (c) => {
266
- const l = c.trim();
267
- if (!l || l.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(l) || s(l))
268
- return l;
269
- const u = l.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
270
- if (u) {
271
- const [, h, f = ""] = u, d = h.trim();
272
- return d ? `${d}[${e}]${f}` : l;
266
+ const u = c.trim();
267
+ if (!u || u.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(u) || s(u))
268
+ return u;
269
+ const l = u.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
270
+ if (l) {
271
+ const [, h, p = ""] = l, d = h.trim();
272
+ return d ? `${d}[${e}]${p}` : u;
273
273
  }
274
- return `${l}[${e}]`;
275
- }, a = (c) => r(c).split(",").map((u) => o(u)).filter((u) => u.trim()).join(", "), i = (c) => c.map((l) => {
276
- switch (l.type) {
274
+ return `${u}[${e}]`;
275
+ }, i = (c) => r(c).split(",").map((l) => o(l)).filter((l) => l.trim()).join(", "), a = (c) => c.map((u) => {
276
+ switch (u.type) {
277
277
  case "simple-at-rule":
278
- return l.content;
278
+ return u.content;
279
279
  case "keyframes":
280
- return l.content;
280
+ return u.content;
281
281
  case "at-rule":
282
282
  try {
283
- const h = t(l.inner), f = i(h);
284
- return `${l.rule} { ${f} }`;
283
+ const h = t(u.inner), p = a(h);
284
+ return `${u.rule} { ${p} }`;
285
285
  } catch {
286
- return l.content;
286
+ return u.content;
287
287
  }
288
288
  case "rule":
289
- if (!l.selector || !l.content)
289
+ if (!u.selector || !u.content)
290
290
  return "";
291
- const u = a(l.selector);
292
- return u.trim() ? `${u} { ${l.content} }` : "";
291
+ const l = i(u.selector);
292
+ return l.trim() ? `${l} { ${u.content} }` : "";
293
293
  default:
294
294
  return "";
295
295
  }
296
- }).filter((l) => l.trim()).join(" "), p = (c) => c.replace(/\s*{\s*/g, " { ").replace(/\s*}\s*/g, " } ").replace(/\s*;\s*/g, "; ").replace(/\s*,\s*/g, ", ").replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "").replace(/\s*}\s*}/g, " } }").trim();
296
+ }).filter((u) => u.trim()).join(" "), f = (c) => c.replace(/\s*{\s*/g, " { ").replace(/\s*}\s*/g, " } ").replace(/\s*;\s*/g, "; ").replace(/\s*,\s*/g, ", ").replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "").replace(/\s*}\s*}/g, " } }").trim();
297
297
  try {
298
298
  const c = n.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g, "").replace(/^\s+|\s+$/gm, "").replace(/\n\s*\n/g, `
299
- `), l = t(c), u = i(l);
300
- return p(u);
299
+ `), u = t(c), l = a(u);
300
+ return f(l);
301
301
  } catch (c) {
302
302
  return console.error("CSS scoping failed:", c), console.error("Input CSS:", n), n.replace(/\/\*[\s\S]*?\*\//g, "").replace(
303
303
  /(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,
304
- (l) => l
305
- ).replace(/([^{}@]+)(?=\s*{)/g, (l) => {
306
- const u = l.trim();
307
- return !u || u.startsWith("@") || u.includes(`[${e}]`) || s(u) ? l : `${u}[${e}]`;
304
+ (u) => u
305
+ ).replace(/([^{}@]+)(?=\s*{)/g, (u) => {
306
+ const l = u.trim();
307
+ return !l || l.startsWith("@") || l.includes(`[${e}]`) || s(l) ? u : `${l}[${e}]`;
308
308
  });
309
309
  }
310
310
  }
311
- function Pe(n) {
312
- return b(n) ? n : JSON.stringify(n);
311
+ function Ae(n) {
312
+ return C(n) ? n : JSON.stringify(n);
313
313
  }
314
- function Ce(n, e, t, s = !1) {
315
- const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, a = s ? ht(t, o) : t;
314
+ function le(n, e, t, s = !1) {
315
+ const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, i = s ? ht(t, o) : t;
316
316
  if (r.prototype.replaceSync) {
317
- const i = new r();
318
- i.id = e, i.replaceSync(a);
319
- const p = n.document, c = p.adoptedStyleSheets, l = Array.from(c).filter(
320
- (u) => u.id !== e
317
+ const a = new r();
318
+ a.id = e, a.replaceSync(i);
319
+ const f = n.document, c = f.adoptedStyleSheets, u = Array.from(c).filter(
320
+ (l) => l.id !== e
321
321
  );
322
- p.adoptedStyleSheets = [...l, i];
322
+ f.adoptedStyleSheets = [...u, a];
323
323
  } else {
324
- const i = n.document;
325
- let p = i.getElementById(e);
326
- p ? p.innerHTML = a : (p = i.createElement("style"), p.id = e, p.innerHTML = a, i.head.appendChild(p));
324
+ const a = n.document;
325
+ let f = a.getElementById(e);
326
+ f ? f.innerHTML = i : (f = a.createElement("style"), f.id = e, f.innerHTML = i, a.head.appendChild(f));
327
327
  }
328
328
  }
329
329
  async function mt(n, e) {
330
330
  const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
331
- t && Ce(window, n, t);
331
+ t && le(window, n, t);
332
332
  }
333
- function Ae(n, e = window) {
333
+ function Ie(n, e = window) {
334
334
  const t = e.document, s = e.document.head;
335
335
  for (const r of n)
336
336
  if (!t.getElementById(r)) {
337
- const a = t.createElement("link");
338
- a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
337
+ const i = t.createElement("link");
338
+ i.rel = "stylesheet", i.id = r, i.href = r, s.appendChild(i);
339
339
  }
340
340
  }
341
- async function Ie(n, e, t = window) {
341
+ async function Fe(n, e, t = window) {
342
342
  const s = t.document, r = t.document.head;
343
343
  let o = t[e];
344
- return o ? o.default || o : new Promise((a, i) => {
345
- for (const p of n) {
344
+ return o ? o.default || o : new Promise((i, a) => {
345
+ for (const f of n) {
346
346
  const c = s.createElement("script");
347
- c.src = p, c.onload = () => {
348
- o = t[e], o ? a(o.default || o) : i(null);
349
- }, c.onerror = (l) => {
350
- i(l);
347
+ c.src = f, c.onload = () => {
348
+ o = t[e], o ? i(o.default || o) : a(null);
349
+ }, c.onerror = (u) => {
350
+ a(u);
351
351
  }, r.appendChild(c);
352
352
  }
353
353
  });
354
354
  }
355
355
  function gt(n) {
356
- return L(n) || L(n?.install);
356
+ return q(n) || q(n?.install);
357
357
  }
358
358
  function vt(n) {
359
359
  return ct.includes(n);
@@ -361,53 +361,55 @@ function vt(n) {
361
361
  function yt(n) {
362
362
  return at.includes(n);
363
363
  }
364
- function O(n = window) {
364
+ function T(n = window) {
365
365
  const e = window?.Mock;
366
366
  if (e) return e;
367
367
  const t = n?.Mock;
368
368
  if (t && window)
369
369
  return window.Mock = t, t;
370
370
  }
371
- function ms(n, e, t) {
371
+ function Ss(n, e, t) {
372
372
  Object.assign(e.meta, t.meta);
373
373
  const s = n?._container;
374
374
  t?.type === "page" && s.classList.add("is-page"), t?.pure && s.classList.add("is-pure");
375
375
  }
376
- function D(n, e, t = !1, s = !1) {
376
+ function H(n, e, t = !1, s = !1, r = !1) {
377
377
  try {
378
- const r = ['"use strict";', "var __self = arguments[0];"];
379
- r.push("return ");
380
- let o = (n.value || "").trim();
381
- o = o.replace(/this(\W|$)/g, (i, p) => `__self${p}`), o = r.join(`
382
- `) + o;
383
- const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
378
+ const o = ['"use strict";', "var __self = arguments[0];"];
379
+ o.push("return ");
380
+ let i = (n.value || "").trim();
381
+ r || (i = i.replace(/this(\W|$)/g, (f, c) => `__self${c}`)), i = o.join(`
382
+ `) + i;
383
+ const a = r ? `
384
+ ${i}
385
+ ` : `with(${t ? "{}" : "$scope || {}"}) { ${i} }`;
384
386
  return new Function("$scope", a)(e);
385
- } catch (r) {
386
- if (I.error("parseExpression.error", r, n, e?.__self ?? e), s)
387
- throw r;
387
+ } catch (o) {
388
+ if (k.error("parseExpression.error", o, n, e?.__self ?? e), s)
389
+ throw o;
388
390
  }
389
391
  }
390
- function ne(n, e, t = !1, s = !1) {
391
- const r = D(n, e, t, s);
392
- if (typeof r != "function" && (I.error(
392
+ function E(n, e, t = !1, s = !1, r = !1) {
393
+ const o = H(n, e, t, s, r);
394
+ if (typeof o != "function" && (k.error(
393
395
  "parseFunction.error",
394
396
  "not a function",
395
397
  n,
396
398
  e?.__self ?? e
397
399
  ), s))
398
400
  throw new Error(`"${n.value}" not a function`);
399
- return r;
401
+ return o;
400
402
  }
401
- function $(n) {
403
+ function j(n) {
402
404
  return n && n.type === "JSExpression";
403
405
  }
404
- function T(n) {
406
+ function S(n) {
405
407
  return typeof n == "object" && n && n.type === "JSFunction";
406
408
  }
407
409
  function _t(n) {
408
- return $(n) || T(n);
410
+ return j(n) || S(n);
409
411
  }
410
- function gs(n) {
412
+ function $s(n) {
411
413
  return _t(n) ? n.value : JSON.stringify(n);
412
414
  }
413
415
  const wt = {
@@ -423,11 +425,11 @@ const wt = {
423
425
  noPermissionMessage: "无权限访问该页面",
424
426
  appName: "",
425
427
  statusKey: "code"
426
- }, Fe = Symbol("access");
427
- class ke {
428
+ }, ke = Symbol("access");
429
+ class fe {
428
430
  options;
429
431
  data = null;
430
- mode = w.Raw;
432
+ mode = _.Raw;
431
433
  interceptResponse = !0;
432
434
  constructor(e) {
433
435
  this.options = Object.assign({}, wt, e), this.loadData();
@@ -440,21 +442,21 @@ class ke {
440
442
  }
441
443
  connect(e) {
442
444
  const { mode: t, router: s, request: r } = e;
443
- this.mode = t, s && this.mode === w.Raw && this.setGuard(s), r && this.setRequest(r);
445
+ this.mode = t, s && this.mode !== _.Design && this.setGuard(s), r && this.setRequest(r);
444
446
  }
445
447
  login(e) {
446
448
  const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
447
- this.setData(e), this.data && (W.save(t, e, {
449
+ this.setData(e), this.data && (X.save(t, e, {
448
450
  type: "local",
449
451
  prefix: s
450
- }), r && Q.set(o, this.data.token));
452
+ }), r && Y.set(o, this.data.token));
451
453
  }
452
454
  clear() {
453
455
  const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
454
- this.data = null, W.remove(e, {
456
+ this.data = null, X.remove(e, {
455
457
  type: "local",
456
458
  prefix: t
457
- }), s && Q.remove(r);
459
+ }), s && Y.remove(r);
458
460
  }
459
461
  logout() {
460
462
  this.clear(), this.toLogin();
@@ -467,14 +469,14 @@ class ke {
467
469
  }
468
470
  can(e) {
469
471
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
470
- return typeof e == "function" ? e(s) : me(e).every((o) => s[o] || s[t + "." + o]);
472
+ return typeof e == "function" ? e(s) : ve(e).every((o) => s[o] || s[t + "." + o]);
471
473
  }
472
474
  some(e) {
473
475
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
474
- return me(e).some((o) => s[o] || s[t + "." + o]);
476
+ return ve(e).some((o) => s[o] || s[t + "." + o]);
475
477
  }
476
478
  install(e) {
477
- e.config.globalProperties.$access = this, e.provide(Fe, this);
479
+ e.config.globalProperties.$access = this, e.provide(ke, this);
478
480
  }
479
481
  isAuthPath(e) {
480
482
  const { auth: t, isAuth: s } = this.options;
@@ -495,7 +497,7 @@ class ke {
495
497
  setData(e) {
496
498
  const { privateKey: t } = this.options;
497
499
  if (Array.isArray(e) && t) {
498
- const s = e.map((r) => ge(r, t));
500
+ const s = e.map((r) => ye(r, t));
499
501
  try {
500
502
  this.data = JSON.parse(s.join(""));
501
503
  } catch (r) {
@@ -505,7 +507,7 @@ class ke {
505
507
  }
506
508
  if (typeof e == "string")
507
509
  try {
508
- const s = t ? ge(e, t) : e;
510
+ const s = t ? ye(e, t) : e;
509
511
  s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
510
512
  } catch (s) {
511
513
  console.warn(s);
@@ -514,7 +516,7 @@ class ke {
514
516
  this.data = e;
515
517
  }
516
518
  loadData() {
517
- const { storageKey: e, storagePrefix: t } = this.options, s = W.get(e, {
519
+ const { storageKey: e, storagePrefix: t } = this.options, s = X.get(e, {
518
520
  type: "local",
519
521
  prefix: t
520
522
  });
@@ -522,10 +524,10 @@ class ke {
522
524
  }
523
525
  isLogined() {
524
526
  const { session: e, authKey: t } = this.options;
525
- return e && t ? !!Q.get(t) : !!this.getToken();
527
+ return e && t ? !!Y.get(t) : !!this.getToken();
526
528
  }
527
529
  hasRoutePermission(e) {
528
- if (e.name === M) {
530
+ if (e.name === D) {
529
531
  const t = e.params.id;
530
532
  return t && this.can(t);
531
533
  }
@@ -542,10 +544,10 @@ class ke {
542
544
  return t();
543
545
  {
544
546
  const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
545
- return await this.showTip(s), L(r) ? (r(), t(!1)) : b(r) ? t(r) : t(!1);
547
+ return await this.showTip(s), q(r) ? (r(), t(!1)) : C(r) ? t(r) : t(!1);
546
548
  }
547
549
  }
548
- t(!1), this.toLogin();
550
+ t(!1), await J(0), this.toLogin();
549
551
  }
550
552
  isWhiteList(e) {
551
553
  const { whiteList: t } = this.options;
@@ -561,7 +563,7 @@ class ke {
561
563
  }
562
564
  async showTip(e) {
563
565
  const { alert: t } = this.options;
564
- return t ? (await ce(150), await t(e, {
566
+ return t ? (await J(150), await t(e, {
565
567
  title: "提示",
566
568
  type: "warning"
567
569
  })?.catch(() => !1)) : !1;
@@ -578,50 +580,50 @@ class ke {
578
580
  }
579
581
  }
580
582
  function St() {
581
- return Ee(Fe, null);
583
+ return Re(ke, null);
582
584
  }
583
- function vs(n = {}) {
585
+ function js(n = {}) {
584
586
  const {
585
587
  notify: e,
586
588
  loading: t,
587
589
  settings: s = {},
588
590
  Startup: r,
589
591
  access: o,
590
- useTitle: a,
591
- alert: i
592
+ useTitle: i,
593
+ alert: a
592
594
  } = n;
593
- let p = null;
595
+ let f = null;
594
596
  return {
595
- request: $e({
597
+ request: Ee({
596
598
  settings: {
597
599
  type: "form",
598
600
  validSuccess: !0,
599
601
  originResponse: !1,
600
602
  loading: !0,
601
- validate: (l) => l.data?.code === 0 || !!l.data?.success,
603
+ validate: (u) => u.data?.code === 0 || !!u.data?.success,
602
604
  failMessage: !0,
603
- showError: (l) => {
604
- e && e(l || "未知错误");
605
+ showError: (u) => {
606
+ e && e(u || "未知错误");
605
607
  },
606
608
  showLoading: () => {
607
- p && p.close(), t && (p = t());
609
+ f && f.close(), t && (f = t());
608
610
  },
609
611
  hideLoading: () => {
610
- p && (p.close(), p = null);
612
+ f && (f.close(), f = null);
611
613
  },
612
614
  ...s
613
615
  }
614
616
  }),
615
- jsonp: je,
617
+ jsonp: be,
616
618
  notify: e,
617
619
  loading: t,
618
- useTitle: a,
620
+ useTitle: i,
619
621
  startupComponent: r,
620
- access: o ? new ke({ alert: i, ...o }) : void 0
622
+ access: o ? new fe({ alert: a, ...o }) : void 0
621
623
  };
622
624
  }
623
- function ys(n = {}) {
624
- return new ke(n);
625
+ function Es(n = {}) {
626
+ return new fe(n);
625
627
  }
626
628
  function $t(n, e) {
627
629
  const { jsonp: t, request: s } = e;
@@ -631,7 +633,7 @@ function $t(n, e) {
631
633
  query: r
632
634
  });
633
635
  {
634
- const r = n.headers ? D(n.headers, {}, !0) : void 0, o = {
636
+ const r = n.headers ? H(n.headers, {}, !0) : void 0, o = {
635
637
  url: n.url,
636
638
  method: n.method,
637
639
  settings: {
@@ -639,19 +641,19 @@ function $t(n, e) {
639
641
  headers: r
640
642
  }
641
643
  };
642
- return (a, i) => (delete o.data, s.send(We(o, i || {}, { data: a })));
644
+ return (i, a) => (delete o.data, s.send(Qe(o, a || {}, { data: i })));
643
645
  }
644
646
  }
645
647
  function jt(n, e) {
646
648
  const { metaQuery: t } = e;
647
649
  if (!t) return;
648
650
  const { code: s, queryCode: r } = n;
649
- return (o, a) => {
651
+ return (o, i) => {
650
652
  if (!t) {
651
653
  console.warn("adapter.metaQuery is not defined!");
652
654
  return;
653
655
  }
654
- return t(s, r, o, a);
656
+ return t(s, r, o, i);
655
657
  };
656
658
  }
657
659
  function Et(n = [], e = [], t) {
@@ -662,19 +664,19 @@ function Et(n = [], e = [], t) {
662
664
  s[r.id] = jt(r, t);
663
665
  return s;
664
666
  }
665
- async function Rt(n = [], e = window) {
666
- const t = O(e);
667
+ async function bt(n = [], e = window) {
668
+ const t = T(e);
667
669
  t && (Me(e), n.forEach((s) => Pt(t, s)));
668
670
  }
669
- function bt(n, e = window) {
670
- const t = T(n.mockTemplate) && n.mockTemplate.value ? ne(n.mockTemplate, {}, !0) : void 0, s = O(e);
671
+ function Rt(n, e = window) {
672
+ const t = S(n.mockTemplate) && n.mockTemplate.value ? E(n.mockTemplate, {}, !0) : void 0, s = T(e);
671
673
  return async (...r) => {
672
674
  let o = {};
673
675
  if (t)
674
676
  try {
675
677
  o = await t.apply(t, r);
676
- } catch (a) {
677
- I.warn("模拟数据模版异常", a);
678
+ } catch (i) {
679
+ k.warn("模拟数据模版异常", i);
678
680
  }
679
681
  return s?.mock(o);
680
682
  };
@@ -683,15 +685,15 @@ function Pt(n, e) {
683
685
  if (!e.mock) return;
684
686
  const { url: t, mockTemplate: s } = e;
685
687
  if (t && s) {
686
- const r = Qe(`${t}(.*)`), o = Xe(t, { decode: decodeURIComponent }), a = D(s, {}, !0);
687
- n.mock(r, (i) => {
688
- const p = A.parse(i.url) || {}, c = i.body instanceof FormData ? Ye(i.body) : i.body, l = o(i.url)?.params;
689
- return Object.assign(i, { data: c, params: p, query: l }), n.mock(a(i));
688
+ const r = We(`${t}(.*)`), o = Xe(t, { decode: decodeURIComponent }), i = H(s, {}, !0);
689
+ n.mock(r, (a) => {
690
+ const f = F.parse(a.url) || {}, c = a.body instanceof FormData ? Ye(a.body) : a.body, u = o(a.url)?.params;
691
+ return Object.assign(a, { data: c, params: f, query: u }), n.mock(i(a));
690
692
  });
691
693
  }
692
694
  }
693
695
  function Me(n = window) {
694
- const e = O(n);
696
+ const e = T(n);
695
697
  e && (e._mocked = {});
696
698
  }
697
699
  class Ct {
@@ -723,7 +725,7 @@ class Ct {
723
725
  const { mode: t, dsl: s, attrs: r } = e;
724
726
  this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
725
727
  }
726
- setup(e, t = q) {
728
+ setup(e, t = z) {
727
729
  const s = t.getCurrentInstance();
728
730
  if (!s) return;
729
731
  this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
@@ -737,12 +739,12 @@ class Ct {
737
739
  });
738
740
  }
739
741
  __proxy() {
740
- this.__instance && we.forEach((e) => {
742
+ this.__instance && $e.forEach((e) => {
741
743
  this[e] = this.__instance?.[e];
742
744
  });
743
745
  }
744
746
  __cleanup() {
745
- we.forEach((e) => {
747
+ $e.forEach((e) => {
746
748
  this[e] = null;
747
749
  }), this.__reset();
748
750
  }
@@ -751,30 +753,30 @@ class Ct {
751
753
  }
752
754
  __parseFunction(e) {
753
755
  if (e)
754
- if (this.__mode === w.Runtime) {
756
+ if (this.__mode === _.Runtime) {
755
757
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
756
- return ne({ type: s, value: r }, this);
758
+ return E({ type: s, value: r }, this);
757
759
  } else
758
- return ne(e, this);
760
+ return E(e, this);
759
761
  }
760
762
  __parseExpression(e) {
761
763
  if (e)
762
- if (this.__mode === w.Runtime) {
764
+ if (this.__mode === _.Runtime) {
763
765
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
764
- return D({ type: s, value: r }, this);
766
+ return H({ type: s, value: r }, this);
765
767
  } else
766
- return D(e, this);
768
+ return H(e, this);
767
769
  }
768
770
  __ref(e = null, t) {
769
- if (this.__mode !== w.VNode)
771
+ if (this.__mode !== _.VNode)
770
772
  return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
771
- await ce(0);
773
+ await J(0);
772
774
  let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
773
775
  if (!r) {
774
776
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
775
777
  return;
776
778
  }
777
- return r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, w.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, s)), typeof t == "function" ? t(s) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, s)), s;
779
+ return r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, _.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, s)), typeof t == "function" ? t(s) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, s)), s;
778
780
  };
779
781
  }
780
782
  __getRefEl(e, t, s) {
@@ -793,79 +795,79 @@ class Ct {
793
795
  return s.context.__proto__ = this.context, s.__proto__ = this, s;
794
796
  }
795
797
  }
796
- function re(n) {
798
+ function oe(n) {
797
799
  const {
798
- Vue: e = q,
799
- mode: t = w.Runtime,
800
+ Vue: e = z,
801
+ mode: t = _.Runtime,
800
802
  components: s = {},
801
803
  libs: r = {},
802
804
  apis: o = {},
803
- loader: a
804
- } = n, i = e.computed(() => n.dsl), p = {
805
+ loader: i
806
+ } = n, a = e.computed(() => n.dsl), f = {
805
807
  $components: s,
806
808
  $libs: r,
807
809
  $apis: o
808
810
  }, c = new Ct({
809
811
  mode: t,
810
- dsl: i.value,
811
- attrs: p
812
- }), l = e.defineComponent({
813
- name: i.value.name,
814
- __scopeId: i.value.id ? `data-v-${i.value.id}` : void 0,
812
+ dsl: a.value,
813
+ attrs: f
814
+ }), u = e.defineComponent({
815
+ name: a.value.name,
816
+ __scopeId: a.value.id ? `data-v-${a.value.id}` : void 0,
815
817
  props: {
816
- ...It(i.value.props ?? [], c)
818
+ ...It(a.value.props ?? [], c)
817
819
  },
818
- setup(u) {
819
- c.$props = u, c.props = u, i.value.id && Ce(
820
+ setup(l) {
821
+ c.$props = l, c.props = l, a.value.id && le(
820
822
  n.window || window,
821
- i.value.id,
822
- i.value.css || "",
823
+ a.value.id,
824
+ a.value.css || "",
823
825
  !0
824
- ), c.state = Ft(e, i.value.state ?? {}, c);
825
- const h = kt(e, i.value.computed ?? {}, c), f = Mt(i.value.methods ?? {}, c), d = Ot(e, i.value.inject, c);
826
- for (const [m, j] of Object.entries(d || {}))
827
- d[m] = e.inject(m, j);
826
+ ), c.state = Ft(e, a.value.state ?? {}, c);
827
+ const h = kt(e, a.value.computed ?? {}, c), p = Mt(a.value.methods ?? {}, c), d = Ot(e, a.value.inject, c);
828
+ for (const [m, b] of Object.entries(d || {}))
829
+ d[m] = e.inject(m, b);
828
830
  const v = Dt(
829
- i.value.dataSources || {},
831
+ a.value.dataSources || {},
830
832
  c
831
833
  ), g = {
832
834
  ...d,
833
835
  ...h,
834
- ...f,
836
+ ...p,
835
837
  ...v
836
838
  };
837
- return c.setup(g, e), Tt(e, i.value.watch ?? [], c), {
839
+ return c.setup(g, e), Tt(e, a.value.watch ?? [], c), {
838
840
  vtj: c
839
841
  };
840
842
  },
841
- emits: At(i.value.emits),
843
+ emits: At(a.value.emits),
842
844
  expose: ["vtj"],
843
845
  render() {
844
- if (!i.value.nodes) return null;
845
- const u = i.value.nodes || [];
846
- return u.length === 1 ? F(u[0], c, e, a, u) : u.map(
847
- (h) => F(h, c, e, a, u)
846
+ if (!a.value.nodes) return null;
847
+ const l = a.value.nodes || [];
848
+ return l.length === 1 ? M(l[0], c, e, i, l) : l.map(
849
+ (h) => M(h, c, e, i, l)
848
850
  );
849
851
  },
850
- ...Ht(i.value.lifeCycles ?? {}, c)
852
+ ...Ht(a.value.lifeCycles ?? {}, c)
851
853
  });
852
854
  return {
853
- renderer: e.markRaw(l),
855
+ renderer: e.markRaw(u),
854
856
  context: c
855
857
  };
856
858
  }
857
859
  function At(n = []) {
858
- return n.map((e) => b(e) ? e : e.name);
860
+ return n.map((e) => C(e) ? e : e.name);
859
861
  }
860
862
  function It(n = [], e) {
861
863
  const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => it[o]) : void 0;
862
- return n.map((s) => b(s) ? {
864
+ return n.map((s) => C(s) ? {
863
865
  name: s
864
866
  } : {
865
867
  name: s.name,
866
868
  type: s.type,
867
869
  required: s.required,
868
- default: $(s.default) ? e.__parseExpression(s.default) : s.default
870
+ default: j(s.default) ? e.__parseExpression(s.default) : s.default
869
871
  }).reduce(
870
872
  (s, r) => (s[r.name] = {
871
873
  type: t(r.type),
@@ -880,7 +882,7 @@ function Ft(n, e, t) {
880
882
  Object.keys(e || {}).reduce(
881
883
  (s, r) => {
882
884
  let o = e[r];
883
- return $(o) ? o = t.__parseExpression(o) : T(o) && (o = t.__parseFunction(o)), s[r] = o, s;
885
+ return j(o) ? o = t.__parseExpression(o) : S(o) && (o = t.__parseFunction(o)), s[r] = o, s;
884
886
  },
885
887
  {}
886
888
  )
@@ -901,10 +903,10 @@ function Mt(n, e) {
901
903
  function Ot(n, e = [], t) {
902
904
  return e.reduce(
903
905
  (s, r) => {
904
- const { name: o, from: a } = r || {};
906
+ const { name: o, from: i } = r || {};
905
907
  r.default;
906
- const i = $(a) ? t.__parseExpression(a) || o : a ?? o, p = $(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
907
- return s[o] = n.inject(i, p), s;
908
+ const a = j(i) ? t.__parseExpression(i) || o : i ?? o, f = j(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
909
+ return s[o] = n.inject(a, f), s;
908
910
  },
909
911
  {}
910
912
  );
@@ -914,12 +916,12 @@ function Dt(n, e) {
914
916
  (t, s) => {
915
917
  const r = n[s];
916
918
  if (r.type === "mock")
917
- t[s] = bt(r);
919
+ t[s] = Rt(r);
918
920
  else if (r.ref) {
919
- const o = e.$apis[r.ref], a = T(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
920
- t[s] = async (...i) => {
921
- const p = await o.apply(e, i);
922
- return a ? a(p) : p;
921
+ const o = e.$apis[r.ref], i = S(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
922
+ t[s] = async (...a) => {
923
+ const f = await o.apply(e, a);
924
+ return i ? i(f) : f;
923
925
  };
924
926
  }
925
927
  return t;
@@ -944,131 +946,131 @@ function Ht(n, e) {
944
946
  (t, [s, r]) => {
945
947
  const o = e.__parseFunction(r);
946
948
  return t[s] = async () => {
947
- await ce(0), L(o) && o();
949
+ await J(0), q(o) && o();
948
950
  }, t;
949
951
  },
950
952
  {}
951
953
  );
952
954
  }
953
955
  const Oe = new Ze();
954
- let X = [], C = {};
956
+ let Z = [], I = {};
955
957
  const xt = (n) => n;
956
958
  async function De(n, e = window) {
957
- const { urls: t = [], library: s } = n, r = t.filter((i) => z(i));
959
+ const { urls: t = [], library: s } = n, r = t.filter((a) => V(a));
958
960
  if (r.length === 0 || !s) return null;
959
- const o = t.filter((i) => K(i));
960
- return o.length && Ae(o, e), await Ie(r, s, e).catch(
961
- (i) => (console.warn("loadScriptUrl error", r, s, i), null)
961
+ const o = t.filter((a) => G(a));
962
+ return o.length && Ie(o, e), await Fe(r, s, e).catch(
963
+ (a) => (console.warn("loadScriptUrl error", r, s, a), null)
962
964
  );
963
965
  }
964
- function oe(n) {
966
+ function ie(n) {
965
967
  const { getDsl: e, getDslByUrl: t, options: s } = n;
966
- return s.window && (X.forEach((r) => {
968
+ return s.window && (Z.forEach((r) => {
967
969
  delete s.window[r];
968
- }), X = []), (r, o, a = q) => {
970
+ }), Z = []), (r, o, i = z) => {
969
971
  if (!o || typeof o == "string") return r;
970
972
  if (o.type === "Schema" && o.id)
971
- return a.defineAsyncComponent(async () => {
972
- const i = C[o.id] || await Oe.add(
973
+ return i.defineAsyncComponent(async () => {
974
+ const a = I[o.id] || await Oe.add(
973
975
  o.id,
974
976
  () => e(o.id)
975
977
  );
976
- return i && (i.name = r, C[o.id] = i), i ? re({
978
+ return a && (a.name = r, I[o.id] = a), a ? oe({
977
979
  ...s,
978
- Vue: a,
979
- dsl: ve(i),
980
- mode: w.Runtime,
981
- loader: oe(n)
980
+ Vue: i,
981
+ dsl: _e(a),
982
+ mode: _.Runtime,
983
+ loader: ie(n)
982
984
  }).renderer : null;
983
985
  });
984
986
  if (o.type === "UrlSchema" && o.url)
985
- return a.defineAsyncComponent(async () => {
986
- const i = C[o.url] || await t(o.url);
987
- return i && (i.name = r, C[o.url] = i), i ? re({
987
+ return i.defineAsyncComponent(async () => {
988
+ const a = I[o.url] || await t(o.url);
989
+ return a && (a.name = r, I[o.url] = a), a ? oe({
988
990
  ...s,
989
- Vue: a,
990
- dsl: ve(i),
991
- mode: w.Runtime,
992
- loader: oe(n)
991
+ Vue: i,
992
+ dsl: _e(a),
993
+ mode: _.Runtime,
994
+ loader: ie(n)
993
995
  }).renderer : null;
994
996
  });
995
997
  if (o.type === "Plugin") {
996
- let i = o.library ? C[o.library] : null;
997
- return i || (o.library && X.push(o.library), i = C[o.library || Symbol()] = a.defineAsyncComponent(
998
+ let a = o.library ? I[o.library] : null;
999
+ return a || (o.library && Z.push(o.library), a = I[o.library || Symbol()] = i.defineAsyncComponent(
998
1000
  async () => {
999
- const p = await De(o, s.window);
1000
- return p || (console.warn("getPlugin result is null", o), null);
1001
+ const f = await De(o, s.window);
1002
+ return f || (console.warn("getPlugin result is null", o), null);
1001
1003
  }
1002
- ), i);
1004
+ ), a);
1003
1005
  }
1004
1006
  return r;
1005
1007
  };
1006
1008
  }
1007
- function _s() {
1008
- C = {}, Oe.clearAllCache();
1009
+ function bs() {
1010
+ I = {}, Oe.clearAllCache();
1009
1011
  }
1010
- function F(n, e, t = q, s = xt, r = [], o = !1) {
1012
+ function M(n, e, t = z, s = xt, r = [], o = !1) {
1011
1013
  if (!n || !n.name || n.invisible) return null;
1012
- const a = t.getCurrentInstance()?.appContext, { id: i = null, directives: p = [] } = n, { vIf: c, vElseIf: l, vElse: u, vFor: h, vShow: f, vModels: d, vBind: v, vHtml: g, others: m } = Te(p);
1013
- if (!o && (l || u))
1014
+ const i = t.getCurrentInstance()?.appContext, { id: a = null, directives: f = [] } = n, { vIf: c, vElseIf: u, vElse: l, vFor: h, vShow: p, vModels: d, vBind: v, vHtml: g, others: m } = Te(f);
1015
+ if (!o && (u || l))
1014
1016
  return null;
1015
1017
  if (c && !Nt(c, e))
1016
- return qt(n, e, t, s, r);
1017
- const j = (y, H = 0) => {
1018
- const P = y.$components, G = (() => {
1018
+ return Jt(n, e, t, s, r);
1019
+ const b = (y, x = 0) => {
1020
+ const A = y.$components, Q = (() => {
1019
1021
  if (n.name === "component")
1020
1022
  return Ut(y, n.props?.is);
1021
1023
  if (n.name === "slot") return n.name;
1022
- const S = s(n.name, n.from, t);
1023
- if (b(S))
1024
- return vt(S) || yt(S) ? S : P[S] ?? a?.app?.component(S) ?? S;
1025
- if (et(S) && n.id) {
1026
- const de = `Loader${n.id}_${H}`, he = P[de];
1027
- return he || (P[de] = S);
1024
+ const $ = s(n.name, n.from, t);
1025
+ if (C($))
1026
+ return vt($) || yt($) ? $ : A[$] ?? i?.app?.component($) ?? $;
1027
+ if (et($) && n.id) {
1028
+ const me = `Loader${n.id}_${x}`, ge = A[me];
1029
+ return ge || (A[me] = $);
1028
1030
  }
1029
- return S;
1030
- })(), E = Lt(i, n.props ?? {}, y), Le = Jt(t, n.events ?? {}, y);
1031
+ return $;
1032
+ })(), R = Lt(a, n.props ?? {}, y), Le = qt(t, n.events ?? {}, y);
1031
1033
  if (n.name === "slot")
1032
- return Kt(t, n, E, y, s);
1033
- v && Object.assign(E, y.__parseExpression(v.value)), f && (E.style = Object.assign(
1034
- E.style ?? {},
1035
- Gt(f, y)
1036
- )), g && Object.assign(E, Vt(g, y)), d.forEach((S) => {
1037
- Object.assign(E, Wt(t, S, y));
1034
+ return Kt(t, n, R, y, s);
1035
+ v && Object.assign(R, y.__parseExpression(v.value)), p && (R.style = Object.assign(
1036
+ R.style ?? {},
1037
+ Gt(p, y)
1038
+ )), g && Object.assign(R, Vt(g, y)), d.forEach(($) => {
1039
+ Object.assign(R, Qt(t, $, y));
1038
1040
  });
1039
- const Je = Qt(
1041
+ const qe = Wt(
1040
1042
  t,
1041
1043
  n.children ?? [],
1042
1044
  y,
1043
1045
  s,
1044
1046
  n
1045
- ), pe = y?.__id ? `data-v-${y.__id}` : void 0, qe = pe ? { [pe]: "" } : {};
1046
- let V = t.createVNode(
1047
- G,
1048
- { key: `${i}_${H}`, ...qe, ...E, ...Le },
1049
- Je
1047
+ ), de = y?.__id ? `data-v-${y.__id}` : void 0, Je = de ? { [de]: "" } : {};
1048
+ let W = t.createVNode(
1049
+ Q,
1050
+ { key: `${a}_${x}`, ...Je, ...R, ...Le },
1051
+ qe
1050
1052
  );
1051
- const fe = a ? Bt(a, m, y) : [];
1052
- return fe.length && (V = t.withDirectives(V, fe)), V;
1053
+ const he = i ? Bt(i, m, y) : [];
1054
+ return he.length && (W = t.withDirectives(W, he)), W;
1053
1055
  };
1054
- return h ? Zt(h, j, e) : j(e);
1056
+ return h ? Zt(h, b, e) : b(e);
1055
1057
  }
1056
1058
  function Bt(n, e, t) {
1057
1059
  const s = n.app;
1058
1060
  return e.map((r) => {
1059
1061
  const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
1060
1062
  if (!o) return null;
1061
- const a = [o];
1062
- return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
1063
+ const i = [o];
1064
+ return r.value && i.push(t.__parseExpression(r.value)), r.arg && i.push(r.arg), r.modifiers && i.push(r.modifiers), i;
1063
1065
  }).filter((r) => !!r);
1064
1066
  }
1065
1067
  function Te(n = []) {
1066
- const e = n.find((l) => R(l.name) === "vIf"), t = n.find(
1067
- (l) => R(l.name) === "vElseIf"
1068
- ), s = n.find((l) => R(l.name) === "vElse"), r = n.find((l) => R(l.name) === "vFor"), o = n.find((l) => R(l.name) === "vShow"), a = n.find((l) => R(l.name) === "vBind"), i = n.find((l) => R(l.name) === "vHtml"), p = n.filter(
1069
- (l) => R(l.name) === "vModel"
1068
+ const e = n.find((u) => P(u.name) === "vIf"), t = n.find(
1069
+ (u) => P(u.name) === "vElseIf"
1070
+ ), s = n.find((u) => P(u.name) === "vElse"), r = n.find((u) => P(u.name) === "vFor"), o = n.find((u) => P(u.name) === "vShow"), i = n.find((u) => P(u.name) === "vBind"), a = n.find((u) => P(u.name) === "vHtml"), f = n.filter(
1071
+ (u) => P(u.name) === "vModel"
1070
1072
  ), c = n.filter(
1071
- (l) => !ot.includes(R(l.name))
1073
+ (u) => !ot.includes(P(u.name))
1072
1074
  );
1073
1075
  return {
1074
1076
  vIf: e,
@@ -1076,56 +1078,56 @@ function Te(n = []) {
1076
1078
  vElse: s,
1077
1079
  vFor: r,
1078
1080
  vShow: o,
1079
- vModels: p,
1080
- vBind: a,
1081
+ vModels: f,
1082
+ vBind: i,
1081
1083
  others: c,
1082
- vHtml: i
1084
+ vHtml: a
1083
1085
  };
1084
1086
  }
1085
1087
  function Nt(n, e) {
1086
1088
  return !!e.__parseExpression(n.value);
1087
1089
  }
1088
1090
  function Ut(n, e) {
1089
- return e ? $(e) ? n.__parseExpression(e) : e : "div";
1091
+ return e ? j(e) ? n.__parseExpression(e) : e : "div";
1090
1092
  }
1091
1093
  function Lt(n, e, t) {
1092
- const s = ie(e, t);
1094
+ const s = ae(e, t);
1093
1095
  return s.ref = t.__ref(n, s.ref), s;
1094
1096
  }
1095
- function ie(n, e) {
1096
- return $(n) ? e.__parseExpression(n) : T(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) => ie(t, e)) : typeof n == "object" ? Object.keys(n || {}).reduce(
1097
+ function ae(n, e) {
1098
+ return j(n) ? e.__parseExpression(n) : S(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) => ae(t, e)) : typeof n == "object" ? Object.keys(n || {}).reduce(
1097
1099
  (t, s) => {
1098
1100
  let r = n[s];
1099
- return t[s] = ie(r, e), t;
1101
+ return t[s] = ae(r, e), t;
1100
1102
  },
1101
1103
  {}
1102
1104
  ) : n;
1103
1105
  }
1104
- function Jt(n, e, t) {
1106
+ function qt(n, e, t) {
1105
1107
  const s = ["passive", "capture", "once"], r = {
1106
1108
  capture: "Capture",
1107
1109
  once: "Once",
1108
1110
  passive: "OnceCapture"
1109
1111
  };
1110
1112
  return Object.keys(e || {}).reduce(
1111
- (o, a) => {
1112
- const i = e[a], p = He(i.modifiers), c = p.find((h) => s.includes(h)), l = "on" + tt(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
1113
- return u && (o[l] = n.withModifiers(u, p)), o;
1113
+ (o, i) => {
1114
+ const a = e[i], f = He(a.modifiers), c = f.find((h) => s.includes(h)), u = "on" + tt(i) + (c && r[c] || ""), l = t.__parseFunction(a.handler);
1115
+ return l && (o[u] = n.withModifiers(l, f)), o;
1114
1116
  },
1115
1117
  {}
1116
1118
  );
1117
1119
  }
1118
- function qt(n, e, t, s, r = []) {
1119
- let o = r.findIndex((a) => a.id === n.id);
1120
- for (let a = ++o; a < r.length; a++) {
1121
- const { directives: i = [] } = r[a], { vElseIf: p, vElse: c } = Te(i);
1122
- if (p) {
1123
- if (e.__parseExpression(p.value))
1124
- return F(r[a], e, t, s, r, !0);
1120
+ function Jt(n, e, t, s, r = []) {
1121
+ let o = r.findIndex((i) => i.id === n.id);
1122
+ for (let i = ++o; i < r.length; i++) {
1123
+ const { directives: a = [] } = r[i], { vElseIf: f, vElse: c } = Te(a);
1124
+ if (f) {
1125
+ if (e.__parseExpression(f.value))
1126
+ return M(r[i], e, t, s, r, !0);
1125
1127
  continue;
1126
1128
  }
1127
1129
  if (c)
1128
- return F(r[a], e, t, s, r, !0);
1130
+ return M(r[i], e, t, s, r, !0);
1129
1131
  }
1130
1132
  return null;
1131
1133
  }
@@ -1134,17 +1136,17 @@ function He(n = {}, e = !1) {
1134
1136
  return e ? t.map((s) => "." + s) : t;
1135
1137
  }
1136
1138
  function Kt(n, e, t, s, r) {
1137
- const { children: o } = e, a = zt(e, s), i = s.$slots?.[a.name];
1138
- return i ? i(t) : o ? b(o) ? n.createTextVNode(o) : $(o) ? n.createTextVNode(
1139
- Pe(s.__parseExpression(o))
1139
+ const { children: o } = e, i = zt(e, s), a = s.$slots?.[i.name];
1140
+ return a ? a(t) : o ? C(o) ? n.createTextVNode(o) : j(o) ? n.createTextVNode(
1141
+ Ae(s.__parseExpression(o))
1140
1142
  ) : Array.isArray(o) ? o.map(
1141
- (p) => F(p, s, n, r, o)
1143
+ (f) => M(f, s, n, r, o)
1142
1144
  ) : null : null;
1143
1145
  }
1144
1146
  function zt(n, e) {
1145
1147
  const { props: t } = n, s = t?.name || "default";
1146
1148
  return {
1147
- name: $(s) ? e.__parseExpression(s) : s,
1149
+ name: j(s) ? e.__parseExpression(s) : s,
1148
1150
  params: []
1149
1151
  };
1150
1152
  }
@@ -1158,41 +1160,41 @@ function Vt(n, e) {
1158
1160
  innerHTML: e.__parseExpression(n.value) || ""
1159
1161
  };
1160
1162
  }
1161
- function Wt(n, e, t) {
1163
+ function Qt(n, e, t) {
1162
1164
  const s = {
1163
1165
  type: "JSFunction",
1164
1166
  value: e.value?.value ? `(v) => {
1165
1167
  ${e.value.value} = v;
1166
1168
  }` : "(v) => {}"
1167
1169
  }, r = t.__parseFunction(s), o = He(
1168
- $(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
1169
- ), a = $(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
1170
+ j(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
1171
+ ), i = j(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
1170
1172
  return {
1171
- [a]: t.__parseExpression(e.value),
1172
- [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
1173
+ [i]: t.__parseExpression(e.value),
1174
+ [`onUpdate:${i}`]: o.length && r ? n.withModifiers(r, o) : r
1173
1175
  };
1174
1176
  }
1175
- function Qt(n, e, t, s, r) {
1177
+ function Wt(n, e, t, s, r) {
1176
1178
  if (!e) return null;
1177
- if (b(e))
1179
+ if (C(e))
1178
1180
  return { default: () => e };
1179
- if ($(e))
1181
+ if (j(e))
1180
1182
  return {
1181
- default: () => Pe(t.__parseExpression(e))
1183
+ default: () => Ae(t.__parseExpression(e))
1182
1184
  };
1183
1185
  if (Array.isArray(e) && e.length > 0) {
1184
- const o = Xt(e), a = (i, p) => !i || !r ? {} : r?.id && Object.keys(i).length ? p ? {
1185
- [p]: i
1186
+ const o = Xt(e), i = (a, f) => !a || !r ? {} : r?.id && Object.keys(a).length ? f ? {
1187
+ [f]: a
1186
1188
  } : {
1187
- [`scope_${r.id}`]: i
1188
- } : p ? { [p]: /* @__PURE__ */ Object.create(null) } : {};
1189
+ [`scope_${r.id}`]: a
1190
+ } : f ? { [f]: /* @__PURE__ */ Object.create(null) } : {};
1189
1191
  return Object.entries(o).reduce(
1190
- (i, [p, { nodes: c, params: l, scope: u }]) => (i[p] = (h) => {
1191
- const f = l.length ? st(h ?? {}, l) : a(h, u);
1192
+ (a, [f, { nodes: c, params: u, scope: l }]) => (a[f] = (h) => {
1193
+ const p = u.length ? st(h ?? {}, u) : i(h, l);
1192
1194
  return c.map(
1193
- (d) => F(d, t.__clone(f), n, s, c)
1195
+ (d) => M(d, t.__clone(p), n, s, c)
1194
1196
  );
1195
- }, i),
1197
+ }, a),
1196
1198
  {}
1197
1199
  );
1198
1200
  }
@@ -1211,21 +1213,21 @@ function Xt(n) {
1211
1213
  return e;
1212
1214
  }
1213
1215
  function Yt(n = "default") {
1214
- return b(n) ? { name: n, params: [], scope: "" } : { params: [], scope: "", ...n };
1216
+ return C(n) ? { name: n, params: [], scope: "" } : { params: [], scope: "", ...n };
1215
1217
  }
1216
1218
  function Zt(n, e, t) {
1217
- const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
1218
- let i = t.__parseExpression(s) || [];
1219
- return Number.isInteger(i) && (i = new Array(i).fill(!0).map((p, c) => c + 1)), Array.isArray(i) ? i.map((p, c) => e(t.__clone({ [o]: p, [a]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
1219
+ const { value: s, iterator: r } = n, { item: o = "item", index: i = "index" } = r || {};
1220
+ let a = t.__parseExpression(s) || [];
1221
+ return Number.isInteger(a) && (a = new Array(a).fill(!0).map((f, c) => c + 1)), Array.isArray(a) ? a.map((f, c) => e(t.__clone({ [o]: f, [i]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
1220
1222
  }
1221
- const Y = Re({
1223
+ const ee = Pe({
1222
1224
  name: "VtjPageContainer",
1223
1225
  async setup() {
1224
- const n = Ne(), e = be(), t = e.meta.__vtj__ || e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = se(Symbol());
1226
+ const n = Ne(), e = Ce(), t = e.meta.__vtj__ || e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = re(Symbol());
1225
1227
  if (s) {
1226
1228
  Object.assign(e.meta, s.meta || {}, { cache: s.cache });
1227
- const { useTitle: a } = n?.adapter;
1228
- a && a(s.title || "VTJ");
1229
+ const { useTitle: i } = n?.adapter;
1230
+ i && i(s.title || "VTJ");
1229
1231
  }
1230
1232
  return {
1231
1233
  provider: n,
@@ -1239,34 +1241,34 @@ const Y = Re({
1239
1241
  },
1240
1242
  render() {
1241
1243
  const { component: n, query: e, sid: t } = this;
1242
- return n ? te(n, { ...e, key: t }) : te("div", "页面不存在");
1244
+ return n ? ne(n, { ...e, key: t }) : ne("div", "页面不存在");
1243
1245
  },
1244
1246
  activated() {
1245
1247
  this.meta.cache === !1 && (this.sid = Symbol());
1246
1248
  }
1247
- }), es = Re({
1249
+ }), es = Pe({
1248
1250
  name: "VtjStartupContainer",
1249
1251
  render() {
1250
- return te("div", "page not found!");
1252
+ return ne("div", "page not found!");
1251
1253
  }
1252
1254
  });
1253
- function J(n, e, t = []) {
1255
+ function K(n, e, t = []) {
1254
1256
  const s = [];
1255
1257
  for (const r of t) {
1256
- const { id: o, title: a, icon: i, children: p, hidden: c, layout: l } = r;
1257
- if (l) {
1258
- const u = J(n, e, p || []);
1259
- s.push(...u);
1258
+ const { id: o, title: i, icon: a, children: f, hidden: c, layout: u } = r;
1259
+ if (u) {
1260
+ const l = K(n, e, f || []);
1261
+ s.push(...l);
1260
1262
  } else {
1261
- const u = {
1263
+ const l = {
1262
1264
  id: o,
1263
- title: a,
1264
- icon: i,
1265
+ title: i,
1266
+ icon: a,
1265
1267
  hidden: c,
1266
1268
  url: `${n}/${e}/${o}`,
1267
- children: p && p.length ? J(n, e, p) : void 0
1269
+ children: f && f.length ? K(n, e, f) : void 0
1268
1270
  };
1269
- s.push(u);
1271
+ s.push(l);
1270
1272
  }
1271
1273
  }
1272
1274
  return s;
@@ -1282,114 +1284,161 @@ function xe(n, e) {
1282
1284
  e.can(s.id.toString()) && t.push(s);
1283
1285
  return t;
1284
1286
  }
1285
- function ws(n) {
1287
+ function Rs(n) {
1286
1288
  const {
1287
1289
  menuPathPrefix: e = "",
1288
1290
  pageRouteName: t = "page",
1289
1291
  disableMenusFilter: s = !1
1290
- } = n || {}, r = Ne(), o = be(), a = St(), i = se(!1), p = se(!1), c = r.project, l = (f) => {
1291
- i.value = !f?.mask, p.value = !!f?.pure;
1292
+ } = n || {}, r = Ne(), o = Ce(), i = St(), a = re(!1), f = re(!1), c = r.project, u = (p) => {
1293
+ a.value = !p?.mask, f.value = !!p?.pure;
1292
1294
  };
1293
1295
  rt(() => {
1294
- const { name: f, params: d, meta: v } = o;
1295
- if (f === M) {
1296
+ const { name: p, params: d, meta: v } = o;
1297
+ if (p === D) {
1296
1298
  const g = r.getPage(d.id);
1297
- l(g);
1298
- } else if (f === N) {
1299
+ u(g);
1300
+ } else if (p === U) {
1299
1301
  const g = r.getHomepage();
1300
- l(g);
1302
+ u(g);
1301
1303
  } else {
1302
1304
  const g = v.__vtj__;
1303
1305
  if (g) {
1304
1306
  const m = r.getPage(g);
1305
- l(m);
1307
+ u(m);
1306
1308
  } else
1307
- i.value = !v.mask, p.value = !!v.pure;
1309
+ a.value = !v.mask, f.value = !!v.pure;
1308
1310
  }
1309
1311
  });
1310
- const u = J(
1312
+ const l = K(
1311
1313
  e,
1312
1314
  t,
1313
1315
  c?.pages
1314
1316
  ), h = c?.config;
1315
1317
  return {
1316
- disabled: i,
1318
+ disabled: a,
1317
1319
  logo: h?.logo,
1318
1320
  themeSwitchable: h?.themeSwitchable,
1319
1321
  title: h?.title || c?.description || c?.name || "VTJ App",
1320
- menus: s ? u : xe(u, a),
1321
- pure: p
1322
+ menus: s ? l : xe(l, i),
1323
+ pure: f
1322
1324
  };
1323
1325
  }
1324
- function Z(n, e) {
1325
- const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: a = "", component: i, routeMeta: p } = e;
1326
+ function te(n, e) {
1327
+ const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: i = "", component: a, routeMeta: f } = e;
1326
1328
  return {
1327
1329
  name: t,
1328
- path: `${a}${o}/${t}`,
1329
- component: i,
1330
+ path: `${i}${o}/${t}`,
1331
+ component: a,
1330
1332
  meta: {
1331
1333
  title: s,
1332
- ...p,
1334
+ ...f,
1333
1335
  ...r,
1334
1336
  __vtj__: t
1335
1337
  }
1336
1338
  };
1337
1339
  }
1338
- function ae(n) {
1340
+ function ce(n) {
1339
1341
  const {
1340
1342
  name: e = "page",
1341
1343
  prefix: t = "",
1342
1344
  pages: s = [],
1343
1345
  component: r,
1344
1346
  loader: o,
1345
- routeMeta: a,
1346
- homepage: i
1347
- } = n, p = [];
1347
+ routeMeta: i,
1348
+ homepage: a
1349
+ } = n, f = [];
1348
1350
  for (const c of s) {
1349
- const { id: l, title: u, dir: h, layout: f, children: d, meta: v } = c;
1351
+ const { id: u, title: l, dir: h, layout: p, children: d, meta: v } = c;
1350
1352
  if (h) {
1351
- const g = ae({
1353
+ const g = ce({
1352
1354
  name: e,
1353
1355
  prefix: t,
1354
1356
  component: r,
1355
- routeMeta: a,
1356
- homepage: i,
1357
+ routeMeta: i,
1358
+ homepage: a,
1357
1359
  loader: o,
1358
1360
  pages: d || []
1359
1361
  });
1360
- p.push(...g);
1361
- } else if (f) {
1362
- const g = ae({
1362
+ f.push(...g);
1363
+ } else if (p) {
1364
+ const g = ce({
1363
1365
  name: e,
1364
1366
  prefix: t,
1365
1367
  component: r,
1366
- routeMeta: a,
1367
- homepage: i,
1368
+ routeMeta: i,
1369
+ homepage: a,
1368
1370
  loader: o,
1369
1371
  pages: d || []
1370
1372
  }), m = {
1371
- name: `layout_${l}`,
1373
+ name: `layout_${u}`,
1372
1374
  path: t,
1373
- component: () => o(l),
1375
+ component: () => o(u),
1374
1376
  meta: {
1375
- title: u,
1376
- ...a,
1377
+ title: l,
1378
+ ...i,
1377
1379
  ...v,
1378
- __vtj__: l
1380
+ __vtj__: u
1379
1381
  },
1380
1382
  children: g
1381
1383
  };
1382
- p.push(m), p.push(Z(c, n));
1383
- } else if (p.push(Z(c, n)), i === l) {
1384
- const g = Z(c, n);
1385
- g.path = "", g.name = `home_${l}`, p.push(g);
1384
+ f.push(m), f.push(te(c, n));
1385
+ } else if (f.push(te(c, n)), a === u) {
1386
+ const g = te(c, n);
1387
+ g.path = "", g.name = `home_${u}`, f.push(g);
1386
1388
  }
1387
1389
  }
1388
- return p;
1390
+ return f;
1391
+ }
1392
+ function ts(n = {}, e) {
1393
+ const { css: t, store: s, enhance: r } = n, { window: o, app: i, library: a = {}, adapter: f, mode: c } = e, { Pinia: u } = a;
1394
+ le(o, "global-css", t || ""), u && s && ss(s, i, u), rs(i, f, n), !f.access && n.access && ns(n.access, i, c, f), os(i, n), r && is(r, i);
1395
+ }
1396
+ function ss(n, e, t) {
1397
+ const s = t.createPinia();
1398
+ if (e.use(s), S(n) && n.value) {
1399
+ const r = E(n, {}, !1, !1, !0), o = t.defineStore("$store", r(e) || {});
1400
+ e.config.globalProperties.$store = o();
1401
+ }
1402
+ }
1403
+ function ns(n, e, t, s) {
1404
+ if (S(n) && n.value) {
1405
+ const r = E(n, {}, !1, !1, !0), o = new fe(r(e)), i = e.config.globalProperties.$router, a = s.request;
1406
+ o.connect({ mode: t, router: i, request: a }), e.use(o);
1407
+ }
1408
+ }
1409
+ function rs(n, e, t) {
1410
+ if (!e.request) return;
1411
+ const { axios: s, request: r, response: o } = t;
1412
+ if (s && S(s) && s.value) {
1413
+ const i = E(s, {}, !1, !1, !0);
1414
+ e.request.setConfig(i(n));
1415
+ }
1416
+ if (r && S(r) && r.value) {
1417
+ const i = E(r, {}, !1, !1, !0);
1418
+ e.request.useRequest((a) => i(a, n));
1419
+ }
1420
+ if (o && S(o) && o.value) {
1421
+ const i = E(o, {}, !1, !1, !0);
1422
+ e.request.useResponse((a) => i(a, n));
1423
+ }
1424
+ }
1425
+ function os(n, e) {
1426
+ const { beforeEach: t, afterEach: s } = e, r = n.config.globalProperties.$router;
1427
+ if (t && S(t) && t.value) {
1428
+ const o = E(t, {}, !1, !1, !0);
1429
+ r && r.beforeEach((i, a, f) => o(i, a, f, n));
1430
+ }
1431
+ if (s && S(s) && s.value) {
1432
+ const o = E(s, {}, !1, !1, !0);
1433
+ r && r.afterEach((i, a, f) => o(i, a, f, n));
1434
+ }
1435
+ }
1436
+ function is(n, e) {
1437
+ S(n) && n.value && E(n, {}, !1, !1, !0)(e);
1389
1438
  }
1390
1439
  const Be = Symbol("Provider");
1391
- var ts = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(ts || {});
1392
- class ss extends Ke {
1440
+ var as = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(as || {});
1441
+ class cs extends Ke {
1393
1442
  // DSL缓存
1394
1443
  /**
1395
1444
  * 创建Provider实例
@@ -1399,21 +1448,21 @@ class ss extends Ke {
1399
1448
  super(), this.options = e;
1400
1449
  const {
1401
1450
  service: t,
1402
- mode: s = w.Raw,
1451
+ mode: s = _.Raw,
1403
1452
  dependencies: r,
1404
1453
  materials: o,
1405
- project: a = {},
1406
- adapter: i = {},
1407
- globals: p = {},
1454
+ project: i = {},
1455
+ adapter: a = {},
1456
+ globals: f = {},
1408
1457
  modules: c = {},
1409
- router: l = null,
1410
- materialPath: u = "./",
1458
+ router: u = null,
1459
+ materialPath: l = "./",
1411
1460
  nodeEnv: h = "development"
1412
1461
  /* Development */
1413
1462
  } = e;
1414
- this.mode = s, this.modules = c, this.service = t, this.router = l, this.materialPath = u, this.nodeEnv = h, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, p), Object.assign(this.adapter, i);
1415
- const { access: f, request: d } = this.adapter;
1416
- f && f.connect({ mode: s, router: l, request: d }), a && s !== w.Design ? this.load(a) : this.project = a;
1463
+ this.mode = s, this.modules = c, this.service = t, this.router = u, this.materialPath = l, this.nodeEnv = h, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, f), Object.assign(this.adapter, a);
1464
+ const { access: p, request: d } = this.adapter;
1465
+ p && p.connect({ mode: s, router: u, request: d }), i && s !== _.Design ? this.load(i) : this.project = i;
1417
1466
  }
1418
1467
  mode;
1419
1468
  // 当前运行模式(设计/源码/预览等)
@@ -1421,7 +1470,7 @@ class ss extends Ke {
1421
1470
  // 全局变量
1422
1471
  modules = {};
1423
1472
  // 异步模块加载器
1424
- adapter = { request: ee, jsonp: je };
1473
+ adapter = { request: se, jsonp: be };
1425
1474
  // 适配器接口
1426
1475
  apis = {};
1427
1476
  // API集合
@@ -1451,9 +1500,9 @@ class ss extends Ke {
1451
1500
  try {
1452
1501
  s = await e.apply(e, t);
1453
1502
  } catch (o) {
1454
- I.warn("模拟数据模版异常", o);
1503
+ k.warn("模拟数据模版异常", o);
1455
1504
  }
1456
- return O()?.mock(s);
1505
+ return T()?.mock(s);
1457
1506
  };
1458
1507
  }
1459
1508
  /**
@@ -1469,11 +1518,11 @@ class ss extends Ke {
1469
1518
  const { vtjDir: t = ".vtj" } = this.options, s = this.modules[`${t}/projects/${e.id}.json`] || this.modules[`/src/${t}/projects/${e.id}.json`];
1470
1519
  if (this.project = s ? await s() : await this.service.init(e), !this.project)
1471
1520
  throw new Error("project is null");
1472
- const { apis: r = [], meta: o = [] } = this.project, a = window;
1473
- a && (a.CKEDITOR_VERSION = void 0), this.mode === w.Raw ? await this.loadDependencies(a) : await this.loadAssets(a), this.initMock(a), this.apis = Et(r, o, this.adapter), Me(a), Rt(r, a), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
1521
+ const { apis: r = [], meta: o = [] } = this.project, i = window;
1522
+ i && (i.CKEDITOR_VERSION = void 0), this.mode === _.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = Et(r, o, this.adapter), Me(i), bt(r, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
1474
1523
  }
1475
1524
  initMock(e) {
1476
- const t = O(e);
1525
+ const t = T(e);
1477
1526
  t && t.setup({
1478
1527
  timeout: "50-500"
1479
1528
  });
@@ -1484,45 +1533,45 @@ class ss extends Ke {
1484
1533
  e[s] || (e[s] = this.library[s] = await r());
1485
1534
  }
1486
1535
  async loadAssets(e) {
1487
- const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1488
- libraryExports: p,
1536
+ const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: i, nodeEnv: a } = this, {
1537
+ libraryExports: f,
1489
1538
  libraryMap: c,
1490
- materials: l,
1491
- materialExports: u,
1539
+ materials: u,
1540
+ materialExports: l,
1492
1541
  materialMapLibrary: h
1493
- } = pt(
1542
+ } = ft(
1494
1543
  t,
1495
- a,
1496
- i === "development"
1544
+ i,
1545
+ a === "development"
1497
1546
  /* Development */
1498
1547
  );
1499
- for (const f of p) {
1500
- const d = s[f], v = e[f];
1548
+ for (const p of f) {
1549
+ const d = s[p], v = e[p];
1501
1550
  if (v)
1502
- r[f] = v;
1551
+ r[p] = v;
1503
1552
  else if (d)
1504
- e[f] = r[f] = await d();
1553
+ e[p] = r[p] = await d();
1505
1554
  else {
1506
- const g = c[f] || [];
1555
+ const g = c[p] || [];
1507
1556
  for (const m of g)
1508
- K(m) && await mt(m, A.append(m, { v: k })), z(m) && await ye(A.append(m, { v: k }));
1509
- r[f] = e[f];
1557
+ G(m) && await mt(m, F.append(m, { v: O })), V(m) && await we(F.append(m, { v: O }));
1558
+ r[p] = e[p];
1510
1559
  }
1511
1560
  }
1512
- if (i === "development") {
1513
- for (const d of l)
1514
- await ye(A.append(d, { v: k }));
1515
- const f = this.materials || {};
1516
- for (const d of u) {
1561
+ if (a === "development") {
1562
+ for (const d of u)
1563
+ await we(F.append(d, { v: O }));
1564
+ const p = this.materials || {};
1565
+ for (const d of l) {
1517
1566
  const v = e[h[d]], g = ze[d];
1518
1567
  if (g)
1519
1568
  v && g.forEach((m) => {
1520
1569
  o[m] = v[m];
1521
1570
  });
1522
1571
  else {
1523
- const m = f[d] ? (await f[d]()).default : e[d];
1524
- m && v && (m.components || []).forEach((j) => {
1525
- o[j.name] = ft(j, v);
1572
+ const m = p[d] ? (await p[d]()).default : e[d];
1573
+ m && v && (m.components || []).forEach((b) => {
1574
+ o[b.name] = pt(b, v);
1526
1575
  });
1527
1576
  }
1528
1577
  }
@@ -1532,33 +1581,33 @@ class ss extends Ke {
1532
1581
  const { router: e, project: t, options: s, adapter: r } = this;
1533
1582
  if (!e) return;
1534
1583
  const o = t?.platform === "uniapp" ? "pages" : "page", {
1535
- routeAppendTo: a,
1536
- pageRouteName: i = o,
1537
- routeMeta: p
1538
- } = s, c = a ? "" : "/", l = {
1539
- path: `${c}${i}/:id`,
1540
- name: M,
1541
- component: Y
1542
- }, u = {
1584
+ routeAppendTo: i,
1585
+ pageRouteName: a = o,
1586
+ routeMeta: f
1587
+ } = s, c = i ? "" : "/", u = {
1588
+ path: `${c}${a}/:id`,
1589
+ name: D,
1590
+ component: ee
1591
+ }, l = {
1543
1592
  path: c,
1544
- name: N,
1545
- component: t?.homepage ? Y : r.startupComponent || es,
1546
- meta: p
1593
+ name: U,
1594
+ component: t?.homepage ? ee : r.startupComponent || es,
1595
+ meta: f
1547
1596
  };
1548
- if (e.hasRoute(M) && e.removeRoute(M), e.hasRoute(N) && e.removeRoute(N), s.enableStaticRoute) {
1597
+ if (e.hasRoute(D) && e.removeRoute(D), e.hasRoute(U) && e.removeRoute(U), s.enableStaticRoute) {
1549
1598
  const h = t?.pages || [];
1550
- ae({
1551
- name: i,
1599
+ ce({
1600
+ name: a,
1552
1601
  prefix: c,
1553
1602
  pages: h,
1554
- component: Y,
1603
+ component: ee,
1555
1604
  loader: this.getRenderComponent.bind(this),
1556
1605
  homepage: t?.homepage
1557
1606
  }).forEach((d) => {
1558
- a ? e.addRoute(a, d) : e.addRoute(d);
1559
- }), t?.homepage || (a ? e.addRoute(a, u) : e.addRoute(u));
1607
+ i ? e.addRoute(i, d) : e.addRoute(d);
1608
+ }), t?.homepage || (i ? e.addRoute(i, l) : e.addRoute(l));
1560
1609
  } else
1561
- a ? (e.addRoute(a, l), e.addRoute(a, u)) : (e.addRoute(l), e.addRoute(u));
1610
+ i ? (e.addRoute(i, u), e.addRoute(i, l)) : (e.addRoute(u), e.addRoute(l));
1562
1611
  }
1563
1612
  /**
1564
1613
  * Vue 插件安装方法
@@ -1574,8 +1623,14 @@ class ss extends Ke {
1574
1623
  const t = e.config.globalProperties.installed || {};
1575
1624
  for (const [s, r] of Object.entries(this.library))
1576
1625
  !t[s] && gt(r) && (e.use(r), t[s] = !0);
1577
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Be, this), e.config.globalProperties.$provider = this, e.config.globalProperties.installed = t, this.mode === w.Design && (e.config.errorHandler = (s, r, o) => {
1578
- const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", p = `[ ${a} ] ${i} ${o}`;
1626
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Be, this), e.config.globalProperties.$provider = this, this.project?.platform !== "uniapp" && this.initGlobals(this.project?.globals || {}, {
1627
+ app: e,
1628
+ window,
1629
+ adapter: this.adapter,
1630
+ library: this.library,
1631
+ mode: this.mode
1632
+ }), this.options.enhance && e.use(this.options.enhance, this), this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
1633
+ const i = r?.$options.name, a = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", f = `[ ${i} ] ${a} ${o}`;
1579
1634
  console.error(
1580
1635
  "[VTJ Error]:",
1581
1636
  {
@@ -1584,8 +1639,8 @@ class ss extends Ke {
1584
1639
  info: o
1585
1640
  },
1586
1641
  s?.stack
1587
- ), this.adapter.notify && this.adapter.notify(p, "组件渲染错误", "error");
1588
- }), this.options.enhance && e.use(this.options.enhance, this);
1642
+ ), this.adapter.notify && this.adapter.notify(f, "组件渲染错误", "error");
1643
+ }), e.config.globalProperties.installed = t;
1589
1644
  }
1590
1645
  getFile(e) {
1591
1646
  const { blocks: t = [] } = this.project || {};
@@ -1593,20 +1648,20 @@ class ss extends Ke {
1593
1648
  }
1594
1649
  getPage(e) {
1595
1650
  const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
1596
- for (const a of o) {
1597
- if (a.id === r)
1598
- return a;
1599
- if (a.children && a.children.length) {
1600
- const i = s(r, a.children);
1601
- if (i)
1602
- return i;
1651
+ for (const i of o) {
1652
+ if (i.id === r)
1653
+ return i;
1654
+ if (i.children && i.children.length) {
1655
+ const a = s(r, i.children);
1656
+ if (a)
1657
+ return a;
1603
1658
  }
1604
1659
  }
1605
1660
  };
1606
1661
  return s(e, t) || null;
1607
1662
  }
1608
1663
  getMenus(e = "page", t = "") {
1609
- return J(t, e, this.project?.pages || []);
1664
+ return K(t, e, this.project?.pages || []);
1610
1665
  }
1611
1666
  getHomepage() {
1612
1667
  const { homepage: e } = this.project || {};
@@ -1637,23 +1692,23 @@ class ss extends Ke {
1637
1692
  * @returns 渲染器实例
1638
1693
  */
1639
1694
  createDslRenderer(e, t = {}) {
1640
- const { library: s, components: r, mode: o, apis: a } = this, i = {
1695
+ const { library: s, components: r, mode: o, apis: i } = this, a = {
1641
1696
  mode: o,
1642
1697
  Vue: s.Vue,
1643
1698
  components: r,
1644
1699
  libs: s,
1645
- apis: a,
1700
+ apis: i,
1646
1701
  window,
1647
1702
  ...t
1648
- }, p = oe({
1703
+ }, f = ie({
1649
1704
  getDsl: async (c) => await this.getDsl(c) || null,
1650
1705
  getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
1651
- options: i
1706
+ options: a
1652
1707
  });
1653
- return re({
1654
- ...i,
1708
+ return oe({
1709
+ ...a,
1655
1710
  dsl: e,
1656
- loader: p
1711
+ loader: f
1657
1712
  });
1658
1713
  }
1659
1714
  /**
@@ -1669,13 +1724,14 @@ class ss extends Ke {
1669
1724
  async getRenderComponent(e, t) {
1670
1725
  const s = this.getFile(e);
1671
1726
  if (!s)
1672
- return I.warn(`Can not find file: ${e}`), null;
1673
- t && t(s);
1674
- const { vtjRawDir: r = ".vtj/vue" } = this.options, o = `${r}/${e}.vue`, a = this.modules[o] || this.modules[`/src/pages/${e}.vue`];
1675
- if (a)
1676
- return (await a())?.default;
1677
- const i = await this.getDsl(s.id);
1678
- return i ? this.createDslRenderer(i).renderer : (I.warn(`Can not find dsl: ${e}`), null);
1727
+ return k.warn(`Can not find file: ${e}`), null;
1728
+ if (t && t(s), this.mode === _.Raw) {
1729
+ const { vtjRawDir: o = ".vtj/vue" } = this.options, i = `${o}/${e}.vue`, a = this.modules[i] || this.modules[`/src/pages/${e}.vue`];
1730
+ if (a)
1731
+ return (await a())?.default;
1732
+ }
1733
+ const r = await this.getDsl(s.id);
1734
+ return r ? this.createDslRenderer(r).renderer : (k.warn(`Can not find dsl: ${e}`), null);
1679
1735
  }
1680
1736
  /**
1681
1737
  * 定义基于URL的异步组件
@@ -1687,7 +1743,7 @@ class ss extends Ke {
1687
1743
  * @returns Vue异步组件
1688
1744
  */
1689
1745
  defineUrlSchemaComponent(e, t) {
1690
- return _e(async () => {
1746
+ return Se(async () => {
1691
1747
  const s = await this.getDslByUrl(e);
1692
1748
  return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1693
1749
  });
@@ -1700,18 +1756,33 @@ class ss extends Ke {
1700
1756
  * @returns Vue异步组件
1701
1757
  */
1702
1758
  definePluginComponent(e) {
1703
- return _e(async () => await De(e, window));
1759
+ return Se(async () => await De(e, window));
1760
+ }
1761
+ /**
1762
+ * 设置应用全局
1763
+ * @param css
1764
+ * @param win
1765
+ */
1766
+ initGlobals(e, t) {
1767
+ const s = Object.assign(
1768
+ {
1769
+ adapter: this.adapter,
1770
+ window
1771
+ },
1772
+ t
1773
+ );
1774
+ ts(e, s);
1704
1775
  }
1705
1776
  }
1706
- function Ss(n) {
1707
- const e = new ss(n);
1777
+ function Ps(n) {
1778
+ const e = new cs(n);
1708
1779
  return {
1709
1780
  provider: e,
1710
1781
  onReady: (s) => e.ready(s)
1711
1782
  };
1712
1783
  }
1713
1784
  function Ne(n = {}) {
1714
- const e = Ee(Be, null);
1785
+ const e = Re(Be, null);
1715
1786
  if (!e)
1716
1787
  throw new Error("Can not find provider");
1717
1788
  if (e.nodeEnv === "development") {
@@ -1727,10 +1798,10 @@ function Ne(n = {}) {
1727
1798
  }
1728
1799
  return e;
1729
1800
  }
1730
- async function $s(n, e = "") {
1731
- const { name: t, urls: s = [] } = n || {}, r = s.map((i) => e + i), { css: o, js: a } = dt(r);
1732
- if (o.length && Ae(o), a.length)
1733
- return await Ie(a, t).catch(
1801
+ async function Cs(n, e = "") {
1802
+ const { name: t, urls: s = [] } = n || {}, r = s.map((a) => e + a), { css: o, js: i } = dt(r);
1803
+ if (o.length && Ie(o), i.length)
1804
+ return await Fe(i, t).catch(
1734
1805
  () => {
1735
1806
  }
1736
1807
  );
@@ -1741,7 +1812,7 @@ const Ue = {
1741
1812
  originResponse: !1,
1742
1813
  failMessage: !0,
1743
1814
  validate: (n) => n.data?.code === 0
1744
- }, ns = (n, e = "/__vtj__/api/:type.json") => (t, s, r) => n.send({
1815
+ }, us = (n, e = "/__vtj__/api/:type.json") => (t, s, r) => n.send({
1745
1816
  url: e,
1746
1817
  method: "post",
1747
1818
  params: { type: t },
@@ -1751,7 +1822,7 @@ const Ue = {
1751
1822
  data: s
1752
1823
  },
1753
1824
  settings: Ue
1754
- }), rs = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
1825
+ }), ls = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
1755
1826
  url: e,
1756
1827
  method: "post",
1757
1828
  data: {
@@ -1763,8 +1834,8 @@ const Ue = {
1763
1834
  type: "data"
1764
1835
  }
1765
1836
  }).then((r) => r && r[0] ? r[0] : null).catch(() => null);
1766
- function js(n) {
1767
- return $e({
1837
+ function As(n) {
1838
+ return Ee({
1768
1839
  settings: {
1769
1840
  type: "json",
1770
1841
  validSuccess: !0,
@@ -1777,9 +1848,9 @@ function js(n) {
1777
1848
  }
1778
1849
  });
1779
1850
  }
1780
- class ue {
1781
- constructor(e = ee) {
1782
- this.req = e, this.api = ns(e), this.uploader = rs(e);
1851
+ class pe {
1852
+ constructor(e = se) {
1853
+ this.req = e, this.api = us(e), this.uploader = ls(e);
1783
1854
  }
1784
1855
  api;
1785
1856
  pluginCaches = {};
@@ -1863,10 +1934,10 @@ class ue {
1863
1934
  return await this.api("clearStaticFiles", e).catch(() => "");
1864
1935
  }
1865
1936
  async getPluginMaterial(e) {
1866
- const { urls: t = [] } = e, s = t.filter((o) => lt(o))[0];
1937
+ const { urls: t = [] } = e, s = t.filter((o) => ut(o))[0];
1867
1938
  if (!s) return null;
1868
1939
  const r = this.pluginCaches[s];
1869
- return r || (this.pluginCaches[s] = ee.send({
1940
+ return r || (this.pluginCaches[s] = se.send({
1870
1941
  url: s,
1871
1942
  method: "get",
1872
1943
  settings: {
@@ -1879,77 +1950,77 @@ class ue {
1879
1950
  return console.log("BaseService.genSource", e), "";
1880
1951
  }
1881
1952
  }
1882
- const _ = new nt({
1953
+ const w = new nt({
1883
1954
  type: "local",
1884
1955
  expired: 0,
1885
1956
  prefix: "__VTJ_"
1886
1957
  });
1887
- class Es extends ue {
1958
+ class Is extends pe {
1888
1959
  init(e) {
1889
- const t = new U(e), s = _.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1890
- return _.save(`project_${t.id}`, r), Promise.resolve(r);
1960
+ const t = new L(e), s = w.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1961
+ return w.save(`project_${t.id}`, r), Promise.resolve(r);
1891
1962
  }
1892
1963
  saveProject(e) {
1893
- const t = new U(e);
1894
- return _.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1964
+ const t = new L(e);
1965
+ return w.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1895
1966
  }
1896
1967
  saveMaterials(e, t) {
1897
- return _.save(`materials_${e.id}`, le(t)), Promise.resolve(!0);
1968
+ return w.save(`materials_${e.id}`, ue(t)), Promise.resolve(!0);
1898
1969
  }
1899
1970
  saveFile(e) {
1900
- return _.save(`file_${e.id}`, e), Promise.resolve(!0);
1971
+ return w.save(`file_${e.id}`, e), Promise.resolve(!0);
1901
1972
  }
1902
1973
  getFile(e) {
1903
- const t = _.get(`file_${e}`);
1974
+ const t = w.get(`file_${e}`);
1904
1975
  return t ? Promise.resolve(t) : Promise.reject(null);
1905
1976
  }
1906
1977
  removeFile(e) {
1907
- return _.remove(`file_${e}`), Promise.resolve(!0);
1978
+ return w.remove(`file_${e}`), Promise.resolve(!0);
1908
1979
  }
1909
1980
  saveHistory(e) {
1910
- return _.save(`history_${e.id}`, e), Promise.resolve(!0);
1981
+ return w.save(`history_${e.id}`, e), Promise.resolve(!0);
1911
1982
  }
1912
1983
  removeHistory(e) {
1913
- const t = _.get(`history_${e}`);
1984
+ const t = w.get(`history_${e}`);
1914
1985
  if (t) {
1915
1986
  const r = (t.items || []).map((o) => o.id);
1916
- this.removeHistoryItem(e, r), _.remove(`history_${e}`);
1987
+ this.removeHistoryItem(e, r), w.remove(`history_${e}`);
1917
1988
  }
1918
1989
  return Promise.resolve(!0);
1919
1990
  }
1920
1991
  getHistory(e) {
1921
- const t = _.get(`history_${e}`), s = new Se(t || { id: e });
1992
+ const t = w.get(`history_${e}`), s = new je(t || { id: e });
1922
1993
  return Promise.resolve(s.toDsl());
1923
1994
  }
1924
1995
  getHistoryItem(e, t) {
1925
- const s = _.get(`history_${e}_${t}`);
1996
+ const s = w.get(`history_${e}_${t}`);
1926
1997
  return Promise.resolve(s);
1927
1998
  }
1928
1999
  saveHistoryItem(e, t) {
1929
- return _.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
2000
+ return w.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1930
2001
  }
1931
2002
  removeHistoryItem(e, t) {
1932
2003
  return t.forEach((s) => {
1933
- _.remove(`history_${e}_${s}`);
2004
+ w.remove(`history_${e}_${s}`);
1934
2005
  }), Promise.resolve(!0);
1935
2006
  }
1936
2007
  }
1937
- class os extends ue {
2008
+ class fs extends pe {
1938
2009
  projects = {};
1939
2010
  materials = {};
1940
2011
  files = {};
1941
2012
  histories = {};
1942
2013
  historyItems = {};
1943
2014
  init(e) {
1944
- const t = new U(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
2015
+ const t = new L(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1945
2016
  return this.projects[r.id] = r, Promise.resolve(r);
1946
2017
  }
1947
2018
  saveProject(e) {
1948
- const t = new U(e);
2019
+ const t = new L(e);
1949
2020
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1950
2021
  }
1951
2022
  saveMaterials(e, t) {
1952
- return e.id && (this.materials[e.id] = le(t)), Promise.resolve(!0);
2023
+ return e.id && (this.materials[e.id] = ue(t)), Promise.resolve(!0);
1953
2024
  }
1954
2025
  saveFile(e) {
1955
2026
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1973,7 +2044,7 @@ class os extends ue {
1973
2044
  return Promise.resolve(!0);
1974
2045
  }
1975
2046
  getHistory(e) {
1976
- const t = this.histories[e], s = new Se(t || { id: e });
2047
+ const t = this.histories[e], s = new je(t || { id: e });
1977
2048
  return Promise.resolve(s);
1978
2049
  }
1979
2050
  getHistoryItem(e, t) {
@@ -1991,11 +2062,11 @@ class os extends ue {
1991
2062
  }), Promise.resolve(!0);
1992
2063
  }
1993
2064
  }
1994
- let B = null;
1995
- function Rs() {
1996
- return B || (B = new os(), B);
2065
+ let N = null;
2066
+ function Fs() {
2067
+ return N || (N = new fs(), N);
1997
2068
  }
1998
- class bs extends ue {
2069
+ class ks extends pe {
1999
2070
  getFileCaches = {};
2000
2071
  async getExtension() {
2001
2072
  return await this.api("getExtension", {}).catch(() => {
@@ -2012,7 +2083,7 @@ class bs extends ue {
2012
2083
  async saveMaterials(e, t) {
2013
2084
  return !!await this.api("saveMaterials", {
2014
2085
  project: e,
2015
- materials: le(t)
2086
+ materials: ue(t)
2016
2087
  }).catch(() => !1);
2017
2088
  }
2018
2089
  async saveFile(e) {
@@ -2053,79 +2124,79 @@ class bs extends ue {
2053
2124
  }
2054
2125
  }
2055
2126
  export {
2056
- fs as ACCESS,
2057
- Fe as ACCESS_KEY,
2058
- ke as Access,
2127
+ ys as ACCESS,
2128
+ ke as ACCESS_KEY,
2129
+ fe as Access,
2059
2130
  ct as BUILD_IN_TAGS,
2060
2131
  ot as BUILT_IN_DIRECTIVES,
2061
- ue as BaseService,
2062
- we as CONTEXT_HOST,
2132
+ pe as BaseService,
2133
+ $e as CONTEXT_HOST,
2063
2134
  Ct as Context,
2064
- w as ContextMode,
2135
+ _ as ContextMode,
2065
2136
  it as DATA_TYPES,
2066
- N as HOMEPAGE_ROUTE_NAME,
2137
+ U as HOMEPAGE_ROUTE_NAME,
2067
2138
  at as HTML_TAGS,
2068
- gs as JSCodeToString,
2069
- us as LIFE_CYCLES_LIST,
2070
- bs as LocalService,
2071
- os as MemoryService,
2072
- ts as NodeEnv,
2073
- M as PAGE_ROUTE_NAME,
2074
- ss as Provider,
2075
- ps as REMOTE,
2076
- Es as StorageService,
2077
- k as VTJ_RENDERER_VERSION,
2078
- Ce as adoptedStyleSheets,
2079
- _s as clearLoaderCache,
2139
+ $s as JSCodeToString,
2140
+ gs as LIFE_CYCLES_LIST,
2141
+ ks as LocalService,
2142
+ fs as MemoryService,
2143
+ as as NodeEnv,
2144
+ D as PAGE_ROUTE_NAME,
2145
+ cs as Provider,
2146
+ vs as REMOTE,
2147
+ Is as StorageService,
2148
+ O as VTJ_RENDERER_VERSION,
2149
+ le as adoptedStyleSheets,
2150
+ bs as clearLoaderCache,
2080
2151
  ht as compileScopedCSS,
2081
- ys as createAccess,
2082
- vs as createAdapter,
2083
- ds as createAssetScripts,
2084
- hs as createAssetsCss,
2152
+ Es as createAccess,
2153
+ js as createAdapter,
2154
+ _s as createAssetScripts,
2155
+ ws as createAssetsCss,
2085
2156
  Dt as createDataSources,
2086
- oe as createLoader,
2087
- Rs as createMemoryService,
2088
- J as createMenus,
2157
+ ie as createLoader,
2158
+ Fs as createMemoryService,
2159
+ K as createMenus,
2089
2160
  jt as createMetaApi,
2090
- bt as createMock,
2091
- Ss as createProvider,
2092
- re as createRenderer,
2161
+ Rt as createMock,
2162
+ Ps as createProvider,
2163
+ oe as createRenderer,
2093
2164
  $t as createSchemaApi,
2094
2165
  Et as createSchemaApis,
2095
- js as createServiceRequest,
2166
+ As as createServiceRequest,
2096
2167
  xt as defaultLoader,
2097
- x as fillBasePath,
2098
- O as getMock,
2168
+ B as fillBasePath,
2169
+ T as getMock,
2099
2170
  He as getModifiers,
2100
2171
  De as getPlugin,
2101
- ft as getRawComponent,
2172
+ pt as getRawComponent,
2102
2173
  vt as isBuiltInTag,
2103
- K as isCSSUrl,
2174
+ G as isCSSUrl,
2104
2175
  _t as isJSCode,
2105
- $ as isJSExpression,
2106
- T as isJSFunction,
2107
- lt as isJSON,
2108
- z as isJSUrl,
2176
+ j as isJSExpression,
2177
+ S as isJSFunction,
2178
+ ut as isJSON,
2179
+ V as isJSUrl,
2109
2180
  yt as isNativeTag,
2110
2181
  gt as isVuePlugin,
2111
2182
  mt as loadCss,
2112
- Ae as loadCssUrl,
2113
- $s as loadEnhance,
2114
- Ie as loadScriptUrl,
2183
+ Ie as loadCssUrl,
2184
+ Cs as loadEnhance,
2185
+ Fe as loadScriptUrl,
2115
2186
  xe as menusFilter,
2116
2187
  Pt as mockApi,
2117
- Rt as mockApis,
2188
+ bt as mockApis,
2118
2189
  Me as mockCleanup,
2119
- F as nodeRender,
2120
- pt as parseDeps,
2121
- D as parseExpression,
2122
- ne as parseFunction,
2190
+ M as nodeRender,
2191
+ ft as parseDeps,
2192
+ H as parseExpression,
2193
+ E as parseFunction,
2123
2194
  dt as parseUrls,
2124
2195
  Be as providerKey,
2125
- ut as removeProdFlag,
2126
- ms as setupPageSetting,
2127
- Pe as toString,
2196
+ lt as removeProdFlag,
2197
+ Ss as setupPageSetting,
2198
+ Ae as toString,
2128
2199
  St as useAccess,
2129
- ws as useMask,
2200
+ Rs as useMask,
2130
2201
  Ne as useProvider
2131
2202
  };