nuxt-intlayer 7.0.0-canary.2 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/dist/cjs/_virtual/rolldown_runtime.cjs +0 -15
  2. package/dist/cjs/packages/@intlayer/dictionaries-entry/dist/esm/index.cjs +1 -1
  3. package/dist/cjs/packages/@intlayer/dictionaries-entry/dist/esm/index.cjs.map +1 -1
  4. package/dist/cjs/runtime/intlayer-plugin.cjs +4 -3
  5. package/dist/cjs/runtime/intlayer-plugin.cjs.map +1 -1
  6. package/dist/esm/packages/@intlayer/dictionaries-entry/dist/esm/index.mjs +2 -2
  7. package/dist/esm/packages/@intlayer/dictionaries-entry/dist/esm/index.mjs.map +1 -1
  8. package/dist/esm/runtime/intlayer-plugin.mjs +3 -3
  9. package/dist/esm/runtime/intlayer-plugin.mjs.map +1 -1
  10. package/package.json +16 -14
  11. package/dist/cjs/node_modules/.bun/@babel_parser@7.28.4/node_modules/@babel/parser/lib/index.cjs +0 -12494
  12. package/dist/cjs/node_modules/.bun/@babel_parser@7.28.4/node_modules/@babel/parser/lib/index.cjs.map +0 -1
  13. package/dist/cjs/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.cjs +0 -2353
  14. package/dist/cjs/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.cjs.map +0 -1
  15. package/dist/cjs/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.cjs +0 -4751
  16. package/dist/cjs/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.cjs.map +0 -1
  17. package/dist/cjs/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/index.cjs +0 -18
  18. package/dist/cjs/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/index.cjs.map +0 -1
  19. package/dist/cjs/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.cjs +0 -660
  20. package/dist/cjs/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.cjs.map +0 -1
  21. package/dist/cjs/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.cjs +0 -442
  22. package/dist/cjs/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.cjs.map +0 -1
  23. package/dist/cjs/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/index.cjs +0 -18
  24. package/dist/cjs/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/index.cjs.map +0 -1
  25. package/dist/cjs/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.cjs.cjs +0 -22
  26. package/dist/cjs/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.cjs.cjs.map +0 -1
  27. package/dist/cjs/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.cjs +0 -1457
  28. package/dist/cjs/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.cjs.map +0 -1
  29. package/dist/cjs/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/index.cjs +0 -18
  30. package/dist/cjs/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/index.cjs.map +0 -1
  31. package/dist/cjs/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.cjs.cjs +0 -870
  32. package/dist/cjs/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.cjs.cjs.map +0 -1
  33. package/dist/cjs/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.cjs +0 -4204
  34. package/dist/cjs/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.cjs.map +0 -1
  35. package/dist/cjs/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/index.cjs +0 -18
  36. package/dist/cjs/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/index.cjs.map +0 -1
  37. package/dist/cjs/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.cjs +0 -1373
  38. package/dist/cjs/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.cjs.map +0 -1
  39. package/dist/cjs/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.cjs +0 -1270
  40. package/dist/cjs/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.cjs.map +0 -1
  41. package/dist/cjs/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/index.cjs +0 -18
  42. package/dist/cjs/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/index.cjs.map +0 -1
  43. package/dist/cjs/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.cjs.cjs +0 -44
  44. package/dist/cjs/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.cjs.cjs.map +0 -1
  45. package/dist/cjs/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.cjs.prod.cjs +0 -491
  46. package/dist/cjs/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.cjs.prod.cjs.map +0 -1
  47. package/dist/cjs/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/index.cjs +0 -18
  48. package/dist/cjs/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/index.cjs.map +0 -1
  49. package/dist/cjs/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/decode.cjs +0 -474
  50. package/dist/cjs/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/decode.cjs.map +0 -1
  51. package/dist/cjs/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/decode_codepoint.cjs +0 -82
  52. package/dist/cjs/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/decode_codepoint.cjs.map +0 -1
  53. package/dist/cjs/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/generated/decode-data-html.cjs +0 -18
  54. package/dist/cjs/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/generated/decode-data-html.cjs.map +0 -1
  55. package/dist/cjs/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/generated/decode-data-xml.cjs +0 -18
  56. package/dist/cjs/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/generated/decode-data-xml.cjs.map +0 -1
  57. package/dist/cjs/node_modules/.bun/estree-walker@2.0.2/node_modules/estree-walker/dist/umd/estree-walker.cjs +0 -255
  58. package/dist/cjs/node_modules/.bun/estree-walker@2.0.2/node_modules/estree-walker/dist/umd/estree-walker.cjs.map +0 -1
  59. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.cjs +0 -103
  60. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.cjs.map +0 -1
  61. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.cjs +0 -76
  62. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.cjs.map +0 -1
  63. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.cjs +0 -44
  64. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.cjs.map +0 -1
  65. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.cjs +0 -71
  66. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.cjs.map +0 -1
  67. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.cjs +0 -80
  68. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.cjs.map +0 -1
  69. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.cjs +0 -92
  70. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.cjs.map +0 -1
  71. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.cjs +0 -791
  72. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.cjs.map +0 -1
  73. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.cjs +0 -298
  74. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.cjs.map +0 -1
  75. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.cjs +0 -296
  76. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.cjs.map +0 -1
  77. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/util.cjs +0 -355
  78. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/util.cjs.map +0 -1
  79. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/source-map.cjs +0 -20
  80. package/dist/cjs/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/source-map.cjs.map +0 -1
  81. package/dist/cjs/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/native.cjs +0 -10
  82. package/dist/cjs/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/native.cjs.map +0 -1
  83. package/dist/cjs/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/rng.cjs +0 -18
  84. package/dist/cjs/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/rng.cjs.map +0 -1
  85. package/dist/cjs/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/stringify.cjs +0 -11
  86. package/dist/cjs/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/stringify.cjs.map +0 -1
  87. package/dist/cjs/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/v4.cjs +0 -28
  88. package/dist/cjs/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/v4.cjs.map +0 -1
  89. package/dist/cjs/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.cjs.cjs +0 -65
  90. package/dist/cjs/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.cjs.cjs.map +0 -1
  91. package/dist/cjs/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.cjs.prod.cjs +0 -55
  92. package/dist/cjs/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.cjs.prod.cjs.map +0 -1
  93. package/dist/cjs/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index.cjs +0 -18
  94. package/dist/cjs/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index.cjs.map +0 -1
  95. package/dist/cjs/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs +0 -15
  96. package/dist/cjs/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs.map +0 -1
  97. package/dist/esm/node_modules/.bun/@babel_parser@7.28.4/node_modules/@babel/parser/lib/index.mjs +0 -12491
  98. package/dist/esm/node_modules/.bun/@babel_parser@7.28.4/node_modules/@babel/parser/lib/index.mjs.map +0 -1
  99. package/dist/esm/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.mjs +0 -2350
  100. package/dist/esm/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.mjs.map +0 -1
  101. package/dist/esm/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.mjs +0 -4748
  102. package/dist/esm/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.mjs.map +0 -1
  103. package/dist/esm/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/index.mjs +0 -15
  104. package/dist/esm/node_modules/.bun/@vue_compiler-core@3.5.22/node_modules/@vue/compiler-core/index.mjs.map +0 -1
  105. package/dist/esm/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.mjs +0 -657
  106. package/dist/esm/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.mjs.map +0 -1
  107. package/dist/esm/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.mjs +0 -439
  108. package/dist/esm/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.mjs.map +0 -1
  109. package/dist/esm/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/index.mjs +0 -15
  110. package/dist/esm/node_modules/.bun/@vue_compiler-dom@3.5.22/node_modules/@vue/compiler-dom/index.mjs.map +0 -1
  111. package/dist/esm/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.cjs.mjs +0 -19
  112. package/dist/esm/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.cjs.mjs.map +0 -1
  113. package/dist/esm/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.mjs +0 -1454
  114. package/dist/esm/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.mjs.map +0 -1
  115. package/dist/esm/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs +0 -1312
  116. package/dist/esm/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs.map +0 -1
  117. package/dist/esm/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/index.mjs +0 -15
  118. package/dist/esm/node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/index.mjs.map +0 -1
  119. package/dist/esm/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.cjs.mjs +0 -867
  120. package/dist/esm/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.cjs.mjs.map +0 -1
  121. package/dist/esm/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.mjs +0 -4201
  122. package/dist/esm/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.mjs.map +0 -1
  123. package/dist/esm/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs +0 -995
  124. package/dist/esm/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs.map +0 -1
  125. package/dist/esm/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/index.mjs +0 -15
  126. package/dist/esm/node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/index.mjs.map +0 -1
  127. package/dist/esm/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.mjs +0 -1370
  128. package/dist/esm/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.mjs.map +0 -1
  129. package/dist/esm/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.mjs +0 -1267
  130. package/dist/esm/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.mjs.map +0 -1
  131. package/dist/esm/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/index.mjs +0 -15
  132. package/dist/esm/node_modules/.bun/@vue_runtime-dom@3.5.22/node_modules/@vue/runtime-dom/index.mjs.map +0 -1
  133. package/dist/esm/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.cjs.mjs +0 -41
  134. package/dist/esm/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.cjs.mjs.map +0 -1
  135. package/dist/esm/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.cjs.prod.mjs +0 -488
  136. package/dist/esm/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.cjs.prod.mjs.map +0 -1
  137. package/dist/esm/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.esm-bundler.mjs +0 -77
  138. package/dist/esm/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/dist/shared.esm-bundler.mjs.map +0 -1
  139. package/dist/esm/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/index.mjs +0 -15
  140. package/dist/esm/node_modules/.bun/@vue_shared@3.5.22/node_modules/@vue/shared/index.mjs.map +0 -1
  141. package/dist/esm/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/decode.mjs +0 -471
  142. package/dist/esm/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/decode.mjs.map +0 -1
  143. package/dist/esm/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/decode_codepoint.mjs +0 -79
  144. package/dist/esm/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/decode_codepoint.mjs.map +0 -1
  145. package/dist/esm/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/generated/decode-data-html.mjs +0 -15
  146. package/dist/esm/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/generated/decode-data-html.mjs.map +0 -1
  147. package/dist/esm/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/generated/decode-data-xml.mjs +0 -15
  148. package/dist/esm/node_modules/.bun/entities@4.5.0/node_modules/entities/lib/generated/decode-data-xml.mjs.map +0 -1
  149. package/dist/esm/node_modules/.bun/estree-walker@2.0.2/node_modules/estree-walker/dist/umd/estree-walker.mjs +0 -252
  150. package/dist/esm/node_modules/.bun/estree-walker@2.0.2/node_modules/estree-walker/dist/umd/estree-walker.mjs.map +0 -1
  151. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.mjs +0 -100
  152. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.mjs.map +0 -1
  153. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.mjs +0 -73
  154. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.mjs.map +0 -1
  155. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.mjs +0 -41
  156. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.mjs.map +0 -1
  157. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.mjs +0 -68
  158. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.mjs.map +0 -1
  159. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.mjs +0 -77
  160. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.mjs.map +0 -1
  161. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.mjs +0 -89
  162. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.mjs.map +0 -1
  163. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.mjs +0 -788
  164. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.mjs.map +0 -1
  165. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.mjs +0 -295
  166. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.mjs.map +0 -1
  167. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.mjs +0 -293
  168. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.mjs.map +0 -1
  169. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/util.mjs +0 -352
  170. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/util.mjs.map +0 -1
  171. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/source-map.mjs +0 -17
  172. package/dist/esm/node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/source-map.mjs.map +0 -1
  173. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/native.mjs +0 -7
  174. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/native.mjs.map +0 -1
  175. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/rng.mjs +0 -14
  176. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/rng.mjs.map +0 -1
  177. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/stringify.mjs +0 -10
  178. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/stringify.mjs.map +0 -1
  179. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/v4.mjs +0 -28
  180. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/v4.mjs.map +0 -1
  181. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/native.mjs +0 -8
  182. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/native.mjs.map +0 -1
  183. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/rng.mjs +0 -16
  184. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/rng.mjs.map +0 -1
  185. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/stringify.mjs +0 -10
  186. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/stringify.mjs.map +0 -1
  187. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/v4.mjs +0 -28
  188. package/dist/esm/node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/v4.mjs.map +0 -1
  189. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.cjs.mjs +0 -62
  190. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.cjs.mjs.map +0 -1
  191. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.cjs.prod.mjs +0 -52
  192. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.cjs.prod.mjs.map +0 -1
  193. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs +0 -12
  194. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs.map +0 -1
  195. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index.mjs +0 -15
  196. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index.mjs.map +0 -1
  197. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.mjs +0 -10
  198. package/dist/esm/node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.mjs.map +0 -1
