@vc-shell/framework 1.1.44 → 1.1.46

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 (453) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/core/plugins/modularity/loader.ts +150 -74
  3. package/core/services/app-bar-mobile-buttons-service.ts +1 -1
  4. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  5. package/dist/core/services/app-bar-mobile-buttons-service.d.ts +1 -1
  6. package/dist/core/services/app-bar-mobile-buttons-service.d.ts.map +1 -1
  7. package/dist/framework.js +33355 -295
  8. package/dist/index.css +1 -9
  9. package/dist/index.d.ts +0 -4
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/locales/de.json +0 -84
  12. package/dist/locales/en.json +0 -84
  13. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue.d.ts.map +1 -1
  14. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts +1 -1
  15. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts.map +1 -1
  16. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts.map +1 -1
  17. package/dist/shared/components/change-password-button/change-password-button.vue.d.ts.map +1 -1
  18. package/dist/shared/components/logout-button/logout-button.vue.d.ts.map +1 -1
  19. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
  20. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
  21. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +6 -6
  22. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
  25. package/dist/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue.d.ts.map +1 -1
  26. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +0 -26
  27. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
  28. package/dist/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue.d.ts.map +1 -1
  29. package/dist/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue.d.ts.map +1 -1
  30. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  31. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts +0 -5
  32. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  33. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +0 -20
  34. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
  35. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
  36. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts +36 -0
  37. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts.map +1 -0
  38. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts +17 -0
  39. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts.map +1 -0
  40. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +16 -2381
  41. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
  42. package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
  43. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +1 -1
  44. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
  45. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +1 -1
  46. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  47. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +1 -1
  48. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
  49. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
  50. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  51. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +1 -1
  52. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
  53. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +1 -1
  54. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  55. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
  56. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +2 -2
  57. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
  58. package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
  59. package/dist/vendor-boolbase-Cp9L0GAZ.js +25 -0
  60. package/dist/vendor-cheerio-HN9zIPZn.js +3135 -0
  61. package/dist/vendor-cheerio-select-5Ry0HvBq.js +306 -0
  62. package/dist/vendor-core-js-l0sNRNKZ.js +1 -0
  63. package/dist/vendor-css-select-DRIZ9kfZ.js +966 -0
  64. package/dist/vendor-css-what-DuPJ1HEF.js +448 -0
  65. package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +778 -0
  66. package/dist/vendor-date-fns-515YWkk-.js +6724 -0
  67. package/dist/vendor-dom-serializer-nQMsqjYW.js +286 -0
  68. package/dist/vendor-dom7-CJLPMwy5.js +941 -0
  69. package/dist/vendor-domelementtype-CjSzQey5.js +53 -0
  70. package/dist/vendor-domhandler-9z8cS16a.js +484 -0
  71. package/dist/vendor-dompurify-CRFzu7ib.js +1336 -0
  72. package/dist/vendor-domutils-Bc-Opz-v.js +981 -0
  73. package/dist/vendor-entities-Bfsx4xOQ.js +636 -0
  74. package/dist/vendor-floating-ui-core-wV8u8QP4.js +511 -0
  75. package/dist/vendor-floating-ui-dom-DDnRPs17.js +706 -0
  76. package/dist/vendor-floating-ui-utils-OMIFy1QU.js +296 -0
  77. package/dist/vendor-floating-ui-vue-D-tCDAMm.js +167 -0
  78. package/dist/vendor-fontsource-plus-jakarta-sans.css +1 -0
  79. package/dist/vendor-headlessui-vue-CY9FRgTb.js +83 -0
  80. package/dist/vendor-htmlparser2-B1dhFPOs.js +1426 -0
  81. package/dist/vendor-iconify-vue-DfRGgyNu.js +1840 -0
  82. package/dist/vendor-intlify-core-base-BuknsFQe.js +1876 -0
  83. package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +1508 -0
  84. package/dist/vendor-intlify-shared-Cz4YRMuC.js +241 -0
  85. package/dist/vendor-iso-639-1-BJCk9DvE.js +819 -0
  86. package/dist/vendor-linkify-it-CKUf4vsc.js +830 -0
  87. package/dist/vendor-linkifyjs-BfyGgbCh.js +1756 -0
  88. package/dist/vendor-lodash-es-BySUOlwf.js +18333 -0
  89. package/dist/vendor-markdown-it-D-apazHa.js +6000 -0
  90. package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +131 -0
  91. package/dist/vendor-mdurl-BNh2CCgT.js +537 -0
  92. package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +1275 -0
  93. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +591 -0
  94. package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +2153 -0
  95. package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +2470 -0
  96. package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +6589 -0
  97. package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +1510 -0
  98. package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +761 -0
  99. package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +70 -0
  100. package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +667 -0
  101. package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +520 -0
  102. package/dist/vendor-microsoft-signalr-dUnlRsGm.js +3339 -0
  103. package/dist/vendor-moment-Mki5YqAR.js +5679 -0
  104. package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +395 -0
  105. package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +1160 -0
  106. package/dist/vendor-normalize-css.css +1 -0
  107. package/dist/vendor-nth-check-Bx8TxtJt.js +157 -0
  108. package/dist/vendor-orderedmap-dGG6uMFJ.js +137 -0
  109. package/dist/vendor-parse5-Bt2NhSzR.js +8432 -0
  110. package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +216 -0
  111. package/dist/vendor-popperjs-core-Cr2byIky.js +1790 -0
  112. package/dist/vendor-prettier-B4PaeWRQ.js +98 -0
  113. package/dist/vendor-prosemirror-commands-BH9lWGpW.js +561 -0
  114. package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +146 -0
  115. package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +236 -0
  116. package/dist/vendor-prosemirror-history-BDaJkvNx.js +414 -0
  117. package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +128 -0
  118. package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +866 -0
  119. package/dist/vendor-prosemirror-model-BZu3WVcD.js +3463 -0
  120. package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +158 -0
  121. package/dist/vendor-prosemirror-state-BvL9Pxph.js +1003 -0
  122. package/dist/vendor-prosemirror-tables-17qAnviK.js +2159 -0
  123. package/dist/vendor-prosemirror-transform-CE9VV3qg.js +2156 -0
  124. package/dist/vendor-prosemirror-view-CU2WTHT7.js +5811 -0
  125. package/dist/vendor-punycode-js-iAs5RxMf.js +441 -0
  126. package/dist/vendor-rope-sequence-BdXDKoGt.js +207 -0
  127. package/dist/vendor-semver-CVLMK-S4.js +2702 -0
  128. package/dist/vendor-ssr-window-s6OpKa3O.js +150 -0
  129. package/dist/vendor-swiper-CdiyNHVt.js +5679 -0
  130. package/dist/vendor-swiper.css +1 -0
  131. package/dist/vendor-tanstack-virtual-core-l0sNRNKZ.js +1 -0
  132. package/dist/vendor-tanstack-vue-virtual-l0sNRNKZ.js +1 -0
  133. package/dist/vendor-tippy-js-DWFe2TfK.js +1647 -0
  134. package/dist/vendor-tiptap-core-NfwGfaQk.js +4910 -0
  135. package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +57 -0
  136. package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +97 -0
  137. package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +218 -0
  138. package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +73 -0
  139. package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +221 -0
  140. package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +75 -0
  141. package/dist/vendor-tiptap-extension-document-DssuotYs.js +13 -0
  142. package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +26 -0
  143. package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +165 -0
  144. package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +30 -0
  145. package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +68 -0
  146. package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +77 -0
  147. package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +48 -0
  148. package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +92 -0
  149. package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +76 -0
  150. package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +96 -0
  151. package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +414 -0
  152. package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +37 -0
  153. package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +97 -0
  154. package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +39 -0
  155. package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +66 -0
  156. package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +79 -0
  157. package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +47 -0
  158. package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +47 -0
  159. package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +26 -0
  160. package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +354 -0
  161. package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +12 -0
  162. package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +50 -0
  163. package/dist/vendor-tiptap-markdown-7-PCADTU.js +1017 -0
  164. package/dist/vendor-tiptap-pm-l0sNRNKZ.js +1 -0
  165. package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +88 -0
  166. package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +268 -0
  167. package/dist/vendor-truncate-html-3qQY0Djo.js +196 -0
  168. package/dist/vendor-uc-micro-jjt6LQ65.js +23 -0
  169. package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +154 -0
  170. package/dist/vendor-vee-validate-rules-DzV3VY3N.js +536 -0
  171. package/dist/vendor-vue-currency-input-DGAkEFBO.js +545 -0
  172. package/dist/vendor-vue-demi-l0sNRNKZ.js +1 -0
  173. package/dist/vendor-vue-devtools-api-DXYR8qBG.js +169 -0
  174. package/dist/vendor-vue-i18n-Co752uk3.js +1897 -0
  175. package/dist/vendor-vue3-application-insights-CYWFCr_J.js +119 -0
  176. package/dist/vendor-vue3-touch-events-BJEAiSa3.js +416 -0
  177. package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +5019 -0
  178. package/dist/vendor-vuepic-vue-datepicker.css +1 -0
  179. package/dist/vendor-vueuse-components-l1bL12mE.js +339 -0
  180. package/dist/vendor-vueuse-core-DGcJOmwG.js +7743 -0
  181. package/dist/vendor-vueuse-shared-_mOXsFuM.js +1568 -0
  182. package/dist/vendor-w3c-keyname-BOm2dtJm.js +121 -0
  183. package/package.json +22 -11
  184. package/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue +3 -3
  185. package/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.ts +2 -1
  186. package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.ts +1 -0
  187. package/shared/components/change-password-button/change-password-button.vue +1 -2
  188. package/shared/components/logout-button/logout-button.vue +1 -2
  189. package/shared/components/notifications/components/notification-container/index.ts +1 -1
  190. package/shared/components/notifications/core/notification.ts +1 -1
  191. package/shared/components/settings-menu-item/settings-menu-item.vue +1 -0
  192. package/shared/components/sidebar/sidebar.vue +2 -2
  193. package/shared/modules/dynamic/pages/dynamic-blade-list.vue +2 -1
  194. package/ui/components/atoms/vc-hint/vc-hint.vue +2 -0
  195. package/ui/components/atoms/vc-icon/composables/use-icon.ts +1 -1
  196. package/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue +18 -14
  197. package/ui/components/atoms/vc-icon/icons/index.ts +1 -27
  198. package/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue +7 -11
  199. package/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue +37 -31
  200. package/ui/components/atoms/vc-icon/vc-icon-examples.vue +1 -1
  201. package/ui/components/atoms/vc-icon/vc-icon.stories.ts +4 -5
  202. package/ui/components/atoms/vc-icon/vc-icon.vue +43 -186
  203. package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +22 -70
  204. package/ui/components/atoms/vc-icon/vc-material-icon.vue +28 -59
  205. package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +2 -3
  206. package/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue +103 -0
  207. package/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue +252 -0
  208. package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -4
  209. package/ui/components/molecules/vc-editor/vc-editor.vue +666 -360
  210. package/ui/components/molecules/vc-form/vc-form.vue +7 -5
  211. package/ui/components/molecules/vc-input/vc-input.vue +1 -1
  212. package/ui/components/molecules/vc-pagination/vc-pagination.vue +4 -17
  213. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue +1 -1
  214. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue +1 -3
  215. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +1 -4
  216. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +1 -3
  217. package/ui/components/organisms/vc-app/vc-app.backupsb.ts +214 -214
  218. package/ui/components/organisms/vc-app/vc-app.vue +3 -5
  219. package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +3 -10
  220. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue +1 -1
  221. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +2 -2
  222. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue +2 -2
  223. package/ui/components/organisms/vc-blade/vc-blade.vue +4 -5
  224. package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +1 -3
  225. package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +1 -2
  226. package/ui/components/organisms/vc-table/composables/useTableState.ts +5 -5
  227. package/dist/apl-B2DGVGxc.js +0 -76
  228. package/dist/asciiarmor-2LVJmxlE.js +0 -34
  229. package/dist/asn1-jKiBa2Ya.js +0 -95
  230. package/dist/asterisk-DS281yxp.js +0 -271
  231. package/dist/brainfuck-C_p9pTT8.js +0 -34
  232. package/dist/clike-DGTaUp48.js +0 -620
  233. package/dist/clojure-CCKyeQKf.js +0 -800
  234. package/dist/cmake-CuaCgAKt.js +0 -28
  235. package/dist/cobol-BlTKFDRj.js +0 -72
  236. package/dist/coffeescript-BVCvwO8I.js +0 -179
  237. package/dist/commonlisp-D_kxz07b.js +0 -75
  238. package/dist/crystal-D309uH6_.js +0 -217
  239. package/dist/css-BkF-NPzE.js +0 -1553
  240. package/dist/cypher-BMq4Fwjl.js +0 -68
  241. package/dist/d-BZcgY6La.js +0 -127
  242. package/dist/diff-Cg9d_RX2.js +0 -18
  243. package/dist/dockerfile-DIy8NleC.js +0 -194
  244. package/dist/dtd-CtLokQ-U.js +0 -84
  245. package/dist/dylan-QYeExnWK.js +0 -234
  246. package/dist/ebnf-DUPDuY4r.js +0 -78
  247. package/dist/ecl-CiXN-g_D.js +0 -121
  248. package/dist/eiffel-yQhjl4T1.js +0 -110
  249. package/dist/elm-CNT9vbN0.js +0 -108
  250. package/dist/erlang-CFOYdy9e.js +0 -487
  251. package/dist/factor-DDOC7X6P.js +0 -65
  252. package/dist/fcl-CPC2WYrI.js +0 -103
  253. package/dist/forth-BmxRyE9S.js +0 -60
  254. package/dist/fortran-9bvPyrOW.js +0 -442
  255. package/dist/gas-cpmYfFX2.js +0 -183
  256. package/dist/gherkin-CJuwpceU.js +0 -34
  257. package/dist/groovy-DZeT_VM-.js +0 -146
  258. package/dist/haskell-Bvt3Qq1t.js +0 -375
  259. package/dist/haxe-70NVW1pR.js +0 -359
  260. package/dist/http-D9LttvKF.js +0 -44
  261. package/dist/idl-B6TRFYjl.js +0 -947
  262. package/dist/index-4DWvmoYg.js +0 -71
  263. package/dist/index-52o7mJaX.js +0 -156
  264. package/dist/index-B0KatioT.js +0 -98
  265. package/dist/index-BP3W8zuk.js +0 -268
  266. package/dist/index-BykT5L1A.js +0 -148134
  267. package/dist/index-CfXo9hsG.js +0 -75
  268. package/dist/index-Ch37pBUt.js +0 -308
  269. package/dist/index-D2KGkAYT.js +0 -93
  270. package/dist/index-D83zQom_.js +0 -58
  271. package/dist/index-DuQrVLbu.js +0 -134
  272. package/dist/index-_fdMid5h.js +0 -288
  273. package/dist/index-a1wO-owY.js +0 -545
  274. package/dist/index-crMpNSFe.js +0 -611
  275. package/dist/index-dmBRpHHY.js +0 -137
  276. package/dist/index-kBdB14Fz.js +0 -341
  277. package/dist/index-uBhy41le.js +0 -249
  278. package/dist/index-zZrijNsr.js +0 -299
  279. package/dist/javascript-C2yteZeJ.js +0 -691
  280. package/dist/jinja2-DnB6dQmV.js +0 -154
  281. package/dist/julia-DpvXAuO6.js +0 -241
  282. package/dist/livescript-CanGTf8u.js +0 -272
  283. package/dist/lua-XplVlWi_.js +0 -217
  284. package/dist/mathematica-jaRHnSxC.js +0 -35
  285. package/dist/mbox-BctzC1hL.js +0 -76
  286. package/dist/mirc-CFBPAOaF.js +0 -72
  287. package/dist/mllike-BSnXJBGA.js +0 -272
  288. package/dist/modelica-vUgVs--1.js +0 -93
  289. package/dist/mscgen-Cpl0NYLN.js +0 -104
  290. package/dist/mumps-CQoS1kWX.js +0 -25
  291. package/dist/nginx-zDPm3Z74.js +0 -89
  292. package/dist/nsis-fePjrhq7.js +0 -62
  293. package/dist/ntriples-CsNjv2QF.js +0 -79
  294. package/dist/octave-C8PmmSRH.js +0 -143
  295. package/dist/oz-Ce8aN8oE.js +0 -151
  296. package/dist/pascal-De0D6mP7.js +0 -77
  297. package/dist/perl-B4bSCe1C.js +0 -915
  298. package/dist/pig-D24Z8EXi.js +0 -54
  299. package/dist/powershell-DkYVfTzP.js +0 -249
  300. package/dist/properties-Dn9wna3M.js +0 -26
  301. package/dist/protobuf-BPIjwpzm.js +0 -49
  302. package/dist/pug-CwAQJzGR.js +0 -248
  303. package/dist/puppet-nyd4dhjf.js +0 -45
  304. package/dist/python-BkR3uSy8.js +0 -313
  305. package/dist/q-DXjKs-tC.js +0 -83
  306. package/dist/r-LKEuhEGI.js +0 -104
  307. package/dist/rpm-IznJm2Xc.js +0 -57
  308. package/dist/ruby-CcYfvIk6.js +0 -228
  309. package/dist/sas-7E8yHoCW.js +0 -105
  310. package/dist/scheme-DjibxsNh.js +0 -124
  311. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts +0 -113
  312. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts.map +0 -1
  313. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +0 -3
  314. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +0 -1
  315. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +0 -102
  316. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +0 -1
  317. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts +0 -4
  318. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts.map +0 -1
  319. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts +0 -3
  320. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts.map +0 -1
  321. package/dist/shell-C0C2sNA_.js +0 -182
  322. package/dist/sieve-Bwz7vjP5.js +0 -72
  323. package/dist/simple-mode-B0dvCdAA.js +0 -89
  324. package/dist/smalltalk-Bhddl2pB.js +0 -48
  325. package/dist/solr-BNlsLglM.js +0 -41
  326. package/dist/sparql-FarWu_Gb.js +0 -197
  327. package/dist/spreadsheet-C-cy4P5N.js +0 -49
  328. package/dist/sql-CfG5lQ3l.js +0 -282
  329. package/dist/stex-Du4h4KAU.js +0 -129
  330. package/dist/stylus-CAdqWld3.js +0 -250
  331. package/dist/swift-DSxqR9R6.js +0 -230
  332. package/dist/tcl-xfoLljhY.js +0 -81
  333. package/dist/textile-D1AWE-pc.js +0 -295
  334. package/dist/tiddlywiki-5wqsXtSk.js +0 -155
  335. package/dist/tiki-__Kn3CeS.js +0 -181
  336. package/dist/toml-BHiuTcfn.js +0 -49
  337. package/dist/troff-D2UO-fKf.js +0 -35
  338. package/dist/ttcn-Bsa4sfRm.js +0 -123
  339. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
  340. package/dist/turtle-xwJUxoPV.js +0 -80
  341. package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts +0 -7
  342. package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts.map +0 -1
  343. package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts +0 -7
  344. package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts.map +0 -1
  345. package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts +0 -7
  346. package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts.map +0 -1
  347. package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts +0 -7
  348. package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts.map +0 -1
  349. package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts +0 -7
  350. package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts.map +0 -1
  351. package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts +0 -7
  352. package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts.map +0 -1
  353. package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts +0 -7
  354. package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts.map +0 -1
  355. package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts +0 -7
  356. package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts.map +0 -1
  357. package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts +0 -7
  358. package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts.map +0 -1
  359. package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts +0 -7
  360. package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts.map +0 -1
  361. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts +0 -7
  362. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts.map +0 -1
  363. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts +0 -7
  364. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts.map +0 -1
  365. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts +0 -7
  366. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts.map +0 -1
  367. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts +0 -7
  368. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts.map +0 -1
  369. package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts +0 -7
  370. package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts.map +0 -1
  371. package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts +0 -7
  372. package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts.map +0 -1
  373. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts +0 -7
  374. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts.map +0 -1
  375. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts +0 -7
  376. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts.map +0 -1
  377. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts +0 -7
  378. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts.map +0 -1
  379. package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts +0 -7
  380. package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts.map +0 -1
  381. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts +0 -7
  382. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts.map +0 -1
  383. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts +0 -7
  384. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts.map +0 -1
  385. package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts +0 -7
  386. package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts.map +0 -1
  387. package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts +0 -7
  388. package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts.map +0 -1
  389. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts +0 -7
  390. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts.map +0 -1
  391. package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts +0 -7
  392. package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts.map +0 -1
  393. package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts +0 -7
  394. package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts.map +0 -1
  395. package/dist/vb-c2kQGd6-.js +0 -74
  396. package/dist/vbscript-1f_Dhg5H.js +0 -324
  397. package/dist/velocity-DJd0pTTC.js +0 -96
  398. package/dist/verilog-CiS1jyi5.js +0 -262
  399. package/dist/vhdl-T9HkrbI2.js +0 -106
  400. package/dist/webidl-CjfDENEo.js +0 -155
  401. package/dist/xquery-BUQdORAS.js +0 -422
  402. package/dist/yacas-C0absKBh.js +0 -73
  403. package/dist/z80-Pki2zAjW.js +0 -61
  404. package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +0 -186
  405. package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +0 -175
  406. package/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.ts +0 -185
  407. package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +0 -245
  408. package/shared/modules/dynamic/components/fields/storybook/EditorField.stories.ts +0 -192
  409. package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +0 -347
  410. package/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.ts +0 -239
  411. package/shared/modules/dynamic/components/fields/storybook/ImageField.stories.ts +0 -186
  412. package/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.ts +0 -281
  413. package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +0 -312
  414. package/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.ts +0 -361
  415. package/shared/modules/dynamic/components/fields/storybook/RadioButtonGroup.stories.ts +0 -224
  416. package/shared/modules/dynamic/components/fields/storybook/RatingField.stories.ts +0 -131
  417. package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +0 -666
  418. package/shared/modules/dynamic/components/fields/storybook/StatusField.stories.ts +0 -202
  419. package/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.ts +0 -178
  420. package/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.ts +0 -203
  421. package/shared/modules/dynamic/components/fields/storybook/VideoField.stories.ts +0 -92
  422. package/shared/modules/dynamic/components/fields/storybook/common/args.ts +0 -130
  423. package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +0 -8
  424. package/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.ts +0 -54
  425. package/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.ts +0 -16
  426. package/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.ts +0 -41
  427. package/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue +0 -15
  428. package/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue +0 -20
  429. package/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue +0 -13
  430. package/ui/components/atoms/vc-icon/icons/BellIcon.vue +0 -14
  431. package/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue +0 -13
  432. package/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue +0 -13
  433. package/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue +0 -13
  434. package/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue +0 -13
  435. package/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue +0 -16
  436. package/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue +0 -20
  437. package/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue +0 -14
  438. package/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue +0 -14
  439. package/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue +0 -27
  440. package/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue +0 -22
  441. package/ui/components/atoms/vc-icon/icons/LogoutIcon.vue +0 -13
  442. package/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue +0 -14
  443. package/ui/components/atoms/vc-icon/icons/OffersIcon.vue +0 -23
  444. package/ui/components/atoms/vc-icon/icons/OrdersIcon.vue +0 -19
  445. package/ui/components/atoms/vc-icon/icons/PeopleIcon.vue +0 -21
  446. package/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue +0 -20
  447. package/ui/components/atoms/vc-icon/icons/ProductsIcon.vue +0 -23
  448. package/ui/components/atoms/vc-icon/icons/ProfileIcon.vue +0 -18
  449. package/ui/components/atoms/vc-icon/icons/SearchIcon.vue +0 -14
  450. package/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue +0 -21
  451. package/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue +0 -16
  452. package/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue +0 -26
  453. package/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue +0 -19
