cabloy 5.1.10 → 5.1.12

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 (210) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lint-staged.config.mjs +92 -0
  3. package/oxfmt.config.ts +4 -1
  4. package/package.json +2 -11
  5. package/vona/packages-utils/lint/api/tsconfig.base.esm.json +30 -2
  6. package/vona/packages-utils/lint/package.json +40 -5
  7. package/vona/packages-utils/lint/src/index.ts +3 -0
  8. package/vona/packages-utils/lint/{oxc/format.js → src/oxc/format.ts} +4 -2
  9. package/vona/packages-utils/lint/{oxc/lint.js → src/oxc/lint.ts} +7 -7
  10. package/vona/packages-utils/lint/{oxc/lintVue.js → src/oxc/lintVue.ts} +4 -6
  11. package/vona/packages-utils/lint/tsconfig.json +14 -0
  12. package/vona/pnpm-lock.yaml +338 -17
  13. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/.metadata/index.ts +0 -78
  14. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/controller/toolOne.ts +3 -1
  15. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/controller/toolTwo.ts +3 -1
  16. package/zova/env/.env.ssr.cabloyBasicAdmin +0 -2
  17. package/zova/package.original.json +2 -8
  18. package/zova/packages-cli/cli/package.json +2 -2
  19. package/zova/packages-cli/cli-set-front/package.json +8 -8
  20. package/zova/packages-utils/babel-plugin-zova-bean-module/package.json +3 -3
  21. package/zova/packages-utils/babel-plugin-zova-bean-use/package.json +2 -2
  22. package/zova/packages-utils/babel-plugin-zova-behavior/package.json +2 -2
  23. package/zova/packages-utils/babel-plugin-zova-component/package.json +2 -2
  24. package/zova/packages-utils/logger/package.json +2 -2
  25. package/zova/packages-utils/mutate-on-copy/package.json +2 -2
  26. package/zova/packages-utils/quasar-app-extension-zova/package.json +3 -3
  27. package/zova/packages-utils/word-utils/package.json +2 -2
  28. package/zova/packages-utils/zova-jsx/package.json +4 -4
  29. package/zova/packages-utils/zova-openapi/package.json +2 -2
  30. package/zova/packages-utils/zova-vite/package.json +6 -6
  31. package/zova/packages-zova/zova/package.json +4 -4
  32. package/zova/packages-zova/zova-core/package.json +4 -4
  33. package/zova/pnpm-lock.yaml +67 -63
  34. package/zova/src/suite/a-demo/modules/demo-basic/package.json +1 -1
  35. package/zova/src/suite/a-demo/modules/demo-todo/package.json +1 -1
  36. package/zova/src/suite/a-demo/package.json +1 -1
  37. package/zova/src/suite/a-devui/modules/devui-adapter/package.json +1 -1
  38. package/zova/src/suite/a-devui/package.json +1 -1
  39. package/zova/src/suite/a-home/modules/home-api/package.json +1 -1
  40. package/zova/src/suite/a-home/modules/home-base/package.json +1 -1
  41. package/zova/src/suite/a-home/modules/home-icon/package.json +1 -1
  42. package/zova/src/suite/a-home/modules/home-index/package.json +1 -1
  43. package/zova/src/suite/a-home/modules/home-layoutempty/package.json +1 -1
  44. package/zova/src/suite/a-home/modules/home-layouttabs/package.json +1 -1
  45. package/zova/src/suite/a-home/modules/home-login/package.json +1 -1
  46. package/zova/src/suite/a-home/modules/home-passport/package.json +1 -1
  47. package/zova/src/suite/a-home/modules/home-theme/package.json +1 -1
  48. package/zova/src/suite/a-home/package.json +1 -1
  49. package/zova/src/suite/cabloy-basic/modules/basic-adapter/package.json +1 -1
  50. package/zova/src/suite/cabloy-basic/modules/basic-captcha/package.json +1 -1
  51. package/zova/src/suite/cabloy-basic/modules/basic-commands/package.json +1 -1
  52. package/zova/src/suite/cabloy-basic/modules/basic-commandssync/package.json +1 -1
  53. package/zova/src/suite/cabloy-basic/modules/basic-currency/package.json +1 -1
  54. package/zova/src/suite/cabloy-basic/modules/basic-date/package.json +1 -1
  55. package/zova/src/suite/cabloy-basic/modules/basic-form/package.json +1 -1
  56. package/zova/src/suite/cabloy-basic/modules/basic-input/package.json +1 -1
  57. package/zova/src/suite/cabloy-basic/modules/basic-page/package.json +1 -1
  58. package/zova/src/suite/cabloy-basic/modules/basic-pageentry/package.json +1 -1
  59. package/zova/src/suite/cabloy-basic/modules/basic-select/package.json +1 -0
  60. package/zova/src/suite/cabloy-basic/modules/basic-table/package.json +1 -1
  61. package/zova/src/suite/cabloy-basic/modules/basic-text/package.json +1 -0
  62. package/zova/src/suite-vendor/a-zova/modules/a-api/package.json +2 -2
  63. package/zova/src/suite-vendor/a-zova/modules/a-app/package.json +2 -2
  64. package/zova/src/suite-vendor/a-zova/modules/a-bean/package.json +2 -2
  65. package/zova/src/suite-vendor/a-zova/modules/a-behavior/package.json +2 -2
  66. package/zova/src/suite-vendor/a-zova/modules/a-behaviors/package.json +2 -2
  67. package/zova/src/suite-vendor/a-zova/modules/a-boundary/package.json +2 -2
  68. package/zova/src/suite-vendor/a-zova/modules/a-command/package.json +2 -2
  69. package/zova/src/suite-vendor/a-zova/modules/a-fetch/package.json +2 -2
  70. package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +2 -2
  71. package/zova/src/suite-vendor/a-zova/modules/a-icon/package.json +2 -2
  72. package/zova/src/suite-vendor/a-zova/modules/a-interceptor/package.json +2 -2
  73. package/zova/src/suite-vendor/a-zova/modules/a-logger/package.json +3 -3
  74. package/zova/src/suite-vendor/a-zova/modules/a-meta/package.json +2 -2
  75. package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +3 -3
  76. package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +2 -2
  77. package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +2 -2
  78. package/zova/src/suite-vendor/a-zova/modules/a-routerstack/package.json +2 -2
  79. package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +2 -2
  80. package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +2 -2
  81. package/zova/src/suite-vendor/a-zova/modules/a-ssrhmr/package.json +2 -2
  82. package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +2 -2
  83. package/zova/src/suite-vendor/a-zova/modules/a-style/package.json +2 -2
  84. package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +2 -2
  85. package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +2 -2
  86. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +5 -5
  87. package/zova/src/suite-vendor/a-zova/package.json +27 -27
  88. package/vona/packages-utils/lint/api/eslint.js +0 -41
  89. package/vona/packages-utils/lint/api/prettier.js +0 -8
  90. package/vona/packages-utils/lint/api/tsconfig.base.cjs.json +0 -32
  91. package/vona/packages-utils/lint/common/rules.js +0 -155
  92. package/vona/packages-utils/lint/common/rulesVue.js +0 -5
  93. package/vona/packages-utils/lint/front/eslint.js +0 -59
  94. package/vona/packages-utils/lint/front/prettier.js +0 -3
  95. package/vona/packages-utils/lint/front/tsconfig.base.cjs.json +0 -4
  96. package/vona/packages-utils/lint/front/tsconfig.base.esm.json +0 -9
  97. package/vona/packages-utils/lint/index.js +0 -3
  98. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/-zova-config-CoKN49wO.js +0 -11
  99. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-api-DmsK4zNw.js +0 -178
  100. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-app-C7cTDV9C.js +0 -138
  101. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-bean-qjOwLLml.js +0 -408
  102. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-behavior-I9evY2QT.js +0 -454
  103. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-behaviors-Dh8sE2AX.js +0 -58
  104. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-boundary-DxeJURnH.js +0 -21
  105. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-command-Duq9OGnp.js +0 -165
  106. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-fetch-BsiDc5MA.js +0 -317
  107. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-form-BSfvKLPu.js +0 -947
  108. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-icon-Bx0yNmUB.js +0 -460
  109. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-interceptor-CtK-mG6U.js +0 -256
  110. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-logger-D6FVEo-2.js +0 -143
  111. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-meta-DLAWtBzn.js +0 -47
  112. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-model-Ds17NAa5.js +0 -887
  113. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-openapi-Cu42a7Tj.js +0 -677
  114. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-router-BEKs1P3y.js +0 -1009
  115. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-routerstack-CNda3TvU.js +0 -239
  116. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-routertabs-CA8KhmHx.js +0 -519
  117. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-ssr-WZQfI3lD.js +0 -711
  118. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-ssrhmr-DiG_2CbH.js +0 -97
  119. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-style-Dcrophdv.js +0 -408
  120. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-table-Cr0qHPMV.js +0 -464
  121. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-zod-B5ZzHMKp.js +0 -87
  122. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/a-zova-WAWkGLRj.js +0 -21
  123. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/auth-Bjup4K84.svg +0 -8
  124. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/axios-jFGAltpb.js +0 -3152
  125. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-adapter-BzdgS83E.js +0 -68
  126. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-captcha-gmlRJxbp.js +0 -209
  127. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-commands-CmuoODyc.js +0 -179
  128. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-commandssync-4uJoTYWO.js +0 -62
  129. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-currency-ljdT_mJv.js +0 -159
  130. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-date-CJtZtM5q.js +0 -251
  131. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-form-Bi-Dm8Pp.js +0 -376
  132. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-input-DugSctyu.js +0 -83
  133. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-page-C0Mpx24A.js +0 -610
  134. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-pageentry-De7Zvv7J.js +0 -443
  135. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-select-WKCF4vyo.js +0 -186
  136. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-table-B4Eyf7EC.js +0 -368
  137. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/basic-text-CRqjMEyr.js +0 -118
  138. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/browser-C8cI94Tr.js +0 -2409
  139. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/business-DQeTVrBD.svg +0 -12
  140. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/daisy-BZm4lJOy.svg +0 -4
  141. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/default-DxTAw1iv.svg +0 -118
  142. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/demo-basic-CiW_uKMD.js +0 -1419
  143. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/demo-student-DpiY4dnt.js +0 -69
  144. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/demo-todo-CM3XdLlo.js +0 -427
  145. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/devui-adapter-B2uiKP95.js +0 -95
  146. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/dist.es2015-BMNhwNBy.js +0 -343
  147. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/editor-CmZexDJp.svg +0 -32
  148. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/emoji-CLaR2GZg.svg +0 -3
  149. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/esm-Z9BncIrt.js +0 -2574
  150. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/extends-BSP9iXrM.js +0 -27
  151. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/fecha-DvkbkxAQ.js +0 -9849
  152. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/flow-DCn4s91p.svg +0 -13
  153. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-api-B1NjQp7i.js +0 -374
  154. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-base-DRJdeGsg.js +0 -654
  155. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-icon-65b9tDB5.js +0 -125
  156. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-index-KrvUKcFR.js +0 -79
  157. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-layoutempty-DP2peKfC.js +0 -87
  158. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-layouttabs-CRIoszHS.js +0 -980
  159. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-login-z4Url6WO.js +0 -302
  160. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-passport-OqpwAU0M.js +0 -293
  161. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/home-theme-BSua63Y_.js +0 -131
  162. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/index-B5HTgis_.css +0 -26
  163. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/index-Cd4EYYtZ.js +0 -1331
  164. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/localforage-e6vl49GD.js +0 -1798
  165. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/login-Qly1YUqs.svg +0 -7
  166. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/openapi3-jIye4jNw.js +0 -23
  167. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/outline-C6s9io8r.svg +0 -41
  168. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/rest-resource-CN0Ontwm.js +0 -552
  169. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/role-fXTNmWmb.svg +0 -10
  170. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/rolldown-runtime-lkMnaVCm.js +0 -38
  171. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/social-DosI14Uo.svg +0 -12
  172. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/src-BRq8dtuS.js +0 -44
  173. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/src-CBGuKzpF.js +0 -5996
  174. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/src-CzJSxlnS.js +0 -496
  175. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/src-YVxhoO6F.js +0 -65
  176. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-form-CBq6dr_k.js +0 -122
  177. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-query-BJk2jOuy.js +0 -2377
  178. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-query-CBWe1LsT.js +0 -365
  179. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-query-Ch18aWTP.js +0 -212
  180. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-table-BvC3VgJj.js +0 -2241
  181. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tanstack-table-D85qomSu.js +0 -123
  182. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/tools-Wk7SnIwE.svg +0 -4
  183. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/typestyle-C2zp2284.js +0 -281
  184. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-1Y5FbPzj.js +0 -3221
  185. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-C-LVj1DU.js +0 -18
  186. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-ChEE2n-Y.js +0 -598
  187. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-CvF_GLFp.js +0 -190
  188. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-DHzalQTI.js +0 -1308
  189. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/vue-router-COfHCB5q.js +0 -1775
  190. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/wrapAsyncGenerator-zA6hqk-P.js +0 -155
  191. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-6Abekb1F.js +0 -83
  192. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-BHaXQJg22.js +0 -11
  193. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-BYPEGx1T.js +0 -15586
  194. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-BuxXrZHs.js +0 -24
  195. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-C4pGJxwQ.js +0 -1227
  196. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-CoRfsquu.js +0 -8
  197. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-CzTANp3C.js +0 -380
  198. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-DQbBsEtS.js +0 -4130
  199. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/assets/zova-hmnYQoyt.js +0 -374
  200. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/client/favicon.ico +0 -0
  201. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/handler.js +0 -164729
  202. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/index.js +0 -26236
  203. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/assets/site/ssr-testSecond-5.0.0/quasar.manifest.json +0 -1
  204. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/bean/ssrMenu.tools.ts +0 -32
  205. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/bean/ssrMenuGroup.tools.ts +0 -18
  206. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/src/bean/ssrSite.second.ts +0 -31
  207. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/test/ssr.test.ts +0 -44
  208. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/zovaRest/test-second/index.d.mts +0 -9107
  209. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/zovaRest/test-second/index.mjs +0 -234
  210. package/vona/src/suite-vendor/a-cabloy/modules/test-ssr/zovaRest/test-second/package.json +0 -40
