@atom8n/n8n-editor-ui 2.2.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 (310) hide show
  1. package/.stylelintcache +1 -0
  2. package/README.md +59 -0
  3. package/biome.jsonc +8 -0
  4. package/build.log +55 -0
  5. package/data/node-popularity.json +3998 -0
  6. package/dist/assets/AddDataTableModal-UINkk54_.js +1555 -0
  7. package/dist/assets/AgentEditorModal-CVww87TJ.js +358 -0
  8. package/dist/assets/Alert-Dy86dyOr.js +102 -0
  9. package/dist/assets/AnimatedSpinner-DmPN4poP.js +15 -0
  10. package/dist/assets/AnnotationTagsDropdown.ee-BJ7N9lek.js +71 -0
  11. package/dist/assets/AuthView-D2LWHrMp.js +106 -0
  12. package/dist/assets/BottomMenu-CIQiK_dJ.js +532 -0
  13. package/dist/assets/CalendarDate-DgQUMbNo.js +875 -0
  14. package/dist/assets/ChangePasswordView-Z6tUkw0u.js +133 -0
  15. package/dist/assets/ChatAgentAvatar-50YBnv3N.js +67 -0
  16. package/dist/assets/ChatFile-xZxmc2nV.js +146 -0
  17. package/dist/assets/ChatLayout-CTE_5SiM.js +96 -0
  18. package/dist/assets/ChatPersonalAgentsView-BGpHk03K.js +149 -0
  19. package/dist/assets/ChatSidebar-BkVwIypC.js +528 -0
  20. package/dist/assets/ChatView-BbbdeU9x.js +1559 -0
  21. package/dist/assets/ChatWorkflowAgentsView-BtunOxlC.js +116 -0
  22. package/dist/assets/CollectionParameter-BdcPG1lu.js +52 -0
  23. package/dist/assets/CommitMonoVariable-ytizKI8U.woff2 +0 -0
  24. package/dist/assets/CommunityNodeUpdateInfo-C37kca4W.js +273 -0
  25. package/dist/assets/CopyInput-DDZVu2iU.js +74 -0
  26. package/dist/assets/CredentialIcon-8YdTTFZ1.js +80 -0
  27. package/dist/assets/CredentialPicker-DWtj314o.js +293 -0
  28. package/dist/assets/CredentialSelectorModal-DTW2fKh0.js +138 -0
  29. package/dist/assets/CredentialsView-BjUchcCu.js +480 -0
  30. package/dist/assets/DataTableActions-DpAkoxg_.js +95 -0
  31. package/dist/assets/DataTableDetailsView-Coq7zdW5.js +41922 -0
  32. package/dist/assets/DataTableView-Cs-BIkzw.js +293 -0
  33. package/dist/assets/DemoFooter-Cga3jvi-.js +65 -0
  34. package/dist/assets/Draggable-vfvXl9Sp.js +105 -0
  35. package/dist/assets/EmptySharedSectionActionBox-DOXZtTCv.js +36 -0
  36. package/dist/assets/EnterpriseEdition.ee-D_rCFexM.js +15 -0
  37. package/dist/assets/EntityNotFound-3dhTRWsE.js +85 -0
  38. package/dist/assets/EntityUnAuthorised-ChJYZakE.js +66 -0
  39. package/dist/assets/ErrorView-zT9cX76a.js +61 -0
  40. package/dist/assets/EvaluationsRootView-C-OVWYnY.js +523 -0
  41. package/dist/assets/EvaluationsView-CJwJTruc.js +469 -0
  42. package/dist/assets/ExecutionsTime-DEQiyozR.js +573 -0
  43. package/dist/assets/ExecutionsView-Bd5Oh8TH.js +791 -0
  44. package/dist/assets/ExternalSecretsProviderConnectionSwitch.ee-C7Ih-uRo.js +191 -0
  45. package/dist/assets/FixedCollectionParameter-CYuTDW9t.js +496 -0
  46. package/dist/assets/ForgotMyPasswordView-Bs_L9P27.js +102 -0
  47. package/dist/assets/InsightsChartAverageRuntime-Bp3VA8_7.js +62 -0
  48. package/dist/assets/InsightsChartFailed-KPaNWoEr.js +52 -0
  49. package/dist/assets/InsightsChartFailureRate-DE6kE3FM.js +54 -0
  50. package/dist/assets/InsightsChartTimeSaved-auABNZlc.js +68 -0
  51. package/dist/assets/InsightsChartTotal-BKzYRKE7.js +56 -0
  52. package/dist/assets/InsightsDashboard-JWx4W6Db.js +473 -0
  53. package/dist/assets/InsightsPaywall-C8zLLKe8.js +63 -0
  54. package/dist/assets/InsightsSummary-cmN1lHDm.js +210 -0
  55. package/dist/assets/InsightsTableWorkflows-CqcC3IbQ.js +203 -0
  56. package/dist/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
  57. package/dist/assets/InterVariable-Italic-FCBEiFp6.woff2 +0 -0
  58. package/dist/assets/ItemsRenderer-DC8WVyMv.js +922 -0
  59. package/dist/assets/KeyboardShortcutTooltip-D8PAK5JP.js +31 -0
  60. package/dist/assets/LogsPanel-BR06u9RK.js +52 -0
  61. package/dist/assets/LogsPanel-C-_acMHp.js +2325 -0
  62. package/dist/assets/MCPConnectWorkflowsModal-3g8_iUa4.js +303 -0
  63. package/dist/assets/MainHeader-DiQc1edn.js +2153 -0
  64. package/dist/assets/MainSidebar-CoPGG5Ea.js +804 -0
  65. package/dist/assets/MigrationRuleDetail-BAxk1Pvl.js +295 -0
  66. package/dist/assets/MigrationRules-IW9lZMpE.js +285 -0
  67. package/dist/assets/Modal-CIzXlZdZ.js +204 -0
  68. package/dist/assets/ModelByIdSelectorModal-DLvBjzJO.js +115 -0
  69. package/dist/assets/NDVEmptyState-33UoX00I.js +19743 -0
  70. package/dist/assets/NodeCreation-BNzbSWSB.js +240 -0
  71. package/dist/assets/NodeCreator-BftgCKx7.js +1288 -0
  72. package/dist/assets/NodeDetailsView-CsoQCpcF.js +1075 -0
  73. package/dist/assets/NodeDetailsViewV2-C_wNQR_3.js +981 -0
  74. package/dist/assets/NodeIcon-B9VW6tX6.js +87 -0
  75. package/dist/assets/NodeSettings-ZwVip6VR.js +1872 -0
  76. package/dist/assets/NodeView-D4WUEvLB.js +2452 -0
  77. package/dist/assets/OAuthConsentView-DlrUqZbT.js +230 -0
  78. package/dist/assets/PageViewLayout-NT1KPFgy.js +12 -0
  79. package/dist/assets/ParameterInputList-sG2nz-Jo.js +38091 -0
  80. package/dist/assets/PrebuiltAgentTemplatesView-Csi5U8dc.js +154 -0
  81. package/dist/assets/ProjectBreadcrumb-C_XiY7sc.js +98 -0
  82. package/dist/assets/ProjectCardBadge-t_hs7vzx.js +209 -0
  83. package/dist/assets/ProjectHeader-Dq5Ihb26.js +549 -0
  84. package/dist/assets/ProjectIcon-DY8gGuHX.js +64 -0
  85. package/dist/assets/ProjectRoleView-Du-KTrAC.js +435 -0
  86. package/dist/assets/ProjectRolesView-DjxM_y4u.js +239 -0
  87. package/dist/assets/ProjectSettings-C6kWuV21.js +966 -0
  88. package/dist/assets/ProjectSharing-CVUgNWAY.js +262 -0
  89. package/dist/assets/ProjectVariables-CJlAo3dv.js +467 -0
  90. package/dist/assets/ProviderSettingsModal-BUFC2ZLv.js +307 -0
  91. package/dist/assets/PushConnectionTracker-DPBnGV0v.js +27 -0
  92. package/dist/assets/ResolversView-3BdkvvYA.js +209 -0
  93. package/dist/assets/ResourceFiltersDropdown-dgyXpcEX.js +159 -0
  94. package/dist/assets/ResourcesListLayout-qBLtomK6.js +631 -0
  95. package/dist/assets/RunDataHtml-BrW0OQra.js +7 -0
  96. package/dist/assets/RunDataHtml-Cleia4Cj.js +40 -0
  97. package/dist/assets/RunDataJson-uxkrhYRK.js +227 -0
  98. package/dist/assets/RunDataJsonActions-DkPk7E8d.js +5007 -0
  99. package/dist/assets/RunDataParsedAiContent-CtPRjig-.js +26 -0
  100. package/dist/assets/RunDataParsedAiContent-WAuqLQ5M.js +192 -0
  101. package/dist/assets/RunDataSearch-YBWUr93C.js +141 -0
  102. package/dist/assets/RunDataTable-DcXaBynW.js +631 -0
  103. package/dist/assets/SamlOnboarding-BTdQ_hr3.js +78 -0
  104. package/dist/assets/SaveButton-D5sQSxIk.js +89 -0
  105. package/dist/assets/SelectedItemsInfo-BHZ-NvF5.js +58 -0
  106. package/dist/assets/SettingsApiView-IfZTMXx1.js +313 -0
  107. package/dist/assets/SettingsChatHubView-gWh2X6vX.js +285 -0
  108. package/dist/assets/SettingsCommunityNodesView-D8VQtpGY.js +349 -0
  109. package/dist/assets/SettingsExternalSecrets-CpMc7mkW.js +233 -0
  110. package/dist/assets/SettingsLdapView-CU5a2MAy.js +2553 -0
  111. package/dist/assets/SettingsLogStreamingView-uojTe-oX.js +375 -0
  112. package/dist/assets/SettingsMCPView-B5Swp1C_.js +1214 -0
  113. package/dist/assets/SettingsPersonalView-Cr3aGood.js +402 -0
  114. package/dist/assets/SettingsSourceControl-DXOvFDEY.js +547 -0
  115. package/dist/assets/SettingsSso-27MfU1HV.js +1032 -0
  116. package/dist/assets/SettingsUsageAndPlan-DqIO-G46.js +419 -0
  117. package/dist/assets/SettingsUsersView-DfHB4_Kh.js +833 -0
  118. package/dist/assets/SettingsView-C4sA7Uny.js +90 -0
  119. package/dist/assets/SetupTemplateFormStep-BmiSzZin.js +258 -0
  120. package/dist/assets/SetupView-VORZ-L_u.js +112 -0
  121. package/dist/assets/SetupWorkflowCredentialsButton-DTmkOAW5.js +73 -0
  122. package/dist/assets/SetupWorkflowFromTemplateView-B9NupdJE.js +286 -0
  123. package/dist/assets/SeverityTag-CX1qTTNA.js +45 -0
  124. package/dist/assets/SigninView-D9_Pm16j.js +358 -0
  125. package/dist/assets/SignoutView-BFsjEAGz.js +19 -0
  126. package/dist/assets/SignupView-Am4ot0QZ.js +137 -0
  127. package/dist/assets/SkeletonAgentCard-C5TL-h8F.js +191 -0
  128. package/dist/assets/TagsDropdown-Bvx_Hd6Q.js +230 -0
  129. package/dist/assets/TemplateCard-CyQ1GuVz.js +105 -0
  130. package/dist/assets/TemplateDetails-CZRusTxE.js +124 -0
  131. package/dist/assets/TemplateList-DKvbwuiY.js +333 -0
  132. package/dist/assets/TemplatesCollectionView-D8dxU8By.js +184 -0
  133. package/dist/assets/TemplatesSearchView-CebC_GLs.js +1230 -0
  134. package/dist/assets/TemplatesView-025CcmIY.js +57 -0
  135. package/dist/assets/TemplatesWorkflowView-C2JfwJAn.js +170 -0
  136. package/dist/assets/TestRunDetailView-Ck78TTWO.js +395 -0
  137. package/dist/assets/TextWithHighlights-BxumwGnv.js +57 -0
  138. package/dist/assets/TimeAgo-C6EN4lCs.js +123 -0
  139. package/dist/assets/ToolsSelectorModal-8QJoUvRL.js +368 -0
  140. package/dist/assets/TriggerPanel-B6pacLkk.js +1225 -0
  141. package/dist/assets/VirtualSchema-B3zGe_8b.js +2402 -0
  142. package/dist/assets/VirtualSchema-Dkh0Cu5z.js +37 -0
  143. package/dist/assets/VueMarkdown-CQqJL9vK.js +28 -0
  144. package/dist/assets/WorkerView-Caznsljo.js +563 -0
  145. package/dist/assets/WorkflowActivationErrorMessage-CGrfPi9O.js +17 -0
  146. package/dist/assets/WorkflowActivator-BINnz0f7.js +362 -0
  147. package/dist/assets/WorkflowExecutionsInfoAccordion-Dg37yEfT.js +166 -0
  148. package/dist/assets/WorkflowExecutionsLandingPage-V2wdubhK.js +93 -0
  149. package/dist/assets/WorkflowExecutionsPreview-DdJaqYV6.js +616 -0
  150. package/dist/assets/WorkflowExecutionsView-DV8ySTfn.js +808 -0
  151. package/dist/assets/WorkflowHistory-GtaBMzIM.js +973 -0
  152. package/dist/assets/WorkflowLocation-CQ9Sq-2y.js +164 -0
  153. package/dist/assets/WorkflowOnboardingView-C49gt0Jr.js +61 -0
  154. package/dist/assets/WorkflowPreview-CXdvv4Nq.js +186 -0
  155. package/dist/assets/WorkflowTagsDropdown-QwbICWjN.js +71 -0
  156. package/dist/assets/WorkflowsView-B-MWIECO.js +3253 -0
  157. package/dist/assets/_MapCache-CcdIl4Ae.js +363 -0
  158. package/dist/assets/_baseOrderBy-N8Be_6z6.js +2989 -0
  159. package/dist/assets/_initCloneObject-viQQyT6o.js +80 -0
  160. package/dist/assets/_plugin-vue_export-helper-BwBpWJRZ.js +6 -0
  161. package/dist/assets/aiTemplatesStarterCollection.store-nL9nePkK.js +656 -0
  162. package/dist/assets/apiKeys.store-BhOFmP2j.js +51 -0
  163. package/dist/assets/assistant.store-CNywgN4S.js +518 -0
  164. package/dist/assets/auth.eventBus-CWXS0Qp7.js +5 -0
  165. package/dist/assets/banners.store-CGEcBTDn.js +195 -0
  166. package/dist/assets/builder.store-Czk2ipDE.js +31417 -0
  167. package/dist/assets/buttons.esm-yintpW2E.js +364 -0
  168. package/dist/assets/chart-CNvyywtJ.js +10958 -0
  169. package/dist/assets/chartjs.utils-BAE52Cv9.js +155 -0
  170. package/dist/assets/chat.store-290YeyrQ.js +865 -0
  171. package/dist/assets/chatPanel.store-NDaawEZL.js +118 -0
  172. package/dist/assets/chunk-6z4oVpB-.js +36 -0
  173. package/dist/assets/col-Cmt4cmuS.js +158 -0
  174. package/dist/assets/constants-C8OH4tTq.js +106256 -0
  175. package/dist/assets/constants-DMrsrpD7.js +32 -0
  176. package/dist/assets/core-B9gt_4yk.js +4 -0
  177. package/dist/assets/core-CP5FY4aX.js +1202 -0
  178. package/dist/assets/core-CRbPymLT.js +9741 -0
  179. package/dist/assets/dataTable.store-DmipQsol.js +207 -0
  180. package/dist/assets/date-picker-2IDsBs2n.js +4115 -0
  181. package/dist/assets/dateFormatter-ik4-9_9r.js +33 -0
  182. package/dist/assets/dateformat-hG8NERse.js +181 -0
  183. package/dist/assets/dialog-lMho1TD8.js +425 -0
  184. package/dist/assets/dist-Cw46Is-h.js +151 -0
  185. package/dist/assets/doppler-B__k0MeW.webp +0 -0
  186. package/dist/assets/element-icons-B-tDfklg.woff +0 -0
  187. package/dist/assets/element-icons-_lZGOqcG.ttf +0 -0
  188. package/dist/assets/empty-BuGRxzl4.js +2210 -0
  189. package/dist/assets/en-CF30SCh2.js +95 -0
  190. package/dist/assets/en-DyO2pPiC.js +2 -0
  191. package/dist/assets/es-BkUFJVtD.js +43338 -0
  192. package/dist/assets/evaluation.constants-GYAwmJnh.js +284 -0
  193. package/dist/assets/executions.store-B9uRYwgv.js +205 -0
  194. package/dist/assets/exports-Crx_gvt_.js +1799 -0
  195. package/dist/assets/externalSecrets.ee.store-BJh4a_6G.js +118 -0
  196. package/dist/assets/fileUtils-CRWqOQje.js +20 -0
  197. package/dist/assets/folders.store-yAFj-5Vl.js +235 -0
  198. package/dist/assets/get-BcEmeOxn.js +2781 -0
  199. package/dist/assets/index-SL8542zQ.js +28372 -0
  200. package/dist/assets/insights.constants-BkJCYJTL.js +55 -0
  201. package/dist/assets/insights.store-BFc3kDUo.js +61 -0
  202. package/dist/assets/insights.utils-CcLXdrrz.js +77 -0
  203. package/dist/assets/isEmpty-C3XXoHqJ.js +35216 -0
  204. package/dist/assets/languageModules-9LyndCqU.js +13862 -0
  205. package/dist/assets/logStreaming.store-IZhWe_VK.js +190 -0
  206. package/dist/assets/mcp.constants-_Jcn7fPq.js +10 -0
  207. package/dist/assets/mcp.store-B9yfcAN9.js +116 -0
  208. package/dist/assets/merge-DhuTk1HM.js +564 -0
  209. package/dist/assets/nodeCreator.store-Bpnrwp2l.js +5444 -0
  210. package/dist/assets/nodeIcon-D6X-ENYt.js +102 -0
  211. package/dist/assets/nodeTransforms-RzcOM0v2.js +42 -0
  212. package/dist/assets/orderBy-Cu9F9DU_.js +15 -0
  213. package/dist/assets/path-browserify-RUt2u7iT.js +328 -0
  214. package/dist/assets/personalizedTemplatesV3.store-BGYp0YBN.js +334 -0
  215. package/dist/assets/pickBy-UI0Jt4wC.js +18 -0
  216. package/dist/assets/preload-helper-dyVz7ck7.js +59 -0
  217. package/dist/assets/radio-CSce3UT0.js +262 -0
  218. package/dist/assets/readyToRun.store-YEMvPUqo.js +626 -0
  219. package/dist/assets/readyToRunWorkflows.store-G3srgIze.js +1319 -0
  220. package/dist/assets/retry-BgHaYzbB.js +23 -0
  221. package/dist/assets/roles.store-CRf_zJTb.js +51 -0
  222. package/dist/assets/router-DNpzz3GH.js +2631 -0
  223. package/dist/assets/sanitize-html-CbW56HUN.js +10758 -0
  224. package/dist/assets/schemaPreview.store-DUgN1yVE.js +113 -0
  225. package/dist/assets/semver-Bk6DGseV.js +1306 -0
  226. package/dist/assets/smartDecimal-DAZl4HKA.js +6 -0
  227. package/dist/assets/sortByProperty-Cn7iGKYu.js +8 -0
  228. package/dist/assets/sourceControl.eventBus-D47xXSc_.js +3 -0
  229. package/dist/assets/sqlite3-DBpDb1lf.wasm +0 -0
  230. package/dist/assets/sqlite3-opfs-async-proxy-vVtmDGHX.js +461 -0
  231. package/dist/assets/sqlite3-worker1-bundler-friendly-DLarOZDL.js +9405 -0
  232. package/dist/assets/src-jviYSG25.js +55454 -0
  233. package/dist/assets/sso.store-DyApJwhx.js +139 -0
  234. package/dist/assets/style-E3CrYFV8.css +111829 -0
  235. package/dist/assets/table-we1DjFMV.js +3944 -0
  236. package/dist/assets/templateActions-bEDSARw2.js +65 -0
  237. package/dist/assets/templateTransforms-BHWiRbtR.js +43 -0
  238. package/dist/assets/truncate-C0KYt7i3.js +4176 -0
  239. package/dist/assets/typescript.worker-CYqLvLHh.js +152048 -0
  240. package/dist/assets/uniqBy-xDyuCRP0.js +10 -0
  241. package/dist/assets/usage.store-CU5J_nGm.js +100 -0
  242. package/dist/assets/useActions-B1JckIRj.js +255 -0
  243. package/dist/assets/useBeforeUnload-DiDkvI8p.js +40 -0
  244. package/dist/assets/useCanvasMapping-BXT7rGhC.js +12570 -0
  245. package/dist/assets/useCanvasOperations-8ULLtMkY.js +1765 -0
  246. package/dist/assets/useClipboard-DvjhVHqJ.js +39 -0
  247. package/dist/assets/useCommandBar-C4tLJbKt.js +2425 -0
  248. package/dist/assets/useCredentialResolvers-BKeFGJnY.js +78 -0
  249. package/dist/assets/useCustomAgent-DpILEt5e.js +471 -0
  250. package/dist/assets/useDebounce-Br5_1ug-.js +147 -0
  251. package/dist/assets/useExecutionData-M5iKsX6z.js +23 -0
  252. package/dist/assets/useExecutionDebugging-8azMzbnd.js +191 -0
  253. package/dist/assets/useExecutionHelpers-BgRRhpBM.js +91 -0
  254. package/dist/assets/useImportCurlCommand-CKiEmX5P.js +8891 -0
  255. package/dist/assets/useIntersectionObserver-BWMwOueh.js +33 -0
  256. package/dist/assets/useKeybindings-B2jfN6rd.js +62 -0
  257. package/dist/assets/useLogsTreeExpand-sZViUfdM.js +843 -0
  258. package/dist/assets/useMcp-DoMOIfqT.js +27 -0
  259. package/dist/assets/usePageRedirectionHelper-DjkznpX6.js +51 -0
  260. package/dist/assets/usePinnedData-BhZkqttf.js +203 -0
  261. package/dist/assets/usePushConnection-DMS-F_IW.js +513 -0
  262. package/dist/assets/useRecentResources-BVORr7eM.js +118 -0
  263. package/dist/assets/useRunWorkflow-LO7ffLp9.js +950 -0
  264. package/dist/assets/useSettingsItems-BhZXwMZn.js +144 -0
  265. package/dist/assets/useTelemetryContext-V6bv4YRq.js +34 -0
  266. package/dist/assets/useWorkflowActivate-DeSmDXjI.js +152 -0
  267. package/dist/assets/useWorkflowsCache-DtcEEAIR.js +179 -0
  268. package/dist/assets/userRoleProvisioning.store-kkSIdeTo.js +33 -0
  269. package/dist/assets/utils-DI7dLldp.js +54 -0
  270. package/dist/assets/versions.store-B1z2OrLE.js +191 -0
  271. package/dist/assets/vue-CydWIhxN.js +4378 -0
  272. package/dist/assets/vue-json-pretty-CsGX66mG.js +1130 -0
  273. package/dist/assets/vue.runtime.esm-bundler-tP5dCd7J.js +7325 -0
  274. package/dist/assets/xml-B_oj6Mle.js +2060 -0
  275. package/dist/favicon.ico +0 -0
  276. package/dist/index.html +157 -0
  277. package/dist/static/base-path.js +1 -0
  278. package/dist/static/community_package_tooltip_img.png +0 -0
  279. package/dist/static/data-mapping-gif.gif +0 -0
  280. package/dist/static/form-grey.svg +1 -0
  281. package/dist/static/google-auth/disabled.dark.png +0 -0
  282. package/dist/static/google-auth/disabled.png +0 -0
  283. package/dist/static/google-auth/focus.dark.png +0 -0
  284. package/dist/static/google-auth/focus.png +0 -0
  285. package/dist/static/google-auth/normal.dark.png +0 -0
  286. package/dist/static/google-auth/normal.png +0 -0
  287. package/dist/static/google-auth/pressed.dark.png +0 -0
  288. package/dist/static/google-auth/pressed.png +0 -0
  289. package/dist/static/n8n-logo.png +0 -0
  290. package/dist/static/og_image.png +0 -0
  291. package/dist/static/open-ai.svg +1 -0
  292. package/dist/static/openChat.png +0 -0
  293. package/dist/static/posthog.init.js +41 -0
  294. package/dist/static/prefers-color-scheme.css +5 -0
  295. package/dist/static/webhook-icon.svg +1 -0
  296. package/dist/tree-sitter-bash.wasm +0 -0
  297. package/dist/tree-sitter.wasm +0 -0
  298. package/eslint.config.mjs +59 -0
  299. package/index.html +45 -0
  300. package/index.js +0 -0
  301. package/package.json +147 -0
  302. package/postcss.config.cjs +6 -0
  303. package/scripts/fetch-node-popularity.mjs +102 -0
  304. package/stylelint.config.mjs +9 -0
  305. package/tailwind.config.js +8 -0
  306. package/tsconfig.json +36 -0
  307. package/vite/i18n-locales-hmr-helpers.ts +19 -0
  308. package/vite/source-map-js-shim.ts +1 -0
  309. package/vite/vite-plugin-node-popularity.mts +32 -0
  310. package/vite.config.mts +304 -0