@@ -0,0 +1,1876 @@
1
+ import { i as isArray, a as isPlainObject, b as isString, c as create, d as assign, e as isBoolean, f as isRegExp, g as isFunction, w as warnOnce, h as warn, j as isObject, k as hasOwn, l as format$1, m as getGlobalThis, n as isNumber, o as isEmptyObject, p as isDate, q as escapeHtml, r as inBrowser, s as mark, t as measure, u as join, v as toDisplayString, x as isPromise, y as generateFormatCacheKey, z as generateCodeFrame } from './vendor-intlify-shared-Cz4YRMuC.js';
2
+ import { c as createCompileError, C as COMPILE_ERROR_CODES_EXTEND_POINT, d as detectHtmlTag, a as defaultOnError, b as baseCompile$1 } from './vendor-intlify-message-compiler-CuOQDWx1.js';
3
+
4
+ /*!
5
+ * core-base v11.1.7
6
+ * (c) 2025 kazuya kawaguchi
7
+ * Released under the MIT License.
8
+ */
9
+
10
+ /**
11
+ * This is only called in esm-bundler builds.
12
+ * istanbul-ignore-next
13
+ */
14
+ function initFeatureFlags() {
15
+ if (typeof __INTLIFY_PROD_DEVTOOLS__ !== 'boolean') {
16
+ getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
17
+ }
18
+ if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== 'boolean') {
19
+ getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false;
20
+ }
21
+ }
22
+
23
+ function isMessageAST(val) {
24
+ return (isObject(val) &&
25
+ resolveType(val) === 0 &&
26
+ (hasOwn(val, 'b') || hasOwn(val, 'body')));
27
+ }
28
+ const PROPS_BODY = ['b', 'body'];
29
+ function resolveBody(node) {
30
+ return resolveProps(node, PROPS_BODY);
31
+ }
32
+ const PROPS_CASES = ['c', 'cases'];
33
+ function resolveCases(node) {
34
+ return resolveProps(node, PROPS_CASES, []);
35
+ }
36
+ const PROPS_STATIC = ['s', 'static'];
37
+ function resolveStatic(node) {
38
+ return resolveProps(node, PROPS_STATIC);
39
+ }
40
+ const PROPS_ITEMS = ['i', 'items'];
41
+ function resolveItems(node) {
42
+ return resolveProps(node, PROPS_ITEMS, []);
43
+ }
44
+ const PROPS_TYPE = ['t', 'type'];
45
+ function resolveType(node) {
46
+ return resolveProps(node, PROPS_TYPE);
47
+ }
48
+ const PROPS_VALUE = ['v', 'value'];
49
+ function resolveValue$1(node, type) {
50
+ const resolved = resolveProps(node, PROPS_VALUE);
51
+ if (resolved != null) {
52
+ return resolved;
53
+ }
54
+ else {
55
+ throw createUnhandleNodeError(type);
56
+ }
57
+ }
58
+ const PROPS_MODIFIER = ['m', 'modifier'];
59
+ function resolveLinkedModifier(node) {
60
+ return resolveProps(node, PROPS_MODIFIER);
61
+ }
62
+ const PROPS_KEY = ['k', 'key'];
63
+ function resolveLinkedKey(node) {
64
+ const resolved = resolveProps(node, PROPS_KEY);
65
+ if (resolved) {
66
+ return resolved;
67
+ }
68
+ else {
69
+ throw createUnhandleNodeError(6 /* NodeTypes.Linked */);
70
+ }
71
+ }
72
+ function resolveProps(node, props, defaultValue) {
73
+ for (let i = 0; i < props.length; i++) {
74
+ const prop = props[i];
75
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
+ if (hasOwn(node, prop) && node[prop] != null) {
77
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
78
+ return node[prop];
79
+ }
80
+ }
81
+ return defaultValue;
82
+ }
83
+ const AST_NODE_PROPS_KEYS = [
84
+ ...PROPS_BODY,
85
+ ...PROPS_CASES,
86
+ ...PROPS_STATIC,
87
+ ...PROPS_ITEMS,
88
+ ...PROPS_KEY,
89
+ ...PROPS_MODIFIER,
90
+ ...PROPS_VALUE,
91
+ ...PROPS_TYPE
92
+ ];
93
+ function createUnhandleNodeError(type) {
94
+ return new Error(`unhandled node type: ${type}`);
95
+ }
96
+
97
+ function format(ast) {
98
+ const msg = (ctx) => formatParts(ctx, ast);
99
+ return msg;
100
+ }
101
+ function formatParts(ctx, ast) {
102
+ const body = resolveBody(ast);
103
+ if (body == null) {
104
+ throw createUnhandleNodeError(0 /* NodeTypes.Resource */);
105
+ }
106
+ const type = resolveType(body);
107
+ if (type === 1 /* NodeTypes.Plural */) {
108
+ const plural = body;
109
+ const cases = resolveCases(plural);
110
+ return ctx.plural(cases.reduce((messages, c) => [
111
+ ...messages,
112
+ formatMessageParts(ctx, c)
113
+ ], []));
114
+ }
115
+ else {
116
+ return formatMessageParts(ctx, body);
117
+ }
118
+ }
119
+ function formatMessageParts(ctx, node) {
120
+ const static_ = resolveStatic(node);
121
+ if (static_ != null) {
122
+ return ctx.type === 'text'
123
+ ? static_
124
+ : ctx.normalize([static_]);
125
+ }
126
+ else {
127
+ const messages = resolveItems(node).reduce((acm, c) => [...acm, formatMessagePart(ctx, c)], []);
128
+ return ctx.normalize(messages);
129
+ }
130
+ }
131
+ function formatMessagePart(ctx, node) {
132
+ const type = resolveType(node);
133
+ switch (type) {
134
+ case 3 /* NodeTypes.Text */: {
135
+ return resolveValue$1(node, type);
136
+ }
137
+ case 9 /* NodeTypes.Literal */: {
138
+ return resolveValue$1(node, type);
139
+ }
140
+ case 4 /* NodeTypes.Named */: {
141
+ const named = node;
142
+ if (hasOwn(named, 'k') && named.k) {
143
+ return ctx.interpolate(ctx.named(named.k));
144
+ }
145
+ if (hasOwn(named, 'key') && named.key) {
146
+ return ctx.interpolate(ctx.named(named.key));
147
+ }
148
+ throw createUnhandleNodeError(type);
149
+ }
150
+ case 5 /* NodeTypes.List */: {
151
+ const list = node;
152
+ if (hasOwn(list, 'i') && isNumber(list.i)) {
153
+ return ctx.interpolate(ctx.list(list.i));
154
+ }
155
+ if (hasOwn(list, 'index') && isNumber(list.index)) {
156
+ return ctx.interpolate(ctx.list(list.index));
157
+ }
158
+ throw createUnhandleNodeError(type);
159
+ }
160
+ case 6 /* NodeTypes.Linked */: {
161
+ const linked = node;
162
+ const modifier = resolveLinkedModifier(linked);
163
+ const key = resolveLinkedKey(linked);
164
+ return ctx.linked(formatMessagePart(ctx, key), modifier ? formatMessagePart(ctx, modifier) : undefined, ctx.type);
165
+ }
166
+ case 7 /* NodeTypes.LinkedKey */: {
167
+ return resolveValue$1(node, type);
168
+ }
169
+ case 8 /* NodeTypes.LinkedModifier */: {
170
+ return resolveValue$1(node, type);
171
+ }
172
+ default:
173
+ throw new Error(`unhandled node on format message part: ${type}`);
174
+ }
175
+ }
176
+
177
+ const WARN_MESSAGE = `Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.`;
178
+ function checkHtmlMessage(source, warnHtmlMessage) {
179
+ if (warnHtmlMessage && detectHtmlTag(source)) {
180
+ warn(format$1(WARN_MESSAGE, { source }));
181
+ }
182
+ }
183
+ const defaultOnCacheKey = (message) => message;
184
+ let compileCache = create();
185
+ function baseCompile(message, options = {}) {
186
+ // error detecting on compile
187
+ let detectError = false;
188
+ const onError = options.onError || defaultOnError;
189
+ options.onError = (err) => {
190
+ detectError = true;
191
+ onError(err);
192
+ };
193
+ // compile with mesasge-compiler
194
+ return { ...baseCompile$1(message, options), detectError };
195
+ }
196
+ /* #__NO_SIDE_EFFECTS__ */
197
+ function compile(message, context) {
198
+ if ((!__INTLIFY_DROP_MESSAGE_COMPILER__) &&
199
+ isString(message)) {
200
+ // check HTML message
201
+ const warnHtmlMessage = isBoolean(context.warnHtmlMessage)
202
+ ? context.warnHtmlMessage
203
+ : true;
204
+ (process.env.NODE_ENV !== 'production') && checkHtmlMessage(message, warnHtmlMessage);
205
+ // check caches
206
+ const onCacheKey = context.onCacheKey || defaultOnCacheKey;
207
+ const cacheKey = onCacheKey(message);
208
+ const cached = compileCache[cacheKey];
209
+ if (cached) {
210
+ return cached;
211
+ }
212
+ // compile with JIT mode
213
+ const { ast, detectError } = baseCompile(message, {
214
+ ...context,
215
+ location: (process.env.NODE_ENV !== 'production'),
216
+ jit: true
217
+ });
218
+ // compose message function from AST
219
+ const msg = format(ast);
220
+ // if occurred compile error, don't cache
221
+ return !detectError
222
+ ? (compileCache[cacheKey] = msg)
223
+ : msg;
224
+ }
225
+ else {
226
+ if ((process.env.NODE_ENV !== 'production') && !isMessageAST(message)) {
227
+ warn(`the message that is resolve with key '${context.key}' is not supported for jit compilation`);
228
+ return (() => message);
229
+ }
230
+ // AST case (passed from bundler)
231
+ const cacheKey = message.cacheKey;
232
+ if (cacheKey) {
233
+ const cached = compileCache[cacheKey];
234
+ if (cached) {
235
+ return cached;
236
+ }
237
+ // compose message function from message (AST)
238
+ return (compileCache[cacheKey] =
239
+ format(message));
240
+ }
241
+ else {
242
+ return format(message);
243
+ }
244
+ }
245
+ }
246
+
247
+ let devtools = null;
248
+ function setDevToolsHook(hook) {
249
+ devtools = hook;
250
+ }
251
+ function initI18nDevTools(i18n, version, meta) {
252
+ // TODO: queue if devtools is undefined
253
+ devtools &&
254
+ devtools.emit('i18n:init', {
255
+ timestamp: Date.now(),
256
+ i18n,
257
+ version,
258
+ meta
259
+ });
260
+ }
261
+ const translateDevTools =
262
+ /* #__PURE__*/ createDevToolsHook('function:translate');
263
+ function createDevToolsHook(hook) {
264
+ return (payloads) => devtools && devtools.emit(hook, payloads);
265
+ }
266
+
267
+ const CoreErrorCodes = {
268
+ INVALID_ARGUMENT: COMPILE_ERROR_CODES_EXTEND_POINT, // 17
269
+ INVALID_DATE_ARGUMENT: 18,
270
+ INVALID_ISO_DATE_ARGUMENT: 19,
271
+ NOT_SUPPORT_NON_STRING_MESSAGE: 20,
272
+ NOT_SUPPORT_LOCALE_PROMISE_VALUE: 21,
273
+ NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 22,
274
+ NOT_SUPPORT_LOCALE_TYPE: 23
275
+ };
276
+ const CORE_ERROR_CODES_EXTEND_POINT = 24;
277
+ function createCoreError(code) {
278
+ return createCompileError(code, null, (process.env.NODE_ENV !== 'production') ? { messages: errorMessages } : undefined);
279
+ }
280
+ /** @internal */
281
+ const errorMessages = {
282
+ [CoreErrorCodes.INVALID_ARGUMENT]: 'Invalid arguments',
283
+ [CoreErrorCodes.INVALID_DATE_ARGUMENT]: 'The date provided is an invalid Date object.' +
284
+ 'Make sure your Date represents a valid date.',
285
+ [CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT]: 'The argument provided is not a valid ISO date string',
286
+ [CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE]: 'Not support non-string message',
287
+ [CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE]: 'cannot support promise value',
288
+ [CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]: 'cannot support async function',
289
+ [CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE]: 'cannot support locale type'
290
+ };
291
+
292
+ /** @internal */
293
+ function getLocale(context, options) {
294
+ return options.locale != null
295
+ ? resolveLocale(options.locale)
296
+ : resolveLocale(context.locale);
297
+ }
298
+ let _resolveLocale;
299
+ /** @internal */
300
+ function resolveLocale(locale) {
301
+ if (isString(locale)) {
302
+ return locale;
303
+ }
304
+ else {
305
+ if (isFunction(locale)) {
306
+ if (locale.resolvedOnce && _resolveLocale != null) {
307
+ return _resolveLocale;
308
+ }
309
+ else if (locale.constructor.name === 'Function') {
310
+ const resolve = locale();
311
+ if (isPromise(resolve)) {
312
+ throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
313
+ }
314
+ return (_resolveLocale = resolve);
315
+ }
316
+ else {
317
+ throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
318
+ }
319
+ }
320
+ else {
321
+ throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE);
322
+ }
323
+ }
324
+ }
325
+ /**
326
+ * Fallback with simple implemenation
327
+ *
328
+ * @remarks
329
+ * A fallback locale function implemented with a simple fallback algorithm.
330
+ *
331
+ * Basically, it returns the value as specified in the `fallbackLocale` props, and is processed with the fallback inside intlify.
332
+ *
333
+ * @param ctx - A {@link CoreContext | context}
334
+ * @param fallback - A {@link FallbackLocale | fallback locale}
335
+ * @param start - A starting {@link Locale | locale}
336
+ *
337
+ * @returns Fallback locales
338
+ *
339
+ * @VueI18nGeneral
340
+ */
341
+ function fallbackWithSimple(ctx, fallback, start) {
342
+ // prettier-ignore
343
+ return [...new Set([
344
+ start,
345
+ ...(isArray(fallback)
346
+ ? fallback
347
+ : isObject(fallback)
348
+ ? Object.keys(fallback)
349
+ : isString(fallback)
350
+ ? [fallback]
351
+ : [start])
352
+ ])];
353
+ }
354
+ /**
355
+ * Fallback with locale chain
356
+ *
357
+ * @remarks
358
+ * A fallback locale function implemented with a fallback chain algorithm. It's used in VueI18n as default.
359
+ *
360
+ * @param ctx - A {@link CoreContext | context}
361
+ * @param fallback - A {@link FallbackLocale | fallback locale}
362
+ * @param start - A starting {@link Locale | locale}
363
+ *
364
+ * @returns Fallback locales
365
+ *
366
+ * @VueI18nSee [Fallbacking](../guide/essentials/fallback)
367
+ *
368
+ * @VueI18nGeneral
369
+ */
370
+ function fallbackWithLocaleChain(ctx, fallback, start) {
371
+ const startLocale = isString(start) ? start : DEFAULT_LOCALE;
372
+ const context = ctx;
373
+ if (!context.__localeChainCache) {
374
+ context.__localeChainCache = new Map();
375
+ }
376
+ let chain = context.__localeChainCache.get(startLocale);
377
+ if (!chain) {
378
+ chain = [];
379
+ // first block defined by start
380
+ let block = [start];
381
+ // while any intervening block found
382
+ while (isArray(block)) {
383
+ block = appendBlockToChain(chain, block, fallback);
384
+ }
385
+ // prettier-ignore
386
+ // last block defined by default
387
+ const defaults = isArray(fallback) || !isPlainObject(fallback)
388
+ ? fallback
389
+ : fallback['default']
390
+ ? fallback['default']
391
+ : null;
392
+ // convert defaults to array
393
+ block = isString(defaults) ? [defaults] : defaults;
394
+ if (isArray(block)) {
395
+ appendBlockToChain(chain, block, false);
396
+ }
397
+ context.__localeChainCache.set(startLocale, chain);
398
+ }
399
+ return chain;
400
+ }
401
+ function appendBlockToChain(chain, block, blocks) {
402
+ let follow = true;
403
+ for (let i = 0; i < block.length && isBoolean(follow); i++) {
404
+ const locale = block[i];
405
+ if (isString(locale)) {
406
+ follow = appendLocaleToChain(chain, block[i], blocks);
407
+ }
408
+ }
409
+ return follow;
410
+ }
411
+ function appendLocaleToChain(chain, locale, blocks) {
412
+ let follow;
413
+ const tokens = locale.split('-');
414
+ do {
415
+ const target = tokens.join('-');
416
+ follow = appendItemToChain(chain, target, blocks);
417
+ tokens.splice(-1, 1);
418
+ } while (tokens.length && follow === true);
419
+ return follow;
420
+ }
421
+ function appendItemToChain(chain, target, blocks) {
422
+ let follow = false;
423
+ if (!chain.includes(target)) {
424
+ follow = true;
425
+ if (target) {
426
+ follow = target[target.length - 1] !== '!';
427
+ const locale = target.replace(/!/g, '');
428
+ chain.push(locale);
429
+ if ((isArray(blocks) || isPlainObject(blocks)) &&
430
+ blocks[locale] // eslint-disable-line @typescript-eslint/no-explicit-any
431
+ ) {
432
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
433
+ follow = blocks[locale];
434
+ }
435
+ }
436
+ }
437
+ return follow;
438
+ }
439
+
440
+ const pathStateMachine = [];
441
+ pathStateMachine[0 /* States.BEFORE_PATH */] = {
442
+ ["w" /* PathCharTypes.WORKSPACE */]: [0 /* States.BEFORE_PATH */],
443
+ ["i" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
444
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */],
445
+ ["o" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */]
446
+ };
447
+ pathStateMachine[1 /* States.IN_PATH */] = {
448
+ ["w" /* PathCharTypes.WORKSPACE */]: [1 /* States.IN_PATH */],
449
+ ["." /* PathCharTypes.DOT */]: [2 /* States.BEFORE_IDENT */],
450
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */],
451
+ ["o" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */]
452
+ };
453
+ pathStateMachine[2 /* States.BEFORE_IDENT */] = {
454
+ ["w" /* PathCharTypes.WORKSPACE */]: [2 /* States.BEFORE_IDENT */],
455
+ ["i" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
456
+ ["0" /* PathCharTypes.ZERO */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */]
457
+ };
458
+ pathStateMachine[3 /* States.IN_IDENT */] = {
459
+ ["i" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
460
+ ["0" /* PathCharTypes.ZERO */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
461
+ ["w" /* PathCharTypes.WORKSPACE */]: [1 /* States.IN_PATH */, 1 /* Actions.PUSH */],
462
+ ["." /* PathCharTypes.DOT */]: [2 /* States.BEFORE_IDENT */, 1 /* Actions.PUSH */],
463
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */, 1 /* Actions.PUSH */],
464
+ ["o" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */, 1 /* Actions.PUSH */]
465
+ };
466
+ pathStateMachine[4 /* States.IN_SUB_PATH */] = {
467
+ ["'" /* PathCharTypes.SINGLE_QUOTE */]: [5 /* States.IN_SINGLE_QUOTE */, 0 /* Actions.APPEND */],
468
+ ["\"" /* PathCharTypes.DOUBLE_QUOTE */]: [6 /* States.IN_DOUBLE_QUOTE */, 0 /* Actions.APPEND */],
469
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [
470
+ 4 /* States.IN_SUB_PATH */,
471
+ 2 /* Actions.INC_SUB_PATH_DEPTH */
472
+ ],
473
+ ["]" /* PathCharTypes.RIGHT_BRACKET */]: [1 /* States.IN_PATH */, 3 /* Actions.PUSH_SUB_PATH */],
474
+ ["o" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,
475
+ ["l" /* PathCharTypes.ELSE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */]
476
+ };
477
+ pathStateMachine[5 /* States.IN_SINGLE_QUOTE */] = {
478
+ ["'" /* PathCharTypes.SINGLE_QUOTE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */],
479
+ ["o" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,
480
+ ["l" /* PathCharTypes.ELSE */]: [5 /* States.IN_SINGLE_QUOTE */, 0 /* Actions.APPEND */]
481
+ };
482
+ pathStateMachine[6 /* States.IN_DOUBLE_QUOTE */] = {
483
+ ["\"" /* PathCharTypes.DOUBLE_QUOTE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */],
484
+ ["o" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,
485
+ ["l" /* PathCharTypes.ELSE */]: [6 /* States.IN_DOUBLE_QUOTE */, 0 /* Actions.APPEND */]
486
+ };
487
+ /**
488
+ * Check if an expression is a literal value.
489
+ */
490
+ const literalValueRE = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
491
+ function isLiteral(exp) {
492
+ return literalValueRE.test(exp);
493
+ }
494
+ /**
495
+ * Strip quotes from a string
496
+ */
497
+ function stripQuotes(str) {
498
+ const a = str.charCodeAt(0);
499
+ const b = str.charCodeAt(str.length - 1);
500
+ return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str;
501
+ }
502
+ /**
503
+ * Determine the type of a character in a keypath.
504
+ */
505
+ function getPathCharType(ch) {
506
+ if (ch === undefined || ch === null) {
507
+ return "o" /* PathCharTypes.END_OF_FAIL */;
508
+ }
509
+ const code = ch.charCodeAt(0);
510
+ switch (code) {
511
+ case 0x5b: // [
512
+ case 0x5d: // ]
513
+ case 0x2e: // .
514
+ case 0x22: // "
515
+ case 0x27: // '
516
+ return ch;
517
+ case 0x5f: // _
518
+ case 0x24: // $
519
+ case 0x2d: // -
520
+ return "i" /* PathCharTypes.IDENT */;
521
+ case 0x09: // Tab (HT)
522
+ case 0x0a: // Newline (LF)
523
+ case 0x0d: // Return (CR)
524
+ case 0xa0: // No-break space (NBSP)
525
+ case 0xfeff: // Byte Order Mark (BOM)
526
+ case 0x2028: // Line Separator (LS)
527
+ case 0x2029: // Paragraph Separator (PS)
528
+ return "w" /* PathCharTypes.WORKSPACE */;
529
+ }
530
+ return "i" /* PathCharTypes.IDENT */;
531
+ }
532
+ /**
533
+ * Format a subPath, return its plain form if it is
534
+ * a literal string or number. Otherwise prepend the
535
+ * dynamic indicator (*).
536
+ */
537
+ function formatSubPath(path) {
538
+ const trimmed = path.trim();
539
+ // invalid leading 0
540
+ if (path.charAt(0) === '0' && isNaN(parseInt(path))) {
541
+ return false;
542
+ }
543
+ return isLiteral(trimmed)
544
+ ? stripQuotes(trimmed)
545
+ : "*" /* PathCharTypes.ASTARISK */ + trimmed;
546
+ }
547
+ /**
548
+ * Parse a string path into an array of segments
549
+ */
550
+ function parse(path) {
551
+ const keys = [];
552
+ let index = -1;
553
+ let mode = 0 /* States.BEFORE_PATH */;
554
+ let subPathDepth = 0;
555
+ let c;
556
+ let key; // eslint-disable-line
557
+ let newChar;
558
+ let type;
559
+ let transition;
560
+ let action;
561
+ let typeMap;
562
+ const actions = [];
563
+ actions[0 /* Actions.APPEND */] = () => {
564
+ if (key === undefined) {
565
+ key = newChar;
566
+ }
567
+ else {
568
+ key += newChar;
569
+ }
570
+ };
571
+ actions[1 /* Actions.PUSH */] = () => {
572
+ if (key !== undefined) {
573
+ keys.push(key);
574
+ key = undefined;
575
+ }
576
+ };
577
+ actions[2 /* Actions.INC_SUB_PATH_DEPTH */] = () => {
578
+ actions[0 /* Actions.APPEND */]();
579
+ subPathDepth++;
580
+ };
581
+ actions[3 /* Actions.PUSH_SUB_PATH */] = () => {
582
+ if (subPathDepth > 0) {
583
+ subPathDepth--;
584
+ mode = 4 /* States.IN_SUB_PATH */;
585
+ actions[0 /* Actions.APPEND */]();
586
+ }
587
+ else {
588
+ subPathDepth = 0;
589
+ if (key === undefined) {
590
+ return false;
591
+ }
592
+ key = formatSubPath(key);
593
+ if (key === false) {
594
+ return false;
595
+ }
596
+ else {
597
+ actions[1 /* Actions.PUSH */]();
598
+ }
599
+ }
600
+ };
601
+ function maybeUnescapeQuote() {
602
+ const nextChar = path[index + 1];
603
+ if ((mode === 5 /* States.IN_SINGLE_QUOTE */ &&
604
+ nextChar === "'" /* PathCharTypes.SINGLE_QUOTE */) ||
605
+ (mode === 6 /* States.IN_DOUBLE_QUOTE */ &&
606
+ nextChar === "\"" /* PathCharTypes.DOUBLE_QUOTE */)) {
607
+ index++;
608
+ newChar = '\\' + nextChar;
609
+ actions[0 /* Actions.APPEND */]();
610
+ return true;
611
+ }
612
+ }
613
+ while (mode !== null) {
614
+ index++;
615
+ c = path[index];
616
+ if (c === '\\' && maybeUnescapeQuote()) {
617
+ continue;
618
+ }
619
+ type = getPathCharType(c);
620
+ typeMap = pathStateMachine[mode];
621
+ transition = typeMap[type] || typeMap["l" /* PathCharTypes.ELSE */] || 8 /* States.ERROR */;
622
+ // check parse error
623
+ if (transition === 8 /* States.ERROR */) {
624
+ return;
625
+ }
626
+ mode = transition[0];
627
+ if (transition[1] !== undefined) {
628
+ action = actions[transition[1]];
629
+ if (action) {
630
+ newChar = c;
631
+ if (action() === false) {
632
+ return;
633
+ }
634
+ }
635
+ }
636
+ // check parse finish
637
+ if (mode === 7 /* States.AFTER_PATH */) {
638
+ return keys;
639
+ }
640
+ }
641
+ }
642
+ // path token cache
643
+ const cache = new Map();
644
+ /**
645
+ * key-value message resolver
646
+ *
647
+ * @remarks
648
+ * Resolves messages with the key-value structure. Note that messages with a hierarchical structure such as objects cannot be resolved
649
+ *
650
+ * @param obj - A target object to be resolved with path
651
+ * @param path - A {@link Path | path} to resolve the value of message
652
+ *
653
+ * @returns A resolved {@link PathValue | path value}
654
+ *
655
+ * @VueI18nGeneral
656
+ */
657
+ function resolveWithKeyValue(obj, path) {
658
+ return isObject(obj) ? obj[path] : null;
659
+ }
660
+ /**
661
+ * message resolver
662
+ *
663
+ * @remarks
664
+ * Resolves messages. messages with a hierarchical structure such as objects can be resolved. This resolver is used in VueI18n as default.
665
+ *
666
+ * @param obj - A target object to be resolved with path
667
+ * @param path - A {@link Path | path} to resolve the value of message
668
+ *
669
+ * @returns A resolved {@link PathValue | path value}
670
+ *
671
+ * @VueI18nGeneral
672
+ */
673
+ function resolveValue(obj, path) {
674
+ // check object
675
+ if (!isObject(obj)) {
676
+ return null;
677
+ }
678
+ // parse path
679
+ let hit = cache.get(path);
680
+ if (!hit) {
681
+ hit = parse(path);
682
+ if (hit) {
683
+ cache.set(path, hit);
684
+ }
685
+ }
686
+ // check hit
687
+ if (!hit) {
688
+ return null;
689
+ }
690
+ // resolve path value
691
+ const len = hit.length;
692
+ let last = obj;
693
+ let i = 0;
694
+ while (i < len) {
695
+ const key = hit[i];
696
+ /**
697
+ * NOTE:
698
+ * if `key` is intlify message format AST node key and `last` is intlify message format AST, skip it.
699
+ * because the AST node is not a key-value structure.
700
+ */
701
+ if (AST_NODE_PROPS_KEYS.includes(key) && isMessageAST(last)) {
702
+ return null;
703
+ }
704
+ const val = last[key];
705
+ if (val === undefined) {
706
+ return null;
707
+ }
708
+ if (isFunction(last)) {
709
+ return null;
710
+ }
711
+ last = val;
712
+ i++;
713
+ }
714
+ return last;
715
+ }
716
+
717
+ const CoreWarnCodes = {
718
+ NOT_FOUND_KEY: 1,
719
+ FALLBACK_TO_TRANSLATE: 2,
720
+ CANNOT_FORMAT_NUMBER: 3,
721
+ FALLBACK_TO_NUMBER_FORMAT: 4,
722
+ CANNOT_FORMAT_DATE: 5,
723
+ FALLBACK_TO_DATE_FORMAT: 6,
724
+ EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7
725
+ };
726
+ const CORE_WARN_CODES_EXTEND_POINT = 8;
727
+ /** @internal */
728
+ const warnMessages = {
729
+ [CoreWarnCodes.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale messages.`,
730
+ [CoreWarnCodes.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
731
+ [CoreWarnCodes.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
732
+ [CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
733
+ [CoreWarnCodes.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
734
+ [CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
735
+ [CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: `This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future.`
736
+ };
737
+ function getWarnMessage(code, ...args) {
738
+ return format$1(warnMessages[code], ...args);
739
+ }
740
+
741
+ /* eslint-disable @typescript-eslint/no-explicit-any */
742
+ /**
743
+ * Intlify core-base version
744
+ * @internal
745
+ */
746
+ const VERSION = '11.1.7';
747
+ const NOT_REOSLVED = -1;
748
+ const DEFAULT_LOCALE = 'en-US';
749
+ const MISSING_RESOLVE_VALUE = '';
750
+ const capitalize = (str) => `${str.charAt(0).toLocaleUpperCase()}${str.substr(1)}`;
751
+ function getDefaultLinkedModifiers() {
752
+ return {
753
+ upper: (val, type) => {
754
+ // prettier-ignore
755
+ return type === 'text' && isString(val)
756
+ ? val.toUpperCase()
757
+ : type === 'vnode' && isObject(val) && '__v_isVNode' in val
758
+ ? val.children.toUpperCase()
759
+ : val;
760
+ },
761
+ lower: (val, type) => {
762
+ // prettier-ignore
763
+ return type === 'text' && isString(val)
764
+ ? val.toLowerCase()
765
+ : type === 'vnode' && isObject(val) && '__v_isVNode' in val
766
+ ? val.children.toLowerCase()
767
+ : val;
768
+ },
769
+ capitalize: (val, type) => {
770
+ // prettier-ignore
771
+ return (type === 'text' && isString(val)
772
+ ? capitalize(val)
773
+ : type === 'vnode' && isObject(val) && '__v_isVNode' in val
774
+ ? capitalize(val.children)
775
+ : val);
776
+ }
777
+ };
778
+ }
779
+ let _compiler;
780
+ function registerMessageCompiler(compiler) {
781
+ _compiler = compiler;
782
+ }
783
+ let _resolver;
784
+ /**
785
+ * Register the message resolver
786
+ *
787
+ * @param resolver - A {@link MessageResolver} function
788
+ *
789
+ * @VueI18nGeneral
790
+ */
791
+ function registerMessageResolver(resolver) {
792
+ _resolver = resolver;
793
+ }
794
+ let _fallbacker;
795
+ /**
796
+ * Register the locale fallbacker
797
+ *
798
+ * @param fallbacker - A {@link LocaleFallbacker} function
799
+ *
800
+ * @VueI18nGeneral
801
+ */
802
+ function registerLocaleFallbacker(fallbacker) {
803
+ _fallbacker = fallbacker;
804
+ }
805
+ // Additional Meta for Intlify DevTools
806
+ let _additionalMeta = null;
807
+ /* #__NO_SIDE_EFFECTS__ */
808
+ const setAdditionalMeta = (meta) => {
809
+ _additionalMeta = meta;
810
+ };
811
+ /* #__NO_SIDE_EFFECTS__ */
812
+ const getAdditionalMeta = () => _additionalMeta;
813
+ let _fallbackContext = null;
814
+ const setFallbackContext = (context) => {
815
+ _fallbackContext = context;
816
+ };
817
+ const getFallbackContext = () => _fallbackContext;
818
+ // ID for CoreContext
819
+ let _cid = 0;
820
+ function createCoreContext(options = {}) {
821
+ // setup options
822
+ const onWarn = isFunction(options.onWarn) ? options.onWarn : warn;
823
+ const version = isString(options.version) ? options.version : VERSION;
824
+ const locale = isString(options.locale) || isFunction(options.locale)
825
+ ? options.locale
826
+ : DEFAULT_LOCALE;
827
+ const _locale = isFunction(locale) ? DEFAULT_LOCALE : locale;
828
+ const fallbackLocale = isArray(options.fallbackLocale) ||
829
+ isPlainObject(options.fallbackLocale) ||
830
+ isString(options.fallbackLocale) ||
831
+ options.fallbackLocale === false
832
+ ? options.fallbackLocale
833
+ : _locale;
834
+ const messages = isPlainObject(options.messages)
835
+ ? options.messages
836
+ : createResources(_locale);
837
+ const datetimeFormats = isPlainObject(options.datetimeFormats)
838
+ ? options.datetimeFormats
839
+ : createResources(_locale)
840
+ ;
841
+ const numberFormats = isPlainObject(options.numberFormats)
842
+ ? options.numberFormats
843
+ : createResources(_locale)
844
+ ;
845
+ const modifiers = assign(create(), options.modifiers, getDefaultLinkedModifiers());
846
+ const pluralRules = options.pluralRules || create();
847
+ const missing = isFunction(options.missing) ? options.missing : null;
848
+ const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn)
849
+ ? options.missingWarn
850
+ : true;
851
+ const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn)
852
+ ? options.fallbackWarn
853
+ : true;
854
+ const fallbackFormat = !!options.fallbackFormat;
855
+ const unresolving = !!options.unresolving;
856
+ const postTranslation = isFunction(options.postTranslation)
857
+ ? options.postTranslation
858
+ : null;
859
+ const processor = isPlainObject(options.processor) ? options.processor : null;
860
+ const warnHtmlMessage = isBoolean(options.warnHtmlMessage)
861
+ ? options.warnHtmlMessage
862
+ : true;
863
+ const escapeParameter = !!options.escapeParameter;
864
+ const messageCompiler = isFunction(options.messageCompiler)
865
+ ? options.messageCompiler
866
+ : _compiler;
867
+ if ((process.env.NODE_ENV !== 'production') &&
868
+ true &&
869
+ true &&
870
+ isFunction(options.messageCompiler)) {
871
+ warnOnce(getWarnMessage(CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));
872
+ }
873
+ const messageResolver = isFunction(options.messageResolver)
874
+ ? options.messageResolver
875
+ : _resolver || resolveWithKeyValue;
876
+ const localeFallbacker = isFunction(options.localeFallbacker)
877
+ ? options.localeFallbacker
878
+ : _fallbacker || fallbackWithSimple;
879
+ const fallbackContext = isObject(options.fallbackContext)
880
+ ? options.fallbackContext
881
+ : undefined;
882
+ // setup internal options
883
+ const internalOptions = options;
884
+ const __datetimeFormatters = isObject(internalOptions.__datetimeFormatters)
885
+ ? internalOptions.__datetimeFormatters
886
+ : new Map()
887
+ ;
888
+ const __numberFormatters = isObject(internalOptions.__numberFormatters)
889
+ ? internalOptions.__numberFormatters
890
+ : new Map()
891
+ ;
892
+ const __meta = isObject(internalOptions.__meta) ? internalOptions.__meta : {};
893
+ _cid++;
894
+ const context = {
895
+ version,
896
+ cid: _cid,
897
+ locale,
898
+ fallbackLocale,
899
+ messages,
900
+ modifiers,
901
+ pluralRules,
902
+ missing,
903
+ missingWarn,
904
+ fallbackWarn,
905
+ fallbackFormat,
906
+ unresolving,
907
+ postTranslation,
908
+ processor,
909
+ warnHtmlMessage,
910
+ escapeParameter,
911
+ messageCompiler,
912
+ messageResolver,
913
+ localeFallbacker,
914
+ fallbackContext,
915
+ onWarn,
916
+ __meta
917
+ };
918
+ {
919
+ context.datetimeFormats = datetimeFormats;
920
+ context.numberFormats = numberFormats;
921
+ context.__datetimeFormatters = __datetimeFormatters;
922
+ context.__numberFormatters = __numberFormatters;
923
+ }
924
+ // for vue-devtools timeline event
925
+ if ((process.env.NODE_ENV !== 'production')) {
926
+ context.__v_emitter =
927
+ internalOptions.__v_emitter != null
928
+ ? internalOptions.__v_emitter
929
+ : undefined;
930
+ }
931
+ // NOTE: experimental !!
932
+ if ((process.env.NODE_ENV !== 'production') || __INTLIFY_PROD_DEVTOOLS__) {
933
+ initI18nDevTools(context, version, __meta);
934
+ }
935
+ return context;
936
+ }
937
+ const createResources = (locale) => ({ [locale]: create() });
938
+ /** @internal */
939
+ function isTranslateFallbackWarn(fallback, key) {
940
+ return fallback instanceof RegExp ? fallback.test(key) : fallback;
941
+ }
942
+ /** @internal */
943
+ function isTranslateMissingWarn(missing, key) {
944
+ return missing instanceof RegExp ? missing.test(key) : missing;
945
+ }
946
+ /** @internal */
947
+ function handleMissing(context, key, locale, missingWarn, type) {
948
+ const { missing, onWarn } = context;
949
+ // for vue-devtools timeline event
950
+ if ((process.env.NODE_ENV !== 'production')) {
951
+ const emitter = context.__v_emitter;
952
+ if (emitter) {
953
+ emitter.emit('missing', {
954
+ locale,
955
+ key,
956
+ type,
957
+ groupId: `${type}:${key}`
958
+ });
959
+ }
960
+ }
961
+ if (missing !== null) {
962
+ const ret = missing(context, locale, key, type);
963
+ return isString(ret) ? ret : key;
964
+ }
965
+ else {
966
+ if ((process.env.NODE_ENV !== 'production') && isTranslateMissingWarn(missingWarn, key)) {
967
+ onWarn(getWarnMessage(CoreWarnCodes.NOT_FOUND_KEY, { key, locale }));
968
+ }
969
+ return key;
970
+ }
971
+ }
972
+ /** @internal */
973
+ function updateFallbackLocale(ctx, locale, fallback) {
974
+ const context = ctx;
975
+ context.__localeChainCache = new Map();
976
+ ctx.localeFallbacker(ctx, fallback, locale);
977
+ }
978
+ /** @internal */
979
+ function isAlmostSameLocale(locale, compareLocale) {
980
+ if (locale === compareLocale)
981
+ return false;
982
+ return locale.split('-')[0] === compareLocale.split('-')[0];
983
+ }
984
+ /** @internal */
985
+ function isImplicitFallback(targetLocale, locales) {
986
+ const index = locales.indexOf(targetLocale);
987
+ if (index === -1) {
988
+ return false;
989
+ }
990
+ for (let i = index + 1; i < locales.length; i++) {
991
+ if (isAlmostSameLocale(targetLocale, locales[i])) {
992
+ return true;
993
+ }
994
+ }
995
+ return false;
996
+ }
997
+ /* eslint-enable @typescript-eslint/no-explicit-any */
998
+
999
+ const intlDefined = typeof Intl !== 'undefined';
1000
+ const Availabilities = {
1001
+ dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== 'undefined',
1002
+ numberFormat: intlDefined && typeof Intl.NumberFormat !== 'undefined'
1003
+ };
1004
+
1005
+ // implementation of `datetime` function
1006
+ function datetime(context, ...args) {
1007
+ const { datetimeFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;
1008
+ const { __datetimeFormatters } = context;
1009
+ if ((process.env.NODE_ENV !== 'production') && !Availabilities.dateTimeFormat) {
1010
+ onWarn(getWarnMessage(CoreWarnCodes.CANNOT_FORMAT_DATE));
1011
+ return MISSING_RESOLVE_VALUE;
1012
+ }
1013
+ const [key, value, options, overrides] = parseDateTimeArgs(...args);
1014
+ const missingWarn = isBoolean(options.missingWarn)
1015
+ ? options.missingWarn
1016
+ : context.missingWarn;
1017
+ const fallbackWarn = isBoolean(options.fallbackWarn)
1018
+ ? options.fallbackWarn
1019
+ : context.fallbackWarn;
1020
+ const part = !!options.part;
1021
+ const locale = getLocale(context, options);
1022
+ const locales = localeFallbacker(context, // eslint-disable-line @typescript-eslint/no-explicit-any
1023
+ fallbackLocale, locale);
1024
+ if (!isString(key) || key === '') {
1025
+ return new Intl.DateTimeFormat(locale, overrides).format(value);
1026
+ }
1027
+ // resolve format
1028
+ let datetimeFormat = {};
1029
+ let targetLocale;
1030
+ let format = null;
1031
+ let from = locale;
1032
+ let to = null;
1033
+ const type = 'datetime format';
1034
+ for (let i = 0; i < locales.length; i++) {
1035
+ targetLocale = to = locales[i];
1036
+ if ((process.env.NODE_ENV !== 'production') &&
1037
+ locale !== targetLocale &&
1038
+ isTranslateFallbackWarn(fallbackWarn, key)) {
1039
+ onWarn(getWarnMessage(CoreWarnCodes.FALLBACK_TO_DATE_FORMAT, {
1040
+ key,
1041
+ target: targetLocale
1042
+ }));
1043
+ }
1044
+ // for vue-devtools timeline event
1045
+ if ((process.env.NODE_ENV !== 'production') && locale !== targetLocale) {
1046
+ const emitter = context.__v_emitter;
1047
+ if (emitter) {
1048
+ emitter.emit('fallback', {
1049
+ type,
1050
+ key,
1051
+ from,
1052
+ to,
1053
+ groupId: `${type}:${key}`
1054
+ });
1055
+ }
1056
+ }
1057
+ datetimeFormat =
1058
+ datetimeFormats[targetLocale] || {};
1059
+ format = datetimeFormat[key];
1060
+ if (isPlainObject(format))
1061
+ break;
1062
+ handleMissing(context, key, targetLocale, missingWarn, type); // eslint-disable-line @typescript-eslint/no-explicit-any
1063
+ from = to;
1064
+ }
1065
+ // checking format and target locale
1066
+ if (!isPlainObject(format) || !isString(targetLocale)) {
1067
+ return unresolving ? NOT_REOSLVED : key;
1068
+ }
1069
+ let id = `${targetLocale}__${key}`;
1070
+ if (!isEmptyObject(overrides)) {
1071
+ id = `${id}__${JSON.stringify(overrides)}`;
1072
+ }
1073
+ let formatter = __datetimeFormatters.get(id);
1074
+ if (!formatter) {
1075
+ formatter = new Intl.DateTimeFormat(targetLocale, assign({}, format, overrides));
1076
+ __datetimeFormatters.set(id, formatter);
1077
+ }
1078
+ return !part ? formatter.format(value) : formatter.formatToParts(value);
1079
+ }
1080
+ /** @internal */
1081
+ const DATETIME_FORMAT_OPTIONS_KEYS = [
1082
+ 'localeMatcher',
1083
+ 'weekday',
1084
+ 'era',
1085
+ 'year',
1086
+ 'month',
1087
+ 'day',
1088
+ 'hour',
1089
+ 'minute',
1090
+ 'second',
1091
+ 'timeZoneName',
1092
+ 'formatMatcher',
1093
+ 'hour12',
1094
+ 'timeZone',
1095
+ 'dateStyle',
1096
+ 'timeStyle',
1097
+ 'calendar',
1098
+ 'dayPeriod',
1099
+ 'numberingSystem',
1100
+ 'hourCycle',
1101
+ 'fractionalSecondDigits'
1102
+ ];
1103
+ /** @internal */
1104
+ function parseDateTimeArgs(...args) {
1105
+ const [arg1, arg2, arg3, arg4] = args;
1106
+ const options = create();
1107
+ let overrides = create();
1108
+ let value;
1109
+ if (isString(arg1)) {
1110
+ // Only allow ISO strings - other date formats are often supported,
1111
+ // but may cause different results in different browsers.
1112
+ const matches = arg1.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
1113
+ if (!matches) {
1114
+ throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);
1115
+ }
1116
+ // Some browsers can not parse the iso datetime separated by space,
1117
+ // this is a compromise solution by replace the 'T'/' ' with 'T'
1118
+ const dateTime = matches[3]
1119
+ ? matches[3].trim().startsWith('T')
1120
+ ? `${matches[1].trim()}${matches[3].trim()}`
1121
+ : `${matches[1].trim()}T${matches[3].trim()}`
1122
+ : matches[1].trim();
1123
+ value = new Date(dateTime);
1124
+ try {
1125
+ // This will fail if the date is not valid
1126
+ value.toISOString();
1127
+ }
1128
+ catch {
1129
+ throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);
1130
+ }
1131
+ }
1132
+ else if (isDate(arg1)) {
1133
+ if (isNaN(arg1.getTime())) {
1134
+ throw createCoreError(CoreErrorCodes.INVALID_DATE_ARGUMENT);
1135
+ }
1136
+ value = arg1;
1137
+ }
1138
+ else if (isNumber(arg1)) {
1139
+ value = arg1;
1140
+ }
1141
+ else {
1142
+ throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
1143
+ }
1144
+ if (isString(arg2)) {
1145
+ options.key = arg2;
1146
+ }
1147
+ else if (isPlainObject(arg2)) {
1148
+ Object.keys(arg2).forEach(key => {
1149
+ if (DATETIME_FORMAT_OPTIONS_KEYS.includes(key)) {
1150
+ overrides[key] = arg2[key];
1151
+ }
1152
+ else {
1153
+ options[key] = arg2[key];
1154
+ }
1155
+ });
1156
+ }
1157
+ if (isString(arg3)) {
1158
+ options.locale = arg3;
1159
+ }
1160
+ else if (isPlainObject(arg3)) {
1161
+ overrides = arg3;
1162
+ }
1163
+ if (isPlainObject(arg4)) {
1164
+ overrides = arg4;
1165
+ }
1166
+ return [options.key || '', value, options, overrides];
1167
+ }
1168
+ /** @internal */
1169
+ function clearDateTimeFormat(ctx, locale, format) {
1170
+ const context = ctx;
1171
+ for (const key in format) {
1172
+ const id = `${locale}__${key}`;
1173
+ if (!context.__datetimeFormatters.has(id)) {
1174
+ continue;
1175
+ }
1176
+ context.__datetimeFormatters.delete(id);
1177
+ }
1178
+ }
1179
+
1180
+ // implementation of `number` function
1181
+ function number(context, ...args) {
1182
+ const { numberFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;
1183
+ const { __numberFormatters } = context;
1184
+ if ((process.env.NODE_ENV !== 'production') && !Availabilities.numberFormat) {
1185
+ onWarn(getWarnMessage(CoreWarnCodes.CANNOT_FORMAT_NUMBER));
1186
+ return MISSING_RESOLVE_VALUE;
1187
+ }
1188
+ const [key, value, options, overrides] = parseNumberArgs(...args);
1189
+ const missingWarn = isBoolean(options.missingWarn)
1190
+ ? options.missingWarn
1191
+ : context.missingWarn;
1192
+ const fallbackWarn = isBoolean(options.fallbackWarn)
1193
+ ? options.fallbackWarn
1194
+ : context.fallbackWarn;
1195
+ const part = !!options.part;
1196
+ const locale = getLocale(context, options);
1197
+ const locales = localeFallbacker(context, // eslint-disable-line @typescript-eslint/no-explicit-any
1198
+ fallbackLocale, locale);
1199
+ if (!isString(key) || key === '') {
1200
+ return new Intl.NumberFormat(locale, overrides).format(value);
1201
+ }
1202
+ // resolve format
1203
+ let numberFormat = {};
1204
+ let targetLocale;
1205
+ let format = null;
1206
+ let from = locale;
1207
+ let to = null;
1208
+ const type = 'number format';
1209
+ for (let i = 0; i < locales.length; i++) {
1210
+ targetLocale = to = locales[i];
1211
+ if ((process.env.NODE_ENV !== 'production') &&
1212
+ locale !== targetLocale &&
1213
+ isTranslateFallbackWarn(fallbackWarn, key)) {
1214
+ onWarn(getWarnMessage(CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT, {
1215
+ key,
1216
+ target: targetLocale
1217
+ }));
1218
+ }
1219
+ // for vue-devtools timeline event
1220
+ if ((process.env.NODE_ENV !== 'production') && locale !== targetLocale) {
1221
+ const emitter = context.__v_emitter;
1222
+ if (emitter) {
1223
+ emitter.emit('fallback', {
1224
+ type,
1225
+ key,
1226
+ from,
1227
+ to,
1228
+ groupId: `${type}:${key}`
1229
+ });
1230
+ }
1231
+ }
1232
+ numberFormat =
1233
+ numberFormats[targetLocale] || {};
1234
+ format = numberFormat[key];
1235
+ if (isPlainObject(format))
1236
+ break;
1237
+ handleMissing(context, key, targetLocale, missingWarn, type); // eslint-disable-line @typescript-eslint/no-explicit-any
1238
+ from = to;
1239
+ }
1240
+ // checking format and target locale
1241
+ if (!isPlainObject(format) || !isString(targetLocale)) {
1242
+ return unresolving ? NOT_REOSLVED : key;
1243
+ }
1244
+ let id = `${targetLocale}__${key}`;
1245
+ if (!isEmptyObject(overrides)) {
1246
+ id = `${id}__${JSON.stringify(overrides)}`;
1247
+ }
1248
+ let formatter = __numberFormatters.get(id);
1249
+ if (!formatter) {
1250
+ formatter = new Intl.NumberFormat(targetLocale, assign({}, format, overrides));
1251
+ __numberFormatters.set(id, formatter);
1252
+ }
1253
+ return !part ? formatter.format(value) : formatter.formatToParts(value);
1254
+ }
1255
+ /** @internal */
1256
+ const NUMBER_FORMAT_OPTIONS_KEYS = [
1257
+ 'localeMatcher',
1258
+ 'style',
1259
+ 'currency',
1260
+ 'currencyDisplay',
1261
+ 'currencySign',
1262
+ 'useGrouping',
1263
+ 'minimumIntegerDigits',
1264
+ 'minimumFractionDigits',
1265
+ 'maximumFractionDigits',
1266
+ 'minimumSignificantDigits',
1267
+ 'maximumSignificantDigits',
1268
+ 'compactDisplay',
1269
+ 'notation',
1270
+ 'signDisplay',
1271
+ 'unit',
1272
+ 'unitDisplay',
1273
+ 'roundingMode',
1274
+ 'roundingPriority',
1275
+ 'roundingIncrement',
1276
+ 'trailingZeroDisplay'
1277
+ ];
1278
+ /** @internal */
1279
+ function parseNumberArgs(...args) {
1280
+ const [arg1, arg2, arg3, arg4] = args;
1281
+ const options = create();
1282
+ let overrides = create();
1283
+ if (!isNumber(arg1)) {
1284
+ throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
1285
+ }
1286
+ const value = arg1;
1287
+ if (isString(arg2)) {
1288
+ options.key = arg2;
1289
+ }
1290
+ else if (isPlainObject(arg2)) {
1291
+ Object.keys(arg2).forEach(key => {
1292
+ if (NUMBER_FORMAT_OPTIONS_KEYS.includes(key)) {
1293
+ overrides[key] = arg2[key];
1294
+ }
1295
+ else {
1296
+ options[key] = arg2[key];
1297
+ }
1298
+ });
1299
+ }
1300
+ if (isString(arg3)) {
1301
+ options.locale = arg3;
1302
+ }
1303
+ else if (isPlainObject(arg3)) {
1304
+ overrides = arg3;
1305
+ }
1306
+ if (isPlainObject(arg4)) {
1307
+ overrides = arg4;
1308
+ }
1309
+ return [options.key || '', value, options, overrides];
1310
+ }
1311
+ /** @internal */
1312
+ function clearNumberFormat(ctx, locale, format) {
1313
+ const context = ctx;
1314
+ for (const key in format) {
1315
+ const id = `${locale}__${key}`;
1316
+ if (!context.__numberFormatters.has(id)) {
1317
+ continue;
1318
+ }
1319
+ context.__numberFormatters.delete(id);
1320
+ }
1321
+ }
1322
+
1323
+ const DEFAULT_MODIFIER = (str) => str;
1324
+ const DEFAULT_MESSAGE = (ctx) => ''; // eslint-disable-line
1325
+ const DEFAULT_MESSAGE_DATA_TYPE = 'text';
1326
+ const DEFAULT_NORMALIZE = (values) => values.length === 0 ? '' : join(values);
1327
+ const DEFAULT_INTERPOLATE = toDisplayString;
1328
+ function pluralDefault(choice, choicesLength) {
1329
+ choice = Math.abs(choice);
1330
+ if (choicesLength === 2) {
1331
+ // prettier-ignore
1332
+ return choice
1333
+ ? choice > 1
1334
+ ? 1
1335
+ : 0
1336
+ : 1;
1337
+ }
1338
+ return choice ? Math.min(choice, 2) : 0;
1339
+ }
1340
+ function getPluralIndex(options) {
1341
+ // prettier-ignore
1342
+ const index = isNumber(options.pluralIndex)
1343
+ ? options.pluralIndex
1344
+ : -1;
1345
+ // prettier-ignore
1346
+ return options.named && (isNumber(options.named.count) || isNumber(options.named.n))
1347
+ ? isNumber(options.named.count)
1348
+ ? options.named.count
1349
+ : isNumber(options.named.n)
1350
+ ? options.named.n
1351
+ : index
1352
+ : index;
1353
+ }
1354
+ function normalizeNamed(pluralIndex, props) {
1355
+ if (!props.count) {
1356
+ props.count = pluralIndex;
1357
+ }
1358
+ if (!props.n) {
1359
+ props.n = pluralIndex;
1360
+ }
1361
+ }
1362
+ function createMessageContext(options = {}) {
1363
+ const locale = options.locale;
1364
+ const pluralIndex = getPluralIndex(options);
1365
+ const pluralRule = isObject(options.pluralRules) &&
1366
+ isString(locale) &&
1367
+ isFunction(options.pluralRules[locale])
1368
+ ? options.pluralRules[locale]
1369
+ : pluralDefault;
1370
+ const orgPluralRule = isObject(options.pluralRules) &&
1371
+ isString(locale) &&
1372
+ isFunction(options.pluralRules[locale])
1373
+ ? pluralDefault
1374
+ : undefined;
1375
+ const plural = (messages) => {
1376
+ return messages[pluralRule(pluralIndex, messages.length, orgPluralRule)];
1377
+ };
1378
+ const _list = options.list || [];
1379
+ const list = (index) => _list[index];
1380
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1381
+ const _named = options.named || create();
1382
+ isNumber(options.pluralIndex) && normalizeNamed(pluralIndex, _named);
1383
+ const named = (key) => _named[key];
1384
+ function message(key, useLinked) {
1385
+ // prettier-ignore
1386
+ const msg = isFunction(options.messages)
1387
+ ? options.messages(key, !!useLinked)
1388
+ : isObject(options.messages)
1389
+ ? options.messages[key]
1390
+ : false;
1391
+ return !msg
1392
+ ? options.parent
1393
+ ? options.parent.message(key) // resolve from parent messages
1394
+ : DEFAULT_MESSAGE
1395
+ : msg;
1396
+ }
1397
+ const _modifier = (name) => options.modifiers
1398
+ ? options.modifiers[name]
1399
+ : DEFAULT_MODIFIER;
1400
+ const normalize = isPlainObject(options.processor) && isFunction(options.processor.normalize)
1401
+ ? options.processor.normalize
1402
+ : DEFAULT_NORMALIZE;
1403
+ const interpolate = isPlainObject(options.processor) &&
1404
+ isFunction(options.processor.interpolate)
1405
+ ? options.processor.interpolate
1406
+ : DEFAULT_INTERPOLATE;
1407
+ const type = isPlainObject(options.processor) && isString(options.processor.type)
1408
+ ? options.processor.type
1409
+ : DEFAULT_MESSAGE_DATA_TYPE;
1410
+ const linked = (key, ...args) => {
1411
+ const [arg1, arg2] = args;
1412
+ let type = 'text';
1413
+ let modifier = '';
1414
+ if (args.length === 1) {
1415
+ if (isObject(arg1)) {
1416
+ modifier = arg1.modifier || modifier;
1417
+ type = arg1.type || type;
1418
+ }
1419
+ else if (isString(arg1)) {
1420
+ modifier = arg1 || modifier;
1421
+ }
1422
+ }
1423
+ else if (args.length === 2) {
1424
+ if (isString(arg1)) {
1425
+ modifier = arg1 || modifier;
1426
+ }
1427
+ if (isString(arg2)) {
1428
+ type = arg2 || type;
1429
+ }
1430
+ }
1431
+ const ret = message(key, true)(ctx);
1432
+ const msg =
1433
+ // The message in vnode resolved with linked are returned as an array by processor.nomalize
1434
+ type === 'vnode' && isArray(ret) && modifier
1435
+ ? ret[0]
1436
+ : ret;
1437
+ return modifier ? _modifier(modifier)(msg, type) : msg;
1438
+ };
1439
+ const ctx = {
1440
+ ["list" /* HelperNameMap.LIST */]: list,
1441
+ ["named" /* HelperNameMap.NAMED */]: named,
1442
+ ["plural" /* HelperNameMap.PLURAL */]: plural,
1443
+ ["linked" /* HelperNameMap.LINKED */]: linked,
1444
+ ["message" /* HelperNameMap.MESSAGE */]: message,
1445
+ ["type" /* HelperNameMap.TYPE */]: type,
1446
+ ["interpolate" /* HelperNameMap.INTERPOLATE */]: interpolate,
1447
+ ["normalize" /* HelperNameMap.NORMALIZE */]: normalize,
1448
+ ["values" /* HelperNameMap.VALUES */]: assign(create(), _list, _named)
1449
+ };
1450
+ return ctx;
1451
+ }
1452
+
1453
+ const NOOP_MESSAGE_FUNCTION = () => '';
1454
+ const isMessageFunction = (val) => isFunction(val);
1455
+ // implementation of `translate` function
1456
+ function translate(context, ...args) {
1457
+ const { fallbackFormat, postTranslation, unresolving, messageCompiler, fallbackLocale, messages } = context;
1458
+ const [key, options] = parseTranslateArgs(...args);
1459
+ const missingWarn = isBoolean(options.missingWarn)
1460
+ ? options.missingWarn
1461
+ : context.missingWarn;
1462
+ const fallbackWarn = isBoolean(options.fallbackWarn)
1463
+ ? options.fallbackWarn
1464
+ : context.fallbackWarn;
1465
+ const escapeParameter = isBoolean(options.escapeParameter)
1466
+ ? options.escapeParameter
1467
+ : context.escapeParameter;
1468
+ const resolvedMessage = !!options.resolvedMessage;
1469
+ // prettier-ignore
1470
+ const defaultMsgOrKey = isString(options.default) || isBoolean(options.default) // default by function option
1471
+ ? !isBoolean(options.default)
1472
+ ? options.default
1473
+ : (!messageCompiler ? () => key : key)
1474
+ : fallbackFormat // default by `fallbackFormat` option
1475
+ ? (!messageCompiler ? () => key : key)
1476
+ : null;
1477
+ const enableDefaultMsg = fallbackFormat ||
1478
+ (defaultMsgOrKey != null &&
1479
+ (isString(defaultMsgOrKey) || isFunction(defaultMsgOrKey)));
1480
+ const locale = getLocale(context, options);
1481
+ // escape params
1482
+ escapeParameter && escapeParams(options);
1483
+ // resolve message format
1484
+ // eslint-disable-next-line prefer-const
1485
+ let [formatScope, targetLocale, message] = !resolvedMessage
1486
+ ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn)
1487
+ : [
1488
+ key,
1489
+ locale,
1490
+ messages[locale] || create()
1491
+ ];
1492
+ // NOTE:
1493
+ // Fix to work around `ssrTransfrom` bug in Vite.
1494
+ // https://github.com/vitejs/vite/issues/4306
1495
+ // To get around this, use temporary variables.
1496
+ // https://github.com/nuxt/framework/issues/1461#issuecomment-954606243
1497
+ let format = formatScope;
1498
+ // if you use default message, set it as message format!
1499
+ let cacheBaseKey = key;
1500
+ if (!resolvedMessage &&
1501
+ !(isString(format) ||
1502
+ isMessageAST(format) ||
1503
+ isMessageFunction(format))) {
1504
+ if (enableDefaultMsg) {
1505
+ format = defaultMsgOrKey;
1506
+ cacheBaseKey = format;
1507
+ }
1508
+ }
1509
+ // checking message format and target locale
1510
+ if (!resolvedMessage &&
1511
+ (!(isString(format) ||
1512
+ isMessageAST(format) ||
1513
+ isMessageFunction(format)) ||
1514
+ !isString(targetLocale))) {
1515
+ return unresolving ? NOT_REOSLVED : key;
1516
+ }
1517
+ // TODO: refactor
1518
+ if ((process.env.NODE_ENV !== 'production') && isString(format) && context.messageCompiler == null) {
1519
+ warn(`The message format compilation is not supported in this build. ` +
1520
+ `Because message compiler isn't included. ` +
1521
+ `You need to pre-compilation all message format. ` +
1522
+ `So translate function return '${key}'.`);
1523
+ return key;
1524
+ }
1525
+ // setup compile error detecting
1526
+ let occurred = false;
1527
+ const onError = () => {
1528
+ occurred = true;
1529
+ };
1530
+ // compile message format
1531
+ const msg = !isMessageFunction(format)
1532
+ ? compileMessageFormat(context, key, targetLocale, format, cacheBaseKey, onError)
1533
+ : format;
1534
+ // if occurred compile error, return the message format
1535
+ if (occurred) {
1536
+ return format;
1537
+ }
1538
+ // evaluate message with context
1539
+ const ctxOptions = getMessageContextOptions(context, targetLocale, message, options);
1540
+ const msgContext = createMessageContext(ctxOptions);
1541
+ const messaged = evaluateMessage(context, msg, msgContext);
1542
+ // if use post translation option, proceed it with handler
1543
+ const ret = postTranslation
1544
+ ? postTranslation(messaged, key)
1545
+ : messaged;
1546
+ // NOTE: experimental !!
1547
+ if ((process.env.NODE_ENV !== 'production') || __INTLIFY_PROD_DEVTOOLS__) {
1548
+ // prettier-ignore
1549
+ const payloads = {
1550
+ timestamp: Date.now(),
1551
+ key: isString(key)
1552
+ ? key
1553
+ : isMessageFunction(format)
1554
+ ? format.key
1555
+ : '',
1556
+ locale: targetLocale || (isMessageFunction(format)
1557
+ ? format.locale
1558
+ : ''),
1559
+ format: isString(format)
1560
+ ? format
1561
+ : isMessageFunction(format)
1562
+ ? format.source
1563
+ : '',
1564
+ message: ret
1565
+ };
1566
+ payloads.meta = assign({}, context.__meta, getAdditionalMeta() || {});
1567
+ translateDevTools(payloads);
1568
+ }
1569
+ return ret;
1570
+ }
1571
+ function escapeParams(options) {
1572
+ if (isArray(options.list)) {
1573
+ options.list = options.list.map(item => isString(item) ? escapeHtml(item) : item);
1574
+ }
1575
+ else if (isObject(options.named)) {
1576
+ Object.keys(options.named).forEach(key => {
1577
+ if (isString(options.named[key])) {
1578
+ options.named[key] = escapeHtml(options.named[key]);
1579
+ }
1580
+ });
1581
+ }
1582
+ }
1583
+ function resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {
1584
+ const { messages, onWarn, messageResolver: resolveValue, localeFallbacker } = context;
1585
+ const locales = localeFallbacker(context, fallbackLocale, locale); // eslint-disable-line @typescript-eslint/no-explicit-any
1586
+ let message = create();
1587
+ let targetLocale;
1588
+ let format = null;
1589
+ let from = locale;
1590
+ let to = null;
1591
+ const type = 'translate';
1592
+ for (let i = 0; i < locales.length; i++) {
1593
+ targetLocale = to = locales[i];
1594
+ if ((process.env.NODE_ENV !== 'production') &&
1595
+ locale !== targetLocale &&
1596
+ !isAlmostSameLocale(locale, targetLocale) &&
1597
+ isTranslateFallbackWarn(fallbackWarn, key)) {
1598
+ onWarn(getWarnMessage(CoreWarnCodes.FALLBACK_TO_TRANSLATE, {
1599
+ key,
1600
+ target: targetLocale
1601
+ }));
1602
+ }
1603
+ // for vue-devtools timeline event
1604
+ if ((process.env.NODE_ENV !== 'production') && locale !== targetLocale) {
1605
+ const emitter = context.__v_emitter;
1606
+ if (emitter) {
1607
+ emitter.emit('fallback', {
1608
+ type,
1609
+ key,
1610
+ from,
1611
+ to,
1612
+ groupId: `${type}:${key}`
1613
+ });
1614
+ }
1615
+ }
1616
+ message =
1617
+ messages[targetLocale] || create();
1618
+ // for vue-devtools timeline event
1619
+ let start = null;
1620
+ let startTag;
1621
+ let endTag;
1622
+ if ((process.env.NODE_ENV !== 'production') && inBrowser) {
1623
+ start = window.performance.now();
1624
+ startTag = 'intlify-message-resolve-start';
1625
+ endTag = 'intlify-message-resolve-end';
1626
+ mark && mark(startTag);
1627
+ }
1628
+ if ((format = resolveValue(message, key)) === null) {
1629
+ // if null, resolve with object key path
1630
+ format = message[key]; // eslint-disable-line @typescript-eslint/no-explicit-any
1631
+ }
1632
+ // for vue-devtools timeline event
1633
+ if ((process.env.NODE_ENV !== 'production') && inBrowser) {
1634
+ const end = window.performance.now();
1635
+ const emitter = context.__v_emitter;
1636
+ if (emitter && start && format) {
1637
+ emitter.emit('message-resolve', {
1638
+ type: 'message-resolve',
1639
+ key,
1640
+ message: format,
1641
+ time: end - start,
1642
+ groupId: `${type}:${key}`
1643
+ });
1644
+ }
1645
+ if (startTag && endTag && mark && measure) {
1646
+ mark(endTag);
1647
+ measure('intlify message resolve', startTag, endTag);
1648
+ }
1649
+ }
1650
+ if (isString(format) || isMessageAST(format) || isMessageFunction(format)) {
1651
+ break;
1652
+ }
1653
+ if (!isImplicitFallback(targetLocale, locales)) {
1654
+ const missingRet = handleMissing(context, // eslint-disable-line @typescript-eslint/no-explicit-any
1655
+ key, targetLocale, missingWarn, type);
1656
+ if (missingRet !== key) {
1657
+ format = missingRet;
1658
+ }
1659
+ }
1660
+ from = to;
1661
+ }
1662
+ return [format, targetLocale, message];
1663
+ }
1664
+ function compileMessageFormat(context, key, targetLocale, format, cacheBaseKey, onError) {
1665
+ const { messageCompiler, warnHtmlMessage } = context;
1666
+ if (isMessageFunction(format)) {
1667
+ const msg = format;
1668
+ msg.locale = msg.locale || targetLocale;
1669
+ msg.key = msg.key || key;
1670
+ return msg;
1671
+ }
1672
+ if (messageCompiler == null) {
1673
+ const msg = (() => format);
1674
+ msg.locale = targetLocale;
1675
+ msg.key = key;
1676
+ return msg;
1677
+ }
1678
+ // for vue-devtools timeline event
1679
+ let start = null;
1680
+ let startTag;
1681
+ let endTag;
1682
+ if ((process.env.NODE_ENV !== 'production') && inBrowser) {
1683
+ start = window.performance.now();
1684
+ startTag = 'intlify-message-compilation-start';
1685
+ endTag = 'intlify-message-compilation-end';
1686
+ mark && mark(startTag);
1687
+ }
1688
+ const msg = messageCompiler(format, getCompileContext(context, targetLocale, cacheBaseKey, format, warnHtmlMessage, onError));
1689
+ // for vue-devtools timeline event
1690
+ if ((process.env.NODE_ENV !== 'production') && inBrowser) {
1691
+ const end = window.performance.now();
1692
+ const emitter = context.__v_emitter;
1693
+ if (emitter && start) {
1694
+ emitter.emit('message-compilation', {
1695
+ type: 'message-compilation',
1696
+ message: format,
1697
+ time: end - start,
1698
+ groupId: `${'translate'}:${key}`
1699
+ });
1700
+ }
1701
+ if (startTag && endTag && mark && measure) {
1702
+ mark(endTag);
1703
+ measure('intlify message compilation', startTag, endTag);
1704
+ }
1705
+ }
1706
+ msg.locale = targetLocale;
1707
+ msg.key = key;
1708
+ msg.source = format;
1709
+ return msg;
1710
+ }
1711
+ function evaluateMessage(context, msg, msgCtx) {
1712
+ // for vue-devtools timeline event
1713
+ let start = null;
1714
+ let startTag;
1715
+ let endTag;
1716
+ if ((process.env.NODE_ENV !== 'production') && inBrowser) {
1717
+ start = window.performance.now();
1718
+ startTag = 'intlify-message-evaluation-start';
1719
+ endTag = 'intlify-message-evaluation-end';
1720
+ mark && mark(startTag);
1721
+ }
1722
+ const messaged = msg(msgCtx);
1723
+ // for vue-devtools timeline event
1724
+ if ((process.env.NODE_ENV !== 'production') && inBrowser) {
1725
+ const end = window.performance.now();
1726
+ const emitter = context.__v_emitter;
1727
+ if (emitter && start) {
1728
+ emitter.emit('message-evaluation', {
1729
+ type: 'message-evaluation',
1730
+ value: messaged,
1731
+ time: end - start,
1732
+ groupId: `${'translate'}:${msg.key}`
1733
+ });
1734
+ }
1735
+ if (startTag && endTag && mark && measure) {
1736
+ mark(endTag);
1737
+ measure('intlify message evaluation', startTag, endTag);
1738
+ }
1739
+ }
1740
+ return messaged;
1741
+ }
1742
+ /** @internal */
1743
+ function parseTranslateArgs(...args) {
1744
+ const [arg1, arg2, arg3] = args;
1745
+ const options = create();
1746
+ if (!isString(arg1) &&
1747
+ !isNumber(arg1) &&
1748
+ !isMessageFunction(arg1) &&
1749
+ !isMessageAST(arg1)) {
1750
+ throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);
1751
+ }
1752
+ // prettier-ignore
1753
+ const key = isNumber(arg1)
1754
+ ? String(arg1)
1755
+ : isMessageFunction(arg1)
1756
+ ? arg1
1757
+ : arg1;
1758
+ if (isNumber(arg2)) {
1759
+ options.plural = arg2;
1760
+ }
1761
+ else if (isString(arg2)) {
1762
+ options.default = arg2;
1763
+ }
1764
+ else if (isPlainObject(arg2) && !isEmptyObject(arg2)) {
1765
+ options.named = arg2;
1766
+ }
1767
+ else if (isArray(arg2)) {
1768
+ options.list = arg2;
1769
+ }
1770
+ if (isNumber(arg3)) {
1771
+ options.plural = arg3;
1772
+ }
1773
+ else if (isString(arg3)) {
1774
+ options.default = arg3;
1775
+ }
1776
+ else if (isPlainObject(arg3)) {
1777
+ assign(options, arg3);
1778
+ }
1779
+ return [key, options];
1780
+ }
1781
+ function getCompileContext(context, locale, key, source, warnHtmlMessage, onError) {
1782
+ return {
1783
+ locale,
1784
+ key,
1785
+ warnHtmlMessage,
1786
+ onError: (err) => {
1787
+ onError && onError(err);
1788
+ if ((process.env.NODE_ENV !== 'production')) {
1789
+ const _source = getSourceForCodeFrame(source);
1790
+ const message = `Message compilation error: ${err.message}`;
1791
+ const codeFrame = err.location &&
1792
+ _source &&
1793
+ generateCodeFrame(_source, err.location.start.offset, err.location.end.offset);
1794
+ const emitter = context.__v_emitter;
1795
+ if (emitter && _source) {
1796
+ emitter.emit('compile-error', {
1797
+ message: _source,
1798
+ error: err.message,
1799
+ start: err.location && err.location.start.offset,
1800
+ end: err.location && err.location.end.offset,
1801
+ groupId: `${'translate'}:${key}`
1802
+ });
1803
+ }
1804
+ console.error(codeFrame ? `${message}\n${codeFrame}` : message);
1805
+ }
1806
+ else {
1807
+ throw err;
1808
+ }
1809
+ },
1810
+ onCacheKey: (source) => generateFormatCacheKey(locale, key, source)
1811
+ };
1812
+ }
1813
+ function getSourceForCodeFrame(source) {
1814
+ if (isString(source)) {
1815
+ return source;
1816
+ }
1817
+ else {
1818
+ if (source.loc && source.loc.source) {
1819
+ return source.loc.source;
1820
+ }
1821
+ }
1822
+ }
1823
+ function getMessageContextOptions(context, locale, message, options) {
1824
+ const { modifiers, pluralRules, messageResolver: resolveValue, fallbackLocale, fallbackWarn, missingWarn, fallbackContext } = context;
1825
+ const resolveMessage = (key, useLinked) => {
1826
+ let val = resolveValue(message, key);
1827
+ // fallback
1828
+ if (val == null && (fallbackContext || useLinked)) {
1829
+ const [, , message] = resolveMessageFormat(fallbackContext || context, // NOTE: if has fallbackContext, fallback to root, else if use linked, fallback to local context
1830
+ key, locale, fallbackLocale, fallbackWarn, missingWarn);
1831
+ val = resolveValue(message, key);
1832
+ }
1833
+ if (isString(val) || isMessageAST(val)) {
1834
+ let occurred = false;
1835
+ const onError = () => {
1836
+ occurred = true;
1837
+ };
1838
+ const msg = compileMessageFormat(context, key, locale, val, key, onError);
1839
+ return !occurred
1840
+ ? msg
1841
+ : NOOP_MESSAGE_FUNCTION;
1842
+ }
1843
+ else if (isMessageFunction(val)) {
1844
+ return val;
1845
+ }
1846
+ else {
1847
+ // TODO: should be implemented warning message
1848
+ return NOOP_MESSAGE_FUNCTION;
1849
+ }
1850
+ };
1851
+ const ctxOptions = {
1852
+ locale,
1853
+ modifiers,
1854
+ pluralRules,
1855
+ messages: resolveMessage
1856
+ };
1857
+ if (context.processor) {
1858
+ ctxOptions.processor = context.processor;
1859
+ }
1860
+ if (options.list) {
1861
+ ctxOptions.list = options.list;
1862
+ }
1863
+ if (options.named) {
1864
+ ctxOptions.named = options.named;
1865
+ }
1866
+ if (isNumber(options.plural)) {
1867
+ ctxOptions.pluralIndex = options.plural;
1868
+ }
1869
+ return ctxOptions;
1870
+ }
1871
+
1872
+ {
1873
+ initFeatureFlags();
1874
+ }
1875
+
1876
+ export { AST_NODE_PROPS_KEYS as A, setDevToolsHook as B, CORE_WARN_CODES_EXTEND_POINT as C, DEFAULT_LOCALE as D, MISSING_RESOLVE_VALUE as M, NOT_REOSLVED as N, clearDateTimeFormat as a, clearNumberFormat as b, createCoreContext as c, isTranslateFallbackWarn as d, isTranslateMissingWarn as e, fallbackWithLocaleChain as f, getFallbackContext as g, CORE_ERROR_CODES_EXTEND_POINT as h, isMessageAST as i, setFallbackContext as j, parseDateTimeArgs as k, datetime as l, parseNumberArgs as m, number as n, isMessageFunction as o, parseTranslateArgs as p, NUMBER_FORMAT_OPTIONS_KEYS as q, DATETIME_FORMAT_OPTIONS_KEYS as r, setAdditionalMeta as s, translate as t, updateFallbackLocale as u, registerMessageCompiler as v, registerMessageResolver as w, registerLocaleFallbacker as x, compile as y, resolveValue as z };