@@ -1,1775 +0,0 @@
1
- import { n as __esmMin } from "./rolldown-runtime-lkMnaVCm.js";
2
- import { E as unref, _ as shallowReactive, h as ref, p as reactive, y as shallowRef } from "./vue-DHzalQTI.js";
3
- import { T as provide, d as defineComponent, g as inject, k as watch, o as computed, p as h, y as nextTick } from "./vue-1Y5FbPzj.js";
4
- import { n as init_vue_runtime_esm_bundler } from "./vue-C-LVj1DU.js";
5
- import { m as init_asyncToGenerator, p as _asyncToGenerator } from "./fecha-DvkbkxAQ.js";
6
- //#region node_modules/.pnpm/@cabloy+vue-router@4.4.16_vue@3.5.34_typescript@5.9.3_/node_modules/@cabloy/vue-router/dist/vue-router.mjs
7
- /*!
8
- * @cabloy/vue-router v4.4.13
9
- * (c) 2026 Eduardo San Martin Morote
10
- * @license MIT
11
- */
12
- /**
13
- * Allows differentiating lazy components from functional components and vue-class-component
14
- * @internal
15
- *
16
- * @param component
17
- */
18
- function isRouteComponent(component) {
19
- return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
20
- }
21
- function isESModule(obj) {
22
- return obj.__esModule || obj[Symbol.toStringTag] === "Module" || obj.default && isRouteComponent(obj.default);
23
- }
24
- function applyToParams(fn, params) {
25
- const newParams = {};
26
- for (const key in params) {
27
- const value = params[key];
28
- newParams[key] = isArray(value) ? value.map(fn) : fn(value);
29
- }
30
- return newParams;
31
- }
32
- /**
33
- * Encode characters that need to be encoded on the path, search and hash
34
- * sections of the URL.
35
- *
36
- * @internal
37
- * @param text - string to encode
38
- * @returns encoded string
39
- */
40
- function commonEncode(text) {
41
- return encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
42
- }
43
- /**
44
- * Encode characters that need to be encoded on the hash section of the URL.
45
- *
46
- * @param text - string to encode
47
- * @returns encoded string
48
- */
49
- function encodeHash(text) {
50
- return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
51
- }
52
- /**
53
- * Encode characters that need to be encoded query values on the query
54
- * section of the URL.
55
- *
56
- * @param text - string to encode
57
- * @returns encoded string
58
- */
59
- function encodeQueryValue(text) {
60
- return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
61
- }
62
- /**
63
- * Like `encodeQueryValue` but also encodes the `=` character.
64
- *
65
- * @param text - string to encode
66
- */
67
- function encodeQueryKey(text) {
68
- return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
69
- }
70
- /**
71
- * Encode characters that need to be encoded on the path section of the URL.
72
- *
73
- * @param text - string to encode
74
- * @returns encoded string
75
- */
76
- function encodePath(text) {
77
- return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
78
- }
79
- /**
80
- * Encode characters that need to be encoded on the path section of the URL as a
81
- * param. This function encodes everything {@link encodePath} does plus the
82
- * slash (`/`) character. If `text` is `null` or `undefined`, returns an empty
83
- * string instead.
84
- *
85
- * @param text - string to encode
86
- * @returns encoded string
87
- */
88
- function encodeParam(text) {
89
- return text == null ? "" : encodePath(text).replace(SLASH_RE, "%2F");
90
- }
91
- /**
92
- * Decode text using `decodeURIComponent`. Returns the original text if it
93
- * fails.
94
- *
95
- * @param text - string to decode
96
- * @returns decoded string
97
- */
98
- function decode(text) {
99
- try {
100
- return decodeURIComponent("" + text);
101
- } catch (err) {}
102
- return "" + text;
103
- }
104
- /**
105
- * Transforms a URI into a normalized history location
106
- *
107
- * @param parseQuery
108
- * @param location - URI to normalize
109
- * @param currentLocation - current absolute location. Allows resolving relative
110
- * paths. Must start with `/`. Defaults to `/`
111
- * @returns a normalized history location
112
- */
113
- function parseURL(parseQuery, location, currentLocation = "/") {
114
- let path, query = {}, searchString = "", hash = "";
115
- const hashPos = location.indexOf("#");
116
- let searchPos = location.indexOf("?");
117
- if (hashPos < searchPos && hashPos >= 0) searchPos = -1;
118
- if (searchPos > -1) {
119
- path = location.slice(0, searchPos);
120
- searchString = location.slice(searchPos + 1, hashPos > -1 ? hashPos : location.length);
121
- query = parseQuery(searchString);
122
- }
123
- if (hashPos > -1) {
124
- path = path || location.slice(0, hashPos);
125
- hash = location.slice(hashPos, location.length);
126
- }
127
- path = resolveRelativePath(path != null ? path : location, currentLocation);
128
- return {
129
- fullPath: path + (searchString && "?") + searchString + hash,
130
- path,
131
- query,
132
- hash: decode(hash)
133
- };
134
- }
135
- /**
136
- * Stringifies a URL object
137
- *
138
- * @param stringifyQuery
139
- * @param location
140
- */
141
- function stringifyURL(stringifyQuery, location) {
142
- const query = location.query ? stringifyQuery(location.query) : "";
143
- return location.path + (query && "?") + query + (location.hash || "");
144
- }
145
- /**
146
- * Strips off the base from the beginning of a location.pathname in a non-case-sensitive way.
147
- *
148
- * @param pathname - location.pathname
149
- * @param base - base to strip off
150
- */
151
- function stripBase(pathname, base) {
152
- if (!base || !pathname.toLowerCase().startsWith(base.toLowerCase())) return pathname;
153
- return pathname.slice(base.length) || "/";
154
- }
155
- /**
156
- * Checks if two RouteLocation are equal. This means that both locations are
157
- * pointing towards the same {@link RouteRecord} and that all `params`, `query`
158
- * parameters and `hash` are the same
159
- *
160
- * @param stringifyQuery - A function that takes a query object of type LocationQueryRaw and returns a string representation of it.
161
- * @param a - first {@link RouteLocation}
162
- * @param b - second {@link RouteLocation}
163
- */
164
- function isSameRouteLocation(stringifyQuery, a, b) {
165
- const aLastIndex = a.matched.length - 1;
166
- const bLastIndex = b.matched.length - 1;
167
- return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) && isSameRouteLocationParams(a.params, b.params) && stringifyQuery(a.query) === stringifyQuery(b.query) && a.hash === b.hash;
168
- }
169
- /**
170
- * Check if two `RouteRecords` are equal. Takes into account aliases: they are
171
- * considered equal to the `RouteRecord` they are aliasing.
172
- *
173
- * @param a - first {@link RouteRecord}
174
- * @param b - second {@link RouteRecord}
175
- */
176
- function isSameRouteRecord(a, b) {
177
- return (a.aliasOf || a) === (b.aliasOf || b);
178
- }
179
- function isSameRouteLocationParams(a, b) {
180
- if (Object.keys(a).length !== Object.keys(b).length) return false;
181
- for (const key in a) if (!isSameRouteLocationParamsValue(a[key], b[key])) return false;
182
- return true;
183
- }
184
- function isSameRouteLocationParamsValue(a, b) {
185
- return isArray(a) ? isEquivalentArray(a, b) : isArray(b) ? isEquivalentArray(b, a) : a === b;
186
- }
187
- /**
188
- * Check if two arrays are the same or if an array with one single entry is the
189
- * same as another primitive value. Used to check query and parameters
190
- *
191
- * @param a - array of values
192
- * @param b - array of values or a single value
193
- */
194
- function isEquivalentArray(a, b) {
195
- return isArray(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
196
- }
197
- /**
198
- * Resolves a relative path that starts with `.`.
199
- *
200
- * @param to - path location we are resolving
201
- * @param from - currentLocation.path, should start with `/`
202
- */
203
- function resolveRelativePath(to, from) {
204
- if (to.startsWith("/")) return to;
205
- if (!to) return from;
206
- const fromSegments = from.split("/");
207
- const toSegments = to.split("/");
208
- const lastToSegment = toSegments[toSegments.length - 1];
209
- if (lastToSegment === ".." || lastToSegment === ".") toSegments.push("");
210
- let position = fromSegments.length - 1;
211
- let toPosition;
212
- let segment;
213
- for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
214
- segment = toSegments[toPosition];
215
- if (segment === ".") continue;
216
- if (segment === "..") {
217
- if (position > 1) position--;
218
- } else break;
219
- }
220
- return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
221
- }
222
- /**
223
- * Normalizes a base by removing any trailing slash and reading the base tag if
224
- * present.
225
- *
226
- * @param base - base to normalize
227
- */
228
- function normalizeBase(base) {
229
- if (!base) if (isBrowser) {
230
- const baseEl = document.querySelector("base");
231
- base = baseEl && baseEl.getAttribute("href") || "/";
232
- base = base.replace(/^\w+:\/\/[^\/]+/, "");
233
- } else base = "/";
234
- if (base[0] !== "/" && base[0] !== "#") base = "/" + base;
235
- return removeTrailingSlash(base);
236
- }
237
- function createHref(base, location) {
238
- return base.replace(BEFORE_HASH_RE, "#") + location;
239
- }
240
- function getElementPosition(el, offset) {
241
- const docRect = document.documentElement.getBoundingClientRect();
242
- const elRect = el.getBoundingClientRect();
243
- return {
244
- behavior: offset.behavior,
245
- left: elRect.left - docRect.left - (offset.left || 0),
246
- top: elRect.top - docRect.top - (offset.top || 0)
247
- };
248
- }
249
- function scrollToPosition(position) {
250
- let scrollToOptions;
251
- if ("el" in position) {
252
- const positionEl = position.el;
253
- const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
254
- const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
255
- if (!el) return;
256
- scrollToOptions = getElementPosition(el, position);
257
- } else scrollToOptions = position;
258
- if ("scrollBehavior" in document.documentElement.style) window.scrollTo(scrollToOptions);
259
- else window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
260
- }
261
- function getScrollKey(path, delta) {
262
- return (history.state ? history.state.position - delta : -1) + path;
263
- }
264
- function saveScrollPosition(key, scrollPosition) {
265
- scrollPositions.set(key, scrollPosition);
266
- }
267
- function getSavedScrollPosition(key) {
268
- const scroll = scrollPositions.get(key);
269
- scrollPositions.delete(key);
270
- return scroll;
271
- }
272
- /**
273
- * Creates a normalized history location from a window.location object
274
- * @param base - The base path
275
- * @param location - The window.location object
276
- */
277
- function createCurrentLocation(base, location) {
278
- const { pathname, search, hash } = location;
279
- const hashPos = base.indexOf("#");
280
- if (hashPos > -1) {
281
- let slicePos = hash.includes(base.slice(hashPos)) ? base.slice(hashPos).length : 1;
282
- let pathFromHash = hash.slice(slicePos);
283
- if (pathFromHash[0] !== "/") pathFromHash = "/" + pathFromHash;
284
- return stripBase(pathFromHash, "");
285
- }
286
- return stripBase(pathname, base) + search + hash;
287
- }
288
- function useHistoryListeners(base, historyState, currentLocation, replace) {
289
- let listeners = [];
290
- let teardowns = [];
291
- let pauseState = null;
292
- const popStateHandler = ({ state }) => {
293
- const to = createCurrentLocation(base, location);
294
- const from = currentLocation.value;
295
- const fromState = historyState.value;
296
- let delta = 0;
297
- if (state) {
298
- currentLocation.value = to;
299
- historyState.value = state;
300
- if (pauseState && pauseState === from) {
301
- pauseState = null;
302
- return;
303
- }
304
- delta = fromState ? state.position - fromState.position : 0;
305
- } else replace(to);
306
- listeners.forEach((listener) => {
307
- listener(currentLocation.value, from, {
308
- delta,
309
- type: NavigationType.pop,
310
- direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
311
- });
312
- });
313
- };
314
- function pauseListeners() {
315
- pauseState = currentLocation.value;
316
- }
317
- function listen(callback) {
318
- listeners.push(callback);
319
- const teardown = () => {
320
- const index = listeners.indexOf(callback);
321
- if (index > -1) listeners.splice(index, 1);
322
- };
323
- teardowns.push(teardown);
324
- return teardown;
325
- }
326
- function beforeUnloadListener() {
327
- const { history } = window;
328
- if (!history.state) return;
329
- history.replaceState(assign({}, history.state, { scroll: computeScrollPosition() }), "");
330
- }
331
- function destroy() {
332
- for (const teardown of teardowns) teardown();
333
- teardowns = [];
334
- window.removeEventListener("popstate", popStateHandler);
335
- window.removeEventListener("beforeunload", beforeUnloadListener);
336
- }
337
- window.addEventListener("popstate", popStateHandler);
338
- window.addEventListener("beforeunload", beforeUnloadListener, { passive: true });
339
- return {
340
- pauseListeners,
341
- listen,
342
- destroy
343
- };
344
- }
345
- /**
346
- * Creates a state object
347
- */
348
- function buildState(back, current, forward, replaced = false, computeScroll = false) {
349
- return {
350
- back,
351
- current,
352
- forward,
353
- replaced,
354
- position: window.history.length,
355
- scroll: computeScroll ? computeScrollPosition() : null
356
- };
357
- }
358
- function useHistoryStateNavigation(base) {
359
- const { history, location } = window;
360
- const currentLocation = { value: createCurrentLocation(base, location) };
361
- const historyState = { value: history.state };
362
- if (!historyState.value) changeLocation(currentLocation.value, {
363
- back: null,
364
- current: currentLocation.value,
365
- forward: null,
366
- position: history.length - 1,
367
- replaced: true,
368
- scroll: null
369
- }, true);
370
- function changeLocation(to, state, replace) {
371
- /**
372
- * if a base tag is provided, and we are on a normal domain, we have to
373
- * respect the provided `base` attribute because pushState() will use it and
374
- * potentially erase anything before the `#` like at
375
- * https://github.com/vuejs/router/issues/685 where a base of
376
- * `/folder/#` but a base of `/` would erase the `/folder/` section. If
377
- * there is no host, the `<base>` tag makes no sense and if there isn't a
378
- * base tag we can just use everything after the `#`.
379
- */
380
- const hashIndex = base.indexOf("#");
381
- const url = hashIndex > -1 ? (location.host && document.querySelector("base") ? base : base.slice(hashIndex)) + to : createBaseLocation() + base + to;
382
- try {
383
- history[replace ? "replaceState" : "pushState"](state, "", url);
384
- historyState.value = state;
385
- } catch (err) {
386
- console.error(err);
387
- location[replace ? "replace" : "assign"](url);
388
- }
389
- }
390
- function replace(to, data) {
391
- changeLocation(to, assign({}, history.state, buildState(historyState.value.back, to, historyState.value.forward, true), data, { position: historyState.value.position }), true);
392
- currentLocation.value = to;
393
- }
394
- function push(to, data) {
395
- const currentState = assign({}, historyState.value, history.state, {
396
- forward: to,
397
- scroll: computeScrollPosition()
398
- });
399
- changeLocation(currentState.current, currentState, true);
400
- changeLocation(to, assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data), false);
401
- currentLocation.value = to;
402
- }
403
- return {
404
- location: currentLocation,
405
- state: historyState,
406
- push,
407
- replace
408
- };
409
- }
410
- /**
411
- * Creates an HTML5 history. Most common history for single page applications.
412
- *
413
- * @param base -
414
- */
415
- function createWebHistory(base) {
416
- base = normalizeBase(base);
417
- const historyNavigation = useHistoryStateNavigation(base);
418
- const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
419
- function go(delta, triggerListeners = true) {
420
- if (!triggerListeners) historyListeners.pauseListeners();
421
- history.go(delta);
422
- }
423
- const routerHistory = assign({
424
- location: "",
425
- base,
426
- go,
427
- createHref: createHref.bind(null, base)
428
- }, historyNavigation, historyListeners);
429
- Object.defineProperty(routerHistory, "location", {
430
- enumerable: true,
431
- get: () => historyNavigation.location.value
432
- });
433
- Object.defineProperty(routerHistory, "state", {
434
- enumerable: true,
435
- get: () => historyNavigation.state.value
436
- });
437
- return routerHistory;
438
- }
439
- /**
440
- * Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
441
- * handle any URL is not possible.
442
- *
443
- * @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `<base>` tag
444
- * in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
445
- * calls**, meaning that if you use a `<base>` tag, it's `href` value **has to match this parameter** (ignoring anything
446
- * after the `#`).
447
- *
448
- * @example
449
- * ```js
450
- * // at https://example.com/folder
451
- * createWebHashHistory() // gives a url of `https://example.com/folder#`
452
- * createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
453
- * // if the `#` is provided in the base, it won't be added by `createWebHashHistory`
454
- * createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
455
- * // you should avoid doing this because it changes the original url and breaks copying urls
456
- * createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
457
- *
458
- * // at file:///usr/etc/folder/index.html
459
- * // for locations with no `host`, the base is ignored
460
- * createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
461
- * ```
462
- */
463
- function createWebHashHistory(base) {
464
- base = location.host ? base || location.pathname + location.search : "";
465
- if (!base.includes("#")) base += "#";
466
- return createWebHistory(base);
467
- }
468
- function isRouteLocation(route) {
469
- return typeof route === "string" || route && typeof route === "object";
470
- }
471
- function isRouteName(name) {
472
- return typeof name === "string" || typeof name === "symbol";
473
- }
474
- /**
475
- * Creates a typed NavigationFailure object.
476
- * @internal
477
- * @param type - NavigationFailureType
478
- * @param params - { from, to }
479
- */
480
- function createRouterError(type, params) {
481
- return assign(/* @__PURE__ */ new Error(), {
482
- type,
483
- [NavigationFailureSymbol]: true
484
- }, params);
485
- }
486
- function isNavigationFailure(error, type) {
487
- return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
488
- }
489
- /**
490
- * Creates a path parser from an array of Segments (a segment is an array of Tokens)
491
- *
492
- * @param segments - array of segments returned by tokenizePath
493
- * @param extraOptions - optional options for the regexp
494
- * @returns a PathParser
495
- */
496
- function tokensToParser(segments, extraOptions) {
497
- const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
498
- const score = [];
499
- let pattern = options.start ? "^" : "";
500
- const keys = [];
501
- for (const segment of segments) {
502
- const segmentScores = segment.length ? [] : [90];
503
- if (options.strict && !segment.length) pattern += "/";
504
- for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
505
- const token = segment[tokenIndex];
506
- let subSegmentScore = 40 + (options.sensitive ? .25 : 0);
507
- if (token.type === 0) {
508
- if (!tokenIndex) pattern += "/";
509
- pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
510
- subSegmentScore += 40;
511
- } else if (token.type === 1) {
512
- const { value, repeatable, optional, regexp } = token;
513
- keys.push({
514
- name: value,
515
- repeatable,
516
- optional
517
- });
518
- const re = regexp ? regexp : BASE_PARAM_PATTERN;
519
- if (re !== BASE_PARAM_PATTERN) {
520
- subSegmentScore += 10;
521
- try {
522
- new RegExp(`(${re})`);
523
- } catch (err) {
524
- throw new Error(`Invalid custom RegExp for param "${value}" (${re}): ` + err.message);
525
- }
526
- }
527
- let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;
528
- if (!tokenIndex) subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
529
- if (optional) subPattern += "?";
530
- pattern += subPattern;
531
- subSegmentScore += 20;
532
- if (optional) subSegmentScore += -8;
533
- if (repeatable) subSegmentScore += -20;
534
- if (re === ".*") subSegmentScore += -50;
535
- }
536
- segmentScores.push(subSegmentScore);
537
- }
538
- score.push(segmentScores);
539
- }
540
- if (options.strict && options.end) {
541
- const i = score.length - 1;
542
- score[i][score[i].length - 1] += .7000000000000001;
543
- }
544
- if (!options.strict) pattern += "/?";
545
- if (options.end) pattern += "$";
546
- else if (options.strict) pattern += "(?:/|$)";
547
- const re = new RegExp(pattern, options.sensitive ? "" : "i");
548
- function parse(path) {
549
- const match = path.match(re);
550
- const params = {};
551
- if (!match) return null;
552
- for (let i = 1; i < match.length; i++) {
553
- const value = match[i] || "";
554
- const key = keys[i - 1];
555
- params[key.name] = value && key.repeatable ? value.split("/") : value;
556
- }
557
- return params;
558
- }
559
- function stringify(params) {
560
- let path = "";
561
- let avoidDuplicatedSlash = false;
562
- for (const segment of segments) {
563
- if (!avoidDuplicatedSlash || !path.endsWith("/")) path += "/";
564
- avoidDuplicatedSlash = false;
565
- for (const token of segment) if (token.type === 0) path += token.value;
566
- else if (token.type === 1) {
567
- const { value, repeatable, optional } = token;
568
- const param = value in params ? params[value] : "";
569
- if (isArray(param) && !repeatable) throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
570
- const text = isArray(param) ? param.join("/") : param;
571
- if (!text) if (optional) {
572
- if (segment.length < 2) if (path.endsWith("/")) path = path.slice(0, -1);
573
- else avoidDuplicatedSlash = true;
574
- } else throw new Error(`Missing required param "${value}"`);
575
- path += text;
576
- }
577
- }
578
- return path || "/";
579
- }
580
- return {
581
- re,
582
- score,
583
- keys,
584
- parse,
585
- stringify
586
- };
587
- }
588
- /**
589
- * Compares an array of numbers as used in PathParser.score and returns a
590
- * number. This function can be used to `sort` an array
591
- *
592
- * @param a - first array of numbers
593
- * @param b - second array of numbers
594
- * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
595
- * should be sorted first
596
- */
597
- function compareScoreArray(a, b) {
598
- let i = 0;
599
- while (i < a.length && i < b.length) {
600
- const diff = b[i] - a[i];
601
- if (diff) return diff;
602
- i++;
603
- }
604
- if (a.length < b.length) return a.length === 1 && a[0] === 80 ? -1 : 1;
605
- else if (a.length > b.length) return b.length === 1 && b[0] === 80 ? 1 : -1;
606
- return 0;
607
- }
608
- /**
609
- * Compare function that can be used with `sort` to sort an array of PathParser
610
- *
611
- * @param a - first PathParser
612
- * @param b - second PathParser
613
- * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
614
- */
615
- function comparePathParserScore(a, b) {
616
- let i = 0;
617
- const aScore = a.score;
618
- const bScore = b.score;
619
- while (i < aScore.length && i < bScore.length) {
620
- const comp = compareScoreArray(aScore[i], bScore[i]);
621
- if (comp) return comp;
622
- i++;
623
- }
624
- if (Math.abs(bScore.length - aScore.length) === 1) {
625
- if (isLastScoreNegative(aScore)) return 1;
626
- if (isLastScoreNegative(bScore)) return -1;
627
- }
628
- return bScore.length - aScore.length;
629
- }
630
- /**
631
- * This allows detecting splats at the end of a path: /home/:id(.*)*
632
- *
633
- * @param score - score to check
634
- * @returns true if the last entry is negative
635
- */
636
- function isLastScoreNegative(score) {
637
- const last = score[score.length - 1];
638
- return score.length > 0 && last[last.length - 1] < 0;
639
- }
640
- function tokenizePath(path) {
641
- if (!path) return [[]];
642
- if (path === "/") return [[ROOT_TOKEN]];
643
- if (!path.startsWith("/")) throw new Error(`Invalid path "${path}"`);
644
- function crash(message) {
645
- throw new Error(`ERR (${state})/"${buffer}": ${message}`);
646
- }
647
- let state = 0;
648
- let previousState = state;
649
- const tokens = [];
650
- let segment;
651
- function finalizeSegment() {
652
- if (segment) tokens.push(segment);
653
- segment = [];
654
- }
655
- let i = 0;
656
- let char;
657
- let buffer = "";
658
- let customRe = "";
659
- function consumeBuffer() {
660
- if (!buffer) return;
661
- if (state === 0) segment.push({
662
- type: 0,
663
- value: buffer
664
- });
665
- else if (state === 1 || state === 2 || state === 3) {
666
- if (segment.length > 1 && (char === "*" || char === "+")) crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
667
- segment.push({
668
- type: 1,
669
- value: buffer,
670
- regexp: customRe,
671
- repeatable: char === "*" || char === "+",
672
- optional: char === "*" || char === "?"
673
- });
674
- } else crash("Invalid state to consume buffer");
675
- buffer = "";
676
- }
677
- function addCharToBuffer() {
678
- buffer += char;
679
- }
680
- while (i < path.length) {
681
- char = path[i++];
682
- if (char === "\\" && state !== 2) {
683
- previousState = state;
684
- state = 4;
685
- continue;
686
- }
687
- switch (state) {
688
- case 0:
689
- if (char === "/") {
690
- if (buffer) consumeBuffer();
691
- finalizeSegment();
692
- } else if (char === ":") {
693
- consumeBuffer();
694
- state = 1;
695
- } else addCharToBuffer();
696
- break;
697
- case 4:
698
- addCharToBuffer();
699
- state = previousState;
700
- break;
701
- case 1:
702
- if (char === "(") state = 2;
703
- else if (VALID_PARAM_RE.test(char)) addCharToBuffer();
704
- else {
705
- consumeBuffer();
706
- state = 0;
707
- if (char !== "*" && char !== "?" && char !== "+") i--;
708
- }
709
- break;
710
- case 2:
711
- if (char === ")") if (customRe[customRe.length - 1] == "\\") customRe = customRe.slice(0, -1) + char;
712
- else state = 3;
713
- else customRe += char;
714
- break;
715
- case 3:
716
- consumeBuffer();
717
- state = 0;
718
- if (char !== "*" && char !== "?" && char !== "+") i--;
719
- customRe = "";
720
- break;
721
- default:
722
- crash("Unknown state");
723
- break;
724
- }
725
- }
726
- if (state === 2) crash(`Unfinished custom RegExp for param "${buffer}"`);
727
- consumeBuffer();
728
- finalizeSegment();
729
- return tokens;
730
- }
731
- function createRouteRecordMatcher(record, parent, options) {
732
- const matcher = assign(tokensToParser(tokenizePath(record.path), options), {
733
- record,
734
- parent,
735
- children: [],
736
- alias: []
737
- });
738
- if (parent) {
739
- if (!matcher.record.aliasOf === !parent.record.aliasOf) parent.children.push(matcher);
740
- }
741
- return matcher;
742
- }
743
- /**
744
- * Creates a Router Matcher.
745
- *
746
- * @internal
747
- * @param routes - array of initial routes
748
- * @param globalOptions - global route options
749
- */
750
- function createRouterMatcher(routes, globalOptions) {
751
- const matchers = [];
752
- const matcherMap = /* @__PURE__ */ new Map();
753
- globalOptions = mergeOptions({
754
- strict: false,
755
- end: true,
756
- sensitive: false
757
- }, globalOptions);
758
- function getRecordMatcher(name) {
759
- return matcherMap.get(name);
760
- }
761
- function addRoute(record, parent, originalRecord) {
762
- const isRootAdd = !originalRecord;
763
- const mainNormalizedRecord = normalizeRouteRecord(record);
764
- mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
765
- const options = mergeOptions(globalOptions, record);
766
- const normalizedRecords = [mainNormalizedRecord];
767
- if ("alias" in record) {
768
- const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
769
- for (const alias of aliases) normalizedRecords.push(normalizeRouteRecord(assign({}, mainNormalizedRecord, {
770
- components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
771
- path: alias,
772
- aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
773
- })));
774
- }
775
- let matcher;
776
- let originalMatcher;
777
- for (const normalizedRecord of normalizedRecords) {
778
- const { path } = normalizedRecord;
779
- if (parent && path[0] !== "/") {
780
- const parentPath = parent.record.path;
781
- const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
782
- normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
783
- }
784
- matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
785
- if (originalRecord) originalRecord.alias.push(matcher);
786
- else {
787
- originalMatcher = originalMatcher || matcher;
788
- if (originalMatcher !== matcher) originalMatcher.alias.push(matcher);
789
- if (isRootAdd && record.name && !isAliasRecord(matcher)) removeRoute(record.name);
790
- }
791
- if (isMatchable(matcher)) insertMatcher(matcher);
792
- if (mainNormalizedRecord.children) {
793
- const children = mainNormalizedRecord.children;
794
- for (let i = 0; i < children.length; i++) addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
795
- }
796
- originalRecord = originalRecord || matcher;
797
- }
798
- return originalMatcher ? () => {
799
- removeRoute(originalMatcher);
800
- } : noop;
801
- }
802
- function removeRoute(matcherRef) {
803
- if (isRouteName(matcherRef)) {
804
- const matcher = matcherMap.get(matcherRef);
805
- if (matcher) {
806
- matcherMap.delete(matcherRef);
807
- matchers.splice(matchers.indexOf(matcher), 1);
808
- matcher.children.forEach(removeRoute);
809
- matcher.alias.forEach(removeRoute);
810
- }
811
- } else {
812
- const index = matchers.indexOf(matcherRef);
813
- if (index > -1) {
814
- matchers.splice(index, 1);
815
- if (matcherRef.record.name) matcherMap.delete(matcherRef.record.name);
816
- matcherRef.children.forEach(removeRoute);
817
- matcherRef.alias.forEach(removeRoute);
818
- }
819
- }
820
- }
821
- function getRoutes() {
822
- return matchers;
823
- }
824
- function insertMatcher(matcher) {
825
- const index = findInsertionIndex(matcher, matchers);
826
- matchers.splice(index, 0, matcher);
827
- if (matcher.record.name && !isAliasRecord(matcher)) matcherMap.set(matcher.record.name, matcher);
828
- }
829
- function resolve(location, currentLocation) {
830
- let matcher;
831
- let params = {};
832
- let path;
833
- let name;
834
- if ("name" in location && location.name) {
835
- matcher = matcherMap.get(location.name);
836
- if (!matcher) return resolve({ path: "/404" }, currentLocation);
837
- if (!matcher) throw createRouterError(1, { location });
838
- name = matcher.record.name;
839
- params = assign(paramsFromLocation(currentLocation.params, matcher.keys.filter((k) => !k.optional).concat(matcher.parent ? matcher.parent.keys.filter((k) => k.optional) : []).map((k) => k.name)), location.params && paramsFromLocation(location.params, matcher.keys.map((k) => k.name)));
840
- path = matcher.stringify(params);
841
- } else if (location.path != null) {
842
- path = location.path;
843
- matcher = matchers.find((m) => m.re.test(path));
844
- if (matcher) {
845
- params = matcher.parse(path);
846
- name = matcher.record.name;
847
- }
848
- } else {
849
- matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path));
850
- if (!matcher) throw createRouterError(1, {
851
- location,
852
- currentLocation
853
- });
854
- name = matcher.record.name;
855
- params = assign({}, currentLocation.params, location.params);
856
- path = matcher.stringify(params);
857
- }
858
- const matched = [];
859
- let parentMatcher = matcher;
860
- while (parentMatcher) {
861
- matched.unshift(parentMatcher.record);
862
- parentMatcher = parentMatcher.parent;
863
- }
864
- return {
865
- name,
866
- path,
867
- params,
868
- matched,
869
- meta: mergeMetaFields(matched)
870
- };
871
- }
872
- routes.forEach((route) => addRoute(route));
873
- function clearRoutes() {
874
- matchers.length = 0;
875
- matcherMap.clear();
876
- }
877
- return {
878
- addRoute,
879
- resolve,
880
- removeRoute,
881
- clearRoutes,
882
- getRoutes,
883
- getRecordMatcher
884
- };
885
- }
886
- function paramsFromLocation(params, keys) {
887
- const newParams = {};
888
- for (const key of keys) if (key in params) newParams[key] = params[key];
889
- return newParams;
890
- }
891
- /**
892
- * Normalizes a RouteRecordRaw. Creates a copy
893
- *
894
- * @param record
895
- * @returns the normalized version
896
- */
897
- function normalizeRouteRecord(record) {
898
- const normalized = {
899
- path: record.path,
900
- redirect: record.redirect,
901
- name: record.name,
902
- meta: record.meta || {},
903
- aliasOf: record.aliasOf,
904
- beforeEnter: record.beforeEnter,
905
- props: normalizeRecordProps(record),
906
- children: record.children || [],
907
- instances: {},
908
- leaveGuards: /* @__PURE__ */ new Set(),
909
- updateGuards: /* @__PURE__ */ new Set(),
910
- enterCallbacks: {},
911
- components: "components" in record ? record.components || null : record.component && { default: record.component }
912
- };
913
- Object.defineProperty(normalized, "mods", { value: {} });
914
- return normalized;
915
- }
916
- /**
917
- * Normalize the optional `props` in a record to always be an object similar to
918
- * components. Also accept a boolean for components.
919
- * @param record
920
- */
921
- function normalizeRecordProps(record) {
922
- const propsObject = {};
923
- const props = record.props || false;
924
- if ("component" in record) propsObject.default = props;
925
- else for (const name in record.components) propsObject[name] = typeof props === "object" ? props[name] : props;
926
- return propsObject;
927
- }
928
- /**
929
- * Checks if a record or any of its parent is an alias
930
- * @param record
931
- */
932
- function isAliasRecord(record) {
933
- while (record) {
934
- if (record.record.aliasOf) return true;
935
- record = record.parent;
936
- }
937
- return false;
938
- }
939
- /**
940
- * Merge meta fields of an array of records
941
- *
942
- * @param matched - array of matched records
943
- */
944
- function mergeMetaFields(matched) {
945
- return matched.reduce((meta, record) => assign(meta, record.meta), {});
946
- }
947
- function mergeOptions(defaults, partialOptions) {
948
- const options = {};
949
- for (const key in defaults) options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
950
- return options;
951
- }
952
- /**
953
- * Performs a binary search to find the correct insertion index for a new matcher.
954
- *
955
- * Matchers are primarily sorted by their score. If scores are tied then we also consider parent/child relationships,
956
- * with descendants coming before ancestors. If there's still a tie, new routes are inserted after existing routes.
957
- *
958
- * @param matcher - new matcher to be inserted
959
- * @param matchers - existing matchers
960
- */
961
- function findInsertionIndex(matcher, matchers) {
962
- let lower = 0;
963
- let upper = matchers.length;
964
- while (lower !== upper) {
965
- const mid = lower + upper >> 1;
966
- if (comparePathParserScore(matcher, matchers[mid]) < 0) upper = mid;
967
- else lower = mid + 1;
968
- }
969
- const insertionAncestor = getInsertionAncestor(matcher);
970
- if (insertionAncestor) upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
971
- return upper;
972
- }
973
- function getInsertionAncestor(matcher) {
974
- let ancestor = matcher;
975
- while (ancestor = ancestor.parent) if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) return ancestor;
976
- }
977
- /**
978
- * Checks if a matcher can be reachable. This means if it's possible to reach it as a route. For example, routes without
979
- * a component, or name, or redirect, are just used to group other routes.
980
- * @param matcher
981
- * @param matcher.record record of the matcher
982
- * @returns
983
- */
984
- function isMatchable({ record }) {
985
- return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
986
- }
987
- /**
988
- * Transforms a queryString into a {@link LocationQuery} object. Accept both, a
989
- * version with the leading `?` and without Should work as URLSearchParams
990
-
991
- * @internal
992
- *
993
- * @param search - search string to parse
994
- * @returns a query object
995
- */
996
- function parseQuery(search) {
997
- const query = {};
998
- if (search === "" || search === "?") return query;
999
- const searchParams = (search[0] === "?" ? search.slice(1) : search).split("&");
1000
- for (let i = 0; i < searchParams.length; ++i) {
1001
- const searchParam = searchParams[i].replace(PLUS_RE, " ");
1002
- const eqPos = searchParam.indexOf("=");
1003
- const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
1004
- const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
1005
- if (key in query) {
1006
- let currentValue = query[key];
1007
- if (!isArray(currentValue)) currentValue = query[key] = [currentValue];
1008
- currentValue.push(value);
1009
- } else query[key] = value;
1010
- }
1011
- return query;
1012
- }
1013
- /**
1014
- * Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it
1015
- * doesn't prepend a `?`
1016
- *
1017
- * @internal
1018
- *
1019
- * @param query - query object to stringify
1020
- * @returns string version of the query without the leading `?`
1021
- */
1022
- function stringifyQuery(query) {
1023
- let search = "";
1024
- for (let key in query) {
1025
- const value = query[key];
1026
- key = encodeQueryKey(key);
1027
- if (value == null) {
1028
- if (value !== void 0) search += (search.length ? "&" : "") + key;
1029
- continue;
1030
- }
1031
- (isArray(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)]).forEach((value) => {
1032
- if (value !== void 0) {
1033
- search += (search.length ? "&" : "") + key;
1034
- if (value != null) search += "=" + value;
1035
- }
1036
- });
1037
- }
1038
- return search;
1039
- }
1040
- /**
1041
- * Transforms a {@link LocationQueryRaw} into a {@link LocationQuery} by casting
1042
- * numbers into strings, removing keys with an undefined value and replacing
1043
- * undefined with null in arrays
1044
- *
1045
- * @param query - query object to normalize
1046
- * @returns a normalized query object
1047
- */
1048
- function normalizeQuery(query) {
1049
- const normalizedQuery = {};
1050
- for (const key in query) {
1051
- const value = query[key];
1052
- if (value !== void 0) normalizedQuery[key] = isArray(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
1053
- }
1054
- return normalizedQuery;
1055
- }
1056
- /**
1057
- * Create a list of callbacks that can be reset. Used to create before and after navigation guards list
1058
- */
1059
- function useCallbacks() {
1060
- let handlers = [];
1061
- function add(handler) {
1062
- handlers.push(handler);
1063
- return () => {
1064
- const i = handlers.indexOf(handler);
1065
- if (i > -1) handlers.splice(i, 1);
1066
- };
1067
- }
1068
- function reset() {
1069
- handlers = [];
1070
- }
1071
- return {
1072
- add,
1073
- list: () => handlers.slice(),
1074
- reset
1075
- };
1076
- }
1077
- function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
1078
- const enterCallbackArray = record && (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
1079
- return () => new Promise((resolve, reject) => {
1080
- const next = (valid) => {
1081
- if (valid === false) reject(createRouterError(4, {
1082
- from,
1083
- to
1084
- }));
1085
- else if (valid instanceof Error) reject(valid);
1086
- else if (isRouteLocation(valid)) reject(createRouterError(2, {
1087
- from: to,
1088
- to: valid
1089
- }));
1090
- else {
1091
- if (enterCallbackArray && record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") enterCallbackArray.push(valid);
1092
- resolve();
1093
- }
1094
- };
1095
- const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
1096
- let guardCall = Promise.resolve(guardReturn);
1097
- if (guard.length < 3) guardCall = guardCall.then(next);
1098
- guardCall.catch((err) => reject(err));
1099
- });
1100
- }
1101
- function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
1102
- const guards = [];
1103
- for (const record of matched) for (const name in record.components) {
1104
- let rawComponent = record.components[name];
1105
- if (guardType !== "beforeRouteEnter" && !record.instances[name]) continue;
1106
- if (isRouteComponent(rawComponent)) {
1107
- const guard = (rawComponent.__vccOpts || rawComponent)[guardType];
1108
- guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
1109
- } else {
1110
- let componentPromise = rawComponent();
1111
- guards.push(() => componentPromise.then((resolved) => {
1112
- if (!resolved) throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
1113
- const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
1114
- record.mods[name] = resolved;
1115
- record.components[name] = resolvedComponent;
1116
- const guard = (resolvedComponent.__vccOpts || resolvedComponent)[guardType];
1117
- return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
1118
- }));
1119
- }
1120
- }
1121
- return guards;
1122
- }
1123
- /**
1124
- * Returns the internal behavior of a {@link RouterLink} without the rendering part.
1125
- *
1126
- * @param props - a `to` location and an optional `replace` flag
1127
- */
1128
- function useLink(props) {
1129
- const router = inject(routerKey);
1130
- const currentRoute = inject(routeLocationKey);
1131
- const route = computed(() => {
1132
- const to = unref(props.to);
1133
- return router.resolve(to);
1134
- });
1135
- const activeRecordIndex = computed(() => {
1136
- const { matched } = route.value;
1137
- const { length } = matched;
1138
- const routeMatched = matched[length - 1];
1139
- const currentMatched = currentRoute.matched;
1140
- if (!routeMatched || !currentMatched.length) return -1;
1141
- const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
1142
- if (index > -1) return index;
1143
- const parentRecordPath = getOriginalPath(matched[length - 2]);
1144
- return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
1145
- });
1146
- const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
1147
- const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
1148
- function navigate(e = {}) {
1149
- if (guardEvent(e)) return router[unref(props.replace) ? "replace" : "push"](unref(props.to)).catch(noop);
1150
- return Promise.resolve();
1151
- }
1152
- /**
1153
- * NOTE: update {@link _RouterLinkI}'s `$slots` type when updating this
1154
- */
1155
- return {
1156
- route,
1157
- href: computed(() => route.value.href),
1158
- isActive,
1159
- isExactActive,
1160
- navigate
1161
- };
1162
- }
1163
- function guardEvent(e) {
1164
- if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
1165
- if (e.defaultPrevented) return;
1166
- if (e.button !== void 0 && e.button !== 0) return;
1167
- if (e.currentTarget && e.currentTarget.getAttribute) {
1168
- const target = e.currentTarget.getAttribute("target");
1169
- if (/\b_blank\b/i.test(target)) return;
1170
- }
1171
- if (e.preventDefault) e.preventDefault();
1172
- return true;
1173
- }
1174
- function includesParams(outer, inner) {
1175
- for (const key in inner) {
1176
- const innerValue = inner[key];
1177
- const outerValue = outer[key];
1178
- if (typeof innerValue === "string") {
1179
- if (innerValue !== outerValue) return false;
1180
- } else if (!isArray(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value !== outerValue[i])) return false;
1181
- }
1182
- return true;
1183
- }
1184
- /**
1185
- * Get the original path value of a record by following its aliasOf
1186
- * @param record
1187
- */
1188
- function getOriginalPath(record) {
1189
- return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
1190
- }
1191
- function normalizeSlot(slot, data) {
1192
- if (!slot) return null;
1193
- const slotContent = slot(data);
1194
- return slotContent.length === 1 ? slotContent[0] : slotContent;
1195
- }
1196
- /**
1197
- * Creates a Router instance that can be used by a Vue app.
1198
- *
1199
- * @param options - {@link RouterOptions}
1200
- */
1201
- function createRouter(options) {
1202
- var _options$matcher;
1203
- const matcher = (_options$matcher = options.matcher) !== null && _options$matcher !== void 0 ? _options$matcher : createRouterMatcher(options.routes, options);
1204
- const parseQuery$1 = options.parseQuery || parseQuery;
1205
- const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
1206
- const routerHistory = options.history;
1207
- const beforeGuards = useCallbacks();
1208
- const beforeResolveGuards = useCallbacks();
1209
- const afterGuards = useCallbacks();
1210
- const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
1211
- let pendingLocation = START_LOCATION_NORMALIZED;
1212
- if (isBrowser && options.scrollBehavior && "scrollRestoration" in history) history.scrollRestoration = "manual";
1213
- const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
1214
- const encodeParams = applyToParams.bind(null, encodeParam);
1215
- const decodeParams = applyToParams.bind(null, decode);
1216
- function addRoute(parentOrRoute, route) {
1217
- let parent;
1218
- let record;
1219
- if (isRouteName(parentOrRoute)) {
1220
- parent = matcher.getRecordMatcher(parentOrRoute);
1221
- record = route;
1222
- } else record = parentOrRoute;
1223
- return matcher.addRoute(record, parent);
1224
- }
1225
- function removeRoute(name) {
1226
- const recordMatcher = matcher.getRecordMatcher(name);
1227
- if (recordMatcher) matcher.removeRoute(recordMatcher);
1228
- }
1229
- function getRoutes() {
1230
- return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
1231
- }
1232
- function hasRoute(name) {
1233
- return !!matcher.getRecordMatcher(name);
1234
- }
1235
- function resolve(rawLocation, currentLocation) {
1236
- currentLocation = assign({}, currentLocation || currentRoute.value);
1237
- if (typeof rawLocation === "string") {
1238
- const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
1239
- const matchedRoute = matcher.resolve({ path: locationNormalized.path }, currentLocation);
1240
- const href = routerHistory.createHref(locationNormalized.fullPath);
1241
- return assign(locationNormalized, matchedRoute, {
1242
- params: decodeParams(matchedRoute.params),
1243
- hash: decode(locationNormalized.hash),
1244
- redirectedFrom: void 0,
1245
- href
1246
- });
1247
- }
1248
- let matcherLocation;
1249
- if (rawLocation.path != null) matcherLocation = assign({}, rawLocation, { path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path });
1250
- else {
1251
- const targetParams = assign({}, rawLocation.params);
1252
- for (const key in targetParams) if (targetParams[key] == null) delete targetParams[key];
1253
- matcherLocation = assign({}, rawLocation, { params: encodeParams(targetParams) });
1254
- currentLocation.params = encodeParams(currentLocation.params);
1255
- }
1256
- const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
1257
- const hash = rawLocation.hash || "";
1258
- matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
1259
- const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
1260
- hash: encodeHash(hash),
1261
- path: matchedRoute.path
1262
- }));
1263
- const href = routerHistory.createHref(fullPath);
1264
- return assign({
1265
- fullPath,
1266
- hash,
1267
- query: stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
1268
- }, matchedRoute, {
1269
- redirectedFrom: void 0,
1270
- href
1271
- });
1272
- }
1273
- function locationAsObject(to) {
1274
- return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign({}, to);
1275
- }
1276
- function checkCanceledNavigation(to, from) {
1277
- if (pendingLocation !== to) return createRouterError(8, {
1278
- from,
1279
- to
1280
- });
1281
- }
1282
- function push(to) {
1283
- return pushWithRedirect(to);
1284
- }
1285
- function replace(to) {
1286
- return push(assign(locationAsObject(to), { replace: true }));
1287
- }
1288
- function handleRedirectRecord(to) {
1289
- const lastMatched = to.matched[to.matched.length - 1];
1290
- if (lastMatched && lastMatched.redirect) {
1291
- const { redirect } = lastMatched;
1292
- let newTargetLocation = typeof redirect === "function" ? redirect(to) : redirect;
1293
- if (typeof newTargetLocation === "string") {
1294
- newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
1295
- newTargetLocation.params = {};
1296
- }
1297
- return assign({
1298
- query: to.query,
1299
- hash: to.hash,
1300
- params: newTargetLocation.path != null ? {} : to.params
1301
- }, newTargetLocation);
1302
- }
1303
- }
1304
- function pushWithRedirect(_x, _x2) {
1305
- return _pushWithRedirect.apply(this, arguments);
1306
- }
1307
- function _pushWithRedirect() {
1308
- _pushWithRedirect = _asyncToGenerator(function* (to, redirectedFrom) {
1309
- var _to$name;
1310
- const _path = to && typeof to === "object" ? (_to$name = to.name) !== null && _to$name !== void 0 ? _to$name : to.path : to;
1311
- yield installedApps.values().next().value.zova.meta.$router.ensureRoute(_path);
1312
- const targetLocation = pendingLocation = resolve(to);
1313
- const from = currentRoute.value;
1314
- const data = to.state;
1315
- const force = to.force;
1316
- const replace = to.replace === true;
1317
- const shouldRedirect = handleRedirectRecord(targetLocation);
1318
- if (shouldRedirect) return pushWithRedirect(assign(locationAsObject(shouldRedirect), {
1319
- state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
1320
- force,
1321
- replace
1322
- }), redirectedFrom || targetLocation);
1323
- const toLocation = targetLocation;
1324
- toLocation.redirectedFrom = redirectedFrom;
1325
- let failure;
1326
- if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
1327
- failure = createRouterError(16, {
1328
- to: toLocation,
1329
- from
1330
- });
1331
- handleScroll(from, from, true, false);
1332
- }
1333
- return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, 2) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure) => {
1334
- if (failure) {
1335
- if (isNavigationFailure(failure, 2)) return pushWithRedirect(assign({ replace }, locationAsObject(failure.to), {
1336
- state: typeof failure.to === "object" ? assign({}, data, failure.to.state) : data,
1337
- force
1338
- }), redirectedFrom || toLocation);
1339
- } else failure = finalizeNavigation(toLocation, from, true, replace, data);
1340
- const info = {
1341
- type: NavigationType.push,
1342
- replace
1343
- };
1344
- triggerAfterEach(toLocation, from, failure, info);
1345
- return failure;
1346
- });
1347
- });
1348
- return _pushWithRedirect.apply(this, arguments);
1349
- }
1350
- /**
1351
- * Helper to reject and skip all navigation guards if a new navigation happened
1352
- * @param to
1353
- * @param from
1354
- */
1355
- function checkCanceledNavigationAndReject(to, from) {
1356
- const error = checkCanceledNavigation(to, from);
1357
- return error ? Promise.reject(error) : Promise.resolve();
1358
- }
1359
- function runWithContext(fn) {
1360
- const app = installedApps.values().next().value;
1361
- return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
1362
- }
1363
- function navigate(to, from) {
1364
- let guards;
1365
- const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
1366
- guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
1367
- for (const record of leavingRecords) record.leaveGuards.forEach((guard) => {
1368
- guards.push(guardToPromiseFn(guard, to, from));
1369
- });
1370
- const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
1371
- guards.push(canceledNavigationCheck);
1372
- return runGuardQueue(guards).then(() => {
1373
- guards = [];
1374
- for (const guard of beforeGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
1375
- guards.push(canceledNavigationCheck);
1376
- return runGuardQueue(guards);
1377
- }).then(() => {
1378
- guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
1379
- for (const record of updatingRecords) record.updateGuards.forEach((guard) => {
1380
- guards.push(guardToPromiseFn(guard, to, from));
1381
- });
1382
- guards.push(canceledNavigationCheck);
1383
- return runGuardQueue(guards);
1384
- }).then(() => {
1385
- guards = [];
1386
- for (const record of enteringRecords) if (record.beforeEnter) if (isArray(record.beforeEnter)) for (const beforeEnter of record.beforeEnter) guards.push(guardToPromiseFn(beforeEnter, to, from));
1387
- else guards.push(guardToPromiseFn(record.beforeEnter, to, from));
1388
- guards.push(canceledNavigationCheck);
1389
- return runGuardQueue(guards);
1390
- }).then(() => {
1391
- to.matched.forEach((record) => record.enterCallbacks = {});
1392
- guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
1393
- guards.push(canceledNavigationCheck);
1394
- return runGuardQueue(guards);
1395
- }).then(() => {
1396
- guards = [];
1397
- for (const guard of beforeResolveGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
1398
- guards.push(canceledNavigationCheck);
1399
- return runGuardQueue(guards);
1400
- }).catch((err) => isNavigationFailure(err, 8) ? err : Promise.reject(err));
1401
- }
1402
- function triggerAfterEach(to, from, failure, info) {
1403
- afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure, info)));
1404
- }
1405
- /**
1406
- * - Cleans up any navigation guards
1407
- * - Changes the url if necessary
1408
- * - Calls the scrollBehavior
1409
- */
1410
- function finalizeNavigation(toLocation, from, isPush, replace, data) {
1411
- const error = checkCanceledNavigation(toLocation, from);
1412
- if (error) return error;
1413
- const isFirstNavigation = from === START_LOCATION_NORMALIZED;
1414
- const state = !isBrowser ? {} : history.state;
1415
- if (isPush) if (replace || isFirstNavigation) routerHistory.replace(toLocation.fullPath, assign({ scroll: isFirstNavigation && state && state.scroll }, data));
1416
- else routerHistory.push(toLocation.fullPath, data);
1417
- currentRoute.value = toLocation;
1418
- handleScroll(toLocation, from, isPush, isFirstNavigation);
1419
- markAsReady();
1420
- }
1421
- let removeHistoryListener;
1422
- function setupListeners() {
1423
- if (removeHistoryListener) return;
1424
- removeHistoryListener = routerHistory.listen((to, _from, info) => {
1425
- if (!router.listening) return;
1426
- const toLocation = resolve(to);
1427
- const shouldRedirect = handleRedirectRecord(toLocation);
1428
- if (shouldRedirect) {
1429
- pushWithRedirect(assign(shouldRedirect, { replace: true }), toLocation).catch(noop);
1430
- return;
1431
- }
1432
- pendingLocation = toLocation;
1433
- const from = currentRoute.value;
1434
- if (isBrowser) saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
1435
- navigate(toLocation, from).catch((error) => {
1436
- if (isNavigationFailure(error, 12)) return error;
1437
- if (isNavigationFailure(error, 2)) {
1438
- pushWithRedirect(error.to, toLocation).then((failure) => {
1439
- if (isNavigationFailure(failure, 20) && !info.delta && info.type === NavigationType.pop) routerHistory.go(-1, false);
1440
- }).catch(noop);
1441
- return Promise.reject();
1442
- }
1443
- if (info.delta) routerHistory.go(-info.delta, false);
1444
- return triggerError(error, toLocation, from);
1445
- }).then((failure) => {
1446
- failure = failure || finalizeNavigation(toLocation, from, false);
1447
- if (failure) {
1448
- if (info.delta && !isNavigationFailure(failure, 8)) routerHistory.go(-info.delta, false);
1449
- else if (info.type === NavigationType.pop && isNavigationFailure(failure, 20)) routerHistory.go(-1, false);
1450
- }
1451
- triggerAfterEach(toLocation, from, failure, info);
1452
- }).catch(noop);
1453
- });
1454
- }
1455
- let readyHandlers = useCallbacks();
1456
- let errorListeners = useCallbacks();
1457
- let ready;
1458
- /**
1459
- * Trigger errorListeners added via onError and throws the error as well
1460
- *
1461
- * @param error - error to throw
1462
- * @param to - location we were navigating to when the error happened
1463
- * @param from - location we were navigating from when the error happened
1464
- * @returns the error as a rejected promise
1465
- */
1466
- function triggerError(error, to, from) {
1467
- markAsReady(error);
1468
- const list = errorListeners.list();
1469
- if (list.length) list.forEach((handler) => handler(error, to, from));
1470
- else console.error(error);
1471
- return Promise.reject(error);
1472
- }
1473
- function isReady() {
1474
- if (ready && currentRoute.value !== START_LOCATION_NORMALIZED) return Promise.resolve();
1475
- return new Promise((resolve, reject) => {
1476
- readyHandlers.add([resolve, reject]);
1477
- });
1478
- }
1479
- function markAsReady(err) {
1480
- if (!ready) {
1481
- ready = !err;
1482
- setupListeners();
1483
- readyHandlers.list().forEach(([resolve, reject]) => err ? reject(err) : resolve());
1484
- readyHandlers.reset();
1485
- }
1486
- return err;
1487
- }
1488
- function handleScroll(to, from, isPush, isFirstNavigation) {
1489
- const { scrollBehavior } = options;
1490
- if (!isBrowser || !scrollBehavior) return Promise.resolve();
1491
- const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
1492
- return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
1493
- }
1494
- const go = (delta) => routerHistory.go(delta);
1495
- let started;
1496
- const installedApps = /* @__PURE__ */ new Set();
1497
- const router = {
1498
- matcher,
1499
- currentRoute,
1500
- listening: true,
1501
- addRoute,
1502
- removeRoute,
1503
- clearRoutes: matcher.clearRoutes,
1504
- hasRoute,
1505
- getRoutes,
1506
- resolve,
1507
- options,
1508
- push,
1509
- replace,
1510
- go,
1511
- back: () => go(-1),
1512
- forward: () => go(1),
1513
- beforeEach: beforeGuards.add,
1514
- beforeResolve: beforeResolveGuards.add,
1515
- afterEach: afterGuards.add,
1516
- onError: errorListeners.add,
1517
- isReady,
1518
- install(app) {
1519
- installedApps.add(app);
1520
- const router = this;
1521
- app.component("RouterLink", RouterLink);
1522
- app.component("RouterView", RouterView);
1523
- app.config.globalProperties.$router = router;
1524
- Object.defineProperty(app.config.globalProperties, "$route", {
1525
- enumerable: true,
1526
- get: () => unref(currentRoute)
1527
- });
1528
- if (isBrowser && !started && currentRoute.value === START_LOCATION_NORMALIZED) {
1529
- started = true;
1530
- push(routerHistory.location).catch((err) => {});
1531
- }
1532
- const reactiveRoute = {};
1533
- for (const key in START_LOCATION_NORMALIZED) Object.defineProperty(reactiveRoute, key, {
1534
- get: () => currentRoute.value[key],
1535
- enumerable: true
1536
- });
1537
- app.provide(routerKey, router);
1538
- app.provide(routeLocationKey, shallowReactive(reactiveRoute));
1539
- app.provide(routerViewLocationKey, currentRoute);
1540
- const unmountApp = app.unmount;
1541
- app.unmount = function() {
1542
- installedApps.delete(app);
1543
- if (installedApps.size < 1) {
1544
- pendingLocation = START_LOCATION_NORMALIZED;
1545
- removeHistoryListener && removeHistoryListener();
1546
- removeHistoryListener = null;
1547
- currentRoute.value = START_LOCATION_NORMALIZED;
1548
- started = false;
1549
- ready = false;
1550
- }
1551
- unmountApp();
1552
- };
1553
- }
1554
- };
1555
- function runGuardQueue(guards) {
1556
- return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
1557
- }
1558
- return router;
1559
- }
1560
- function extractChangingRecords(to, from) {
1561
- const leavingRecords = [];
1562
- const updatingRecords = [];
1563
- const enteringRecords = [];
1564
- const len = Math.max(from.matched.length, to.matched.length);
1565
- for (let i = 0; i < len; i++) {
1566
- const recordFrom = from.matched[i];
1567
- if (recordFrom) if (to.matched.find((record) => isSameRouteRecord(record, recordFrom))) updatingRecords.push(recordFrom);
1568
- else leavingRecords.push(recordFrom);
1569
- const recordTo = to.matched[i];
1570
- if (recordTo) {
1571
- if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) enteringRecords.push(recordTo);
1572
- }
1573
- }
1574
- return [
1575
- leavingRecords,
1576
- updatingRecords,
1577
- enteringRecords
1578
- ];
1579
- }
1580
- var isBrowser, assign, noop, isArray, HASH_RE, AMPERSAND_RE, SLASH_RE, EQUAL_RE, IM_RE, PLUS_RE, ENC_BRACKET_OPEN_RE, ENC_BRACKET_CLOSE_RE, ENC_CARET_RE, ENC_BACKTICK_RE, ENC_CURLY_OPEN_RE, ENC_PIPE_RE, ENC_CURLY_CLOSE_RE, ENC_SPACE_RE, TRAILING_SLASH_RE, removeTrailingSlash, START_LOCATION_NORMALIZED, NavigationType, NavigationDirection, BEFORE_HASH_RE, computeScrollPosition, scrollPositions, createBaseLocation, NavigationFailureSymbol, NavigationFailureType, BASE_PARAM_PATTERN, BASE_PATH_PARSER_OPTIONS, REGEX_CHARS_RE, ROOT_TOKEN, VALID_PARAM_RE, matchedRouteKey, viewDepthKey, routerKey, routeLocationKey, routerViewLocationKey, RouterLink, getLinkClass, RouterViewImpl, RouterView;
1581
- var init_vue_router = __esmMin((() => {
1582
- init_vue_runtime_esm_bundler();
1583
- init_asyncToGenerator();
1584
- isBrowser = typeof document !== "undefined";
1585
- assign = Object.assign;
1586
- noop = () => {};
1587
- isArray = Array.isArray;
1588
- HASH_RE = /#/g;
1589
- AMPERSAND_RE = /&/g;
1590
- SLASH_RE = /\//g;
1591
- EQUAL_RE = /=/g;
1592
- IM_RE = /\?/g;
1593
- PLUS_RE = /\+/g;
1594
- ENC_BRACKET_OPEN_RE = /%5B/g;
1595
- ENC_BRACKET_CLOSE_RE = /%5D/g;
1596
- ENC_CARET_RE = /%5E/g;
1597
- ENC_BACKTICK_RE = /%60/g;
1598
- ENC_CURLY_OPEN_RE = /%7B/g;
1599
- ENC_PIPE_RE = /%7C/g;
1600
- ENC_CURLY_CLOSE_RE = /%7D/g;
1601
- ENC_SPACE_RE = /%20/g;
1602
- TRAILING_SLASH_RE = /\/$/;
1603
- removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
1604
- START_LOCATION_NORMALIZED = {
1605
- path: "/",
1606
- name: void 0,
1607
- params: {},
1608
- query: {},
1609
- hash: "",
1610
- fullPath: "/",
1611
- matched: [],
1612
- meta: {},
1613
- redirectedFrom: void 0
1614
- };
1615
- (function(NavigationType) {
1616
- NavigationType["pop"] = "pop";
1617
- NavigationType["push"] = "push";
1618
- })(NavigationType || (NavigationType = {}));
1619
- (function(NavigationDirection) {
1620
- NavigationDirection["back"] = "back";
1621
- NavigationDirection["forward"] = "forward";
1622
- NavigationDirection["unknown"] = "";
1623
- })(NavigationDirection || (NavigationDirection = {}));
1624
- BEFORE_HASH_RE = /^[^#]+#/;
1625
- computeScrollPosition = () => ({
1626
- left: window.scrollX,
1627
- top: window.scrollY
1628
- });
1629
- scrollPositions = /* @__PURE__ */ new Map();
1630
- createBaseLocation = () => location.protocol + "//" + location.host;
1631
- NavigationFailureSymbol = Symbol("");
1632
- (function(NavigationFailureType) {
1633
- /**
1634
- * An aborted navigation is a navigation that failed because a navigation
1635
- * guard returned `false` or called `next(false)`
1636
- */
1637
- NavigationFailureType[NavigationFailureType["aborted"] = 4] = "aborted";
1638
- /**
1639
- * A cancelled navigation is a navigation that failed because a more recent
1640
- * navigation finished started (not necessarily finished).
1641
- */
1642
- NavigationFailureType[NavigationFailureType["cancelled"] = 8] = "cancelled";
1643
- /**
1644
- * A duplicated navigation is a navigation that failed because it was
1645
- * initiated while already being at the exact same location.
1646
- */
1647
- NavigationFailureType[NavigationFailureType["duplicated"] = 16] = "duplicated";
1648
- })(NavigationFailureType || (NavigationFailureType = {}));
1649
- BASE_PARAM_PATTERN = "[^/]+?";
1650
- BASE_PATH_PARSER_OPTIONS = {
1651
- sensitive: false,
1652
- strict: false,
1653
- start: true,
1654
- end: true
1655
- };
1656
- REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
1657
- ROOT_TOKEN = {
1658
- type: 0,
1659
- value: ""
1660
- };
1661
- VALID_PARAM_RE = /[a-zA-Z0-9_]/;
1662
- matchedRouteKey = Symbol("");
1663
- viewDepthKey = Symbol("");
1664
- routerKey = Symbol("");
1665
- routeLocationKey = Symbol("");
1666
- routerViewLocationKey = Symbol("");
1667
- RouterLink = /* @__PURE__ */ defineComponent({
1668
- name: "RouterLink",
1669
- compatConfig: { MODE: 3 },
1670
- props: {
1671
- to: {
1672
- type: [String, Object],
1673
- required: true
1674
- },
1675
- replace: Boolean,
1676
- activeClass: String,
1677
- exactActiveClass: String,
1678
- custom: Boolean,
1679
- ariaCurrentValue: {
1680
- type: String,
1681
- default: "page"
1682
- }
1683
- },
1684
- useLink,
1685
- setup(props, { slots }) {
1686
- const link = reactive(useLink(props));
1687
- const { options } = inject(routerKey);
1688
- const elClass = computed(() => ({
1689
- [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
1690
- [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
1691
- }));
1692
- return () => {
1693
- var _props$to;
1694
- const children = slots.default && slots.default(link);
1695
- return props.custom ? children : h("a", {
1696
- "data-hydrate-ignore-href": "",
1697
- "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
1698
- href: link.href === "/404" ? (_props$to = props.to) === null || _props$to === void 0 ? void 0 : _props$to.name : link.href,
1699
- onClick: link.navigate,
1700
- class: elClass.value
1701
- }, children);
1702
- };
1703
- }
1704
- });
1705
- getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
1706
- RouterViewImpl = /* @__PURE__ */ defineComponent({
1707
- name: "RouterView",
1708
- inheritAttrs: false,
1709
- props: {
1710
- name: {
1711
- type: String,
1712
- default: "default"
1713
- },
1714
- route: Object
1715
- },
1716
- compatConfig: { MODE: 3 },
1717
- setup(props, { attrs, slots }) {
1718
- const injectedRoute = inject(routerViewLocationKey);
1719
- const routeToDisplay = computed(() => props.route || injectedRoute.value);
1720
- const injectedDepth = inject(viewDepthKey, 0);
1721
- const depth = computed(() => {
1722
- let initialDepth = unref(injectedDepth);
1723
- const { matched } = routeToDisplay.value;
1724
- let matchedRoute;
1725
- while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) initialDepth++;
1726
- return initialDepth;
1727
- });
1728
- const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
1729
- provide(viewDepthKey, computed(() => depth.value + 1));
1730
- provide(matchedRouteKey, matchedRouteRef);
1731
- provide(routerViewLocationKey, routeToDisplay);
1732
- const viewRef = ref();
1733
- watch(() => [
1734
- viewRef.value,
1735
- matchedRouteRef.value,
1736
- props.name
1737
- ], ([instance, to, name], [oldInstance, from, oldName]) => {
1738
- if (to) {
1739
- to.instances[name] = instance;
1740
- if (from && from !== to && instance && instance === oldInstance) {
1741
- if (!to.leaveGuards.size) to.leaveGuards = from.leaveGuards;
1742
- if (!to.updateGuards.size) to.updateGuards = from.updateGuards;
1743
- }
1744
- }
1745
- if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
1746
- }, { flush: "post" });
1747
- return () => {
1748
- const route = routeToDisplay.value;
1749
- const currentName = props.name;
1750
- const matchedRoute = matchedRouteRef.value;
1751
- const ViewComponent = matchedRoute && matchedRoute.components[currentName];
1752
- if (!ViewComponent) return normalizeSlot(slots.default, {
1753
- Component: ViewComponent,
1754
- route
1755
- });
1756
- const routePropsOption = matchedRoute.props[currentName];
1757
- const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
1758
- const onVnodeUnmounted = (vnode) => {
1759
- if (vnode.component.isUnmounted) matchedRoute.instances[currentName] = null;
1760
- };
1761
- const component = h(ViewComponent, assign({}, routeProps, attrs, {
1762
- onVnodeUnmounted,
1763
- ref: viewRef
1764
- }));
1765
- return normalizeSlot(slots.default, {
1766
- Component: component,
1767
- route
1768
- }) || component;
1769
- };
1770
- }
1771
- });
1772
- RouterView = RouterViewImpl;
1773
- }));
1774
- //#endregion
1775
- export { createWebHistory as a, createWebHashHistory as i, RouterView as n, init_vue_router as o, createRouter as r, routerViewLocationKey as s, RouterLink as t };