@vtj/parser 0.12.14 → 0.12.16

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,37 +1,37 @@
1
- import { parse as Lu, compileTemplate as Du } from "@vue/compiler-sfc";
2
- import { parse as Bu } from "@babel/parser";
3
- import W from "@babel/traverse";
4
- import Q from "@babel/generator";
5
- import { BlockModel as Ru } from "@vtj/core";
6
- import { tsFormatter as Z } from "@vtj/coder";
1
+ import { parse as Du, compileTemplate as Bu } from "@vue/compiler-sfc";
2
+ import { parse as Ru } from "@babel/parser";
3
+ import Q from "@babel/traverse";
4
+ import Z from "@babel/generator";
5
+ import { BlockModel as Ou } from "@vtj/core";
6
+ import { tsFormatter as K } from "@vtj/coder";
7
7
  import { NodeTypes as l } from "@vue/compiler-core";
8
- import { upperFirstCamelCase as Ou, uid as Vu } from "@vtj/base";
8
+ import { upperFirstCamelCase as Vu, uid as Mu } from "@vtj/base";
9
9
  import Pu from "postcss";
10
10
  /**!
11
11
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
12
12
  * @name @vtj/parser
13
13
  * @author CHC chenhuachun1549@dingtalk.com
14
- * @version 0.12.14
14
+ * @version 0.12.16
15
15
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
16
16
  */