@@ -1,2353 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.cjs');
2
- const require_index = require('../../../../../@vue_shared@3.5.22/node_modules/@vue/shared/index.cjs');
3
- const require_decode$1 = require('../../../../../entities@4.5.0/node_modules/entities/lib/decode.cjs');
4
- const require_index$1 = require('../../../../../@babel_parser@7.28.4/node_modules/@babel/parser/lib/index.cjs');
5
- const require_estree_walker$1 = require('../../../../../estree-walker@2.0.2/node_modules/estree-walker/dist/umd/estree-walker.cjs');
6
- const require_source_map$1 = require('../../../../../source-map-js@1.2.1/node_modules/source-map-js/source-map.cjs');
7
-
8
- //#region ../../node_modules/.bun/@vue+compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js
9
- var require_compiler_core_cjs = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.bun/@vue+compiler-core@3.5.22/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js": ((exports) => {
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- var shared = require_index.require_shared();
12
- var decode_js = require_decode$1.require_decode();
13
- var parser = require_index$1.require_lib();
14
- var estreeWalker = require_estree_walker$1.require_estree_walker();
15
- var sourceMapJs = require_source_map$1.require_source_map();
16
- const FRAGMENT = Symbol(`Fragment`);
17
- const TELEPORT = Symbol(`Teleport`);
18
- const SUSPENSE = Symbol(`Suspense`);
19
- const KEEP_ALIVE = Symbol(`KeepAlive`);
20
- const BASE_TRANSITION = Symbol(`BaseTransition`);
21
- const OPEN_BLOCK = Symbol(`openBlock`);
22
- const CREATE_BLOCK = Symbol(`createBlock`);
23
- const CREATE_ELEMENT_BLOCK = Symbol(`createElementBlock`);
24
- const CREATE_VNODE = Symbol(`createVNode`);
25
- const CREATE_ELEMENT_VNODE = Symbol(`createElementVNode`);
26
- const CREATE_COMMENT = Symbol(`createCommentVNode`);
27
- const CREATE_TEXT = Symbol(`createTextVNode`);
28
- const CREATE_STATIC = Symbol(`createStaticVNode`);
29
- const RESOLVE_COMPONENT = Symbol(`resolveComponent`);
30
- const RESOLVE_DYNAMIC_COMPONENT = Symbol(`resolveDynamicComponent`);
31
- const RESOLVE_DIRECTIVE = Symbol(`resolveDirective`);
32
- const RESOLVE_FILTER = Symbol(`resolveFilter`);
33
- const WITH_DIRECTIVES = Symbol(`withDirectives`);
34
- const RENDER_LIST = Symbol(`renderList`);
35
- const RENDER_SLOT = Symbol(`renderSlot`);
36
- const CREATE_SLOTS = Symbol(`createSlots`);
37
- const TO_DISPLAY_STRING = Symbol(`toDisplayString`);
38
- const MERGE_PROPS = Symbol(`mergeProps`);
39
- const NORMALIZE_CLASS = Symbol(`normalizeClass`);
40
- const NORMALIZE_STYLE = Symbol(`normalizeStyle`);
41
- const NORMALIZE_PROPS = Symbol(`normalizeProps`);
42
- const GUARD_REACTIVE_PROPS = Symbol(`guardReactiveProps`);
43
- const TO_HANDLERS = Symbol(`toHandlers`);
44
- const CAMELIZE = Symbol(`camelize`);
45
- const CAPITALIZE = Symbol(`capitalize`);
46
- const TO_HANDLER_KEY = Symbol(`toHandlerKey`);
47
- const SET_BLOCK_TRACKING = Symbol(`setBlockTracking`);
48
- const PUSH_SCOPE_ID = Symbol(`pushScopeId`);
49
- const POP_SCOPE_ID = Symbol(`popScopeId`);
50
- const WITH_CTX = Symbol(`withCtx`);
51
- const UNREF = Symbol(`unref`);
52
- const IS_REF = Symbol(`isRef`);
53
- const WITH_MEMO = Symbol(`withMemo`);
54
- const IS_MEMO_SAME = Symbol(`isMemoSame`);
55
- const helperNameMap = {
56
- [FRAGMENT]: `Fragment`,
57
- [TELEPORT]: `Teleport`,
58
- [SUSPENSE]: `Suspense`,
59
- [KEEP_ALIVE]: `KeepAlive`,
60
- [BASE_TRANSITION]: `BaseTransition`,
61
- [OPEN_BLOCK]: `openBlock`,
62
- [CREATE_BLOCK]: `createBlock`,
63
- [CREATE_ELEMENT_BLOCK]: `createElementBlock`,
64
- [CREATE_VNODE]: `createVNode`,
65
- [CREATE_ELEMENT_VNODE]: `createElementVNode`,
66
- [CREATE_COMMENT]: `createCommentVNode`,
67
- [CREATE_TEXT]: `createTextVNode`,
68
- [CREATE_STATIC]: `createStaticVNode`,
69
- [RESOLVE_COMPONENT]: `resolveComponent`,
70
- [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
71
- [RESOLVE_DIRECTIVE]: `resolveDirective`,
72
- [RESOLVE_FILTER]: `resolveFilter`,
73
- [WITH_DIRECTIVES]: `withDirectives`,
74
- [RENDER_LIST]: `renderList`,
75
- [RENDER_SLOT]: `renderSlot`,
76
- [CREATE_SLOTS]: `createSlots`,
77
- [TO_DISPLAY_STRING]: `toDisplayString`,
78
- [MERGE_PROPS]: `mergeProps`,
79
- [NORMALIZE_CLASS]: `normalizeClass`,
80
- [NORMALIZE_STYLE]: `normalizeStyle`,
81
- [NORMALIZE_PROPS]: `normalizeProps`,
82
- [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
83
- [TO_HANDLERS]: `toHandlers`,
84
- [CAMELIZE]: `camelize`,
85
- [CAPITALIZE]: `capitalize`,
86
- [TO_HANDLER_KEY]: `toHandlerKey`,
87
- [SET_BLOCK_TRACKING]: `setBlockTracking`,
88
- [PUSH_SCOPE_ID]: `pushScopeId`,
89
- [POP_SCOPE_ID]: `popScopeId`,
90
- [WITH_CTX]: `withCtx`,
91
- [UNREF]: `unref`,
92
- [IS_REF]: `isRef`,
93
- [WITH_MEMO]: `withMemo`,
94
- [IS_MEMO_SAME]: `isMemoSame`
95
- };
96
- const locStub = {
97
- start: {
98
- line: 1,
99
- column: 1,
100
- offset: 0
101
- },
102
- end: {
103
- line: 1,
104
- column: 1,
105
- offset: 0
106
- },
107
- source: ""
108
- };
109
- function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent$1 = false, loc = locStub) {
110
- if (context) {
111
- if (isBlock) {
112
- context.helper(OPEN_BLOCK);
113
- context.helper(getVNodeBlockHelper(context.inSSR, isComponent$1));
114
- } else context.helper(getVNodeHelper(context.inSSR, isComponent$1));
115
- if (directives) context.helper(WITH_DIRECTIVES);
116
- }
117
- return {
118
- type: 13,
119
- tag,
120
- props,
121
- children,
122
- patchFlag,
123
- dynamicProps,
124
- directives,
125
- isBlock,
126
- disableTracking,
127
- isComponent: isComponent$1,
128
- loc
129
- };
130
- }
131
- function createObjectExpression(properties, loc = locStub) {
132
- return {
133
- type: 15,
134
- loc,
135
- properties
136
- };
137
- }
138
- function createObjectProperty(key, value) {
139
- return {
140
- type: 16,
141
- loc: locStub,
142
- key: shared.isString(key) ? createSimpleExpression(key, true) : key,
143
- value
144
- };
145
- }
146
- function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
147
- return {
148
- type: 4,
149
- loc,
150
- content,
151
- isStatic,
152
- constType: isStatic ? 3 : constType
153
- };
154
- }
155
- function createCompoundExpression(children, loc = locStub) {
156
- return {
157
- type: 8,
158
- loc,
159
- children
160
- };
161
- }
162
- function createCallExpression(callee, args = [], loc = locStub) {
163
- return {
164
- type: 14,
165
- loc,
166
- callee,
167
- arguments: args
168
- };
169
- }
170
- function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
171
- return {
172
- type: 18,
173
- params,
174
- returns,
175
- newline,
176
- isSlot,
177
- loc
178
- };
179
- }
180
- function createConditionalExpression(test, consequent, alternate, newline = true) {
181
- return {
182
- type: 19,
183
- test,
184
- consequent,
185
- alternate,
186
- newline,
187
- loc: locStub
188
- };
189
- }
190
- function createBlockStatement(body) {
191
- return {
192
- type: 21,
193
- body,
194
- loc: locStub
195
- };
196
- }
197
- function getVNodeHelper(ssr, isComponent$1) {
198
- return ssr || isComponent$1 ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
199
- }
200
- function getVNodeBlockHelper(ssr, isComponent$1) {
201
- return ssr || isComponent$1 ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
202
- }
203
- function convertToBlock(node, { helper, removeHelper, inSSR }) {
204
- if (!node.isBlock) {
205
- node.isBlock = true;
206
- removeHelper(getVNodeHelper(inSSR, node.isComponent));
207
- helper(OPEN_BLOCK);
208
- helper(getVNodeBlockHelper(inSSR, node.isComponent));
209
- }
210
- }
211
- const defaultDelimitersOpen = new Uint8Array([123, 123]);
212
- const defaultDelimitersClose = new Uint8Array([125, 125]);
213
- function isTagStartChar(c) {
214
- return c >= 97 && c <= 122 || c >= 65 && c <= 90;
215
- }
216
- function isWhitespace(c) {
217
- return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;
218
- }
219
- function isEndOfTagSection(c) {
220
- return c === 47 || c === 62 || isWhitespace(c);
221
- }
222
- function toCharCodes(str) {
223
- const ret = new Uint8Array(str.length);
224
- for (let i = 0; i < str.length; i++) ret[i] = str.charCodeAt(i);
225
- return ret;
226
- }
227
- const Sequences = {
228
- Cdata: new Uint8Array([
229
- 67,
230
- 68,
231
- 65,
232
- 84,
233
- 65,
234
- 91
235
- ]),
236
- CdataEnd: new Uint8Array([
237
- 93,
238
- 93,
239
- 62
240
- ]),
241
- CommentEnd: new Uint8Array([
242
- 45,
243
- 45,
244
- 62
245
- ]),
246
- ScriptEnd: new Uint8Array([
247
- 60,
248
- 47,
249
- 115,
250
- 99,
251
- 114,
252
- 105,
253
- 112,
254
- 116
255
- ]),
256
- StyleEnd: new Uint8Array([
257
- 60,
258
- 47,
259
- 115,
260
- 116,
261
- 121,
262
- 108,
263
- 101
264
- ]),
265
- TitleEnd: new Uint8Array([
266
- 60,
267
- 47,
268
- 116,
269
- 105,
270
- 116,
271
- 108,
272
- 101
273
- ]),
274
- TextareaEnd: new Uint8Array([
275
- 60,
276
- 47,
277
- 116,
278
- 101,
279
- 120,
280
- 116,
281
- 97,
282
- 114,
283
- 101,
284
- 97
285
- ])
286
- };
287
- var Tokenizer = class {
288
- constructor(stack$1, cbs) {
289
- this.stack = stack$1;
290
- this.cbs = cbs;
291
- /** The current state the tokenizer is in. */
292
- this.state = 1;
293
- /** The read buffer. */
294
- this.buffer = "";
295
- /** The beginning of the section that is currently being read. */
296
- this.sectionStart = 0;
297
- /** The index within the buffer that we are currently looking at. */
298
- this.index = 0;
299
- /** The start of the last entity. */
300
- this.entityStart = 0;
301
- /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
302
- this.baseState = 1;
303
- /** For special parsing behavior inside of script and style tags. */
304
- this.inRCDATA = false;
305
- /** For disabling RCDATA tags handling */
306
- this.inXML = false;
307
- /** For disabling interpolation parsing in v-pre */
308
- this.inVPre = false;
309
- /** Record newline positions for fast line / column calculation */
310
- this.newlines = [];
311
- this.mode = 0;
312
- this.delimiterOpen = defaultDelimitersOpen;
313
- this.delimiterClose = defaultDelimitersClose;
314
- this.delimiterIndex = -1;
315
- this.currentSequence = void 0;
316
- this.sequenceIndex = 0;
317
- this.entityDecoder = new decode_js.EntityDecoder(decode_js.htmlDecodeTree, (cp, consumed) => this.emitCodePoint(cp, consumed));
318
- }
319
- get inSFCRoot() {
320
- return this.mode === 2 && this.stack.length === 0;
321
- }
322
- reset() {
323
- this.state = 1;
324
- this.mode = 0;
325
- this.buffer = "";
326
- this.sectionStart = 0;
327
- this.index = 0;
328
- this.baseState = 1;
329
- this.inRCDATA = false;
330
- this.currentSequence = void 0;
331
- this.newlines.length = 0;
332
- this.delimiterOpen = defaultDelimitersOpen;
333
- this.delimiterClose = defaultDelimitersClose;
334
- }
335
- /**
336
- * Generate Position object with line / column information using recorded
337
- * newline positions. We know the index is always going to be an already
338
- * processed index, so all the newlines up to this index should have been
339
- * recorded.
340
- */
341
- getPos(index) {
342
- let line = 1;
343
- let column = index + 1;
344
- for (let i = this.newlines.length - 1; i >= 0; i--) {
345
- const newlineIndex = this.newlines[i];
346
- if (index > newlineIndex) {
347
- line = i + 2;
348
- column = index - newlineIndex;
349
- break;
350
- }
351
- }
352
- return {
353
- column,
354
- line,
355
- offset: index
356
- };
357
- }
358
- peek() {
359
- return this.buffer.charCodeAt(this.index + 1);
360
- }
361
- stateText(c) {
362
- if (c === 60) {
363
- if (this.index > this.sectionStart) this.cbs.ontext(this.sectionStart, this.index);
364
- this.state = 5;
365
- this.sectionStart = this.index;
366
- } else if (c === 38) this.startEntity();
367
- else if (!this.inVPre && c === this.delimiterOpen[0]) {
368
- this.state = 2;
369
- this.delimiterIndex = 0;
370
- this.stateInterpolationOpen(c);
371
- }
372
- }
373
- stateInterpolationOpen(c) {
374
- if (c === this.delimiterOpen[this.delimiterIndex]) if (this.delimiterIndex === this.delimiterOpen.length - 1) {
375
- const start = this.index + 1 - this.delimiterOpen.length;
376
- if (start > this.sectionStart) this.cbs.ontext(this.sectionStart, start);
377
- this.state = 3;
378
- this.sectionStart = start;
379
- } else this.delimiterIndex++;
380
- else if (this.inRCDATA) {
381
- this.state = 32;
382
- this.stateInRCDATA(c);
383
- } else {
384
- this.state = 1;
385
- this.stateText(c);
386
- }
387
- }
388
- stateInterpolation(c) {
389
- if (c === this.delimiterClose[0]) {
390
- this.state = 4;
391
- this.delimiterIndex = 0;
392
- this.stateInterpolationClose(c);
393
- }
394
- }
395
- stateInterpolationClose(c) {
396
- if (c === this.delimiterClose[this.delimiterIndex]) if (this.delimiterIndex === this.delimiterClose.length - 1) {
397
- this.cbs.oninterpolation(this.sectionStart, this.index + 1);
398
- if (this.inRCDATA) this.state = 32;
399
- else this.state = 1;
400
- this.sectionStart = this.index + 1;
401
- } else this.delimiterIndex++;
402
- else {
403
- this.state = 3;
404
- this.stateInterpolation(c);
405
- }
406
- }
407
- stateSpecialStartSequence(c) {
408
- const isEnd = this.sequenceIndex === this.currentSequence.length;
409
- if (!(isEnd ? isEndOfTagSection(c) : (c | 32) === this.currentSequence[this.sequenceIndex])) this.inRCDATA = false;
410
- else if (!isEnd) {
411
- this.sequenceIndex++;
412
- return;
413
- }
414
- this.sequenceIndex = 0;
415
- this.state = 6;
416
- this.stateInTagName(c);
417
- }
418
- /** Look for an end tag. For <title> and <textarea>, also decode entities. */
419
- stateInRCDATA(c) {
420
- if (this.sequenceIndex === this.currentSequence.length) {
421
- if (c === 62 || isWhitespace(c)) {
422
- const endOfText = this.index - this.currentSequence.length;
423
- if (this.sectionStart < endOfText) {
424
- const actualIndex = this.index;
425
- this.index = endOfText;
426
- this.cbs.ontext(this.sectionStart, endOfText);
427
- this.index = actualIndex;
428
- }
429
- this.sectionStart = endOfText + 2;
430
- this.stateInClosingTagName(c);
431
- this.inRCDATA = false;
432
- return;
433
- }
434
- this.sequenceIndex = 0;
435
- }
436
- if ((c | 32) === this.currentSequence[this.sequenceIndex]) this.sequenceIndex += 1;
437
- else if (this.sequenceIndex === 0) {
438
- if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
439
- if (c === 38) this.startEntity();
440
- else if (!this.inVPre && c === this.delimiterOpen[0]) {
441
- this.state = 2;
442
- this.delimiterIndex = 0;
443
- this.stateInterpolationOpen(c);
444
- }
445
- } else if (this.fastForwardTo(60)) this.sequenceIndex = 1;
446
- } else this.sequenceIndex = Number(c === 60);
447
- }
448
- stateCDATASequence(c) {
449
- if (c === Sequences.Cdata[this.sequenceIndex]) {
450
- if (++this.sequenceIndex === Sequences.Cdata.length) {
451
- this.state = 28;
452
- this.currentSequence = Sequences.CdataEnd;
453
- this.sequenceIndex = 0;
454
- this.sectionStart = this.index + 1;
455
- }
456
- } else {
457
- this.sequenceIndex = 0;
458
- this.state = 23;
459
- this.stateInDeclaration(c);
460
- }
461
- }
462
- /**
463
- * When we wait for one specific character, we can speed things up
464
- * by skipping through the buffer until we find it.
465
- *
466
- * @returns Whether the character was found.
467
- */
468
- fastForwardTo(c) {
469
- while (++this.index < this.buffer.length) {
470
- const cc = this.buffer.charCodeAt(this.index);
471
- if (cc === 10) this.newlines.push(this.index);
472
- if (cc === c) return true;
473
- }
474
- this.index = this.buffer.length - 1;
475
- return false;
476
- }
477
- /**
478
- * Comments and CDATA end with `-->` and `]]>`.
479
- *
480
- * Their common qualities are:
481
- * - Their end sequences have a distinct character they start with.
482
- * - That character is then repeated, so we have to check multiple repeats.
483
- * - All characters but the start character of the sequence can be skipped.
484
- */
485
- stateInCommentLike(c) {
486
- if (c === this.currentSequence[this.sequenceIndex]) {
487
- if (++this.sequenceIndex === this.currentSequence.length) {
488
- if (this.currentSequence === Sequences.CdataEnd) this.cbs.oncdata(this.sectionStart, this.index - 2);
489
- else this.cbs.oncomment(this.sectionStart, this.index - 2);
490
- this.sequenceIndex = 0;
491
- this.sectionStart = this.index + 1;
492
- this.state = 1;
493
- }
494
- } else if (this.sequenceIndex === 0) {
495
- if (this.fastForwardTo(this.currentSequence[0])) this.sequenceIndex = 1;
496
- } else if (c !== this.currentSequence[this.sequenceIndex - 1]) this.sequenceIndex = 0;
497
- }
498
- startSpecial(sequence, offset) {
499
- this.enterRCDATA(sequence, offset);
500
- this.state = 31;
501
- }
502
- enterRCDATA(sequence, offset) {
503
- this.inRCDATA = true;
504
- this.currentSequence = sequence;
505
- this.sequenceIndex = offset;
506
- }
507
- stateBeforeTagName(c) {
508
- if (c === 33) {
509
- this.state = 22;
510
- this.sectionStart = this.index + 1;
511
- } else if (c === 63) {
512
- this.state = 24;
513
- this.sectionStart = this.index + 1;
514
- } else if (isTagStartChar(c)) {
515
- this.sectionStart = this.index;
516
- if (this.mode === 0) this.state = 6;
517
- else if (this.inSFCRoot) this.state = 34;
518
- else if (!this.inXML) if (c === 116) this.state = 30;
519
- else this.state = c === 115 ? 29 : 6;
520
- else this.state = 6;
521
- } else if (c === 47) this.state = 8;
522
- else {
523
- this.state = 1;
524
- this.stateText(c);
525
- }
526
- }
527
- stateInTagName(c) {
528
- if (isEndOfTagSection(c)) this.handleTagName(c);
529
- }
530
- stateInSFCRootTagName(c) {
531
- if (isEndOfTagSection(c)) {
532
- const tag = this.buffer.slice(this.sectionStart, this.index);
533
- if (tag !== "template") this.enterRCDATA(toCharCodes(`</` + tag), 0);
534
- this.handleTagName(c);
535
- }
536
- }
537
- handleTagName(c) {
538
- this.cbs.onopentagname(this.sectionStart, this.index);
539
- this.sectionStart = -1;
540
- this.state = 11;
541
- this.stateBeforeAttrName(c);
542
- }
543
- stateBeforeClosingTagName(c) {
544
- if (isWhitespace(c));
545
- else if (c === 62) {
546
- this.cbs.onerr(14, this.index);
547
- this.state = 1;
548
- this.sectionStart = this.index + 1;
549
- } else {
550
- this.state = isTagStartChar(c) ? 9 : 27;
551
- this.sectionStart = this.index;
552
- }
553
- }
554
- stateInClosingTagName(c) {
555
- if (c === 62 || isWhitespace(c)) {
556
- this.cbs.onclosetag(this.sectionStart, this.index);
557
- this.sectionStart = -1;
558
- this.state = 10;
559
- this.stateAfterClosingTagName(c);
560
- }
561
- }
562
- stateAfterClosingTagName(c) {
563
- if (c === 62) {
564
- this.state = 1;
565
- this.sectionStart = this.index + 1;
566
- }
567
- }
568
- stateBeforeAttrName(c) {
569
- if (c === 62) {
570
- this.cbs.onopentagend(this.index);
571
- if (this.inRCDATA) this.state = 32;
572
- else this.state = 1;
573
- this.sectionStart = this.index + 1;
574
- } else if (c === 47) {
575
- this.state = 7;
576
- if (this.peek() !== 62) this.cbs.onerr(22, this.index);
577
- } else if (c === 60 && this.peek() === 47) {
578
- this.cbs.onopentagend(this.index);
579
- this.state = 5;
580
- this.sectionStart = this.index;
581
- } else if (!isWhitespace(c)) {
582
- if (c === 61) this.cbs.onerr(19, this.index);
583
- this.handleAttrStart(c);
584
- }
585
- }
586
- handleAttrStart(c) {
587
- if (c === 118 && this.peek() === 45) {
588
- this.state = 13;
589
- this.sectionStart = this.index;
590
- } else if (c === 46 || c === 58 || c === 64 || c === 35) {
591
- this.cbs.ondirname(this.index, this.index + 1);
592
- this.state = 14;
593
- this.sectionStart = this.index + 1;
594
- } else {
595
- this.state = 12;
596
- this.sectionStart = this.index;
597
- }
598
- }
599
- stateInSelfClosingTag(c) {
600
- if (c === 62) {
601
- this.cbs.onselfclosingtag(this.index);
602
- this.state = 1;
603
- this.sectionStart = this.index + 1;
604
- this.inRCDATA = false;
605
- } else if (!isWhitespace(c)) {
606
- this.state = 11;
607
- this.stateBeforeAttrName(c);
608
- }
609
- }
610
- stateInAttrName(c) {
611
- if (c === 61 || isEndOfTagSection(c)) {
612
- this.cbs.onattribname(this.sectionStart, this.index);
613
- this.handleAttrNameEnd(c);
614
- } else if (c === 34 || c === 39 || c === 60) this.cbs.onerr(17, this.index);
615
- }
616
- stateInDirName(c) {
617
- if (c === 61 || isEndOfTagSection(c)) {
618
- this.cbs.ondirname(this.sectionStart, this.index);
619
- this.handleAttrNameEnd(c);
620
- } else if (c === 58) {
621
- this.cbs.ondirname(this.sectionStart, this.index);
622
- this.state = 14;
623
- this.sectionStart = this.index + 1;
624
- } else if (c === 46) {
625
- this.cbs.ondirname(this.sectionStart, this.index);
626
- this.state = 16;
627
- this.sectionStart = this.index + 1;
628
- }
629
- }
630
- stateInDirArg(c) {
631
- if (c === 61 || isEndOfTagSection(c)) {
632
- this.cbs.ondirarg(this.sectionStart, this.index);
633
- this.handleAttrNameEnd(c);
634
- } else if (c === 91) this.state = 15;
635
- else if (c === 46) {
636
- this.cbs.ondirarg(this.sectionStart, this.index);
637
- this.state = 16;
638
- this.sectionStart = this.index + 1;
639
- }
640
- }
641
- stateInDynamicDirArg(c) {
642
- if (c === 93) this.state = 14;
643
- else if (c === 61 || isEndOfTagSection(c)) {
644
- this.cbs.ondirarg(this.sectionStart, this.index + 1);
645
- this.handleAttrNameEnd(c);
646
- this.cbs.onerr(27, this.index);
647
- }
648
- }
649
- stateInDirModifier(c) {
650
- if (c === 61 || isEndOfTagSection(c)) {
651
- this.cbs.ondirmodifier(this.sectionStart, this.index);
652
- this.handleAttrNameEnd(c);
653
- } else if (c === 46) {
654
- this.cbs.ondirmodifier(this.sectionStart, this.index);
655
- this.sectionStart = this.index + 1;
656
- }
657
- }
658
- handleAttrNameEnd(c) {
659
- this.sectionStart = this.index;
660
- this.state = 17;
661
- this.cbs.onattribnameend(this.index);
662
- this.stateAfterAttrName(c);
663
- }
664
- stateAfterAttrName(c) {
665
- if (c === 61) this.state = 18;
666
- else if (c === 47 || c === 62) {
667
- this.cbs.onattribend(0, this.sectionStart);
668
- this.sectionStart = -1;
669
- this.state = 11;
670
- this.stateBeforeAttrName(c);
671
- } else if (!isWhitespace(c)) {
672
- this.cbs.onattribend(0, this.sectionStart);
673
- this.handleAttrStart(c);
674
- }
675
- }
676
- stateBeforeAttrValue(c) {
677
- if (c === 34) {
678
- this.state = 19;
679
- this.sectionStart = this.index + 1;
680
- } else if (c === 39) {
681
- this.state = 20;
682
- this.sectionStart = this.index + 1;
683
- } else if (!isWhitespace(c)) {
684
- this.sectionStart = this.index;
685
- this.state = 21;
686
- this.stateInAttrValueNoQuotes(c);
687
- }
688
- }
689
- handleInAttrValue(c, quote) {
690
- if (c === quote || false) {
691
- this.cbs.onattribdata(this.sectionStart, this.index);
692
- this.sectionStart = -1;
693
- this.cbs.onattribend(quote === 34 ? 3 : 2, this.index + 1);
694
- this.state = 11;
695
- } else if (c === 38) this.startEntity();
696
- }
697
- stateInAttrValueDoubleQuotes(c) {
698
- this.handleInAttrValue(c, 34);
699
- }
700
- stateInAttrValueSingleQuotes(c) {
701
- this.handleInAttrValue(c, 39);
702
- }
703
- stateInAttrValueNoQuotes(c) {
704
- if (isWhitespace(c) || c === 62) {
705
- this.cbs.onattribdata(this.sectionStart, this.index);
706
- this.sectionStart = -1;
707
- this.cbs.onattribend(1, this.index);
708
- this.state = 11;
709
- this.stateBeforeAttrName(c);
710
- } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) this.cbs.onerr(18, this.index);
711
- else if (c === 38) this.startEntity();
712
- }
713
- stateBeforeDeclaration(c) {
714
- if (c === 91) {
715
- this.state = 26;
716
- this.sequenceIndex = 0;
717
- } else this.state = c === 45 ? 25 : 23;
718
- }
719
- stateInDeclaration(c) {
720
- if (c === 62 || this.fastForwardTo(62)) {
721
- this.state = 1;
722
- this.sectionStart = this.index + 1;
723
- }
724
- }
725
- stateInProcessingInstruction(c) {
726
- if (c === 62 || this.fastForwardTo(62)) {
727
- this.cbs.onprocessinginstruction(this.sectionStart, this.index);
728
- this.state = 1;
729
- this.sectionStart = this.index + 1;
730
- }
731
- }
732
- stateBeforeComment(c) {
733
- if (c === 45) {
734
- this.state = 28;
735
- this.currentSequence = Sequences.CommentEnd;
736
- this.sequenceIndex = 2;
737
- this.sectionStart = this.index + 1;
738
- } else this.state = 23;
739
- }
740
- stateInSpecialComment(c) {
741
- if (c === 62 || this.fastForwardTo(62)) {
742
- this.cbs.oncomment(this.sectionStart, this.index);
743
- this.state = 1;
744
- this.sectionStart = this.index + 1;
745
- }
746
- }
747
- stateBeforeSpecialS(c) {
748
- if (c === Sequences.ScriptEnd[3]) this.startSpecial(Sequences.ScriptEnd, 4);
749
- else if (c === Sequences.StyleEnd[3]) this.startSpecial(Sequences.StyleEnd, 4);
750
- else {
751
- this.state = 6;
752
- this.stateInTagName(c);
753
- }
754
- }
755
- stateBeforeSpecialT(c) {
756
- if (c === Sequences.TitleEnd[3]) this.startSpecial(Sequences.TitleEnd, 4);
757
- else if (c === Sequences.TextareaEnd[3]) this.startSpecial(Sequences.TextareaEnd, 4);
758
- else {
759
- this.state = 6;
760
- this.stateInTagName(c);
761
- }
762
- }
763
- startEntity() {
764
- this.baseState = this.state;
765
- this.state = 33;
766
- this.entityStart = this.index;
767
- this.entityDecoder.startEntity(this.baseState === 1 || this.baseState === 32 ? decode_js.DecodingMode.Legacy : decode_js.DecodingMode.Attribute);
768
- }
769
- stateInEntity() {
770
- {
771
- const length = this.entityDecoder.write(this.buffer, this.index);
772
- if (length >= 0) {
773
- this.state = this.baseState;
774
- if (length === 0) this.index = this.entityStart;
775
- } else this.index = this.buffer.length - 1;
776
- }
777
- }
778
- /**
779
- * Iterates through the buffer, calling the function corresponding to the current state.
780
- *
781
- * States that are more likely to be hit are higher up, as a performance improvement.
782
- */
783
- parse(input) {
784
- this.buffer = input;
785
- while (this.index < this.buffer.length) {
786
- const c = this.buffer.charCodeAt(this.index);
787
- if (c === 10 && this.state !== 33) this.newlines.push(this.index);
788
- switch (this.state) {
789
- case 1:
790
- this.stateText(c);
791
- break;
792
- case 2:
793
- this.stateInterpolationOpen(c);
794
- break;
795
- case 3:
796
- this.stateInterpolation(c);
797
- break;
798
- case 4:
799
- this.stateInterpolationClose(c);
800
- break;
801
- case 31:
802
- this.stateSpecialStartSequence(c);
803
- break;
804
- case 32:
805
- this.stateInRCDATA(c);
806
- break;
807
- case 26:
808
- this.stateCDATASequence(c);
809
- break;
810
- case 19:
811
- this.stateInAttrValueDoubleQuotes(c);
812
- break;
813
- case 12:
814
- this.stateInAttrName(c);
815
- break;
816
- case 13:
817
- this.stateInDirName(c);
818
- break;
819
- case 14:
820
- this.stateInDirArg(c);
821
- break;
822
- case 15:
823
- this.stateInDynamicDirArg(c);
824
- break;
825
- case 16:
826
- this.stateInDirModifier(c);
827
- break;
828
- case 28:
829
- this.stateInCommentLike(c);
830
- break;
831
- case 27:
832
- this.stateInSpecialComment(c);
833
- break;
834
- case 11:
835
- this.stateBeforeAttrName(c);
836
- break;
837
- case 6:
838
- this.stateInTagName(c);
839
- break;
840
- case 34:
841
- this.stateInSFCRootTagName(c);
842
- break;
843
- case 9:
844
- this.stateInClosingTagName(c);
845
- break;
846
- case 5:
847
- this.stateBeforeTagName(c);
848
- break;
849
- case 17:
850
- this.stateAfterAttrName(c);
851
- break;
852
- case 20:
853
- this.stateInAttrValueSingleQuotes(c);
854
- break;
855
- case 18:
856
- this.stateBeforeAttrValue(c);
857
- break;
858
- case 8:
859
- this.stateBeforeClosingTagName(c);
860
- break;
861
- case 10:
862
- this.stateAfterClosingTagName(c);
863
- break;
864
- case 29:
865
- this.stateBeforeSpecialS(c);
866
- break;
867
- case 30:
868
- this.stateBeforeSpecialT(c);
869
- break;
870
- case 21:
871
- this.stateInAttrValueNoQuotes(c);
872
- break;
873
- case 7:
874
- this.stateInSelfClosingTag(c);
875
- break;
876
- case 23:
877
- this.stateInDeclaration(c);
878
- break;
879
- case 22:
880
- this.stateBeforeDeclaration(c);
881
- break;
882
- case 25:
883
- this.stateBeforeComment(c);
884
- break;
885
- case 24:
886
- this.stateInProcessingInstruction(c);
887
- break;
888
- case 33:
889
- this.stateInEntity();
890
- break;
891
- }
892
- this.index++;
893
- }
894
- this.cleanup();
895
- this.finish();
896
- }
897
- /**
898
- * Remove data that has already been consumed from the buffer.
899
- */
900
- cleanup() {
901
- if (this.sectionStart !== this.index) {
902
- if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) {
903
- this.cbs.ontext(this.sectionStart, this.index);
904
- this.sectionStart = this.index;
905
- } else if (this.state === 19 || this.state === 20 || this.state === 21) {
906
- this.cbs.onattribdata(this.sectionStart, this.index);
907
- this.sectionStart = this.index;
908
- }
909
- }
910
- }
911
- finish() {
912
- if (this.state === 33) {
913
- this.entityDecoder.end();
914
- this.state = this.baseState;
915
- }
916
- this.handleTrailingData();
917
- this.cbs.onend();
918
- }
919
- /** Handle any trailing data. */
920
- handleTrailingData() {
921
- const endIndex = this.buffer.length;
922
- if (this.sectionStart >= endIndex) return;
923
- if (this.state === 28) if (this.currentSequence === Sequences.CdataEnd) this.cbs.oncdata(this.sectionStart, endIndex);
924
- else this.cbs.oncomment(this.sectionStart, endIndex);
925
- else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9);
926
- else this.cbs.ontext(this.sectionStart, endIndex);
927
- }
928
- emitCodePoint(cp, consumed) {
929
- if (this.baseState !== 1 && this.baseState !== 32) {
930
- if (this.sectionStart < this.entityStart) this.cbs.onattribdata(this.sectionStart, this.entityStart);
931
- this.sectionStart = this.entityStart + consumed;
932
- this.index = this.sectionStart - 1;
933
- this.cbs.onattribentity(decode_js.fromCodePoint(cp), this.entityStart, this.sectionStart);
934
- } else {
935
- if (this.sectionStart < this.entityStart) this.cbs.ontext(this.sectionStart, this.entityStart);
936
- this.sectionStart = this.entityStart + consumed;
937
- this.index = this.sectionStart - 1;
938
- this.cbs.ontextentity(decode_js.fromCodePoint(cp), this.entityStart, this.sectionStart);
939
- }
940
- }
941
- };
942
- const deprecationData = {
943
- ["COMPILER_IS_ON_ELEMENT"]: {
944
- message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`,
945
- link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html`
946
- },
947
- ["COMPILER_V_BIND_SYNC"]: {
948
- message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`,
949
- link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
950
- },
951
- ["COMPILER_V_BIND_OBJECT_ORDER"]: {
952
- message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`,
953
- link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html`
954
- },
955
- ["COMPILER_V_ON_NATIVE"]: {
956
- message: `.native modifier for v-on has been removed as is no longer necessary.`,
957
- link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html`
958
- },
959
- ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: {
960
- message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`,
961
- link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html`
962
- },
963
- ["COMPILER_NATIVE_TEMPLATE"]: { message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` },
964
- ["COMPILER_INLINE_TEMPLATE"]: {
965
- message: `"inline-template" has been removed in Vue 3.`,
966
- link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html`
967
- },
968
- ["COMPILER_FILTERS"]: {
969
- message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`,
970
- link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
971
- }
972
- };
973
- function getCompatValue(key, { compatConfig }) {
974
- const value = compatConfig && compatConfig[key];
975
- if (key === "MODE") return value || 3;
976
- else return value;
977
- }
978
- function isCompatEnabled(key, context) {
979
- const mode = getCompatValue("MODE", context);
980
- const value = getCompatValue(key, context);
981
- return mode === 3 ? value === true : value !== false;
982
- }
983
- function checkCompatEnabled(key, context, loc, ...args) {
984
- const enabled = isCompatEnabled(key, context);
985
- if (enabled) warnDeprecation(key, context, loc, ...args);
986
- return enabled;
987
- }
988
- function warnDeprecation(key, context, loc, ...args) {
989
- if (getCompatValue(key, context) === "suppress-warning") return;
990
- const { message, link } = deprecationData[key];
991
- const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? `
992
- Details: ${link}` : ``}`;
993
- const err = new SyntaxError(msg);
994
- err.code = key;
995
- if (loc) err.loc = loc;
996
- context.onWarn(err);
997
- }
998
- function defaultOnError(error) {
999
- throw error;
1000
- }
1001
- function defaultOnWarn(msg) {
1002
- console.warn(`[Vue warn] ${msg.message}`);
1003
- }
1004
- function createCompilerError(code, loc, messages, additionalMessage) {
1005
- const msg = (messages || errorMessages)[code] + (additionalMessage || ``);
1006
- const error = new SyntaxError(String(msg));
1007
- error.code = code;
1008
- error.loc = loc;
1009
- return error;
1010
- }
1011
- const errorMessages = {
1012
- [0]: "Illegal comment.",
1013
- [1]: "CDATA section is allowed only in XML context.",
1014
- [2]: "Duplicate attribute.",
1015
- [3]: "End tag cannot have attributes.",
1016
- [4]: "Illegal '/' in tags.",
1017
- [5]: "Unexpected EOF in tag.",
1018
- [6]: "Unexpected EOF in CDATA section.",
1019
- [7]: "Unexpected EOF in comment.",
1020
- [8]: "Unexpected EOF in script.",
1021
- [9]: "Unexpected EOF in tag.",
1022
- [10]: "Incorrectly closed comment.",
1023
- [11]: "Incorrectly opened comment.",
1024
- [12]: "Illegal tag name. Use '&lt;' to print '<'.",
1025
- [13]: "Attribute value was expected.",
1026
- [14]: "End tag name was expected.",
1027
- [15]: "Whitespace was expected.",
1028
- [16]: "Unexpected '<!--' in comment.",
1029
- [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
1030
- [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
1031
- [19]: "Attribute name cannot start with '='.",
1032
- [21]: "'<?' is allowed only in XML context.",
1033
- [20]: `Unexpected null character.`,
1034
- [22]: "Illegal '/' in tags.",
1035
- [23]: "Invalid end tag.",
1036
- [24]: "Element is missing end tag.",
1037
- [25]: "Interpolation end sign was not found.",
1038
- [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
1039
- [26]: "Legal directive name was expected.",
1040
- [28]: `v-if/v-else-if is missing expression.`,
1041
- [29]: `v-if/else branches must use unique keys.`,
1042
- [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
1043
- [31]: `v-for is missing expression.`,
1044
- [32]: `v-for has invalid expression.`,
1045
- [33]: `<template v-for> key should be placed on the <template> tag.`,
1046
- [34]: `v-bind is missing expression.`,
1047
- [52]: `v-bind with same-name shorthand only allows static argument.`,
1048
- [35]: `v-on is missing expression.`,
1049
- [36]: `Unexpected custom directive on <slot> outlet.`,
1050
- [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
1051
- [38]: `Duplicate slot names found. `,
1052
- [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
1053
- [40]: `v-slot can only be used on components or <template> tags.`,
1054
- [41]: `v-model is missing expression.`,
1055
- [42]: `v-model value must be a valid JavaScript member expression.`,
1056
- [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
1057
- [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
1058
- Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
1059
- [45]: `Error parsing JavaScript expression: `,
1060
- [46]: `<KeepAlive> expects exactly one child component.`,
1061
- [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
1062
- [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
1063
- [48]: `ES module mode is not supported in this build of compiler.`,
1064
- [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
1065
- [50]: `"scopeId" option is only supported in module mode.`,
1066
- [53]: ``
1067
- };
1068
- function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
1069
- const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root;
1070
- estreeWalker.walk(root, {
1071
- enter(node, parent) {
1072
- parent && parentStack.push(parent);
1073
- if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) return this.skip();
1074
- if (node.type === "Identifier") {
1075
- const isLocal = !!knownIds[node.name];
1076
- const isRefed = isReferencedIdentifier(node, parent, parentStack);
1077
- if (includeAll || isRefed && !isLocal) onIdentifier(node, parent, parentStack, isRefed, isLocal);
1078
- } else if (node.type === "ObjectProperty" && (parent == null ? void 0 : parent.type) === "ObjectPattern") node.inPattern = true;
1079
- else if (isFunctionType(node)) if (node.scopeIds) node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
1080
- else walkFunctionParams(node, (id) => markScopeIdentifier(node, id, knownIds));
1081
- else if (node.type === "BlockStatement") if (node.scopeIds) node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
1082
- else walkBlockDeclarations(node, (id) => markScopeIdentifier(node, id, knownIds));
1083
- else if (node.type === "SwitchStatement") if (node.scopeIds) node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
1084
- else walkSwitchStatement(node, false, (id) => markScopeIdentifier(node, id, knownIds));
1085
- else if (node.type === "CatchClause" && node.param) if (node.scopeIds) node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
1086
- else for (const id of extractIdentifiers(node.param)) markScopeIdentifier(node, id, knownIds);
1087
- else if (isForStatement(node)) if (node.scopeIds) node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
1088
- else walkForStatement(node, false, (id) => markScopeIdentifier(node, id, knownIds));
1089
- },
1090
- leave(node, parent) {
1091
- parent && parentStack.pop();
1092
- if (node !== rootExp && node.scopeIds) for (const id of node.scopeIds) {
1093
- knownIds[id]--;
1094
- if (knownIds[id] === 0) delete knownIds[id];
1095
- }
1096
- }
1097
- });
1098
- }
1099
- function isReferencedIdentifier(id, parent, parentStack) {
1100
- if (!parent) return true;
1101
- if (id.name === "arguments") return false;
1102
- if (isReferenced(id, parent, parentStack[parentStack.length - 2])) return true;
1103
- switch (parent.type) {
1104
- case "AssignmentExpression":
1105
- case "AssignmentPattern": return true;
1106
- case "ObjectProperty": return parent.key !== id && isInDestructureAssignment(parent, parentStack);
1107
- case "ArrayPattern": return isInDestructureAssignment(parent, parentStack);
1108
- }
1109
- return false;
1110
- }
1111
- function isInDestructureAssignment(parent, parentStack) {
1112
- if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
1113
- let i = parentStack.length;
1114
- while (i--) {
1115
- const p = parentStack[i];
1116
- if (p.type === "AssignmentExpression") return true;
1117
- else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) break;
1118
- }
1119
- }
1120
- return false;
1121
- }
1122
- function isInNewExpression(parentStack) {
1123
- let i = parentStack.length;
1124
- while (i--) {
1125
- const p = parentStack[i];
1126
- if (p.type === "NewExpression") return true;
1127
- else if (p.type !== "MemberExpression") break;
1128
- }
1129
- return false;
1130
- }
1131
- function walkFunctionParams(node, onIdent) {
1132
- for (const p of node.params) for (const id of extractIdentifiers(p)) onIdent(id);
1133
- }
1134
- function walkBlockDeclarations(block, onIdent) {
1135
- const body = block.type === "SwitchCase" ? block.consequent : block.body;
1136
- for (const stmt of body) if (stmt.type === "VariableDeclaration") {
1137
- if (stmt.declare) continue;
1138
- for (const decl of stmt.declarations) for (const id of extractIdentifiers(decl.id)) onIdent(id);
1139
- } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
1140
- if (stmt.declare || !stmt.id) continue;
1141
- onIdent(stmt.id);
1142
- } else if (isForStatement(stmt)) walkForStatement(stmt, true, onIdent);
1143
- else if (stmt.type === "SwitchStatement") walkSwitchStatement(stmt, true, onIdent);
1144
- }
1145
- function isForStatement(stmt) {
1146
- return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement";
1147
- }
1148
- function walkForStatement(stmt, isVar, onIdent) {
1149
- const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
1150
- if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) for (const decl of variable.declarations) for (const id of extractIdentifiers(decl.id)) onIdent(id);
1151
- }
1152
- function walkSwitchStatement(stmt, isVar, onIdent) {
1153
- for (const cs of stmt.cases) {
1154
- for (const stmt2 of cs.consequent) if (stmt2.type === "VariableDeclaration" && (stmt2.kind === "var" ? isVar : !isVar)) for (const decl of stmt2.declarations) for (const id of extractIdentifiers(decl.id)) onIdent(id);
1155
- walkBlockDeclarations(cs, onIdent);
1156
- }
1157
- }
1158
- function extractIdentifiers(param, nodes = []) {
1159
- switch (param.type) {
1160
- case "Identifier":
1161
- nodes.push(param);
1162
- break;
1163
- case "MemberExpression":
1164
- let object = param;
1165
- while (object.type === "MemberExpression") object = object.object;
1166
- nodes.push(object);
1167
- break;
1168
- case "ObjectPattern":
1169
- for (const prop of param.properties) if (prop.type === "RestElement") extractIdentifiers(prop.argument, nodes);
1170
- else extractIdentifiers(prop.value, nodes);
1171
- break;
1172
- case "ArrayPattern":
1173
- param.elements.forEach((element) => {
1174
- if (element) extractIdentifiers(element, nodes);
1175
- });
1176
- break;
1177
- case "RestElement":
1178
- extractIdentifiers(param.argument, nodes);
1179
- break;
1180
- case "AssignmentPattern":
1181
- extractIdentifiers(param.left, nodes);
1182
- break;
1183
- }
1184
- return nodes;
1185
- }
1186
- function markKnownIds(name, knownIds) {
1187
- if (name in knownIds) knownIds[name]++;
1188
- else knownIds[name] = 1;
1189
- }
1190
- function markScopeIdentifier(node, child, knownIds) {
1191
- const { name } = child;
1192
- if (node.scopeIds && node.scopeIds.has(name)) return;
1193
- markKnownIds(name, knownIds);
1194
- (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);
1195
- }
1196
- const isFunctionType = (node) => {
1197
- return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
1198
- };
1199
- const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
1200
- const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
1201
- function isReferenced(node, parent, grandparent) {
1202
- switch (parent.type) {
1203
- case "MemberExpression":
1204
- case "OptionalMemberExpression":
1205
- if (parent.property === node) return !!parent.computed;
1206
- return parent.object === node;
1207
- case "JSXMemberExpression": return parent.object === node;
1208
- case "VariableDeclarator": return parent.init === node;
1209
- case "ArrowFunctionExpression": return parent.body === node;
1210
- case "PrivateName": return false;
1211
- case "ClassMethod":
1212
- case "ClassPrivateMethod":
1213
- case "ObjectMethod":
1214
- if (parent.key === node) return !!parent.computed;
1215
- return false;
1216
- case "ObjectProperty":
1217
- if (parent.key === node) return !!parent.computed;
1218
- return !grandparent || grandparent.type !== "ObjectPattern";
1219
- case "ClassProperty":
1220
- if (parent.key === node) return !!parent.computed;
1221
- return true;
1222
- case "ClassPrivateProperty": return parent.key !== node;
1223
- case "ClassDeclaration":
1224
- case "ClassExpression": return parent.superClass === node;
1225
- case "AssignmentExpression": return parent.right === node;
1226
- case "AssignmentPattern": return parent.right === node;
1227
- case "LabeledStatement": return false;
1228
- case "CatchClause": return false;
1229
- case "RestElement": return false;
1230
- case "BreakStatement":
1231
- case "ContinueStatement": return false;
1232
- case "FunctionDeclaration":
1233
- case "FunctionExpression": return false;
1234
- case "ExportNamespaceSpecifier":
1235
- case "ExportDefaultSpecifier": return false;
1236
- case "ExportSpecifier":
1237
- if (grandparent == null ? void 0 : grandparent.source) return false;
1238
- return parent.local === node;
1239
- case "ImportDefaultSpecifier":
1240
- case "ImportNamespaceSpecifier":
1241
- case "ImportSpecifier": return false;
1242
- case "ImportAttribute": return false;
1243
- case "JSXAttribute": return false;
1244
- case "ObjectPattern":
1245
- case "ArrayPattern": return false;
1246
- case "MetaProperty": return false;
1247
- case "ObjectTypeProperty": return parent.key !== node;
1248
- case "TSEnumMember": return parent.id !== node;
1249
- case "TSPropertySignature":
1250
- if (parent.key === node) return !!parent.computed;
1251
- return true;
1252
- }
1253
- return true;
1254
- }
1255
- const TS_NODE_TYPES = [
1256
- "TSAsExpression",
1257
- "TSTypeAssertion",
1258
- "TSNonNullExpression",
1259
- "TSInstantiationExpression",
1260
- "TSSatisfiesExpression"
1261
- ];
1262
- const isStaticExp = (p) => p.type === 4 && p.isStatic;
1263
- function isCoreComponent(tag) {
1264
- switch (tag) {
1265
- case "Teleport":
1266
- case "teleport": return TELEPORT;
1267
- case "Suspense":
1268
- case "suspense": return SUSPENSE;
1269
- case "KeepAlive":
1270
- case "keep-alive": return KEEP_ALIVE;
1271
- case "BaseTransition":
1272
- case "base-transition": return BASE_TRANSITION;
1273
- }
1274
- }
1275
- const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
1276
- const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
1277
- function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
1278
- return advancePositionWithMutation({
1279
- offset: pos.offset,
1280
- line: pos.line,
1281
- column: pos.column
1282
- }, source, numberOfCharacters);
1283
- }
1284
- function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {
1285
- let linesCount = 0;
1286
- let lastNewLinePos = -1;
1287
- for (let i = 0; i < numberOfCharacters; i++) if (source.charCodeAt(i) === 10) {
1288
- linesCount++;
1289
- lastNewLinePos = i;
1290
- }
1291
- pos.offset += numberOfCharacters;
1292
- pos.line += linesCount;
1293
- pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos;
1294
- return pos;
1295
- }
1296
- function findDir(node, name, allowEmpty = false) {
1297
- for (let i = 0; i < node.props.length; i++) {
1298
- const p = node.props[i];
1299
- if (p.type === 7 && (allowEmpty || p.exp) && (shared.isString(name) ? p.name === name : name.test(p.name))) return p;
1300
- }
1301
- }
1302
- function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
1303
- for (let i = 0; i < node.props.length; i++) {
1304
- const p = node.props[i];
1305
- if (p.type === 6) {
1306
- if (dynamicOnly) continue;
1307
- if (p.name === name && (p.value || allowEmpty)) return p;
1308
- } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) return p;
1309
- }
1310
- }
1311
- function isStaticArgOf(arg, name) {
1312
- return !!(arg && isStaticExp(arg) && arg.content === name);
1313
- }
1314
- function isVPre(p) {
1315
- return p.type === 7 && p.name === "pre";
1316
- }
1317
- function isVSlot(p) {
1318
- return p.type === 7 && p.name === "slot";
1319
- }
1320
- function isTemplateNode(node) {
1321
- return node.type === 1 && node.tagType === 3;
1322
- }
1323
- function isSlotOutlet(node) {
1324
- return node.type === 1 && node.tagType === 2;
1325
- }
1326
- const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
1327
- function getUnnormalizedProps(props, callPath = []) {
1328
- if (props && !shared.isString(props) && props.type === 14) {
1329
- const callee = props.callee;
1330
- if (!shared.isString(callee) && propsHelperSet.has(callee)) return getUnnormalizedProps(props.arguments[0], callPath.concat(props));
1331
- }
1332
- return [props, callPath];
1333
- }
1334
- function injectProp(node, prop, context) {
1335
- let propsWithInjection;
1336
- let props = node.type === 13 ? node.props : node.arguments[2];
1337
- let callPath = [];
1338
- let parentCall;
1339
- if (props && !shared.isString(props) && props.type === 14) {
1340
- const ret = getUnnormalizedProps(props);
1341
- props = ret[0];
1342
- callPath = ret[1];
1343
- parentCall = callPath[callPath.length - 1];
1344
- }
1345
- if (props == null || shared.isString(props)) propsWithInjection = createObjectExpression([prop]);
1346
- else if (props.type === 14) {
1347
- const first = props.arguments[0];
1348
- if (!shared.isString(first) && first.type === 15) {
1349
- if (!hasProp(prop, first)) first.properties.unshift(prop);
1350
- } else if (props.callee === TO_HANDLERS) propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [createObjectExpression([prop]), props]);
1351
- else props.arguments.unshift(createObjectExpression([prop]));
1352
- !propsWithInjection && (propsWithInjection = props);
1353
- } else if (props.type === 15) {
1354
- if (!hasProp(prop, props)) props.properties.unshift(prop);
1355
- propsWithInjection = props;
1356
- } else {
1357
- propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [createObjectExpression([prop]), props]);
1358
- if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) parentCall = callPath[callPath.length - 2];
1359
- }
1360
- if (node.type === 13) if (parentCall) parentCall.arguments[0] = propsWithInjection;
1361
- else node.props = propsWithInjection;
1362
- else if (parentCall) parentCall.arguments[0] = propsWithInjection;
1363
- else node.arguments[2] = propsWithInjection;
1364
- }
1365
- function hasProp(prop, props) {
1366
- let result = false;
1367
- if (prop.key.type === 4) {
1368
- const propKeyName = prop.key.content;
1369
- result = props.properties.some((p) => p.key.type === 4 && p.key.content === propKeyName);
1370
- }
1371
- return result;
1372
- }
1373
- function getMemoedVNodeCall(node) {
1374
- if (node.type === 14 && node.callee === WITH_MEMO) return node.arguments[1].returns;
1375
- else return node;
1376
- }
1377
- const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
1378
- const defaultParserOptions = {
1379
- parseMode: "base",
1380
- ns: 0,
1381
- delimiters: [`{{`, `}}`],
1382
- getNamespace: () => 0,
1383
- isVoidTag: shared.NO,
1384
- isPreTag: shared.NO,
1385
- isIgnoreNewlineTag: shared.NO,
1386
- isCustomElement: shared.NO,
1387
- onError: defaultOnError,
1388
- onWarn: defaultOnWarn,
1389
- comments: true,
1390
- prefixIdentifiers: false
1391
- };
1392
- let currentOptions = defaultParserOptions;
1393
- let currentRoot = null;
1394
- let currentInput = "";
1395
- let currentOpenTag = null;
1396
- let currentProp = null;
1397
- let currentAttrValue = "";
1398
- let currentAttrStartIndex = -1;
1399
- let currentAttrEndIndex = -1;
1400
- let inPre = 0;
1401
- let inVPre = false;
1402
- let currentVPreBoundary = null;
1403
- const stack = [];
1404
- const tokenizer = new Tokenizer(stack, {
1405
- onerr: emitError,
1406
- ontext(start, end) {
1407
- onText(getSlice(start, end), start, end);
1408
- },
1409
- ontextentity(char, start, end) {
1410
- onText(char, start, end);
1411
- },
1412
- oninterpolation(start, end) {
1413
- if (inVPre) return onText(getSlice(start, end), start, end);
1414
- let innerStart = start + tokenizer.delimiterOpen.length;
1415
- let innerEnd = end - tokenizer.delimiterClose.length;
1416
- while (isWhitespace(currentInput.charCodeAt(innerStart))) innerStart++;
1417
- while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) innerEnd--;
1418
- let exp = getSlice(innerStart, innerEnd);
1419
- if (exp.includes("&")) exp = decode_js.decodeHTML(exp);
1420
- addNode({
1421
- type: 5,
1422
- content: createExp(exp, false, getLoc(innerStart, innerEnd)),
1423
- loc: getLoc(start, end)
1424
- });
1425
- },
1426
- onopentagname(start, end) {
1427
- const name = getSlice(start, end);
1428
- currentOpenTag = {
1429
- type: 1,
1430
- tag: name,
1431
- ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns),
1432
- tagType: 0,
1433
- props: [],
1434
- children: [],
1435
- loc: getLoc(start - 1, end),
1436
- codegenNode: void 0
1437
- };
1438
- },
1439
- onopentagend(end) {
1440
- endOpenTag(end);
1441
- },
1442
- onclosetag(start, end) {
1443
- const name = getSlice(start, end);
1444
- if (!currentOptions.isVoidTag(name)) {
1445
- let found = false;
1446
- for (let i = 0; i < stack.length; i++) if (stack[i].tag.toLowerCase() === name.toLowerCase()) {
1447
- found = true;
1448
- if (i > 0) emitError(24, stack[0].loc.start.offset);
1449
- for (let j = 0; j <= i; j++) onCloseTag(stack.shift(), end, j < i);
1450
- break;
1451
- }
1452
- if (!found) emitError(23, backTrack(start, 60));
1453
- }
1454
- },
1455
- onselfclosingtag(end) {
1456
- const name = currentOpenTag.tag;
1457
- currentOpenTag.isSelfClosing = true;
1458
- endOpenTag(end);
1459
- if (stack[0] && stack[0].tag === name) onCloseTag(stack.shift(), end);
1460
- },
1461
- onattribname(start, end) {
1462
- currentProp = {
1463
- type: 6,
1464
- name: getSlice(start, end),
1465
- nameLoc: getLoc(start, end),
1466
- value: void 0,
1467
- loc: getLoc(start)
1468
- };
1469
- },
1470
- ondirname(start, end) {
1471
- const raw = getSlice(start, end);
1472
- const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2);
1473
- if (!inVPre && name === "") emitError(26, start);
1474
- if (inVPre || name === "") currentProp = {
1475
- type: 6,
1476
- name: raw,
1477
- nameLoc: getLoc(start, end),
1478
- value: void 0,
1479
- loc: getLoc(start)
1480
- };
1481
- else {
1482
- currentProp = {
1483
- type: 7,
1484
- name,
1485
- rawName: raw,
1486
- exp: void 0,
1487
- arg: void 0,
1488
- modifiers: raw === "." ? [createSimpleExpression("prop")] : [],
1489
- loc: getLoc(start)
1490
- };
1491
- if (name === "pre") {
1492
- inVPre = tokenizer.inVPre = true;
1493
- currentVPreBoundary = currentOpenTag;
1494
- const props = currentOpenTag.props;
1495
- for (let i = 0; i < props.length; i++) if (props[i].type === 7) props[i] = dirToAttr(props[i]);
1496
- }
1497
- }
1498
- },
1499
- ondirarg(start, end) {
1500
- if (start === end) return;
1501
- const arg = getSlice(start, end);
1502
- if (inVPre && !isVPre(currentProp)) {
1503
- currentProp.name += arg;
1504
- setLocEnd(currentProp.nameLoc, end);
1505
- } else {
1506
- const isStatic = arg[0] !== `[`;
1507
- currentProp.arg = createExp(isStatic ? arg : arg.slice(1, -1), isStatic, getLoc(start, end), isStatic ? 3 : 0);
1508
- }
1509
- },
1510
- ondirmodifier(start, end) {
1511
- const mod = getSlice(start, end);
1512
- if (inVPre && !isVPre(currentProp)) {
1513
- currentProp.name += "." + mod;
1514
- setLocEnd(currentProp.nameLoc, end);
1515
- } else if (currentProp.name === "slot") {
1516
- const arg = currentProp.arg;
1517
- if (arg) {
1518
- arg.content += "." + mod;
1519
- setLocEnd(arg.loc, end);
1520
- }
1521
- } else {
1522
- const exp = createSimpleExpression(mod, true, getLoc(start, end));
1523
- currentProp.modifiers.push(exp);
1524
- }
1525
- },
1526
- onattribdata(start, end) {
1527
- currentAttrValue += getSlice(start, end);
1528
- if (currentAttrStartIndex < 0) currentAttrStartIndex = start;
1529
- currentAttrEndIndex = end;
1530
- },
1531
- onattribentity(char, start, end) {
1532
- currentAttrValue += char;
1533
- if (currentAttrStartIndex < 0) currentAttrStartIndex = start;
1534
- currentAttrEndIndex = end;
1535
- },
1536
- onattribnameend(end) {
1537
- const start = currentProp.loc.start.offset;
1538
- const name = getSlice(start, end);
1539
- if (currentProp.type === 7) currentProp.rawName = name;
1540
- if (currentOpenTag.props.some((p) => (p.type === 7 ? p.rawName : p.name) === name)) emitError(2, start);
1541
- },
1542
- onattribend(quote, end) {
1543
- if (currentOpenTag && currentProp) {
1544
- setLocEnd(currentProp.loc, end);
1545
- if (quote !== 0) if (currentProp.type === 6) {
1546
- if (currentProp.name === "class") currentAttrValue = condense(currentAttrValue).trim();
1547
- if (quote === 1 && !currentAttrValue) emitError(13, end);
1548
- currentProp.value = {
1549
- type: 2,
1550
- content: currentAttrValue,
1551
- loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1)
1552
- };
1553
- if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
1554
- } else {
1555
- let expParseMode = 0;
1556
- if (currentProp.name === "for") expParseMode = 3;
1557
- else if (currentProp.name === "slot") expParseMode = 1;
1558
- else if (currentProp.name === "on" && currentAttrValue.includes(";")) expParseMode = 2;
1559
- currentProp.exp = createExp(currentAttrValue, false, getLoc(currentAttrStartIndex, currentAttrEndIndex), 0, expParseMode);
1560
- if (currentProp.name === "for") currentProp.forParseResult = parseForExpression(currentProp.exp);
1561
- let syncIndex = -1;
1562
- if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex((mod) => mod.content === "sync")) > -1 && checkCompatEnabled("COMPILER_V_BIND_SYNC", currentOptions, currentProp.loc, currentProp.arg.loc.source)) {
1563
- currentProp.name = "model";
1564
- currentProp.modifiers.splice(syncIndex, 1);
1565
- }
1566
- }
1567
- if (currentProp.type !== 7 || currentProp.name !== "pre") currentOpenTag.props.push(currentProp);
1568
- }
1569
- currentAttrValue = "";
1570
- currentAttrStartIndex = currentAttrEndIndex = -1;
1571
- },
1572
- oncomment(start, end) {
1573
- if (currentOptions.comments) addNode({
1574
- type: 3,
1575
- content: getSlice(start, end),
1576
- loc: getLoc(start - 4, end + 3)
1577
- });
1578
- },
1579
- onend() {
1580
- const end = currentInput.length;
1581
- if (tokenizer.state !== 1) switch (tokenizer.state) {
1582
- case 5:
1583
- case 8:
1584
- emitError(5, end);
1585
- break;
1586
- case 3:
1587
- case 4:
1588
- emitError(25, tokenizer.sectionStart);
1589
- break;
1590
- case 28:
1591
- if (tokenizer.currentSequence === Sequences.CdataEnd) emitError(6, end);
1592
- else emitError(7, end);
1593
- break;
1594
- case 6:
1595
- case 7:
1596
- case 9:
1597
- case 11:
1598
- case 12:
1599
- case 13:
1600
- case 14:
1601
- case 15:
1602
- case 16:
1603
- case 17:
1604
- case 18:
1605
- case 19:
1606
- case 20:
1607
- case 21:
1608
- emitError(9, end);
1609
- break;
1610
- }
1611
- for (let index = 0; index < stack.length; index++) {
1612
- onCloseTag(stack[index], end - 1);
1613
- emitError(24, stack[index].loc.start.offset);
1614
- }
1615
- },
1616
- oncdata(start, end) {
1617
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
1618
- else emitError(1, start - 9);
1619
- },
1620
- onprocessinginstruction(start) {
1621
- if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) emitError(21, start - 1);
1622
- }
1623
- });
1624
- const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
1625
- const stripParensRE = /^\(|\)$/g;
1626
- function parseForExpression(input) {
1627
- const loc = input.loc;
1628
- const exp = input.content;
1629
- const inMatch = exp.match(forAliasRE);
1630
- if (!inMatch) return;
1631
- const [, LHS, RHS] = inMatch;
1632
- const createAliasExpression = (content, offset, asParam = false) => {
1633
- const start = loc.start.offset + offset;
1634
- return createExp(content, false, getLoc(start, start + content.length), 0, asParam ? 1 : 0);
1635
- };
1636
- const result = {
1637
- source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
1638
- value: void 0,
1639
- key: void 0,
1640
- index: void 0,
1641
- finalized: false
1642
- };
1643
- let valueContent = LHS.trim().replace(stripParensRE, "").trim();
1644
- const trimmedOffset = LHS.indexOf(valueContent);
1645
- const iteratorMatch = valueContent.match(forIteratorRE);
1646
- if (iteratorMatch) {
1647
- valueContent = valueContent.replace(forIteratorRE, "").trim();
1648
- const keyContent = iteratorMatch[1].trim();
1649
- let keyOffset;
1650
- if (keyContent) {
1651
- keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
1652
- result.key = createAliasExpression(keyContent, keyOffset, true);
1653
- }
1654
- if (iteratorMatch[2]) {
1655
- const indexContent = iteratorMatch[2].trim();
1656
- if (indexContent) result.index = createAliasExpression(indexContent, exp.indexOf(indexContent, result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length), true);
1657
- }
1658
- }
1659
- if (valueContent) result.value = createAliasExpression(valueContent, trimmedOffset, true);
1660
- return result;
1661
- }
1662
- function getSlice(start, end) {
1663
- return currentInput.slice(start, end);
1664
- }
1665
- function endOpenTag(end) {
1666
- if (tokenizer.inSFCRoot) currentOpenTag.innerLoc = getLoc(end + 1, end + 1);
1667
- addNode(currentOpenTag);
1668
- const { tag, ns } = currentOpenTag;
1669
- if (ns === 0 && currentOptions.isPreTag(tag)) inPre++;
1670
- if (currentOptions.isVoidTag(tag)) onCloseTag(currentOpenTag, end);
1671
- else {
1672
- stack.unshift(currentOpenTag);
1673
- if (ns === 1 || ns === 2) tokenizer.inXML = true;
1674
- }
1675
- currentOpenTag = null;
1676
- }
1677
- function onText(content, start, end) {
1678
- const parent = stack[0] || currentRoot;
1679
- const lastNode = parent.children[parent.children.length - 1];
1680
- if (lastNode && lastNode.type === 2) {
1681
- lastNode.content += content;
1682
- setLocEnd(lastNode.loc, end);
1683
- } else parent.children.push({
1684
- type: 2,
1685
- content,
1686
- loc: getLoc(start, end)
1687
- });
1688
- }
1689
- function onCloseTag(el, end, isImplied = false) {
1690
- if (isImplied) setLocEnd(el.loc, backTrack(end, 60));
1691
- else setLocEnd(el.loc, lookAhead(end, 62) + 1);
1692
- if (tokenizer.inSFCRoot) {
1693
- if (el.children.length) el.innerLoc.end = shared.extend({}, el.children[el.children.length - 1].loc.end);
1694
- else el.innerLoc.end = shared.extend({}, el.innerLoc.start);
1695
- el.innerLoc.source = getSlice(el.innerLoc.start.offset, el.innerLoc.end.offset);
1696
- }
1697
- const { tag, ns, children } = el;
1698
- if (!inVPre) {
1699
- if (tag === "slot") el.tagType = 2;
1700
- else if (isFragmentTemplate(el)) el.tagType = 3;
1701
- else if (isComponent(el)) el.tagType = 1;
1702
- }
1703
- if (!tokenizer.inRCDATA) el.children = condenseWhitespace(children);
1704
- if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
1705
- const first = children[0];
1706
- if (first && first.type === 2) first.content = first.content.replace(/^\r?\n/, "");
1707
- }
1708
- if (ns === 0 && currentOptions.isPreTag(tag)) inPre--;
1709
- if (currentVPreBoundary === el) {
1710
- inVPre = tokenizer.inVPre = false;
1711
- currentVPreBoundary = null;
1712
- }
1713
- if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) tokenizer.inXML = false;
1714
- {
1715
- const props = el.props;
1716
- if (isCompatEnabled("COMPILER_V_IF_V_FOR_PRECEDENCE", currentOptions)) {
1717
- let hasIf = false;
1718
- let hasFor = false;
1719
- for (let i = 0; i < props.length; i++) {
1720
- const p = props[i];
1721
- if (p.type === 7) {
1722
- if (p.name === "if") hasIf = true;
1723
- else if (p.name === "for") hasFor = true;
1724
- }
1725
- if (hasIf && hasFor) {
1726
- warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE", currentOptions, el.loc);
1727
- break;
1728
- }
1729
- }
1730
- }
1731
- if (!tokenizer.inSFCRoot && isCompatEnabled("COMPILER_NATIVE_TEMPLATE", currentOptions) && el.tag === "template" && !isFragmentTemplate(el)) {
1732
- warnDeprecation("COMPILER_NATIVE_TEMPLATE", currentOptions, el.loc);
1733
- const parent = stack[0] || currentRoot;
1734
- const index = parent.children.indexOf(el);
1735
- parent.children.splice(index, 1, ...el.children);
1736
- }
1737
- const inlineTemplateProp = props.find((p) => p.type === 6 && p.name === "inline-template");
1738
- if (inlineTemplateProp && checkCompatEnabled("COMPILER_INLINE_TEMPLATE", currentOptions, inlineTemplateProp.loc) && el.children.length) inlineTemplateProp.value = {
1739
- type: 2,
1740
- content: getSlice(el.children[0].loc.start.offset, el.children[el.children.length - 1].loc.end.offset),
1741
- loc: inlineTemplateProp.loc
1742
- };
1743
- }
1744
- }
1745
- function lookAhead(index, c) {
1746
- let i = index;
1747
- while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++;
1748
- return i;
1749
- }
1750
- function backTrack(index, c) {
1751
- let i = index;
1752
- while (currentInput.charCodeAt(i) !== c && i >= 0) i--;
1753
- return i;
1754
- }
1755
- const specialTemplateDir = /* @__PURE__ */ new Set([
1756
- "if",
1757
- "else",
1758
- "else-if",
1759
- "for",
1760
- "slot"
1761
- ]);
1762
- function isFragmentTemplate({ tag, props }) {
1763
- if (tag === "template") {
1764
- for (let i = 0; i < props.length; i++) if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) return true;
1765
- }
1766
- return false;
1767
- }
1768
- function isComponent({ tag, props }) {
1769
- if (currentOptions.isCustomElement(tag)) return false;
1770
- if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) return true;
1771
- for (let i = 0; i < props.length; i++) {
1772
- const p = props[i];
1773
- if (p.type === 6) {
1774
- if (p.name === "is" && p.value) {
1775
- if (p.value.content.startsWith("vue:")) return true;
1776
- else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT", currentOptions, p.loc)) return true;
1777
- }
1778
- } else if (p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled("COMPILER_IS_ON_ELEMENT", currentOptions, p.loc)) return true;
1779
- }
1780
- return false;
1781
- }
1782
- function isUpperCase(c) {
1783
- return c > 64 && c < 91;
1784
- }
1785
- const windowsNewlineRE = /\r\n/g;
1786
- function condenseWhitespace(nodes) {
1787
- const shouldCondense = currentOptions.whitespace !== "preserve";
1788
- let removedWhitespace = false;
1789
- for (let i = 0; i < nodes.length; i++) {
1790
- const node = nodes[i];
1791
- if (node.type === 2) if (!inPre) {
1792
- if (isAllWhitespace(node.content)) {
1793
- const prev = nodes[i - 1] && nodes[i - 1].type;
1794
- const next = nodes[i + 1] && nodes[i + 1].type;
1795
- if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
1796
- removedWhitespace = true;
1797
- nodes[i] = null;
1798
- } else node.content = " ";
1799
- } else if (shouldCondense) node.content = condense(node.content);
1800
- } else node.content = node.content.replace(windowsNewlineRE, "\n");
1801
- }
1802
- return removedWhitespace ? nodes.filter(Boolean) : nodes;
1803
- }
1804
- function isAllWhitespace(str) {
1805
- for (let i = 0; i < str.length; i++) if (!isWhitespace(str.charCodeAt(i))) return false;
1806
- return true;
1807
- }
1808
- function hasNewlineChar(str) {
1809
- for (let i = 0; i < str.length; i++) {
1810
- const c = str.charCodeAt(i);
1811
- if (c === 10 || c === 13) return true;
1812
- }
1813
- return false;
1814
- }
1815
- function condense(str) {
1816
- let ret = "";
1817
- let prevCharIsWhitespace = false;
1818
- for (let i = 0; i < str.length; i++) if (isWhitespace(str.charCodeAt(i))) {
1819
- if (!prevCharIsWhitespace) {
1820
- ret += " ";
1821
- prevCharIsWhitespace = true;
1822
- }
1823
- } else {
1824
- ret += str[i];
1825
- prevCharIsWhitespace = false;
1826
- }
1827
- return ret;
1828
- }
1829
- function addNode(node) {
1830
- (stack[0] || currentRoot).children.push(node);
1831
- }
1832
- function getLoc(start, end) {
1833
- return {
1834
- start: tokenizer.getPos(start),
1835
- end: end == null ? end : tokenizer.getPos(end),
1836
- source: end == null ? end : getSlice(start, end)
1837
- };
1838
- }
1839
- function cloneLoc(loc) {
1840
- return getLoc(loc.start.offset, loc.end.offset);
1841
- }
1842
- function setLocEnd(loc, end) {
1843
- loc.end = tokenizer.getPos(end);
1844
- loc.source = getSlice(loc.start.offset, end);
1845
- }
1846
- function dirToAttr(dir) {
1847
- const attr = {
1848
- type: 6,
1849
- name: dir.rawName,
1850
- nameLoc: getLoc(dir.loc.start.offset, dir.loc.start.offset + dir.rawName.length),
1851
- value: void 0,
1852
- loc: dir.loc
1853
- };
1854
- if (dir.exp) {
1855
- const loc = dir.exp.loc;
1856
- if (loc.end.offset < dir.loc.end.offset) {
1857
- loc.start.offset--;
1858
- loc.start.column--;
1859
- loc.end.offset++;
1860
- loc.end.column++;
1861
- }
1862
- attr.value = {
1863
- type: 2,
1864
- content: dir.exp.content,
1865
- loc
1866
- };
1867
- }
1868
- return attr;
1869
- }
1870
- function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0) {
1871
- const exp = createSimpleExpression(content, isStatic, loc, constType);
1872
- if (!isStatic && currentOptions.prefixIdentifiers && parseMode !== 3 && content.trim()) {
1873
- if (isSimpleIdentifier(content)) {
1874
- exp.ast = null;
1875
- return exp;
1876
- }
1877
- try {
1878
- const plugins = currentOptions.expressionPlugins;
1879
- const options = { plugins: plugins ? [...plugins, "typescript"] : ["typescript"] };
1880
- if (parseMode === 2) exp.ast = parser.parse(` ${content} `, options).program;
1881
- else if (parseMode === 1) exp.ast = parser.parseExpression(`(${content})=>{}`, options);
1882
- else exp.ast = parser.parseExpression(`(${content})`, options);
1883
- } catch (e) {
1884
- exp.ast = false;
1885
- emitError(45, loc.start.offset, e.message);
1886
- }
1887
- }
1888
- return exp;
1889
- }
1890
- function emitError(code, index, message) {
1891
- currentOptions.onError(createCompilerError(code, getLoc(index, index), void 0, message));
1892
- }
1893
- function traverseChildren(parent, context) {
1894
- let i = 0;
1895
- const nodeRemoved = () => {
1896
- i--;
1897
- };
1898
- for (; i < parent.children.length; i++) {
1899
- const child = parent.children[i];
1900
- if (shared.isString(child)) continue;
1901
- context.grandParent = context.parent;
1902
- context.parent = parent;
1903
- context.childIndex = i;
1904
- context.onNodeRemoved = nodeRemoved;
1905
- traverseNode(child, context);
1906
- }
1907
- }
1908
- function traverseNode(node, context) {
1909
- context.currentNode = node;
1910
- const { nodeTransforms } = context;
1911
- const exitFns = [];
1912
- for (let i2 = 0; i2 < nodeTransforms.length; i2++) {
1913
- const onExit = nodeTransforms[i2](node, context);
1914
- if (onExit) if (shared.isArray(onExit)) exitFns.push(...onExit);
1915
- else exitFns.push(onExit);
1916
- if (!context.currentNode) return;
1917
- else node = context.currentNode;
1918
- }
1919
- switch (node.type) {
1920
- case 3:
1921
- if (!context.ssr) context.helper(CREATE_COMMENT);
1922
- break;
1923
- case 5:
1924
- if (!context.ssr) context.helper(TO_DISPLAY_STRING);
1925
- break;
1926
- case 9:
1927
- for (let i2 = 0; i2 < node.branches.length; i2++) traverseNode(node.branches[i2], context);
1928
- break;
1929
- case 10:
1930
- case 11:
1931
- case 1:
1932
- case 0:
1933
- traverseChildren(node, context);
1934
- break;
1935
- }
1936
- context.currentNode = node;
1937
- let i = exitFns.length;
1938
- while (i--) exitFns[i]();
1939
- }
1940
- function createStructuralDirectiveTransform(name, fn) {
1941
- const matches = shared.isString(name) ? (n) => n === name : (n) => name.test(n);
1942
- return (node, context) => {
1943
- if (node.type === 1) {
1944
- const { props } = node;
1945
- if (node.tagType === 3 && props.some(isVSlot)) return;
1946
- const exitFns = [];
1947
- for (let i = 0; i < props.length; i++) {
1948
- const prop = props[i];
1949
- if (prop.type === 7 && matches(prop.name)) {
1950
- props.splice(i, 1);
1951
- i--;
1952
- const onExit = fn(node, prop, context);
1953
- if (onExit) exitFns.push(onExit);
1954
- }
1955
- }
1956
- return exitFns;
1957
- }
1958
- };
1959
- }
1960
- const isLiteralWhitelisted = /* @__PURE__ */ shared.makeMap("true,false,null,this");
1961
- function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) {
1962
- if (!context.prefixIdentifiers || !node.content.trim()) return node;
1963
- const { inline, bindingMetadata } = context;
1964
- const rewriteIdentifier = (raw, parent, id) => {
1965
- const type = shared.hasOwn(bindingMetadata, raw) && bindingMetadata[raw];
1966
- if (inline) {
1967
- const isAssignmentLVal = parent && parent.type === "AssignmentExpression" && parent.left === id;
1968
- const isUpdateArg = parent && parent.type === "UpdateExpression" && parent.argument === id;
1969
- const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack);
1970
- const isNewExpression = parent && isInNewExpression(parentStack);
1971
- const wrapWithUnref = (raw2) => {
1972
- const wrapped = `${context.helperString(UNREF)}(${raw2})`;
1973
- return isNewExpression ? `(${wrapped})` : wrapped;
1974
- };
1975
- if (isConst(type) || type === "setup-reactive-const" || localVars[raw]) return raw;
1976
- else if (type === "setup-ref") return `${raw}.value`;
1977
- else if (type === "setup-maybe-ref") return isAssignmentLVal || isUpdateArg || isDestructureAssignment ? `${raw}.value` : wrapWithUnref(raw);
1978
- else if (type === "setup-let") if (isAssignmentLVal) {
1979
- const { right: rVal, operator } = parent;
1980
- const rExpString = stringifyExpression(processExpression(createSimpleExpression(rawExp.slice(rVal.start - 1, rVal.end - 1), false), context, false, false, knownIds));
1981
- return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore
1982
- ` : ``} ? ${raw}.value ${operator} ${rExpString} : ${raw}`;
1983
- } else if (isUpdateArg) {
1984
- id.start = parent.start;
1985
- id.end = parent.end;
1986
- const { prefix: isPrefix, operator } = parent;
1987
- const prefix = isPrefix ? operator : ``;
1988
- const postfix = isPrefix ? `` : operator;
1989
- return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore
1990
- ` : ``} ? ${prefix}${raw}.value${postfix} : ${prefix}${raw}${postfix}`;
1991
- } else if (isDestructureAssignment) return raw;
1992
- else return wrapWithUnref(raw);
1993
- else if (type === "props") return shared.genPropsAccessExp(raw);
1994
- else if (type === "props-aliased") return shared.genPropsAccessExp(bindingMetadata.__propsAliases[raw]);
1995
- } else if (type && type.startsWith("setup") || type === "literal-const") return `$setup.${raw}`;
1996
- else if (type === "props-aliased") return `$props['${bindingMetadata.__propsAliases[raw]}']`;
1997
- else if (type) return `$${type}.${raw}`;
1998
- return `_ctx.${raw}`;
1999
- };
2000
- const rawExp = node.content;
2001
- let ast = node.ast;
2002
- if (ast === false) return node;
2003
- if (ast === null || !ast && isSimpleIdentifier(rawExp)) {
2004
- const isScopeVarReference = context.identifiers[rawExp];
2005
- const isAllowedGlobal = shared.isGloballyAllowed(rawExp);
2006
- const isLiteral = isLiteralWhitelisted(rawExp);
2007
- if (!asParams && !isScopeVarReference && !isLiteral && (!isAllowedGlobal || bindingMetadata[rawExp])) {
2008
- if (isConst(bindingMetadata[rawExp])) node.constType = 1;
2009
- node.content = rewriteIdentifier(rawExp);
2010
- } else if (!isScopeVarReference) if (isLiteral) node.constType = 3;
2011
- else node.constType = 2;
2012
- return node;
2013
- }
2014
- if (!ast) {
2015
- const source = asRawStatements ? ` ${rawExp} ` : `(${rawExp})${asParams ? `=>{}` : ``}`;
2016
- try {
2017
- ast = parser.parseExpression(source, {
2018
- sourceType: "module",
2019
- plugins: context.expressionPlugins
2020
- });
2021
- } catch (e) {
2022
- context.onError(createCompilerError(45, node.loc, void 0, e.message));
2023
- return node;
2024
- }
2025
- }
2026
- const ids = [];
2027
- const parentStack = [];
2028
- const knownIds = Object.create(context.identifiers);
2029
- walkIdentifiers(ast, (node2, parent, _, isReferenced$1, isLocal) => {
2030
- if (isStaticPropertyKey(node2, parent)) return;
2031
- if (node2.name.startsWith("_filter_")) return;
2032
- const needPrefix = isReferenced$1 && canPrefix(node2);
2033
- if (needPrefix && !isLocal) {
2034
- if (isStaticProperty(parent) && parent.shorthand) node2.prefix = `${node2.name}: `;
2035
- node2.name = rewriteIdentifier(node2.name, parent, node2);
2036
- ids.push(node2);
2037
- } else {
2038
- if (!(needPrefix && isLocal) && (!parent || parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "MemberExpression")) node2.isConstant = true;
2039
- ids.push(node2);
2040
- }
2041
- }, true, parentStack, knownIds);
2042
- const children = [];
2043
- ids.sort((a, b) => a.start - b.start);
2044
- ids.forEach((id, i) => {
2045
- const start = id.start - 1;
2046
- const end = id.end - 1;
2047
- const last = ids[i - 1];
2048
- const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
2049
- if (leadingText.length || id.prefix) children.push(leadingText + (id.prefix || ``));
2050
- const source = rawExp.slice(start, end);
2051
- children.push(createSimpleExpression(id.name, false, {
2052
- start: advancePositionWithClone(node.loc.start, source, start),
2053
- end: advancePositionWithClone(node.loc.start, source, end),
2054
- source
2055
- }, id.isConstant ? 3 : 0));
2056
- if (i === ids.length - 1 && end < rawExp.length) children.push(rawExp.slice(end));
2057
- });
2058
- let ret;
2059
- if (children.length) {
2060
- ret = createCompoundExpression(children, node.loc);
2061
- ret.ast = ast;
2062
- } else {
2063
- ret = node;
2064
- ret.constType = 3;
2065
- }
2066
- ret.identifiers = Object.keys(knownIds);
2067
- return ret;
2068
- }
2069
- function canPrefix(id) {
2070
- if (shared.isGloballyAllowed(id.name)) return false;
2071
- if (id.name === "require") return false;
2072
- return true;
2073
- }
2074
- function stringifyExpression(exp) {
2075
- if (shared.isString(exp)) return exp;
2076
- else if (exp.type === 4) return exp.content;
2077
- else return exp.children.map(stringifyExpression).join("");
2078
- }
2079
- function isConst(type) {
2080
- return type === "setup-const" || type === "literal-const";
2081
- }
2082
- const transformIf = createStructuralDirectiveTransform(/^(?:if|else|else-if)$/, (node, dir, context) => {
2083
- return processIf(node, dir, context, (ifNode, branch, isRoot) => {
2084
- const siblings = context.parent.children;
2085
- let i = siblings.indexOf(ifNode);
2086
- let key = 0;
2087
- while (i-- >= 0) {
2088
- const sibling = siblings[i];
2089
- if (sibling && sibling.type === 9) key += sibling.branches.length;
2090
- }
2091
- return () => {
2092
- if (isRoot) ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);
2093
- else {
2094
- const parentCondition = getParentCondition(ifNode.codegenNode);
2095
- parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);
2096
- }
2097
- };
2098
- });
2099
- });
2100
- function processIf(node, dir, context, processCodegen) {
2101
- if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
2102
- const loc = dir.exp ? dir.exp.loc : node.loc;
2103
- context.onError(createCompilerError(28, dir.loc));
2104
- dir.exp = createSimpleExpression(`true`, false, loc);
2105
- }
2106
- if (context.prefixIdentifiers && dir.exp) dir.exp = processExpression(dir.exp, context);
2107
- if (dir.name === "if") {
2108
- const branch = createIfBranch(node, dir);
2109
- const ifNode = {
2110
- type: 9,
2111
- loc: cloneLoc(node.loc),
2112
- branches: [branch]
2113
- };
2114
- context.replaceNode(ifNode);
2115
- if (processCodegen) return processCodegen(ifNode, branch, true);
2116
- } else {
2117
- const siblings = context.parent.children;
2118
- const comments = [];
2119
- let i = siblings.indexOf(node);
2120
- while (i-- >= -1) {
2121
- const sibling = siblings[i];
2122
- if (sibling && sibling.type === 3) {
2123
- context.removeNode(sibling);
2124
- comments.unshift(sibling);
2125
- continue;
2126
- }
2127
- if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
2128
- context.removeNode(sibling);
2129
- continue;
2130
- }
2131
- if (sibling && sibling.type === 9) {
2132
- if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) context.onError(createCompilerError(30, node.loc));
2133
- context.removeNode();
2134
- const branch = createIfBranch(node, dir);
2135
- if (comments.length && !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) branch.children = [...comments, ...branch.children];
2136
- {
2137
- const key = branch.userKey;
2138
- if (key) sibling.branches.forEach(({ userKey }) => {
2139
- if (isSameKey(userKey, key)) context.onError(createCompilerError(29, branch.userKey.loc));
2140
- });
2141
- }
2142
- sibling.branches.push(branch);
2143
- const onExit = processCodegen && processCodegen(sibling, branch, false);
2144
- traverseNode(branch, context);
2145
- if (onExit) onExit();
2146
- context.currentNode = null;
2147
- } else context.onError(createCompilerError(30, node.loc));
2148
- break;
2149
- }
2150
- }
2151
- }
2152
- function createIfBranch(node, dir) {
2153
- const isTemplateIf = node.tagType === 3;
2154
- return {
2155
- type: 10,
2156
- loc: node.loc,
2157
- condition: dir.name === "else" ? void 0 : dir.exp,
2158
- children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
2159
- userKey: findProp(node, `key`),
2160
- isTemplateIf
2161
- };
2162
- }
2163
- function createCodegenNodeForBranch(branch, keyIndex, context) {
2164
- if (branch.condition) return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context), createCallExpression(context.helper(CREATE_COMMENT), ["\"v-if\"", "true"]));
2165
- else return createChildrenCodegenNode(branch, keyIndex, context);
2166
- }
2167
- function createChildrenCodegenNode(branch, keyIndex, context) {
2168
- const { helper } = context;
2169
- const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2));
2170
- const { children } = branch;
2171
- const firstChild = children[0];
2172
- if (children.length !== 1 || firstChild.type !== 1) if (children.length === 1 && firstChild.type === 11) {
2173
- const vnodeCall = firstChild.codegenNode;
2174
- injectProp(vnodeCall, keyProperty, context);
2175
- return vnodeCall;
2176
- } else {
2177
- let patchFlag = 64;
2178
- if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) patchFlag |= 2048;
2179
- return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc);
2180
- }
2181
- else {
2182
- const ret = firstChild.codegenNode;
2183
- const vnodeCall = getMemoedVNodeCall(ret);
2184
- if (vnodeCall.type === 13) convertToBlock(vnodeCall, context);
2185
- injectProp(vnodeCall, keyProperty, context);
2186
- return ret;
2187
- }
2188
- }
2189
- function isSameKey(a, b) {
2190
- if (!a || a.type !== b.type) return false;
2191
- if (a.type === 6) {
2192
- if (a.value.content !== b.value.content) return false;
2193
- } else {
2194
- const exp = a.exp;
2195
- const branchExp = b.exp;
2196
- if (exp.type !== branchExp.type) return false;
2197
- if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) return false;
2198
- }
2199
- return true;
2200
- }
2201
- function getParentCondition(node) {
2202
- while (true) if (node.type === 19) if (node.alternate.type === 19) node = node.alternate;
2203
- else return node;
2204
- else if (node.type === 20) node = node.value;
2205
- }
2206
- const transformFor = createStructuralDirectiveTransform("for", (node, dir, context) => {
2207
- const { helper, removeHelper } = context;
2208
- return processFor(node, dir, context, (forNode) => {
2209
- const renderExp = createCallExpression(helper(RENDER_LIST), [forNode.source]);
2210
- const isTemplate = isTemplateNode(node);
2211
- const memo = findDir(node, "memo");
2212
- const keyProp = findProp(node, `key`, false, true);
2213
- const isDirKey = keyProp && keyProp.type === 7;
2214
- let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
2215
- if (memo && keyExp && isDirKey) keyProp.exp = keyExp = processExpression(keyExp, context);
2216
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
2217
- if (isTemplate) {
2218
- if (memo) memo.exp = processExpression(memo.exp, context);
2219
- if (keyProperty && keyProp.type !== 6) keyProperty.value = processExpression(keyProperty.value, context);
2220
- }
2221
- const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
2222
- const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
2223
- forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
2224
- return () => {
2225
- let childBlock;
2226
- const { children } = forNode;
2227
- if (isTemplate) node.children.some((c) => {
2228
- if (c.type === 1) {
2229
- const key = findProp(c, "key");
2230
- if (key) {
2231
- context.onError(createCompilerError(33, key.loc));
2232
- return true;
2233
- }
2234
- }
2235
- });
2236
- const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;
2237
- const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
2238
- if (slotOutlet) {
2239
- childBlock = slotOutlet.codegenNode;
2240
- if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
2241
- } else if (needFragmentWrapper) childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : void 0, node.children, 64, void 0, void 0, true, void 0, false);
2242
- else {
2243
- childBlock = children[0].codegenNode;
2244
- if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
2245
- if (childBlock.isBlock !== !isStableFragment) if (childBlock.isBlock) {
2246
- removeHelper(OPEN_BLOCK);
2247
- removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
2248
- } else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
2249
- childBlock.isBlock = !isStableFragment;
2250
- if (childBlock.isBlock) {
2251
- helper(OPEN_BLOCK);
2252
- helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
2253
- } else helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
2254
- }
2255
- if (memo) {
2256
- const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [createSimpleExpression(`_cached`)]));
2257
- loop.body = createBlockStatement([
2258
- createCompoundExpression([
2259
- `const _memo = (`,
2260
- memo.exp,
2261
- `)`
2262
- ]),
2263
- createCompoundExpression([
2264
- `if (_cached`,
2265
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
2266
- ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
2267
- ]),
2268
- createCompoundExpression([`const _item = `, childBlock]),
2269
- createSimpleExpression(`_item.memo = _memo`),
2270
- createSimpleExpression(`return _item`)
2271
- ]);
2272
- renderExp.arguments.push(loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached.length)));
2273
- context.cached.push(null);
2274
- } else renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true));
2275
- };
2276
- });
2277
- });
2278
- function processFor(node, dir, context, processCodegen) {
2279
- if (!dir.exp) {
2280
- context.onError(createCompilerError(31, dir.loc));
2281
- return;
2282
- }
2283
- const parseResult = dir.forParseResult;
2284
- if (!parseResult) {
2285
- context.onError(createCompilerError(32, dir.loc));
2286
- return;
2287
- }
2288
- finalizeForParseResult(parseResult, context);
2289
- const { addIdentifiers, removeIdentifiers, scopes } = context;
2290
- const { source, value, key, index } = parseResult;
2291
- const forNode = {
2292
- type: 11,
2293
- loc: dir.loc,
2294
- source,
2295
- valueAlias: value,
2296
- keyAlias: key,
2297
- objectIndexAlias: index,
2298
- parseResult,
2299
- children: isTemplateNode(node) ? node.children : [node]
2300
- };
2301
- context.replaceNode(forNode);
2302
- scopes.vFor++;
2303
- if (context.prefixIdentifiers) {
2304
- value && addIdentifiers(value);
2305
- key && addIdentifiers(key);
2306
- index && addIdentifiers(index);
2307
- }
2308
- const onExit = processCodegen && processCodegen(forNode);
2309
- return () => {
2310
- scopes.vFor--;
2311
- if (context.prefixIdentifiers) {
2312
- value && removeIdentifiers(value);
2313
- key && removeIdentifiers(key);
2314
- index && removeIdentifiers(index);
2315
- }
2316
- if (onExit) onExit();
2317
- };
2318
- }
2319
- function finalizeForParseResult(result, context) {
2320
- if (result.finalized) return;
2321
- if (context.prefixIdentifiers) {
2322
- result.source = processExpression(result.source, context);
2323
- if (result.key) result.key = processExpression(result.key, context, true);
2324
- if (result.index) result.index = processExpression(result.index, context, true);
2325
- if (result.value) result.value = processExpression(result.value, context, true);
2326
- }
2327
- result.finalized = true;
2328
- }
2329
- function createForLoopParams({ value, key, index }, memoArgs = []) {
2330
- return createParamsList([
2331
- value,
2332
- key,
2333
- index,
2334
- ...memoArgs
2335
- ]);
2336
- }
2337
- function createParamsList(args) {
2338
- let i = args.length;
2339
- while (i--) if (args[i]) break;
2340
- return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false));
2341
- }
2342
- const defaultFallback = createSimpleExpression(`undefined`, false);
2343
- exports.generateCodeFrame = shared.generateCodeFrame;
2344
- }) });
2345
-
2346
- //#endregion
2347
- Object.defineProperty(exports, 'default', {
2348
- enumerable: true,
2349
- get: function () {
2350
- return require_compiler_core_cjs();
2351
- }
2352
- });
2353
- //# sourceMappingURL=compiler-core.cjs.cjs.map