@vue/compiler-sfc 3.6.0-beta.10 → 3.6.0-beta.11

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.6.0-beta.10
2
+ * @vue/compiler-sfc v3.6.0-beta.11
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -11,7 +11,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
11
11
  var __getProtoOf = Object.getPrototypeOf;
12
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
13
13
  var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
14
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
14
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
15
15
  var __exportAll = (all, no_symbols) => {
16
16
  let target = {};
17
17
  for (var name in all) __defProp(target, name, {
@@ -41,7 +41,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
41
41
  throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
42
42
  });
43
43
  //#endregion
44
- //#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
44
+ //#region \0@oxc-project+runtime@0.128.0/helpers/typeof.js
45
45
  function _typeof(o) {
46
46
  "@babel/helpers - typeof";
47
47
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -52,7 +52,7 @@ function _typeof(o) {
52
52
  }
53
53
  var init_typeof = __esmMin((() => {}));
54
54
  //#endregion
55
- //#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
55
+ //#region \0@oxc-project+runtime@0.128.0/helpers/toPrimitive.js
56
56
  function toPrimitive(t, r) {
57
57
  if ("object" != _typeof(t) || !t) return t;
58
58
  var e = t[Symbol.toPrimitive];
@@ -67,7 +67,7 @@ var init_toPrimitive = __esmMin((() => {
67
67
  init_typeof();
68
68
  }));
69
69
  //#endregion
70
- //#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
70
+ //#region \0@oxc-project+runtime@0.128.0/helpers/toPropertyKey.js
71
71
  function toPropertyKey(t) {
72
72
  var i = toPrimitive(t, "string");
73
73
  return "symbol" == _typeof(i) ? i : i + "";
@@ -77,7 +77,7 @@ var init_toPropertyKey = __esmMin((() => {
77
77
  init_toPrimitive();
78
78
  }));
79
79
  //#endregion
80
- //#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
80
+ //#region \0@oxc-project+runtime@0.128.0/helpers/defineProperty.js
81
81
  function _defineProperty(e, r, t) {
82
82
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
83
83
  value: t,
@@ -90,7 +90,7 @@ var init_defineProperty = __esmMin((() => {
90
90
  init_toPropertyKey();
91
91
  }));
92
92
  //#endregion
93
- //#region \0@oxc-project+runtime@0.124.0/helpers/objectSpread2.js
93
+ //#region \0@oxc-project+runtime@0.128.0/helpers/objectSpread2.js
94
94
  function ownKeys(e, r) {
95
95
  var t = Object.keys(e);
96
96
  if (Object.getOwnPropertySymbols) {
@@ -3594,7 +3594,7 @@ const errorMessages$1 = {
3594
3594
  [54]: ``
3595
3595
  };
3596
3596
  //#endregion
3597
- //#region node_modules/.pnpm/@babel+parser@7.29.2/node_modules/@babel/parser/lib/index.js
3597
+ //#region node_modules/.pnpm/@babel+parser@7.29.3/node_modules/@babel/parser/lib/index.js
3598
3598
  var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
3599
3599
  Object.defineProperty(exports, "__esModule", { value: true });
3600
3600
  function _objectWithoutPropertiesLoose(r, e) {
@@ -6138,7 +6138,7 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
6138
6138
  }
6139
6139
  flowParseDeclareVariable(node) {
6140
6140
  this.next();
6141
- node.id = this.flowParseTypeAnnotatableIdentifier(true);
6141
+ node.id = this.flowParseTypeAnnotatableIdentifier();
6142
6142
  this.scope.declareName(node.id.name, 5, node.id.loc.start);
6143
6143
  this.semicolon();
6144
6144
  return this.finishNode(node, "DeclareVariable");
@@ -6282,9 +6282,14 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
6282
6282
  if (!reservedTypes.has(word)) return;
6283
6283
  this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { reservedType: word });
6284
6284
  }
6285
- flowParseRestrictedIdentifier(liberal, declaration) {
6285
+ flowParseRestrictedIdentifierName(liberal, declaration) {
6286
6286
  this.checkReservedType(this.state.value, this.state.startLoc, declaration);
6287
- return this.parseIdentifier(liberal);
6287
+ return this.parseIdentifierName(liberal);
6288
+ }
6289
+ flowParseRestrictedIdentifier(liberal, declaration) {
6290
+ const node = this.startNode();
6291
+ const name = this.flowParseRestrictedIdentifierName(liberal, declaration);
6292
+ return this.createIdentifier(node, name);
6288
6293
  }
6289
6294
  flowParseTypeAlias(node) {
6290
6295
  node.id = this.flowParseRestrictedIdentifier(false, true);
@@ -6308,14 +6313,21 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
6308
6313
  this.semicolon();
6309
6314
  return this.finishNode(node, "OpaqueType");
6310
6315
  }
6316
+ flowParseTypeParameterBound() {
6317
+ if (this.match(14) || this.isContextual(81)) {
6318
+ const node = this.startNode();
6319
+ this.next();
6320
+ node.typeAnnotation = this.flowParseType();
6321
+ return this.finishNode(node, "TypeAnnotation");
6322
+ }
6323
+ }
6311
6324
  flowParseTypeParameter(requireDefault = false) {
6312
6325
  const nodeStartLoc = this.state.startLoc;
6313
6326
  const node = this.startNode();
6314
6327
  const variance = this.flowParseVariance();
6315
- const ident = this.flowParseTypeAnnotatableIdentifier();
6316
- node.name = ident.name;
6328
+ node.name = this.flowParseRestrictedIdentifierName();
6317
6329
  node.variance = variance;
6318
- node.bound = ident.typeAnnotation;
6330
+ node.bound = this.flowParseTypeParameterBound();
6319
6331
  if (this.match(29)) {
6320
6332
  this.eat(29);
6321
6333
  node.default = this.flowParseType();
@@ -6873,13 +6885,11 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
6873
6885
  node.typeAnnotation = this.flowParseTypeInitialiser();
6874
6886
  return this.finishNode(node, "TypeAnnotation");
6875
6887
  }
6876
- flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
6877
- const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
6878
- if (this.match(14)) {
6879
- ident.typeAnnotation = this.flowParseTypeAnnotation();
6880
- this.resetEndLocation(ident);
6881
- }
6882
- return ident;
6888
+ flowParseTypeAnnotatableIdentifier() {
6889
+ const node = this.startNode();
6890
+ const name = this.parseIdentifierName();
6891
+ if (this.match(14)) node.typeAnnotation = this.flowParseTypeAnnotation();
6892
+ return this.createIdentifier(node, name);
6883
6893
  }
6884
6894
  typeCastToParameter(node) {
6885
6895
  node.expression.typeAnnotation = node.typeAnnotation;
@@ -8675,6 +8685,7 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
8675
8685
  adjustInnerComments(node, node.properties, commentWS);
8676
8686
  break;
8677
8687
  case "CallExpression":
8688
+ case "NewExpression":
8678
8689
  case "OptionalCallExpression":
8679
8690
  adjustInnerComments(node, node.arguments, commentWS);
8680
8691
  break;
@@ -8687,6 +8698,7 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
8687
8698
  case "ObjectMethod":
8688
8699
  case "ClassMethod":
8689
8700
  case "ClassPrivateMethod":
8701
+ case "TSTypeParameterDeclaration":
8690
8702
  adjustInnerComments(node, node.params, commentWS);
8691
8703
  break;
8692
8704
  case "ArrayExpression":
@@ -8703,6 +8715,9 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
8703
8715
  case "TSEnumBody":
8704
8716
  adjustInnerComments(node, node.members, commentWS);
8705
8717
  break;
8718
+ case "TSInterfaceBody":
8719
+ adjustInnerComments(node, node.body, commentWS);
8720
+ break;
8706
8721
  default:
8707
8722
  if (node.type === "RecordExpression") {
8708
8723
  adjustInnerComments(node, node.properties, commentWS);
@@ -10259,7 +10274,8 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
10259
10274
  const oldInModule = this.inModule;
10260
10275
  this.inModule = inModule;
10261
10276
  const oldScope = this.scope;
10262
- this.scope = new (this.getScopeHandler())(this, inModule);
10277
+ const ScopeHandler = this.getScopeHandler();
10278
+ this.scope = new ScopeHandler(this, inModule);
10263
10279
  const oldProdParam = this.prodParam;
10264
10280
  this.prodParam = new ProductionParameterHandler();
10265
10281
  const oldClassScope = this.classScope;
@@ -16166,7 +16182,7 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
16166
16182
  exports.parseExpression = parseExpression;
16167
16183
  }));
16168
16184
  //#endregion
16169
- //#region \0@oxc-project+runtime@0.124.0/helpers/asyncToGenerator.js
16185
+ //#region \0@oxc-project+runtime@0.128.0/helpers/asyncToGenerator.js
16170
16186
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
16171
16187
  try {
16172
16188
  var i = n[a](c), u = i.value;
@@ -17621,6 +17637,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
17621
17637
  constantCache: /* @__PURE__ */ new WeakMap(),
17622
17638
  temps: 0,
17623
17639
  identifiers: Object.create(null),
17640
+ identifierScopes: Object.create(null),
17624
17641
  scopes: {
17625
17642
  vFor: 0,
17626
17643
  vSlot: 0,
@@ -17671,16 +17688,20 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
17671
17688
  context.parent.children.splice(removalIndex, 1);
17672
17689
  },
17673
17690
  onNodeRemoved: NOOP,
17674
- addIdentifiers(exp) {
17675
- if (isString$1(exp)) addId(exp);
17676
- else if (exp.identifiers) exp.identifiers.forEach(addId);
17677
- else if (exp.type === 4) addId(exp.content);
17691
+ addIdentifiers(exp, type = "local") {
17692
+ if (isString$1(exp)) addId(exp, type);
17693
+ else if (exp.identifiers) exp.identifiers.forEach((id) => addId(id, type));
17694
+ else if (exp.type === 4) addId(exp.content, type);
17678
17695
  },
17679
17696
  removeIdentifiers(exp) {
17680
17697
  if (isString$1(exp)) removeId(exp);
17681
17698
  else if (exp.identifiers) exp.identifiers.forEach(removeId);
17682
17699
  else if (exp.type === 4) removeId(exp.content);
17683
17700
  },
17701
+ isSlotScopeIdentifier(name) {
17702
+ const scopes = context.identifierScopes[name];
17703
+ return scopes ? scopes[scopes.length - 1] === "slot" : false;
17704
+ },
17684
17705
  hoist(exp) {
17685
17706
  if (isString$1(exp)) exp = createSimpleExpression(exp);
17686
17707
  context.hoists.push(exp);
@@ -17694,13 +17715,16 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
17694
17715
  return cacheExp;
17695
17716
  }
17696
17717
  };
17697
- function addId(id) {
17698
- const { identifiers } = context;
17718
+ function addId(id, type) {
17719
+ const { identifiers, identifierScopes } = context;
17699
17720
  if (identifiers[id] === void 0) identifiers[id] = 0;
17700
17721
  identifiers[id]++;
17722
+ (identifierScopes[id] || (identifierScopes[id] = [])).push(type);
17701
17723
  }
17702
17724
  function removeId(id) {
17703
17725
  context.identifiers[id]--;
17726
+ const scopes = context.identifierScopes[id];
17727
+ if (scopes) scopes.pop();
17704
17728
  }
17705
17729
  return context;
17706
17730
  }
@@ -20870,7 +20894,7 @@ const trackSlotScopes = (node, context) => {
20870
20894
  const vSlot = findDir$1(node, "slot");
20871
20895
  if (vSlot) {
20872
20896
  const slotProps = vSlot.exp;
20873
- if (context.prefixIdentifiers) slotProps && context.addIdentifiers(slotProps);
20897
+ if (context.prefixIdentifiers) slotProps && context.addIdentifiers(slotProps, "slot");
20874
20898
  context.scopes.vSlot++;
20875
20899
  return () => {
20876
20900
  if (context.prefixIdentifiers) slotProps && context.removeIdentifiers(slotProps);
@@ -21089,6 +21113,15 @@ function resolveComponentType(node, context, ssr = false) {
21089
21113
  if (!ssr) context.helper(builtIn);
21090
21114
  return builtIn;
21091
21115
  }
21116
+ {
21117
+ const fromScope = resolveSlotScopeReference(tag, context);
21118
+ if (fromScope) return fromScope;
21119
+ const dotIndex = tag.indexOf(".");
21120
+ if (dotIndex > 0) {
21121
+ const ns = resolveSlotScopeReference(tag.slice(0, dotIndex), context);
21122
+ if (ns) return ns + tag.slice(dotIndex);
21123
+ }
21124
+ }
21092
21125
  {
21093
21126
  const fromSetup = resolveSetupReference$1(tag, context);
21094
21127
  if (fromSetup) return fromSetup;
@@ -21107,6 +21140,14 @@ function resolveComponentType(node, context, ssr = false) {
21107
21140
  context.components.add(tag);
21108
21141
  return toValidAssetId(tag, `component`);
21109
21142
  }
21143
+ function resolveSlotScopeReference(name, context) {
21144
+ const camelName = camelize(name);
21145
+ const PascalName = capitalize(camelName);
21146
+ const isInSlotScope = (reference) => context.isSlotScopeIdentifier(reference);
21147
+ if (isInSlotScope(name)) return name;
21148
+ if (isInSlotScope(camelName)) return camelName;
21149
+ if (isInSlotScope(PascalName)) return PascalName;
21150
+ }
21110
21151
  function resolveSetupReference$1(name, context) {
21111
21152
  const bindings = context.bindingMetadata;
21112
21153
  if (!bindings || bindings.__isScriptSetup === false) return;
@@ -24423,13 +24464,15 @@ init_objectSpread2();
24423
24464
  const resourceUrlTagConfig = {
24424
24465
  video: ["src", "poster"],
24425
24466
  source: ["src"],
24426
- img: ["src"],
24427
- image: ["xlink:href", "href"]
24467
+ img: ["src"]
24428
24468
  };
24429
24469
  const defaultAssetUrlOptions = {
24430
24470
  base: null,
24431
24471
  includeAbsolute: false,
24432
- tags: _objectSpread2(_objectSpread2({}, resourceUrlTagConfig), {}, { use: ["xlink:href", "href"] })
24472
+ tags: _objectSpread2(_objectSpread2({}, resourceUrlTagConfig), {}, {
24473
+ image: ["xlink:href", "href"],
24474
+ use: ["xlink:href", "href"]
24475
+ })
24433
24476
  };
24434
24477
  const normalizeOptions = (options) => {
24435
24478
  if (Object.keys(options).some((key) => isArray$3(options[key]))) return _objectSpread2(_objectSpread2({}, defaultAssetUrlOptions), {}, { tags: options });
@@ -24467,7 +24510,7 @@ const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => {
24467
24510
  if (attr.type !== 6 || !assetAttrs.includes(attr.name) || !attr.value) return;
24468
24511
  const urlValue = attr.value.content;
24469
24512
  const isHashOnlyValue = urlValue[0] === "#";
24470
- if (isExternalUrl(urlValue) || isDataUrl(urlValue) || isHashOnlyValue && !canTransformHashImport(node.tag, attr.name) || !options.includeAbsolute && !isRelativeUrl(urlValue)) return;
24513
+ if (isExternalUrl(urlValue) || isDataUrl(urlValue) || urlValue === "#" || isHashOnlyValue && !canTransformHashImport(node.tag, attr.name) || !options.includeAbsolute && !isRelativeUrl(urlValue)) return;
24471
24514
  const url = parseUrl(urlValue);
24472
24515
  if (options.base && urlValue[0] === ".") {
24473
24516
  const base = parseUrl(options.base);
@@ -24631,6 +24674,90 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
24631
24674
  }
24632
24675
  };
24633
24676
  //#endregion
24677
+ //#region packages/compiler-vapor/src/ir/component.ts
24678
+ const IRDynamicPropsKind = {
24679
+ "EXPRESSION": 0,
24680
+ "0": "EXPRESSION",
24681
+ "ATTRIBUTE": 1,
24682
+ "1": "ATTRIBUTE"
24683
+ };
24684
+ const IRSlotType = {
24685
+ "STATIC": 0,
24686
+ "0": "STATIC",
24687
+ "DYNAMIC": 1,
24688
+ "1": "DYNAMIC",
24689
+ "LOOP": 2,
24690
+ "2": "LOOP",
24691
+ "CONDITIONAL": 3,
24692
+ "3": "CONDITIONAL",
24693
+ "EXPRESSION": 4,
24694
+ "4": "EXPRESSION"
24695
+ };
24696
+ //#endregion
24697
+ //#region packages/compiler-vapor/src/ir/index.ts
24698
+ const IRNodeTypes = {
24699
+ "ROOT": 0,
24700
+ "0": "ROOT",
24701
+ "BLOCK": 1,
24702
+ "1": "BLOCK",
24703
+ "SET_BLOCK_KEY": 2,
24704
+ "2": "SET_BLOCK_KEY",
24705
+ "SET_PROP": 3,
24706
+ "3": "SET_PROP",
24707
+ "SET_DYNAMIC_PROPS": 4,
24708
+ "4": "SET_DYNAMIC_PROPS",
24709
+ "SET_TEXT": 5,
24710
+ "5": "SET_TEXT",
24711
+ "SET_EVENT": 6,
24712
+ "6": "SET_EVENT",
24713
+ "SET_DYNAMIC_EVENTS": 7,
24714
+ "7": "SET_DYNAMIC_EVENTS",
24715
+ "SET_HTML": 8,
24716
+ "8": "SET_HTML",
24717
+ "SET_TEMPLATE_REF": 9,
24718
+ "9": "SET_TEMPLATE_REF",
24719
+ "INSERT_NODE": 10,
24720
+ "10": "INSERT_NODE",
24721
+ "PREPEND_NODE": 11,
24722
+ "11": "PREPEND_NODE",
24723
+ "CREATE_COMPONENT_NODE": 12,
24724
+ "12": "CREATE_COMPONENT_NODE",
24725
+ "SLOT_OUTLET_NODE": 13,
24726
+ "13": "SLOT_OUTLET_NODE",
24727
+ "DIRECTIVE": 14,
24728
+ "14": "DIRECTIVE",
24729
+ "IF": 15,
24730
+ "15": "IF",
24731
+ "FOR": 16,
24732
+ "16": "FOR",
24733
+ "KEY": 17,
24734
+ "17": "KEY",
24735
+ "GET_TEXT_CHILD": 18,
24736
+ "18": "GET_TEXT_CHILD"
24737
+ };
24738
+ var TemplateRegistry = class {
24739
+ constructor() {
24740
+ this.entries = [];
24741
+ }
24742
+ keys() {
24743
+ return this.entries.map(({ content }) => content);
24744
+ }
24745
+ };
24746
+ const DynamicFlag = {
24747
+ "NONE": 0,
24748
+ "0": "NONE",
24749
+ "REFERENCED": 1,
24750
+ "1": "REFERENCED",
24751
+ "NON_TEMPLATE": 2,
24752
+ "2": "NON_TEMPLATE",
24753
+ "INSERT": 4,
24754
+ "4": "INSERT"
24755
+ };
24756
+ function isBlockOperation(op) {
24757
+ const type = op.type;
24758
+ return type === 12 || type === 13 || type === 15 || type === 17 || type === 16;
24759
+ }
24760
+ //#endregion
24634
24761
  //#region packages/compiler-vapor/src/transforms/utils.ts
24635
24762
  const newDynamic = () => ({
24636
24763
  flags: 1,
@@ -24746,6 +24873,7 @@ function isTeleportTag(tag) {
24746
24873
  }
24747
24874
  function isBuiltInComponent(tag) {
24748
24875
  if (isTeleportTag(tag)) return "VaporTeleport";
24876
+ else if (tag === "Suspense" || tag === "suspense") return "Suspense";
24749
24877
  else if (isKeepAliveTag(tag)) return "VaporKeepAlive";
24750
24878
  else if (isTransitionTag(tag)) return "VaporTransition";
24751
24879
  else if (isTransitionGroupTag(tag)) return "VaporTransitionGroup";
@@ -24767,6 +24895,8 @@ var TransformContext = class TransformContext {
24767
24895
  this.index = 0;
24768
24896
  this.block = this.ir.block;
24769
24897
  this.template = "";
24898
+ this.templateRoot = false;
24899
+ this.templateIndexMap = /* @__PURE__ */ new Map();
24770
24900
  this.childrenTemplate = [];
24771
24901
  this.dynamic = this.ir.block.dynamic;
24772
24902
  this.imports = [];
@@ -24776,6 +24906,8 @@ var TransformContext = class TransformContext {
24776
24906
  this.component = this.ir.component;
24777
24907
  this.directive = this.ir.directive;
24778
24908
  this.slots = [];
24909
+ this.effectIndex = this.block.effect.length;
24910
+ this.operationIndex = this.block.operation.length;
24779
24911
  this.isLastEffectiveChild = true;
24780
24912
  this.isOnRightmostPath = true;
24781
24913
  this.hasInlineAncestorNeedingClose = false;
@@ -24793,20 +24925,28 @@ var TransformContext = class TransformContext {
24793
24925
  this.initNextIdMap();
24794
24926
  }
24795
24927
  enterBlock(ir, isVFor = false) {
24796
- const { block, template, dynamic, childrenTemplate, slots } = this;
24928
+ const { block, template, templateRoot, templateIndexMap, dynamic, childrenTemplate, slots, effectIndex, operationIndex } = this;
24797
24929
  this.block = ir;
24798
24930
  this.dynamic = ir.dynamic;
24799
24931
  this.template = "";
24932
+ this.templateRoot = false;
24933
+ this.templateIndexMap = templateIndexMap;
24800
24934
  this.childrenTemplate = [];
24801
24935
  this.slots = [];
24936
+ this.effectIndex = ir.effect.length;
24937
+ this.operationIndex = ir.operation.length;
24802
24938
  isVFor && this.inVFor++;
24803
24939
  return () => {
24804
24940
  this.registerTemplate();
24805
24941
  this.block = block;
24806
24942
  this.template = template;
24943
+ this.templateRoot = templateRoot;
24944
+ this.templateIndexMap = templateIndexMap;
24807
24945
  this.dynamic = dynamic;
24808
24946
  this.childrenTemplate = childrenTemplate;
24809
24947
  this.slots = slots;
24948
+ this.effectIndex = effectIndex;
24949
+ this.operationIndex = operationIndex;
24810
24950
  isVFor && this.inVFor--;
24811
24951
  };
24812
24952
  }
@@ -24831,31 +24971,66 @@ var TransformContext = class TransformContext {
24831
24971
  nextIfIndex() {
24832
24972
  return this.ifIndex++;
24833
24973
  }
24834
- pushTemplate(content) {
24835
- const existingIndex = this.ir.templateIndexMap.get(content);
24974
+ getTemplateNamespace() {
24975
+ return this.node.type === 1 ? this.node.ns : 0;
24976
+ }
24977
+ canUseStaticTemplate() {
24978
+ if (!this.template) return false;
24979
+ if (this.inVFor) return false;
24980
+ if (this.dynamic.hasDynamicChild) return false;
24981
+ if (this.block.effect.length !== this.effectIndex) return false;
24982
+ if (this.block.operation.length !== this.operationIndex) return false;
24983
+ if (this.node.type === 2 || this.node.type === 3) return true;
24984
+ return this.node.type === 1 && this.node.tagType === 0 && !(this.options.isCustomElement(this.node.tag) || this.node.tag === "template");
24985
+ }
24986
+ pushTemplate(content, { root = false, static: isStatic = false } = {}) {
24987
+ const templateKey = JSON.stringify([
24988
+ this.getTemplateNamespace(),
24989
+ root,
24990
+ isStatic,
24991
+ content
24992
+ ]);
24993
+ const existingIndex = this.templateIndexMap.get(templateKey);
24836
24994
  if (existingIndex !== void 0) return existingIndex;
24837
- const newIndex = this.ir.template.size;
24838
- this.ir.template.set(content, this.node.ns);
24839
- this.ir.templateIndexMap.set(content, newIndex);
24995
+ const ns = this.getTemplateNamespace();
24996
+ const newIndex = this.ir.template.entries.length;
24997
+ this.ir.template.entries.push({
24998
+ content,
24999
+ ns,
25000
+ root,
25001
+ static: isStatic
25002
+ });
25003
+ this.templateIndexMap.set(templateKey, newIndex);
24840
25004
  return newIndex;
24841
25005
  }
24842
25006
  registerTemplate() {
24843
25007
  if (!this.template) return -1;
24844
- const id = this.pushTemplate(this.template);
25008
+ const id = this.pushTemplate(this.template, {
25009
+ root: this.templateRoot,
25010
+ static: this.canUseStaticTemplate()
25011
+ });
24845
25012
  return this.dynamic.template = id;
24846
25013
  }
24847
- registerEffect(expressions, operation, getIndex = () => this.block.effect.length) {
25014
+ registerEffect(expressions, operation, getIndex) {
24848
25015
  const operations = [operation].flat();
24849
25016
  expressions = expressions.filter((exp) => !isConstantExpression(exp));
24850
25017
  if (this.inVOnce || expressions.length === 0 || expressions.every((e) => isStaticExpression(e, this.root.options.bindingMetadata))) return this.registerOperation(...operations);
24851
- this.block.effect.splice(getIndex(), 0, {
25018
+ const index = getIndex ? getIndex() : this.block.effect.length;
25019
+ this.block.effect.splice(index, 0, {
24852
25020
  expressions,
24853
25021
  operations
24854
25022
  });
25023
+ if (getIndex) this.shiftEffectBoundaries(index);
24855
25024
  }
24856
25025
  registerOperation(...node) {
24857
25026
  this.block.operation.push(...node);
24858
25027
  }
25028
+ effectBoundary() {
25029
+ return {
25030
+ operationIndex: this.operationIndex,
25031
+ effectIndex: this.effectIndex
25032
+ };
25033
+ }
24859
25034
  create(node, index) {
24860
25035
  let effectiveParent = this;
24861
25036
  while (effectiveParent && effectiveParent.node.type === 1 && effectiveParent.node.tagType === 3) effectiveParent = effectiveParent.parent;
@@ -24871,14 +25046,23 @@ var TransformContext = class TransformContext {
24871
25046
  parent: this,
24872
25047
  index,
24873
25048
  template: "",
25049
+ templateRoot: false,
24874
25050
  childrenTemplate: [],
25051
+ templateIndexMap: this.templateIndexMap,
24875
25052
  dynamic: newDynamic(),
25053
+ effectIndex: this.block.effect.length,
25054
+ operationIndex: this.block.operation.length,
24876
25055
  effectiveParent,
24877
25056
  isLastEffectiveChild,
24878
25057
  isOnRightmostPath,
24879
25058
  hasInlineAncestorNeedingClose
24880
25059
  });
24881
25060
  }
25061
+ shiftEffectBoundaries(index, dynamic = this.dynamic) {
25062
+ const operation = dynamic.operation;
25063
+ if (operation && isBlockOperation(operation) && operation.effectIndex !== void 0 && operation.effectIndex >= index) operation.effectIndex++;
25064
+ for (const child of dynamic.children) this.shiftEffectBoundaries(index, child);
25065
+ }
24882
25066
  isEffectivelyLastChild(index) {
24883
25067
  const children = this.node.children;
24884
25068
  if (!children) return true;
@@ -24913,9 +25097,7 @@ function transform(node, options = {}) {
24913
25097
  type: 0,
24914
25098
  node,
24915
25099
  source: node.source,
24916
- template: /* @__PURE__ */ new Map(),
24917
- templateIndexMap: /* @__PURE__ */ new Map(),
24918
- rootTemplateIndexes: /* @__PURE__ */ new Set(),
25100
+ template: new TemplateRegistry(),
24919
25101
  component: /* @__PURE__ */ new Set(),
24920
25102
  directive: /* @__PURE__ */ new Set(),
24921
25103
  block: newBlock(node),
@@ -25129,82 +25311,6 @@ function codeFragmentToString(code, context) {
25129
25311
  }
25130
25312
  }
25131
25313
  //#endregion
25132
- //#region packages/compiler-vapor/src/ir/component.ts
25133
- const IRDynamicPropsKind = {
25134
- "EXPRESSION": 0,
25135
- "0": "EXPRESSION",
25136
- "ATTRIBUTE": 1,
25137
- "1": "ATTRIBUTE"
25138
- };
25139
- const IRSlotType = {
25140
- "STATIC": 0,
25141
- "0": "STATIC",
25142
- "DYNAMIC": 1,
25143
- "1": "DYNAMIC",
25144
- "LOOP": 2,
25145
- "2": "LOOP",
25146
- "CONDITIONAL": 3,
25147
- "3": "CONDITIONAL",
25148
- "EXPRESSION": 4,
25149
- "4": "EXPRESSION"
25150
- };
25151
- //#endregion
25152
- //#region packages/compiler-vapor/src/ir/index.ts
25153
- const IRNodeTypes = {
25154
- "ROOT": 0,
25155
- "0": "ROOT",
25156
- "BLOCK": 1,
25157
- "1": "BLOCK",
25158
- "SET_BLOCK_KEY": 2,
25159
- "2": "SET_BLOCK_KEY",
25160
- "SET_PROP": 3,
25161
- "3": "SET_PROP",
25162
- "SET_DYNAMIC_PROPS": 4,
25163
- "4": "SET_DYNAMIC_PROPS",
25164
- "SET_TEXT": 5,
25165
- "5": "SET_TEXT",
25166
- "SET_EVENT": 6,
25167
- "6": "SET_EVENT",
25168
- "SET_DYNAMIC_EVENTS": 7,
25169
- "7": "SET_DYNAMIC_EVENTS",
25170
- "SET_HTML": 8,
25171
- "8": "SET_HTML",
25172
- "SET_TEMPLATE_REF": 9,
25173
- "9": "SET_TEMPLATE_REF",
25174
- "INSERT_NODE": 10,
25175
- "10": "INSERT_NODE",
25176
- "PREPEND_NODE": 11,
25177
- "11": "PREPEND_NODE",
25178
- "CREATE_COMPONENT_NODE": 12,
25179
- "12": "CREATE_COMPONENT_NODE",
25180
- "SLOT_OUTLET_NODE": 13,
25181
- "13": "SLOT_OUTLET_NODE",
25182
- "DIRECTIVE": 14,
25183
- "14": "DIRECTIVE",
25184
- "IF": 15,
25185
- "15": "IF",
25186
- "FOR": 16,
25187
- "16": "FOR",
25188
- "KEY": 17,
25189
- "17": "KEY",
25190
- "GET_TEXT_CHILD": 18,
25191
- "18": "GET_TEXT_CHILD"
25192
- };
25193
- const DynamicFlag = {
25194
- "NONE": 0,
25195
- "0": "NONE",
25196
- "REFERENCED": 1,
25197
- "1": "REFERENCED",
25198
- "NON_TEMPLATE": 2,
25199
- "2": "NON_TEMPLATE",
25200
- "INSERT": 4,
25201
- "4": "INSERT"
25202
- };
25203
- function isBlockOperation(op) {
25204
- const type = op.type;
25205
- return type === 12 || type === 13 || type === 15 || type === 17 || type === 16;
25206
- }
25207
- //#endregion
25208
25314
  //#region packages/compiler-vapor/src/generators/dom.ts
25209
25315
  function genInsertNode({ parent, elements, anchor }, { helper }) {
25210
25316
  let element = elements.map((el) => `n${el}`).join(", ");
@@ -25837,26 +25943,40 @@ function buildDestructureIdMap(idToPathMap, baseAccessor, plugins) {
25837
25943
  function matchPatterns(render, keyProp, idMap) {
25838
25944
  const selectorPatterns = [];
25839
25945
  const keyOnlyBindingPatterns = [];
25840
- render.effect = render.effect.filter((effect) => {
25946
+ const removedEffectIndexes = [];
25947
+ render.effect = render.effect.filter((effect, index) => {
25841
25948
  if (keyProp !== void 0) {
25842
25949
  const selector = matchSelectorPattern(effect, keyProp.content, idMap);
25843
25950
  if (selector) {
25844
25951
  selectorPatterns.push(selector);
25952
+ removedEffectIndexes.push(index);
25845
25953
  return false;
25846
25954
  }
25847
25955
  const keyOnly = matchKeyOnlyBindingPattern(effect, keyProp.content);
25848
25956
  if (keyOnly) {
25849
25957
  keyOnlyBindingPatterns.push(keyOnly);
25958
+ removedEffectIndexes.push(index);
25850
25959
  return false;
25851
25960
  }
25852
25961
  }
25853
25962
  return true;
25854
25963
  });
25964
+ if (removedEffectIndexes.length) shiftEffectBoundaries(render.dynamic, removedEffectIndexes);
25855
25965
  return {
25856
25966
  keyOnlyBindingPatterns,
25857
25967
  selectorPatterns
25858
25968
  };
25859
25969
  }
25970
+ function shiftEffectBoundaries(dynamic, removedEffectIndexes) {
25971
+ const operation = dynamic.operation;
25972
+ if (operation && isBlockOperation(operation) && operation.effectIndex !== void 0) {
25973
+ let offset = 0;
25974
+ for (const removedIndex of removedEffectIndexes) if (removedIndex < operation.effectIndex) offset++;
25975
+ else break;
25976
+ operation.effectIndex -= offset;
25977
+ }
25978
+ for (const child of dynamic.children) shiftEffectBoundaries(child, removedEffectIndexes);
25979
+ }
25860
25980
  function matchKeyOnlyBindingPattern(effect, key) {
25861
25981
  if (effect.expressions.length === 1) {
25862
25982
  const { ast, content } = effect.expressions[0];
@@ -26172,11 +26292,11 @@ function genCreateComponent(operation, context) {
26172
26292
  ];
26173
26293
  }, []),
26174
26294
  `const n${operation.id} = `,
26175
- ...genCall(operation.dynamic && !operation.dynamic.isStatic ? helper("createDynamicComponent") : operation.isCustomElement ? helper("createPlainElement") : operation.asset ? helper("createComponentWithFallback") : helper("createComponent"), tag, rawProps, rawSlots, root ? "true" : false, once && "true"),
26295
+ ...genCall(operation.dynamic && !operation.dynamic.isStatic ? helper("createDynamicComponent") : operation.useCreateElement ? helper("createPlainElement") : operation.asset ? helper("createComponentWithFallback") : helper("createComponent"), tag, rawProps, rawSlots, root ? "true" : false, once && "true"),
26176
26296
  ...genDirectivesForElement(operation.id, context)
26177
26297
  ];
26178
26298
  function genTag() {
26179
- if (operation.isCustomElement) return JSON.stringify(operation.tag);
26299
+ if (operation.useCreateElement) return JSON.stringify(operation.tag);
26180
26300
  else if (operation.dynamic) if (operation.dynamic.isStatic) return genCall(helper("resolveDynamicComponent"), genExpression(operation.dynamic, context));
26181
26301
  else return [
26182
26302
  "() => (",
@@ -26612,21 +26732,24 @@ function genEffect({ operations }, context) {
26612
26732
  return frag;
26613
26733
  }
26614
26734
  function genInsertionState(operation, context) {
26615
- const { parent, anchor, logicalIndex, append, last } = operation;
26616
- return [NEWLINE, ...genCall(context.helper("setInsertionState"), `n${parent}`, anchor == null ? void 0 : anchor === -1 ? `0` : append ? "null" : `n${anchor}`, logicalIndex !== void 0 ? String(logicalIndex) : void 0, last && "true")];
26735
+ const { parent, anchor, logicalIndex, append } = operation;
26736
+ return [NEWLINE, ...genCall(context.helper("setInsertionState"), `n${parent}`, anchor == null ? void 0 : anchor === -1 ? `0` : append ? "null" : `n${anchor}`, logicalIndex !== void 0 ? String(logicalIndex) : void 0)];
26617
26737
  }
26618
26738
  //#endregion
26619
26739
  //#region packages/compiler-vapor/src/generators/template.ts
26620
- function genTemplates(templates, rootIndexes, context) {
26740
+ function genTemplates(templates, context) {
26621
26741
  const result = [];
26622
- let i = 0;
26623
- templates.forEach((ns, template) => {
26624
- result.push(`const ${context.tName(i)} = ${context.helper("template")}(${JSON.stringify(template).replace(IMPORT_EXPR_RE, `" + $1 + "`)}${rootIndexes.has(i) ? ", true" : ns ? ", false" : ""}${ns ? `, ${ns}` : ""})\n`);
26625
- i++;
26742
+ templates.forEach(({ content, ns, root, static: isStatic }, i) => {
26743
+ let args = JSON.stringify(content).replace(IMPORT_EXPR_RE, `" + $1 + "`);
26744
+ if (root) args += ", true";
26745
+ else if (isStatic || ns) args += ", false";
26746
+ if (isStatic || ns) args += `, ${isStatic ? "true" : "false"}`;
26747
+ if (ns) args += `, ${ns}`;
26748
+ result.push(`const ${context.tName(i)} = ${context.helper("template")}(${args})\n`);
26626
26749
  });
26627
26750
  return result.join("");
26628
26751
  }
26629
- function genSelf(dynamic, context) {
26752
+ function genSelf(dynamic, context, flushBeforeDynamic) {
26630
26753
  const [frag, push] = buildCodeFragment();
26631
26754
  const { id, template, operation, hasDynamicChild } = dynamic;
26632
26755
  if (id !== void 0 && template !== void 0) {
@@ -26634,10 +26757,10 @@ function genSelf(dynamic, context) {
26634
26757
  push(...genDirectivesForElement(id, context));
26635
26758
  }
26636
26759
  if (operation) push(...genOperationWithInsertionState(operation, context));
26637
- if (hasDynamicChild) push(...genChildren(dynamic, context, push, `n${id}`));
26760
+ if (hasDynamicChild) push(...genChildren(dynamic, context, push, `n${id}`, flushBeforeDynamic));
26638
26761
  return frag;
26639
26762
  }
26640
- function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
26763
+ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`, flushBeforeDynamic) {
26641
26764
  const { helper } = context;
26642
26765
  const [frag, push] = buildCodeFragment();
26643
26766
  const { children } = dynamic;
@@ -26646,12 +26769,14 @@ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
26646
26769
  for (const [index, child] of children.entries()) {
26647
26770
  if (child.flags & 2) offset--;
26648
26771
  if (child.flags & 4 && child.template != null) {
26649
- push(...genSelf(child, context));
26772
+ flushBeforeDynamic && flushBeforeDynamic(child, push);
26773
+ push(...genSelf(child, context, flushBeforeDynamic));
26650
26774
  continue;
26651
26775
  }
26652
26776
  const id = child.flags & 1 ? child.flags & 4 ? child.anchor : child.id : void 0;
26653
26777
  if (id === void 0 && !child.hasDynamicChild) {
26654
- push(...genSelf(child, context));
26778
+ flushBeforeDynamic && flushBeforeDynamic(child, push);
26779
+ push(...genSelf(child, context, flushBeforeDynamic));
26655
26780
  continue;
26656
26781
  }
26657
26782
  const elementIndex = index + offset;
@@ -26667,10 +26792,13 @@ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
26667
26792
  else if (elementIndex > 1) init = genCall(helper("nthChild"), from, String(elementIndex), logicalIndex);
26668
26793
  pushBlock(...init);
26669
26794
  }
26670
- if (id === child.anchor && !child.hasDynamicChild) push(...genSelf(child, context));
26795
+ if (id === child.anchor && !child.hasDynamicChild) {
26796
+ flushBeforeDynamic && flushBeforeDynamic(child, push);
26797
+ push(...genSelf(child, context, flushBeforeDynamic));
26798
+ }
26671
26799
  if (id !== void 0) push(...genDirectivesForElement(id, context));
26672
26800
  prev = [variable, elementIndex];
26673
- push(...genChildren(child, context, pushBlock, variable));
26801
+ push(...genChildren(child, context, pushBlock, variable, flushBeforeDynamic));
26674
26802
  }
26675
26803
  return frag;
26676
26804
  }
@@ -26701,10 +26829,30 @@ function genBlockContent(block, context, root, genEffectsExtraFrag) {
26701
26829
  }
26702
26830
  genResolveAssets("directive", "resolveDirective");
26703
26831
  }
26704
- for (const child of dynamic.children) push(...genSelf(child, context));
26705
- for (const child of dynamic.children) if (!child.hasDynamicChild) push(...genChildren(child, context, push, `n${child.id}`));
26706
- push(...genOperations(operation, context));
26707
- push(...genEffects(effect, context, genEffectsExtraFrag));
26832
+ let operationIndex = 0;
26833
+ let effectIndex = 0;
26834
+ const flushPendingOperations = (operationEnd, effectEnd, push) => {
26835
+ while (operationIndex < operationEnd) {
26836
+ push(...genOperationWithInsertionState(operation[operationIndex], context));
26837
+ operationIndex++;
26838
+ }
26839
+ if (effectIndex < effectEnd) {
26840
+ push(...genEffects(effect.slice(effectIndex, effectEnd), context));
26841
+ effectIndex = effectEnd;
26842
+ }
26843
+ };
26844
+ const flushBeforeDynamic = (dynamic, push) => {
26845
+ const operation = dynamic.operation;
26846
+ if (operation && isBlockOperation(operation) && operation.operationIndex !== void 0 && operation.effectIndex !== void 0) flushPendingOperations(operation.operationIndex, operation.effectIndex, push);
26847
+ };
26848
+ for (const child of dynamic.children) {
26849
+ flushBeforeDynamic(child, push);
26850
+ push(...genSelf(child, context, flushBeforeDynamic));
26851
+ }
26852
+ for (const child of dynamic.children) if (!child.hasDynamicChild) push(...genChildren(child, context, push, `n${child.id}`, flushBeforeDynamic));
26853
+ if (operationIndex < operation.length) push(...genOperations(operation.slice(operationIndex), context));
26854
+ if (effectIndex < effect.length) push(...genEffects(effect.slice(effectIndex), context, genEffectsExtraFrag));
26855
+ else if (genEffectsExtraFrag) push(...genEffects([], context, genEffectsExtraFrag));
26708
26856
  push(NEWLINE, `return `);
26709
26857
  const returnNodes = returns.map((n) => `n${n}`);
26710
26858
  push(...returnNodes.length > 1 ? genMulti(DELIMITERS_ARRAY, ...returnNodes) : [returnNodes[0] || "null"]);
@@ -26790,7 +26938,7 @@ var CodegenContext = class {
26790
26938
  this.nextIdMap = /* @__PURE__ */ new Map();
26791
26939
  this.lastIdMap = /* @__PURE__ */ new Map();
26792
26940
  this.lastTIndex = -1;
26793
- this.options = extend({
26941
+ const defaultOptions = {
26794
26942
  mode: "module",
26795
26943
  prefixIdentifiers: true,
26796
26944
  sourceMap: false,
@@ -26805,7 +26953,8 @@ var CodegenContext = class {
26805
26953
  inline: false,
26806
26954
  bindingMetadata: {},
26807
26955
  expressionPlugins: []
26808
- }, options);
26956
+ };
26957
+ this.options = extend(defaultOptions, options);
26809
26958
  this.block = ir.block;
26810
26959
  this.bindingNames = new Set(this.options.bindingMetadata ? Object.keys(this.options.bindingMetadata) : []);
26811
26960
  this.initNextIdMap();
@@ -26826,7 +26975,7 @@ function generate(ir, options = {}) {
26826
26975
  push(INDENT_END, NEWLINE);
26827
26976
  if (!inline) push("}");
26828
26977
  const delegates = genDelegates(context);
26829
- const templates = genTemplates(ir.template, ir.rootTemplateIndexes, context);
26978
+ const templates = genTemplates(ir.template.entries, context);
26830
26979
  const preamble = genHelperImports(context) + genAssetImports(context) + templates + delegates;
26831
26980
  const newlineCount = [...preamble].filter((c) => c === "\n").length;
26832
26981
  if (newlineCount && !inline) frag.unshift(...new Array(newlineCount).fill(LF));
@@ -26858,79 +27007,6 @@ function genAssetImports({ ir }) {
26858
27007
  return imports;
26859
27008
  }
26860
27009
  //#endregion
26861
- //#region packages/compiler-vapor/src/transforms/transformChildren.ts
26862
- const transformChildren = (node, context) => {
26863
- const isFragment = node.type === 0 || node.type === 1 && (node.tagType === 3 || node.tagType === 1);
26864
- if (!isFragment && node.type !== 1) return;
26865
- for (const [i, child] of node.children.entries()) {
26866
- const childContext = context.create(child, i);
26867
- transformNode(childContext);
26868
- const childDynamic = childContext.dynamic;
26869
- if (isFragment) {
26870
- childContext.reference();
26871
- childContext.registerTemplate();
26872
- if (!(childDynamic.flags & 2) || childDynamic.flags & 4) context.block.returns.push(childContext.dynamic.id);
26873
- } else context.childrenTemplate.push(childContext.template);
26874
- if (childDynamic.hasDynamicChild || childDynamic.id !== void 0 || childDynamic.flags & 2 || childDynamic.flags & 4) context.dynamic.hasDynamicChild = true;
26875
- context.dynamic.children[i] = childDynamic;
26876
- }
26877
- if (!isFragment) processDynamicChildren(context);
26878
- };
26879
- function processDynamicChildren(context) {
26880
- let prevDynamics = [];
26881
- let staticCount = 0;
26882
- let dynamicCount = 0;
26883
- let lastInsertionChild;
26884
- const children = context.dynamic.children;
26885
- let logicalIndex = 0;
26886
- for (const [index, child] of children.entries()) {
26887
- if (child.flags & 4) {
26888
- child.logicalIndex = logicalIndex;
26889
- prevDynamics.push(lastInsertionChild = child);
26890
- logicalIndex++;
26891
- }
26892
- if (!(child.flags & 2)) {
26893
- child.logicalIndex = logicalIndex;
26894
- if (prevDynamics.length) {
26895
- if (staticCount) {
26896
- context.childrenTemplate[index - prevDynamics.length] = `<!>`;
26897
- prevDynamics[0].flags -= 2;
26898
- const anchor = prevDynamics[0].anchor = context.increaseId();
26899
- registerInsertion(prevDynamics, context, anchor);
26900
- } else registerInsertion(prevDynamics, context, -1);
26901
- dynamicCount += prevDynamics.length;
26902
- prevDynamics = [];
26903
- }
26904
- staticCount++;
26905
- logicalIndex++;
26906
- }
26907
- }
26908
- if (prevDynamics.length) registerInsertion(prevDynamics, context, dynamicCount + staticCount, true);
26909
- if (lastInsertionChild && lastInsertionChild.operation) lastInsertionChild.operation.last = true;
26910
- }
26911
- function registerInsertion(dynamics, context, anchor, append) {
26912
- for (const child of dynamics) {
26913
- const logicalIndex = child.logicalIndex;
26914
- if (child.template != null) context.registerOperation({
26915
- type: 10,
26916
- elements: dynamics.map((child) => child.id),
26917
- parent: context.reference(),
26918
- anchor: append ? void 0 : anchor
26919
- });
26920
- else if (child.operation && isBlockOperation(child.operation)) {
26921
- child.operation.parent = context.reference();
26922
- child.operation.anchor = anchor;
26923
- child.operation.logicalIndex = logicalIndex;
26924
- child.operation.append = append;
26925
- }
26926
- }
26927
- }
26928
- //#endregion
26929
- //#region packages/compiler-vapor/src/transforms/vOnce.ts
26930
- const transformVOnce = (node, context) => {
26931
- if (node.type === 1 && findDir$1(node, "once", true)) context.inVOnce = true;
26932
- };
26933
- //#endregion
26934
27010
  //#region packages/compiler-vapor/src/transforms/vBind.ts
26935
27011
  function normalizeBindShorthand(arg, context) {
26936
27012
  if (arg.type !== 4 || !arg.isStatic) {
@@ -26968,6 +27044,7 @@ const transformVBind = (dir, node, context) => {
26968
27044
  };
26969
27045
  //#endregion
26970
27046
  //#region packages/compiler-vapor/src/transforms/transformElement.ts
27047
+ init_objectSpread2();
26971
27048
  const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,");
26972
27049
  const transformElement = (node, context) => {
26973
27050
  let effectIndex = context.block.effect.length;
@@ -26980,13 +27057,13 @@ const transformElement = (node, context) => {
26980
27057
  return function postTransformElement() {
26981
27058
  ({node} = context);
26982
27059
  if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) return;
26983
- const isCustomElement = !!context.options.isCustomElement(node.tag);
26984
- const isComponent = node.tagType === 1 || isCustomElement;
27060
+ const useCreateElement = shouldUseCreateElement(node, context);
27061
+ const isComponent = node.tagType === 1 || useCreateElement;
26985
27062
  const isDynamicComponent = isComponentTag(node.tag);
26986
27063
  const staticKey = resolveStaticKey(node, context, isComponent);
26987
27064
  const propsResult = buildProps(node, context, isComponent, isDynamicComponent, getEffectIndex);
26988
27065
  const singleRoot = isSingleRoot(context);
26989
- if (isComponent) transformComponentElement(node, propsResult, staticKey, singleRoot, context, isDynamicComponent, isCustomElement);
27066
+ if (isComponent) transformComponentElement(node, propsResult, staticKey, singleRoot, context, isDynamicComponent, useCreateElement);
26990
27067
  else transformNativeElement(node, propsResult, staticKey, singleRoot, context, getEffectIndex, context.root === context.effectiveParent || canOmitEndTag(node, context));
26991
27068
  if (parentSlots) context.slots = parentSlots;
26992
27069
  };
@@ -27010,11 +27087,11 @@ function isSingleRoot(context) {
27010
27087
  }
27011
27088
  return context.root === parent;
27012
27089
  }
27013
- function transformComponentElement(node, propsResult, staticKey, singleRoot, context, isDynamicComponent, isCustomElement) {
27090
+ function transformComponentElement(node, propsResult, staticKey, singleRoot, context, isDynamicComponent, useCreateElement) {
27014
27091
  const dynamicComponent = isDynamicComponent ? resolveDynamicComponent(node) : void 0;
27015
27092
  let { tag } = node;
27016
27093
  let asset = true;
27017
- if (!dynamicComponent && !isCustomElement) {
27094
+ if (!dynamicComponent && !useCreateElement) {
27018
27095
  const fromSetup = resolveSetupReference(tag, context);
27019
27096
  if (fromSetup) {
27020
27097
  tag = fromSetup;
@@ -27040,9 +27117,10 @@ function transformComponentElement(node, propsResult, staticKey, singleRoot, con
27040
27117
  }
27041
27118
  context.dynamic.flags |= 6;
27042
27119
  const id = context.reference();
27043
- context.dynamic.operation = {
27120
+ context.dynamic.operation = _objectSpread2(_objectSpread2({
27044
27121
  type: 12,
27045
- id,
27122
+ id
27123
+ }, context.effectBoundary()), {}, {
27046
27124
  tag,
27047
27125
  props: propsResult[0] ? propsResult[1] : [propsResult[1]],
27048
27126
  asset,
@@ -27050,8 +27128,8 @@ function transformComponentElement(node, propsResult, staticKey, singleRoot, con
27050
27128
  slots: [...context.slots],
27051
27129
  once: context.inVOnce,
27052
27130
  dynamic: dynamicComponent,
27053
- isCustomElement
27054
- };
27131
+ useCreateElement
27132
+ });
27055
27133
  if (staticKey) context.registerOperation(createSetBlockKey(id, staticKey));
27056
27134
  context.slots = [];
27057
27135
  }
@@ -27112,7 +27190,7 @@ function transformNativeElement(node, propsResult, staticKey, singleRoot, contex
27112
27190
  }
27113
27191
  template += `>` + context.childrenTemplate.join("");
27114
27192
  if (!isVoidTag(tag) && !omitEndTag) template += `</${tag}>`;
27115
- if (singleRoot) context.ir.rootTemplateIndexes.add(context.ir.template.size);
27193
+ context.templateRoot = singleRoot;
27116
27194
  if (context.parent && context.parent.node.type === 1 && !isValidHTMLNesting(context.parent.node.tag, tag)) {
27117
27195
  context.reference();
27118
27196
  context.dynamic.template = context.pushTemplate(template);
@@ -27253,6 +27331,85 @@ function mergePropValues(existing, incoming) {
27253
27331
  function isComponentTag(tag) {
27254
27332
  return tag === "component" || tag === "Component";
27255
27333
  }
27334
+ function shouldUseCreateElement(node, context) {
27335
+ return context.options.isCustomElement(node.tag) || node.tagType === 0 && node.tag === "template";
27336
+ }
27337
+ //#endregion
27338
+ //#region packages/compiler-vapor/src/transforms/transformChildren.ts
27339
+ const transformChildren = (node, context) => {
27340
+ const isFragment = node.type === 0 || node.type === 1 && (node.tagType === 3 || node.tagType === 1);
27341
+ if (!isFragment && node.type !== 1) return;
27342
+ const useCreateElement = node.type === 1 && shouldUseCreateElement(node, context);
27343
+ for (const [i, child] of node.children.entries()) {
27344
+ const childContext = context.create(child, i);
27345
+ transformNode(childContext);
27346
+ const childDynamic = childContext.dynamic;
27347
+ if (isFragment) {
27348
+ childContext.reference();
27349
+ childContext.registerTemplate();
27350
+ if (!(childDynamic.flags & 2) || childDynamic.flags & 4) context.block.returns.push(childContext.dynamic.id);
27351
+ } else if (useCreateElement) {
27352
+ if (childContext.template !== "" || childDynamic.template != null || childDynamic.id !== void 0 || childDynamic.operation !== void 0 || childDynamic.hasDynamicChild === true) {
27353
+ childContext.reference();
27354
+ childContext.registerTemplate();
27355
+ childDynamic.flags |= 6;
27356
+ }
27357
+ } else context.childrenTemplate.push(childContext.template);
27358
+ if (childDynamic.hasDynamicChild || childDynamic.id !== void 0 || childDynamic.flags & 2 || childDynamic.flags & 4) context.dynamic.hasDynamicChild = true;
27359
+ context.dynamic.children[i] = childDynamic;
27360
+ }
27361
+ if (!isFragment) processDynamicChildren(context);
27362
+ };
27363
+ function processDynamicChildren(context) {
27364
+ let prevDynamics = [];
27365
+ let staticCount = 0;
27366
+ const children = context.dynamic.children;
27367
+ let logicalIndex = 0;
27368
+ for (const [index, child] of children.entries()) {
27369
+ if (child.flags & 4) {
27370
+ child.logicalIndex = logicalIndex;
27371
+ prevDynamics.push(child);
27372
+ logicalIndex++;
27373
+ }
27374
+ if (!(child.flags & 2)) {
27375
+ child.logicalIndex = logicalIndex;
27376
+ if (prevDynamics.length) {
27377
+ if (staticCount) {
27378
+ context.childrenTemplate[index - prevDynamics.length] = `<!>`;
27379
+ prevDynamics[0].flags -= 2;
27380
+ const anchor = prevDynamics[0].anchor = context.increaseId();
27381
+ registerInsertion(prevDynamics, context, anchor);
27382
+ } else registerInsertion(prevDynamics, context, -1);
27383
+ prevDynamics = [];
27384
+ }
27385
+ staticCount++;
27386
+ logicalIndex++;
27387
+ }
27388
+ }
27389
+ if (prevDynamics.length) registerInsertion(prevDynamics, context, prevDynamics[0].logicalIndex, true);
27390
+ }
27391
+ function registerInsertion(dynamics, context, anchor, append) {
27392
+ for (const child of dynamics) {
27393
+ const logicalIndex = child.logicalIndex;
27394
+ if (child.template != null) context.registerOperation({
27395
+ type: 10,
27396
+ elements: dynamics.map((child) => child.id),
27397
+ parent: context.reference(),
27398
+ anchor: append ? void 0 : anchor
27399
+ });
27400
+ else if (child.operation && isBlockOperation(child.operation)) {
27401
+ child.operation.parent = context.reference();
27402
+ child.operation.anchor = anchor;
27403
+ child.operation.logicalIndex = logicalIndex;
27404
+ child.operation.append = append;
27405
+ }
27406
+ }
27407
+ }
27408
+ //#endregion
27409
+ //#region packages/compiler-vapor/src/transforms/vOnce.ts
27410
+ const transformVOnce = (node, context) => {
27411
+ if (node.type === 1 && findDir$1(node, "once", true)) context.inVOnce = true;
27412
+ };
27256
27413
  //#endregion
27257
27414
  //#region packages/compiler-vapor/src/transforms/vHtml.ts
27258
27415
  const transformVHtml = (dir, node, context) => {
@@ -27273,6 +27430,141 @@ const transformVHtml = (dir, node, context) => {
27273
27430
  });
27274
27431
  };
27275
27432
  //#endregion
27433
+ //#region packages/compiler-vapor/src/transforms/transformText.ts
27434
+ const seen = /* @__PURE__ */ new WeakMap();
27435
+ function markNonTemplate(node, context) {
27436
+ let seenNodes = seen.get(context.root);
27437
+ if (!seenNodes) {
27438
+ seenNodes = /* @__PURE__ */ new WeakSet();
27439
+ seen.set(context.root, seenNodes);
27440
+ }
27441
+ seenNodes.add(node);
27442
+ }
27443
+ const transformText = (node, context) => {
27444
+ if (!seen.has(context.root)) seen.set(context.root, /* @__PURE__ */ new WeakSet());
27445
+ if (seen.get(context.root).has(node)) {
27446
+ context.dynamic.flags |= 2;
27447
+ return;
27448
+ }
27449
+ const isFragment = node.type === 0 || node.type === 1 && (node.tagType === 3 || node.tagType === 1);
27450
+ if ((isFragment || node.type === 1 && node.tagType === 0) && node.children.length) {
27451
+ let hasInterp = false;
27452
+ let isAllTextLike = true;
27453
+ for (const c of node.children) if (c.type === 5) hasInterp = true;
27454
+ else if (c.type !== 2) isAllTextLike = false;
27455
+ if (!isFragment && isAllTextLike && hasInterp) {
27456
+ const elementContext = context;
27457
+ if (shouldUseCreateElement(node, elementContext)) processCreateElementTextContainer(node.children, elementContext);
27458
+ else processTextContainer(node.children, elementContext);
27459
+ } else if (hasInterp) for (let i = 0; i < node.children.length; i++) {
27460
+ const c = node.children[i];
27461
+ const prev = node.children[i - 1];
27462
+ if (c.type === 5 && prev && prev.type === 2) markNonTemplate(prev, context);
27463
+ }
27464
+ } else if (node.type === 5) processInterpolation(context);
27465
+ else if (node.type === 2) {
27466
+ var _context$parent;
27467
+ const parent = (_context$parent = context.parent) === null || _context$parent === void 0 ? void 0 : _context$parent.node;
27468
+ if (parent && parent.type === 1 && shouldUseCreateElement(parent, context.parent) && node.content[0] === "<") {
27469
+ materializeLiteralTextNode(createSimpleExpression(node.content, true, node.loc), context);
27470
+ return;
27471
+ }
27472
+ const isRootText = !parent || parent.type === 0 || parent.type === 1 && (parent.tagType === 3 || parent.tagType === 1);
27473
+ context.template += isRootText ? node.content : escapeHtml(node.content);
27474
+ }
27475
+ };
27476
+ function processInterpolation(context) {
27477
+ const parentNode = context.parent.node;
27478
+ const children = parentNode.children;
27479
+ const nexts = children.slice(context.index);
27480
+ const idx = nexts.findIndex((n) => !isTextLike(n));
27481
+ const nodes = idx > -1 ? nexts.slice(0, idx) : nexts;
27482
+ const prev = children[context.index - 1];
27483
+ if (prev && prev.type === 2) nodes.unshift(prev);
27484
+ const values = processTextLikeChildren(nodes, context);
27485
+ if (values.length === 0 && parentNode.type !== 0) return;
27486
+ const literalValues = values.map((v) => getLiteralExpressionValue(v));
27487
+ if (literalValues.every((v) => v != null) && parentNode.type !== 0) {
27488
+ const text = literalValues.join("");
27489
+ if (parentNode.type === 1 && shouldUseCreateElement(parentNode, context.parent) && text[0] === "<") {
27490
+ materializeLiteralTextNode(createSimpleExpression(text, true, context.node.loc), context);
27491
+ return;
27492
+ }
27493
+ const isElementChild = parentNode.type === 1 && parentNode.tagType === 0;
27494
+ context.template += isElementChild ? escapeHtml(text) : text;
27495
+ return;
27496
+ }
27497
+ context.template += " ";
27498
+ const id = context.reference();
27499
+ if (values.length === 0) return;
27500
+ context.registerEffect(values, {
27501
+ type: 5,
27502
+ element: id,
27503
+ values
27504
+ });
27505
+ }
27506
+ function processTextContainer(children, context) {
27507
+ const values = processTextLikeChildren(children, context);
27508
+ const literals = values.map((value) => getLiteralExpressionValue(value));
27509
+ if (literals.every((l) => l != null)) context.childrenTemplate = literals.map((l) => escapeHtml(String(l)));
27510
+ else {
27511
+ context.childrenTemplate = [" "];
27512
+ context.registerOperation({
27513
+ type: 18,
27514
+ parent: context.reference()
27515
+ });
27516
+ context.registerEffect(values, {
27517
+ type: 5,
27518
+ element: context.reference(),
27519
+ values,
27520
+ generated: true
27521
+ });
27522
+ }
27523
+ }
27524
+ function registerSyntheticTextChild(context, template, values) {
27525
+ const id = context.increaseId();
27526
+ context.dynamic.children[context.node.children.length] = {
27527
+ id,
27528
+ flags: 6,
27529
+ children: [],
27530
+ template: context.pushTemplate(template)
27531
+ };
27532
+ context.dynamic.hasDynamicChild = true;
27533
+ if (values && values.length) context.registerEffect(values, {
27534
+ type: 5,
27535
+ element: id,
27536
+ values
27537
+ });
27538
+ return id;
27539
+ }
27540
+ function processCreateElementTextContainer(children, context) {
27541
+ registerSyntheticTextChild(context, "", processTextLikeChildren(children, context));
27542
+ }
27543
+ function materializeLiteralTextNode(value, context) {
27544
+ const id = context.reference();
27545
+ context.dynamic.flags |= 6;
27546
+ context.dynamic.template = context.pushTemplate("");
27547
+ context.registerEffect([value], {
27548
+ type: 5,
27549
+ element: id,
27550
+ values: [value]
27551
+ });
27552
+ }
27553
+ function processTextLikeChildren(nodes, context) {
27554
+ const exps = [];
27555
+ for (const node of nodes) {
27556
+ let exp;
27557
+ markNonTemplate(node, context);
27558
+ if (node.type === 2) exp = createSimpleExpression(node.content, true, node.loc);
27559
+ else exp = node.content;
27560
+ if (exp.content) exps.push(exp);
27561
+ }
27562
+ return exps;
27563
+ }
27564
+ function isTextLike(node) {
27565
+ return node.type === 5 || node.type === 2;
27566
+ }
27567
+ //#endregion
27276
27568
  //#region packages/compiler-vapor/src/transforms/vText.ts
27277
27569
  const transformVText = (dir, node, context) => {
27278
27570
  let { exp, loc } = dir;
@@ -27283,22 +27575,41 @@ const transformVText = (dir, node, context) => {
27283
27575
  if (node.children.length) {
27284
27576
  context.options.onError(createDOMCompilerError(57, loc));
27285
27577
  context.childrenTemplate.length = 0;
27578
+ for (const child of node.children) markNonTemplate(child, context);
27286
27579
  }
27287
27580
  if (isVoidTag(context.node.tag)) return;
27288
27581
  const literal = getLiteralExpressionValue(exp);
27289
- if (literal != null) context.childrenTemplate = [String(literal)];
27290
- else {
27291
- context.childrenTemplate = [" "];
27292
- const isComponent = node.tagType === 1;
27293
- if (!isComponent) context.registerOperation({
27294
- type: 18,
27582
+ const useCreateElement = shouldUseCreateElement(context.node, context);
27583
+ if (literal != null) if (useCreateElement) {
27584
+ const id = registerSyntheticTextChild(context, "", [exp]);
27585
+ context.registerOperation({
27586
+ type: 10,
27587
+ elements: [id],
27295
27588
  parent: context.reference()
27296
27589
  });
27590
+ } else context.childrenTemplate = [String(literal)];
27591
+ else {
27592
+ const isComponent = node.tagType === 1;
27593
+ let id;
27594
+ if (useCreateElement) {
27595
+ id = registerSyntheticTextChild(context, "");
27596
+ context.registerOperation({
27597
+ type: 10,
27598
+ elements: [id],
27599
+ parent: context.reference()
27600
+ });
27601
+ } else if (!isComponent) {
27602
+ context.childrenTemplate = [" "];
27603
+ context.registerOperation({
27604
+ type: 18,
27605
+ parent: context.reference()
27606
+ });
27607
+ }
27297
27608
  context.registerEffect([exp], {
27298
27609
  type: 5,
27299
- element: context.reference(),
27610
+ element: useCreateElement ? id : context.reference(),
27300
27611
  values: [exp],
27301
- generated: true,
27612
+ generated: !useCreateElement,
27302
27613
  isComponent
27303
27614
  });
27304
27615
  }
@@ -27312,6 +27623,7 @@ const transformVOn = (dir, node, context) => {
27312
27623
  const isSlotOutlet = node.tag === "slot";
27313
27624
  if (!exp && !modifiers.length) context.options.onError(createCompilerError(35, loc));
27314
27625
  arg = resolveExpression(arg);
27626
+ if (arg.isStatic && arg.content.startsWith("vue:")) arg = extend({}, arg, { content: `vnode-${arg.content.slice(4)}` });
27315
27627
  const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(arg.isStatic ? `on${arg.content}` : arg, modifiers, null, loc);
27316
27628
  let keyOverride;
27317
27629
  const isStaticClick = arg.isStatic && arg.content.toLowerCase() === "click";
@@ -27411,96 +27723,6 @@ const transformTemplateRef = (node, context) => {
27411
27723
  };
27412
27724
  };
27413
27725
  //#endregion
27414
- //#region packages/compiler-vapor/src/transforms/transformText.ts
27415
- const seen = /* @__PURE__ */ new WeakMap();
27416
- function markNonTemplate(node, context) {
27417
- seen.get(context.root).add(node);
27418
- }
27419
- const transformText = (node, context) => {
27420
- if (!seen.has(context.root)) seen.set(context.root, /* @__PURE__ */ new WeakSet());
27421
- if (seen.get(context.root).has(node)) {
27422
- context.dynamic.flags |= 2;
27423
- return;
27424
- }
27425
- const isFragment = node.type === 0 || node.type === 1 && (node.tagType === 3 || node.tagType === 1);
27426
- if ((isFragment || node.type === 1 && node.tagType === 0) && node.children.length) {
27427
- let hasInterp = false;
27428
- let isAllTextLike = true;
27429
- for (const c of node.children) if (c.type === 5) hasInterp = true;
27430
- else if (c.type !== 2) isAllTextLike = false;
27431
- if (!isFragment && isAllTextLike && hasInterp) processTextContainer(node.children, context);
27432
- else if (hasInterp) for (let i = 0; i < node.children.length; i++) {
27433
- const c = node.children[i];
27434
- const prev = node.children[i - 1];
27435
- if (c.type === 5 && prev && prev.type === 2) markNonTemplate(prev, context);
27436
- }
27437
- } else if (node.type === 5) processInterpolation(context);
27438
- else if (node.type === 2) {
27439
- var _context$parent;
27440
- const parent = (_context$parent = context.parent) === null || _context$parent === void 0 ? void 0 : _context$parent.node;
27441
- const isRootText = !parent || parent.type === 0 || parent.type === 1 && (parent.tagType === 3 || parent.tagType === 1);
27442
- context.template += isRootText ? node.content : escapeHtml(node.content);
27443
- }
27444
- };
27445
- function processInterpolation(context) {
27446
- const parentNode = context.parent.node;
27447
- const children = parentNode.children;
27448
- const nexts = children.slice(context.index);
27449
- const idx = nexts.findIndex((n) => !isTextLike(n));
27450
- const nodes = idx > -1 ? nexts.slice(0, idx) : nexts;
27451
- const prev = children[context.index - 1];
27452
- if (prev && prev.type === 2) nodes.unshift(prev);
27453
- const values = processTextLikeChildren(nodes, context);
27454
- if (values.length === 0 && parentNode.type !== 0) return;
27455
- const literalValues = values.map((v) => getLiteralExpressionValue(v));
27456
- if (literalValues.every((v) => v != null) && parentNode.type !== 0) {
27457
- const text = literalValues.join("");
27458
- const isElementChild = parentNode.type === 1 && parentNode.tagType === 0;
27459
- context.template += isElementChild ? escapeHtml(text) : text;
27460
- return;
27461
- }
27462
- context.template += " ";
27463
- const id = context.reference();
27464
- if (values.length === 0) return;
27465
- context.registerEffect(values, {
27466
- type: 5,
27467
- element: id,
27468
- values
27469
- });
27470
- }
27471
- function processTextContainer(children, context) {
27472
- const values = processTextLikeChildren(children, context);
27473
- const literals = values.map((value) => getLiteralExpressionValue(value));
27474
- if (literals.every((l) => l != null)) context.childrenTemplate = literals.map((l) => escapeHtml(String(l)));
27475
- else {
27476
- context.childrenTemplate = [" "];
27477
- context.registerOperation({
27478
- type: 18,
27479
- parent: context.reference()
27480
- });
27481
- context.registerEffect(values, {
27482
- type: 5,
27483
- element: context.reference(),
27484
- values,
27485
- generated: true
27486
- });
27487
- }
27488
- }
27489
- function processTextLikeChildren(nodes, context) {
27490
- const exps = [];
27491
- for (const node of nodes) {
27492
- let exp;
27493
- markNonTemplate(node, context);
27494
- if (node.type === 2) exp = createSimpleExpression(node.content, true, node.loc);
27495
- else exp = node.content;
27496
- if (exp.content) exps.push(exp);
27497
- }
27498
- return exps;
27499
- }
27500
- function isTextLike(node) {
27501
- return node.type === 5 || node.type === 2;
27502
- }
27503
- //#endregion
27504
27726
  //#region packages/compiler-vapor/src/transforms/vModel.ts
27505
27727
  const transformVModel = (dir, node, context) => {
27506
27728
  const { exp, arg } = dir;
@@ -27598,6 +27820,7 @@ function getSiblingIf(context, reverse) {
27598
27820
  }
27599
27821
  //#endregion
27600
27822
  //#region packages/compiler-vapor/src/transforms/vIf.ts
27823
+ init_objectSpread2();
27601
27824
  const transformVIf = createStructuralDirectiveTransform([
27602
27825
  "if",
27603
27826
  "else",
@@ -27617,15 +27840,16 @@ function processIf(node, dir, context) {
27617
27840
  const [branch, onExit] = createIfBranch(node, context);
27618
27841
  return () => {
27619
27842
  onExit();
27620
- context.dynamic.operation = {
27843
+ context.dynamic.operation = _objectSpread2(_objectSpread2({
27621
27844
  type: 15,
27622
- id,
27845
+ id
27846
+ }, context.effectBoundary()), {}, {
27623
27847
  blockShape: encodeIfBlockShape(branch, forceMultiRoot),
27624
27848
  condition: dir.exp,
27625
27849
  positive: branch,
27626
27850
  index: context.root.nextIfIndex(),
27627
27851
  once: context.inVOnce || isStaticExpression(dir.exp, context.options.bindingMetadata)
27628
- };
27852
+ });
27629
27853
  };
27630
27854
  } else {
27631
27855
  const siblingIf = getSiblingIf(context, true);
@@ -27692,6 +27916,7 @@ function shouldForceMultiRoot(context) {
27692
27916
  }
27693
27917
  //#endregion
27694
27918
  //#region packages/compiler-vapor/src/transforms/vFor.ts
27919
+ init_objectSpread2();
27695
27920
  const transformVFor = createStructuralDirectiveTransform("for", processFor);
27696
27921
  function processFor(node, dir, context) {
27697
27922
  if (!dir.exp) {
@@ -27717,9 +27942,10 @@ function processFor(node, dir, context) {
27717
27942
  exitBlock();
27718
27943
  const { parent } = context;
27719
27944
  const isOnlyChild = parent && parent.block.node !== parent.node && parent.node.children.length === 1;
27720
- context.dynamic.operation = {
27945
+ context.dynamic.operation = _objectSpread2(_objectSpread2({
27721
27946
  type: 16,
27722
- id,
27947
+ id
27948
+ }, context.effectBoundary()), {}, {
27723
27949
  source,
27724
27950
  value,
27725
27951
  key,
@@ -27729,7 +27955,7 @@ function processFor(node, dir, context) {
27729
27955
  once: context.inVOnce || isStaticExpression(source, context.options.bindingMetadata),
27730
27956
  component: isComponent,
27731
27957
  onlyChild: !!isOnlyChild
27732
- };
27958
+ });
27733
27959
  };
27734
27960
  }
27735
27961
  function isTemplateWithSingleComponent(node) {
@@ -27739,6 +27965,7 @@ function isTemplateWithSingleComponent(node) {
27739
27965
  }
27740
27966
  //#endregion
27741
27967
  //#region packages/compiler-vapor/src/transforms/transformSlotOutlet.ts
27968
+ init_objectSpread2();
27742
27969
  const transformSlotOutlet = (node, context) => {
27743
27970
  if (node.type !== 1 || node.tag !== "slot") return;
27744
27971
  const id = context.reference();
@@ -27769,15 +27996,16 @@ const transformSlotOutlet = (node, context) => {
27769
27996
  }
27770
27997
  return () => {
27771
27998
  exitBlock && exitBlock();
27772
- context.dynamic.operation = {
27999
+ context.dynamic.operation = _objectSpread2(_objectSpread2({
27773
28000
  type: 13,
27774
- id,
28001
+ id
28002
+ }, context.effectBoundary()), {}, {
27775
28003
  name: slotName,
27776
28004
  props: irProps,
27777
28005
  fallback,
27778
28006
  noSlotted: !!(context.options.scopeId && !context.options.slotted),
27779
28007
  once: context.inVOnce
27780
- };
28008
+ });
27781
28009
  };
27782
28010
  };
27783
28011
  function createFallback(node, context) {
@@ -27954,6 +28182,7 @@ function hasMultipleChildren(node) {
27954
28182
  }
27955
28183
  //#endregion
27956
28184
  //#region packages/compiler-vapor/src/transforms/transformKey.ts
28185
+ init_objectSpread2();
27957
28186
  const transformKey = (node, context) => {
27958
28187
  if (node.type !== 1 || context.inVOnce || findDir(node, "for")) return;
27959
28188
  const dir = findProp(node, "key", true, true);
@@ -27968,12 +28197,13 @@ const transformKey = (node, context) => {
27968
28197
  const exitBlock = context.enterBlock(block);
27969
28198
  return () => {
27970
28199
  exitBlock();
27971
- context.dynamic.operation = {
28200
+ context.dynamic.operation = _objectSpread2(_objectSpread2({
27972
28201
  type: 17,
27973
- id,
28202
+ id
28203
+ }, context.effectBoundary()), {}, {
27974
28204
  value,
27975
28205
  block
27976
- };
28206
+ });
27977
28207
  };
27978
28208
  };
27979
28209
  //#endregion
@@ -28040,6 +28270,7 @@ var src_exports$1 = /* @__PURE__ */ __exportAll({
28040
28270
  IRDynamicPropsKind: () => IRDynamicPropsKind,
28041
28271
  IRNodeTypes: () => IRNodeTypes,
28042
28272
  IRSlotType: () => IRSlotType,
28273
+ TemplateRegistry: () => TemplateRegistry,
28043
28274
  VaporErrorCodes: () => VaporErrorCodes,
28044
28275
  VaporErrorMessages: () => VaporErrorMessages,
28045
28276
  buildCodeFragment: () => buildCodeFragment,
@@ -28605,6 +28836,8 @@ function subTransform(node, options, parentContext) {
28605
28836
  childContext.ssr = false;
28606
28837
  childContext.scopes = _objectSpread2({}, parentContext.scopes);
28607
28838
  childContext.identifiers = _objectSpread2({}, parentContext.identifiers);
28839
+ childContext.identifierScopes = Object.create(null);
28840
+ for (const name in parentContext.identifierScopes) childContext.identifierScopes[name] = parentContext.identifierScopes[name].slice();
28608
28841
  childContext.imports = parentContext.imports;
28609
28842
  traverseNode(childRoot, childContext);
28610
28843
  [
@@ -28999,6 +29232,7 @@ function doCompileTemplate({ filename, id, scoped, slotted, inMap, source, ast:
28999
29232
  slotted,
29000
29233
  sourceMap: true
29001
29234
  }, compilerOptions), {}, {
29235
+ bindingMetadata: vapor && !ssr && compilerOptions.bindingMetadata == null ? {} : compilerOptions.bindingMetadata,
29002
29236
  hmr: !isProd,
29003
29237
  nodeTransforms: nodeTransforms.concat(compilerOptions.nodeTransforms || []),
29004
29238
  filename,
@@ -29131,10 +29365,10 @@ var require_picocolors_browser = /* @__PURE__ */ __commonJSMin(((exports, module
29131
29365
  module.exports.createColors = create;
29132
29366
  }));
29133
29367
  //#endregion
29134
- //#region (ignored) node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/terminal-highlight
29368
+ //#region (ignored) node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/terminal-highlight
29135
29369
  var require_terminal_highlight = /* @__PURE__ */ __commonJSMin((() => {}));
29136
29370
  //#endregion
29137
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/css-syntax-error.js
29371
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/css-syntax-error.js
29138
29372
  var require_css_syntax_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29139
29373
  let pico = require_picocolors_browser();
29140
29374
  let terminalHighlight = require_terminal_highlight();
@@ -29209,8 +29443,15 @@ var require_css_syntax_error = /* @__PURE__ */ __commonJSMin(((exports, module)
29209
29443
  CssSyntaxError.default = CssSyntaxError;
29210
29444
  }));
29211
29445
  //#endregion
29212
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/stringifier.js
29446
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/stringifier.js
29213
29447
  var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29448
+ const STYLE_TAG = /(<)(\/?style\b)/gi;
29449
+ const COMMENT_OPEN = /(<)(!--)/g;
29450
+ function escapeHTMLInCSS(str) {
29451
+ if (typeof str !== "string") return str;
29452
+ if (!str.includes("<")) return str;
29453
+ return str.replace(STYLE_TAG, "\\3c $2").replace(COMMENT_OPEN, "\\3c $2");
29454
+ }
29214
29455
  const DEFAULT_RAW = {
29215
29456
  after: "\n",
29216
29457
  beforeClose: "\n",
@@ -29233,14 +29474,15 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29233
29474
  this.builder = builder;
29234
29475
  }
29235
29476
  atrule(node, semicolon) {
29477
+ let raws = node.raws;
29236
29478
  let name = "@" + node.name;
29237
29479
  let params = node.params ? this.rawValue(node, "params") : "";
29238
- if (typeof node.raws.afterName !== "undefined") name += node.raws.afterName;
29480
+ if (typeof raws.afterName !== "undefined") name += raws.afterName;
29239
29481
  else if (params) name += " ";
29240
29482
  if (node.nodes) this.block(node, name + params);
29241
29483
  else {
29242
- let end = (node.raws.between || "") + (semicolon ? ";" : "");
29243
- this.builder(name + params + end, node);
29484
+ let end = (raws.between || "") + (semicolon ? ";" : "");
29485
+ this.builder(escapeHTMLInCSS(name + params + end), node);
29244
29486
  }
29245
29487
  }
29246
29488
  beforeAfter(node, detect) {
@@ -29263,40 +29505,43 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29263
29505
  }
29264
29506
  block(node, start) {
29265
29507
  let between = this.raw(node, "between", "beforeOpen");
29266
- this.builder(start + between + "{", node, "start");
29508
+ this.builder(escapeHTMLInCSS(start + between) + "{", node, "start");
29267
29509
  let after;
29268
29510
  if (node.nodes && node.nodes.length) {
29269
29511
  this.body(node);
29270
29512
  after = this.raw(node, "after");
29271
29513
  } else after = this.raw(node, "after", "emptyBody");
29272
- if (after) this.builder(after);
29514
+ if (after) this.builder(escapeHTMLInCSS(after));
29273
29515
  this.builder("}", node, "end");
29274
29516
  }
29275
29517
  body(node) {
29276
- let last = node.nodes.length - 1;
29518
+ let nodes = node.nodes;
29519
+ let last = nodes.length - 1;
29277
29520
  while (last > 0) {
29278
- if (node.nodes[last].type !== "comment") break;
29521
+ if (nodes[last].type !== "comment") break;
29279
29522
  last -= 1;
29280
29523
  }
29281
29524
  let semicolon = this.raw(node, "semicolon");
29282
- for (let i = 0; i < node.nodes.length; i++) {
29283
- let child = node.nodes[i];
29525
+ let isDocument = node.type === "document";
29526
+ for (let i = 0; i < nodes.length; i++) {
29527
+ let child = nodes[i];
29284
29528
  let before = this.raw(child, "before");
29285
- if (before) this.builder(before);
29529
+ if (before) this.builder(isDocument ? before : escapeHTMLInCSS(before));
29286
29530
  this.stringify(child, last !== i || semicolon);
29287
29531
  }
29288
29532
  }
29289
29533
  comment(node) {
29290
29534
  let left = this.raw(node, "left", "commentLeft");
29291
29535
  let right = this.raw(node, "right", "commentRight");
29292
- this.builder("/*" + left + node.text + right + "*/", node);
29536
+ this.builder(escapeHTMLInCSS("/*" + left + node.text + right + "*/"), node);
29293
29537
  }
29294
29538
  decl(node, semicolon) {
29539
+ let raws = node.raws;
29295
29540
  let between = this.raw(node, "between", "colon");
29296
29541
  let string = node.prop + between + this.rawValue(node, "value");
29297
- if (node.important) string += node.raws.important || " !important";
29542
+ if (node.important) string += raws.important || " !important";
29298
29543
  if (semicolon) string += ";";
29299
- this.builder(string, node);
29544
+ this.builder(escapeHTMLInCSS(string), node);
29300
29545
  }
29301
29546
  document(node) {
29302
29547
  this.body(node);
@@ -29315,8 +29560,8 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29315
29560
  }
29316
29561
  if (!parent) return DEFAULT_RAW[detect];
29317
29562
  let root = node.root();
29318
- if (!root.rawCache) root.rawCache = {};
29319
- if (typeof root.rawCache[detect] !== "undefined") return root.rawCache[detect];
29563
+ let cache = root.rawCache || (root.rawCache = {});
29564
+ if (typeof cache[detect] !== "undefined") return cache[detect];
29320
29565
  if (detect === "before" || detect === "after") return this.beforeAfter(node, detect);
29321
29566
  else {
29322
29567
  let method = "raw" + capitalize(detect);
@@ -29327,7 +29572,7 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29327
29572
  });
29328
29573
  }
29329
29574
  if (typeof value === "undefined") value = DEFAULT_RAW[detect];
29330
- root.rawCache[detect] = value;
29575
+ cache[detect] = value;
29331
29576
  return value;
29332
29577
  }
29333
29578
  rawBeforeClose(root) {
@@ -29448,11 +29693,15 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29448
29693
  }
29449
29694
  root(node) {
29450
29695
  this.body(node);
29451
- if (node.raws.after) this.builder(node.raws.after);
29696
+ if (node.raws.after) {
29697
+ let after = node.raws.after;
29698
+ let isDocument = node.parent && node.parent.type === "document";
29699
+ this.builder(isDocument ? after : escapeHTMLInCSS(after));
29700
+ }
29452
29701
  }
29453
29702
  rule(node) {
29454
29703
  this.block(node, this.rawValue(node, "selector"));
29455
- if (node.raws.ownSemicolon) this.builder(node.raws.ownSemicolon, node, "end");
29704
+ if (node.raws.ownSemicolon) this.builder(escapeHTMLInCSS(node.raws.ownSemicolon), node, "end");
29456
29705
  }
29457
29706
  stringify(node, semicolon) {
29458
29707
  /* c8 ignore start */
@@ -29465,7 +29714,7 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29465
29714
  Stringifier.default = Stringifier;
29466
29715
  }));
29467
29716
  //#endregion
29468
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/stringify.js
29717
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/stringify.js
29469
29718
  var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29470
29719
  let Stringifier = require_stringifier();
29471
29720
  function stringify(node, builder) {
@@ -29475,13 +29724,13 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29475
29724
  stringify.default = stringify;
29476
29725
  }));
29477
29726
  //#endregion
29478
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/symbols.js
29727
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/symbols.js
29479
29728
  var require_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29480
29729
  module.exports.isClean = Symbol("isClean");
29481
29730
  module.exports.my = Symbol("my");
29482
29731
  }));
29483
29732
  //#endregion
29484
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/node.js
29733
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/node.js
29485
29734
  var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29486
29735
  let CssSyntaxError = require_css_syntax_error();
29487
29736
  let Stringifier = require_stringifier();
@@ -29782,7 +30031,7 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29782
30031
  Node.default = Node;
29783
30032
  }));
29784
30033
  //#endregion
29785
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/comment.js
30034
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/comment.js
29786
30035
  var require_comment$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29787
30036
  let Node = require_node$1();
29788
30037
  var Comment = class extends Node {
@@ -29795,7 +30044,7 @@ var require_comment$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29795
30044
  Comment.default = Comment;
29796
30045
  }));
29797
30046
  //#endregion
29798
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/declaration.js
30047
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/declaration.js
29799
30048
  var require_declaration = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29800
30049
  init_objectSpread2();
29801
30050
  let Node = require_node$1();
@@ -29813,7 +30062,7 @@ var require_declaration = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29813
30062
  Declaration.default = Declaration;
29814
30063
  }));
29815
30064
  //#endregion
29816
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/container.js
30065
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/container.js
29817
30066
  var require_container$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
29818
30067
  let Comment = require_comment$1();
29819
30068
  let Declaration = require_declaration();
@@ -30105,7 +30354,7 @@ var require_container$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30105
30354
  }));
30106
30355
  /* c8 ignore stop */
30107
30356
  //#endregion
30108
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/at-rule.js
30357
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/at-rule.js
30109
30358
  var require_at_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30110
30359
  let Container = require_container$1();
30111
30360
  var AtRule = class extends Container {
@@ -30127,7 +30376,7 @@ var require_at_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30127
30376
  Container.registerAtRule(AtRule);
30128
30377
  }));
30129
30378
  //#endregion
30130
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/document.js
30379
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/document.js
30131
30380
  var require_document = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30132
30381
  init_objectSpread2();
30133
30382
  let Container = require_container$1();
@@ -30151,7 +30400,7 @@ var require_document = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30151
30400
  Document.default = Document;
30152
30401
  }));
30153
30402
  //#endregion
30154
- //#region \0@oxc-project+runtime@0.124.0/helpers/objectWithoutPropertiesLoose.js
30403
+ //#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutPropertiesLoose.js
30155
30404
  function _objectWithoutPropertiesLoose(r, e) {
30156
30405
  if (null == r) return {};
30157
30406
  var t = {};
@@ -30163,7 +30412,7 @@ function _objectWithoutPropertiesLoose(r, e) {
30163
30412
  }
30164
30413
  var init_objectWithoutPropertiesLoose = __esmMin((() => {}));
30165
30414
  //#endregion
30166
- //#region \0@oxc-project+runtime@0.124.0/helpers/objectWithoutProperties.js
30415
+ //#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutProperties.js
30167
30416
  function _objectWithoutProperties(e, t) {
30168
30417
  if (null == e) return {};
30169
30418
  var o, r, i = _objectWithoutPropertiesLoose(e, t);
@@ -30177,7 +30426,7 @@ var init_objectWithoutProperties = __esmMin((() => {
30177
30426
  init_objectWithoutPropertiesLoose();
30178
30427
  }));
30179
30428
  //#endregion
30180
- //#region node_modules/.pnpm/nanoid@3.3.11/node_modules/nanoid/non-secure/index.cjs
30429
+ //#region node_modules/.pnpm/nanoid@3.3.12/node_modules/nanoid/non-secure/index.cjs
30181
30430
  var require_non_secure = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30182
30431
  let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
30183
30432
  let customAlphabet = (alphabet, defaultSize = 21) => {
@@ -30200,10 +30449,10 @@ var require_non_secure = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30200
30449
  };
30201
30450
  }));
30202
30451
  //#endregion
30203
- //#region (ignored) node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib
30452
+ //#region (ignored) node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib
30204
30453
  var require_lib = /* @__PURE__ */ __commonJSMin((() => {}));
30205
30454
  //#endregion
30206
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/previous-map.js
30455
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/previous-map.js
30207
30456
  var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30208
30457
  init__polyfill_node_buffer();
30209
30458
  let { existsSync, readFileSync } = (init__polyfill_node_fs(), __toCommonJS(_polyfill_node_fs_exports));
@@ -30218,6 +30467,7 @@ var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30218
30467
  var PreviousMap = class {
30219
30468
  constructor(css, opts) {
30220
30469
  if (opts.map === false) return;
30470
+ if (opts.unsafeMap) this.unsafeMap = true;
30221
30471
  this.loadAnnotation(css);
30222
30472
  this.inline = this.startWith(this.annotation, "data:");
30223
30473
  let prev = opts.map ? opts.map.prev : void 0;
@@ -30227,7 +30477,7 @@ var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30227
30477
  if (text) this.text = text;
30228
30478
  }
30229
30479
  consumer() {
30230
- if (!this.consumerCache) this.consumerCache = new SourceMapConsumer(this.text);
30480
+ if (!this.consumerCache) this.consumerCache = new SourceMapConsumer(this.json || this.text);
30231
30481
  return this.consumerCache;
30232
30482
  }
30233
30483
  decodeInline(text) {
@@ -30255,7 +30505,11 @@ var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30255
30505
  let end = css.indexOf("*/", start);
30256
30506
  if (start > -1 && end > -1) this.annotation = this.getAnnotationURL(css.substring(start, end));
30257
30507
  }
30258
- loadFile(path) {
30508
+ loadFile(path, cssFile, trusted) {
30509
+ /* c8 ignore next 5 */
30510
+ if (!trusted && !this.unsafeMap) {
30511
+ if (!/\.map$/i.test(path)) return;
30512
+ }
30259
30513
  this.root = dirname(path);
30260
30514
  if (existsSync(path)) {
30261
30515
  this.mapFile = path;
@@ -30268,7 +30522,7 @@ var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30268
30522
  else if (typeof prev === "function") {
30269
30523
  let prevPath = prev(file);
30270
30524
  if (prevPath) {
30271
- let map = this.loadFile(prevPath);
30525
+ let map = this.loadFile(prevPath, file, true);
30272
30526
  if (!map) throw new Error("Unable to load previous source map: " + prevPath.toString());
30273
30527
  return map;
30274
30528
  }
@@ -30280,7 +30534,14 @@ var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30280
30534
  else if (this.annotation) {
30281
30535
  let map = this.annotation;
30282
30536
  if (file) map = join(dirname(file), map);
30283
- return this.loadFile(map);
30537
+ let unknown = this.loadFile(map, file, false);
30538
+ if (unknown) try {
30539
+ /* c8 ignore next 4 */
30540
+ this.json = JSON.parse(unknown.replace(/^\)]}'[^\n]*\n/, ""));
30541
+ } catch (_unused) {
30542
+ return;
30543
+ }
30544
+ return unknown;
30284
30545
  }
30285
30546
  }
30286
30547
  startWith(string, start) {
@@ -30295,7 +30556,7 @@ var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30295
30556
  PreviousMap.default = PreviousMap;
30296
30557
  }));
30297
30558
  //#endregion
30298
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/input.js
30559
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/input.js
30299
30560
  var require_input = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30300
30561
  init_objectSpread2();
30301
30562
  let { nanoid } = require_non_secure();
@@ -30488,7 +30749,7 @@ var require_input = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30488
30749
  if (terminalHighlight && terminalHighlight.registerInput) terminalHighlight.registerInput(Input);
30489
30750
  }));
30490
30751
  //#endregion
30491
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/root.js
30752
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/root.js
30492
30753
  var require_root$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30493
30754
  let Container = require_container$1();
30494
30755
  let LazyResult, Processor;
@@ -30527,7 +30788,7 @@ var require_root$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30527
30788
  Container.registerRoot(Root);
30528
30789
  }));
30529
30790
  //#endregion
30530
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/list.js
30791
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/list.js
30531
30792
  var require_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30532
30793
  let list = {
30533
30794
  comma(string) {
@@ -30576,7 +30837,7 @@ var require_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30576
30837
  list.default = list;
30577
30838
  }));
30578
30839
  //#endregion
30579
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/rule.js
30840
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/rule.js
30580
30841
  var require_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30581
30842
  let Container = require_container$1();
30582
30843
  let list = require_list();
@@ -30600,7 +30861,7 @@ var require_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30600
30861
  Container.registerRule(Rule);
30601
30862
  }));
30602
30863
  //#endregion
30603
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/fromJSON.js
30864
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/fromJSON.js
30604
30865
  var require_fromJSON = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30605
30866
  init_objectWithoutProperties();
30606
30867
  init_objectSpread2();
@@ -30640,7 +30901,7 @@ var require_fromJSON = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30640
30901
  fromJSON.default = fromJSON;
30641
30902
  }));
30642
30903
  //#endregion
30643
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/map-generator.js
30904
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/map-generator.js
30644
30905
  var require_map_generator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30645
30906
  init__polyfill_node_buffer();
30646
30907
  let { dirname, relative, resolve, sep } = (init__polyfill_node_path(), __toCommonJS(_polyfill_node_path_exports));
@@ -30909,7 +31170,7 @@ var require_map_generator = /* @__PURE__ */ __commonJSMin(((exports, module) =>
30909
31170
  module.exports = MapGenerator;
30910
31171
  }));
30911
31172
  //#endregion
30912
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/tokenize.js
31173
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/tokenize.js
30913
31174
  var require_tokenize$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30914
31175
  const SINGLE_QUOTE = "'".charCodeAt(0);
30915
31176
  const DOUBLE_QUOTE = "\"".charCodeAt(0);
@@ -30943,6 +31204,7 @@ var require_tokenize$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
30943
31204
  let pos = 0;
30944
31205
  let buffer = [];
30945
31206
  let returned = [];
31207
+ let lastBadParen = -1;
30946
31208
  function position() {
30947
31209
  return pos;
30948
31210
  }
@@ -31011,15 +31273,22 @@ var require_tokenize$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31011
31273
  next
31012
31274
  ];
31013
31275
  pos = next;
31014
- } else {
31276
+ } else if (pos <= lastBadParen) currentToken = [
31277
+ "(",
31278
+ "(",
31279
+ pos
31280
+ ];
31281
+ else {
31015
31282
  next = css.indexOf(")", pos + 1);
31016
31283
  content = css.slice(pos, next + 1);
31017
- if (next === -1 || RE_BAD_BRACKET.test(content)) currentToken = [
31018
- "(",
31019
- "(",
31020
- pos
31021
- ];
31022
- else {
31284
+ if (next === -1 || RE_BAD_BRACKET.test(content)) {
31285
+ lastBadParen = next === -1 ? length : next;
31286
+ currentToken = [
31287
+ "(",
31288
+ "(",
31289
+ pos
31290
+ ];
31291
+ } else {
31023
31292
  currentToken = [
31024
31293
  "brackets",
31025
31294
  content,
@@ -31134,7 +31403,7 @@ var require_tokenize$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31134
31403
  };
31135
31404
  }));
31136
31405
  //#endregion
31137
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/parser.js
31406
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/parser.js
31138
31407
  var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31139
31408
  let AtRule = require_at_rule();
31140
31409
  let Comment = require_comment$1();
@@ -31587,7 +31856,7 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31587
31856
  module.exports = Parser;
31588
31857
  }));
31589
31858
  //#endregion
31590
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/parse.js
31859
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/parse.js
31591
31860
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31592
31861
  let Container = require_container$1();
31593
31862
  let Input = require_input();
@@ -31611,7 +31880,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31611
31880
  Container.registerParse(parse);
31612
31881
  }));
31613
31882
  //#endregion
31614
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/warning.js
31883
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/warning.js
31615
31884
  var require_warning = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31616
31885
  var Warning = class {
31617
31886
  constructor(text, opts = {}) {
@@ -31640,7 +31909,7 @@ var require_warning = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31640
31909
  Warning.default = Warning;
31641
31910
  }));
31642
31911
  //#endregion
31643
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/result.js
31912
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/result.js
31644
31913
  var require_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31645
31914
  let Warning = require_warning();
31646
31915
  var Result = class {
@@ -31674,7 +31943,7 @@ var require_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31674
31943
  Result.default = Result;
31675
31944
  }));
31676
31945
  //#endregion
31677
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/warn-once.js
31946
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/warn-once.js
31678
31947
  var require_warn_once = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31679
31948
  let printed = {};
31680
31949
  module.exports = function warnOnce(message) {
@@ -31684,7 +31953,7 @@ var require_warn_once = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31684
31953
  };
31685
31954
  }));
31686
31955
  //#endregion
31687
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/lazy-result.js
31956
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/lazy-result.js
31688
31957
  var require_lazy_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31689
31958
  init_objectSpread2();
31690
31959
  init_asyncToGenerator();
@@ -31970,6 +32239,15 @@ var require_lazy_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31970
32239
  if (opts.syntax) str = opts.syntax.stringify;
31971
32240
  if (opts.stringifier) str = opts.stringifier;
31972
32241
  if (str.stringify) str = str.stringify;
32242
+ let rootSource = this.result.root.source;
32243
+ if (opts.map === void 0 && !(rootSource && rootSource.input && rootSource.input.map)) {
32244
+ let result = "";
32245
+ str(this.result.root, (i) => {
32246
+ result += i;
32247
+ });
32248
+ this.result.css = result;
32249
+ return this.result;
32250
+ }
31973
32251
  let data = new MapGenerator(str, this.result.root, this.result.opts).generate();
31974
32252
  this.result.css = data[0];
31975
32253
  this.result.map = data[1];
@@ -32092,7 +32370,7 @@ var require_lazy_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
32092
32370
  Document.registerLazyResult(LazyResult);
32093
32371
  }));
32094
32372
  //#endregion
32095
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/no-work-result.js
32373
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/no-work-result.js
32096
32374
  var require_no_work_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
32097
32375
  let MapGenerator = require_map_generator();
32098
32376
  let parse = require_parse();
@@ -32189,7 +32467,7 @@ var require_no_work_result = /* @__PURE__ */ __commonJSMin(((exports, module) =>
32189
32467
  NoWorkResult.default = NoWorkResult;
32190
32468
  }));
32191
32469
  //#endregion
32192
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/processor.js
32470
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/processor.js
32193
32471
  var require_processor$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
32194
32472
  let Document = require_document();
32195
32473
  let LazyResult = require_lazy_result();
@@ -32197,7 +32475,7 @@ var require_processor$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
32197
32475
  let Root = require_root$1();
32198
32476
  var Processor = class {
32199
32477
  constructor(plugins = []) {
32200
- this.version = "8.5.9";
32478
+ this.version = "8.5.14";
32201
32479
  this.plugins = this.normalize(plugins);
32202
32480
  }
32203
32481
  normalize(plugins) {
@@ -32228,7 +32506,7 @@ var require_processor$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
32228
32506
  Document.registerProcessor(Processor);
32229
32507
  }));
32230
32508
  //#endregion
32231
- //#region node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/postcss.mjs
32509
+ //#region node_modules/.pnpm/postcss@8.5.14/node_modules/postcss/lib/postcss.mjs
32232
32510
  var import_postcss = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
32233
32511
  init__polyfill_node_process();
32234
32512
  let AtRule = require_at_rule();
@@ -35405,6 +35683,8 @@ function processRule(id, rule) {
35405
35683
  function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false) {
35406
35684
  let node = null;
35407
35685
  let shouldInject = !deep;
35686
+ let hasNestedDeep = false;
35687
+ let splitForNestedDeep = false;
35408
35688
  selector.each((n) => {
35409
35689
  if (n.type === "combinator" && (n.value === ">>>" || n.value === "/deep/")) {
35410
35690
  n.value = " ";
@@ -35414,6 +35694,25 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
35414
35694
  }
35415
35695
  if (n.type === "pseudo") {
35416
35696
  const { value } = n;
35697
+ if (isDeepContainerPseudo(n)) {
35698
+ if (n.nodes.some((selector) => selector.some(isDeepSelector))) {
35699
+ const hasScopeAnchor = !!node;
35700
+ const hasMixedSelectors = n.nodes.some((selector) => !selector.some(isDeepSelector));
35701
+ const hasTrailingNodes = selector.index(n) < selector.length - 1;
35702
+ if (canSplitDeepContainerPseudo(n) && !deep && !hasScopeAnchor && hasMixedSelectors && hasTrailingNodes) {
35703
+ splitSelectorForNestedDeep(id, rule, selector, selectorRoot, n, deep, slotted);
35704
+ splitForNestedDeep = true;
35705
+ return false;
35706
+ }
35707
+ if (value === ":not" && !deep && !hasScopeAnchor && hasMixedSelectors && hasTrailingNodes) return;
35708
+ n.nodes.forEach((selector) => rewriteSelector(id, rule, selector, selectorRoot, deep || hasScopeAnchor, slotted));
35709
+ if (!hasScopeAnchor) {
35710
+ node = n;
35711
+ shouldInject = false;
35712
+ }
35713
+ hasNestedDeep = true;
35714
+ }
35715
+ }
35417
35716
  if (value === ":deep" || value === "::v-deep") {
35418
35717
  rule.__deep = true;
35419
35718
  if (n.nodes.length) {
@@ -35464,8 +35763,9 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
35464
35763
  }
35465
35764
  if (node) return;
35466
35765
  }
35467
- if (n.type !== "pseudo" && n.type !== "combinator" || n.type === "pseudo" && (n.value === ":is" || n.value === ":where") && !node) node = n;
35766
+ if (!hasNestedDeep && (n.type !== "pseudo" && n.type !== "combinator" || n.type === "pseudo" && (n.value === ":is" || n.value === ":where") && !node)) node = n;
35468
35767
  });
35768
+ if (splitForNestedDeep) return;
35469
35769
  if (rule.nodes.some((node) => node.type === "rule")) {
35470
35770
  const deep = rule.__deep;
35471
35771
  if (!deep) {
@@ -35475,7 +35775,7 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
35475
35775
  }
35476
35776
  shouldInject = deep;
35477
35777
  }
35478
- if (node) {
35778
+ if (node && !hasNestedDeep) {
35479
35779
  const { type, value } = node;
35480
35780
  if (type === "pseudo" && (value === ":is" || value === ":where")) {
35481
35781
  node.nodes.forEach((value) => rewriteSelector(id, rule, value, selectorRoot, deep, slotted));
@@ -35497,6 +35797,32 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
35497
35797
  function isSpaceCombinator(node) {
35498
35798
  return node.type === "combinator" && /^\s+$/.test(node.value);
35499
35799
  }
35800
+ function isDeepSelector(node) {
35801
+ var _nodes;
35802
+ if (node.type === "pseudo" && (node.value === ":deep" || node.value === "::v-deep")) return true;
35803
+ return !!((_nodes = node.nodes) === null || _nodes === void 0 ? void 0 : _nodes.some((child) => isDeepSelector(child)));
35804
+ }
35805
+ function isDeepContainerPseudo(node) {
35806
+ return node.type === "pseudo" && (node.value === ":is" || node.value === ":where" || node.value === ":has" || node.value === ":not");
35807
+ }
35808
+ function canSplitDeepContainerPseudo(node) {
35809
+ return node.value === ":is" || node.value === ":where" || node.value === ":has";
35810
+ }
35811
+ function splitSelectorForNestedDeep(id, rule, selector, selectorRoot, pseudo, deep, slotted) {
35812
+ const pseudoIndex = selector.index(pseudo);
35813
+ const selectors = pseudo.nodes.map((branch, index) => {
35814
+ const branchSelector = selector.clone();
35815
+ if (branchSelector.first) branchSelector.first.spaces.before = index === 0 ? selector.first.spaces.before : " ";
35816
+ const branchPseudo = branchSelector.at(pseudoIndex);
35817
+ const branchClone = branch.clone();
35818
+ if (branchClone.first) branchClone.first.spaces.before = "";
35819
+ branchPseudo.removeAll();
35820
+ branchPseudo.append(branchClone);
35821
+ rewriteSelector(id, rule, branchSelector, selectorRoot, deep, slotted);
35822
+ return branchSelector;
35823
+ });
35824
+ selector.replaceWith(...selectors);
35825
+ }
35500
35826
  function extractAndWrapNodes(parentNode) {
35501
35827
  if (!parentNode.nodes) return;
35502
35828
  const nodes = parentNode.nodes.filter((node) => node.type === "decl" || node.type === "comment");
@@ -39039,13 +39365,22 @@ var TypeScope = class {
39039
39365
  this.exportedDeclares = Object.create(null);
39040
39366
  }
39041
39367
  };
39368
+ function recordScopeDep(ctx, scope) {
39369
+ if (scope && scope.filename !== ctx.filename) (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(scope.filename);
39370
+ }
39371
+ function recordResolvedElementDeps(ctx, { props }) {
39372
+ for (const key in props) recordScopeDep(ctx, props[key]._ownerScope);
39373
+ }
39042
39374
  /**
39043
39375
  * Resolve arbitrary type node to a list of type elements that can be then
39044
39376
  * mapped to runtime props or emits.
39045
39377
  */
39046
39378
  function resolveTypeElements(ctx, node, scope, typeParameters) {
39047
39379
  const canCache = !typeParameters;
39048
- if (canCache && node._resolvedElements) return node._resolvedElements;
39380
+ if (canCache && node._resolvedElements) {
39381
+ recordResolvedElementDeps(ctx, node._resolvedElements);
39382
+ return node._resolvedElements;
39383
+ }
39049
39384
  const resolved = innerResolveTypeElements(ctx, node, node._ownerScope || scope || ctxToScope(ctx), typeParameters);
39050
39385
  return canCache ? node._resolvedElements = resolved : resolved;
39051
39386
  }
@@ -39307,7 +39642,10 @@ function resolveBuiltin(ctx, node, name, scope, typeParameters) {
39307
39642
  }
39308
39643
  function resolveTypeReference(ctx, node, scope, name, onlyExported = false) {
39309
39644
  const canCache = !(scope === null || scope === void 0 ? void 0 : scope.isGenericScope);
39310
- if (canCache && node._resolvedReference) return node._resolvedReference;
39645
+ if (canCache && node._resolvedReference) {
39646
+ recordScopeDep(ctx, node._resolvedReference._ownerScope);
39647
+ return node._resolvedReference;
39648
+ }
39311
39649
  const resolved = innerResolveTypeReference(ctx, scope || ctxToScope(ctx), name || getReferenceName(node), node, onlyExported);
39312
39650
  return canCache ? node._resolvedReference = resolved : resolved;
39313
39651
  }
@@ -39322,7 +39660,9 @@ function innerResolveTypeReference(ctx, scope, name, node, onlyExported) {
39322
39660
  const src = node.type === "TSTypeQuery" ? s.declares : s.types;
39323
39661
  if (src[name]) {
39324
39662
  (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(s.filename);
39325
- return src[name];
39663
+ const resolved = src[name];
39664
+ if (resolved._ownerScope && resolved._ownerScope !== s) ctx.deps.add(resolved._ownerScope.filename);
39665
+ return resolved;
39326
39666
  }
39327
39667
  }
39328
39668
  }
@@ -39387,7 +39727,7 @@ function resolveTypeFromImport(ctx, node, name, scope) {
39387
39727
  const { source, imported } = scope.imports[name];
39388
39728
  return resolveTypeReference(ctx, node, importSourceToScope(ctx, node, scope, source), imported, true);
39389
39729
  }
39390
- function importSourceToScope(ctx, node, scope, source) {
39730
+ function importSourceToScope(ctx, node, scope, source, trackDep = true) {
39391
39731
  let fs;
39392
39732
  try {
39393
39733
  fs = resolveFS(ctx);
@@ -39400,10 +39740,11 @@ function importSourceToScope(ctx, node, scope, source) {
39400
39740
  if (source.startsWith("..")) resolved = resolveExt(joinPaths(dirname(scope.filename), source), fs);
39401
39741
  else if (source[0] === ".") resolved = resolveExt(joinPaths(dirname(scope.filename), source), fs);
39402
39742
  else return ctx.error(`Type import from non-relative sources is not supported in the browser build.`, node, scope);
39743
+ if (!resolved && source[0] === "." && false);
39403
39744
  if (resolved) resolved = scope.resolvedImportSources[source] = normalizePath(resolved);
39404
39745
  }
39405
39746
  if (resolved) {
39406
- (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(resolved);
39747
+ if (trackDep) (ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(resolved);
39407
39748
  return fileToScope(ctx, resolved);
39408
39749
  } else return ctx.error(`Failed to resolve import source ${JSON.stringify(source)}.`, node, scope);
39409
39750
  }
@@ -39501,8 +39842,22 @@ function recordTypes(ctx, body, scope, asGlobal = false) {
39501
39842
  for (const stmt of body) if (asGlobal) {
39502
39843
  if (isAmbient) {
39503
39844
  if (stmt.declare) recordType(stmt, types, declares);
39504
- } else if (stmt.type === "TSModuleDeclaration" && stmt.global) for (const s of stmt.body.body) if (s.type === "ExportNamedDeclaration" && s.declaration) recordType(s.declaration, types, declares);
39505
- else recordType(s, types, declares);
39845
+ } else if (stmt.type === "TSModuleDeclaration" && stmt.global) for (const s of stmt.body.body) if (s.type === "ExportNamedDeclaration") {
39846
+ if (s.declaration) recordType(s.declaration, types, declares);
39847
+ else if (s.source) {
39848
+ const sourceScope = importSourceToScope(ctx, s.source, scope, s.source.value, false);
39849
+ for (const spec of s.specifiers) if (spec.type === "ExportSpecifier") {
39850
+ const exported = getId(spec.exported);
39851
+ const local = spec.local.name;
39852
+ if (sourceScope.exportedTypes[local]) types[exported] = sourceScope.exportedTypes[local];
39853
+ if (sourceScope.exportedDeclares[local]) declares[exported] = sourceScope.exportedDeclares[local];
39854
+ }
39855
+ }
39856
+ } else if (s.type === "ExportAllDeclaration" && s.source) {
39857
+ const sourceScope = importSourceToScope(ctx, s.source, scope, s.source.value, false);
39858
+ Object.assign(types, sourceScope.exportedTypes);
39859
+ Object.assign(declares, sourceScope.exportedDeclares);
39860
+ } else recordType(s, types, declares);
39506
39861
  } else recordType(stmt, types, declares);
39507
39862
  if (!asGlobal) {
39508
39863
  for (const stmt of body) if (stmt.type === "ExportNamedDeclaration") {
@@ -39539,10 +39894,10 @@ function recordTypes(ctx, body, scope, asGlobal = false) {
39539
39894
  }
39540
39895
  for (const key of Object.keys(types)) {
39541
39896
  const node = types[key];
39542
- node._ownerScope = scope;
39543
- if (node._ns) node._ns._ownerScope = scope;
39897
+ if (!node._ownerScope) node._ownerScope = scope;
39898
+ if (node._ns && !node._ns._ownerScope) node._ns._ownerScope = scope;
39544
39899
  }
39545
- for (const key of Object.keys(declares)) declares[key]._ownerScope = scope;
39900
+ for (const key of Object.keys(declares)) if (!declares[key]._ownerScope) declares[key]._ownerScope = scope;
39546
39901
  }
39547
39902
  function recordType(node, types, declares, overwriteId) {
39548
39903
  switch (node.type) {
@@ -39667,7 +40022,10 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
39667
40022
  default: return [UNKNOWN_TYPE];
39668
40023
  }
39669
40024
  case "TSTypeReference": {
39670
- const resolved = resolveTypeReference(ctx, node, scope);
40025
+ let resolved;
40026
+ try {
40027
+ resolved = resolveTypeReference(ctx, node, scope);
40028
+ } catch (_unused) {}
39671
40029
  if (resolved) {
39672
40030
  if (resolved.type === "TSTypeAliasDeclaration") {
39673
40031
  if (resolved.typeAnnotation.type === "TSFunctionType") return ["Function"];
@@ -39743,6 +40101,17 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
39743
40101
  case "ReadonlyArray": return ["Array"];
39744
40102
  case "ReadonlyMap": return ["Map"];
39745
40103
  case "ReadonlySet": return ["Set"];
40104
+ case "Ref":
40105
+ case "ShallowRef":
40106
+ case "ComputedRef":
40107
+ case "WritableComputedRef": return ["Object"];
40108
+ case "MaybeRef":
40109
+ case "MaybeRefOrGetter": {
40110
+ const types = new Set(["Object"]);
40111
+ if (node.typeName.name === "MaybeRefOrGetter") types.add("Function");
40112
+ if (node.typeParameters && node.typeParameters.params[0]) for (const t of inferRuntimeType(ctx, node.typeParameters.params[0], scope, false, typeParameters)) types.add(t);
40113
+ return Array.from(types);
40114
+ }
39746
40115
  case "NonNullable":
39747
40116
  if (node.typeParameters && node.typeParameters.params[0]) return inferRuntimeType(ctx, node.typeParameters.params[0], scope).filter((t) => t !== "null");
39748
40117
  break;
@@ -40940,7 +41309,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
40940
41309
  //#endregion
40941
41310
  //#region packages/compiler-sfc/src/index.ts
40942
41311
  init_objectSpread2();
40943
- const version = "3.6.0-beta.10";
41312
+ const version = "3.6.0-beta.11";
40944
41313
  const parseCache = parseCache$1;
40945
41314
  const errorMessages = _objectSpread2(_objectSpread2({}, errorMessages$1), DOMErrorMessages);
40946
41315
  const walk = walk$2;