17
- const X0 = "0.12.14";
18
- function ru(e) {
19
- const { descriptor: u } = Lu(e), t = u.template?.content || "", a = (u.scriptSetup || u.script)?.content || "", i = u.styles.map((c) => c.content);
17
+ const X0 = "0.12.16";
18
+ function nu(e) {
19
+ const { descriptor: u } = Du(e), t = u.template?.content || "", a = (u.scriptSetup || u.script)?.content || "", i = u.styles.map((c) => c.content);
20
20
  return {
21
21
  template: t,
22
22
  script: a,
23
23
  styles: i
24
24
  };
25
25
  }
26
- function nu(e) {
27
- return Bu(e, { sourceType: "module", plugins: ["typescript"] });
26
+ function du(e) {
27
+ return Ru(e, { sourceType: "module", plugins: ["typescript"] });
28
28
  }
29
- function du(e, u) {
30
- return (W.default || W)(e, u);
29
+ function fu(e, u) {
30
+ return (Q.default || Q)(e, u);
31
31
  }
32
32
  function R(e) {
33
33
  try {
34
- return (Q.default || Q)(e, {
34
+ return (Z.default || Z)(e, {
35
35
  comments: !1,
36
36
  concise: !0,
37
37
  retainLines: !1,
@@ -43,21 +43,21 @@ function R(e) {
43
43
  return console.error("代码生成错误", u), "";
44
44
  }
45
45
  }
46
- function H(e) {
46
+ function G(e) {
47
47
  return e && e.type === "JSExpression";
48
48
  }
49
- function Mu(e) {
49
+ function Uu(e) {
50
50
  return typeof e == "object" && e && e.type === "JSFunction";
51
51
  }
52
- function G(e) {
53
- return H(e) || Mu(e);
52
+ function C(e) {
53
+ return G(e) || Uu(e);
54
54
  }
55
- function Uu(e) {
56
- return !!e && !H(e) && typeof e != "string";
55
+ function $u(e) {
56
+ return !!e && !G(e) && typeof e != "string";
57
57
  }
58
58
  function z0(e) {
59
- const u = ru(e), t = nu(u.script), a = {};
60
- return u.styles && (a.css = u.styles[0] || ""), du(t, {
59
+ const u = nu(e), t = du(u.script), a = {};
60
+ return u.styles && (a.css = u.styles[0] || ""), fu(t, {
61
61
  CallExpression(i) {
62
62
  const c = i.node.callee?.name;
63
63
  if (c) {
@@ -72,21 +72,21 @@ function z0(e) {
72
72
  }
73
73
  function O(e, u, t) {
74
74
  const a = new RegExp(`${u}`, "g"), i = /(\@\_|\$|\.|\,|\w)$/, c = /^\w/, s = new RegExp(`^this.${u}$`, "g");
75
- return e.replace(a, (n, f, h) => {
75
+ return e.replace(a, (d, f, h) => {
76
76
  const b = h.substring(0, f), E = h.substring(f + u.length);
77
- return i.test(b.trim()) || c.test(E.trim()) ? n : t;
77
+ return i.test(b.trim()) || c.test(E.trim()) ? d : t;
78
78
  }).replace(s, t);
79
79
  }
80
- function K(e, u, t) {
80
+ function Y(e, u, t) {
81
81
  const {
82
82
  context: a = {},
83
83
  computed: i = [],
84
84
  libs: c = {},
85
85
  members: s = [],
86
- platform: d
87
- } = t || {}, n = Array.from(a[u || ""] || /* @__PURE__ */ new Set());
88
- if (n)
89
- for (const f of n)
86
+ platform: n
87
+ } = t || {}, d = Array.from(a[u || ""] || /* @__PURE__ */ new Set());
88
+ if (d)
89
+ for (const f of d)
90
90
  e = O(e, f, `this.context.${f}`);
91
91
  for (const f of i)
92
92
  e = O(e, f, `this.${f}.value`);
@@ -94,25 +94,25 @@ function K(e, u, t) {
94
94
  e = O(e, f, `this.$libs.${h}.${f}`);
95
95
  for (const f of s)
96
96
  e = O(e, f, `this.${f}`);
97
- if (d === "uniapp") {
97
+ if (n === "uniapp") {
98
98
  const f = /\buni\./g;
99
99
  e = e.replace(f, "this.$libs.UniH5.uni.");
100
100
  }
101
101
  return e = e.replace(/_ctx\./g, "this."), e;
102
102
  }
103
- function v(e) {
103
+ function S(e) {
104
104
  return {
105
105
  type: "JSExpression",
106
106
  value: /^\{[\w\W]*\}$/.test(e) ? `(${e})` : e
107
107
  };
108
108
  }
109
- function C(e) {
109
+ function J(e) {
110
110
  return {
111
111
  type: "JSFunction",
112
112
  value: e
113
113
  };
114
114
  }
115
- const $u = [
115
+ const ju = [
116
116
  "beforeCreate",
117
117
  "created",
118
118
  "beforeMount",
@@ -126,18 +126,18 @@ const $u = [
126
126
  "renderTriggered",
127
127
  "activated",
128
128
  "deactivated"
129
- ], ju = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot".split(
129
+ ], Fu = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot".split(
130
130
  ","
131
- ), Fu = "component,slot,template".split(","), Hu = "view,swiper,progress,icon,text,button,checkbox,editor,form,input,label,picker,radio,slider,switch,textarea,audio,camera,image,video,map,canvas".split(
131
+ ), Hu = "component,slot,template".split(","), Gu = "view,swiper,progress,icon,text,button,checkbox,editor,form,input,label,picker,radio,slider,switch,textarea,audio,camera,image,video,map,canvas".split(
132
132
  ","
133
133
  );
134
- function Gu(e, u = "web") {
135
- return u === "uniapp" && Hu.includes(e);
136
- }
137
134
  function Cu(e, u = "web") {
138
- return (ju.includes(e) || Fu.includes(e)) && !Gu(e, u) ? e : Ou(e);
135
+ return u === "uniapp" && Gu.includes(e);
139
136
  }
140
- function fu(e) {
137
+ function ou(e, u = "web") {
138
+ return (Fu.includes(e) || Hu.includes(e)) && !Cu(e, u) ? e : Vu(e);
139
+ }
140
+ function bu(e) {
141
141
  return e.replace(/\s+/g, " ").split(";").reduce((t, a) => {
142
142
  const [i, c] = a.split(":").map((s) => s.trim());
143
143
  return i && c && (t[i] = c), t;
@@ -160,7 +160,7 @@ const zu = /* @__PURE__ */ new Uint16Array(
160
160
  // prettier-ignore
161
161
  /* @__PURE__ */ "Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((e) => e.charCodeAt(0))
162
162
  );
163
- var M;
163
+ var U;
164
164
  const Qu = /* @__PURE__ */ new Map([
165
165
  [0, 65533],
166
166
  // C1 Unicode control character reference replacements
@@ -191,9 +191,9 @@ const Qu = /* @__PURE__ */ new Map([
191
191
  [156, 339],
192
192
  [158, 382],
193
193
  [159, 376]
194
- ]), Y = (
194
+ ]), uu = (
195
195
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, n/no-unsupported-features/es-builtins
196
- (M = String.fromCodePoint) !== null && M !== void 0 ? M : function(e) {
196
+ (U = String.fromCodePoint) !== null && U !== void 0 ? U : function(e) {
197
197
  let u = "";
198
198
  return e > 65535 && (e -= 65536, u += String.fromCharCode(e >>> 10 & 1023 | 55296), e = 56320 | e & 1023), u += String.fromCharCode(e), u;
199
199
  }
@@ -211,14 +211,14 @@ var N;
211
211
  (function(e) {
212
212
  e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
213
213
  })(N || (N = {}));
214
- function $(e) {
214
+ function j(e) {
215
215
  return e >= y.ZERO && e <= y.NINE;
216
216
  }
217
217
  function Yu(e) {
218
218
  return e >= y.UPPER_A && e <= y.UPPER_F || e >= y.LOWER_A && e <= y.LOWER_F;
219
219
  }
220
220
  function u0(e) {
221
- return e >= y.UPPER_A && e <= y.UPPER_Z || e >= y.LOWER_A && e <= y.LOWER_Z || $(e);
221
+ return e >= y.UPPER_A && e <= y.UPPER_Z || e >= y.LOWER_A && e <= y.LOWER_Z || j(e);
222
222
  }
223
223
  function e0(e) {
224
224
  return e === y.EQUALS || u0(e);
@@ -295,7 +295,7 @@ class t0 {
295
295
  const a = t;
296
296
  for (; t < u.length; ) {
297
297
  const i = u.charCodeAt(t);
298
- if ($(i) || Yu(i))
298
+ if (j(i) || Yu(i))
299
299
  t += 1;
300
300
  else
301
301
  return this.addToNumericResult(u, a, t, 16), this.emitNumericEntity(i, 3);
@@ -315,7 +315,7 @@ class t0 {
315
315
  const a = t;
316
316
  for (; t < u.length; ) {
317
317
  const i = u.charCodeAt(t);
318
- if ($(i))
318
+ if (j(i))
319
319
  t += 1;
320
320
  else
321
321
  return this.addToNumericResult(u, a, t, 10), this.emitNumericEntity(i, 2);
@@ -424,18 +424,18 @@ function a0(e, u, t, a) {
424
424
  if (i === 0)
425
425
  return c !== 0 && a === c ? t : -1;
426
426
  if (c) {
427
- const n = a - c;
428
- return n < 0 || n >= i ? -1 : e[t + n] - 1;
427
+ const d = a - c;
428
+ return d < 0 || d >= i ? -1 : e[t + d] - 1;
429
429
  }
430
- let s = t, d = s + i - 1;
431
- for (; s <= d; ) {
432
- const n = s + d >>> 1, f = e[n];
430
+ let s = t, n = s + i - 1;
431
+ for (; s <= n; ) {
432
+ const d = s + n >>> 1, f = e[d];
433
433
  if (f < a)
434
- s = n + 1;
434
+ s = d + 1;
435
435
  else if (f > a)
436
- d = n - 1;
436
+ n = d - 1;
437
437
  else
438
- return e[n + i];
438
+ return e[d + i];
439
439
  }
440
440
  return -1;
441
441
  }
@@ -821,7 +821,7 @@ const k = /* @__PURE__ */ new Set([
821
821
  "button",
822
822
  "datalist",
823
823
  "textarea"
824
- ]), p = /* @__PURE__ */ new Set(["p"]), uu = /* @__PURE__ */ new Set(["thead", "tbody"]), eu = /* @__PURE__ */ new Set(["dd", "dt"]), tu = /* @__PURE__ */ new Set(["rt", "rp"]), s0 = /* @__PURE__ */ new Map([
824
+ ]), p = /* @__PURE__ */ new Set(["p"]), eu = /* @__PURE__ */ new Set(["thead", "tbody"]), tu = /* @__PURE__ */ new Set(["dd", "dt"]), au = /* @__PURE__ */ new Set(["rt", "rp"]), s0 = /* @__PURE__ */ new Map([
825
825
  ["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
826
826
  ["th", /* @__PURE__ */ new Set(["th"])],
827
827
  ["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
@@ -842,8 +842,8 @@ const k = /* @__PURE__ */ new Set([
842
842
  ["textarea", k],
843
843
  ["option", /* @__PURE__ */ new Set(["option"])],
844
844
  ["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
845
- ["dd", eu],
846
- ["dt", eu],
845
+ ["dd", tu],
846
+ ["dt", tu],
847
847
  ["address", p],
848
848
  ["article", p],
849
849
  ["aside", p],
@@ -865,10 +865,10 @@ const k = /* @__PURE__ */ new Set([
865
865
  ["section", p],
866
866
  ["table", p],
867
867
  ["ul", p],
868
- ["rt", tu],
869
- ["rp", tu],
870
- ["tbody", uu],
871
- ["tfoot", uu]
868
+ ["rt", au],
869
+ ["rp", au],
870
+ ["tbody", eu],
871
+ ["tfoot", eu]
872
872
  ]), r0 = /* @__PURE__ */ new Set([
873
873
  "area",
874
874
  "base",
@@ -889,7 +889,7 @@ const k = /* @__PURE__ */ new Set([
889
889
  "source",
890
890
  "track",
891
891
  "wbr"
892
- ]), au = /* @__PURE__ */ new Set(["math", "svg"]), iu = /* @__PURE__ */ new Set([
892
+ ]), iu = /* @__PURE__ */ new Set(["math", "svg"]), cu = /* @__PURE__ */ new Set([
893
893
  "mi",
894
894
  "mo",
895
895
  "mn",
@@ -902,8 +902,8 @@ const k = /* @__PURE__ */ new Set([
902
902
  ]), n0 = /\s|\//;
903
903
  class d0 {
904
904
  constructor(u, t = {}) {
905
- var a, i, c, s, d, n;
906
- this.options = t, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = u ?? {}, this.htmlMode = !this.options.xmlMode, this.lowerCaseTagNames = (a = t.lowerCaseTags) !== null && a !== void 0 ? a : this.htmlMode, this.lowerCaseAttributeNames = (i = t.lowerCaseAttributeNames) !== null && i !== void 0 ? i : this.htmlMode, this.recognizeSelfClosing = (c = t.recognizeSelfClosing) !== null && c !== void 0 ? c : !this.htmlMode, this.tokenizer = new ((s = t.Tokenizer) !== null && s !== void 0 ? s : c0)(this.options, this), this.foreignContext = [!this.htmlMode], (n = (d = this.cbs).onparserinit) === null || n === void 0 || n.call(d, this);
905
+ var a, i, c, s, n, d;
906
+ this.options = t, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = u ?? {}, this.htmlMode = !this.options.xmlMode, this.lowerCaseTagNames = (a = t.lowerCaseTags) !== null && a !== void 0 ? a : this.htmlMode, this.lowerCaseAttributeNames = (i = t.lowerCaseAttributeNames) !== null && i !== void 0 ? i : this.htmlMode, this.recognizeSelfClosing = (c = t.recognizeSelfClosing) !== null && c !== void 0 ? c : !this.htmlMode, this.tokenizer = new ((s = t.Tokenizer) !== null && s !== void 0 ? s : c0)(this.options, this), this.foreignContext = [!this.htmlMode], (d = (n = this.cbs).onparserinit) === null || d === void 0 || d.call(n, this);
907
907
  }
908
908
  // Tokenizer event handlers
909
909
  /** @internal */
@@ -915,7 +915,7 @@ class d0 {
915
915
  /** @internal */
916
916
  ontextentity(u, t) {
917
917
  var a, i;
918
- this.endIndex = t - 1, (i = (a = this.cbs).ontext) === null || i === void 0 || i.call(a, Y(u)), this.startIndex = t;
918
+ this.endIndex = t - 1, (i = (a = this.cbs).ontext) === null || i === void 0 || i.call(a, uu(u)), this.startIndex = t;
919
919
  }
920
920
  /**
921
921
  * Checks if the current tag is a void element. Override this if you want
@@ -936,10 +936,10 @@ class d0 {
936
936
  const s = this.htmlMode && s0.get(u);
937
937
  if (s)
938
938
  for (; this.stack.length > 0 && s.has(this.stack[0]); ) {
939
- const d = this.stack.shift();
940
- (a = (t = this.cbs).onclosetag) === null || a === void 0 || a.call(t, d, !0);
939
+ const n = this.stack.shift();
940
+ (a = (t = this.cbs).onclosetag) === null || a === void 0 || a.call(t, n, !0);
941
941
  }
942
- this.isVoidElement(u) || (this.stack.unshift(u), this.htmlMode && (au.has(u) ? this.foreignContext.unshift(!0) : iu.has(u) && this.foreignContext.unshift(!1))), (c = (i = this.cbs).onopentagname) === null || c === void 0 || c.call(i, u), this.cbs.onopentag && (this.attribs = {});
942
+ this.isVoidElement(u) || (this.stack.unshift(u), this.htmlMode && (iu.has(u) ? this.foreignContext.unshift(!0) : cu.has(u) && this.foreignContext.unshift(!1))), (c = (i = this.cbs).onopentagname) === null || c === void 0 || c.call(i, u), this.cbs.onopentag && (this.attribs = {});
943
943
  }
944
944
  endOpenTag(u) {
945
945
  var t, a;
@@ -951,17 +951,17 @@ class d0 {
951
951
  }
952
952
  /** @internal */
953
953
  onclosetag(u, t) {
954
- var a, i, c, s, d, n, f, h;
954
+ var a, i, c, s, n, d, f, h;
955
955
  this.endIndex = t;
956
956
  let b = this.getSlice(u, t);
957
- if (this.lowerCaseTagNames && (b = b.toLowerCase()), this.htmlMode && (au.has(b) || iu.has(b)) && this.foreignContext.shift(), this.isVoidElement(b))
958
- this.htmlMode && b === "br" && ((s = (c = this.cbs).onopentagname) === null || s === void 0 || s.call(c, "br"), (n = (d = this.cbs).onopentag) === null || n === void 0 || n.call(d, "br", {}, !0), (h = (f = this.cbs).onclosetag) === null || h === void 0 || h.call(f, "br", !1));
957
+ if (this.lowerCaseTagNames && (b = b.toLowerCase()), this.htmlMode && (iu.has(b) || cu.has(b)) && this.foreignContext.shift(), this.isVoidElement(b))
958
+ this.htmlMode && b === "br" && ((s = (c = this.cbs).onopentagname) === null || s === void 0 || s.call(c, "br"), (d = (n = this.cbs).onopentag) === null || d === void 0 || d.call(n, "br", {}, !0), (h = (f = this.cbs).onclosetag) === null || h === void 0 || h.call(f, "br", !1));
959
959
  else {
960
960
  const E = this.stack.indexOf(b);
961
961
  if (E !== -1)
962
962
  for (let m = 0; m <= E; m++) {
963
- const S = this.stack.shift();
964
- (i = (a = this.cbs).onclosetag) === null || i === void 0 || i.call(a, S, m !== E);
963
+ const v = this.stack.shift();
964
+ (i = (a = this.cbs).onclosetag) === null || i === void 0 || i.call(a, v, m !== E);
965
965
  }
966
966
  else this.htmlMode && b === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
967
967
  }
@@ -988,7 +988,7 @@ class d0 {
988
988
  }
989
989
  /** @internal */
990
990
  onattribentity(u) {
991
- this.attribvalue += Y(u);
991
+ this.attribvalue += uu(u);
992
992
  }
993
993
  /** @internal */
994
994
  onattribend(u, t) {
@@ -1022,15 +1022,15 @@ class d0 {
1022
1022
  }
1023
1023
  /** @internal */
1024
1024
  oncomment(u, t, a) {
1025
- var i, c, s, d;
1026
- this.endIndex = t, (c = (i = this.cbs).oncomment) === null || c === void 0 || c.call(i, this.getSlice(u, t - a)), (d = (s = this.cbs).oncommentend) === null || d === void 0 || d.call(s), this.startIndex = t + 1;
1025
+ var i, c, s, n;
1026
+ this.endIndex = t, (c = (i = this.cbs).oncomment) === null || c === void 0 || c.call(i, this.getSlice(u, t - a)), (n = (s = this.cbs).oncommentend) === null || n === void 0 || n.call(s), this.startIndex = t + 1;
1027
1027
  }
1028
1028
  /** @internal */
1029
1029
  oncdata(u, t, a) {
1030
- var i, c, s, d, n, f, h, b, E, m;
1030
+ var i, c, s, n, d, f, h, b, E, m;
1031
1031
  this.endIndex = t;
1032
- const S = this.getSlice(u, t - a);
1033
- !this.htmlMode || this.options.recognizeCDATA ? ((c = (i = this.cbs).oncdatastart) === null || c === void 0 || c.call(i), (d = (s = this.cbs).ontext) === null || d === void 0 || d.call(s, S), (f = (n = this.cbs).oncdataend) === null || f === void 0 || f.call(n)) : ((b = (h = this.cbs).oncomment) === null || b === void 0 || b.call(h, `[CDATA[${S}]]`), (m = (E = this.cbs).oncommentend) === null || m === void 0 || m.call(E)), this.startIndex = t + 1;
1032
+ const v = this.getSlice(u, t - a);
1033
+ !this.htmlMode || this.options.recognizeCDATA ? ((c = (i = this.cbs).oncdatastart) === null || c === void 0 || c.call(i), (n = (s = this.cbs).ontext) === null || n === void 0 || n.call(s, v), (f = (d = this.cbs).oncdataend) === null || f === void 0 || f.call(d)) : ((b = (h = this.cbs).oncomment) === null || b === void 0 || b.call(h, `[CDATA[${v}]]`), (m = (E = this.cbs).oncommentend) === null || m === void 0 || m.call(E)), this.startIndex = t + 1;
1034
1034
  }
1035
1035
  /** @internal */
1036
1036
  onend() {
@@ -1128,65 +1128,65 @@ class d0 {
1128
1128
  this.end(u);
1129
1129
  }
1130
1130
  }
1131
- function cu(e) {
1132
- const u = { name: "", children: [] }, t = [u];
1133
- let a = "";
1134
- const i = new d0(
1131
+ function su(e, u = "web") {
1132
+ const t = { name: "", children: [] }, a = [t];
1133
+ let i = "";
1134
+ const c = new d0(
1135
1135
  {
1136
- onopentag: (c, s, d) => {
1137
- const n = t[t.length - 1];
1138
- a.trim() && (Array.isArray(n.children) ? n.children.push({
1139
- name: "text",
1140
- children: a.trim()
1141
- }) : n.children = a.trim(), a = "");
1142
- const f = Object.entries(s || {}).reduce(
1143
- (b, E) => {
1144
- let [m = "", S = ""] = E;
1145
- return m = m.replace(/\\\"/g, ""), S = S.replace(/\\\"/g, ""), m && (b[m] = S), b;
1136
+ onopentag: (s, n, d) => {
1137
+ const f = a[a.length - 1];
1138
+ i.trim() && (Array.isArray(f.children) ? f.children.push({
1139
+ name: "span",
1140
+ children: i.trim()
1141
+ }) : f.children = i.trim(), i = "");
1142
+ const h = Object.entries(n || {}).reduce(
1143
+ (E, m) => {
1144
+ let [v = "", w = ""] = m;
1145
+ return v && (E[v] = w), E;
1146
1146
  },
1147
1147
  {}
1148
1148
  );
1149
- f.style && (f.style = fu(f.style));
1150
- const h = {
1151
- name: c,
1152
- props: f
1149
+ h.style && (h.style = bu(h.style));
1150
+ const b = {
1151
+ name: ou(s, u),
1152
+ props: h
1153
1153
  };
1154
- Array.isArray(n.children) ? n.children.push(h) : n.children ? n.children = [
1154
+ Array.isArray(f.children) ? f.children.push(b) : f.children ? f.children = [
1155
1155
  {
1156
1156
  name: "span",
1157
- children: n.children
1157
+ children: f.children
1158
1158
  },
1159
- h
1160
- ] : n.children = [h], d || t.push(h);
1159
+ b
1160
+ ] : f.children = [b], d || a.push(b);
1161
1161
  },
1162
- ontext: (c) => {
1163
- const s = c.trim();
1164
- s && s !== '"' && (a += s);
1162
+ ontext: (s) => {
1163
+ const n = s.trim();
1164
+ n && n !== '"' && (i += n);
1165
1165
  },
1166
1166
  onclosetag: () => {
1167
- const c = t.pop();
1168
- a.trim() && (Array.isArray(c?.children) ? c.children.push({
1167
+ const s = a.pop();
1168
+ i.trim() && (Array.isArray(s?.children) ? s.children.push({
1169
1169
  name: "span",
1170
- children: a.trim()
1171
- }) : c && (c.children = a.trim()), a = "");
1170
+ children: i.trim()
1171
+ }) : s && (s.children = i.trim()), i = "");
1172
1172
  }
1173
1173
  },
1174
1174
  { decodeEntities: !0 }
1175
1175
  );
1176
- return i.write(e), i.end(), u.children || [];
1176
+ return c.write(e.replace(/\\"/g, '"')), c.end(), t.children || [];
1177
1177
  }
1178
- let j = [], P = {}, ou = {}, bu = {}, lu = "web";
1178
+ let F = [], M = {}, lu = {}, hu = {}, P = "web";
1179
1179
  function f0(e, u, t = "", a) {
1180
- return j = [], P = {}, ou = a?.handlers || {}, bu = a?.styles || {}, lu = a?.platform || "web", {
1181
- nodes: (Du({
1180
+ return F = [], M = {}, lu = a?.handlers || {}, hu = a?.styles || {}, P = a?.platform || "web", {
1181
+ nodes: (Bu({
1182
1182
  id: e,
1183
1183
  filename: u,
1184
1184
  source: t,
1185
1185
  isProd: !0,
1186
1186
  slotted: !0
1187
- }).ast?.children || []).map((d) => _(d)).filter((d) => !!d),
1188
- slots: j,
1189
- context: P
1187
+ }).ast?.children || []).map((n) => _(n)).filter((n) => !!n),
1188
+ slots: F,
1189
+ context: M
1190
1190
  };
1191
1191
  }
1192
1192
  function o0(e) {
@@ -1195,7 +1195,7 @@ function o0(e) {
1195
1195
  const t = [];
1196
1196
  for (const [a, i] of Object.entries(e.props || {}))
1197
1197
  a === "name" ? u = i : t.push(a);
1198
- j.push({
1198
+ F.push({
1199
1199
  name: u,
1200
1200
  params: t
1201
1201
  });
@@ -1206,23 +1206,23 @@ function b0(e) {
1206
1206
  for (const t of e) {
1207
1207
  if (t.type === l.ATTRIBUTE)
1208
1208
  if (t.name === "class") {
1209
- const a = t.value?.content || "", i = /[\w]+_[\w]{5,}/, c = a.match(i)?.[0] || "", s = a.split(" ").filter((n) => n !== c), d = bu[`.${c}`];
1210
- d && (u.style = d), s.length && (u.class = s.join(" "));
1209
+ const a = t.value?.content || "", i = /[\w]+_[\w]{5,}/, c = a.match(i)?.[0] || "", s = a.split(" ").filter((d) => d !== c), n = hu[`.${c}`];
1210
+ n && (u.style = n), s.length && (u.class = s.join(" "));
1211
1211
  } else if (t.name === "style") {
1212
1212
  const a = t.value?.content || "";
1213
- a && (u.style = fu(a));
1213
+ a && (u.style = bu(a));
1214
1214
  } else
1215
1215
  u[t.name] = t.value?.content || "";
1216
- if (t.type === l.DIRECTIVE && t.name === "bind" && (t.exp?.type === l.SIMPLE_EXPRESSION && t.arg?.type === l.SIMPLE_EXPRESSION && (u[t.arg.content] = v(`(${t.exp.content})`)), t.exp?.type === l.COMPOUND_EXPRESSION && t.arg?.type === l.SIMPLE_EXPRESSION))
1216
+ if (t.type === l.DIRECTIVE && t.name === "bind" && (t.exp?.type === l.SIMPLE_EXPRESSION && t.arg?.type === l.SIMPLE_EXPRESSION && (u[t.arg.content] = S(`(${t.exp.content})`)), t.exp?.type === l.COMPOUND_EXPRESSION && t.arg?.type === l.SIMPLE_EXPRESSION))
1217
1217
  if (t.arg.content === "class" && u.class) {
1218
1218
  const a = t.exp.ast.type, i = Xu(
1219
1219
  u.class,
1220
1220
  t.exp.loc.source,
1221
1221
  a
1222
1222
  );
1223
- i && (u[t.arg.content] = v(i));
1223
+ i && (u[t.arg.content] = S(i));
1224
1224
  } else
1225
- u[t.arg.content] = v(
1225
+ u[t.arg.content] = S(
1226
1226
  `(${t.exp.loc.source})`
1227
1227
  );
1228
1228
  }
@@ -1238,8 +1238,8 @@ function l0(e, u = {}) {
1238
1238
  );
1239
1239
  let c = a.exp?.loc.source || "";
1240
1240
  /\)$/.test(c) && (c = `($event) => { ${c} } `);
1241
- const d = new RegExp(`${a.arg.content}_[\\w]{5,}`), n = c.match(d)?.[0] || "", f = u[n];
1242
- if (n && f)
1241
+ const n = new RegExp(`${a.arg.content}_[\\w]{5,}`), d = c.match(n)?.[0] || "", f = u[d];
1242
+ if (d && f)
1243
1243
  t[a.arg.content] = {
1244
1244
  name: a.arg.content,
1245
1245
  handler: f,
@@ -1249,7 +1249,7 @@ function l0(e, u = {}) {
1249
1249
  const h = a.exp?.ast?.type === "AssignmentExpression";
1250
1250
  t[a.arg.content] = {
1251
1251
  name: a.arg.content,
1252
- handler: C(h ? `()=> {${c}}` : `(${c})`),
1252
+ handler: J(h ? `()=> {${c}}` : `(${c})`),
1253
1253
  modifiers: i
1254
1254
  };
1255
1255
  }
@@ -1263,102 +1263,102 @@ function h0(e, u) {
1263
1263
  const c = i === 0 ? "vIf" : a.condition ? "vElseIf" : "vElse", s = a.condition?.loc.source || "";
1264
1264
  t.push({
1265
1265
  name: c,
1266
- value: c === "vElse" ? !0 : v(s)
1266
+ value: c === "vElse" ? !0 : S(s)
1267
1267
  });
1268
1268
  }
1269
1269
  }), e.type === l.FOR && t.push({
1270
1270
  name: "vFor",
1271
- value: v(e.source.loc.source),
1271
+ value: S(e.source.loc.source),
1272
1272
  iterator: {
1273
1273
  item: e.valueAlias?.loc.source || "item",
1274
1274
  index: e.keyAlias?.loc.source || "index"
1275
1275
  }
1276
1276
  }), e.type === l.ELEMENT) {
1277
1277
  const a = e.props.filter(
1278
- (n) => n.type === l.DIRECTIVE
1279
- ), i = a.filter((n) => n.name === "model");
1280
- i.length && i.forEach((n) => {
1278
+ (d) => d.type === l.DIRECTIVE
1279
+ ), i = a.filter((d) => d.name === "model");
1280
+ i.length && i.forEach((d) => {
1281
1281
  t.push({
1282
1282
  name: "vModel",
1283
- arg: n.arg?.content,
1284
- value: v(n.exp?.loc.source || "")
1283
+ arg: d.arg?.content,
1284
+ value: S(d.exp?.loc.source || "")
1285
1285
  });
1286
1286
  });
1287
- const c = a.find((n) => n.name === "show");
1287
+ const c = a.find((d) => d.name === "show");
1288
1288
  c && t.push({
1289
1289
  name: "vShow",
1290
- value: v(c.exp?.loc.source || "")
1290
+ value: S(c.exp?.loc.source || "")
1291
1291
  });
1292
- const s = a.find((n) => n.name === "bind" && !n.arg);
1292
+ const s = a.find((d) => d.name === "bind" && !d.arg);
1293
1293
  s && t.push({
1294
1294
  name: "vBind",
1295
- value: v(s.exp?.loc.source || "")
1295
+ value: S(s.exp?.loc.source || "")
1296
1296
  });
1297
- const d = a.find((n) => n.name === "html");
1298
- d && t.push({
1297
+ const n = a.find((d) => d.name === "html");
1298
+ n && t.push({
1299
1299
  name: "vHtml",
1300
- value: v(d.exp?.loc.source || "")
1300
+ value: S(n.exp?.loc.source || "")
1301
1301
  });
1302
1302
  }
1303
1303
  return t;
1304
1304
  }
1305
- function hu(e) {
1305
+ function pu(e) {
1306
1306
  let u = "";
1307
1307
  const { name: t, props: a, events: i = {} } = e, c = a?.class || "";
1308
1308
  if (typeof c == "string") {
1309
- const s = new RegExp(`${t}_([\\w]+)`), d = c.match(s);
1310
- d && d[1] && (u = d[1]);
1309
+ const s = new RegExp(`${t}_([\\w]+)`), n = c.match(s);
1310
+ n && n[1] && (u = n[1]);
1311
1311
  }
1312
- for (const { name: s, handler: d } of Object.values(i)) {
1313
- const n = new RegExp(`${s}_([\\w]+)`), f = d.value.match(n);
1312
+ for (const { name: s, handler: n } of Object.values(i)) {
1313
+ const d = new RegExp(`${s}_([\\w]+)`), f = n.value.match(d);
1314
1314
  f && f[1] && (u = f[1]);
1315
1315
  }
1316
- return u || Vu();
1316
+ return u || Mu();
1317
1317
  }
1318
- function F(e, u) {
1319
- const t = new Set(u?.id ? P[u.id] : []), a = (e.directives || []).find((s) => s.name === "vFor");
1318
+ function H(e, u) {
1319
+ const t = new Set(u?.id ? M[u.id] : []), a = (e.directives || []).find((s) => s.name === "vFor");
1320
1320
  let i = new Set(Array.from(t));
1321
1321
  if (a) {
1322
- const { item: s = "item", index: d = "index" } = a.iterator || {};
1323
- i = /* @__PURE__ */ new Set([s, d, ...Array.from(i)]);
1322
+ const { item: s = "item", index: n = "index" } = a.iterator || {};
1323
+ i = /* @__PURE__ */ new Set([s, n, ...Array.from(i)]);
1324
1324
  }
1325
1325
  const c = e.slot;
1326
1326
  if (c) {
1327
- const s = typeof c == "string" ? [] : c.params || [], d = s.length ? s : [`scope_${u?.id}`];
1328
- i = /* @__PURE__ */ new Set([...d, ...Array.from(i)]);
1327
+ const s = typeof c == "string" ? [] : c.params || [], n = s.length ? s : [`scope_${u?.id}`];
1328
+ i = /* @__PURE__ */ new Set([...n, ...Array.from(i)]);
1329
1329
  }
1330
- P[e.id] = i;
1330
+ M[e.id] = i;
1331
1331
  }
1332
- function U(e, u, t, a) {
1332
+ function $(e, u, t, a) {
1333
1333
  const i = {
1334
- name: Cu(e.tag, lu),
1334
+ name: ou(e.tag, P),
1335
1335
  props: b0(e.props),
1336
- events: l0(e.props, ou),
1336
+ events: l0(e.props, lu),
1337
1337
  directives: h0(t || e, a)
1338
1338
  };
1339
- i.id = hu(i), F(i, u);
1339
+ i.id = pu(i), H(i, u);
1340
1340
  const c = x0(i, e.children);
1341
- return F(i, u), o0(c), c;
1341
+ return H(i, u), o0(c), c;
1342
1342
  }
1343
1343
  function p0(e, u) {
1344
1344
  return e.map((t) => _(t, u, e));
1345
1345
  }
1346
1346
  function _(e, u, t) {
1347
1347
  if (e.type === l.ELEMENT)
1348
- return U(e, u);
1348
+ return $(e, u);
1349
1349
  if (!t && e.type === l.IF)
1350
1350
  return p0(e.branches);
1351
1351
  if (t && e.type === l.IF_BRANCH) {
1352
- const a = e.children[0];
1352
+ const a = e.children.find((i) => i.type === l.ELEMENT);
1353
1353
  if (a && a.type === l.ELEMENT)
1354
- return U(a, u, e, t);
1354
+ return $(a, u, e, t);
1355
1355
  }
1356
1356
  if (e.type === l.FOR) {
1357
1357
  const a = e.children[0];
1358
1358
  if (a.type === l.ELEMENT)
1359
- return U(a, u, e);
1359
+ return $(a, u, e);
1360
1360
  }
1361
- return e.type === l.TEXT_CALL ? e.content.type == l.TEXT ? e.content.content : e.content.type === l.INTERPOLATION ? v(e.content.content.loc.source) : "" : e.type === l.TEXT ? e.content : e.type === l.INTERPOLATION && (e.content.type === l.SIMPLE_EXPRESSION || e.content.type === l.COMPOUND_EXPRESSION) ? v(e.content.loc.source) : e.type === l.COMPOUND_EXPRESSION ? m0(
1361
+ return e.type === l.TEXT_CALL ? e.content.type == l.TEXT ? e.content.content : e.content.type === l.INTERPOLATION ? S(e.content.content.loc.source) : "" : e.type === l.TEXT ? e.content : e.type === l.INTERPOLATION && (e.content.type === l.SIMPLE_EXPRESSION || e.content.type === l.COMPOUND_EXPRESSION) ? S(e.content.loc.source) : e.type === l.COMPOUND_EXPRESSION ? m0(
1362
1362
  e.children
1363
1363
  ) : (e.type === l.COMMENT || console.warn("未处理", e.type), null);
1364
1364
  }
@@ -1367,7 +1367,7 @@ function m0(e = []) {
1367
1367
  for (const a of u)
1368
1368
  t.push({
1369
1369
  name: "span",
1370
- children: a.type === l.TEXT ? a.loc.source : v(a.content?.loc.source)
1370
+ children: a.type === l.TEXT ? a.loc.source : S(a.content?.loc.source)
1371
1371
  });
1372
1372
  return {
1373
1373
  name: "span",
@@ -1380,7 +1380,7 @@ function x0(e, u = []) {
1380
1380
  if (a.type === l.ELEMENT && a.codegenNode?.value?.arguments) {
1381
1381
  const i = a.codegenNode.value.arguments[0];
1382
1382
  if (i) {
1383
- const c = cu(i);
1383
+ const c = su(i, P);
1384
1384
  t.push(...c);
1385
1385
  }
1386
1386
  } else if (a.type === l.ELEMENT && a.tag === "template") {
@@ -1390,17 +1390,17 @@ function x0(e, u = []) {
1390
1390
  name: "span",
1391
1391
  children: _(c, e)
1392
1392
  } : _(c, e);
1393
- s && (Array.isArray(s) ? s : [s]).forEach((n) => {
1394
- Uu(n) && i?.type === l.DIRECTIVE && (n.id = hu(n), n.slot = {
1393
+ s && (Array.isArray(s) ? s : [s]).forEach((d) => {
1394
+ $u(d) && i?.type === l.DIRECTIVE && (d.id = pu(d), d.slot = {
1395
1395
  name: i.arg?.content || "default",
1396
1396
  params: i.exp?.identifiers || []
1397
- }, F(n, e)), t.push(n);
1397
+ }, H(d, e)), t.push(d);
1398
1398
  });
1399
1399
  }
1400
1400
  } else if (a.type === l.JS_CALL_EXPRESSION) {
1401
1401
  const i = a.arguments?.[0];
1402
1402
  if (i) {
1403
- const c = cu(i);
1403
+ const c = su(i, P);
1404
1404
  t.push(...c);
1405
1405
  }
1406
1406
  } else if (a.type === l.TEXT_CALL) {
@@ -1412,7 +1412,7 @@ function x0(e, u = []) {
1412
1412
  }
1413
1413
  if (t.length === 1) {
1414
1414
  const a = t[0];
1415
- e.children = typeof a == "string" || H(a) ? a : [a];
1415
+ e.children = typeof a == "string" || G(a) ? a : [a];
1416
1416
  } else
1417
1417
  e.children = t.map((a) => typeof a == "string" ? { name: "span", children: a } : a);
1418
1418
  return e;
@@ -1422,22 +1422,22 @@ function g0(e, u) {
1422
1422
  imports: y0(e),
1423
1423
  emits: [],
1424
1424
  errors: []
1425
- }, i = nu(e);
1426
- return du(i, {
1425
+ }, i = du(e);
1426
+ return fu(i, {
1427
1427
  ExportDefaultDeclaration(c) {
1428
1428
  const s = c.node.declaration;
1429
1429
  if (s.type !== "CallExpression") return;
1430
- const d = s.arguments[0];
1431
- if (d?.type !== "ObjectExpression") return;
1432
- const n = d.properties.filter(
1430
+ const n = s.arguments[0];
1431
+ if (n?.type !== "ObjectExpression") return;
1432
+ const d = n.properties.filter(
1433
1433
  (b) => b.type === "ObjectProperty"
1434
- ), f = d.properties.filter(
1434
+ ), f = n.properties.filter(
1435
1435
  (b) => b.type == "ObjectMethod"
1436
- ), h = n.find(
1436
+ ), h = d.find(
1437
1437
  (b) => b.key.name === "computed"
1438
1438
  );
1439
- h && (a.computed = pu(h.value), a.watchers = T0(h.value));
1440
- for (const b of n)
1439
+ h && (a.computed = mu(h.value), a.watchers = T0(h.value));
1440
+ for (const b of d)
1441
1441
  switch (b.key.name) {
1442
1442
  case "name":
1443
1443
  a.name = b.value.value;
@@ -1472,8 +1472,8 @@ function g0(e, u) {
1472
1472
  CallExpression(c) {
1473
1473
  const s = _0(c.node);
1474
1474
  if (s.length)
1475
- for (let d of s)
1476
- a.emits?.find((f) => f.name === d.name) || a.emits?.push(d);
1475
+ for (let n of s)
1476
+ a.emits?.find((f) => f.name === n.name) || a.emits?.push(n);
1477
1477
  }
1478
1478
  }), a;
1479
1479
  }
@@ -1507,23 +1507,25 @@ function S0(e) {
1507
1507
  const { key: i, value: c } = a;
1508
1508
  if (i.type === "Identifier") {
1509
1509
  const s = R(c);
1510
- t[i.name] = v(s);
1510
+ t[i.name] = S(s);
1511
1511
  }
1512
1512
  }
1513
1513
  return t;
1514
1514
  }
1515
1515
  function q(e) {
1516
- const { key: u, async: t, params: a, body: i } = e, c = a.map((s) => s.type === "ObjectPattern" ? `{${s.properties.map((n) => n.key?.name || n.name).join(",")}}` : s.name).join(", ");
1516
+ const { key: u, async: t, params: a, body: i } = e;
1517
+ console.log("getFunction--", e, u, t, a, i);
1518
+ const c = a.map((s) => s.type === "ObjectPattern" ? `{${s.properties.map((d) => d.key?.name || d.name).join(",")}}` : s.name).join(", ");
1517
1519
  if (u.type === "Identifier") {
1518
- const s = u.name, d = R(i), f = `${t ? "async " : ""}(${c}) => ${d}`, h = s.startsWith("watcher_");
1520
+ const s = u.name, n = R(i), f = `${t ? "async " : ""}(${c}) => ${n}`, h = s.startsWith("watcher_");
1519
1521
  return {
1520
1522
  name: s,
1521
1523
  watcher: h,
1522
- exp: C(f)
1524
+ exp: J(f)
1523
1525
  };
1524
1526
  }
1525
1527
  }
1526
- function pu(e) {
1528
+ function mu(e) {
1527
1529
  if (!e) return {};
1528
1530
  const u = {};
1529
1531
  for (const t of e.properties) {
@@ -1538,13 +1540,13 @@ function v0(e, u) {
1538
1540
  for (const c of e.properties) {
1539
1541
  const s = q(c);
1540
1542
  if (s && s.exp.value.includes("provider.apis")) {
1541
- const n = (s.exp.value.match(a) || [])[1];
1542
- if (!n) continue;
1543
- const f = D0(u, n);
1543
+ const d = (s.exp.value.match(a) || [])[1];
1544
+ if (!d) continue;
1545
+ const f = D0(u, d);
1544
1546
  if (!f) continue;
1545
1547
  const h = s.exp.value.match(i)?.[1];
1546
1548
  t[s.name] = {
1547
- ref: n,
1549
+ ref: d,
1548
1550
  name: f.name,
1549
1551
  test: {
1550
1552
  type: "JSFunction",
@@ -1567,7 +1569,7 @@ function v0(e, u) {
1567
1569
  return t;
1568
1570
  }
1569
1571
  function w0(e) {
1570
- const u = pu(e), t = /\_([\w]{5,})$/, a = {};
1572
+ const u = mu(e), t = /\_([\w]{5,})$/, a = {};
1571
1573
  for (const i of Object.keys(u))
1572
1574
  t.test(i) || (a[i] = u[i]);
1573
1575
  return a;
@@ -1583,7 +1585,7 @@ function A0(e) {
1583
1585
  const c = R(
1584
1586
  a.body.body[0].argument.callee.object
1585
1587
  );
1586
- u[i] = C(c);
1588
+ u[i] = J(c);
1587
1589
  } else
1588
1590
  u[i] = q(a)?.exp;
1589
1591
  } catch (c) {
@@ -1602,14 +1604,14 @@ function T0(e) {
1602
1604
  return u;
1603
1605
  }
1604
1606
  function B(e, u) {
1605
- return !!mu(e, u);
1607
+ return !!xu(e, u);
1606
1608
  }
1607
- function mu(e, u) {
1609
+ function xu(e, u) {
1608
1610
  return e.find(
1609
1611
  (a) => a.key?.name === u
1610
1612
  )?.value?.value;
1611
1613
  }
1612
- function su(e, u) {
1614
+ function ru(e, u) {
1613
1615
  const t = e.find(
1614
1616
  (a) => a.key?.name === u
1615
1617
  );
@@ -1621,12 +1623,12 @@ function I0(e, u = {}) {
1621
1623
  for (const a of e.properties) {
1622
1624
  const { key: i, value: c } = a, s = i.value || i.name || "";
1623
1625
  if (u[s]) {
1624
- const d = c.properties;
1626
+ const n = c.properties;
1625
1627
  t.push({
1626
1628
  source: u[s],
1627
- deep: B(d, "deep"),
1628
- immediate: B(d, "immediate"),
1629
- handler: su(d, "handler")
1629
+ deep: B(n, "deep"),
1630
+ immediate: B(n, "immediate"),
1631
+ handler: ru(n, "handler")
1630
1632
  });
1631
1633
  } else if (a.type === "ObjectMethod" && t.push({
1632
1634
  // todo: 处理上下文
@@ -1638,16 +1640,16 @@ function I0(e, u = {}) {
1638
1640
  immediate: !1,
1639
1641
  handler: q(a)?.exp
1640
1642
  }), a.type === "ObjectProperty") {
1641
- const d = c.properties;
1643
+ const n = c.properties;
1642
1644
  t.push({
1643
1645
  // todo: 处理上下文
1644
1646
  source: {
1645
1647
  type: "JSFunction",
1646
1648
  value: `this.${s}`
1647
1649
  },
1648
- deep: B(d, "deep"),
1649
- immediate: B(d, "immediate"),
1650
- handler: su(d, "handler")
1650
+ deep: B(n, "deep"),
1651
+ immediate: B(n, "immediate"),
1652
+ handler: ru(n, "handler")
1651
1653
  });
1652
1654
  }
1653
1655
  }
@@ -1657,7 +1659,7 @@ function N0(e) {
1657
1659
  const u = {};
1658
1660
  for (const t of e) {
1659
1661
  const a = t.key.name;
1660
- if ($u.includes(a)) {
1662
+ if (ju.includes(a)) {
1661
1663
  const i = q(t);
1662
1664
  i && (u[i.name] = i.exp);
1663
1665
  }
@@ -1671,12 +1673,12 @@ function q0(e) {
1671
1673
  if (u)
1672
1674
  return u.value.type === "ArrayExpression" ? u.value.elements.map((t) => t.name) : u.value.name;
1673
1675
  }
1674
- function xu(e) {
1676
+ function gu(e) {
1675
1677
  const u = e.find(
1676
1678
  (t) => t.key?.name === "default"
1677
1679
  );
1678
1680
  if (u)
1679
- return v(R(u.value));
1681
+ return S(R(u.value));
1680
1682
  }
1681
1683
  function k0(e) {
1682
1684
  if (!e) return [];
@@ -1687,7 +1689,7 @@ function k0(e) {
1687
1689
  name: a.name,
1688
1690
  required: B(c, "required"),
1689
1691
  type: q0(c),
1690
- default: xu(c)
1692
+ default: gu(c)
1691
1693
  };
1692
1694
  })), u;
1693
1695
  }
@@ -1707,11 +1709,11 @@ function _0(e) {
1707
1709
  function L0(e) {
1708
1710
  let u = [];
1709
1711
  return e.type === "ObjectExpression" && (u = e.properties.map((t) => {
1710
- const { key: a, value: i } = t, c = i.properties, s = a.name, d = mu(c, "from"), n = xu(c);
1712
+ const { key: a, value: i } = t, c = i.properties, s = a.name, n = xu(c, "from"), d = gu(c);
1711
1713
  return {
1712
1714
  name: s,
1713
- from: d || s,
1714
- default: n
1715
+ from: n || s,
1716
+ default: d
1715
1717
  };
1716
1718
  })), u;
1717
1719
  }
@@ -1724,10 +1726,10 @@ function B0(e) {
1724
1726
  const i = Pu.parse(e), c = /^.[\w]+_[\w]{5,}/;
1725
1727
  for (const s of i.nodes)
1726
1728
  if (s.type === "rule") {
1727
- const d = {};
1728
- c.test(s.selector) ? (s.nodes.forEach((n) => {
1729
- n.type === "decl" && (d[n.prop] = n.value);
1730
- }), t[s.selector] = d) : a.push(s.toString());
1729
+ const n = {};
1730
+ c.test(s.selector) ? (s.nodes.forEach((d) => {
1731
+ d.type === "decl" && (n[d.prop] = d.value);
1732
+ }), t[s.selector] = n) : a.push(s.toString());
1731
1733
  }
1732
1734
  } catch (i) {
1733
1735
  u.push(`css解析出错了,错误信息:[ ${i.message} ]
@@ -1741,46 +1743,46 @@ function B0(e) {
1741
1743
  };
1742
1744
  }
1743
1745
  async function W0(e) {
1744
- const { id: u, name: t, source: a, project: i } = e, { dependencies: c = [], platform: s = "web" } = i || {}, d = Ju(a);
1745
- if (d.length)
1746
- return Promise.reject(d);
1747
- const n = ru(a), {
1746
+ const { id: u, name: t, source: a, project: i } = e, { dependencies: c = [], platform: s = "web" } = i || {}, n = Ju(a);
1747
+ if (n.length)
1748
+ return Promise.reject(n);
1749
+ const d = nu(a), {
1748
1750
  styles: f,
1749
1751
  css: h,
1750
1752
  errors: b
1751
- } = B0(n.styles.join(`
1753
+ } = B0(d.styles.join(`
1752
1754
  `)), {
1753
1755
  state: E,
1754
1756
  watch: m,
1755
- lifeCycles: S,
1757
+ lifeCycles: v,
1756
1758
  computed: w,
1757
- methods: J,
1758
- props: gu,
1759
- emits: yu,
1760
- inject: Eu,
1761
- handlers: Su,
1762
- imports: vu,
1763
- dataSources: wu
1764
- } = g0(n.script, i), { nodes: Au, slots: Tu, context: Iu } = f0(u, t, n.template, {
1759
+ methods: X,
1760
+ props: yu,
1761
+ emits: Eu,
1762
+ inject: Su,
1763
+ handlers: vu,
1764
+ imports: wu,
1765
+ dataSources: Au
1766
+ } = g0(d.script, i), { nodes: Tu, slots: Iu, context: Nu } = f0(u, t, d.template, {
1765
1767
  platform: s,
1766
- handlers: Su,
1768
+ handlers: vu,
1767
1769
  styles: f
1768
- }), X = {
1770
+ }), z = {
1769
1771
  id: u,
1770
1772
  name: t,
1771
- inject: Eu,
1772
- props: gu,
1773
+ inject: Su,
1774
+ props: yu,
1773
1775
  state: E,
1774
1776
  watch: m,
1775
- lifeCycles: S,
1777
+ lifeCycles: v,
1776
1778
  computed: w,
1777
- methods: J,
1778
- dataSources: wu,
1779
- slots: Tu,
1780
- emits: yu,
1781
- nodes: Au,
1779
+ methods: X,
1780
+ dataSources: Au,
1781
+ slots: Iu,
1782
+ emits: Eu,
1783
+ nodes: Tu,
1782
1784
  css: h
1783
- }, Nu = Object.keys(w || {}), qu = [
1785
+ }, qu = Object.keys(w || {}), ku = [
1784
1786
  "$el",
1785
1787
  "$emit",
1786
1788
  "$nextTick",
@@ -1796,33 +1798,33 @@ async function W0(e) {
1796
1798
  "state",
1797
1799
  "$props",
1798
1800
  "props",
1799
- ...Object.keys(J || {})
1800
- ], { libs: ku } = V0(vu, c), z = {
1801
+ ...Object.keys(X || {})
1802
+ ], { libs: _u } = V0(wu, c), W = {
1801
1803
  platform: s,
1802
- context: Iu,
1803
- computed: Nu,
1804
- libs: ku,
1805
- members: qu
1804
+ context: Nu,
1805
+ computed: qu,
1806
+ libs: _u,
1807
+ members: ku
1806
1808
  };
1807
1809
  return await R0(
1808
- X,
1810
+ z,
1809
1811
  async (L) => {
1810
1812
  await O0(L, async (D) => {
1811
- if (G(D)) {
1812
- const _u = await Z(D.value);
1813
- D.value = K(_u, L.id, z);
1813
+ if (C(D)) {
1814
+ const Lu = await K(D.value);
1815
+ D.value = Y(Lu, L.id, W);
1814
1816
  }
1815
1817
  });
1816
1818
  },
1817
1819
  async (L) => {
1818
- const D = await Z(L.value);
1819
- L.value = K(D, "", z);
1820
+ const D = await K(L.value);
1821
+ L.value = Y(D, "", W);
1820
1822
  }
1821
- ), d.push(...b), d.length ? Promise.reject(d) : new Ru(X).toDsl();
1823
+ ), n.push(...b), n.length ? Promise.reject(n) : new Ou(z).toDsl();
1822
1824
  }
1823
1825
  async function R0(e, u, t) {
1824
- const a = async (m, S) => {
1825
- if (await u(m, S), Array.isArray(m.children))
1826
+ const a = async (m, v) => {
1827
+ if (await u(m, v), Array.isArray(m.children))
1826
1828
  for (const w of m.children)
1827
1829
  await a(w, m);
1828
1830
  }, i = async (m) => {
@@ -1832,14 +1834,14 @@ async function R0(e, u, t) {
1832
1834
  await i(w);
1833
1835
  return;
1834
1836
  }
1835
- const S = Object.values(m);
1836
- for (const w of S)
1837
- G(w) ? await t(w) : await i(w);
1837
+ const v = Object.values(m);
1838
+ for (const w of v)
1839
+ C(w) ? await t(w) : await i(w);
1838
1840
  }, {
1839
1841
  state: c,
1840
1842
  watch: s,
1841
- computed: d,
1842
- props: n,
1843
+ computed: n,
1844
+ props: d,
1843
1845
  dataSources: f,
1844
1846
  methods: h,
1845
1847
  lifeCycles: b,
@@ -1848,8 +1850,8 @@ async function R0(e, u, t) {
1848
1850
  if (await i({
1849
1851
  state: c,
1850
1852
  watch: s,
1851
- computed: d,
1852
- props: n,
1853
+ computed: n,
1854
+ props: d,
1853
1855
  dataSources: f,
1854
1856
  methods: h,
1855
1857
  lifeCycles: b,
@@ -1866,7 +1868,7 @@ async function O0(e, u) {
1866
1868
  await u(c), await t(c);
1867
1869
  return;
1868
1870
  }
1869
- if (G(a)) {
1871
+ if (C(a)) {
1870
1872
  await u(a);
1871
1873
  return;
1872
1874
  }
@@ -1883,8 +1885,8 @@ function V0(e = [], u = []) {
1883
1885
  );
1884
1886
  for (const { from: i, imports: c } of e)
1885
1887
  c.forEach((s) => {
1886
- const d = a[i];
1887
- d && (t[s] = d);
1888
+ const n = a[i];
1889
+ n && (t[s] = n);
1888
1890
  });
1889
1891
  return {
1890
1892
  libs: t
@@ -1892,9 +1894,9 @@ function V0(e = [], u = []) {
1892
1894
  }
1893
1895
  export {
1894
1896
  X0 as VTJ_PARSER_VERSION,
1895
- cu as htmlToNodes,
1897
+ su as htmlToNodes,
1896
1898
  z0 as parseUniApp,
1897
1899
  W0 as parseVue,
1898
- K as patchCode,
1900
+ Y as patchCode,
1899
1901
  O as replacer
1900
1902
  };