@@ -0,0 +1,4378 @@
1
+ import { a as __toCommonJS, n as __esmMin, r as __export, t as __commonJSMin } from "./chunk-6z4oVpB-.js";
2
+ import { Jt as NOOP, Kt as EMPTY_OBJ, Qt as generateCodeFrame, Sn as shared_esm_bundler_exports, Xt as capitalize, Yt as camelize, Zt as extend, _n as makeMap, a as init_runtime_dom_esm_bundler, cn as isObject, fn as isReservedProp, gn as isVoidTag, hn as isSymbol, ln as isOn, mn as isString, nn as isArray, on as isHTMLTag, pn as isSVGTag, qt as NO, rn as isBuiltInDirective, s as runtime_dom_esm_bundler_exports, sn as isMathMLTag, tn as init_shared_esm_bundler, wn as toHandlerKey, xn as parseStringStyle } from "./vue.runtime.esm-bundler-tP5dCd7J.js";
3
+ function registerRuntimeHelpers(helpers) {
4
+ Object.getOwnPropertySymbols(helpers).forEach((s) => {
5
+ helperNameMap[s] = helpers[s];
6
+ });
7
+ }
8
+ function createRoot(children, source = "") {
9
+ return {
10
+ type: 0,
11
+ source,
12
+ children,
13
+ helpers: /* @__PURE__ */ new Set(),
14
+ components: [],
15
+ directives: [],
16
+ hoists: [],
17
+ imports: [],
18
+ cached: [],
19
+ temps: 0,
20
+ codegenNode: void 0,
21
+ loc: locStub
22
+ };
23
+ }
24
+ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent$1 = false, loc = locStub) {
25
+ if (context) {
26
+ if (isBlock) {
27
+ context.helper(OPEN_BLOCK);
28
+ context.helper(getVNodeBlockHelper(context.inSSR, isComponent$1));
29
+ } else context.helper(getVNodeHelper(context.inSSR, isComponent$1));
30
+ if (directives) context.helper(WITH_DIRECTIVES);
31
+ }
32
+ return {
33
+ type: 13,
34
+ tag,
35
+ props,
36
+ children,
37
+ patchFlag,
38
+ dynamicProps,
39
+ directives,
40
+ isBlock,
41
+ disableTracking,
42
+ isComponent: isComponent$1,
43
+ loc
44
+ };
45
+ }
46
+ function createArrayExpression(elements, loc = locStub) {
47
+ return {
48
+ type: 17,
49
+ loc,
50
+ elements
51
+ };
52
+ }
53
+ function createObjectExpression(properties, loc = locStub) {
54
+ return {
55
+ type: 15,
56
+ loc,
57
+ properties
58
+ };
59
+ }
60
+ function createObjectProperty(key, value) {
61
+ return {
62
+ type: 16,
63
+ loc: locStub,
64
+ key: isString(key) ? createSimpleExpression(key, true) : key,
65
+ value
66
+ };
67
+ }
68
+ function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
69
+ return {
70
+ type: 4,
71
+ loc,
72
+ content,
73
+ isStatic,
74
+ constType: isStatic ? 3 : constType
75
+ };
76
+ }
77
+ function createInterpolation(content, loc) {
78
+ return {
79
+ type: 5,
80
+ loc,
81
+ content: isString(content) ? createSimpleExpression(content, false, loc) : content
82
+ };
83
+ }
84
+ function createCompoundExpression(children, loc = locStub) {
85
+ return {
86
+ type: 8,
87
+ loc,
88
+ children
89
+ };
90
+ }
91
+ function createCallExpression(callee, args = [], loc = locStub) {
92
+ return {
93
+ type: 14,
94
+ loc,
95
+ callee,
96
+ arguments: args
97
+ };
98
+ }
99
+ function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
100
+ return {
101
+ type: 18,
102
+ params,
103
+ returns,
104
+ newline,
105
+ isSlot,
106
+ loc
107
+ };
108
+ }
109
+ function createConditionalExpression(test, consequent, alternate, newline = true) {
110
+ return {
111
+ type: 19,
112
+ test,
113
+ consequent,
114
+ alternate,
115
+ newline,
116
+ loc: locStub
117
+ };
118
+ }
119
+ function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {
120
+ return {
121
+ type: 20,
122
+ index,
123
+ value,
124
+ needPauseTracking,
125
+ inVOnce,
126
+ needArraySpread: false,
127
+ loc: locStub
128
+ };
129
+ }
130
+ function createBlockStatement(body) {
131
+ return {
132
+ type: 21,
133
+ body,
134
+ loc: locStub
135
+ };
136
+ }
137
+ function createTemplateLiteral(elements) {
138
+ return {
139
+ type: 22,
140
+ elements,
141
+ loc: locStub
142
+ };
143
+ }
144
+ function createIfStatement(test, consequent, alternate) {
145
+ return {
146
+ type: 23,
147
+ test,
148
+ consequent,
149
+ alternate,
150
+ loc: locStub
151
+ };
152
+ }
153
+ function createAssignmentExpression(left, right) {
154
+ return {
155
+ type: 24,
156
+ left,
157
+ right,
158
+ loc: locStub
159
+ };
160
+ }
161
+ function createSequenceExpression(expressions) {
162
+ return {
163
+ type: 25,
164
+ expressions,
165
+ loc: locStub
166
+ };
167
+ }
168
+ function createReturnStatement(returns) {
169
+ return {
170
+ type: 26,
171
+ returns,
172
+ loc: locStub
173
+ };
174
+ }
175
+ function getVNodeHelper(ssr, isComponent$1) {
176
+ return ssr || isComponent$1 ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
177
+ }
178
+ function getVNodeBlockHelper(ssr, isComponent$1) {
179
+ return ssr || isComponent$1 ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
180
+ }
181
+ function convertToBlock(node, { helper, removeHelper, inSSR }) {
182
+ if (!node.isBlock) {
183
+ node.isBlock = true;
184
+ removeHelper(getVNodeHelper(inSSR, node.isComponent));
185
+ helper(OPEN_BLOCK);
186
+ helper(getVNodeBlockHelper(inSSR, node.isComponent));
187
+ }
188
+ }
189
+ function isTagStartChar(c) {
190
+ return c >= 97 && c <= 122 || c >= 65 && c <= 90;
191
+ }
192
+ function isWhitespace(c) {
193
+ return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;
194
+ }
195
+ function isEndOfTagSection(c) {
196
+ return c === 47 || c === 62 || isWhitespace(c);
197
+ }
198
+ function toCharCodes(str) {
199
+ const ret = new Uint8Array(str.length);
200
+ for (let i = 0; i < str.length; i++) ret[i] = str.charCodeAt(i);
201
+ return ret;
202
+ }
203
+ function getCompatValue(key, { compatConfig }) {
204
+ const value = compatConfig && compatConfig[key];
205
+ if (key === "MODE") return value || 3;
206
+ else return value;
207
+ }
208
+ function isCompatEnabled(key, context) {
209
+ const mode = getCompatValue("MODE", context);
210
+ const value = getCompatValue(key, context);
211
+ return mode === 3 ? value === true : value !== false;
212
+ }
213
+ function checkCompatEnabled(key, context, loc, ...args) {
214
+ return isCompatEnabled(key, context);
215
+ }
216
+ function warnDeprecation(key, context, loc, ...args) {
217
+ if (getCompatValue(key, context) === "suppress-warning") return;
218
+ const { message, link } = deprecationData[key];
219
+ const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? `
220
+ Details: ${link}` : ``}`;
221
+ const err = new SyntaxError(msg);
222
+ err.code = key;
223
+ if (loc) err.loc = loc;
224
+ context.onWarn(err);
225
+ }
226
+ function defaultOnError(error) {
227
+ throw error;
228
+ }
229
+ function defaultOnWarn(msg) {}
230
+ function createCompilerError(code, loc, messages, additionalMessage) {
231
+ const msg = `https://vuejs.org/error-reference/#compiler-${code}`;
232
+ const error = new SyntaxError(String(msg));
233
+ error.code = code;
234
+ error.loc = loc;
235
+ return error;
236
+ }
237
+ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {}
238
+ function isReferencedIdentifier(id, parent, parentStack) {
239
+ return false;
240
+ }
241
+ function isInDestructureAssignment(parent, parentStack) {
242
+ if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
243
+ let i = parentStack.length;
244
+ while (i--) {
245
+ const p = parentStack[i];
246
+ if (p.type === "AssignmentExpression") return true;
247
+ else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) break;
248
+ }
249
+ }
250
+ return false;
251
+ }
252
+ function isInNewExpression(parentStack) {
253
+ let i = parentStack.length;
254
+ while (i--) {
255
+ const p = parentStack[i];
256
+ if (p.type === "NewExpression") return true;
257
+ else if (p.type !== "MemberExpression") break;
258
+ }
259
+ return false;
260
+ }
261
+ function walkFunctionParams(node, onIdent) {
262
+ for (const p of node.params) for (const id of extractIdentifiers(p)) onIdent(id);
263
+ }
264
+ function walkBlockDeclarations(block, onIdent) {
265
+ for (const stmt of block.body) if (stmt.type === "VariableDeclaration") {
266
+ if (stmt.declare) continue;
267
+ for (const decl of stmt.declarations) for (const id of extractIdentifiers(decl.id)) onIdent(id);
268
+ } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
269
+ if (stmt.declare || !stmt.id) continue;
270
+ onIdent(stmt.id);
271
+ } else if (isForStatement(stmt)) walkForStatement(stmt, true, onIdent);
272
+ }
273
+ function isForStatement(stmt) {
274
+ return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement";
275
+ }
276
+ function walkForStatement(stmt, isVar, onIdent) {
277
+ const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
278
+ 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);
279
+ }
280
+ function extractIdentifiers(param, nodes = []) {
281
+ switch (param.type) {
282
+ case "Identifier":
283
+ nodes.push(param);
284
+ break;
285
+ case "MemberExpression":
286
+ let object = param;
287
+ while (object.type === "MemberExpression") object = object.object;
288
+ nodes.push(object);
289
+ break;
290
+ case "ObjectPattern":
291
+ for (const prop of param.properties) if (prop.type === "RestElement") extractIdentifiers(prop.argument, nodes);
292
+ else extractIdentifiers(prop.value, nodes);
293
+ break;
294
+ case "ArrayPattern":
295
+ param.elements.forEach((element) => {
296
+ if (element) extractIdentifiers(element, nodes);
297
+ });
298
+ break;
299
+ case "RestElement":
300
+ extractIdentifiers(param.argument, nodes);
301
+ break;
302
+ case "AssignmentPattern":
303
+ extractIdentifiers(param.left, nodes);
304
+ break;
305
+ }
306
+ return nodes;
307
+ }
308
+ function unwrapTSNode(node) {
309
+ if (TS_NODE_TYPES.includes(node.type)) return unwrapTSNode(node.expression);
310
+ else return node;
311
+ }
312
+ function isCoreComponent(tag) {
313
+ switch (tag) {
314
+ case "Teleport":
315
+ case "teleport": return TELEPORT;
316
+ case "Suspense":
317
+ case "suspense": return SUSPENSE;
318
+ case "KeepAlive":
319
+ case "keep-alive": return KEEP_ALIVE;
320
+ case "BaseTransition":
321
+ case "base-transition": return BASE_TRANSITION;
322
+ }
323
+ }
324
+ function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
325
+ return advancePositionWithMutation({
326
+ offset: pos.offset,
327
+ line: pos.line,
328
+ column: pos.column
329
+ }, source, numberOfCharacters);
330
+ }
331
+ function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {
332
+ let linesCount = 0;
333
+ let lastNewLinePos = -1;
334
+ for (let i = 0; i < numberOfCharacters; i++) if (source.charCodeAt(i) === 10) {
335
+ linesCount++;
336
+ lastNewLinePos = i;
337
+ }
338
+ pos.offset += numberOfCharacters;
339
+ pos.line += linesCount;
340
+ pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos;
341
+ return pos;
342
+ }
343
+ function assert(condition, msg) {
344
+ if (!condition) throw new Error(msg || `unexpected compiler condition`);
345
+ }
346
+ function findDir(node, name, allowEmpty = false) {
347
+ for (let i = 0; i < node.props.length; i++) {
348
+ const p = node.props[i];
349
+ if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) return p;
350
+ }
351
+ }
352
+ function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
353
+ for (let i = 0; i < node.props.length; i++) {
354
+ const p = node.props[i];
355
+ if (p.type === 6) {
356
+ if (dynamicOnly) continue;
357
+ if (p.name === name && (p.value || allowEmpty)) return p;
358
+ } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) return p;
359
+ }
360
+ }
361
+ function isStaticArgOf(arg, name) {
362
+ return !!(arg && isStaticExp(arg) && arg.content === name);
363
+ }
364
+ function hasDynamicKeyVBind(node) {
365
+ return node.props.some((p) => p.type === 7 && p.name === "bind" && (!p.arg || p.arg.type !== 4 || !p.arg.isStatic));
366
+ }
367
+ function isText$1(node) {
368
+ return node.type === 5 || node.type === 2;
369
+ }
370
+ function isVSlot(p) {
371
+ return p.type === 7 && p.name === "slot";
372
+ }
373
+ function isTemplateNode(node) {
374
+ return node.type === 1 && node.tagType === 3;
375
+ }
376
+ function isSlotOutlet(node) {
377
+ return node.type === 1 && node.tagType === 2;
378
+ }
379
+ function getUnnormalizedProps(props, callPath = []) {
380
+ if (props && !isString(props) && props.type === 14) {
381
+ const callee = props.callee;
382
+ if (!isString(callee) && propsHelperSet.has(callee)) return getUnnormalizedProps(props.arguments[0], callPath.concat(props));
383
+ }
384
+ return [props, callPath];
385
+ }
386
+ function injectProp(node, prop, context) {
387
+ let propsWithInjection;
388
+ let props = node.type === 13 ? node.props : node.arguments[2];
389
+ let callPath = [];
390
+ let parentCall;
391
+ if (props && !isString(props) && props.type === 14) {
392
+ const ret = getUnnormalizedProps(props);
393
+ props = ret[0];
394
+ callPath = ret[1];
395
+ parentCall = callPath[callPath.length - 1];
396
+ }
397
+ if (props == null || isString(props)) propsWithInjection = createObjectExpression([prop]);
398
+ else if (props.type === 14) {
399
+ const first = props.arguments[0];
400
+ if (!isString(first) && first.type === 15) {
401
+ if (!hasProp(prop, first)) first.properties.unshift(prop);
402
+ } else if (props.callee === TO_HANDLERS) propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [createObjectExpression([prop]), props]);
403
+ else props.arguments.unshift(createObjectExpression([prop]));
404
+ !propsWithInjection && (propsWithInjection = props);
405
+ } else if (props.type === 15) {
406
+ if (!hasProp(prop, props)) props.properties.unshift(prop);
407
+ propsWithInjection = props;
408
+ } else {
409
+ propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [createObjectExpression([prop]), props]);
410
+ if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) parentCall = callPath[callPath.length - 2];
411
+ }
412
+ if (node.type === 13) if (parentCall) parentCall.arguments[0] = propsWithInjection;
413
+ else node.props = propsWithInjection;
414
+ else if (parentCall) parentCall.arguments[0] = propsWithInjection;
415
+ else node.arguments[2] = propsWithInjection;
416
+ }
417
+ function hasProp(prop, props) {
418
+ let result = false;
419
+ if (prop.key.type === 4) {
420
+ const propKeyName = prop.key.content;
421
+ result = props.properties.some((p) => p.key.type === 4 && p.key.content === propKeyName);
422
+ }
423
+ return result;
424
+ }
425
+ function toValidAssetId(name, type) {
426
+ return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
427
+ return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString();
428
+ })}`;
429
+ }
430
+ function hasScopeRef(node, ids) {
431
+ if (!node || Object.keys(ids).length === 0) return false;
432
+ switch (node.type) {
433
+ case 1:
434
+ for (let i = 0; i < node.props.length; i++) {
435
+ const p = node.props[i];
436
+ if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) return true;
437
+ }
438
+ return node.children.some((c) => hasScopeRef(c, ids));
439
+ case 11:
440
+ if (hasScopeRef(node.source, ids)) return true;
441
+ return node.children.some((c) => hasScopeRef(c, ids));
442
+ case 9: return node.branches.some((b) => hasScopeRef(b, ids));
443
+ case 10:
444
+ if (hasScopeRef(node.condition, ids)) return true;
445
+ return node.children.some((c) => hasScopeRef(c, ids));
446
+ case 4: return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content];
447
+ case 8: return node.children.some((c) => isObject(c) && hasScopeRef(c, ids));
448
+ case 5:
449
+ case 12: return hasScopeRef(node.content, ids);
450
+ case 2:
451
+ case 3:
452
+ case 20: return false;
453
+ default: return false;
454
+ }
455
+ }
456
+ function getMemoedVNodeCall(node) {
457
+ if (node.type === 14 && node.callee === WITH_MEMO) return node.arguments[1].returns;
458
+ else return node;
459
+ }
460
+ function parseForExpression(input) {
461
+ const loc = input.loc;
462
+ const exp = input.content;
463
+ const inMatch = exp.match(forAliasRE);
464
+ if (!inMatch) return;
465
+ const [, LHS, RHS] = inMatch;
466
+ const createAliasExpression = (content, offset, asParam = false) => {
467
+ const start = loc.start.offset + offset;
468
+ return createExp(content, false, getLoc(start, start + content.length), 0, asParam ? 1 : 0);
469
+ };
470
+ const result = {
471
+ source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
472
+ value: void 0,
473
+ key: void 0,
474
+ index: void 0,
475
+ finalized: false
476
+ };
477
+ let valueContent = LHS.trim().replace(stripParensRE, "").trim();
478
+ const trimmedOffset = LHS.indexOf(valueContent);
479
+ const iteratorMatch = valueContent.match(forIteratorRE);
480
+ if (iteratorMatch) {
481
+ valueContent = valueContent.replace(forIteratorRE, "").trim();
482
+ const keyContent = iteratorMatch[1].trim();
483
+ let keyOffset;
484
+ if (keyContent) {
485
+ keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
486
+ result.key = createAliasExpression(keyContent, keyOffset, true);
487
+ }
488
+ if (iteratorMatch[2]) {
489
+ const indexContent = iteratorMatch[2].trim();
490
+ if (indexContent) result.index = createAliasExpression(indexContent, exp.indexOf(indexContent, result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length), true);
491
+ }
492
+ }
493
+ if (valueContent) result.value = createAliasExpression(valueContent, trimmedOffset, true);
494
+ return result;
495
+ }
496
+ function getSlice(start, end) {
497
+ return currentInput.slice(start, end);
498
+ }
499
+ function endOpenTag(end) {
500
+ if (tokenizer.inSFCRoot) currentOpenTag.innerLoc = getLoc(end + 1, end + 1);
501
+ addNode(currentOpenTag);
502
+ const { tag, ns } = currentOpenTag;
503
+ if (ns === 0 && currentOptions.isPreTag(tag)) inPre++;
504
+ if (currentOptions.isVoidTag(tag)) onCloseTag(currentOpenTag, end);
505
+ else {
506
+ stack.unshift(currentOpenTag);
507
+ if (ns === 1 || ns === 2) tokenizer.inXML = true;
508
+ }
509
+ currentOpenTag = null;
510
+ }
511
+ function onText(content, start, end) {
512
+ {
513
+ const tag = stack[0] && stack[0].tag;
514
+ if (tag !== "script" && tag !== "style" && content.includes("&")) content = currentOptions.decodeEntities(content, false);
515
+ }
516
+ const parent = stack[0] || currentRoot;
517
+ const lastNode = parent.children[parent.children.length - 1];
518
+ if (lastNode && lastNode.type === 2) {
519
+ lastNode.content += content;
520
+ setLocEnd(lastNode.loc, end);
521
+ } else parent.children.push({
522
+ type: 2,
523
+ content,
524
+ loc: getLoc(start, end)
525
+ });
526
+ }
527
+ function onCloseTag(el, end, isImplied = false) {
528
+ if (isImplied) setLocEnd(el.loc, backTrack(end, 60));
529
+ else setLocEnd(el.loc, lookAhead(end, 62) + 1);
530
+ if (tokenizer.inSFCRoot) {
531
+ if (el.children.length) el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end);
532
+ else el.innerLoc.end = extend({}, el.innerLoc.start);
533
+ el.innerLoc.source = getSlice(el.innerLoc.start.offset, el.innerLoc.end.offset);
534
+ }
535
+ const { tag, ns, children } = el;
536
+ if (!inVPre) {
537
+ if (tag === "slot") el.tagType = 2;
538
+ else if (isFragmentTemplate(el)) el.tagType = 3;
539
+ else if (isComponent(el)) el.tagType = 1;
540
+ }
541
+ if (!tokenizer.inRCDATA) el.children = condenseWhitespace(children);
542
+ if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
543
+ const first = children[0];
544
+ if (first && first.type === 2) first.content = first.content.replace(/^\r?\n/, "");
545
+ }
546
+ if (ns === 0 && currentOptions.isPreTag(tag)) inPre--;
547
+ if (currentVPreBoundary === el) {
548
+ inVPre = tokenizer.inVPre = false;
549
+ currentVPreBoundary = null;
550
+ }
551
+ if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) tokenizer.inXML = false;
552
+ {
553
+ const props = el.props;
554
+ if (!tokenizer.inSFCRoot && isCompatEnabled("COMPILER_NATIVE_TEMPLATE", currentOptions) && el.tag === "template" && !isFragmentTemplate(el)) {
555
+ const parent = stack[0] || currentRoot;
556
+ const index = parent.children.indexOf(el);
557
+ parent.children.splice(index, 1, ...el.children);
558
+ }
559
+ const inlineTemplateProp = props.find((p) => p.type === 6 && p.name === "inline-template");
560
+ if (inlineTemplateProp && checkCompatEnabled("COMPILER_INLINE_TEMPLATE", currentOptions, inlineTemplateProp.loc) && el.children.length) inlineTemplateProp.value = {
561
+ type: 2,
562
+ content: getSlice(el.children[0].loc.start.offset, el.children[el.children.length - 1].loc.end.offset),
563
+ loc: inlineTemplateProp.loc
564
+ };
565
+ }
566
+ }
567
+ function lookAhead(index, c) {
568
+ let i = index;
569
+ while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++;
570
+ return i;
571
+ }
572
+ function backTrack(index, c) {
573
+ let i = index;
574
+ while (currentInput.charCodeAt(i) !== c && i >= 0) i--;
575
+ return i;
576
+ }
577
+ function isFragmentTemplate({ tag, props }) {
578
+ if (tag === "template") {
579
+ for (let i = 0; i < props.length; i++) if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) return true;
580
+ }
581
+ return false;
582
+ }
583
+ function isComponent({ tag, props }) {
584
+ if (currentOptions.isCustomElement(tag)) return false;
585
+ if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) return true;
586
+ for (let i = 0; i < props.length; i++) {
587
+ const p = props[i];
588
+ if (p.type === 6) {
589
+ if (p.name === "is" && p.value) {
590
+ if (p.value.content.startsWith("vue:")) return true;
591
+ else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT", currentOptions, p.loc)) return true;
592
+ }
593
+ } else if (p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled("COMPILER_IS_ON_ELEMENT", currentOptions, p.loc)) return true;
594
+ }
595
+ return false;
596
+ }
597
+ function isUpperCase(c) {
598
+ return c > 64 && c < 91;
599
+ }
600
+ function condenseWhitespace(nodes, tag) {
601
+ const shouldCondense = currentOptions.whitespace !== "preserve";
602
+ let removedWhitespace = false;
603
+ for (let i = 0; i < nodes.length; i++) {
604
+ const node = nodes[i];
605
+ if (node.type === 2) if (!inPre) {
606
+ if (isAllWhitespace(node.content)) {
607
+ const prev = nodes[i - 1] && nodes[i - 1].type;
608
+ const next = nodes[i + 1] && nodes[i + 1].type;
609
+ if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
610
+ removedWhitespace = true;
611
+ nodes[i] = null;
612
+ } else node.content = " ";
613
+ } else if (shouldCondense) node.content = condense(node.content);
614
+ } else node.content = node.content.replace(windowsNewlineRE, "\n");
615
+ }
616
+ return removedWhitespace ? nodes.filter(Boolean) : nodes;
617
+ }
618
+ function isAllWhitespace(str) {
619
+ for (let i = 0; i < str.length; i++) if (!isWhitespace(str.charCodeAt(i))) return false;
620
+ return true;
621
+ }
622
+ function hasNewlineChar(str) {
623
+ for (let i = 0; i < str.length; i++) {
624
+ const c = str.charCodeAt(i);
625
+ if (c === 10 || c === 13) return true;
626
+ }
627
+ return false;
628
+ }
629
+ function condense(str) {
630
+ let ret = "";
631
+ let prevCharIsWhitespace = false;
632
+ for (let i = 0; i < str.length; i++) if (isWhitespace(str.charCodeAt(i))) {
633
+ if (!prevCharIsWhitespace) {
634
+ ret += " ";
635
+ prevCharIsWhitespace = true;
636
+ }
637
+ } else {
638
+ ret += str[i];
639
+ prevCharIsWhitespace = false;
640
+ }
641
+ return ret;
642
+ }
643
+ function addNode(node) {
644
+ (stack[0] || currentRoot).children.push(node);
645
+ }
646
+ function getLoc(start, end) {
647
+ return {
648
+ start: tokenizer.getPos(start),
649
+ end: end == null ? end : tokenizer.getPos(end),
650
+ source: end == null ? end : getSlice(start, end)
651
+ };
652
+ }
653
+ function cloneLoc(loc) {
654
+ return getLoc(loc.start.offset, loc.end.offset);
655
+ }
656
+ function setLocEnd(loc, end) {
657
+ loc.end = tokenizer.getPos(end);
658
+ loc.source = getSlice(loc.start.offset, end);
659
+ }
660
+ function dirToAttr(dir) {
661
+ const attr = {
662
+ type: 6,
663
+ name: dir.rawName,
664
+ nameLoc: getLoc(dir.loc.start.offset, dir.loc.start.offset + dir.rawName.length),
665
+ value: void 0,
666
+ loc: dir.loc
667
+ };
668
+ if (dir.exp) {
669
+ const loc = dir.exp.loc;
670
+ if (loc.end.offset < dir.loc.end.offset) {
671
+ loc.start.offset--;
672
+ loc.start.column--;
673
+ loc.end.offset++;
674
+ loc.end.column++;
675
+ }
676
+ attr.value = {
677
+ type: 2,
678
+ content: dir.exp.content,
679
+ loc
680
+ };
681
+ }
682
+ return attr;
683
+ }
684
+ function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0) {
685
+ return createSimpleExpression(content, isStatic, loc, constType);
686
+ }
687
+ function emitError(code, index, message) {
688
+ currentOptions.onError(createCompilerError(code, getLoc(index, index), void 0, message));
689
+ }
690
+ function reset() {
691
+ tokenizer.reset();
692
+ currentOpenTag = null;
693
+ currentProp = null;
694
+ currentAttrValue = "";
695
+ currentAttrStartIndex = -1;
696
+ currentAttrEndIndex = -1;
697
+ stack.length = 0;
698
+ }
699
+ function baseParse(input, options) {
700
+ reset();
701
+ currentInput = input;
702
+ currentOptions = extend({}, defaultParserOptions);
703
+ if (options) {
704
+ let key;
705
+ for (key in options) if (options[key] != null) currentOptions[key] = options[key];
706
+ }
707
+ tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
708
+ tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
709
+ const delimiters = options && options.delimiters;
710
+ if (delimiters) {
711
+ tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
712
+ tokenizer.delimiterClose = toCharCodes(delimiters[1]);
713
+ }
714
+ const root = currentRoot = createRoot([], input);
715
+ tokenizer.parse(currentInput);
716
+ root.loc = getLoc(0, input.length);
717
+ root.children = condenseWhitespace(root.children);
718
+ currentRoot = null;
719
+ return root;
720
+ }
721
+ function cacheStatic(root, context) {
722
+ walk(root, void 0, context, isSingleElementRoot(root, root.children[0]));
723
+ }
724
+ function isSingleElementRoot(root, child) {
725
+ const { children } = root;
726
+ return children.length === 1 && child.type === 1 && !isSlotOutlet(child);
727
+ }
728
+ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
729
+ const { children } = node;
730
+ const toCache = [];
731
+ for (let i = 0; i < children.length; i++) {
732
+ const child = children[i];
733
+ if (child.type === 1 && child.tagType === 0) {
734
+ const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
735
+ if (constantType > 0) {
736
+ if (constantType >= 2) {
737
+ child.codegenNode.patchFlag = -1;
738
+ toCache.push(child);
739
+ continue;
740
+ }
741
+ } else {
742
+ const codegenNode = child.codegenNode;
743
+ if (codegenNode.type === 13) {
744
+ const flag = codegenNode.patchFlag;
745
+ if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
746
+ const props = getNodeProps(child);
747
+ if (props) codegenNode.props = context.hoist(props);
748
+ }
749
+ if (codegenNode.dynamicProps) codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);
750
+ }
751
+ }
752
+ } else if (child.type === 12) {
753
+ if ((doNotHoistNode ? 0 : getConstantType(child, context)) >= 2) {
754
+ toCache.push(child);
755
+ continue;
756
+ }
757
+ }
758
+ if (child.type === 1) {
759
+ const isComponent$1 = child.tagType === 1;
760
+ if (isComponent$1) context.scopes.vSlot++;
761
+ walk(child, node, context, false, inFor);
762
+ if (isComponent$1) context.scopes.vSlot--;
763
+ } else if (child.type === 11) walk(child, node, context, child.children.length === 1, true);
764
+ else if (child.type === 9) for (let i2 = 0; i2 < child.branches.length; i2++) walk(child.branches[i2], node, context, child.branches[i2].children.length === 1, inFor);
765
+ }
766
+ let cachedAsArray = false;
767
+ if (toCache.length === children.length && node.type === 1) {
768
+ if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
769
+ node.codegenNode.children = getCacheExpression(createArrayExpression(node.codegenNode.children));
770
+ cachedAsArray = true;
771
+ } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
772
+ const slot = getSlotNode(node.codegenNode, "default");
773
+ if (slot) {
774
+ slot.returns = getCacheExpression(createArrayExpression(slot.returns));
775
+ cachedAsArray = true;
776
+ }
777
+ } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) {
778
+ const slotName = findDir(node, "slot", true);
779
+ const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
780
+ if (slot) {
781
+ slot.returns = getCacheExpression(createArrayExpression(slot.returns));
782
+ cachedAsArray = true;
783
+ }
784
+ }
785
+ }
786
+ if (!cachedAsArray) for (const child of toCache) child.codegenNode = context.cache(child.codegenNode);
787
+ function getCacheExpression(value) {
788
+ const exp = context.cache(value);
789
+ if (inFor && context.hmr) exp.needArraySpread = true;
790
+ return exp;
791
+ }
792
+ function getSlotNode(node2, name) {
793
+ if (node2.children && !isArray(node2.children) && node2.children.type === 15) {
794
+ const slot = node2.children.properties.find((p) => p.key === name || p.key.content === name);
795
+ return slot && slot.value;
796
+ }
797
+ }
798
+ if (toCache.length && context.transformHoist) context.transformHoist(children, context, node);
799
+ }
800
+ function getConstantType(node, context) {
801
+ const { constantCache } = context;
802
+ switch (node.type) {
803
+ case 1:
804
+ if (node.tagType !== 0) return 0;
805
+ const cached = constantCache.get(node);
806
+ if (cached !== void 0) return cached;
807
+ const codegenNode = node.codegenNode;
808
+ if (codegenNode.type !== 13) return 0;
809
+ if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") return 0;
810
+ if (codegenNode.patchFlag === void 0) {
811
+ let returnType2 = 3;
812
+ const generatedPropsType = getGeneratedPropsConstantType(node, context);
813
+ if (generatedPropsType === 0) {
814
+ constantCache.set(node, 0);
815
+ return 0;
816
+ }
817
+ if (generatedPropsType < returnType2) returnType2 = generatedPropsType;
818
+ for (let i = 0; i < node.children.length; i++) {
819
+ const childType = getConstantType(node.children[i], context);
820
+ if (childType === 0) {
821
+ constantCache.set(node, 0);
822
+ return 0;
823
+ }
824
+ if (childType < returnType2) returnType2 = childType;
825
+ }
826
+ if (returnType2 > 1) for (let i = 0; i < node.props.length; i++) {
827
+ const p = node.props[i];
828
+ if (p.type === 7 && p.name === "bind" && p.exp) {
829
+ const expType = getConstantType(p.exp, context);
830
+ if (expType === 0) {
831
+ constantCache.set(node, 0);
832
+ return 0;
833
+ }
834
+ if (expType < returnType2) returnType2 = expType;
835
+ }
836
+ }
837
+ if (codegenNode.isBlock) {
838
+ for (let i = 0; i < node.props.length; i++) if (node.props[i].type === 7) {
839
+ constantCache.set(node, 0);
840
+ return 0;
841
+ }
842
+ context.removeHelper(OPEN_BLOCK);
843
+ context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
844
+ codegenNode.isBlock = false;
845
+ context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));
846
+ }
847
+ constantCache.set(node, returnType2);
848
+ return returnType2;
849
+ } else {
850
+ constantCache.set(node, 0);
851
+ return 0;
852
+ }
853
+ case 2:
854
+ case 3: return 3;
855
+ case 9:
856
+ case 11:
857
+ case 10: return 0;
858
+ case 5:
859
+ case 12: return getConstantType(node.content, context);
860
+ case 4: return node.constType;
861
+ case 8:
862
+ let returnType = 3;
863
+ for (let i = 0; i < node.children.length; i++) {
864
+ const child = node.children[i];
865
+ if (isString(child) || isSymbol(child)) continue;
866
+ const childType = getConstantType(child, context);
867
+ if (childType === 0) return 0;
868
+ else if (childType < returnType) returnType = childType;
869
+ }
870
+ return returnType;
871
+ case 20: return 2;
872
+ default: return 0;
873
+ }
874
+ }
875
+ function getConstantTypeOfHelperCall(value, context) {
876
+ if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
877
+ const arg = value.arguments[0];
878
+ if (arg.type === 4) return getConstantType(arg, context);
879
+ else if (arg.type === 14) return getConstantTypeOfHelperCall(arg, context);
880
+ }
881
+ return 0;
882
+ }
883
+ function getGeneratedPropsConstantType(node, context) {
884
+ let returnType = 3;
885
+ const props = getNodeProps(node);
886
+ if (props && props.type === 15) {
887
+ const { properties } = props;
888
+ for (let i = 0; i < properties.length; i++) {
889
+ const { key, value } = properties[i];
890
+ const keyType = getConstantType(key, context);
891
+ if (keyType === 0) return keyType;
892
+ if (keyType < returnType) returnType = keyType;
893
+ let valueType;
894
+ if (value.type === 4) valueType = getConstantType(value, context);
895
+ else if (value.type === 14) valueType = getConstantTypeOfHelperCall(value, context);
896
+ else valueType = 0;
897
+ if (valueType === 0) return valueType;
898
+ if (valueType < returnType) returnType = valueType;
899
+ }
900
+ }
901
+ return returnType;
902
+ }
903
+ function getNodeProps(node) {
904
+ const codegenNode = node.codegenNode;
905
+ if (codegenNode.type === 13) return codegenNode.props;
906
+ }
907
+ function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
908
+ const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
909
+ const context = {
910
+ filename,
911
+ selfName: nameMatch && capitalize(camelize(nameMatch[1])),
912
+ prefixIdentifiers,
913
+ hoistStatic,
914
+ hmr,
915
+ cacheHandlers,
916
+ nodeTransforms,
917
+ directiveTransforms,
918
+ transformHoist,
919
+ isBuiltInComponent,
920
+ isCustomElement,
921
+ expressionPlugins,
922
+ scopeId,
923
+ slotted,
924
+ ssr,
925
+ inSSR,
926
+ ssrCssVars,
927
+ bindingMetadata,
928
+ inline,
929
+ isTS,
930
+ onError,
931
+ onWarn,
932
+ compatConfig,
933
+ root,
934
+ helpers: /* @__PURE__ */ new Map(),
935
+ components: /* @__PURE__ */ new Set(),
936
+ directives: /* @__PURE__ */ new Set(),
937
+ hoists: [],
938
+ imports: [],
939
+ cached: [],
940
+ constantCache: /* @__PURE__ */ new WeakMap(),
941
+ temps: 0,
942
+ identifiers: /* @__PURE__ */ Object.create(null),
943
+ scopes: {
944
+ vFor: 0,
945
+ vSlot: 0,
946
+ vPre: 0,
947
+ vOnce: 0
948
+ },
949
+ parent: null,
950
+ grandParent: null,
951
+ currentNode: root,
952
+ childIndex: 0,
953
+ inVOnce: false,
954
+ helper(name) {
955
+ const count = context.helpers.get(name) || 0;
956
+ context.helpers.set(name, count + 1);
957
+ return name;
958
+ },
959
+ removeHelper(name) {
960
+ const count = context.helpers.get(name);
961
+ if (count) {
962
+ const currentCount = count - 1;
963
+ if (!currentCount) context.helpers.delete(name);
964
+ else context.helpers.set(name, currentCount);
965
+ }
966
+ },
967
+ helperString(name) {
968
+ return `_${helperNameMap[context.helper(name)]}`;
969
+ },
970
+ replaceNode(node) {
971
+ context.parent.children[context.childIndex] = context.currentNode = node;
972
+ },
973
+ removeNode(node) {
974
+ const list = context.parent.children;
975
+ const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1;
976
+ if (!node || node === context.currentNode) {
977
+ context.currentNode = null;
978
+ context.onNodeRemoved();
979
+ } else if (context.childIndex > removalIndex) {
980
+ context.childIndex--;
981
+ context.onNodeRemoved();
982
+ }
983
+ context.parent.children.splice(removalIndex, 1);
984
+ },
985
+ onNodeRemoved: NOOP,
986
+ addIdentifiers(exp) {},
987
+ removeIdentifiers(exp) {},
988
+ hoist(exp) {
989
+ if (isString(exp)) exp = createSimpleExpression(exp);
990
+ context.hoists.push(exp);
991
+ const identifier = createSimpleExpression(`_hoisted_${context.hoists.length}`, false, exp.loc, 2);
992
+ identifier.hoisted = exp;
993
+ return identifier;
994
+ },
995
+ cache(exp, isVNode = false, inVOnce = false) {
996
+ const cacheExp = createCacheExpression(context.cached.length, exp, isVNode, inVOnce);
997
+ context.cached.push(cacheExp);
998
+ return cacheExp;
999
+ }
1000
+ };
1001
+ context.filters = /* @__PURE__ */ new Set();
1002
+ return context;
1003
+ }
1004
+ function transform(root, options) {
1005
+ const context = createTransformContext(root, options);
1006
+ traverseNode(root, context);
1007
+ if (options.hoistStatic) cacheStatic(root, context);
1008
+ if (!options.ssr) createRootCodegen(root, context);
1009
+ root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);
1010
+ root.components = [...context.components];
1011
+ root.directives = [...context.directives];
1012
+ root.imports = context.imports;
1013
+ root.hoists = context.hoists;
1014
+ root.temps = context.temps;
1015
+ root.cached = context.cached;
1016
+ root.transformed = true;
1017
+ root.filters = [...context.filters];
1018
+ }
1019
+ function createRootCodegen(root, context) {
1020
+ const { helper } = context;
1021
+ const { children } = root;
1022
+ if (children.length === 1) {
1023
+ const child = children[0];
1024
+ if (isSingleElementRoot(root, child) && child.codegenNode) {
1025
+ const codegenNode = child.codegenNode;
1026
+ if (codegenNode.type === 13) convertToBlock(codegenNode, context);
1027
+ root.codegenNode = codegenNode;
1028
+ } else root.codegenNode = child;
1029
+ } else if (children.length > 1) root.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, root.children, 64, void 0, void 0, true, void 0, false);
1030
+ }
1031
+ function traverseChildren(parent, context) {
1032
+ let i = 0;
1033
+ const nodeRemoved = () => {
1034
+ i--;
1035
+ };
1036
+ for (; i < parent.children.length; i++) {
1037
+ const child = parent.children[i];
1038
+ if (isString(child)) continue;
1039
+ context.grandParent = context.parent;
1040
+ context.parent = parent;
1041
+ context.childIndex = i;
1042
+ context.onNodeRemoved = nodeRemoved;
1043
+ traverseNode(child, context);
1044
+ }
1045
+ }
1046
+ function traverseNode(node, context) {
1047
+ context.currentNode = node;
1048
+ const { nodeTransforms } = context;
1049
+ const exitFns = [];
1050
+ for (let i2 = 0; i2 < nodeTransforms.length; i2++) {
1051
+ const onExit = nodeTransforms[i2](node, context);
1052
+ if (onExit) if (isArray(onExit)) exitFns.push(...onExit);
1053
+ else exitFns.push(onExit);
1054
+ if (!context.currentNode) return;
1055
+ else node = context.currentNode;
1056
+ }
1057
+ switch (node.type) {
1058
+ case 3:
1059
+ if (!context.ssr) context.helper(CREATE_COMMENT);
1060
+ break;
1061
+ case 5:
1062
+ if (!context.ssr) context.helper(TO_DISPLAY_STRING);
1063
+ break;
1064
+ case 9:
1065
+ for (let i2 = 0; i2 < node.branches.length; i2++) traverseNode(node.branches[i2], context);
1066
+ break;
1067
+ case 10:
1068
+ case 11:
1069
+ case 1:
1070
+ case 0:
1071
+ traverseChildren(node, context);
1072
+ break;
1073
+ }
1074
+ context.currentNode = node;
1075
+ let i = exitFns.length;
1076
+ while (i--) exitFns[i]();
1077
+ }
1078
+ function createStructuralDirectiveTransform(name, fn) {
1079
+ const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
1080
+ return (node, context) => {
1081
+ if (node.type === 1) {
1082
+ const { props } = node;
1083
+ if (node.tagType === 3 && props.some(isVSlot)) return;
1084
+ const exitFns = [];
1085
+ for (let i = 0; i < props.length; i++) {
1086
+ const prop = props[i];
1087
+ if (prop.type === 7 && matches(prop.name)) {
1088
+ props.splice(i, 1);
1089
+ i--;
1090
+ const onExit = fn(node, prop, context);
1091
+ if (onExit) exitFns.push(onExit);
1092
+ }
1093
+ }
1094
+ return exitFns;
1095
+ }
1096
+ };
1097
+ }
1098
+ function createCodegenContext(ast, { mode = "function", prefixIdentifiers = mode === "module", sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssrRuntimeModuleName = "vue/server-renderer", ssr = false, isTS = false, inSSR = false }) {
1099
+ const context = {
1100
+ mode,
1101
+ prefixIdentifiers,
1102
+ sourceMap,
1103
+ filename,
1104
+ scopeId,
1105
+ optimizeImports,
1106
+ runtimeGlobalName,
1107
+ runtimeModuleName,
1108
+ ssrRuntimeModuleName,
1109
+ ssr,
1110
+ isTS,
1111
+ inSSR,
1112
+ source: ast.source,
1113
+ code: ``,
1114
+ column: 1,
1115
+ line: 1,
1116
+ offset: 0,
1117
+ indentLevel: 0,
1118
+ pure: false,
1119
+ map: void 0,
1120
+ helper(key) {
1121
+ return `_${helperNameMap[key]}`;
1122
+ },
1123
+ push(code, newlineIndex = -2, node) {
1124
+ context.code += code;
1125
+ },
1126
+ indent() {
1127
+ newline(++context.indentLevel);
1128
+ },
1129
+ deindent(withoutNewLine = false) {
1130
+ if (withoutNewLine) --context.indentLevel;
1131
+ else newline(--context.indentLevel);
1132
+ },
1133
+ newline() {
1134
+ newline(context.indentLevel);
1135
+ }
1136
+ };
1137
+ function newline(n) {
1138
+ context.push("\n" + ` `.repeat(n), 0);
1139
+ }
1140
+ return context;
1141
+ }
1142
+ function generate(ast, options = {}) {
1143
+ const context = createCodegenContext(ast, options);
1144
+ if (options.onContextCreated) options.onContextCreated(context);
1145
+ const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
1146
+ const helpers = Array.from(ast.helpers);
1147
+ const hasHelpers = helpers.length > 0;
1148
+ const useWithBlock = !prefixIdentifiers && mode !== "module";
1149
+ genFunctionPreamble(ast, context);
1150
+ push(`function ${ssr ? `ssrRender` : `render`}(${(ssr ? [
1151
+ "_ctx",
1152
+ "_push",
1153
+ "_parent",
1154
+ "_attrs"
1155
+ ] : ["_ctx", "_cache"]).join(", ")}) {`);
1156
+ indent();
1157
+ if (useWithBlock) {
1158
+ push(`with (_ctx) {`);
1159
+ indent();
1160
+ if (hasHelpers) {
1161
+ push(`const { ${helpers.map(aliasHelper).join(", ")} } = _Vue
1162
+ `, -1);
1163
+ newline();
1164
+ }
1165
+ }
1166
+ if (ast.components.length) {
1167
+ genAssets(ast.components, "component", context);
1168
+ if (ast.directives.length || ast.temps > 0) newline();
1169
+ }
1170
+ if (ast.directives.length) {
1171
+ genAssets(ast.directives, "directive", context);
1172
+ if (ast.temps > 0) newline();
1173
+ }
1174
+ if (ast.filters && ast.filters.length) {
1175
+ newline();
1176
+ genAssets(ast.filters, "filter", context);
1177
+ newline();
1178
+ }
1179
+ if (ast.temps > 0) {
1180
+ push(`let `);
1181
+ for (let i = 0; i < ast.temps; i++) push(`${i > 0 ? `, ` : ``}_temp${i}`);
1182
+ }
1183
+ if (ast.components.length || ast.directives.length || ast.temps) {
1184
+ push(`
1185
+ `, 0);
1186
+ newline();
1187
+ }
1188
+ if (!ssr) push(`return `);
1189
+ if (ast.codegenNode) genNode(ast.codegenNode, context);
1190
+ else push(`null`);
1191
+ if (useWithBlock) {
1192
+ deindent();
1193
+ push(`}`);
1194
+ }
1195
+ deindent();
1196
+ push(`}`);
1197
+ return {
1198
+ ast,
1199
+ code: context.code,
1200
+ preamble: ``,
1201
+ map: context.map ? context.map.toJSON() : void 0
1202
+ };
1203
+ }
1204
+ function genFunctionPreamble(ast, context) {
1205
+ const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName, ssrRuntimeModuleName } = context;
1206
+ const VueBinding = runtimeGlobalName;
1207
+ const helpers = Array.from(ast.helpers);
1208
+ if (helpers.length > 0) {
1209
+ push(`const _Vue = ${VueBinding}
1210
+ `, -1);
1211
+ if (ast.hoists.length) push(`const { ${[
1212
+ CREATE_VNODE,
1213
+ CREATE_ELEMENT_VNODE,
1214
+ CREATE_COMMENT,
1215
+ CREATE_TEXT,
1216
+ CREATE_STATIC
1217
+ ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", ")} } = _Vue
1218
+ `, -1);
1219
+ }
1220
+ genHoists(ast.hoists, context);
1221
+ newline();
1222
+ push(`return `);
1223
+ }
1224
+ function genAssets(assets, type, { helper, push, newline, isTS }) {
1225
+ const resolver = helper(type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE);
1226
+ for (let i = 0; i < assets.length; i++) {
1227
+ let id = assets[i];
1228
+ const maybeSelfReference = id.endsWith("__self");
1229
+ if (maybeSelfReference) id = id.slice(0, -6);
1230
+ push(`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`);
1231
+ if (i < assets.length - 1) newline();
1232
+ }
1233
+ }
1234
+ function genHoists(hoists, context) {
1235
+ if (!hoists.length) return;
1236
+ context.pure = true;
1237
+ const { push, newline } = context;
1238
+ newline();
1239
+ for (let i = 0; i < hoists.length; i++) {
1240
+ const exp = hoists[i];
1241
+ if (exp) {
1242
+ push(`const _hoisted_${i + 1} = `);
1243
+ genNode(exp, context);
1244
+ newline();
1245
+ }
1246
+ }
1247
+ context.pure = false;
1248
+ }
1249
+ function genNodeListAsArray(nodes, context) {
1250
+ const multilines = nodes.length > 3 || false;
1251
+ context.push(`[`);
1252
+ multilines && context.indent();
1253
+ genNodeList(nodes, context, multilines);
1254
+ multilines && context.deindent();
1255
+ context.push(`]`);
1256
+ }
1257
+ function genNodeList(nodes, context, multilines = false, comma = true) {
1258
+ const { push, newline } = context;
1259
+ for (let i = 0; i < nodes.length; i++) {
1260
+ const node = nodes[i];
1261
+ if (isString(node)) push(node, -3);
1262
+ else if (isArray(node)) genNodeListAsArray(node, context);
1263
+ else genNode(node, context);
1264
+ if (i < nodes.length - 1) if (multilines) {
1265
+ comma && push(",");
1266
+ newline();
1267
+ } else comma && push(", ");
1268
+ }
1269
+ }
1270
+ function genNode(node, context) {
1271
+ if (isString(node)) {
1272
+ context.push(node, -3);
1273
+ return;
1274
+ }
1275
+ if (isSymbol(node)) {
1276
+ context.push(context.helper(node));
1277
+ return;
1278
+ }
1279
+ switch (node.type) {
1280
+ case 1:
1281
+ case 9:
1282
+ case 11:
1283
+ genNode(node.codegenNode, context);
1284
+ break;
1285
+ case 2:
1286
+ genText(node, context);
1287
+ break;
1288
+ case 4:
1289
+ genExpression(node, context);
1290
+ break;
1291
+ case 5:
1292
+ genInterpolation(node, context);
1293
+ break;
1294
+ case 12:
1295
+ genNode(node.codegenNode, context);
1296
+ break;
1297
+ case 8:
1298
+ genCompoundExpression(node, context);
1299
+ break;
1300
+ case 3:
1301
+ genComment(node, context);
1302
+ break;
1303
+ case 13:
1304
+ genVNodeCall(node, context);
1305
+ break;
1306
+ case 14:
1307
+ genCallExpression(node, context);
1308
+ break;
1309
+ case 15:
1310
+ genObjectExpression(node, context);
1311
+ break;
1312
+ case 17:
1313
+ genArrayExpression(node, context);
1314
+ break;
1315
+ case 18:
1316
+ genFunctionExpression(node, context);
1317
+ break;
1318
+ case 19:
1319
+ genConditionalExpression(node, context);
1320
+ break;
1321
+ case 20:
1322
+ genCacheExpression(node, context);
1323
+ break;
1324
+ case 21:
1325
+ genNodeList(node.body, context, true, false);
1326
+ break;
1327
+ case 22: break;
1328
+ case 23: break;
1329
+ case 24: break;
1330
+ case 25: break;
1331
+ case 26: break;
1332
+ case 10: break;
1333
+ default:
1334
+ }
1335
+ }
1336
+ function genText(node, context) {
1337
+ context.push(JSON.stringify(node.content), -3, node);
1338
+ }
1339
+ function genExpression(node, context) {
1340
+ const { content, isStatic } = node;
1341
+ context.push(isStatic ? JSON.stringify(content) : content, -3, node);
1342
+ }
1343
+ function genInterpolation(node, context) {
1344
+ const { push, helper, pure } = context;
1345
+ if (pure) push(PURE_ANNOTATION);
1346
+ push(`${helper(TO_DISPLAY_STRING)}(`);
1347
+ genNode(node.content, context);
1348
+ push(`)`);
1349
+ }
1350
+ function genCompoundExpression(node, context) {
1351
+ for (let i = 0; i < node.children.length; i++) {
1352
+ const child = node.children[i];
1353
+ if (isString(child)) context.push(child, -3);
1354
+ else genNode(child, context);
1355
+ }
1356
+ }
1357
+ function genExpressionAsPropertyKey(node, context) {
1358
+ const { push } = context;
1359
+ if (node.type === 8) {
1360
+ push(`[`);
1361
+ genCompoundExpression(node, context);
1362
+ push(`]`);
1363
+ } else if (node.isStatic) push(isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content), -2, node);
1364
+ else push(`[${node.content}]`, -3, node);
1365
+ }
1366
+ function genComment(node, context) {
1367
+ const { push, helper, pure } = context;
1368
+ if (pure) push(PURE_ANNOTATION);
1369
+ push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, -3, node);
1370
+ }
1371
+ function genVNodeCall(node, context) {
1372
+ const { push, helper, pure } = context;
1373
+ const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent: isComponent$1 } = node;
1374
+ let patchFlagString;
1375
+ if (patchFlag) patchFlagString = String(patchFlag);
1376
+ if (directives) push(helper(WITH_DIRECTIVES) + `(`);
1377
+ if (isBlock) push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
1378
+ if (pure) push(PURE_ANNOTATION);
1379
+ push(helper(isBlock ? getVNodeBlockHelper(context.inSSR, isComponent$1) : getVNodeHelper(context.inSSR, isComponent$1)) + `(`, -2, node);
1380
+ genNodeList(genNullableArgs([
1381
+ tag,
1382
+ props,
1383
+ children,
1384
+ patchFlagString,
1385
+ dynamicProps
1386
+ ]), context);
1387
+ push(`)`);
1388
+ if (isBlock) push(`)`);
1389
+ if (directives) {
1390
+ push(`, `);
1391
+ genNode(directives, context);
1392
+ push(`)`);
1393
+ }
1394
+ }
1395
+ function genNullableArgs(args) {
1396
+ let i = args.length;
1397
+ while (i--) if (args[i] != null) break;
1398
+ return args.slice(0, i + 1).map((arg) => arg || `null`);
1399
+ }
1400
+ function genCallExpression(node, context) {
1401
+ const { push, helper, pure } = context;
1402
+ const callee = isString(node.callee) ? node.callee : helper(node.callee);
1403
+ if (pure) push(PURE_ANNOTATION);
1404
+ push(callee + `(`, -2, node);
1405
+ genNodeList(node.arguments, context);
1406
+ push(`)`);
1407
+ }
1408
+ function genObjectExpression(node, context) {
1409
+ const { push, indent, deindent, newline } = context;
1410
+ const { properties } = node;
1411
+ if (!properties.length) {
1412
+ push(`{}`, -2, node);
1413
+ return;
1414
+ }
1415
+ const multilines = properties.length > 1 || false;
1416
+ push(multilines ? `{` : `{ `);
1417
+ multilines && indent();
1418
+ for (let i = 0; i < properties.length; i++) {
1419
+ const { key, value } = properties[i];
1420
+ genExpressionAsPropertyKey(key, context);
1421
+ push(`: `);
1422
+ genNode(value, context);
1423
+ if (i < properties.length - 1) {
1424
+ push(`,`);
1425
+ newline();
1426
+ }
1427
+ }
1428
+ multilines && deindent();
1429
+ push(multilines ? `}` : ` }`);
1430
+ }
1431
+ function genArrayExpression(node, context) {
1432
+ genNodeListAsArray(node.elements, context);
1433
+ }
1434
+ function genFunctionExpression(node, context) {
1435
+ const { push, indent, deindent } = context;
1436
+ const { params, returns, body, newline, isSlot } = node;
1437
+ if (isSlot) push(`_${helperNameMap[WITH_CTX]}(`);
1438
+ push(`(`, -2, node);
1439
+ if (isArray(params)) genNodeList(params, context);
1440
+ else if (params) genNode(params, context);
1441
+ push(`) => `);
1442
+ if (newline || body) {
1443
+ push(`{`);
1444
+ indent();
1445
+ }
1446
+ if (returns) {
1447
+ if (newline) push(`return `);
1448
+ if (isArray(returns)) genNodeListAsArray(returns, context);
1449
+ else genNode(returns, context);
1450
+ } else if (body) genNode(body, context);
1451
+ if (newline || body) {
1452
+ deindent();
1453
+ push(`}`);
1454
+ }
1455
+ if (isSlot) {
1456
+ if (node.isNonScopedSlot) push(`, undefined, true`);
1457
+ push(`)`);
1458
+ }
1459
+ }
1460
+ function genConditionalExpression(node, context) {
1461
+ const { test, consequent, alternate, newline: needNewline } = node;
1462
+ const { push, indent, deindent, newline } = context;
1463
+ if (test.type === 4) {
1464
+ const needsParens = !isSimpleIdentifier(test.content);
1465
+ needsParens && push(`(`);
1466
+ genExpression(test, context);
1467
+ needsParens && push(`)`);
1468
+ } else {
1469
+ push(`(`);
1470
+ genNode(test, context);
1471
+ push(`)`);
1472
+ }
1473
+ needNewline && indent();
1474
+ context.indentLevel++;
1475
+ needNewline || push(` `);
1476
+ push(`? `);
1477
+ genNode(consequent, context);
1478
+ context.indentLevel--;
1479
+ needNewline && newline();
1480
+ needNewline || push(` `);
1481
+ push(`: `);
1482
+ const isNested = alternate.type === 19;
1483
+ if (!isNested) context.indentLevel++;
1484
+ genNode(alternate, context);
1485
+ if (!isNested) context.indentLevel--;
1486
+ needNewline && deindent(true);
1487
+ }
1488
+ function genCacheExpression(node, context) {
1489
+ const { push, helper, indent, deindent, newline } = context;
1490
+ const { needPauseTracking, needArraySpread } = node;
1491
+ if (needArraySpread) push(`[...(`);
1492
+ push(`_cache[${node.index}] || (`);
1493
+ if (needPauseTracking) {
1494
+ indent();
1495
+ push(`${helper(SET_BLOCK_TRACKING)}(-1`);
1496
+ if (node.inVOnce) push(`, true`);
1497
+ push(`),`);
1498
+ newline();
1499
+ push(`(`);
1500
+ }
1501
+ push(`_cache[${node.index}] = `);
1502
+ genNode(node.value, context);
1503
+ if (needPauseTracking) {
1504
+ push(`).cacheIndex = ${node.index},`);
1505
+ newline();
1506
+ push(`${helper(SET_BLOCK_TRACKING)}(1),`);
1507
+ newline();
1508
+ push(`_cache[${node.index}]`);
1509
+ deindent();
1510
+ }
1511
+ push(`)`);
1512
+ if (needArraySpread) push(`)]`);
1513
+ }
1514
+ function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) {
1515
+ return node;
1516
+ }
1517
+ function stringifyExpression(exp) {
1518
+ if (isString(exp)) return exp;
1519
+ else if (exp.type === 4) return exp.content;
1520
+ else return exp.children.map(stringifyExpression).join("");
1521
+ }
1522
+ function processIf(node, dir, context, processCodegen) {
1523
+ if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
1524
+ const loc = dir.exp ? dir.exp.loc : node.loc;
1525
+ context.onError(createCompilerError(28, dir.loc));
1526
+ dir.exp = createSimpleExpression(`true`, false, loc);
1527
+ }
1528
+ if (dir.name === "if") {
1529
+ const branch = createIfBranch(node, dir);
1530
+ const ifNode = {
1531
+ type: 9,
1532
+ loc: cloneLoc(node.loc),
1533
+ branches: [branch]
1534
+ };
1535
+ context.replaceNode(ifNode);
1536
+ if (processCodegen) return processCodegen(ifNode, branch, true);
1537
+ } else {
1538
+ const siblings = context.parent.children;
1539
+ let i = siblings.indexOf(node);
1540
+ while (i-- >= -1) {
1541
+ const sibling = siblings[i];
1542
+ if (sibling && sibling.type === 3) {
1543
+ context.removeNode(sibling);
1544
+ continue;
1545
+ }
1546
+ if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
1547
+ context.removeNode(sibling);
1548
+ continue;
1549
+ }
1550
+ if (sibling && sibling.type === 9) {
1551
+ if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) context.onError(createCompilerError(30, node.loc));
1552
+ context.removeNode();
1553
+ const branch = createIfBranch(node, dir);
1554
+ sibling.branches.push(branch);
1555
+ const onExit = processCodegen && processCodegen(sibling, branch, false);
1556
+ traverseNode(branch, context);
1557
+ if (onExit) onExit();
1558
+ context.currentNode = null;
1559
+ } else context.onError(createCompilerError(30, node.loc));
1560
+ break;
1561
+ }
1562
+ }
1563
+ }
1564
+ function createIfBranch(node, dir) {
1565
+ const isTemplateIf = node.tagType === 3;
1566
+ return {
1567
+ type: 10,
1568
+ loc: node.loc,
1569
+ condition: dir.name === "else" ? void 0 : dir.exp,
1570
+ children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
1571
+ userKey: findProp(node, `key`),
1572
+ isTemplateIf
1573
+ };
1574
+ }
1575
+ function createCodegenNodeForBranch(branch, keyIndex, context) {
1576
+ if (branch.condition) return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context), createCallExpression(context.helper(CREATE_COMMENT), ["\"\"", "true"]));
1577
+ else return createChildrenCodegenNode(branch, keyIndex, context);
1578
+ }
1579
+ function createChildrenCodegenNode(branch, keyIndex, context) {
1580
+ const { helper } = context;
1581
+ const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2));
1582
+ const { children } = branch;
1583
+ const firstChild = children[0];
1584
+ if (children.length !== 1 || firstChild.type !== 1) if (children.length === 1 && firstChild.type === 11) {
1585
+ const vnodeCall = firstChild.codegenNode;
1586
+ injectProp(vnodeCall, keyProperty, context);
1587
+ return vnodeCall;
1588
+ } else return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, 64, void 0, void 0, true, false, false, branch.loc);
1589
+ else {
1590
+ const ret = firstChild.codegenNode;
1591
+ const vnodeCall = getMemoedVNodeCall(ret);
1592
+ if (vnodeCall.type === 13) convertToBlock(vnodeCall, context);
1593
+ injectProp(vnodeCall, keyProperty, context);
1594
+ return ret;
1595
+ }
1596
+ }
1597
+ function getParentCondition(node) {
1598
+ while (true) if (node.type === 19) if (node.alternate.type === 19) node = node.alternate;
1599
+ else return node;
1600
+ else if (node.type === 20) node = node.value;
1601
+ }
1602
+ function processFor(node, dir, context, processCodegen) {
1603
+ if (!dir.exp) {
1604
+ context.onError(createCompilerError(31, dir.loc));
1605
+ return;
1606
+ }
1607
+ const parseResult = dir.forParseResult;
1608
+ if (!parseResult) {
1609
+ context.onError(createCompilerError(32, dir.loc));
1610
+ return;
1611
+ }
1612
+ finalizeForParseResult(parseResult, context);
1613
+ const { addIdentifiers, removeIdentifiers, scopes } = context;
1614
+ const { source, value, key, index } = parseResult;
1615
+ const forNode = {
1616
+ type: 11,
1617
+ loc: dir.loc,
1618
+ source,
1619
+ valueAlias: value,
1620
+ keyAlias: key,
1621
+ objectIndexAlias: index,
1622
+ parseResult,
1623
+ children: isTemplateNode(node) ? node.children : [node]
1624
+ };
1625
+ context.replaceNode(forNode);
1626
+ scopes.vFor++;
1627
+ const onExit = processCodegen && processCodegen(forNode);
1628
+ return () => {
1629
+ scopes.vFor--;
1630
+ if (onExit) onExit();
1631
+ };
1632
+ }
1633
+ function finalizeForParseResult(result, context) {
1634
+ if (result.finalized) return;
1635
+ result.finalized = true;
1636
+ }
1637
+ function createForLoopParams({ value, key, index }, memoArgs = []) {
1638
+ return createParamsList([
1639
+ value,
1640
+ key,
1641
+ index,
1642
+ ...memoArgs
1643
+ ]);
1644
+ }
1645
+ function createParamsList(args) {
1646
+ let i = args.length;
1647
+ while (i--) if (args[i]) break;
1648
+ return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false));
1649
+ }
1650
+ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
1651
+ context.helper(WITH_CTX);
1652
+ const { children, loc } = node;
1653
+ const slotsProperties = [];
1654
+ const dynamicSlots = [];
1655
+ let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
1656
+ const onComponentSlot = findDir(node, "slot", true);
1657
+ if (onComponentSlot) {
1658
+ const { arg, exp } = onComponentSlot;
1659
+ if (arg && !isStaticExp(arg)) hasDynamicSlots = true;
1660
+ slotsProperties.push(createObjectProperty(arg || createSimpleExpression("default", true), buildSlotFn(exp, void 0, children, loc)));
1661
+ }
1662
+ let hasTemplateSlots = false;
1663
+ let hasNamedDefaultSlot = false;
1664
+ const implicitDefaultChildren = [];
1665
+ const seenSlotNames = /* @__PURE__ */ new Set();
1666
+ let conditionalBranchIndex = 0;
1667
+ for (let i = 0; i < children.length; i++) {
1668
+ const slotElement = children[i];
1669
+ let slotDir;
1670
+ if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
1671
+ if (slotElement.type !== 3) implicitDefaultChildren.push(slotElement);
1672
+ continue;
1673
+ }
1674
+ if (onComponentSlot) {
1675
+ context.onError(createCompilerError(37, slotDir.loc));
1676
+ break;
1677
+ }
1678
+ hasTemplateSlots = true;
1679
+ const { children: slotChildren, loc: slotLoc } = slotElement;
1680
+ const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir;
1681
+ let staticSlotName;
1682
+ if (isStaticExp(slotName)) staticSlotName = slotName ? slotName.content : `default`;
1683
+ else hasDynamicSlots = true;
1684
+ const vFor = findDir(slotElement, "for");
1685
+ const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc);
1686
+ let vIf;
1687
+ let vElse;
1688
+ if (vIf = findDir(slotElement, "if")) {
1689
+ hasDynamicSlots = true;
1690
+ dynamicSlots.push(createConditionalExpression(vIf.exp, buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), defaultFallback));
1691
+ } else if (vElse = findDir(slotElement, /^else(-if)?$/, true)) {
1692
+ let j = i;
1693
+ let prev;
1694
+ while (j--) {
1695
+ prev = children[j];
1696
+ if (prev.type !== 3) break;
1697
+ }
1698
+ if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
1699
+ let conditional = dynamicSlots[dynamicSlots.length - 1];
1700
+ while (conditional.alternate.type === 19) conditional = conditional.alternate;
1701
+ conditional.alternate = vElse.exp ? createConditionalExpression(vElse.exp, buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), defaultFallback) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
1702
+ } else context.onError(createCompilerError(30, vElse.loc));
1703
+ } else if (vFor) {
1704
+ hasDynamicSlots = true;
1705
+ const parseResult = vFor.forParseResult;
1706
+ if (parseResult) {
1707
+ finalizeForParseResult(parseResult, context);
1708
+ dynamicSlots.push(createCallExpression(context.helper(RENDER_LIST), [parseResult.source, createFunctionExpression(createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true)]));
1709
+ } else context.onError(createCompilerError(32, vFor.loc));
1710
+ } else {
1711
+ if (staticSlotName) {
1712
+ if (seenSlotNames.has(staticSlotName)) {
1713
+ context.onError(createCompilerError(38, dirLoc));
1714
+ continue;
1715
+ }
1716
+ seenSlotNames.add(staticSlotName);
1717
+ if (staticSlotName === "default") hasNamedDefaultSlot = true;
1718
+ }
1719
+ slotsProperties.push(createObjectProperty(slotName, slotFunction));
1720
+ }
1721
+ }
1722
+ if (!onComponentSlot) {
1723
+ const buildDefaultSlotProperty = (props, children2) => {
1724
+ const fn = buildSlotFn(props, void 0, children2, loc);
1725
+ if (context.compatConfig) fn.isNonScopedSlot = true;
1726
+ return createObjectProperty(`default`, fn);
1727
+ };
1728
+ if (!hasTemplateSlots) slotsProperties.push(buildDefaultSlotProperty(void 0, children));
1729
+ else if (implicitDefaultChildren.length && implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) if (hasNamedDefaultSlot) context.onError(createCompilerError(39, implicitDefaultChildren[0].loc));
1730
+ else slotsProperties.push(buildDefaultSlotProperty(void 0, implicitDefaultChildren));
1731
+ }
1732
+ const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;
1733
+ let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`, createSimpleExpression(slotFlag + ``, false))), loc);
1734
+ if (dynamicSlots.length) slots = createCallExpression(context.helper(CREATE_SLOTS), [slots, createArrayExpression(dynamicSlots)]);
1735
+ return {
1736
+ slots,
1737
+ hasDynamicSlots
1738
+ };
1739
+ }
1740
+ function buildDynamicSlot(name, fn, index) {
1741
+ const props = [createObjectProperty(`name`, name), createObjectProperty(`fn`, fn)];
1742
+ if (index != null) props.push(createObjectProperty(`key`, createSimpleExpression(String(index), true)));
1743
+ return createObjectExpression(props);
1744
+ }
1745
+ function hasForwardedSlots(children) {
1746
+ for (let i = 0; i < children.length; i++) {
1747
+ const child = children[i];
1748
+ switch (child.type) {
1749
+ case 1:
1750
+ if (child.tagType === 2 || hasForwardedSlots(child.children)) return true;
1751
+ break;
1752
+ case 9:
1753
+ if (hasForwardedSlots(child.branches)) return true;
1754
+ break;
1755
+ case 10:
1756
+ case 11:
1757
+ if (hasForwardedSlots(child.children)) return true;
1758
+ break;
1759
+ }
1760
+ }
1761
+ return false;
1762
+ }
1763
+ function isNonWhitespaceContent(node) {
1764
+ if (node.type !== 2 && node.type !== 12) return true;
1765
+ return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
1766
+ }
1767
+ function resolveComponentType(node, context, ssr = false) {
1768
+ let { tag } = node;
1769
+ const isExplicitDynamic = isComponentTag(tag);
1770
+ const isProp = findProp(node, "is", false, true);
1771
+ if (isProp) {
1772
+ if (isExplicitDynamic || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context)) {
1773
+ let exp;
1774
+ if (isProp.type === 6) exp = isProp.value && createSimpleExpression(isProp.value.content, true);
1775
+ else {
1776
+ exp = isProp.exp;
1777
+ if (!exp) exp = createSimpleExpression(`is`, false, isProp.arg.loc);
1778
+ }
1779
+ if (exp) return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [exp]);
1780
+ } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) tag = isProp.value.content.slice(4);
1781
+ }
1782
+ const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
1783
+ if (builtIn) {
1784
+ if (!ssr) context.helper(builtIn);
1785
+ return builtIn;
1786
+ }
1787
+ context.helper(RESOLVE_COMPONENT);
1788
+ context.components.add(tag);
1789
+ return toValidAssetId(tag, `component`);
1790
+ }
1791
+ function buildProps(node, context, props = node.props, isComponent$1, isDynamicComponent, ssr = false) {
1792
+ const { tag, loc: elementLoc, children } = node;
1793
+ let properties = [];
1794
+ const mergeArgs = [];
1795
+ const runtimeDirectives = [];
1796
+ const hasChildren = children.length > 0;
1797
+ let shouldUseBlock = false;
1798
+ let patchFlag = 0;
1799
+ let hasRef = false;
1800
+ let hasClassBinding = false;
1801
+ let hasStyleBinding = false;
1802
+ let hasHydrationEventBinding = false;
1803
+ let hasDynamicKeys = false;
1804
+ let hasVnodeHook = false;
1805
+ const dynamicPropNames = [];
1806
+ const pushMergeArg = (arg) => {
1807
+ if (properties.length) {
1808
+ mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
1809
+ properties = [];
1810
+ }
1811
+ if (arg) mergeArgs.push(arg);
1812
+ };
1813
+ const pushRefVForMarker = () => {
1814
+ if (context.scopes.vFor > 0) properties.push(createObjectProperty(createSimpleExpression("ref_for", true), createSimpleExpression("true")));
1815
+ };
1816
+ const analyzePatchFlag = ({ key, value }) => {
1817
+ if (isStaticExp(key)) {
1818
+ const name = key.content;
1819
+ const isEventHandler = isOn(name);
1820
+ if (isEventHandler && (!isComponent$1 || isDynamicComponent) && name.toLowerCase() !== "onclick" && name !== "onUpdate:modelValue" && !isReservedProp(name)) hasHydrationEventBinding = true;
1821
+ if (isEventHandler && isReservedProp(name)) hasVnodeHook = true;
1822
+ if (isEventHandler && value.type === 14) value = value.arguments[0];
1823
+ if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) return;
1824
+ if (name === "ref") hasRef = true;
1825
+ else if (name === "class") hasClassBinding = true;
1826
+ else if (name === "style") hasStyleBinding = true;
1827
+ else if (name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
1828
+ if (isComponent$1 && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
1829
+ } else hasDynamicKeys = true;
1830
+ };
1831
+ for (let i = 0; i < props.length; i++) {
1832
+ const prop = props[i];
1833
+ if (prop.type === 6) {
1834
+ const { loc, name, nameLoc, value } = prop;
1835
+ let isStatic = true;
1836
+ if (name === "ref") {
1837
+ hasRef = true;
1838
+ pushRefVForMarker();
1839
+ }
1840
+ if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context))) continue;
1841
+ properties.push(createObjectProperty(createSimpleExpression(name, true, nameLoc), createSimpleExpression(value ? value.content : "", isStatic, value ? value.loc : loc)));
1842
+ } else {
1843
+ const { name, arg, exp, loc, modifiers } = prop;
1844
+ const isVBind = name === "bind";
1845
+ const isVOn = name === "on";
1846
+ if (name === "slot") {
1847
+ if (!isComponent$1) context.onError(createCompilerError(40, loc));
1848
+ continue;
1849
+ }
1850
+ if (name === "once" || name === "memo") continue;
1851
+ if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context))) continue;
1852
+ if (isVOn && ssr) continue;
1853
+ if (isVBind && isStaticArgOf(arg, "key") || isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")) shouldUseBlock = true;
1854
+ if (isVBind && isStaticArgOf(arg, "ref")) pushRefVForMarker();
1855
+ if (!arg && (isVBind || isVOn)) {
1856
+ hasDynamicKeys = true;
1857
+ if (exp) if (isVBind) {
1858
+ pushRefVForMarker();
1859
+ pushMergeArg();
1860
+ if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context)) {
1861
+ mergeArgs.unshift(exp);
1862
+ continue;
1863
+ }
1864
+ mergeArgs.push(exp);
1865
+ } else pushMergeArg({
1866
+ type: 14,
1867
+ loc,
1868
+ callee: context.helper(TO_HANDLERS),
1869
+ arguments: isComponent$1 ? [exp] : [exp, `true`]
1870
+ });
1871
+ else context.onError(createCompilerError(isVBind ? 34 : 35, loc));
1872
+ continue;
1873
+ }
1874
+ if (isVBind && modifiers.some((mod) => mod.content === "prop")) patchFlag |= 32;
1875
+ const directiveTransform = context.directiveTransforms[name];
1876
+ if (directiveTransform) {
1877
+ const { props: props2, needRuntime } = directiveTransform(prop, node, context);
1878
+ !ssr && props2.forEach(analyzePatchFlag);
1879
+ if (isVOn && arg && !isStaticExp(arg)) pushMergeArg(createObjectExpression(props2, elementLoc));
1880
+ else properties.push(...props2);
1881
+ if (needRuntime) {
1882
+ runtimeDirectives.push(prop);
1883
+ if (isSymbol(needRuntime)) directiveImportMap.set(prop, needRuntime);
1884
+ }
1885
+ } else if (!isBuiltInDirective(name)) {
1886
+ runtimeDirectives.push(prop);
1887
+ if (hasChildren) shouldUseBlock = true;
1888
+ }
1889
+ }
1890
+ }
1891
+ let propsExpression = void 0;
1892
+ if (mergeArgs.length) {
1893
+ pushMergeArg();
1894
+ if (mergeArgs.length > 1) propsExpression = createCallExpression(context.helper(MERGE_PROPS), mergeArgs, elementLoc);
1895
+ else propsExpression = mergeArgs[0];
1896
+ } else if (properties.length) propsExpression = createObjectExpression(dedupeProperties(properties), elementLoc);
1897
+ if (hasDynamicKeys) patchFlag |= 16;
1898
+ else {
1899
+ if (hasClassBinding && !isComponent$1) patchFlag |= 2;
1900
+ if (hasStyleBinding && !isComponent$1) patchFlag |= 4;
1901
+ if (dynamicPropNames.length) patchFlag |= 8;
1902
+ if (hasHydrationEventBinding) patchFlag |= 32;
1903
+ }
1904
+ if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) patchFlag |= 512;
1905
+ if (!context.inSSR && propsExpression) switch (propsExpression.type) {
1906
+ case 15:
1907
+ let classKeyIndex = -1;
1908
+ let styleKeyIndex = -1;
1909
+ let hasDynamicKey = false;
1910
+ for (let i = 0; i < propsExpression.properties.length; i++) {
1911
+ const key = propsExpression.properties[i].key;
1912
+ if (isStaticExp(key)) {
1913
+ if (key.content === "class") classKeyIndex = i;
1914
+ else if (key.content === "style") styleKeyIndex = i;
1915
+ } else if (!key.isHandlerKey) hasDynamicKey = true;
1916
+ }
1917
+ const classProp = propsExpression.properties[classKeyIndex];
1918
+ const styleProp = propsExpression.properties[styleKeyIndex];
1919
+ if (!hasDynamicKey) {
1920
+ if (classProp && !isStaticExp(classProp.value)) classProp.value = createCallExpression(context.helper(NORMALIZE_CLASS), [classProp.value]);
1921
+ if (styleProp && (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || styleProp.value.type === 17)) styleProp.value = createCallExpression(context.helper(NORMALIZE_STYLE), [styleProp.value]);
1922
+ } else propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);
1923
+ break;
1924
+ case 14: break;
1925
+ default:
1926
+ propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [propsExpression])]);
1927
+ break;
1928
+ }
1929
+ return {
1930
+ props: propsExpression,
1931
+ directives: runtimeDirectives,
1932
+ patchFlag,
1933
+ dynamicPropNames,
1934
+ shouldUseBlock
1935
+ };
1936
+ }
1937
+ function dedupeProperties(properties) {
1938
+ const knownProps = /* @__PURE__ */ new Map();
1939
+ const deduped = [];
1940
+ for (let i = 0; i < properties.length; i++) {
1941
+ const prop = properties[i];
1942
+ if (prop.key.type === 8 || !prop.key.isStatic) {
1943
+ deduped.push(prop);
1944
+ continue;
1945
+ }
1946
+ const name = prop.key.content;
1947
+ const existing = knownProps.get(name);
1948
+ if (existing) {
1949
+ if (name === "style" || name === "class" || isOn(name)) mergeAsArray(existing, prop);
1950
+ } else {
1951
+ knownProps.set(name, prop);
1952
+ deduped.push(prop);
1953
+ }
1954
+ }
1955
+ return deduped;
1956
+ }
1957
+ function mergeAsArray(existing, incoming) {
1958
+ if (existing.value.type === 17) existing.value.elements.push(incoming.value);
1959
+ else existing.value = createArrayExpression([existing.value, incoming.value], existing.loc);
1960
+ }
1961
+ function buildDirectiveArgs(dir, context) {
1962
+ const dirArgs = [];
1963
+ const runtime = directiveImportMap.get(dir);
1964
+ if (runtime) dirArgs.push(context.helperString(runtime));
1965
+ else {
1966
+ context.helper(RESOLVE_DIRECTIVE);
1967
+ context.directives.add(dir.name);
1968
+ dirArgs.push(toValidAssetId(dir.name, `directive`));
1969
+ }
1970
+ const { loc } = dir;
1971
+ if (dir.exp) dirArgs.push(dir.exp);
1972
+ if (dir.arg) {
1973
+ if (!dir.exp) dirArgs.push(`void 0`);
1974
+ dirArgs.push(dir.arg);
1975
+ }
1976
+ if (Object.keys(dir.modifiers).length) {
1977
+ if (!dir.arg) {
1978
+ if (!dir.exp) dirArgs.push(`void 0`);
1979
+ dirArgs.push(`void 0`);
1980
+ }
1981
+ const trueExpression = createSimpleExpression(`true`, false, loc);
1982
+ dirArgs.push(createObjectExpression(dir.modifiers.map((modifier) => createObjectProperty(modifier, trueExpression)), loc));
1983
+ }
1984
+ return createArrayExpression(dirArgs, dir.loc);
1985
+ }
1986
+ function stringifyDynamicPropNames(props) {
1987
+ let propsNamesString = `[`;
1988
+ for (let i = 0, l = props.length; i < l; i++) {
1989
+ propsNamesString += JSON.stringify(props[i]);
1990
+ if (i < l - 1) propsNamesString += ", ";
1991
+ }
1992
+ return propsNamesString + `]`;
1993
+ }
1994
+ function isComponentTag(tag) {
1995
+ return tag === "component" || tag === "Component";
1996
+ }
1997
+ function processSlotOutlet(node, context) {
1998
+ let slotName = `"default"`;
1999
+ let slotProps = void 0;
2000
+ const nonNameProps = [];
2001
+ for (let i = 0; i < node.props.length; i++) {
2002
+ const p = node.props[i];
2003
+ if (p.type === 6) {
2004
+ if (p.value) if (p.name === "name") slotName = JSON.stringify(p.value.content);
2005
+ else {
2006
+ p.name = camelize(p.name);
2007
+ nonNameProps.push(p);
2008
+ }
2009
+ } else if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
2010
+ if (p.exp) slotName = p.exp;
2011
+ else if (p.arg && p.arg.type === 4) slotName = p.exp = createSimpleExpression(camelize(p.arg.content), false, p.arg.loc);
2012
+ } else {
2013
+ if (p.name === "bind" && p.arg && isStaticExp(p.arg)) p.arg.content = camelize(p.arg.content);
2014
+ nonNameProps.push(p);
2015
+ }
2016
+ }
2017
+ if (nonNameProps.length > 0) {
2018
+ const { props, directives } = buildProps(node, context, nonNameProps, false, false);
2019
+ slotProps = props;
2020
+ if (directives.length) context.onError(createCompilerError(36, directives[0].loc));
2021
+ }
2022
+ return {
2023
+ slotName,
2024
+ slotProps
2025
+ };
2026
+ }
2027
+ function createTransformProps(props = []) {
2028
+ return { props };
2029
+ }
2030
+ function rewriteFilter(node, context) {
2031
+ if (node.type === 4) parseFilter(node, context);
2032
+ else for (let i = 0; i < node.children.length; i++) {
2033
+ const child = node.children[i];
2034
+ if (typeof child !== "object") continue;
2035
+ if (child.type === 4) parseFilter(child, context);
2036
+ else if (child.type === 8) rewriteFilter(node, context);
2037
+ else if (child.type === 5) rewriteFilter(child.content, context);
2038
+ }
2039
+ }
2040
+ function parseFilter(node, context) {
2041
+ const exp = node.content;
2042
+ let inSingle = false;
2043
+ let inDouble = false;
2044
+ let inTemplateString = false;
2045
+ let inRegex = false;
2046
+ let curly = 0;
2047
+ let square = 0;
2048
+ let paren = 0;
2049
+ let lastFilterIndex = 0;
2050
+ let c, prev, i, expression, filters = [];
2051
+ for (i = 0; i < exp.length; i++) {
2052
+ prev = c;
2053
+ c = exp.charCodeAt(i);
2054
+ if (inSingle) {
2055
+ if (c === 39 && prev !== 92) inSingle = false;
2056
+ } else if (inDouble) {
2057
+ if (c === 34 && prev !== 92) inDouble = false;
2058
+ } else if (inTemplateString) {
2059
+ if (c === 96 && prev !== 92) inTemplateString = false;
2060
+ } else if (inRegex) {
2061
+ if (c === 47 && prev !== 92) inRegex = false;
2062
+ } else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) if (expression === void 0) {
2063
+ lastFilterIndex = i + 1;
2064
+ expression = exp.slice(0, i).trim();
2065
+ } else pushFilter();
2066
+ else {
2067
+ switch (c) {
2068
+ case 34:
2069
+ inDouble = true;
2070
+ break;
2071
+ case 39:
2072
+ inSingle = true;
2073
+ break;
2074
+ case 96:
2075
+ inTemplateString = true;
2076
+ break;
2077
+ case 40:
2078
+ paren++;
2079
+ break;
2080
+ case 41:
2081
+ paren--;
2082
+ break;
2083
+ case 91:
2084
+ square++;
2085
+ break;
2086
+ case 93:
2087
+ square--;
2088
+ break;
2089
+ case 123:
2090
+ curly++;
2091
+ break;
2092
+ case 125:
2093
+ curly--;
2094
+ break;
2095
+ }
2096
+ if (c === 47) {
2097
+ let j = i - 1;
2098
+ let p;
2099
+ for (; j >= 0; j--) {
2100
+ p = exp.charAt(j);
2101
+ if (p !== " ") break;
2102
+ }
2103
+ if (!p || !validDivisionCharRE.test(p)) inRegex = true;
2104
+ }
2105
+ }
2106
+ }
2107
+ if (expression === void 0) expression = exp.slice(0, i).trim();
2108
+ else if (lastFilterIndex !== 0) pushFilter();
2109
+ function pushFilter() {
2110
+ filters.push(exp.slice(lastFilterIndex, i).trim());
2111
+ lastFilterIndex = i + 1;
2112
+ }
2113
+ if (filters.length) {
2114
+ for (i = 0; i < filters.length; i++) expression = wrapFilter(expression, filters[i], context);
2115
+ node.content = expression;
2116
+ node.ast = void 0;
2117
+ }
2118
+ }
2119
+ function wrapFilter(exp, filter, context) {
2120
+ context.helper(RESOLVE_FILTER);
2121
+ const i = filter.indexOf("(");
2122
+ if (i < 0) {
2123
+ context.filters.add(filter);
2124
+ return `${toValidAssetId(filter, "filter")}(${exp})`;
2125
+ } else {
2126
+ const name = filter.slice(0, i);
2127
+ const args = filter.slice(i + 1);
2128
+ context.filters.add(name);
2129
+ return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`;
2130
+ }
2131
+ }
2132
+ function getBaseTransformPreset(prefixIdentifiers) {
2133
+ return [[
2134
+ transformOnce,
2135
+ transformIf,
2136
+ transformMemo,
2137
+ transformFor,
2138
+ ...[transformFilter],
2139
+ ...[],
2140
+ transformSlotOutlet,
2141
+ transformElement,
2142
+ trackSlotScopes,
2143
+ transformText
2144
+ ], {
2145
+ on: transformOn,
2146
+ bind: transformBind,
2147
+ model: transformModel
2148
+ }];
2149
+ }
2150
+ function baseCompile(source, options = {}) {
2151
+ const onError = options.onError || defaultOnError;
2152
+ const isModuleMode = options.mode === "module";
2153
+ if (options.prefixIdentifiers === true) onError(createCompilerError(47));
2154
+ else if (isModuleMode) onError(createCompilerError(48));
2155
+ const prefixIdentifiers = false;
2156
+ if (options.cacheHandlers) onError(createCompilerError(49));
2157
+ if (options.scopeId && !isModuleMode) onError(createCompilerError(50));
2158
+ const resolvedOptions = extend({}, options, { prefixIdentifiers });
2159
+ const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
2160
+ const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
2161
+ transform(ast, extend({}, resolvedOptions, {
2162
+ nodeTransforms: [...nodeTransforms, ...options.nodeTransforms || []],
2163
+ directiveTransforms: extend({}, directiveTransforms, options.directiveTransforms || {})
2164
+ }));
2165
+ return generate(ast, resolvedOptions);
2166
+ }
2167
+ var FRAGMENT, TELEPORT, SUSPENSE, KEEP_ALIVE, BASE_TRANSITION, OPEN_BLOCK, CREATE_BLOCK, CREATE_ELEMENT_BLOCK, CREATE_VNODE, CREATE_ELEMENT_VNODE, CREATE_COMMENT, CREATE_TEXT, CREATE_STATIC, RESOLVE_COMPONENT, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_FILTER, WITH_DIRECTIVES, RENDER_LIST, RENDER_SLOT, CREATE_SLOTS, TO_DISPLAY_STRING, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_STYLE, NORMALIZE_PROPS, GUARD_REACTIVE_PROPS, TO_HANDLERS, CAMELIZE, CAPITALIZE, TO_HANDLER_KEY, SET_BLOCK_TRACKING, PUSH_SCOPE_ID, POP_SCOPE_ID, WITH_CTX, UNREF, IS_REF, WITH_MEMO, IS_MEMO_SAME, helperNameMap, Namespaces, NodeTypes, ElementTypes, ConstantTypes, locStub, defaultDelimitersOpen, defaultDelimitersClose, Sequences, Tokenizer, CompilerDeprecationTypes, deprecationData, ErrorCodes, errorMessages, isFunctionType, isStaticProperty, isStaticPropertyKey, TS_NODE_TYPES, isStaticExp, nonIdentifierRE, isSimpleIdentifier, validFirstIdentCharRE, validIdentCharRE, whitespaceRE, getExpSource, isMemberExpressionBrowser, isMemberExpressionNode, isMemberExpression, fnExpRE, isFnExpressionBrowser, isFnExpressionNode, isFnExpression, propsHelperSet, forAliasRE, defaultParserOptions, currentOptions, currentRoot, currentInput, currentOpenTag, currentProp, currentAttrValue, currentAttrStartIndex, currentAttrEndIndex, inPre, inVPre, currentVPreBoundary, stack, tokenizer, forIteratorRE, stripParensRE, specialTemplateDir, windowsNewlineRE, allowHoistedHelperSet, PURE_ANNOTATION, aliasHelper, transformExpression, transformIf, transformBind, transformBindShorthand, injectPrefix, transformFor, defaultFallback, trackSlotScopes, trackVForSlotScopes, buildClientSlotFn, directiveImportMap, transformElement, transformSlotOutlet, transformOn, transformText, seen$1, transformOnce, transformModel, validDivisionCharRE, transformFilter, seen, transformMemo, BindingTypes, noopDirectiveTransform;
2168
+ var init_compiler_core_esm_bundler = __esmMin((() => {
2169
+ init_shared_esm_bundler();
2170
+ FRAGMENT = Symbol(``);
2171
+ TELEPORT = Symbol(``);
2172
+ SUSPENSE = Symbol(``);
2173
+ KEEP_ALIVE = Symbol(``);
2174
+ BASE_TRANSITION = Symbol(``);
2175
+ OPEN_BLOCK = Symbol(``);
2176
+ CREATE_BLOCK = Symbol(``);
2177
+ CREATE_ELEMENT_BLOCK = Symbol(``);
2178
+ CREATE_VNODE = Symbol(``);
2179
+ CREATE_ELEMENT_VNODE = Symbol(``);
2180
+ CREATE_COMMENT = Symbol(``);
2181
+ CREATE_TEXT = Symbol(``);
2182
+ CREATE_STATIC = Symbol(``);
2183
+ RESOLVE_COMPONENT = Symbol(``);
2184
+ RESOLVE_DYNAMIC_COMPONENT = Symbol(``);
2185
+ RESOLVE_DIRECTIVE = Symbol(``);
2186
+ RESOLVE_FILTER = Symbol(``);
2187
+ WITH_DIRECTIVES = Symbol(``);
2188
+ RENDER_LIST = Symbol(``);
2189
+ RENDER_SLOT = Symbol(``);
2190
+ CREATE_SLOTS = Symbol(``);
2191
+ TO_DISPLAY_STRING = Symbol(``);
2192
+ MERGE_PROPS = Symbol(``);
2193
+ NORMALIZE_CLASS = Symbol(``);
2194
+ NORMALIZE_STYLE = Symbol(``);
2195
+ NORMALIZE_PROPS = Symbol(``);
2196
+ GUARD_REACTIVE_PROPS = Symbol(``);
2197
+ TO_HANDLERS = Symbol(``);
2198
+ CAMELIZE = Symbol(``);
2199
+ CAPITALIZE = Symbol(``);
2200
+ TO_HANDLER_KEY = Symbol(``);
2201
+ SET_BLOCK_TRACKING = Symbol(``);
2202
+ PUSH_SCOPE_ID = Symbol(``);
2203
+ POP_SCOPE_ID = Symbol(``);
2204
+ WITH_CTX = Symbol(``);
2205
+ UNREF = Symbol(``);
2206
+ IS_REF = Symbol(``);
2207
+ WITH_MEMO = Symbol(``);
2208
+ IS_MEMO_SAME = Symbol(``);
2209
+ helperNameMap = {
2210
+ [FRAGMENT]: `Fragment`,
2211
+ [TELEPORT]: `Teleport`,
2212
+ [SUSPENSE]: `Suspense`,
2213
+ [KEEP_ALIVE]: `KeepAlive`,
2214
+ [BASE_TRANSITION]: `BaseTransition`,
2215
+ [OPEN_BLOCK]: `openBlock`,
2216
+ [CREATE_BLOCK]: `createBlock`,
2217
+ [CREATE_ELEMENT_BLOCK]: `createElementBlock`,
2218
+ [CREATE_VNODE]: `createVNode`,
2219
+ [CREATE_ELEMENT_VNODE]: `createElementVNode`,
2220
+ [CREATE_COMMENT]: `createCommentVNode`,
2221
+ [CREATE_TEXT]: `createTextVNode`,
2222
+ [CREATE_STATIC]: `createStaticVNode`,
2223
+ [RESOLVE_COMPONENT]: `resolveComponent`,
2224
+ [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
2225
+ [RESOLVE_DIRECTIVE]: `resolveDirective`,
2226
+ [RESOLVE_FILTER]: `resolveFilter`,
2227
+ [WITH_DIRECTIVES]: `withDirectives`,
2228
+ [RENDER_LIST]: `renderList`,
2229
+ [RENDER_SLOT]: `renderSlot`,
2230
+ [CREATE_SLOTS]: `createSlots`,
2231
+ [TO_DISPLAY_STRING]: `toDisplayString`,
2232
+ [MERGE_PROPS]: `mergeProps`,
2233
+ [NORMALIZE_CLASS]: `normalizeClass`,
2234
+ [NORMALIZE_STYLE]: `normalizeStyle`,
2235
+ [NORMALIZE_PROPS]: `normalizeProps`,
2236
+ [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
2237
+ [TO_HANDLERS]: `toHandlers`,
2238
+ [CAMELIZE]: `camelize`,
2239
+ [CAPITALIZE]: `capitalize`,
2240
+ [TO_HANDLER_KEY]: `toHandlerKey`,
2241
+ [SET_BLOCK_TRACKING]: `setBlockTracking`,
2242
+ [PUSH_SCOPE_ID]: `pushScopeId`,
2243
+ [POP_SCOPE_ID]: `popScopeId`,
2244
+ [WITH_CTX]: `withCtx`,
2245
+ [UNREF]: `unref`,
2246
+ [IS_REF]: `isRef`,
2247
+ [WITH_MEMO]: `withMemo`,
2248
+ [IS_MEMO_SAME]: `isMemoSame`
2249
+ };
2250
+ Namespaces = {
2251
+ "HTML": 0,
2252
+ "0": "HTML",
2253
+ "SVG": 1,
2254
+ "1": "SVG",
2255
+ "MATH_ML": 2,
2256
+ "2": "MATH_ML"
2257
+ };
2258
+ NodeTypes = {
2259
+ "ROOT": 0,
2260
+ "0": "ROOT",
2261
+ "ELEMENT": 1,
2262
+ "1": "ELEMENT",
2263
+ "TEXT": 2,
2264
+ "2": "TEXT",
2265
+ "COMMENT": 3,
2266
+ "3": "COMMENT",
2267
+ "SIMPLE_EXPRESSION": 4,
2268
+ "4": "SIMPLE_EXPRESSION",
2269
+ "INTERPOLATION": 5,
2270
+ "5": "INTERPOLATION",
2271
+ "ATTRIBUTE": 6,
2272
+ "6": "ATTRIBUTE",
2273
+ "DIRECTIVE": 7,
2274
+ "7": "DIRECTIVE",
2275
+ "COMPOUND_EXPRESSION": 8,
2276
+ "8": "COMPOUND_EXPRESSION",
2277
+ "IF": 9,
2278
+ "9": "IF",
2279
+ "IF_BRANCH": 10,
2280
+ "10": "IF_BRANCH",
2281
+ "FOR": 11,
2282
+ "11": "FOR",
2283
+ "TEXT_CALL": 12,
2284
+ "12": "TEXT_CALL",
2285
+ "VNODE_CALL": 13,
2286
+ "13": "VNODE_CALL",
2287
+ "JS_CALL_EXPRESSION": 14,
2288
+ "14": "JS_CALL_EXPRESSION",
2289
+ "JS_OBJECT_EXPRESSION": 15,
2290
+ "15": "JS_OBJECT_EXPRESSION",
2291
+ "JS_PROPERTY": 16,
2292
+ "16": "JS_PROPERTY",
2293
+ "JS_ARRAY_EXPRESSION": 17,
2294
+ "17": "JS_ARRAY_EXPRESSION",
2295
+ "JS_FUNCTION_EXPRESSION": 18,
2296
+ "18": "JS_FUNCTION_EXPRESSION",
2297
+ "JS_CONDITIONAL_EXPRESSION": 19,
2298
+ "19": "JS_CONDITIONAL_EXPRESSION",
2299
+ "JS_CACHE_EXPRESSION": 20,
2300
+ "20": "JS_CACHE_EXPRESSION",
2301
+ "JS_BLOCK_STATEMENT": 21,
2302
+ "21": "JS_BLOCK_STATEMENT",
2303
+ "JS_TEMPLATE_LITERAL": 22,
2304
+ "22": "JS_TEMPLATE_LITERAL",
2305
+ "JS_IF_STATEMENT": 23,
2306
+ "23": "JS_IF_STATEMENT",
2307
+ "JS_ASSIGNMENT_EXPRESSION": 24,
2308
+ "24": "JS_ASSIGNMENT_EXPRESSION",
2309
+ "JS_SEQUENCE_EXPRESSION": 25,
2310
+ "25": "JS_SEQUENCE_EXPRESSION",
2311
+ "JS_RETURN_STATEMENT": 26,
2312
+ "26": "JS_RETURN_STATEMENT"
2313
+ };
2314
+ ElementTypes = {
2315
+ "ELEMENT": 0,
2316
+ "0": "ELEMENT",
2317
+ "COMPONENT": 1,
2318
+ "1": "COMPONENT",
2319
+ "SLOT": 2,
2320
+ "2": "SLOT",
2321
+ "TEMPLATE": 3,
2322
+ "3": "TEMPLATE"
2323
+ };
2324
+ ConstantTypes = {
2325
+ "NOT_CONSTANT": 0,
2326
+ "0": "NOT_CONSTANT",
2327
+ "CAN_SKIP_PATCH": 1,
2328
+ "1": "CAN_SKIP_PATCH",
2329
+ "CAN_CACHE": 2,
2330
+ "2": "CAN_CACHE",
2331
+ "CAN_STRINGIFY": 3,
2332
+ "3": "CAN_STRINGIFY"
2333
+ };
2334
+ locStub = {
2335
+ start: {
2336
+ line: 1,
2337
+ column: 1,
2338
+ offset: 0
2339
+ },
2340
+ end: {
2341
+ line: 1,
2342
+ column: 1,
2343
+ offset: 0
2344
+ },
2345
+ source: ""
2346
+ };
2347
+ defaultDelimitersOpen = new Uint8Array([123, 123]);
2348
+ defaultDelimitersClose = new Uint8Array([125, 125]);
2349
+ Sequences = {
2350
+ Cdata: new Uint8Array([
2351
+ 67,
2352
+ 68,
2353
+ 65,
2354
+ 84,
2355
+ 65,
2356
+ 91
2357
+ ]),
2358
+ CdataEnd: new Uint8Array([
2359
+ 93,
2360
+ 93,
2361
+ 62
2362
+ ]),
2363
+ CommentEnd: new Uint8Array([
2364
+ 45,
2365
+ 45,
2366
+ 62
2367
+ ]),
2368
+ ScriptEnd: new Uint8Array([
2369
+ 60,
2370
+ 47,
2371
+ 115,
2372
+ 99,
2373
+ 114,
2374
+ 105,
2375
+ 112,
2376
+ 116
2377
+ ]),
2378
+ StyleEnd: new Uint8Array([
2379
+ 60,
2380
+ 47,
2381
+ 115,
2382
+ 116,
2383
+ 121,
2384
+ 108,
2385
+ 101
2386
+ ]),
2387
+ TitleEnd: new Uint8Array([
2388
+ 60,
2389
+ 47,
2390
+ 116,
2391
+ 105,
2392
+ 116,
2393
+ 108,
2394
+ 101
2395
+ ]),
2396
+ TextareaEnd: new Uint8Array([
2397
+ 60,
2398
+ 47,
2399
+ 116,
2400
+ 101,
2401
+ 120,
2402
+ 116,
2403
+ 97,
2404
+ 114,
2405
+ 101,
2406
+ 97
2407
+ ])
2408
+ };
2409
+ Tokenizer = class {
2410
+ constructor(stack$1, cbs) {
2411
+ this.stack = stack$1;
2412
+ this.cbs = cbs;
2413
+ this.state = 1;
2414
+ this.buffer = "";
2415
+ this.sectionStart = 0;
2416
+ this.index = 0;
2417
+ this.entityStart = 0;
2418
+ this.baseState = 1;
2419
+ this.inRCDATA = false;
2420
+ this.inXML = false;
2421
+ this.inVPre = false;
2422
+ this.newlines = [];
2423
+ this.mode = 0;
2424
+ this.delimiterOpen = defaultDelimitersOpen;
2425
+ this.delimiterClose = defaultDelimitersClose;
2426
+ this.delimiterIndex = -1;
2427
+ this.currentSequence = void 0;
2428
+ this.sequenceIndex = 0;
2429
+ }
2430
+ get inSFCRoot() {
2431
+ return this.mode === 2 && this.stack.length === 0;
2432
+ }
2433
+ reset() {
2434
+ this.state = 1;
2435
+ this.mode = 0;
2436
+ this.buffer = "";
2437
+ this.sectionStart = 0;
2438
+ this.index = 0;
2439
+ this.baseState = 1;
2440
+ this.inRCDATA = false;
2441
+ this.currentSequence = void 0;
2442
+ this.newlines.length = 0;
2443
+ this.delimiterOpen = defaultDelimitersOpen;
2444
+ this.delimiterClose = defaultDelimitersClose;
2445
+ }
2446
+ getPos(index) {
2447
+ let line = 1;
2448
+ let column = index + 1;
2449
+ for (let i = this.newlines.length - 1; i >= 0; i--) {
2450
+ const newlineIndex = this.newlines[i];
2451
+ if (index > newlineIndex) {
2452
+ line = i + 2;
2453
+ column = index - newlineIndex;
2454
+ break;
2455
+ }
2456
+ }
2457
+ return {
2458
+ column,
2459
+ line,
2460
+ offset: index
2461
+ };
2462
+ }
2463
+ peek() {
2464
+ return this.buffer.charCodeAt(this.index + 1);
2465
+ }
2466
+ stateText(c) {
2467
+ if (c === 60) {
2468
+ if (this.index > this.sectionStart) this.cbs.ontext(this.sectionStart, this.index);
2469
+ this.state = 5;
2470
+ this.sectionStart = this.index;
2471
+ } else if (!this.inVPre && c === this.delimiterOpen[0]) {
2472
+ this.state = 2;
2473
+ this.delimiterIndex = 0;
2474
+ this.stateInterpolationOpen(c);
2475
+ }
2476
+ }
2477
+ stateInterpolationOpen(c) {
2478
+ if (c === this.delimiterOpen[this.delimiterIndex]) if (this.delimiterIndex === this.delimiterOpen.length - 1) {
2479
+ const start = this.index + 1 - this.delimiterOpen.length;
2480
+ if (start > this.sectionStart) this.cbs.ontext(this.sectionStart, start);
2481
+ this.state = 3;
2482
+ this.sectionStart = start;
2483
+ } else this.delimiterIndex++;
2484
+ else if (this.inRCDATA) {
2485
+ this.state = 32;
2486
+ this.stateInRCDATA(c);
2487
+ } else {
2488
+ this.state = 1;
2489
+ this.stateText(c);
2490
+ }
2491
+ }
2492
+ stateInterpolation(c) {
2493
+ if (c === this.delimiterClose[0]) {
2494
+ this.state = 4;
2495
+ this.delimiterIndex = 0;
2496
+ this.stateInterpolationClose(c);
2497
+ }
2498
+ }
2499
+ stateInterpolationClose(c) {
2500
+ if (c === this.delimiterClose[this.delimiterIndex]) if (this.delimiterIndex === this.delimiterClose.length - 1) {
2501
+ this.cbs.oninterpolation(this.sectionStart, this.index + 1);
2502
+ if (this.inRCDATA) this.state = 32;
2503
+ else this.state = 1;
2504
+ this.sectionStart = this.index + 1;
2505
+ } else this.delimiterIndex++;
2506
+ else {
2507
+ this.state = 3;
2508
+ this.stateInterpolation(c);
2509
+ }
2510
+ }
2511
+ stateSpecialStartSequence(c) {
2512
+ const isEnd = this.sequenceIndex === this.currentSequence.length;
2513
+ if (!(isEnd ? isEndOfTagSection(c) : (c | 32) === this.currentSequence[this.sequenceIndex])) this.inRCDATA = false;
2514
+ else if (!isEnd) {
2515
+ this.sequenceIndex++;
2516
+ return;
2517
+ }
2518
+ this.sequenceIndex = 0;
2519
+ this.state = 6;
2520
+ this.stateInTagName(c);
2521
+ }
2522
+ stateInRCDATA(c) {
2523
+ if (this.sequenceIndex === this.currentSequence.length) {
2524
+ if (c === 62 || isWhitespace(c)) {
2525
+ const endOfText = this.index - this.currentSequence.length;
2526
+ if (this.sectionStart < endOfText) {
2527
+ const actualIndex = this.index;
2528
+ this.index = endOfText;
2529
+ this.cbs.ontext(this.sectionStart, endOfText);
2530
+ this.index = actualIndex;
2531
+ }
2532
+ this.sectionStart = endOfText + 2;
2533
+ this.stateInClosingTagName(c);
2534
+ this.inRCDATA = false;
2535
+ return;
2536
+ }
2537
+ this.sequenceIndex = 0;
2538
+ }
2539
+ if ((c | 32) === this.currentSequence[this.sequenceIndex]) this.sequenceIndex += 1;
2540
+ else if (this.sequenceIndex === 0) {
2541
+ if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
2542
+ if (!this.inVPre && c === this.delimiterOpen[0]) {
2543
+ this.state = 2;
2544
+ this.delimiterIndex = 0;
2545
+ this.stateInterpolationOpen(c);
2546
+ }
2547
+ } else if (this.fastForwardTo(60)) this.sequenceIndex = 1;
2548
+ } else this.sequenceIndex = Number(c === 60);
2549
+ }
2550
+ stateCDATASequence(c) {
2551
+ if (c === Sequences.Cdata[this.sequenceIndex]) {
2552
+ if (++this.sequenceIndex === Sequences.Cdata.length) {
2553
+ this.state = 28;
2554
+ this.currentSequence = Sequences.CdataEnd;
2555
+ this.sequenceIndex = 0;
2556
+ this.sectionStart = this.index + 1;
2557
+ }
2558
+ } else {
2559
+ this.sequenceIndex = 0;
2560
+ this.state = 23;
2561
+ this.stateInDeclaration(c);
2562
+ }
2563
+ }
2564
+ fastForwardTo(c) {
2565
+ while (++this.index < this.buffer.length) {
2566
+ const cc = this.buffer.charCodeAt(this.index);
2567
+ if (cc === 10) this.newlines.push(this.index);
2568
+ if (cc === c) return true;
2569
+ }
2570
+ this.index = this.buffer.length - 1;
2571
+ return false;
2572
+ }
2573
+ stateInCommentLike(c) {
2574
+ if (c === this.currentSequence[this.sequenceIndex]) {
2575
+ if (++this.sequenceIndex === this.currentSequence.length) {
2576
+ if (this.currentSequence === Sequences.CdataEnd) this.cbs.oncdata(this.sectionStart, this.index - 2);
2577
+ else this.cbs.oncomment(this.sectionStart, this.index - 2);
2578
+ this.sequenceIndex = 0;
2579
+ this.sectionStart = this.index + 1;
2580
+ this.state = 1;
2581
+ }
2582
+ } else if (this.sequenceIndex === 0) {
2583
+ if (this.fastForwardTo(this.currentSequence[0])) this.sequenceIndex = 1;
2584
+ } else if (c !== this.currentSequence[this.sequenceIndex - 1]) this.sequenceIndex = 0;
2585
+ }
2586
+ startSpecial(sequence, offset) {
2587
+ this.enterRCDATA(sequence, offset);
2588
+ this.state = 31;
2589
+ }
2590
+ enterRCDATA(sequence, offset) {
2591
+ this.inRCDATA = true;
2592
+ this.currentSequence = sequence;
2593
+ this.sequenceIndex = offset;
2594
+ }
2595
+ stateBeforeTagName(c) {
2596
+ if (c === 33) {
2597
+ this.state = 22;
2598
+ this.sectionStart = this.index + 1;
2599
+ } else if (c === 63) {
2600
+ this.state = 24;
2601
+ this.sectionStart = this.index + 1;
2602
+ } else if (isTagStartChar(c)) {
2603
+ this.sectionStart = this.index;
2604
+ if (this.mode === 0) this.state = 6;
2605
+ else if (this.inSFCRoot) this.state = 34;
2606
+ else if (!this.inXML) if (c === 116) this.state = 30;
2607
+ else this.state = c === 115 ? 29 : 6;
2608
+ else this.state = 6;
2609
+ } else if (c === 47) this.state = 8;
2610
+ else {
2611
+ this.state = 1;
2612
+ this.stateText(c);
2613
+ }
2614
+ }
2615
+ stateInTagName(c) {
2616
+ if (isEndOfTagSection(c)) this.handleTagName(c);
2617
+ }
2618
+ stateInSFCRootTagName(c) {
2619
+ if (isEndOfTagSection(c)) {
2620
+ const tag = this.buffer.slice(this.sectionStart, this.index);
2621
+ if (tag !== "template") this.enterRCDATA(toCharCodes(`</` + tag), 0);
2622
+ this.handleTagName(c);
2623
+ }
2624
+ }
2625
+ handleTagName(c) {
2626
+ this.cbs.onopentagname(this.sectionStart, this.index);
2627
+ this.sectionStart = -1;
2628
+ this.state = 11;
2629
+ this.stateBeforeAttrName(c);
2630
+ }
2631
+ stateBeforeClosingTagName(c) {
2632
+ if (isWhitespace(c));
2633
+ else if (c === 62) {
2634
+ this.state = 1;
2635
+ this.sectionStart = this.index + 1;
2636
+ } else {
2637
+ this.state = isTagStartChar(c) ? 9 : 27;
2638
+ this.sectionStart = this.index;
2639
+ }
2640
+ }
2641
+ stateInClosingTagName(c) {
2642
+ if (c === 62 || isWhitespace(c)) {
2643
+ this.cbs.onclosetag(this.sectionStart, this.index);
2644
+ this.sectionStart = -1;
2645
+ this.state = 10;
2646
+ this.stateAfterClosingTagName(c);
2647
+ }
2648
+ }
2649
+ stateAfterClosingTagName(c) {
2650
+ if (c === 62) {
2651
+ this.state = 1;
2652
+ this.sectionStart = this.index + 1;
2653
+ }
2654
+ }
2655
+ stateBeforeAttrName(c) {
2656
+ if (c === 62) {
2657
+ this.cbs.onopentagend(this.index);
2658
+ if (this.inRCDATA) this.state = 32;
2659
+ else this.state = 1;
2660
+ this.sectionStart = this.index + 1;
2661
+ } else if (c === 47) this.state = 7;
2662
+ else if (c === 60 && this.peek() === 47) {
2663
+ this.cbs.onopentagend(this.index);
2664
+ this.state = 5;
2665
+ this.sectionStart = this.index;
2666
+ } else if (!isWhitespace(c)) this.handleAttrStart(c);
2667
+ }
2668
+ handleAttrStart(c) {
2669
+ if (c === 118 && this.peek() === 45) {
2670
+ this.state = 13;
2671
+ this.sectionStart = this.index;
2672
+ } else if (c === 46 || c === 58 || c === 64 || c === 35) {
2673
+ this.cbs.ondirname(this.index, this.index + 1);
2674
+ this.state = 14;
2675
+ this.sectionStart = this.index + 1;
2676
+ } else {
2677
+ this.state = 12;
2678
+ this.sectionStart = this.index;
2679
+ }
2680
+ }
2681
+ stateInSelfClosingTag(c) {
2682
+ if (c === 62) {
2683
+ this.cbs.onselfclosingtag(this.index);
2684
+ this.state = 1;
2685
+ this.sectionStart = this.index + 1;
2686
+ this.inRCDATA = false;
2687
+ } else if (!isWhitespace(c)) {
2688
+ this.state = 11;
2689
+ this.stateBeforeAttrName(c);
2690
+ }
2691
+ }
2692
+ stateInAttrName(c) {
2693
+ if (c === 61 || isEndOfTagSection(c)) {
2694
+ this.cbs.onattribname(this.sectionStart, this.index);
2695
+ this.handleAttrNameEnd(c);
2696
+ }
2697
+ }
2698
+ stateInDirName(c) {
2699
+ if (c === 61 || isEndOfTagSection(c)) {
2700
+ this.cbs.ondirname(this.sectionStart, this.index);
2701
+ this.handleAttrNameEnd(c);
2702
+ } else if (c === 58) {
2703
+ this.cbs.ondirname(this.sectionStart, this.index);
2704
+ this.state = 14;
2705
+ this.sectionStart = this.index + 1;
2706
+ } else if (c === 46) {
2707
+ this.cbs.ondirname(this.sectionStart, this.index);
2708
+ this.state = 16;
2709
+ this.sectionStart = this.index + 1;
2710
+ }
2711
+ }
2712
+ stateInDirArg(c) {
2713
+ if (c === 61 || isEndOfTagSection(c)) {
2714
+ this.cbs.ondirarg(this.sectionStart, this.index);
2715
+ this.handleAttrNameEnd(c);
2716
+ } else if (c === 91) this.state = 15;
2717
+ else if (c === 46) {
2718
+ this.cbs.ondirarg(this.sectionStart, this.index);
2719
+ this.state = 16;
2720
+ this.sectionStart = this.index + 1;
2721
+ }
2722
+ }
2723
+ stateInDynamicDirArg(c) {
2724
+ if (c === 93) this.state = 14;
2725
+ else if (c === 61 || isEndOfTagSection(c)) {
2726
+ this.cbs.ondirarg(this.sectionStart, this.index + 1);
2727
+ this.handleAttrNameEnd(c);
2728
+ }
2729
+ }
2730
+ stateInDirModifier(c) {
2731
+ if (c === 61 || isEndOfTagSection(c)) {
2732
+ this.cbs.ondirmodifier(this.sectionStart, this.index);
2733
+ this.handleAttrNameEnd(c);
2734
+ } else if (c === 46) {
2735
+ this.cbs.ondirmodifier(this.sectionStart, this.index);
2736
+ this.sectionStart = this.index + 1;
2737
+ }
2738
+ }
2739
+ handleAttrNameEnd(c) {
2740
+ this.sectionStart = this.index;
2741
+ this.state = 17;
2742
+ this.cbs.onattribnameend(this.index);
2743
+ this.stateAfterAttrName(c);
2744
+ }
2745
+ stateAfterAttrName(c) {
2746
+ if (c === 61) this.state = 18;
2747
+ else if (c === 47 || c === 62) {
2748
+ this.cbs.onattribend(0, this.sectionStart);
2749
+ this.sectionStart = -1;
2750
+ this.state = 11;
2751
+ this.stateBeforeAttrName(c);
2752
+ } else if (!isWhitespace(c)) {
2753
+ this.cbs.onattribend(0, this.sectionStart);
2754
+ this.handleAttrStart(c);
2755
+ }
2756
+ }
2757
+ stateBeforeAttrValue(c) {
2758
+ if (c === 34) {
2759
+ this.state = 19;
2760
+ this.sectionStart = this.index + 1;
2761
+ } else if (c === 39) {
2762
+ this.state = 20;
2763
+ this.sectionStart = this.index + 1;
2764
+ } else if (!isWhitespace(c)) {
2765
+ this.sectionStart = this.index;
2766
+ this.state = 21;
2767
+ this.stateInAttrValueNoQuotes(c);
2768
+ }
2769
+ }
2770
+ handleInAttrValue(c, quote) {
2771
+ if (c === quote || this.fastForwardTo(quote)) {
2772
+ this.cbs.onattribdata(this.sectionStart, this.index);
2773
+ this.sectionStart = -1;
2774
+ this.cbs.onattribend(quote === 34 ? 3 : 2, this.index + 1);
2775
+ this.state = 11;
2776
+ }
2777
+ }
2778
+ stateInAttrValueDoubleQuotes(c) {
2779
+ this.handleInAttrValue(c, 34);
2780
+ }
2781
+ stateInAttrValueSingleQuotes(c) {
2782
+ this.handleInAttrValue(c, 39);
2783
+ }
2784
+ stateInAttrValueNoQuotes(c) {
2785
+ if (isWhitespace(c) || c === 62) {
2786
+ this.cbs.onattribdata(this.sectionStart, this.index);
2787
+ this.sectionStart = -1;
2788
+ this.cbs.onattribend(1, this.index);
2789
+ this.state = 11;
2790
+ this.stateBeforeAttrName(c);
2791
+ } else if (c === 39 || c === 60 || c === 61 || c === 96) this.cbs.onerr(18, this.index);
2792
+ }
2793
+ stateBeforeDeclaration(c) {
2794
+ if (c === 91) {
2795
+ this.state = 26;
2796
+ this.sequenceIndex = 0;
2797
+ } else this.state = c === 45 ? 25 : 23;
2798
+ }
2799
+ stateInDeclaration(c) {
2800
+ if (c === 62 || this.fastForwardTo(62)) {
2801
+ this.state = 1;
2802
+ this.sectionStart = this.index + 1;
2803
+ }
2804
+ }
2805
+ stateInProcessingInstruction(c) {
2806
+ if (c === 62 || this.fastForwardTo(62)) {
2807
+ this.cbs.onprocessinginstruction(this.sectionStart, this.index);
2808
+ this.state = 1;
2809
+ this.sectionStart = this.index + 1;
2810
+ }
2811
+ }
2812
+ stateBeforeComment(c) {
2813
+ if (c === 45) {
2814
+ this.state = 28;
2815
+ this.currentSequence = Sequences.CommentEnd;
2816
+ this.sequenceIndex = 2;
2817
+ this.sectionStart = this.index + 1;
2818
+ } else this.state = 23;
2819
+ }
2820
+ stateInSpecialComment(c) {
2821
+ if (c === 62 || this.fastForwardTo(62)) {
2822
+ this.cbs.oncomment(this.sectionStart, this.index);
2823
+ this.state = 1;
2824
+ this.sectionStart = this.index + 1;
2825
+ }
2826
+ }
2827
+ stateBeforeSpecialS(c) {
2828
+ if (c === Sequences.ScriptEnd[3]) this.startSpecial(Sequences.ScriptEnd, 4);
2829
+ else if (c === Sequences.StyleEnd[3]) this.startSpecial(Sequences.StyleEnd, 4);
2830
+ else {
2831
+ this.state = 6;
2832
+ this.stateInTagName(c);
2833
+ }
2834
+ }
2835
+ stateBeforeSpecialT(c) {
2836
+ if (c === Sequences.TitleEnd[3]) this.startSpecial(Sequences.TitleEnd, 4);
2837
+ else if (c === Sequences.TextareaEnd[3]) this.startSpecial(Sequences.TextareaEnd, 4);
2838
+ else {
2839
+ this.state = 6;
2840
+ this.stateInTagName(c);
2841
+ }
2842
+ }
2843
+ startEntity() {}
2844
+ stateInEntity() {}
2845
+ parse(input) {
2846
+ this.buffer = input;
2847
+ while (this.index < this.buffer.length) {
2848
+ const c = this.buffer.charCodeAt(this.index);
2849
+ if (c === 10) this.newlines.push(this.index);
2850
+ switch (this.state) {
2851
+ case 1:
2852
+ this.stateText(c);
2853
+ break;
2854
+ case 2:
2855
+ this.stateInterpolationOpen(c);
2856
+ break;
2857
+ case 3:
2858
+ this.stateInterpolation(c);
2859
+ break;
2860
+ case 4:
2861
+ this.stateInterpolationClose(c);
2862
+ break;
2863
+ case 31:
2864
+ this.stateSpecialStartSequence(c);
2865
+ break;
2866
+ case 32:
2867
+ this.stateInRCDATA(c);
2868
+ break;
2869
+ case 26:
2870
+ this.stateCDATASequence(c);
2871
+ break;
2872
+ case 19:
2873
+ this.stateInAttrValueDoubleQuotes(c);
2874
+ break;
2875
+ case 12:
2876
+ this.stateInAttrName(c);
2877
+ break;
2878
+ case 13:
2879
+ this.stateInDirName(c);
2880
+ break;
2881
+ case 14:
2882
+ this.stateInDirArg(c);
2883
+ break;
2884
+ case 15:
2885
+ this.stateInDynamicDirArg(c);
2886
+ break;
2887
+ case 16:
2888
+ this.stateInDirModifier(c);
2889
+ break;
2890
+ case 28:
2891
+ this.stateInCommentLike(c);
2892
+ break;
2893
+ case 27:
2894
+ this.stateInSpecialComment(c);
2895
+ break;
2896
+ case 11:
2897
+ this.stateBeforeAttrName(c);
2898
+ break;
2899
+ case 6:
2900
+ this.stateInTagName(c);
2901
+ break;
2902
+ case 34:
2903
+ this.stateInSFCRootTagName(c);
2904
+ break;
2905
+ case 9:
2906
+ this.stateInClosingTagName(c);
2907
+ break;
2908
+ case 5:
2909
+ this.stateBeforeTagName(c);
2910
+ break;
2911
+ case 17:
2912
+ this.stateAfterAttrName(c);
2913
+ break;
2914
+ case 20:
2915
+ this.stateInAttrValueSingleQuotes(c);
2916
+ break;
2917
+ case 18:
2918
+ this.stateBeforeAttrValue(c);
2919
+ break;
2920
+ case 8:
2921
+ this.stateBeforeClosingTagName(c);
2922
+ break;
2923
+ case 10:
2924
+ this.stateAfterClosingTagName(c);
2925
+ break;
2926
+ case 29:
2927
+ this.stateBeforeSpecialS(c);
2928
+ break;
2929
+ case 30:
2930
+ this.stateBeforeSpecialT(c);
2931
+ break;
2932
+ case 21:
2933
+ this.stateInAttrValueNoQuotes(c);
2934
+ break;
2935
+ case 7:
2936
+ this.stateInSelfClosingTag(c);
2937
+ break;
2938
+ case 23:
2939
+ this.stateInDeclaration(c);
2940
+ break;
2941
+ case 22:
2942
+ this.stateBeforeDeclaration(c);
2943
+ break;
2944
+ case 25:
2945
+ this.stateBeforeComment(c);
2946
+ break;
2947
+ case 24:
2948
+ this.stateInProcessingInstruction(c);
2949
+ break;
2950
+ case 33:
2951
+ this.stateInEntity();
2952
+ break;
2953
+ }
2954
+ this.index++;
2955
+ }
2956
+ this.cleanup();
2957
+ this.finish();
2958
+ }
2959
+ cleanup() {
2960
+ if (this.sectionStart !== this.index) {
2961
+ if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) {
2962
+ this.cbs.ontext(this.sectionStart, this.index);
2963
+ this.sectionStart = this.index;
2964
+ } else if (this.state === 19 || this.state === 20 || this.state === 21) {
2965
+ this.cbs.onattribdata(this.sectionStart, this.index);
2966
+ this.sectionStart = this.index;
2967
+ }
2968
+ }
2969
+ }
2970
+ finish() {
2971
+ this.handleTrailingData();
2972
+ this.cbs.onend();
2973
+ }
2974
+ handleTrailingData() {
2975
+ const endIndex = this.buffer.length;
2976
+ if (this.sectionStart >= endIndex) return;
2977
+ if (this.state === 28) if (this.currentSequence === Sequences.CdataEnd) this.cbs.oncdata(this.sectionStart, endIndex);
2978
+ else this.cbs.oncomment(this.sectionStart, endIndex);
2979
+ 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);
2980
+ else this.cbs.ontext(this.sectionStart, endIndex);
2981
+ }
2982
+ emitCodePoint(cp, consumed) {}
2983
+ };
2984
+ CompilerDeprecationTypes = {
2985
+ "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT",
2986
+ "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC",
2987
+ "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER",
2988
+ "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE",
2989
+ "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE",
2990
+ "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE",
2991
+ "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE",
2992
+ "COMPILER_FILTERS": "COMPILER_FILTERS"
2993
+ };
2994
+ deprecationData = {
2995
+ ["COMPILER_IS_ON_ELEMENT"]: {
2996
+ 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:".`,
2997
+ link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html`
2998
+ },
2999
+ ["COMPILER_V_BIND_SYNC"]: {
3000
+ 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}\`.`,
3001
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
3002
+ },
3003
+ ["COMPILER_V_BIND_OBJECT_ORDER"]: {
3004
+ 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.`,
3005
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html`
3006
+ },
3007
+ ["COMPILER_V_ON_NATIVE"]: {
3008
+ message: `.native modifier for v-on has been removed as is no longer necessary.`,
3009
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html`
3010
+ },
3011
+ ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: {
3012
+ 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.`,
3013
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html`
3014
+ },
3015
+ ["COMPILER_NATIVE_TEMPLATE"]: { message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` },
3016
+ ["COMPILER_INLINE_TEMPLATE"]: {
3017
+ message: `"inline-template" has been removed in Vue 3.`,
3018
+ link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html`
3019
+ },
3020
+ ["COMPILER_FILTERS"]: {
3021
+ 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.`,
3022
+ link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
3023
+ }
3024
+ };
3025
+ ErrorCodes = {
3026
+ "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0,
3027
+ "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT",
3028
+ "CDATA_IN_HTML_CONTENT": 1,
3029
+ "1": "CDATA_IN_HTML_CONTENT",
3030
+ "DUPLICATE_ATTRIBUTE": 2,
3031
+ "2": "DUPLICATE_ATTRIBUTE",
3032
+ "END_TAG_WITH_ATTRIBUTES": 3,
3033
+ "3": "END_TAG_WITH_ATTRIBUTES",
3034
+ "END_TAG_WITH_TRAILING_SOLIDUS": 4,
3035
+ "4": "END_TAG_WITH_TRAILING_SOLIDUS",
3036
+ "EOF_BEFORE_TAG_NAME": 5,
3037
+ "5": "EOF_BEFORE_TAG_NAME",
3038
+ "EOF_IN_CDATA": 6,
3039
+ "6": "EOF_IN_CDATA",
3040
+ "EOF_IN_COMMENT": 7,
3041
+ "7": "EOF_IN_COMMENT",
3042
+ "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8,
3043
+ "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT",
3044
+ "EOF_IN_TAG": 9,
3045
+ "9": "EOF_IN_TAG",
3046
+ "INCORRECTLY_CLOSED_COMMENT": 10,
3047
+ "10": "INCORRECTLY_CLOSED_COMMENT",
3048
+ "INCORRECTLY_OPENED_COMMENT": 11,
3049
+ "11": "INCORRECTLY_OPENED_COMMENT",
3050
+ "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12,
3051
+ "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME",
3052
+ "MISSING_ATTRIBUTE_VALUE": 13,
3053
+ "13": "MISSING_ATTRIBUTE_VALUE",
3054
+ "MISSING_END_TAG_NAME": 14,
3055
+ "14": "MISSING_END_TAG_NAME",
3056
+ "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15,
3057
+ "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES",
3058
+ "NESTED_COMMENT": 16,
3059
+ "16": "NESTED_COMMENT",
3060
+ "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17,
3061
+ "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME",
3062
+ "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18,
3063
+ "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE",
3064
+ "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19,
3065
+ "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME",
3066
+ "UNEXPECTED_NULL_CHARACTER": 20,
3067
+ "20": "UNEXPECTED_NULL_CHARACTER",
3068
+ "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21,
3069
+ "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME",
3070
+ "UNEXPECTED_SOLIDUS_IN_TAG": 22,
3071
+ "22": "UNEXPECTED_SOLIDUS_IN_TAG",
3072
+ "X_INVALID_END_TAG": 23,
3073
+ "23": "X_INVALID_END_TAG",
3074
+ "X_MISSING_END_TAG": 24,
3075
+ "24": "X_MISSING_END_TAG",
3076
+ "X_MISSING_INTERPOLATION_END": 25,
3077
+ "25": "X_MISSING_INTERPOLATION_END",
3078
+ "X_MISSING_DIRECTIVE_NAME": 26,
3079
+ "26": "X_MISSING_DIRECTIVE_NAME",
3080
+ "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27,
3081
+ "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END",
3082
+ "X_V_IF_NO_EXPRESSION": 28,
3083
+ "28": "X_V_IF_NO_EXPRESSION",
3084
+ "X_V_IF_SAME_KEY": 29,
3085
+ "29": "X_V_IF_SAME_KEY",
3086
+ "X_V_ELSE_NO_ADJACENT_IF": 30,
3087
+ "30": "X_V_ELSE_NO_ADJACENT_IF",
3088
+ "X_V_FOR_NO_EXPRESSION": 31,
3089
+ "31": "X_V_FOR_NO_EXPRESSION",
3090
+ "X_V_FOR_MALFORMED_EXPRESSION": 32,
3091
+ "32": "X_V_FOR_MALFORMED_EXPRESSION",
3092
+ "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33,
3093
+ "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT",
3094
+ "X_V_BIND_NO_EXPRESSION": 34,
3095
+ "34": "X_V_BIND_NO_EXPRESSION",
3096
+ "X_V_ON_NO_EXPRESSION": 35,
3097
+ "35": "X_V_ON_NO_EXPRESSION",
3098
+ "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36,
3099
+ "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET",
3100
+ "X_V_SLOT_MIXED_SLOT_USAGE": 37,
3101
+ "37": "X_V_SLOT_MIXED_SLOT_USAGE",
3102
+ "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38,
3103
+ "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES",
3104
+ "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39,
3105
+ "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN",
3106
+ "X_V_SLOT_MISPLACED": 40,
3107
+ "40": "X_V_SLOT_MISPLACED",
3108
+ "X_V_MODEL_NO_EXPRESSION": 41,
3109
+ "41": "X_V_MODEL_NO_EXPRESSION",
3110
+ "X_V_MODEL_MALFORMED_EXPRESSION": 42,
3111
+ "42": "X_V_MODEL_MALFORMED_EXPRESSION",
3112
+ "X_V_MODEL_ON_SCOPE_VARIABLE": 43,
3113
+ "43": "X_V_MODEL_ON_SCOPE_VARIABLE",
3114
+ "X_V_MODEL_ON_PROPS": 44,
3115
+ "44": "X_V_MODEL_ON_PROPS",
3116
+ "X_INVALID_EXPRESSION": 45,
3117
+ "45": "X_INVALID_EXPRESSION",
3118
+ "X_KEEP_ALIVE_INVALID_CHILDREN": 46,
3119
+ "46": "X_KEEP_ALIVE_INVALID_CHILDREN",
3120
+ "X_PREFIX_ID_NOT_SUPPORTED": 47,
3121
+ "47": "X_PREFIX_ID_NOT_SUPPORTED",
3122
+ "X_MODULE_MODE_NOT_SUPPORTED": 48,
3123
+ "48": "X_MODULE_MODE_NOT_SUPPORTED",
3124
+ "X_CACHE_HANDLER_NOT_SUPPORTED": 49,
3125
+ "49": "X_CACHE_HANDLER_NOT_SUPPORTED",
3126
+ "X_SCOPE_ID_NOT_SUPPORTED": 50,
3127
+ "50": "X_SCOPE_ID_NOT_SUPPORTED",
3128
+ "X_VNODE_HOOKS": 51,
3129
+ "51": "X_VNODE_HOOKS",
3130
+ "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52,
3131
+ "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
3132
+ "__EXTEND_POINT__": 53,
3133
+ "53": "__EXTEND_POINT__"
3134
+ };
3135
+ errorMessages = {
3136
+ [0]: "Illegal comment.",
3137
+ [1]: "CDATA section is allowed only in XML context.",
3138
+ [2]: "Duplicate attribute.",
3139
+ [3]: "End tag cannot have attributes.",
3140
+ [4]: "Illegal '/' in tags.",
3141
+ [5]: "Unexpected EOF in tag.",
3142
+ [6]: "Unexpected EOF in CDATA section.",
3143
+ [7]: "Unexpected EOF in comment.",
3144
+ [8]: "Unexpected EOF in script.",
3145
+ [9]: "Unexpected EOF in tag.",
3146
+ [10]: "Incorrectly closed comment.",
3147
+ [11]: "Incorrectly opened comment.",
3148
+ [12]: "Illegal tag name. Use '&lt;' to print '<'.",
3149
+ [13]: "Attribute value was expected.",
3150
+ [14]: "End tag name was expected.",
3151
+ [15]: "Whitespace was expected.",
3152
+ [16]: "Unexpected '<!--' in comment.",
3153
+ [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
3154
+ [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
3155
+ [19]: "Attribute name cannot start with '='.",
3156
+ [21]: "'<?' is allowed only in XML context.",
3157
+ [20]: `Unexpected null character.`,
3158
+ [22]: "Illegal '/' in tags.",
3159
+ [23]: "Invalid end tag.",
3160
+ [24]: "Element is missing end tag.",
3161
+ [25]: "Interpolation end sign was not found.",
3162
+ [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
3163
+ [26]: "Legal directive name was expected.",
3164
+ [28]: `v-if/v-else-if is missing expression.`,
3165
+ [29]: `v-if/else branches must use unique keys.`,
3166
+ [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
3167
+ [31]: `v-for is missing expression.`,
3168
+ [32]: `v-for has invalid expression.`,
3169
+ [33]: `<template v-for> key should be placed on the <template> tag.`,
3170
+ [34]: `v-bind is missing expression.`,
3171
+ [52]: `v-bind with same-name shorthand only allows static argument.`,
3172
+ [35]: `v-on is missing expression.`,
3173
+ [36]: `Unexpected custom directive on <slot> outlet.`,
3174
+ [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.`,
3175
+ [38]: `Duplicate slot names found. `,
3176
+ [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
3177
+ [40]: `v-slot can only be used on components or <template> tags.`,
3178
+ [41]: `v-model is missing expression.`,
3179
+ [42]: `v-model value must be a valid JavaScript member expression.`,
3180
+ [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
3181
+ [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
3182
+ Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
3183
+ [45]: `Error parsing JavaScript expression: `,
3184
+ [46]: `<KeepAlive> expects exactly one child component.`,
3185
+ [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.`,
3186
+ [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
3187
+ [48]: `ES module mode is not supported in this build of compiler.`,
3188
+ [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
3189
+ [50]: `"scopeId" option is only supported in module mode.`,
3190
+ [53]: ``
3191
+ };
3192
+ isFunctionType = (node) => {
3193
+ return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
3194
+ };
3195
+ isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
3196
+ isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
3197
+ TS_NODE_TYPES = [
3198
+ "TSAsExpression",
3199
+ "TSTypeAssertion",
3200
+ "TSNonNullExpression",
3201
+ "TSInstantiationExpression",
3202
+ "TSSatisfiesExpression"
3203
+ ];
3204
+ isStaticExp = (p) => p.type === 4 && p.isStatic;
3205
+ nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
3206
+ isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
3207
+ validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
3208
+ validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
3209
+ whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
3210
+ getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
3211
+ isMemberExpressionBrowser = (exp) => {
3212
+ const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());
3213
+ let state = 0;
3214
+ let stateStack = [];
3215
+ let currentOpenBracketCount = 0;
3216
+ let currentOpenParensCount = 0;
3217
+ let currentStringType = null;
3218
+ for (let i = 0; i < path.length; i++) {
3219
+ const char = path.charAt(i);
3220
+ switch (state) {
3221
+ case 0:
3222
+ if (char === "[") {
3223
+ stateStack.push(state);
3224
+ state = 1;
3225
+ currentOpenBracketCount++;
3226
+ } else if (char === "(") {
3227
+ stateStack.push(state);
3228
+ state = 2;
3229
+ currentOpenParensCount++;
3230
+ } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) return false;
3231
+ break;
3232
+ case 1:
3233
+ if (char === `'` || char === `"` || char === "`") {
3234
+ stateStack.push(state);
3235
+ state = 3;
3236
+ currentStringType = char;
3237
+ } else if (char === `[`) currentOpenBracketCount++;
3238
+ else if (char === `]`) {
3239
+ if (!--currentOpenBracketCount) state = stateStack.pop();
3240
+ }
3241
+ break;
3242
+ case 2:
3243
+ if (char === `'` || char === `"` || char === "`") {
3244
+ stateStack.push(state);
3245
+ state = 3;
3246
+ currentStringType = char;
3247
+ } else if (char === `(`) currentOpenParensCount++;
3248
+ else if (char === `)`) {
3249
+ if (i === path.length - 1) return false;
3250
+ if (!--currentOpenParensCount) state = stateStack.pop();
3251
+ }
3252
+ break;
3253
+ case 3:
3254
+ if (char === currentStringType) {
3255
+ state = stateStack.pop();
3256
+ currentStringType = null;
3257
+ }
3258
+ break;
3259
+ }
3260
+ }
3261
+ return !currentOpenBracketCount && !currentOpenParensCount;
3262
+ };
3263
+ isMemberExpressionNode = NOOP;
3264
+ isMemberExpression = isMemberExpressionBrowser;
3265
+ fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
3266
+ isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
3267
+ isFnExpressionNode = NOOP;
3268
+ isFnExpression = isFnExpressionBrowser;
3269
+ propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
3270
+ forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
3271
+ defaultParserOptions = {
3272
+ parseMode: "base",
3273
+ ns: 0,
3274
+ delimiters: [`{{`, `}}`],
3275
+ getNamespace: () => 0,
3276
+ isVoidTag: NO,
3277
+ isPreTag: NO,
3278
+ isIgnoreNewlineTag: NO,
3279
+ isCustomElement: NO,
3280
+ onError: defaultOnError,
3281
+ onWarn: defaultOnWarn,
3282
+ comments: false,
3283
+ prefixIdentifiers: false
3284
+ };
3285
+ currentOptions = defaultParserOptions;
3286
+ currentRoot = null;
3287
+ currentInput = "";
3288
+ currentOpenTag = null;
3289
+ currentProp = null;
3290
+ currentAttrValue = "";
3291
+ currentAttrStartIndex = -1;
3292
+ currentAttrEndIndex = -1;
3293
+ inPre = 0;
3294
+ inVPre = false;
3295
+ currentVPreBoundary = null;
3296
+ stack = [];
3297
+ tokenizer = new Tokenizer(stack, {
3298
+ onerr: emitError,
3299
+ ontext(start, end) {
3300
+ onText(getSlice(start, end), start, end);
3301
+ },
3302
+ ontextentity(char, start, end) {
3303
+ onText(char, start, end);
3304
+ },
3305
+ oninterpolation(start, end) {
3306
+ if (inVPre) return onText(getSlice(start, end), start, end);
3307
+ let innerStart = start + tokenizer.delimiterOpen.length;
3308
+ let innerEnd = end - tokenizer.delimiterClose.length;
3309
+ while (isWhitespace(currentInput.charCodeAt(innerStart))) innerStart++;
3310
+ while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) innerEnd--;
3311
+ let exp = getSlice(innerStart, innerEnd);
3312
+ if (exp.includes("&")) exp = currentOptions.decodeEntities(exp, false);
3313
+ addNode({
3314
+ type: 5,
3315
+ content: createExp(exp, false, getLoc(innerStart, innerEnd)),
3316
+ loc: getLoc(start, end)
3317
+ });
3318
+ },
3319
+ onopentagname(start, end) {
3320
+ const name = getSlice(start, end);
3321
+ currentOpenTag = {
3322
+ type: 1,
3323
+ tag: name,
3324
+ ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns),
3325
+ tagType: 0,
3326
+ props: [],
3327
+ children: [],
3328
+ loc: getLoc(start - 1, end),
3329
+ codegenNode: void 0
3330
+ };
3331
+ },
3332
+ onopentagend(end) {
3333
+ endOpenTag(end);
3334
+ },
3335
+ onclosetag(start, end) {
3336
+ const name = getSlice(start, end);
3337
+ if (!currentOptions.isVoidTag(name)) {
3338
+ let found = false;
3339
+ for (let i = 0; i < stack.length; i++) if (stack[i].tag.toLowerCase() === name.toLowerCase()) {
3340
+ found = true;
3341
+ if (i > 0) emitError(24, stack[0].loc.start.offset);
3342
+ for (let j = 0; j <= i; j++) onCloseTag(stack.shift(), end, j < i);
3343
+ break;
3344
+ }
3345
+ if (!found) emitError(23, backTrack(start, 60));
3346
+ }
3347
+ },
3348
+ onselfclosingtag(end) {
3349
+ const name = currentOpenTag.tag;
3350
+ currentOpenTag.isSelfClosing = true;
3351
+ endOpenTag(end);
3352
+ if (stack[0] && stack[0].tag === name) onCloseTag(stack.shift(), end);
3353
+ },
3354
+ onattribname(start, end) {
3355
+ currentProp = {
3356
+ type: 6,
3357
+ name: getSlice(start, end),
3358
+ nameLoc: getLoc(start, end),
3359
+ value: void 0,
3360
+ loc: getLoc(start)
3361
+ };
3362
+ },
3363
+ ondirname(start, end) {
3364
+ const raw = getSlice(start, end);
3365
+ const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2);
3366
+ if (!inVPre && name === "") emitError(26, start);
3367
+ if (inVPre || name === "") currentProp = {
3368
+ type: 6,
3369
+ name: raw,
3370
+ nameLoc: getLoc(start, end),
3371
+ value: void 0,
3372
+ loc: getLoc(start)
3373
+ };
3374
+ else {
3375
+ currentProp = {
3376
+ type: 7,
3377
+ name,
3378
+ rawName: raw,
3379
+ exp: void 0,
3380
+ arg: void 0,
3381
+ modifiers: raw === "." ? [createSimpleExpression("prop")] : [],
3382
+ loc: getLoc(start)
3383
+ };
3384
+ if (name === "pre") {
3385
+ inVPre = tokenizer.inVPre = true;
3386
+ currentVPreBoundary = currentOpenTag;
3387
+ const props = currentOpenTag.props;
3388
+ for (let i = 0; i < props.length; i++) if (props[i].type === 7) props[i] = dirToAttr(props[i]);
3389
+ }
3390
+ }
3391
+ },
3392
+ ondirarg(start, end) {
3393
+ if (start === end) return;
3394
+ const arg = getSlice(start, end);
3395
+ if (inVPre) {
3396
+ currentProp.name += arg;
3397
+ setLocEnd(currentProp.nameLoc, end);
3398
+ } else {
3399
+ const isStatic = arg[0] !== `[`;
3400
+ currentProp.arg = createExp(isStatic ? arg : arg.slice(1, -1), isStatic, getLoc(start, end), isStatic ? 3 : 0);
3401
+ }
3402
+ },
3403
+ ondirmodifier(start, end) {
3404
+ const mod = getSlice(start, end);
3405
+ if (inVPre) {
3406
+ currentProp.name += "." + mod;
3407
+ setLocEnd(currentProp.nameLoc, end);
3408
+ } else if (currentProp.name === "slot") {
3409
+ const arg = currentProp.arg;
3410
+ if (arg) {
3411
+ arg.content += "." + mod;
3412
+ setLocEnd(arg.loc, end);
3413
+ }
3414
+ } else {
3415
+ const exp = createSimpleExpression(mod, true, getLoc(start, end));
3416
+ currentProp.modifiers.push(exp);
3417
+ }
3418
+ },
3419
+ onattribdata(start, end) {
3420
+ currentAttrValue += getSlice(start, end);
3421
+ if (currentAttrStartIndex < 0) currentAttrStartIndex = start;
3422
+ currentAttrEndIndex = end;
3423
+ },
3424
+ onattribentity(char, start, end) {
3425
+ currentAttrValue += char;
3426
+ if (currentAttrStartIndex < 0) currentAttrStartIndex = start;
3427
+ currentAttrEndIndex = end;
3428
+ },
3429
+ onattribnameend(end) {
3430
+ const start = currentProp.loc.start.offset;
3431
+ const name = getSlice(start, end);
3432
+ if (currentProp.type === 7) currentProp.rawName = name;
3433
+ if (currentOpenTag.props.some((p) => (p.type === 7 ? p.rawName : p.name) === name)) emitError(2, start);
3434
+ },
3435
+ onattribend(quote, end) {
3436
+ if (currentOpenTag && currentProp) {
3437
+ setLocEnd(currentProp.loc, end);
3438
+ if (quote !== 0) {
3439
+ if (currentAttrValue.includes("&")) currentAttrValue = currentOptions.decodeEntities(currentAttrValue, true);
3440
+ if (currentProp.type === 6) {
3441
+ if (currentProp.name === "class") currentAttrValue = condense(currentAttrValue).trim();
3442
+ if (quote === 1 && !currentAttrValue) emitError(13, end);
3443
+ currentProp.value = {
3444
+ type: 2,
3445
+ content: currentAttrValue,
3446
+ loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1)
3447
+ };
3448
+ if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
3449
+ } else {
3450
+ currentProp.exp = createExp(currentAttrValue, false, getLoc(currentAttrStartIndex, currentAttrEndIndex), 0, 0);
3451
+ if (currentProp.name === "for") currentProp.forParseResult = parseForExpression(currentProp.exp);
3452
+ let syncIndex = -1;
3453
+ if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex((mod) => mod.content === "sync")) > -1 && checkCompatEnabled("COMPILER_V_BIND_SYNC", currentOptions, currentProp.loc, currentProp.rawName)) {
3454
+ currentProp.name = "model";
3455
+ currentProp.modifiers.splice(syncIndex, 1);
3456
+ }
3457
+ }
3458
+ }
3459
+ if (currentProp.type !== 7 || currentProp.name !== "pre") currentOpenTag.props.push(currentProp);
3460
+ }
3461
+ currentAttrValue = "";
3462
+ currentAttrStartIndex = currentAttrEndIndex = -1;
3463
+ },
3464
+ oncomment(start, end) {
3465
+ if (currentOptions.comments) addNode({
3466
+ type: 3,
3467
+ content: getSlice(start, end),
3468
+ loc: getLoc(start - 4, end + 3)
3469
+ });
3470
+ },
3471
+ onend() {
3472
+ const end = currentInput.length;
3473
+ for (let index = 0; index < stack.length; index++) {
3474
+ onCloseTag(stack[index], end - 1);
3475
+ emitError(24, stack[index].loc.start.offset);
3476
+ }
3477
+ },
3478
+ oncdata(start, end) {
3479
+ if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
3480
+ else emitError(1, start - 9);
3481
+ },
3482
+ onprocessinginstruction(start) {
3483
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) emitError(21, start - 1);
3484
+ }
3485
+ });
3486
+ forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
3487
+ stripParensRE = /^\(|\)$/g;
3488
+ specialTemplateDir = /* @__PURE__ */ new Set([
3489
+ "if",
3490
+ "else",
3491
+ "else-if",
3492
+ "for",
3493
+ "slot"
3494
+ ]);
3495
+ windowsNewlineRE = /\r\n/g;
3496
+ allowHoistedHelperSet = /* @__PURE__ */ new Set([
3497
+ NORMALIZE_CLASS,
3498
+ NORMALIZE_STYLE,
3499
+ NORMALIZE_PROPS,
3500
+ GUARD_REACTIVE_PROPS
3501
+ ]);
3502
+ PURE_ANNOTATION = `/*@__PURE__*/`;
3503
+ aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
3504
+ "" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b");
3505
+ transformExpression = (node, context) => {
3506
+ if (node.type === 5) node.content = processExpression(node.content, context);
3507
+ else if (node.type === 1) {
3508
+ const memo = findDir(node, "memo");
3509
+ for (let i = 0; i < node.props.length; i++) {
3510
+ const dir = node.props[i];
3511
+ if (dir.type === 7 && dir.name !== "for") {
3512
+ const exp = dir.exp;
3513
+ const arg = dir.arg;
3514
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
3515
+ if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
3516
+ }
3517
+ }
3518
+ }
3519
+ };
3520
+ transformIf = createStructuralDirectiveTransform(/^(if|else|else-if)$/, (node, dir, context) => {
3521
+ return processIf(node, dir, context, (ifNode, branch, isRoot) => {
3522
+ const siblings = context.parent.children;
3523
+ let i = siblings.indexOf(ifNode);
3524
+ let key = 0;
3525
+ while (i-- >= 0) {
3526
+ const sibling = siblings[i];
3527
+ if (sibling && sibling.type === 9) key += sibling.branches.length;
3528
+ }
3529
+ return () => {
3530
+ if (isRoot) ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);
3531
+ else {
3532
+ const parentCondition = getParentCondition(ifNode.codegenNode);
3533
+ parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);
3534
+ }
3535
+ };
3536
+ });
3537
+ });
3538
+ transformBind = (dir, _node, context) => {
3539
+ const { modifiers, loc } = dir;
3540
+ const arg = dir.arg;
3541
+ let { exp } = dir;
3542
+ if (exp && exp.type === 4 && !exp.content.trim()) exp = void 0;
3543
+ if (!exp) {
3544
+ if (arg.type !== 4 || !arg.isStatic) {
3545
+ context.onError(createCompilerError(52, arg.loc));
3546
+ return { props: [createObjectProperty(arg, createSimpleExpression("", true, loc))] };
3547
+ }
3548
+ transformBindShorthand(dir);
3549
+ exp = dir.exp;
3550
+ }
3551
+ if (arg.type !== 4) {
3552
+ arg.children.unshift(`(`);
3553
+ arg.children.push(`) || ""`);
3554
+ } else if (!arg.isStatic) arg.content = `${arg.content} || ""`;
3555
+ if (modifiers.some((mod) => mod.content === "camel")) if (arg.type === 4) if (arg.isStatic) arg.content = camelize(arg.content);
3556
+ else arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
3557
+ else {
3558
+ arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
3559
+ arg.children.push(`)`);
3560
+ }
3561
+ if (!context.inSSR) {
3562
+ if (modifiers.some((mod) => mod.content === "prop")) injectPrefix(arg, ".");
3563
+ if (modifiers.some((mod) => mod.content === "attr")) injectPrefix(arg, "^");
3564
+ }
3565
+ return { props: [createObjectProperty(arg, exp)] };
3566
+ };
3567
+ transformBindShorthand = (dir, context) => {
3568
+ const arg = dir.arg;
3569
+ dir.exp = createSimpleExpression(camelize(arg.content), false, arg.loc);
3570
+ };
3571
+ injectPrefix = (arg, prefix) => {
3572
+ if (arg.type === 4) if (arg.isStatic) arg.content = prefix + arg.content;
3573
+ else arg.content = `\`${prefix}\${${arg.content}}\``;
3574
+ else {
3575
+ arg.children.unshift(`'${prefix}' + (`);
3576
+ arg.children.push(`)`);
3577
+ }
3578
+ };
3579
+ transformFor = createStructuralDirectiveTransform("for", (node, dir, context) => {
3580
+ const { helper, removeHelper } = context;
3581
+ return processFor(node, dir, context, (forNode) => {
3582
+ const renderExp = createCallExpression(helper(RENDER_LIST), [forNode.source]);
3583
+ const isTemplate = isTemplateNode(node);
3584
+ const memo = findDir(node, "memo");
3585
+ const keyProp = findProp(node, `key`, false, true);
3586
+ if (keyProp && keyProp.type === 7 && !keyProp.exp) transformBindShorthand(keyProp);
3587
+ let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
3588
+ const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
3589
+ const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
3590
+ const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
3591
+ forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
3592
+ return () => {
3593
+ let childBlock;
3594
+ const { children } = forNode;
3595
+ const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;
3596
+ const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
3597
+ if (slotOutlet) {
3598
+ childBlock = slotOutlet.codegenNode;
3599
+ if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
3600
+ } else if (needFragmentWrapper) childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : void 0, node.children, 64, void 0, void 0, true, void 0, false);
3601
+ else {
3602
+ childBlock = children[0].codegenNode;
3603
+ if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
3604
+ if (childBlock.isBlock !== !isStableFragment) if (childBlock.isBlock) {
3605
+ removeHelper(OPEN_BLOCK);
3606
+ removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
3607
+ } else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
3608
+ childBlock.isBlock = !isStableFragment;
3609
+ if (childBlock.isBlock) {
3610
+ helper(OPEN_BLOCK);
3611
+ helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
3612
+ } else helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
3613
+ }
3614
+ if (memo) {
3615
+ const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [createSimpleExpression(`_cached`)]));
3616
+ loop.body = createBlockStatement([
3617
+ createCompoundExpression([
3618
+ `const _memo = (`,
3619
+ memo.exp,
3620
+ `)`
3621
+ ]),
3622
+ createCompoundExpression([
3623
+ `if (_cached`,
3624
+ ...keyExp ? [` && _cached.key === `, keyExp] : [],
3625
+ ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
3626
+ ]),
3627
+ createCompoundExpression([`const _item = `, childBlock]),
3628
+ createSimpleExpression(`_item.memo = _memo`),
3629
+ createSimpleExpression(`return _item`)
3630
+ ]);
3631
+ renderExp.arguments.push(loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached.length)));
3632
+ context.cached.push(null);
3633
+ } else renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true));
3634
+ };
3635
+ });
3636
+ });
3637
+ defaultFallback = createSimpleExpression(`undefined`, false);
3638
+ trackSlotScopes = (node, context) => {
3639
+ if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {
3640
+ const vSlot = findDir(node, "slot");
3641
+ if (vSlot) {
3642
+ vSlot.exp;
3643
+ context.scopes.vSlot++;
3644
+ return () => {
3645
+ context.scopes.vSlot--;
3646
+ };
3647
+ }
3648
+ }
3649
+ };
3650
+ trackVForSlotScopes = (node, context) => {
3651
+ let vFor;
3652
+ if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) {
3653
+ const result = vFor.forParseResult;
3654
+ if (result) {
3655
+ finalizeForParseResult(result, context);
3656
+ const { value, key, index } = result;
3657
+ const { addIdentifiers, removeIdentifiers } = context;
3658
+ value && addIdentifiers(value);
3659
+ key && addIdentifiers(key);
3660
+ index && addIdentifiers(index);
3661
+ return () => {
3662
+ value && removeIdentifiers(value);
3663
+ key && removeIdentifiers(key);
3664
+ index && removeIdentifiers(index);
3665
+ };
3666
+ }
3667
+ }
3668
+ };
3669
+ buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(props, children, false, true, children.length ? children[0].loc : loc);
3670
+ directiveImportMap = /* @__PURE__ */ new WeakMap();
3671
+ transformElement = (node, context) => {
3672
+ return function postTransformElement() {
3673
+ node = context.currentNode;
3674
+ if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) return;
3675
+ const { tag, props } = node;
3676
+ const isComponent$1 = node.tagType === 1;
3677
+ let vnodeTag = isComponent$1 ? resolveComponentType(node, context) : `"${tag}"`;
3678
+ const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
3679
+ let vnodeProps;
3680
+ let vnodeChildren;
3681
+ let patchFlag = 0;
3682
+ let vnodeDynamicProps;
3683
+ let dynamicPropNames;
3684
+ let vnodeDirectives;
3685
+ let shouldUseBlock = isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent$1 && (tag === "svg" || tag === "foreignObject" || tag === "math");
3686
+ if (props.length > 0) {
3687
+ const propsBuildResult = buildProps(node, context, void 0, isComponent$1, isDynamicComponent);
3688
+ vnodeProps = propsBuildResult.props;
3689
+ patchFlag = propsBuildResult.patchFlag;
3690
+ dynamicPropNames = propsBuildResult.dynamicPropNames;
3691
+ const directives = propsBuildResult.directives;
3692
+ vnodeDirectives = directives && directives.length ? createArrayExpression(directives.map((dir) => buildDirectiveArgs(dir, context))) : void 0;
3693
+ if (propsBuildResult.shouldUseBlock) shouldUseBlock = true;
3694
+ }
3695
+ if (node.children.length > 0) {
3696
+ if (vnodeTag === KEEP_ALIVE) {
3697
+ shouldUseBlock = true;
3698
+ patchFlag |= 1024;
3699
+ }
3700
+ if (isComponent$1 && vnodeTag !== TELEPORT && vnodeTag !== KEEP_ALIVE) {
3701
+ const { slots, hasDynamicSlots } = buildSlots(node, context);
3702
+ vnodeChildren = slots;
3703
+ if (hasDynamicSlots) patchFlag |= 1024;
3704
+ } else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
3705
+ const child = node.children[0];
3706
+ const type = child.type;
3707
+ const hasDynamicTextChild = type === 5 || type === 8;
3708
+ if (hasDynamicTextChild && getConstantType(child, context) === 0) patchFlag |= 1;
3709
+ if (hasDynamicTextChild || type === 2) vnodeChildren = child;
3710
+ else vnodeChildren = node.children;
3711
+ } else vnodeChildren = node.children;
3712
+ }
3713
+ if (dynamicPropNames && dynamicPropNames.length) vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
3714
+ node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent$1, node.loc);
3715
+ };
3716
+ };
3717
+ transformSlotOutlet = (node, context) => {
3718
+ if (isSlotOutlet(node)) {
3719
+ const { children, loc } = node;
3720
+ const { slotName, slotProps } = processSlotOutlet(node, context);
3721
+ const slotArgs = [
3722
+ context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,
3723
+ slotName,
3724
+ "{}",
3725
+ "undefined",
3726
+ "true"
3727
+ ];
3728
+ let expectedLen = 2;
3729
+ if (slotProps) {
3730
+ slotArgs[2] = slotProps;
3731
+ expectedLen = 3;
3732
+ }
3733
+ if (children.length) {
3734
+ slotArgs[3] = createFunctionExpression([], children, false, false, loc);
3735
+ expectedLen = 4;
3736
+ }
3737
+ if (context.scopeId && !context.slotted) expectedLen = 5;
3738
+ slotArgs.splice(expectedLen);
3739
+ node.codegenNode = createCallExpression(context.helper(RENDER_SLOT), slotArgs, loc);
3740
+ }
3741
+ };
3742
+ transformOn = (dir, node, context, augmentor) => {
3743
+ const { loc, modifiers, arg } = dir;
3744
+ if (!dir.exp && !modifiers.length) context.onError(createCompilerError(35, loc));
3745
+ let eventName;
3746
+ if (arg.type === 4) if (arg.isStatic) {
3747
+ let rawName = arg.content;
3748
+ if (rawName.startsWith("vue:")) rawName = `vnode-${rawName.slice(4)}`;
3749
+ eventName = createSimpleExpression(node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? toHandlerKey(camelize(rawName)) : `on:${rawName}`, true, arg.loc);
3750
+ } else eventName = createCompoundExpression([
3751
+ `${context.helperString(TO_HANDLER_KEY)}(`,
3752
+ arg,
3753
+ `)`
3754
+ ]);
3755
+ else {
3756
+ eventName = arg;
3757
+ eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
3758
+ eventName.children.push(`)`);
3759
+ }
3760
+ let exp = dir.exp;
3761
+ if (exp && !exp.content.trim()) exp = void 0;
3762
+ let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
3763
+ if (exp) {
3764
+ const isMemberExp = isMemberExpression(exp);
3765
+ const isInlineStatement = !(isMemberExp || isFnExpression(exp));
3766
+ const hasMultipleStatements = exp.content.includes(`;`);
3767
+ if (isInlineStatement || shouldCache && isMemberExp) exp = createCompoundExpression([
3768
+ `${isInlineStatement ? `$event` : `(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,
3769
+ exp,
3770
+ hasMultipleStatements ? `}` : `)`
3771
+ ]);
3772
+ }
3773
+ let ret = { props: [createObjectProperty(eventName, exp || createSimpleExpression(`() => {}`, false, loc))] };
3774
+ if (augmentor) ret = augmentor(ret);
3775
+ if (shouldCache) ret.props[0].value = context.cache(ret.props[0].value);
3776
+ ret.props.forEach((p) => p.key.isHandlerKey = true);
3777
+ return ret;
3778
+ };
3779
+ transformText = (node, context) => {
3780
+ if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) return () => {
3781
+ const children = node.children;
3782
+ let currentContainer = void 0;
3783
+ let hasText = false;
3784
+ for (let i = 0; i < children.length; i++) {
3785
+ const child = children[i];
3786
+ if (isText$1(child)) {
3787
+ hasText = true;
3788
+ for (let j = i + 1; j < children.length; j++) {
3789
+ const next = children[j];
3790
+ if (isText$1(next)) {
3791
+ if (!currentContainer) currentContainer = children[i] = createCompoundExpression([child], child.loc);
3792
+ currentContainer.children.push(` + `, next);
3793
+ children.splice(j, 1);
3794
+ j--;
3795
+ } else {
3796
+ currentContainer = void 0;
3797
+ break;
3798
+ }
3799
+ }
3800
+ }
3801
+ }
3802
+ if (!hasText || children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && !node.props.find((p) => p.type === 7 && !context.directiveTransforms[p.name]) && !(node.tag === "template"))) return;
3803
+ for (let i = 0; i < children.length; i++) {
3804
+ const child = children[i];
3805
+ if (isText$1(child) || child.type === 8) {
3806
+ const callArgs = [];
3807
+ if (child.type !== 2 || child.content !== " ") callArgs.push(child);
3808
+ if (!context.ssr && getConstantType(child, context) === 0) callArgs.push("1");
3809
+ children[i] = {
3810
+ type: 12,
3811
+ content: child,
3812
+ loc: child.loc,
3813
+ codegenNode: createCallExpression(context.helper(CREATE_TEXT), callArgs)
3814
+ };
3815
+ }
3816
+ }
3817
+ };
3818
+ };
3819
+ seen$1 = /* @__PURE__ */ new WeakSet();
3820
+ transformOnce = (node, context) => {
3821
+ if (node.type === 1 && findDir(node, "once", true)) {
3822
+ if (seen$1.has(node) || context.inVOnce || context.inSSR) return;
3823
+ seen$1.add(node);
3824
+ context.inVOnce = true;
3825
+ context.helper(SET_BLOCK_TRACKING);
3826
+ return () => {
3827
+ context.inVOnce = false;
3828
+ const cur = context.currentNode;
3829
+ if (cur.codegenNode) cur.codegenNode = context.cache(cur.codegenNode, true, true);
3830
+ };
3831
+ }
3832
+ };
3833
+ transformModel = (dir, node, context) => {
3834
+ const { exp, arg } = dir;
3835
+ if (!exp) {
3836
+ context.onError(createCompilerError(41, dir.loc));
3837
+ return createTransformProps();
3838
+ }
3839
+ const rawExp = exp.loc.source.trim();
3840
+ const expString = exp.type === 4 ? exp.content : rawExp;
3841
+ const bindingType = context.bindingMetadata[rawExp];
3842
+ if (bindingType === "props" || bindingType === "props-aliased") {
3843
+ context.onError(createCompilerError(44, exp.loc));
3844
+ return createTransformProps();
3845
+ }
3846
+ if (!expString.trim() || !isMemberExpression(exp) && true) {
3847
+ context.onError(createCompilerError(42, exp.loc));
3848
+ return createTransformProps();
3849
+ }
3850
+ const propName = arg ? arg : createSimpleExpression("modelValue", true);
3851
+ const eventName = arg ? isStaticExp(arg) ? `onUpdate:${camelize(arg.content)}` : createCompoundExpression(["\"onUpdate:\" + ", arg]) : `onUpdate:modelValue`;
3852
+ let assignmentExp;
3853
+ assignmentExp = createCompoundExpression([
3854
+ `${context.isTS ? `($event: any)` : `$event`} => ((`,
3855
+ exp,
3856
+ `) = $event)`
3857
+ ]);
3858
+ const props = [createObjectProperty(propName, dir.exp), createObjectProperty(eventName, assignmentExp)];
3859
+ if (dir.modifiers.length && node.tagType === 1) {
3860
+ const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
3861
+ const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, " + \"Modifiers\""]) : `modelModifiers`;
3862
+ props.push(createObjectProperty(modifiersKey, createSimpleExpression(`{ ${modifiers} }`, false, dir.loc, 2)));
3863
+ }
3864
+ return createTransformProps(props);
3865
+ };
3866
+ validDivisionCharRE = /[\w).+\-_$\]]/;
3867
+ transformFilter = (node, context) => {
3868
+ if (!isCompatEnabled("COMPILER_FILTERS", context)) return;
3869
+ if (node.type === 5) rewriteFilter(node.content, context);
3870
+ else if (node.type === 1) node.props.forEach((prop) => {
3871
+ if (prop.type === 7 && prop.name !== "for" && prop.exp) rewriteFilter(prop.exp, context);
3872
+ });
3873
+ };
3874
+ seen = /* @__PURE__ */ new WeakSet();
3875
+ transformMemo = (node, context) => {
3876
+ if (node.type === 1) {
3877
+ const dir = findDir(node, "memo");
3878
+ if (!dir || seen.has(node)) return;
3879
+ seen.add(node);
3880
+ return () => {
3881
+ const codegenNode = node.codegenNode || context.currentNode.codegenNode;
3882
+ if (codegenNode && codegenNode.type === 13) {
3883
+ if (node.tagType !== 1) convertToBlock(codegenNode, context);
3884
+ node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
3885
+ dir.exp,
3886
+ createFunctionExpression(void 0, codegenNode),
3887
+ `_cache`,
3888
+ String(context.cached.length)
3889
+ ]);
3890
+ context.cached.push(null);
3891
+ }
3892
+ };
3893
+ }
3894
+ };
3895
+ BindingTypes = {
3896
+ "DATA": "data",
3897
+ "PROPS": "props",
3898
+ "PROPS_ALIASED": "props-aliased",
3899
+ "SETUP_LET": "setup-let",
3900
+ "SETUP_CONST": "setup-const",
3901
+ "SETUP_REACTIVE_CONST": "setup-reactive-const",
3902
+ "SETUP_MAYBE_REF": "setup-maybe-ref",
3903
+ "SETUP_REF": "setup-ref",
3904
+ "OPTIONS": "options",
3905
+ "LITERAL_CONST": "literal-const"
3906
+ };
3907
+ noopDirectiveTransform = () => ({ props: [] });
3908
+ }));
3909
+ var compiler_dom_esm_bundler_exports = /* @__PURE__ */ __export({
3910
+ BASE_TRANSITION: () => BASE_TRANSITION,
3911
+ BindingTypes: () => BindingTypes,
3912
+ CAMELIZE: () => CAMELIZE,
3913
+ CAPITALIZE: () => CAPITALIZE,
3914
+ CREATE_BLOCK: () => CREATE_BLOCK,
3915
+ CREATE_COMMENT: () => CREATE_COMMENT,
3916
+ CREATE_ELEMENT_BLOCK: () => CREATE_ELEMENT_BLOCK,
3917
+ CREATE_ELEMENT_VNODE: () => CREATE_ELEMENT_VNODE,
3918
+ CREATE_SLOTS: () => CREATE_SLOTS,
3919
+ CREATE_STATIC: () => CREATE_STATIC,
3920
+ CREATE_TEXT: () => CREATE_TEXT,
3921
+ CREATE_VNODE: () => CREATE_VNODE,
3922
+ CompilerDeprecationTypes: () => CompilerDeprecationTypes,
3923
+ ConstantTypes: () => ConstantTypes,
3924
+ DOMDirectiveTransforms: () => DOMDirectiveTransforms,
3925
+ DOMErrorCodes: () => DOMErrorCodes,
3926
+ DOMErrorMessages: () => DOMErrorMessages,
3927
+ DOMNodeTransforms: () => DOMNodeTransforms,
3928
+ ElementTypes: () => ElementTypes,
3929
+ ErrorCodes: () => ErrorCodes,
3930
+ FRAGMENT: () => FRAGMENT,
3931
+ GUARD_REACTIVE_PROPS: () => GUARD_REACTIVE_PROPS,
3932
+ IS_MEMO_SAME: () => IS_MEMO_SAME,
3933
+ IS_REF: () => IS_REF,
3934
+ KEEP_ALIVE: () => KEEP_ALIVE,
3935
+ MERGE_PROPS: () => MERGE_PROPS,
3936
+ NORMALIZE_CLASS: () => NORMALIZE_CLASS,
3937
+ NORMALIZE_PROPS: () => NORMALIZE_PROPS,
3938
+ NORMALIZE_STYLE: () => NORMALIZE_STYLE,
3939
+ Namespaces: () => Namespaces,
3940
+ NodeTypes: () => NodeTypes,
3941
+ OPEN_BLOCK: () => OPEN_BLOCK,
3942
+ POP_SCOPE_ID: () => POP_SCOPE_ID,
3943
+ PUSH_SCOPE_ID: () => PUSH_SCOPE_ID,
3944
+ RENDER_LIST: () => RENDER_LIST,
3945
+ RENDER_SLOT: () => RENDER_SLOT,
3946
+ RESOLVE_COMPONENT: () => RESOLVE_COMPONENT,
3947
+ RESOLVE_DIRECTIVE: () => RESOLVE_DIRECTIVE,
3948
+ RESOLVE_DYNAMIC_COMPONENT: () => RESOLVE_DYNAMIC_COMPONENT,
3949
+ RESOLVE_FILTER: () => RESOLVE_FILTER,
3950
+ SET_BLOCK_TRACKING: () => SET_BLOCK_TRACKING,
3951
+ SUSPENSE: () => SUSPENSE,
3952
+ TELEPORT: () => TELEPORT,
3953
+ TO_DISPLAY_STRING: () => TO_DISPLAY_STRING,
3954
+ TO_HANDLERS: () => TO_HANDLERS,
3955
+ TO_HANDLER_KEY: () => TO_HANDLER_KEY,
3956
+ TRANSITION: () => TRANSITION,
3957
+ TRANSITION_GROUP: () => TRANSITION_GROUP,
3958
+ TS_NODE_TYPES: () => TS_NODE_TYPES,
3959
+ UNREF: () => UNREF,
3960
+ V_MODEL_CHECKBOX: () => V_MODEL_CHECKBOX,
3961
+ V_MODEL_DYNAMIC: () => V_MODEL_DYNAMIC,
3962
+ V_MODEL_RADIO: () => V_MODEL_RADIO,
3963
+ V_MODEL_SELECT: () => V_MODEL_SELECT,
3964
+ V_MODEL_TEXT: () => V_MODEL_TEXT,
3965
+ V_ON_WITH_KEYS: () => V_ON_WITH_KEYS,
3966
+ V_ON_WITH_MODIFIERS: () => V_ON_WITH_MODIFIERS,
3967
+ V_SHOW: () => V_SHOW,
3968
+ WITH_CTX: () => WITH_CTX,
3969
+ WITH_DIRECTIVES: () => WITH_DIRECTIVES,
3970
+ WITH_MEMO: () => WITH_MEMO,
3971
+ advancePositionWithClone: () => advancePositionWithClone,
3972
+ advancePositionWithMutation: () => advancePositionWithMutation,
3973
+ assert: () => assert,
3974
+ baseCompile: () => baseCompile,
3975
+ baseParse: () => baseParse,
3976
+ buildDirectiveArgs: () => buildDirectiveArgs,
3977
+ buildProps: () => buildProps,
3978
+ buildSlots: () => buildSlots,
3979
+ checkCompatEnabled: () => checkCompatEnabled,
3980
+ compile: () => compile,
3981
+ convertToBlock: () => convertToBlock,
3982
+ createArrayExpression: () => createArrayExpression,
3983
+ createAssignmentExpression: () => createAssignmentExpression,
3984
+ createBlockStatement: () => createBlockStatement,
3985
+ createCacheExpression: () => createCacheExpression,
3986
+ createCallExpression: () => createCallExpression,
3987
+ createCompilerError: () => createCompilerError,
3988
+ createCompoundExpression: () => createCompoundExpression,
3989
+ createConditionalExpression: () => createConditionalExpression,
3990
+ createDOMCompilerError: () => createDOMCompilerError,
3991
+ createForLoopParams: () => createForLoopParams,
3992
+ createFunctionExpression: () => createFunctionExpression,
3993
+ createIfStatement: () => createIfStatement,
3994
+ createInterpolation: () => createInterpolation,
3995
+ createObjectExpression: () => createObjectExpression,
3996
+ createObjectProperty: () => createObjectProperty,
3997
+ createReturnStatement: () => createReturnStatement,
3998
+ createRoot: () => createRoot,
3999
+ createSequenceExpression: () => createSequenceExpression,
4000
+ createSimpleExpression: () => createSimpleExpression,
4001
+ createStructuralDirectiveTransform: () => createStructuralDirectiveTransform,
4002
+ createTemplateLiteral: () => createTemplateLiteral,
4003
+ createTransformContext: () => createTransformContext,
4004
+ createVNodeCall: () => createVNodeCall,
4005
+ errorMessages: () => errorMessages,
4006
+ extractIdentifiers: () => extractIdentifiers,
4007
+ findDir: () => findDir,
4008
+ findProp: () => findProp,
4009
+ forAliasRE: () => forAliasRE,
4010
+ generate: () => generate,
4011
+ generateCodeFrame: () => generateCodeFrame,
4012
+ getBaseTransformPreset: () => getBaseTransformPreset,
4013
+ getConstantType: () => getConstantType,
4014
+ getMemoedVNodeCall: () => getMemoedVNodeCall,
4015
+ getVNodeBlockHelper: () => getVNodeBlockHelper,
4016
+ getVNodeHelper: () => getVNodeHelper,
4017
+ hasDynamicKeyVBind: () => hasDynamicKeyVBind,
4018
+ hasScopeRef: () => hasScopeRef,
4019
+ helperNameMap: () => helperNameMap,
4020
+ injectProp: () => injectProp,
4021
+ isCoreComponent: () => isCoreComponent,
4022
+ isFnExpression: () => isFnExpression,
4023
+ isFnExpressionBrowser: () => isFnExpressionBrowser,
4024
+ isFnExpressionNode: () => isFnExpressionNode,
4025
+ isFunctionType: () => isFunctionType,
4026
+ isInDestructureAssignment: () => isInDestructureAssignment,
4027
+ isInNewExpression: () => isInNewExpression,
4028
+ isMemberExpression: () => isMemberExpression,
4029
+ isMemberExpressionBrowser: () => isMemberExpressionBrowser,
4030
+ isMemberExpressionNode: () => isMemberExpressionNode,
4031
+ isReferencedIdentifier: () => isReferencedIdentifier,
4032
+ isSimpleIdentifier: () => isSimpleIdentifier,
4033
+ isSlotOutlet: () => isSlotOutlet,
4034
+ isStaticArgOf: () => isStaticArgOf,
4035
+ isStaticExp: () => isStaticExp,
4036
+ isStaticProperty: () => isStaticProperty,
4037
+ isStaticPropertyKey: () => isStaticPropertyKey,
4038
+ isTemplateNode: () => isTemplateNode,
4039
+ isText: () => isText$1,
4040
+ isVSlot: () => isVSlot,
4041
+ locStub: () => locStub,
4042
+ noopDirectiveTransform: () => noopDirectiveTransform,
4043
+ parse: () => parse,
4044
+ parserOptions: () => parserOptions,
4045
+ processExpression: () => processExpression,
4046
+ processFor: () => processFor,
4047
+ processIf: () => processIf,
4048
+ processSlotOutlet: () => processSlotOutlet,
4049
+ registerRuntimeHelpers: () => registerRuntimeHelpers,
4050
+ resolveComponentType: () => resolveComponentType,
4051
+ stringifyExpression: () => stringifyExpression,
4052
+ toValidAssetId: () => toValidAssetId,
4053
+ trackSlotScopes: () => trackSlotScopes,
4054
+ trackVForSlotScopes: () => trackVForSlotScopes,
4055
+ transform: () => transform,
4056
+ transformBind: () => transformBind,
4057
+ transformElement: () => transformElement,
4058
+ transformExpression: () => transformExpression,
4059
+ transformModel: () => transformModel,
4060
+ transformOn: () => transformOn,
4061
+ transformStyle: () => transformStyle,
4062
+ traverseNode: () => traverseNode,
4063
+ unwrapTSNode: () => unwrapTSNode,
4064
+ walkBlockDeclarations: () => walkBlockDeclarations,
4065
+ walkFunctionParams: () => walkFunctionParams,
4066
+ walkIdentifiers: () => walkIdentifiers,
4067
+ warnDeprecation: () => warnDeprecation
4068
+ });
4069
+ function decodeHtmlBrowser(raw, asAttr = false) {
4070
+ if (!decoder) decoder = document.createElement("div");
4071
+ if (asAttr) {
4072
+ decoder.innerHTML = `<div foo="${raw.replace(/"/g, "&quot;")}">`;
4073
+ return decoder.children[0].getAttribute("foo");
4074
+ } else {
4075
+ decoder.innerHTML = raw;
4076
+ return decoder.textContent;
4077
+ }
4078
+ }
4079
+ function createDOMCompilerError(code, loc) {
4080
+ return createCompilerError(code, loc, void 0);
4081
+ }
4082
+ function compile(src, options = {}) {
4083
+ return baseCompile(src, extend({}, parserOptions, options, {
4084
+ nodeTransforms: [
4085
+ ignoreSideEffectTags,
4086
+ ...DOMNodeTransforms,
4087
+ ...options.nodeTransforms || []
4088
+ ],
4089
+ directiveTransforms: extend({}, DOMDirectiveTransforms, options.directiveTransforms || {}),
4090
+ transformHoist: null
4091
+ }));
4092
+ }
4093
+ function parse(template, options = {}) {
4094
+ return baseParse(template, extend({}, parserOptions, options));
4095
+ }
4096
+ var V_MODEL_RADIO, V_MODEL_CHECKBOX, V_MODEL_TEXT, V_MODEL_SELECT, V_MODEL_DYNAMIC, V_ON_WITH_MODIFIERS, V_ON_WITH_KEYS, V_SHOW, TRANSITION, TRANSITION_GROUP, decoder, parserOptions, transformStyle, parseInlineCSS, DOMErrorCodes, DOMErrorMessages, transformVHtml, transformVText, transformModel$1, isEventOptionModifier, isNonKeyModifier, maybeKeyModifier, isKeyboardEvent, resolveModifiers, transformClick, transformOn$1, transformShow, ignoreSideEffectTags, DOMNodeTransforms, DOMDirectiveTransforms;
4097
+ var init_compiler_dom_esm_bundler = __esmMin((() => {
4098
+ init_compiler_core_esm_bundler();
4099
+ init_compiler_core_esm_bundler();
4100
+ init_shared_esm_bundler();
4101
+ V_MODEL_RADIO = Symbol(``);
4102
+ V_MODEL_CHECKBOX = Symbol(``);
4103
+ V_MODEL_TEXT = Symbol(``);
4104
+ V_MODEL_SELECT = Symbol(``);
4105
+ V_MODEL_DYNAMIC = Symbol(``);
4106
+ V_ON_WITH_MODIFIERS = Symbol(``);
4107
+ V_ON_WITH_KEYS = Symbol(``);
4108
+ V_SHOW = Symbol(``);
4109
+ TRANSITION = Symbol(``);
4110
+ TRANSITION_GROUP = Symbol(``);
4111
+ registerRuntimeHelpers({
4112
+ [V_MODEL_RADIO]: `vModelRadio`,
4113
+ [V_MODEL_CHECKBOX]: `vModelCheckbox`,
4114
+ [V_MODEL_TEXT]: `vModelText`,
4115
+ [V_MODEL_SELECT]: `vModelSelect`,
4116
+ [V_MODEL_DYNAMIC]: `vModelDynamic`,
4117
+ [V_ON_WITH_MODIFIERS]: `withModifiers`,
4118
+ [V_ON_WITH_KEYS]: `withKeys`,
4119
+ [V_SHOW]: `vShow`,
4120
+ [TRANSITION]: `Transition`,
4121
+ [TRANSITION_GROUP]: `TransitionGroup`
4122
+ });
4123
+ parserOptions = {
4124
+ parseMode: "html",
4125
+ isVoidTag,
4126
+ isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
4127
+ isPreTag: (tag) => tag === "pre",
4128
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
4129
+ decodeEntities: decodeHtmlBrowser,
4130
+ isBuiltInComponent: (tag) => {
4131
+ if (tag === "Transition" || tag === "transition") return TRANSITION;
4132
+ else if (tag === "TransitionGroup" || tag === "transition-group") return TRANSITION_GROUP;
4133
+ },
4134
+ getNamespace(tag, parent, rootNamespace) {
4135
+ let ns = parent ? parent.ns : rootNamespace;
4136
+ if (parent && ns === 2) {
4137
+ if (parent.tag === "annotation-xml") {
4138
+ if (tag === "svg") return 1;
4139
+ if (parent.props.some((a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml"))) ns = 0;
4140
+ } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") ns = 0;
4141
+ } else if (parent && ns === 1) {
4142
+ if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") ns = 0;
4143
+ }
4144
+ if (ns === 0) {
4145
+ if (tag === "svg") return 1;
4146
+ if (tag === "math") return 2;
4147
+ }
4148
+ return ns;
4149
+ }
4150
+ };
4151
+ transformStyle = (node) => {
4152
+ if (node.type === 1) node.props.forEach((p, i) => {
4153
+ if (p.type === 6 && p.name === "style" && p.value) node.props[i] = {
4154
+ type: 7,
4155
+ name: `bind`,
4156
+ arg: createSimpleExpression(`style`, true, p.loc),
4157
+ exp: parseInlineCSS(p.value.content, p.loc),
4158
+ modifiers: [],
4159
+ loc: p.loc
4160
+ };
4161
+ });
4162
+ };
4163
+ parseInlineCSS = (cssText, loc) => {
4164
+ const normalized = parseStringStyle(cssText);
4165
+ return createSimpleExpression(JSON.stringify(normalized), false, loc, 3);
4166
+ };
4167
+ DOMErrorCodes = {
4168
+ "X_V_HTML_NO_EXPRESSION": 53,
4169
+ "53": "X_V_HTML_NO_EXPRESSION",
4170
+ "X_V_HTML_WITH_CHILDREN": 54,
4171
+ "54": "X_V_HTML_WITH_CHILDREN",
4172
+ "X_V_TEXT_NO_EXPRESSION": 55,
4173
+ "55": "X_V_TEXT_NO_EXPRESSION",
4174
+ "X_V_TEXT_WITH_CHILDREN": 56,
4175
+ "56": "X_V_TEXT_WITH_CHILDREN",
4176
+ "X_V_MODEL_ON_INVALID_ELEMENT": 57,
4177
+ "57": "X_V_MODEL_ON_INVALID_ELEMENT",
4178
+ "X_V_MODEL_ARG_ON_ELEMENT": 58,
4179
+ "58": "X_V_MODEL_ARG_ON_ELEMENT",
4180
+ "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59,
4181
+ "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
4182
+ "X_V_MODEL_UNNECESSARY_VALUE": 60,
4183
+ "60": "X_V_MODEL_UNNECESSARY_VALUE",
4184
+ "X_V_SHOW_NO_EXPRESSION": 61,
4185
+ "61": "X_V_SHOW_NO_EXPRESSION",
4186
+ "X_TRANSITION_INVALID_CHILDREN": 62,
4187
+ "62": "X_TRANSITION_INVALID_CHILDREN",
4188
+ "X_IGNORED_SIDE_EFFECT_TAG": 63,
4189
+ "63": "X_IGNORED_SIDE_EFFECT_TAG",
4190
+ "__EXTEND_POINT__": 64,
4191
+ "64": "__EXTEND_POINT__"
4192
+ };
4193
+ DOMErrorMessages = {
4194
+ [53]: `v-html is missing expression.`,
4195
+ [54]: `v-html will override element children.`,
4196
+ [55]: `v-text is missing expression.`,
4197
+ [56]: `v-text will override element children.`,
4198
+ [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
4199
+ [58]: `v-model argument is not supported on plain elements.`,
4200
+ [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
4201
+ [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
4202
+ [61]: `v-show is missing expression.`,
4203
+ [62]: `<Transition> expects exactly one child element or component.`,
4204
+ [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
4205
+ };
4206
+ transformVHtml = (dir, node, context) => {
4207
+ const { exp, loc } = dir;
4208
+ if (!exp) context.onError(createDOMCompilerError(53, loc));
4209
+ if (node.children.length) {
4210
+ context.onError(createDOMCompilerError(54, loc));
4211
+ node.children.length = 0;
4212
+ }
4213
+ return { props: [createObjectProperty(createSimpleExpression(`innerHTML`, true, loc), exp || createSimpleExpression("", true))] };
4214
+ };
4215
+ transformVText = (dir, node, context) => {
4216
+ const { exp, loc } = dir;
4217
+ if (!exp) context.onError(createDOMCompilerError(55, loc));
4218
+ if (node.children.length) {
4219
+ context.onError(createDOMCompilerError(56, loc));
4220
+ node.children.length = 0;
4221
+ }
4222
+ return { props: [createObjectProperty(createSimpleExpression(`textContent`, true), exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression(context.helperString(TO_DISPLAY_STRING), [exp], loc) : createSimpleExpression("", true))] };
4223
+ };
4224
+ transformModel$1 = (dir, node, context) => {
4225
+ const baseResult = transformModel(dir, node, context);
4226
+ if (!baseResult.props.length || node.tagType === 1) return baseResult;
4227
+ if (dir.arg) context.onError(createDOMCompilerError(58, dir.arg.loc));
4228
+ const { tag } = node;
4229
+ const isCustomElement = context.isCustomElement(tag);
4230
+ if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
4231
+ let directiveToUse = V_MODEL_TEXT;
4232
+ let isInvalidType = false;
4233
+ if (tag === "input" || isCustomElement) {
4234
+ const type = findProp(node, `type`);
4235
+ if (type) {
4236
+ if (type.type === 7) directiveToUse = V_MODEL_DYNAMIC;
4237
+ else if (type.value) switch (type.value.content) {
4238
+ case "radio":
4239
+ directiveToUse = V_MODEL_RADIO;
4240
+ break;
4241
+ case "checkbox":
4242
+ directiveToUse = V_MODEL_CHECKBOX;
4243
+ break;
4244
+ case "file":
4245
+ isInvalidType = true;
4246
+ context.onError(createDOMCompilerError(59, dir.loc));
4247
+ break;
4248
+ default: break;
4249
+ }
4250
+ } else if (hasDynamicKeyVBind(node)) directiveToUse = V_MODEL_DYNAMIC;
4251
+ } else if (tag === "select") directiveToUse = V_MODEL_SELECT;
4252
+ if (!isInvalidType) baseResult.needRuntime = context.helper(directiveToUse);
4253
+ } else context.onError(createDOMCompilerError(57, dir.loc));
4254
+ baseResult.props = baseResult.props.filter((p) => !(p.key.type === 4 && p.key.content === "modelValue"));
4255
+ return baseResult;
4256
+ };
4257
+ isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`);
4258
+ isNonKeyModifier = /* @__PURE__ */ makeMap(`stop,prevent,self,ctrl,shift,alt,meta,exact,middle`);
4259
+ maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
4260
+ isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`);
4261
+ resolveModifiers = (key, modifiers, context, loc) => {
4262
+ const keyModifiers = [];
4263
+ const nonKeyModifiers = [];
4264
+ const eventOptionModifiers = [];
4265
+ for (let i = 0; i < modifiers.length; i++) {
4266
+ const modifier = modifiers[i].content;
4267
+ if (modifier === "native" && checkCompatEnabled("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
4268
+ else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
4269
+ else if (maybeKeyModifier(modifier)) if (isStaticExp(key)) if (isKeyboardEvent(key.content.toLowerCase())) keyModifiers.push(modifier);
4270
+ else nonKeyModifiers.push(modifier);
4271
+ else {
4272
+ keyModifiers.push(modifier);
4273
+ nonKeyModifiers.push(modifier);
4274
+ }
4275
+ else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
4276
+ else keyModifiers.push(modifier);
4277
+ }
4278
+ return {
4279
+ keyModifiers,
4280
+ nonKeyModifiers,
4281
+ eventOptionModifiers
4282
+ };
4283
+ };
4284
+ transformClick = (key, event) => {
4285
+ return isStaticExp(key) && key.content.toLowerCase() === "onclick" ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
4286
+ `(`,
4287
+ key,
4288
+ `) === "onClick" ? "${event}" : (`,
4289
+ key,
4290
+ `)`
4291
+ ]) : key;
4292
+ };
4293
+ transformOn$1 = (dir, node, context) => {
4294
+ return transformOn(dir, node, context, (baseResult) => {
4295
+ const { modifiers } = dir;
4296
+ if (!modifiers.length) return baseResult;
4297
+ let { key, value: handlerExp } = baseResult.props[0];
4298
+ const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
4299
+ if (nonKeyModifiers.includes("right")) key = transformClick(key, `onContextmenu`);
4300
+ if (nonKeyModifiers.includes("middle")) key = transformClick(key, `onMouseup`);
4301
+ if (nonKeyModifiers.length) handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [handlerExp, JSON.stringify(nonKeyModifiers)]);
4302
+ if (keyModifiers.length && (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [handlerExp, JSON.stringify(keyModifiers)]);
4303
+ if (eventOptionModifiers.length) {
4304
+ const modifierPostfix = eventOptionModifiers.map(capitalize).join("");
4305
+ key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([
4306
+ `(`,
4307
+ key,
4308
+ `) + "${modifierPostfix}"`
4309
+ ]);
4310
+ }
4311
+ return { props: [createObjectProperty(key, handlerExp)] };
4312
+ });
4313
+ };
4314
+ transformShow = (dir, node, context) => {
4315
+ const { exp, loc } = dir;
4316
+ if (!exp) context.onError(createDOMCompilerError(61, loc));
4317
+ return {
4318
+ props: [],
4319
+ needRuntime: context.helper(V_SHOW)
4320
+ };
4321
+ };
4322
+ ignoreSideEffectTags = (node, context) => {
4323
+ if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) context.removeNode();
4324
+ };
4325
+ DOMNodeTransforms = [transformStyle, ...[]];
4326
+ DOMDirectiveTransforms = {
4327
+ cloak: noopDirectiveTransform,
4328
+ html: transformVHtml,
4329
+ text: transformVText,
4330
+ model: transformModel$1,
4331
+ on: transformOn$1,
4332
+ show: transformShow
4333
+ };
4334
+ }));
4335
+ var require_vue_cjs_prod = /* @__PURE__ */ __commonJSMin(((exports) => {
4336
+ Object.defineProperty(exports, "__esModule", { value: true });
4337
+ var compilerDom = (init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports));
4338
+ var runtimeDom = (init_runtime_dom_esm_bundler(), __toCommonJS(runtime_dom_esm_bundler_exports));
4339
+ var shared = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
4340
+ function _interopNamespaceDefault(e) {
4341
+ var n = Object.create(null);
4342
+ if (e) for (var k in e) n[k] = e[k];
4343
+ n.default = e;
4344
+ return Object.freeze(n);
4345
+ }
4346
+ var runtimeDom__namespace = /* @__PURE__ */ _interopNamespaceDefault(runtimeDom);
4347
+ var compileCache = /* @__PURE__ */ Object.create(null);
4348
+ function compileToFunction(template, options) {
4349
+ if (!shared.isString(template)) if (template.nodeType) template = template.innerHTML;
4350
+ else return shared.NOOP;
4351
+ const key = shared.genCacheKey(template, options);
4352
+ const cached = compileCache[key];
4353
+ if (cached) return cached;
4354
+ if (template[0] === "#") {
4355
+ const el = document.querySelector(template);
4356
+ template = el ? el.innerHTML : ``;
4357
+ }
4358
+ const opts = shared.extend({
4359
+ hoistStatic: true,
4360
+ onError: void 0,
4361
+ onWarn: shared.NOOP
4362
+ }, options);
4363
+ if (!opts.isCustomElement && typeof customElements !== "undefined") opts.isCustomElement = (tag) => !!customElements.get(tag);
4364
+ const { code } = compilerDom.compile(template, opts);
4365
+ const render = new Function("Vue", code)(runtimeDom__namespace);
4366
+ render._rc = true;
4367
+ return compileCache[key] = render;
4368
+ }
4369
+ runtimeDom.registerRuntimeCompiler(compileToFunction);
4370
+ exports.compile = compileToFunction;
4371
+ Object.keys(runtimeDom).forEach(function(k) {
4372
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = runtimeDom[k];
4373
+ });
4374
+ }));
4375
+ var require_vue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4376
+ module.exports = require_vue_cjs_prod();
4377
+ }));
4378
+ export { require_vue as t };