@vc-shell/framework 1.1.46 → 1.1.47
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.
- package/CHANGELOG.md +4 -0
- package/core/plugins/modularity/loader.ts +126 -97
- package/dist/assets/042c75b764bc78a7.svg +1 -0
- package/dist/assets/0ba156439a339f2a.svg +1 -0
- package/dist/assets/0be560bfb22d0e72.woff2 +0 -0
- package/dist/assets/0f590f8a94577092.svg +1 -0
- package/dist/assets/0fc5820f8be53a1b.svg +1 -0
- package/dist/assets/10768e2cc79fc60b.svg +1 -0
- package/dist/assets/11b3d25a56fd9a21.woff2 +0 -0
- package/dist/assets/157b8721e0600ea8.svg +1 -0
- package/dist/assets/15e91cdd649cde9a.svg +1 -0
- package/dist/assets/1a3e84b2457f709a.woff +0 -0
- package/dist/assets/1de63eb118636cce.svg +1 -0
- package/dist/assets/1ea01de36eb5491b.svg +1 -0
- package/dist/assets/204eaf512fde2023.svg +1 -0
- package/dist/assets/2088983edf42e153.svg +1 -0
- package/dist/assets/208f810a9321a327.svg +1 -0
- package/dist/assets/21220a9d10e6c558.svg +1 -0
- package/dist/assets/220db345a102045d.woff2 +0 -0
- package/dist/assets/225da11d23968333.svg +1 -0
- package/dist/assets/226f862dd81bdc13.woff2 +0 -0
- package/dist/assets/23a2d53395ddb14f.woff +0 -0
- package/dist/assets/259e6ad461a52ad7.svg +1 -0
- package/dist/assets/261e6dec4d53b9ac.woff +0 -0
- package/dist/assets/262f46a0b6d94bb6.svg +1 -0
- package/dist/assets/2857c513073467da.svg +1 -0
- package/dist/assets/2b3be7889467d98f.woff +0 -0
- package/dist/assets/2d4e6190eec72737.svg +1 -0
- package/dist/assets/2eba973185078bc8.woff +0 -0
- package/dist/assets/327511cd4a7ba7f9.woff +0 -0
- package/dist/assets/334d3f6bc766c516.woff +0 -0
- package/dist/assets/34ff7dd0c2285956.svg +1 -0
- package/dist/assets/3d26b7c1ab78bbe2.woff +0 -0
- package/dist/assets/3f8c4cc8099e34b6.woff2 +0 -0
- package/dist/assets/40a0e53b79ce63c6.woff2 +0 -0
- package/dist/assets/41275bcb979cb650.svg +1 -0
- package/dist/assets/42df4e2d6fa3fd2a.woff2 +0 -0
- package/dist/assets/434f7982590e462f.woff +0 -0
- package/dist/assets/4ae5f23e0ca888e7.woff2 +0 -0
- package/dist/assets/4d7a77b0e5373992.svg +1 -0
- package/dist/assets/4e43c74354534fb3.svg +1 -0
- package/dist/assets/4fe75f5117100705.svg +1 -0
- package/dist/assets/52610491f372cb0c.woff2 +0 -0
- package/dist/assets/52e261a005074e1b.woff +0 -0
- package/dist/assets/5304c3d05a5f9789.woff2 +0 -0
- package/dist/assets/572bb1bb4156a9c1.svg +1 -0
- package/dist/assets/5b3661be8be679d0.woff2 +0 -0
- package/dist/assets/5d96cfcc5bedd917.woff2 +0 -0
- package/dist/assets/6075995d7e74da46.woff2 +0 -0
- package/dist/assets/617c4736236e199e.woff +0 -0
- package/dist/assets/6619e9e10beea0e7.woff2 +0 -0
- package/dist/assets/67230f05dc94a265.svg +1 -0
- package/dist/assets/6798e4dd4add9b48.svg +1 -0
- package/dist/assets/698ec6c722d4cb05.woff2 +0 -0
- package/dist/assets/6a3e73faf406cf33.svg +1 -0
- package/dist/assets/72de3a63bc0b70dd.svg +1 -0
- package/dist/assets/74c6a6ab81bb6340.woff2 +0 -0
- package/dist/assets/74ed5f8a78e71106.svg +1 -0
- package/dist/assets/7ce0c166fd6a1204.woff +0 -0
- package/dist/assets/7d55399c2a7bc985.svg +1 -0
- package/dist/assets/7d970675c69fca1d.woff +0 -0
- package/dist/assets/7eda727273fd98d3.svg +1 -0
- package/dist/assets/7f6ebfd707b76ca2.woff +0 -0
- package/dist/assets/7fa898d213fcc7bc.woff2 +0 -0
- package/dist/assets/861e6b7192b3b6c7.woff +0 -0
- package/dist/assets/8bbcde81ba21ecb2.woff2 +0 -0
- package/dist/assets/8f6657e5e0b8d3e4.woff +0 -0
- package/dist/assets/910b0d99b9e26568.svg +1 -0
- package/dist/assets/91eee1aa81f72683.woff +0 -0
- package/dist/assets/92508f8707159b51.svg +1 -0
- package/dist/assets/9392bf1d591e1abb.svg +1 -0
- package/dist/assets/97e8d4984ba0713a.woff2 +0 -0
- package/dist/assets/9cb83236f6bb7ab1.svg +1 -0
- package/dist/assets/9d37314695c0b68d.woff +0 -0
- package/dist/assets/a18404194e3f9047.svg +1 -0
- package/dist/assets/a2017fe7f0a26510.svg +1 -0
- package/dist/assets/a47034e65dbcc3d7.woff +0 -0
- package/dist/assets/a617e11804bbacb7.woff +0 -0
- package/dist/assets/ab6e7190bb1492d5.woff2 +0 -0
- package/dist/assets/abf88f301a0730f4.svg +1 -0
- package/dist/assets/aed17cb6fdad2ada.woff2 +0 -0
- package/dist/assets/b1a596e31ad1185a.svg +1 -0
- package/dist/assets/b27767411c8427be.woff +0 -0
- package/dist/assets/b291dc35a17511f7.woff +0 -0
- package/dist/assets/b325adcae33bbe7a.svg +1 -0
- package/dist/assets/b372390551ca2fa1.svg +1 -0
- package/dist/assets/b5bb1e8fc975decd.svg +1 -0
- package/dist/assets/b645a4a2181b9dc1.svg +1 -0
- package/dist/assets/b6499ddce0a4ef7d.svg +1 -0
- package/dist/assets/b94421fadd23b0f2.svg +1 -0
- package/dist/assets/bb28fb0f27f1c11b.svg +1 -0
- package/dist/assets/bfbe205759295eca.woff2 +0 -0
- package/dist/assets/ca791c5ca5848a03.svg +1 -0
- package/dist/assets/cb32840ce330103f.woff +0 -0
- package/dist/assets/d084bda16abe8a56.svg +1 -0
- package/dist/assets/d32b129cae2fffd6.svg +1 -0
- package/dist/assets/d35a4c7113315758.woff2 +0 -0
- package/dist/assets/d3f792f54ae4c307.svg +1 -0
- package/dist/assets/d5a5b8630120073d.svg +1 -0
- package/dist/assets/d5f9664ebbfb104b.svg +1 -0
- package/dist/assets/d80b05788e407de7.woff2 +0 -0
- package/dist/assets/d84247b59449dd88.woff2 +0 -0
- package/dist/assets/dd05d43ff0df2fc7.svg +1 -0
- package/dist/assets/e38acaa1757232e0.svg +1 -0
- package/dist/assets/e4a8550f1c7ffe36.svg +1 -0
- package/dist/assets/e5adb5ae3a3698f6.svg +1 -0
- package/dist/assets/e61a1889bac955f4.woff2 +0 -0
- package/dist/assets/e72bb11356af94c7.svg +1 -0
- package/dist/assets/e98196a9f8dcb2f0.svg +1 -0
- package/dist/assets/ebec912a42ad49ff.woff +0 -0
- package/dist/assets/f09d89268e4c0317.svg +1 -0
- package/dist/assets/f276d55184e05a07.woff +0 -0
- package/dist/assets/f5722262b6e7214e.woff2 +0 -0
- package/dist/assets/f7fc8bf46089d8b2.svg +1 -0
- package/dist/assets/fcb1c1ffb5640194.woff +0 -0
- package/dist/assets/fe141d99763f5d2b.woff +0 -0
- package/dist/assets/fed13b0d59903483.svg +1 -0
- package/dist/assets/fed757d2c2344ead.woff2 +0 -0
- package/dist/assets/ffc438f20e79ce73.woff +0 -0
- package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
- package/dist/framework.js +16544 -25878
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
- package/dist/vendor-boolbase-Bgn9I6iN.js +21 -0
- package/dist/vendor-cheerio-CleDsuQZ.js +1053 -0
- package/dist/vendor-cheerio-select-CVkYl3Z-.js +191 -0
- package/dist/vendor-css-select-CtIzVIiG.js +622 -0
- package/dist/vendor-css-what-CZZaquJM.js +267 -0
- package/dist/vendor-cypress-signalr-mock-CdKwIhWw.js +769 -0
- package/dist/vendor-date-fns-CdFbeoHV.js +2989 -0
- package/dist/vendor-dom-serializer-CugO0RdN.js +213 -0
- package/dist/vendor-dom7-wvIUV9pT.js +529 -0
- package/dist/vendor-domelementtype-B3sFIGaC.js +21 -0
- package/dist/vendor-domhandler-CL40eeX9.js +311 -0
- package/dist/vendor-dompurify-eYFoHPwR.js +528 -0
- package/dist/vendor-domutils-D3Y2YQFR.js +386 -0
- package/dist/vendor-entities-v26HW8wW.js +363 -0
- package/dist/vendor-floating-ui-core-C9uEvi1M.js +349 -0
- package/dist/vendor-floating-ui-dom-CZkYGmv4.js +393 -0
- package/dist/vendor-floating-ui-utils-Bx3BTd6_.js +259 -0
- package/dist/vendor-floating-ui-vue-CLOiVYP7.js +107 -0
- package/dist/vendor-headlessui-vue-Dg0Llidi.js +961 -0
- package/dist/vendor-htmlparser2-CXL_uhMI.js +735 -0
- package/dist/vendor-iconify-vue-D4fihzvl.js +1205 -0
- package/dist/vendor-intlify-core-base-Bvt2vJFV.js +1129 -0
- package/dist/vendor-intlify-message-compiler-1VxNzq21.js +945 -0
- package/dist/vendor-intlify-shared-D7kiPMOG.js +130 -0
- package/dist/vendor-iso-639-1-dVGfSUIM.js +781 -0
- package/dist/vendor-linkify-it-LzoUhj6C.js +199 -0
- package/dist/vendor-linkifyjs-DTu7SY_Y.js +705 -0
- package/dist/vendor-lodash-es-CrYlgAi8.js +4816 -0
- package/dist/vendor-markdown-it-4AJoRTAg.js +2263 -0
- package/dist/vendor-markdown-it-task-lists-Byg1-ms9.js +69 -0
- package/dist/vendor-mdurl-DZFDNdqC.js +192 -0
- package/dist/vendor-microsoft-applicationinsights-analytics-js-DA-ctcAL.js +1105 -0
- package/dist/vendor-microsoft-applicationinsights-cfgsync-js-COfRj-2q.js +261 -0
- package/dist/vendor-microsoft-applicationinsights-channel-js-MTPYhH-I.js +1809 -0
- package/dist/vendor-microsoft-applicationinsights-common-CDVnJ6MR.js +1921 -0
- package/dist/vendor-microsoft-applicationinsights-core-js-D7Aicf8S.js +4127 -0
- package/dist/vendor-microsoft-applicationinsights-dependencies-js-CvQWWraU.js +1399 -0
- package/dist/vendor-microsoft-applicationinsights-properties-js-C0Iv1cZE.js +572 -0
- package/dist/vendor-microsoft-applicationinsights-shims-CxtPYiwp.js +43 -0
- package/dist/vendor-microsoft-applicationinsights-web-BRuQAzjU.js +487 -0
- package/dist/vendor-microsoft-dynamicproto-js-DSkQkH3T.js +147 -0
- package/dist/vendor-microsoft-signalr-qIrag5xx.js +1761 -0
- package/dist/vendor-moment-CwOqp704.js +2589 -0
- package/dist/vendor-nevware21-ts-async-FAyg3c9V.js +260 -0
- package/dist/vendor-nevware21-ts-utils-Dy41wRhA.js +853 -0
- package/dist/vendor-nth-check-BE7AeBMg.js +45 -0
- package/dist/vendor-orderedmap-B3SOk52B.js +103 -0
- package/dist/vendor-parse5-DqztJOGh.js +5747 -0
- package/dist/vendor-parse5-htmlparser2-tree-adapter-CNubfdOP.js +143 -0
- package/dist/vendor-popperjs-core-LGjf7Wza.js +905 -0
- package/dist/vendor-prettier-D8C9GG-0.js +4858 -0
- package/dist/vendor-prosemirror-commands-BqYcdumy.js +344 -0
- package/dist/vendor-prosemirror-dropcursor-zknUsW5x.js +86 -0
- package/dist/vendor-prosemirror-gapcursor-DjOZhP78.js +200 -0
- package/dist/vendor-prosemirror-history-l8l3CFac.js +248 -0
- package/dist/vendor-prosemirror-keymap-C17r08p-.js +62 -0
- package/dist/vendor-prosemirror-markdown-WJEDhc-w.js +650 -0
- package/dist/vendor-prosemirror-model-BN5TnJD_.js +2736 -0
- package/dist/vendor-prosemirror-schema-list-CR0gi7aY.js +87 -0
- package/dist/vendor-prosemirror-state-B0bFP8WI.js +821 -0
- package/dist/vendor-prosemirror-tables-B1txTKlC.js +1711 -0
- package/dist/vendor-prosemirror-transform-Bo7kNPme.js +1507 -0
- package/dist/vendor-prosemirror-view--C7TZvmQ.js +3746 -0
- package/dist/vendor-punycode-js-CNI-zL6U.js +133 -0
- package/dist/vendor-rope-sequence-sEGCUMi8.js +100 -0
- package/dist/vendor-semver-BoKYtkQw.js +1021 -0
- package/dist/vendor-ssr-window-D4k3p53c.js +133 -0
- package/dist/vendor-swiper-CMVLTGu0.js +2825 -0
- package/dist/vendor-tippy-js-BGdgwGX-.js +812 -0
- package/dist/vendor-tiptap-core-BRY37Sb2.js +2806 -0
- package/dist/vendor-tiptap-extension-blockquote-CPd5qv-9.js +43 -0
- package/dist/vendor-tiptap-extension-bold-B0GwBNks.js +71 -0
- package/dist/vendor-tiptap-extension-bubble-menu-B0sZZld7.js +128 -0
- package/dist/vendor-tiptap-extension-bullet-list-CQm4ReOu.js +53 -0
- package/dist/vendor-tiptap-extension-code-C8cy6bRj.js +51 -0
- package/dist/vendor-tiptap-extension-code-block-BqTchNEf.js +133 -0
- package/dist/vendor-tiptap-extension-document-Dka1Uu0g.js +9 -0
- package/dist/vendor-tiptap-extension-dropcursor-CFSh-BuE.js +20 -0
- package/dist/vendor-tiptap-extension-floating-menu-H8PB4zeI.js +99 -0
- package/dist/vendor-tiptap-extension-gapcursor-CzwfD_IT.js +24 -0
- package/dist/vendor-tiptap-extension-hard-break-Rm6aVcrK.js +55 -0
- package/dist/vendor-tiptap-extension-heading-CavI6u1v.js +54 -0
- package/dist/vendor-tiptap-extension-history-WEN1_74D.js +35 -0
- package/dist/vendor-tiptap-extension-horizontal-rule-DZkUEL6s.js +58 -0
- package/dist/vendor-tiptap-extension-image-B67_mxGM.js +64 -0
- package/dist/vendor-tiptap-extension-italic-BshxBFou.js +70 -0
- package/dist/vendor-tiptap-extension-link-CJAQIgui.js +262 -0
- package/dist/vendor-tiptap-extension-list-item-DF-iMpqO.js +33 -0
- package/dist/vendor-tiptap-extension-ordered-list-CN8MF-kN.js +71 -0
- package/dist/vendor-tiptap-extension-paragraph-DI577lM5.js +33 -0
- package/dist/vendor-tiptap-extension-placeholder-DwAtlfAF.js +52 -0
- package/dist/vendor-tiptap-extension-strike-CIty09KN.js +61 -0
- package/dist/vendor-tiptap-extension-table-C5nv-GUb.js +213 -0
- package/dist/vendor-tiptap-extension-table-cell-DXbBhJW3.js +40 -0
- package/dist/vendor-tiptap-extension-table-header-rtggsYXA.js +40 -0
- package/dist/vendor-tiptap-extension-table-row-67khjMDt.js +22 -0
- package/dist/vendor-tiptap-extension-text-D1OHb_a1.js +8 -0
- package/dist/vendor-tiptap-extension-underline-IqWixw3m.js +40 -0
- package/dist/vendor-tiptap-markdown-DVxB1hbO.js +825 -0
- package/dist/vendor-tiptap-starter-kit-CPH9gu2X.js +29 -0
- package/dist/vendor-tiptap-vue-3-CkBe4_xM.js +225 -0
- package/dist/vendor-truncate-html-Bx1HJzRq.js +145 -0
- package/dist/vendor-uc-micro-4lbSaZOs.js +17 -0
- package/dist/vendor-vee-validate-i18n-zT8NxX3R.js +93 -0
- package/dist/vendor-vee-validate-rules-DDeNM2Gc.js +314 -0
- package/dist/vendor-vue-currency-input-DxWnS-HB.js +315 -0
- package/dist/vendor-vue-devtools-api-aVYGocXp.js +93 -0
- package/dist/vendor-vue-i18n-DPtOLen3.js +1359 -0
- package/dist/vendor-vue3-application-insights-dAGGfA_M.js +69 -0
- package/dist/vendor-vue3-touch-events-8Pa3HHlV.js +169 -0
- package/dist/vendor-vuepic-vue-datepicker-DglsiNYa.js +4997 -0
- package/dist/vendor-vueuse-components-DtK_mxpP.js +219 -0
- package/dist/vendor-vueuse-core-cB-c7DzH.js +5129 -0
- package/dist/vendor-vueuse-shared-Dg7PMM0z.js +1169 -0
- package/dist/vendor-w3c-keyname-CLxH8j-f.js +92 -0
- package/dist/vendor-whatwg-fetch-l0sNRNKZ.js +1 -0
- package/package.json +5 -4
- package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +2 -1
- package/dist/vendor-boolbase-Cp9L0GAZ.js +0 -25
- package/dist/vendor-cheerio-HN9zIPZn.js +0 -3135
- package/dist/vendor-cheerio-select-5Ry0HvBq.js +0 -306
- package/dist/vendor-css-select-DRIZ9kfZ.js +0 -966
- package/dist/vendor-css-what-DuPJ1HEF.js +0 -448
- package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +0 -778
- package/dist/vendor-date-fns-515YWkk-.js +0 -6724
- package/dist/vendor-dom-serializer-nQMsqjYW.js +0 -286
- package/dist/vendor-dom7-CJLPMwy5.js +0 -941
- package/dist/vendor-domelementtype-CjSzQey5.js +0 -53
- package/dist/vendor-domhandler-9z8cS16a.js +0 -484
- package/dist/vendor-dompurify-CRFzu7ib.js +0 -1336
- package/dist/vendor-domutils-Bc-Opz-v.js +0 -981
- package/dist/vendor-entities-Bfsx4xOQ.js +0 -636
- package/dist/vendor-floating-ui-core-wV8u8QP4.js +0 -511
- package/dist/vendor-floating-ui-dom-DDnRPs17.js +0 -706
- package/dist/vendor-floating-ui-utils-OMIFy1QU.js +0 -296
- package/dist/vendor-floating-ui-vue-D-tCDAMm.js +0 -167
- package/dist/vendor-fontsource-plus-jakarta-sans.css +0 -1
- package/dist/vendor-headlessui-vue-CY9FRgTb.js +0 -83
- package/dist/vendor-htmlparser2-B1dhFPOs.js +0 -1426
- package/dist/vendor-iconify-vue-DfRGgyNu.js +0 -1840
- package/dist/vendor-intlify-core-base-BuknsFQe.js +0 -1876
- package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +0 -1508
- package/dist/vendor-intlify-shared-Cz4YRMuC.js +0 -241
- package/dist/vendor-iso-639-1-BJCk9DvE.js +0 -819
- package/dist/vendor-linkify-it-CKUf4vsc.js +0 -830
- package/dist/vendor-linkifyjs-BfyGgbCh.js +0 -1756
- package/dist/vendor-lodash-es-BySUOlwf.js +0 -18333
- package/dist/vendor-markdown-it-D-apazHa.js +0 -6000
- package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +0 -131
- package/dist/vendor-mdurl-BNh2CCgT.js +0 -537
- package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +0 -1275
- package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +0 -591
- package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +0 -2153
- package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +0 -2470
- package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +0 -6589
- package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +0 -1510
- package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +0 -761
- package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +0 -70
- package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +0 -667
- package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +0 -520
- package/dist/vendor-microsoft-signalr-dUnlRsGm.js +0 -3339
- package/dist/vendor-moment-Mki5YqAR.js +0 -5679
- package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +0 -395
- package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +0 -1160
- package/dist/vendor-nth-check-Bx8TxtJt.js +0 -157
- package/dist/vendor-orderedmap-dGG6uMFJ.js +0 -137
- package/dist/vendor-parse5-Bt2NhSzR.js +0 -8432
- package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +0 -216
- package/dist/vendor-popperjs-core-Cr2byIky.js +0 -1790
- package/dist/vendor-prettier-B4PaeWRQ.js +0 -98
- package/dist/vendor-prosemirror-commands-BH9lWGpW.js +0 -561
- package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +0 -146
- package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +0 -236
- package/dist/vendor-prosemirror-history-BDaJkvNx.js +0 -414
- package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +0 -128
- package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +0 -866
- package/dist/vendor-prosemirror-model-BZu3WVcD.js +0 -3463
- package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +0 -158
- package/dist/vendor-prosemirror-state-BvL9Pxph.js +0 -1003
- package/dist/vendor-prosemirror-tables-17qAnviK.js +0 -2159
- package/dist/vendor-prosemirror-transform-CE9VV3qg.js +0 -2156
- package/dist/vendor-prosemirror-view-CU2WTHT7.js +0 -5811
- package/dist/vendor-punycode-js-iAs5RxMf.js +0 -441
- package/dist/vendor-rope-sequence-BdXDKoGt.js +0 -207
- package/dist/vendor-semver-CVLMK-S4.js +0 -2702
- package/dist/vendor-ssr-window-s6OpKa3O.js +0 -150
- package/dist/vendor-swiper-CdiyNHVt.js +0 -5679
- package/dist/vendor-tippy-js-DWFe2TfK.js +0 -1647
- package/dist/vendor-tiptap-core-NfwGfaQk.js +0 -4910
- package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +0 -57
- package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +0 -97
- package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +0 -218
- package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +0 -73
- package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +0 -221
- package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +0 -75
- package/dist/vendor-tiptap-extension-document-DssuotYs.js +0 -13
- package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +0 -26
- package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +0 -165
- package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +0 -30
- package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +0 -68
- package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +0 -77
- package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +0 -48
- package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +0 -92
- package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +0 -76
- package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +0 -96
- package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +0 -414
- package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +0 -37
- package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +0 -97
- package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +0 -39
- package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +0 -66
- package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +0 -79
- package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +0 -47
- package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +0 -47
- package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +0 -26
- package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +0 -354
- package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +0 -12
- package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +0 -50
- package/dist/vendor-tiptap-markdown-7-PCADTU.js +0 -1017
- package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +0 -88
- package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +0 -268
- package/dist/vendor-truncate-html-3qQY0Djo.js +0 -196
- package/dist/vendor-uc-micro-jjt6LQ65.js +0 -23
- package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +0 -154
- package/dist/vendor-vee-validate-rules-DzV3VY3N.js +0 -536
- package/dist/vendor-vue-currency-input-DGAkEFBO.js +0 -545
- package/dist/vendor-vue-devtools-api-DXYR8qBG.js +0 -169
- package/dist/vendor-vue-i18n-Co752uk3.js +0 -1897
- package/dist/vendor-vue3-application-insights-CYWFCr_J.js +0 -119
- package/dist/vendor-vue3-touch-events-BJEAiSa3.js +0 -416
- package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +0 -5019
- package/dist/vendor-vueuse-components-l1bL12mE.js +0 -339
- package/dist/vendor-vueuse-core-DGcJOmwG.js +0 -7743
- package/dist/vendor-vueuse-shared-_mOXsFuM.js +0 -1568
- package/dist/vendor-w3c-keyname-BOm2dtJm.js +0 -121
|
@@ -1,1897 +0,0 @@
|
|
|
1
|
-
import { C as CORE_WARN_CODES_EXTEND_POINT, D as DEFAULT_LOCALE, u as updateFallbackLocale, c as createCoreContext, a as clearDateTimeFormat, b as clearNumberFormat, i as isMessageAST, A as AST_NODE_PROPS_KEYS, s as setAdditionalMeta, g as getFallbackContext, N as NOT_REOSLVED, d as isTranslateFallbackWarn, e as isTranslateMissingWarn, f as fallbackWithLocaleChain, h as CORE_ERROR_CODES_EXTEND_POINT, j as setFallbackContext, p as parseTranslateArgs, t as translate, M as MISSING_RESOLVE_VALUE, k as parseDateTimeArgs, l as datetime, m as parseNumberArgs, n as number, o as isMessageFunction, q as NUMBER_FORMAT_OPTIONS_KEYS, r as DATETIME_FORMAT_OPTIONS_KEYS, v as registerMessageCompiler, w as registerMessageResolver, x as registerLocaleFallbacker, y as compile, z as resolveValue, B as setDevToolsHook } from './vendor-intlify-core-base-BuknsFQe.js';
|
|
2
|
-
import { w as warnOnce, e as isBoolean, l as format, A as makeSymbol, a as isPlainObject, B as createEmitter, b as isString, i as isArray, f as isRegExp, r as inBrowser, d as assign, c as create, C as deepCopy, k as hasOwn, j as isObject, g as isFunction, n as isNumber, h as warn, o as isEmptyObject, m as getGlobalThis } from './vendor-intlify-shared-Cz4YRMuC.js';
|
|
3
|
-
import { effectScope, ref, shallowRef, computed, watch, isRef, defineComponent, getCurrentInstance, h, Fragment, inject, onMounted, onUnmounted, createVNode, Text } from 'vue';
|
|
4
|
-
import { s as setupDevtoolsPlugin } from './vendor-vue-devtools-api-DXYR8qBG.js';
|
|
5
|
-
import { c as createCompileError } from './vendor-intlify-message-compiler-CuOQDWx1.js';
|
|
6
|
-
|
|
7
|
-
/*!
|
|
8
|
-
* vue-i18n v11.1.7
|
|
9
|
-
* (c) 2025 kazuya kawaguchi
|
|
10
|
-
* Released under the MIT License.
|
|
11
|
-
*/
|
|
12
|
-
const VERSION = "11.1.7";
|
|
13
|
-
function initFeatureFlags() {
|
|
14
|
-
if (typeof __VUE_I18N_FULL_INSTALL__ !== "boolean") {
|
|
15
|
-
getGlobalThis().__VUE_I18N_FULL_INSTALL__ = true;
|
|
16
|
-
}
|
|
17
|
-
if (typeof __VUE_I18N_LEGACY_API__ !== "boolean") {
|
|
18
|
-
getGlobalThis().__VUE_I18N_LEGACY_API__ = true;
|
|
19
|
-
}
|
|
20
|
-
if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== "boolean") {
|
|
21
|
-
getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false;
|
|
22
|
-
}
|
|
23
|
-
if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
|
|
24
|
-
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const I18nErrorCodes = {
|
|
28
|
-
// composer module errors
|
|
29
|
-
UNEXPECTED_RETURN_TYPE: CORE_ERROR_CODES_EXTEND_POINT,
|
|
30
|
-
// 24
|
|
31
|
-
// legacy module errors
|
|
32
|
-
INVALID_ARGUMENT: 25,
|
|
33
|
-
// i18n module errors
|
|
34
|
-
MUST_BE_CALL_SETUP_TOP: 26,
|
|
35
|
-
NOT_INSTALLED: 27,
|
|
36
|
-
// directive module errors
|
|
37
|
-
REQUIRED_VALUE: 28,
|
|
38
|
-
INVALID_VALUE: 29,
|
|
39
|
-
// vue-devtools errors
|
|
40
|
-
CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: 30,
|
|
41
|
-
NOT_INSTALLED_WITH_PROVIDE: 31,
|
|
42
|
-
// unexpected error
|
|
43
|
-
UNEXPECTED_ERROR: 32,
|
|
44
|
-
// not compatible legacy vue-i18n constructor
|
|
45
|
-
NOT_COMPATIBLE_LEGACY_VUE_I18N: 33,
|
|
46
|
-
// Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
|
|
47
|
-
NOT_AVAILABLE_COMPOSITION_IN_LEGACY: 34,
|
|
48
|
-
// duplicate `useI18n` calling
|
|
49
|
-
DUPLICATE_USE_I18N_CALLING: 35
|
|
50
|
-
};
|
|
51
|
-
function createI18nError(code, ...args) {
|
|
52
|
-
return createCompileError(code, null, process.env.NODE_ENV !== "production" ? { messages: errorMessages, args } : void 0);
|
|
53
|
-
}
|
|
54
|
-
const errorMessages = {
|
|
55
|
-
[I18nErrorCodes.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
|
|
56
|
-
[I18nErrorCodes.INVALID_ARGUMENT]: "Invalid argument",
|
|
57
|
-
[I18nErrorCodes.MUST_BE_CALL_SETUP_TOP]: "Must be called at the top of a `setup` function",
|
|
58
|
-
[I18nErrorCodes.NOT_INSTALLED]: "Need to install with `app.use` function",
|
|
59
|
-
[I18nErrorCodes.UNEXPECTED_ERROR]: "Unexpected error",
|
|
60
|
-
[I18nErrorCodes.REQUIRED_VALUE]: `Required in value: {0}`,
|
|
61
|
-
[I18nErrorCodes.INVALID_VALUE]: `Invalid value`,
|
|
62
|
-
[I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: `Cannot setup vue-devtools plugin`,
|
|
63
|
-
[I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function",
|
|
64
|
-
[I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N]: "Not compatible legacy VueI18n.",
|
|
65
|
-
[I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly",
|
|
66
|
-
[I18nErrorCodes.DUPLICATE_USE_I18N_CALLING]: "Duplicate `useI18n` calling by local scope. Please don't call it on local scope"
|
|
67
|
-
};
|
|
68
|
-
const TranslateVNodeSymbol = /* @__PURE__ */ makeSymbol("__translateVNode");
|
|
69
|
-
const DatetimePartsSymbol = /* @__PURE__ */ makeSymbol("__datetimeParts");
|
|
70
|
-
const NumberPartsSymbol = /* @__PURE__ */ makeSymbol("__numberParts");
|
|
71
|
-
const EnableEmitter = /* @__PURE__ */ makeSymbol("__enableEmitter");
|
|
72
|
-
const DisableEmitter = /* @__PURE__ */ makeSymbol("__disableEmitter");
|
|
73
|
-
const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
|
|
74
|
-
const InejctWithOptionSymbol = /* @__PURE__ */ makeSymbol("__injectWithOption");
|
|
75
|
-
const DisposeSymbol = /* @__PURE__ */ makeSymbol("__dispose");
|
|
76
|
-
const I18nWarnCodes = {
|
|
77
|
-
FALLBACK_TO_ROOT: CORE_WARN_CODES_EXTEND_POINT,
|
|
78
|
-
// 8
|
|
79
|
-
NOT_FOUND_PARENT_SCOPE: 9,
|
|
80
|
-
IGNORE_OBJ_FLATTEN: 10,
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated will be removed at vue-i18n v12
|
|
83
|
-
*/
|
|
84
|
-
DEPRECATE_LEGACY_MODE: 11,
|
|
85
|
-
/**
|
|
86
|
-
* @deprecated will be removed at vue-i18n v12
|
|
87
|
-
*/
|
|
88
|
-
DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE: 12
|
|
89
|
-
};
|
|
90
|
-
const warnMessages = {
|
|
91
|
-
[I18nWarnCodes.FALLBACK_TO_ROOT]: `Fall back to {type} '{key}' with root locale.`,
|
|
92
|
-
[I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]: `Not found parent scope. use the global scope.`,
|
|
93
|
-
[I18nWarnCodes.IGNORE_OBJ_FLATTEN]: `Ignore object flatten: '{key}' key has an string value`,
|
|
94
|
-
/**
|
|
95
|
-
* @deprecated will be removed at vue-i18n v12
|
|
96
|
-
*/
|
|
97
|
-
[I18nWarnCodes.DEPRECATE_LEGACY_MODE]: `Legacy API mode has been deprecated in v11. Use Composition API mode instead.
|
|
98
|
-
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,
|
|
99
|
-
/**
|
|
100
|
-
* @deprecated will be removed at vue-i18n v12
|
|
101
|
-
*/
|
|
102
|
-
[I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]: `'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.`
|
|
103
|
-
};
|
|
104
|
-
function getWarnMessage(code, ...args) {
|
|
105
|
-
return format(warnMessages[code], ...args);
|
|
106
|
-
}
|
|
107
|
-
function handleFlatJson(obj) {
|
|
108
|
-
if (!isObject(obj)) {
|
|
109
|
-
return obj;
|
|
110
|
-
}
|
|
111
|
-
if (isMessageAST(obj)) {
|
|
112
|
-
return obj;
|
|
113
|
-
}
|
|
114
|
-
for (const key in obj) {
|
|
115
|
-
if (!hasOwn(obj, key)) {
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (!key.includes(".")) {
|
|
119
|
-
if (isObject(obj[key])) {
|
|
120
|
-
handleFlatJson(obj[key]);
|
|
121
|
-
}
|
|
122
|
-
} else {
|
|
123
|
-
const subKeys = key.split(".");
|
|
124
|
-
const lastIndex = subKeys.length - 1;
|
|
125
|
-
let currentObj = obj;
|
|
126
|
-
let hasStringValue = false;
|
|
127
|
-
for (let i = 0; i < lastIndex; i++) {
|
|
128
|
-
if (subKeys[i] === "__proto__") {
|
|
129
|
-
throw new Error(`unsafe key: ${subKeys[i]}`);
|
|
130
|
-
}
|
|
131
|
-
if (!(subKeys[i] in currentObj)) {
|
|
132
|
-
currentObj[subKeys[i]] = create();
|
|
133
|
-
}
|
|
134
|
-
if (!isObject(currentObj[subKeys[i]])) {
|
|
135
|
-
process.env.NODE_ENV !== "production" && warn(getWarnMessage(I18nWarnCodes.IGNORE_OBJ_FLATTEN, {
|
|
136
|
-
key: subKeys[i]
|
|
137
|
-
}));
|
|
138
|
-
hasStringValue = true;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
currentObj = currentObj[subKeys[i]];
|
|
142
|
-
}
|
|
143
|
-
if (!hasStringValue) {
|
|
144
|
-
if (!isMessageAST(currentObj)) {
|
|
145
|
-
currentObj[subKeys[lastIndex]] = obj[key];
|
|
146
|
-
delete obj[key];
|
|
147
|
-
} else {
|
|
148
|
-
if (!AST_NODE_PROPS_KEYS.includes(subKeys[lastIndex])) {
|
|
149
|
-
delete obj[key];
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
if (!isMessageAST(currentObj)) {
|
|
154
|
-
const target = currentObj[subKeys[lastIndex]];
|
|
155
|
-
if (isObject(target)) {
|
|
156
|
-
handleFlatJson(target);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return obj;
|
|
162
|
-
}
|
|
163
|
-
function getLocaleMessages(locale, options) {
|
|
164
|
-
const { messages, __i18n, messageResolver, flatJson } = options;
|
|
165
|
-
const ret = isPlainObject(messages) ? messages : isArray(__i18n) ? create() : { [locale]: create() };
|
|
166
|
-
if (isArray(__i18n)) {
|
|
167
|
-
__i18n.forEach((custom) => {
|
|
168
|
-
if ("locale" in custom && "resource" in custom) {
|
|
169
|
-
const { locale: locale2, resource } = custom;
|
|
170
|
-
if (locale2) {
|
|
171
|
-
ret[locale2] = ret[locale2] || create();
|
|
172
|
-
deepCopy(resource, ret[locale2]);
|
|
173
|
-
} else {
|
|
174
|
-
deepCopy(resource, ret);
|
|
175
|
-
}
|
|
176
|
-
} else {
|
|
177
|
-
isString(custom) && deepCopy(JSON.parse(custom), ret);
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
if (messageResolver == null && flatJson) {
|
|
182
|
-
for (const key in ret) {
|
|
183
|
-
if (hasOwn(ret, key)) {
|
|
184
|
-
handleFlatJson(ret[key]);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return ret;
|
|
189
|
-
}
|
|
190
|
-
function getComponentOptions(instance) {
|
|
191
|
-
return instance.type;
|
|
192
|
-
}
|
|
193
|
-
function adjustI18nResources(gl, options, componentOptions) {
|
|
194
|
-
let messages = isObject(options.messages) ? options.messages : create();
|
|
195
|
-
if ("__i18nGlobal" in componentOptions) {
|
|
196
|
-
messages = getLocaleMessages(gl.locale.value, {
|
|
197
|
-
messages,
|
|
198
|
-
__i18n: componentOptions.__i18nGlobal
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
const locales = Object.keys(messages);
|
|
202
|
-
if (locales.length) {
|
|
203
|
-
locales.forEach((locale) => {
|
|
204
|
-
gl.mergeLocaleMessage(locale, messages[locale]);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
{
|
|
208
|
-
if (isObject(options.datetimeFormats)) {
|
|
209
|
-
const locales2 = Object.keys(options.datetimeFormats);
|
|
210
|
-
if (locales2.length) {
|
|
211
|
-
locales2.forEach((locale) => {
|
|
212
|
-
gl.mergeDateTimeFormat(locale, options.datetimeFormats[locale]);
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
if (isObject(options.numberFormats)) {
|
|
217
|
-
const locales2 = Object.keys(options.numberFormats);
|
|
218
|
-
if (locales2.length) {
|
|
219
|
-
locales2.forEach((locale) => {
|
|
220
|
-
gl.mergeNumberFormat(locale, options.numberFormats[locale]);
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
function createTextNode(key) {
|
|
227
|
-
return createVNode(Text, null, key, 0);
|
|
228
|
-
}
|
|
229
|
-
const DEVTOOLS_META = "__INTLIFY_META__";
|
|
230
|
-
const NOOP_RETURN_ARRAY = () => [];
|
|
231
|
-
const NOOP_RETURN_FALSE = () => false;
|
|
232
|
-
let composerID = 0;
|
|
233
|
-
function defineCoreMissingHandler(missing) {
|
|
234
|
-
return (ctx, locale, key, type) => {
|
|
235
|
-
return missing(locale, key, getCurrentInstance() || void 0, type);
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
const getMetaInfo = /* @__NO_SIDE_EFFECTS__ */ () => {
|
|
239
|
-
const instance = getCurrentInstance();
|
|
240
|
-
let meta = null;
|
|
241
|
-
return instance && (meta = getComponentOptions(instance)[DEVTOOLS_META]) ? { [DEVTOOLS_META]: meta } : null;
|
|
242
|
-
};
|
|
243
|
-
function createComposer(options = {}) {
|
|
244
|
-
const { __root, __injectWithOption } = options;
|
|
245
|
-
const _isGlobal = __root === void 0;
|
|
246
|
-
const flatJson = options.flatJson;
|
|
247
|
-
const _ref = inBrowser ? ref : shallowRef;
|
|
248
|
-
let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
|
|
249
|
-
const _locale = _ref(
|
|
250
|
-
// prettier-ignore
|
|
251
|
-
__root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : DEFAULT_LOCALE
|
|
252
|
-
);
|
|
253
|
-
const _fallbackLocale = _ref(
|
|
254
|
-
// prettier-ignore
|
|
255
|
-
__root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
|
|
256
|
-
);
|
|
257
|
-
const _messages = _ref(getLocaleMessages(_locale.value, options));
|
|
258
|
-
const _datetimeFormats = _ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
|
|
259
|
-
const _numberFormats = _ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
|
|
260
|
-
let _missingWarn = __root ? __root.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
|
|
261
|
-
let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
|
|
262
|
-
let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
|
|
263
|
-
let _fallbackFormat = !!options.fallbackFormat;
|
|
264
|
-
let _missing = isFunction(options.missing) ? options.missing : null;
|
|
265
|
-
let _runtimeMissing = isFunction(options.missing) ? defineCoreMissingHandler(options.missing) : null;
|
|
266
|
-
let _postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
|
|
267
|
-
let _warnHtmlMessage = __root ? __root.warnHtmlMessage : isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
|
|
268
|
-
let _escapeParameter = !!options.escapeParameter;
|
|
269
|
-
const _modifiers = __root ? __root.modifiers : isPlainObject(options.modifiers) ? options.modifiers : {};
|
|
270
|
-
let _pluralRules = options.pluralRules || __root && __root.pluralRules;
|
|
271
|
-
let _context;
|
|
272
|
-
const getCoreContext = () => {
|
|
273
|
-
_isGlobal && setFallbackContext(null);
|
|
274
|
-
const ctxOptions = {
|
|
275
|
-
version: VERSION,
|
|
276
|
-
locale: _locale.value,
|
|
277
|
-
fallbackLocale: _fallbackLocale.value,
|
|
278
|
-
messages: _messages.value,
|
|
279
|
-
modifiers: _modifiers,
|
|
280
|
-
pluralRules: _pluralRules,
|
|
281
|
-
missing: _runtimeMissing === null ? void 0 : _runtimeMissing,
|
|
282
|
-
missingWarn: _missingWarn,
|
|
283
|
-
fallbackWarn: _fallbackWarn,
|
|
284
|
-
fallbackFormat: _fallbackFormat,
|
|
285
|
-
unresolving: true,
|
|
286
|
-
postTranslation: _postTranslation === null ? void 0 : _postTranslation,
|
|
287
|
-
warnHtmlMessage: _warnHtmlMessage,
|
|
288
|
-
escapeParameter: _escapeParameter,
|
|
289
|
-
messageResolver: options.messageResolver,
|
|
290
|
-
messageCompiler: options.messageCompiler,
|
|
291
|
-
__meta: { framework: "vue" }
|
|
292
|
-
};
|
|
293
|
-
{
|
|
294
|
-
ctxOptions.datetimeFormats = _datetimeFormats.value;
|
|
295
|
-
ctxOptions.numberFormats = _numberFormats.value;
|
|
296
|
-
ctxOptions.__datetimeFormatters = isPlainObject(_context) ? _context.__datetimeFormatters : void 0;
|
|
297
|
-
ctxOptions.__numberFormatters = isPlainObject(_context) ? _context.__numberFormatters : void 0;
|
|
298
|
-
}
|
|
299
|
-
if (process.env.NODE_ENV !== "production") {
|
|
300
|
-
ctxOptions.__v_emitter = isPlainObject(_context) ? _context.__v_emitter : void 0;
|
|
301
|
-
}
|
|
302
|
-
const ctx = createCoreContext(ctxOptions);
|
|
303
|
-
_isGlobal && setFallbackContext(ctx);
|
|
304
|
-
return ctx;
|
|
305
|
-
};
|
|
306
|
-
_context = getCoreContext();
|
|
307
|
-
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
308
|
-
const locale = computed({
|
|
309
|
-
get: () => _locale.value,
|
|
310
|
-
set: (val) => {
|
|
311
|
-
_context.locale = val;
|
|
312
|
-
_locale.value = val;
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
const fallbackLocale = computed({
|
|
316
|
-
get: () => _fallbackLocale.value,
|
|
317
|
-
set: (val) => {
|
|
318
|
-
_context.fallbackLocale = val;
|
|
319
|
-
_fallbackLocale.value = val;
|
|
320
|
-
updateFallbackLocale(_context, _locale.value, val);
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
const messages = computed(() => _messages.value);
|
|
324
|
-
const datetimeFormats = /* @__PURE__ */ computed(() => _datetimeFormats.value);
|
|
325
|
-
const numberFormats = /* @__PURE__ */ computed(() => _numberFormats.value);
|
|
326
|
-
function getPostTranslationHandler() {
|
|
327
|
-
return isFunction(_postTranslation) ? _postTranslation : null;
|
|
328
|
-
}
|
|
329
|
-
function setPostTranslationHandler(handler) {
|
|
330
|
-
_postTranslation = handler;
|
|
331
|
-
_context.postTranslation = handler;
|
|
332
|
-
}
|
|
333
|
-
function getMissingHandler() {
|
|
334
|
-
return _missing;
|
|
335
|
-
}
|
|
336
|
-
function setMissingHandler(handler) {
|
|
337
|
-
if (handler !== null) {
|
|
338
|
-
_runtimeMissing = defineCoreMissingHandler(handler);
|
|
339
|
-
}
|
|
340
|
-
_missing = handler;
|
|
341
|
-
_context.missing = _runtimeMissing;
|
|
342
|
-
}
|
|
343
|
-
function isResolvedTranslateMessage(type, arg) {
|
|
344
|
-
return type !== "translate" || !arg.resolvedMessage;
|
|
345
|
-
}
|
|
346
|
-
const wrapWithDeps = (fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) => {
|
|
347
|
-
let ret;
|
|
348
|
-
try {
|
|
349
|
-
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
|
|
350
|
-
setAdditionalMeta(/* @__PURE__ */ getMetaInfo());
|
|
351
|
-
}
|
|
352
|
-
if (!_isGlobal) {
|
|
353
|
-
_context.fallbackContext = __root ? getFallbackContext() : void 0;
|
|
354
|
-
}
|
|
355
|
-
ret = fn(_context);
|
|
356
|
-
} finally {
|
|
357
|
-
if (!_isGlobal) {
|
|
358
|
-
_context.fallbackContext = void 0;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
if (warnType !== "translate exists" && // for not `te` (e.g `t`)
|
|
362
|
-
isNumber(ret) && ret === NOT_REOSLVED || warnType === "translate exists" && !ret) {
|
|
363
|
-
const [key, arg2] = argumentParser();
|
|
364
|
-
if (process.env.NODE_ENV !== "production" && __root && isString(key) && isResolvedTranslateMessage(warnType, arg2)) {
|
|
365
|
-
if (_fallbackRoot && (isTranslateFallbackWarn(_fallbackWarn, key) || isTranslateMissingWarn(_missingWarn, key))) {
|
|
366
|
-
warn(getWarnMessage(I18nWarnCodes.FALLBACK_TO_ROOT, {
|
|
367
|
-
key,
|
|
368
|
-
type: warnType
|
|
369
|
-
}));
|
|
370
|
-
}
|
|
371
|
-
if (process.env.NODE_ENV !== "production") {
|
|
372
|
-
const { __v_emitter: emitter } = _context;
|
|
373
|
-
if (emitter && _fallbackRoot) {
|
|
374
|
-
emitter.emit("fallback", {
|
|
375
|
-
type: warnType,
|
|
376
|
-
key,
|
|
377
|
-
to: "global",
|
|
378
|
-
groupId: `${warnType}:${key}`
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key);
|
|
384
|
-
} else if (successCondition(ret)) {
|
|
385
|
-
return ret;
|
|
386
|
-
} else {
|
|
387
|
-
throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE);
|
|
388
|
-
}
|
|
389
|
-
};
|
|
390
|
-
function t(...args) {
|
|
391
|
-
return wrapWithDeps((context) => Reflect.apply(translate, null, [context, ...args]), () => parseTranslateArgs(...args), "translate", (root) => Reflect.apply(root.t, root, [...args]), (key) => key, (val) => isString(val));
|
|
392
|
-
}
|
|
393
|
-
function rt(...args) {
|
|
394
|
-
const [arg1, arg2, arg3] = args;
|
|
395
|
-
if (arg3 && !isObject(arg3)) {
|
|
396
|
-
throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
|
|
397
|
-
}
|
|
398
|
-
return t(...[arg1, arg2, assign({ resolvedMessage: true }, arg3 || {})]);
|
|
399
|
-
}
|
|
400
|
-
function d(...args) {
|
|
401
|
-
return wrapWithDeps((context) => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), "datetime format", (root) => Reflect.apply(root.d, root, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString(val) || isArray(val));
|
|
402
|
-
}
|
|
403
|
-
function n(...args) {
|
|
404
|
-
return wrapWithDeps((context) => Reflect.apply(number, null, [context, ...args]), () => parseNumberArgs(...args), "number format", (root) => Reflect.apply(root.n, root, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString(val) || isArray(val));
|
|
405
|
-
}
|
|
406
|
-
function normalize(values) {
|
|
407
|
-
return values.map((val) => isString(val) || isNumber(val) || isBoolean(val) ? createTextNode(String(val)) : val);
|
|
408
|
-
}
|
|
409
|
-
const interpolate = (val) => val;
|
|
410
|
-
const processor = {
|
|
411
|
-
normalize,
|
|
412
|
-
interpolate,
|
|
413
|
-
type: "vnode"
|
|
414
|
-
};
|
|
415
|
-
function translateVNode(...args) {
|
|
416
|
-
return wrapWithDeps((context) => {
|
|
417
|
-
let ret;
|
|
418
|
-
const _context2 = context;
|
|
419
|
-
try {
|
|
420
|
-
_context2.processor = processor;
|
|
421
|
-
ret = Reflect.apply(translate, null, [_context2, ...args]);
|
|
422
|
-
} finally {
|
|
423
|
-
_context2.processor = null;
|
|
424
|
-
}
|
|
425
|
-
return ret;
|
|
426
|
-
}, () => parseTranslateArgs(...args), "translate", (root) => root[TranslateVNodeSymbol](...args), (key) => [createTextNode(key)], (val) => isArray(val));
|
|
427
|
-
}
|
|
428
|
-
function numberParts(...args) {
|
|
429
|
-
return wrapWithDeps((context) => Reflect.apply(number, null, [context, ...args]), () => parseNumberArgs(...args), "number format", (root) => root[NumberPartsSymbol](...args), NOOP_RETURN_ARRAY, (val) => isString(val) || isArray(val));
|
|
430
|
-
}
|
|
431
|
-
function datetimeParts(...args) {
|
|
432
|
-
return wrapWithDeps((context) => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), "datetime format", (root) => root[DatetimePartsSymbol](...args), NOOP_RETURN_ARRAY, (val) => isString(val) || isArray(val));
|
|
433
|
-
}
|
|
434
|
-
function setPluralRules(rules) {
|
|
435
|
-
_pluralRules = rules;
|
|
436
|
-
_context.pluralRules = _pluralRules;
|
|
437
|
-
}
|
|
438
|
-
function te(key, locale2) {
|
|
439
|
-
return wrapWithDeps(() => {
|
|
440
|
-
if (!key) {
|
|
441
|
-
return false;
|
|
442
|
-
}
|
|
443
|
-
const targetLocale = isString(locale2) ? locale2 : _locale.value;
|
|
444
|
-
const message = getLocaleMessage(targetLocale);
|
|
445
|
-
const resolved = _context.messageResolver(message, key);
|
|
446
|
-
return isMessageAST(resolved) || isMessageFunction(resolved) || isString(resolved);
|
|
447
|
-
}, () => [key], "translate exists", (root) => {
|
|
448
|
-
return Reflect.apply(root.te, root, [key, locale2]);
|
|
449
|
-
}, NOOP_RETURN_FALSE, (val) => isBoolean(val));
|
|
450
|
-
}
|
|
451
|
-
function resolveMessages(key) {
|
|
452
|
-
let messages2 = null;
|
|
453
|
-
const locales = fallbackWithLocaleChain(_context, _fallbackLocale.value, _locale.value);
|
|
454
|
-
for (let i = 0; i < locales.length; i++) {
|
|
455
|
-
const targetLocaleMessages = _messages.value[locales[i]] || {};
|
|
456
|
-
const messageValue = _context.messageResolver(targetLocaleMessages, key);
|
|
457
|
-
if (messageValue != null) {
|
|
458
|
-
messages2 = messageValue;
|
|
459
|
-
break;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
return messages2;
|
|
463
|
-
}
|
|
464
|
-
function tm(key) {
|
|
465
|
-
const messages2 = resolveMessages(key);
|
|
466
|
-
return messages2 != null ? messages2 : __root ? __root.tm(key) || {} : {};
|
|
467
|
-
}
|
|
468
|
-
function getLocaleMessage(locale2) {
|
|
469
|
-
return _messages.value[locale2] || {};
|
|
470
|
-
}
|
|
471
|
-
function setLocaleMessage(locale2, message) {
|
|
472
|
-
if (flatJson) {
|
|
473
|
-
const _message = { [locale2]: message };
|
|
474
|
-
for (const key in _message) {
|
|
475
|
-
if (hasOwn(_message, key)) {
|
|
476
|
-
handleFlatJson(_message[key]);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
message = _message[locale2];
|
|
480
|
-
}
|
|
481
|
-
_messages.value[locale2] = message;
|
|
482
|
-
_context.messages = _messages.value;
|
|
483
|
-
}
|
|
484
|
-
function mergeLocaleMessage(locale2, message) {
|
|
485
|
-
_messages.value[locale2] = _messages.value[locale2] || {};
|
|
486
|
-
const _message = { [locale2]: message };
|
|
487
|
-
if (flatJson) {
|
|
488
|
-
for (const key in _message) {
|
|
489
|
-
if (hasOwn(_message, key)) {
|
|
490
|
-
handleFlatJson(_message[key]);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
message = _message[locale2];
|
|
495
|
-
deepCopy(message, _messages.value[locale2]);
|
|
496
|
-
_context.messages = _messages.value;
|
|
497
|
-
}
|
|
498
|
-
function getDateTimeFormat(locale2) {
|
|
499
|
-
return _datetimeFormats.value[locale2] || {};
|
|
500
|
-
}
|
|
501
|
-
function setDateTimeFormat(locale2, format2) {
|
|
502
|
-
_datetimeFormats.value[locale2] = format2;
|
|
503
|
-
_context.datetimeFormats = _datetimeFormats.value;
|
|
504
|
-
clearDateTimeFormat(_context, locale2, format2);
|
|
505
|
-
}
|
|
506
|
-
function mergeDateTimeFormat(locale2, format2) {
|
|
507
|
-
_datetimeFormats.value[locale2] = assign(_datetimeFormats.value[locale2] || {}, format2);
|
|
508
|
-
_context.datetimeFormats = _datetimeFormats.value;
|
|
509
|
-
clearDateTimeFormat(_context, locale2, format2);
|
|
510
|
-
}
|
|
511
|
-
function getNumberFormat(locale2) {
|
|
512
|
-
return _numberFormats.value[locale2] || {};
|
|
513
|
-
}
|
|
514
|
-
function setNumberFormat(locale2, format2) {
|
|
515
|
-
_numberFormats.value[locale2] = format2;
|
|
516
|
-
_context.numberFormats = _numberFormats.value;
|
|
517
|
-
clearNumberFormat(_context, locale2, format2);
|
|
518
|
-
}
|
|
519
|
-
function mergeNumberFormat(locale2, format2) {
|
|
520
|
-
_numberFormats.value[locale2] = assign(_numberFormats.value[locale2] || {}, format2);
|
|
521
|
-
_context.numberFormats = _numberFormats.value;
|
|
522
|
-
clearNumberFormat(_context, locale2, format2);
|
|
523
|
-
}
|
|
524
|
-
composerID++;
|
|
525
|
-
if (__root && inBrowser) {
|
|
526
|
-
watch(__root.locale, (val) => {
|
|
527
|
-
if (_inheritLocale) {
|
|
528
|
-
_locale.value = val;
|
|
529
|
-
_context.locale = val;
|
|
530
|
-
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
531
|
-
}
|
|
532
|
-
});
|
|
533
|
-
watch(__root.fallbackLocale, (val) => {
|
|
534
|
-
if (_inheritLocale) {
|
|
535
|
-
_fallbackLocale.value = val;
|
|
536
|
-
_context.fallbackLocale = val;
|
|
537
|
-
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
const composer = {
|
|
542
|
-
id: composerID,
|
|
543
|
-
locale,
|
|
544
|
-
fallbackLocale,
|
|
545
|
-
get inheritLocale() {
|
|
546
|
-
return _inheritLocale;
|
|
547
|
-
},
|
|
548
|
-
set inheritLocale(val) {
|
|
549
|
-
_inheritLocale = val;
|
|
550
|
-
if (val && __root) {
|
|
551
|
-
_locale.value = __root.locale.value;
|
|
552
|
-
_fallbackLocale.value = __root.fallbackLocale.value;
|
|
553
|
-
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
554
|
-
}
|
|
555
|
-
},
|
|
556
|
-
get availableLocales() {
|
|
557
|
-
return Object.keys(_messages.value).sort();
|
|
558
|
-
},
|
|
559
|
-
messages,
|
|
560
|
-
get modifiers() {
|
|
561
|
-
return _modifiers;
|
|
562
|
-
},
|
|
563
|
-
get pluralRules() {
|
|
564
|
-
return _pluralRules || {};
|
|
565
|
-
},
|
|
566
|
-
get isGlobal() {
|
|
567
|
-
return _isGlobal;
|
|
568
|
-
},
|
|
569
|
-
get missingWarn() {
|
|
570
|
-
return _missingWarn;
|
|
571
|
-
},
|
|
572
|
-
set missingWarn(val) {
|
|
573
|
-
_missingWarn = val;
|
|
574
|
-
_context.missingWarn = _missingWarn;
|
|
575
|
-
},
|
|
576
|
-
get fallbackWarn() {
|
|
577
|
-
return _fallbackWarn;
|
|
578
|
-
},
|
|
579
|
-
set fallbackWarn(val) {
|
|
580
|
-
_fallbackWarn = val;
|
|
581
|
-
_context.fallbackWarn = _fallbackWarn;
|
|
582
|
-
},
|
|
583
|
-
get fallbackRoot() {
|
|
584
|
-
return _fallbackRoot;
|
|
585
|
-
},
|
|
586
|
-
set fallbackRoot(val) {
|
|
587
|
-
_fallbackRoot = val;
|
|
588
|
-
},
|
|
589
|
-
get fallbackFormat() {
|
|
590
|
-
return _fallbackFormat;
|
|
591
|
-
},
|
|
592
|
-
set fallbackFormat(val) {
|
|
593
|
-
_fallbackFormat = val;
|
|
594
|
-
_context.fallbackFormat = _fallbackFormat;
|
|
595
|
-
},
|
|
596
|
-
get warnHtmlMessage() {
|
|
597
|
-
return _warnHtmlMessage;
|
|
598
|
-
},
|
|
599
|
-
set warnHtmlMessage(val) {
|
|
600
|
-
_warnHtmlMessage = val;
|
|
601
|
-
_context.warnHtmlMessage = val;
|
|
602
|
-
},
|
|
603
|
-
get escapeParameter() {
|
|
604
|
-
return _escapeParameter;
|
|
605
|
-
},
|
|
606
|
-
set escapeParameter(val) {
|
|
607
|
-
_escapeParameter = val;
|
|
608
|
-
_context.escapeParameter = val;
|
|
609
|
-
},
|
|
610
|
-
t,
|
|
611
|
-
getLocaleMessage,
|
|
612
|
-
setLocaleMessage,
|
|
613
|
-
mergeLocaleMessage,
|
|
614
|
-
getPostTranslationHandler,
|
|
615
|
-
setPostTranslationHandler,
|
|
616
|
-
getMissingHandler,
|
|
617
|
-
setMissingHandler,
|
|
618
|
-
[SetPluralRulesSymbol]: setPluralRules
|
|
619
|
-
};
|
|
620
|
-
{
|
|
621
|
-
composer.datetimeFormats = datetimeFormats;
|
|
622
|
-
composer.numberFormats = numberFormats;
|
|
623
|
-
composer.rt = rt;
|
|
624
|
-
composer.te = te;
|
|
625
|
-
composer.tm = tm;
|
|
626
|
-
composer.d = d;
|
|
627
|
-
composer.n = n;
|
|
628
|
-
composer.getDateTimeFormat = getDateTimeFormat;
|
|
629
|
-
composer.setDateTimeFormat = setDateTimeFormat;
|
|
630
|
-
composer.mergeDateTimeFormat = mergeDateTimeFormat;
|
|
631
|
-
composer.getNumberFormat = getNumberFormat;
|
|
632
|
-
composer.setNumberFormat = setNumberFormat;
|
|
633
|
-
composer.mergeNumberFormat = mergeNumberFormat;
|
|
634
|
-
composer[InejctWithOptionSymbol] = __injectWithOption;
|
|
635
|
-
composer[TranslateVNodeSymbol] = translateVNode;
|
|
636
|
-
composer[DatetimePartsSymbol] = datetimeParts;
|
|
637
|
-
composer[NumberPartsSymbol] = numberParts;
|
|
638
|
-
}
|
|
639
|
-
if (process.env.NODE_ENV !== "production") {
|
|
640
|
-
composer[EnableEmitter] = (emitter) => {
|
|
641
|
-
_context.__v_emitter = emitter;
|
|
642
|
-
};
|
|
643
|
-
composer[DisableEmitter] = () => {
|
|
644
|
-
_context.__v_emitter = void 0;
|
|
645
|
-
};
|
|
646
|
-
}
|
|
647
|
-
return composer;
|
|
648
|
-
}
|
|
649
|
-
const VUE_I18N_COMPONENT_TYPES = "vue-i18n: composer properties";
|
|
650
|
-
const VueDevToolsLabels = {
|
|
651
|
-
"vue-devtools-plugin-vue-i18n": "Vue I18n DevTools",
|
|
652
|
-
"vue-i18n-resource-inspector": "Vue I18n DevTools",
|
|
653
|
-
"vue-i18n-timeline": "Vue I18n"
|
|
654
|
-
};
|
|
655
|
-
const VueDevToolsPlaceholders = {
|
|
656
|
-
"vue-i18n-resource-inspector": "Search for scopes ..."
|
|
657
|
-
};
|
|
658
|
-
const VueDevToolsTimelineColors = {
|
|
659
|
-
"vue-i18n-timeline": 16764185
|
|
660
|
-
};
|
|
661
|
-
let devtoolsApi;
|
|
662
|
-
async function enableDevTools(app, i18n) {
|
|
663
|
-
return new Promise((resolve, reject) => {
|
|
664
|
-
try {
|
|
665
|
-
setupDevtoolsPlugin({
|
|
666
|
-
id: "vue-devtools-plugin-vue-i18n",
|
|
667
|
-
label: VueDevToolsLabels["vue-devtools-plugin-vue-i18n"],
|
|
668
|
-
packageName: "vue-i18n",
|
|
669
|
-
homepage: "https://vue-i18n.intlify.dev",
|
|
670
|
-
logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
|
|
671
|
-
componentStateTypes: [VUE_I18N_COMPONENT_TYPES],
|
|
672
|
-
app
|
|
673
|
-
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
674
|
-
}, (api) => {
|
|
675
|
-
devtoolsApi = api;
|
|
676
|
-
api.on.visitComponentTree(({ componentInstance, treeNode }) => {
|
|
677
|
-
updateComponentTreeTags(componentInstance, treeNode, i18n);
|
|
678
|
-
});
|
|
679
|
-
api.on.inspectComponent(({ componentInstance, instanceData }) => {
|
|
680
|
-
if (componentInstance.vnode.el && componentInstance.vnode.el.__VUE_I18N__ && instanceData) {
|
|
681
|
-
if (i18n.mode === "legacy") {
|
|
682
|
-
if (componentInstance.vnode.el.__VUE_I18N__ !== i18n.global.__composer) {
|
|
683
|
-
inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
|
|
684
|
-
}
|
|
685
|
-
} else {
|
|
686
|
-
inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
});
|
|
690
|
-
api.addInspector({
|
|
691
|
-
id: "vue-i18n-resource-inspector",
|
|
692
|
-
label: VueDevToolsLabels["vue-i18n-resource-inspector"],
|
|
693
|
-
icon: "language",
|
|
694
|
-
treeFilterPlaceholder: VueDevToolsPlaceholders["vue-i18n-resource-inspector"]
|
|
695
|
-
});
|
|
696
|
-
api.on.getInspectorTree((payload) => {
|
|
697
|
-
if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
|
|
698
|
-
registerScope(payload, i18n);
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
const roots = /* @__PURE__ */ new Map();
|
|
702
|
-
api.on.getInspectorState(async (payload) => {
|
|
703
|
-
if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
|
|
704
|
-
api.unhighlightElement();
|
|
705
|
-
inspectScope(payload, i18n);
|
|
706
|
-
if (payload.nodeId === "global") {
|
|
707
|
-
if (!roots.has(payload.app)) {
|
|
708
|
-
const [root] = await api.getComponentInstances(payload.app);
|
|
709
|
-
roots.set(payload.app, root);
|
|
710
|
-
}
|
|
711
|
-
api.highlightElement(roots.get(payload.app));
|
|
712
|
-
} else {
|
|
713
|
-
const instance = getComponentInstance(payload.nodeId, i18n);
|
|
714
|
-
instance && api.highlightElement(instance);
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
});
|
|
718
|
-
api.on.editInspectorState((payload) => {
|
|
719
|
-
if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
|
|
720
|
-
editScope(payload, i18n);
|
|
721
|
-
}
|
|
722
|
-
});
|
|
723
|
-
api.addTimelineLayer({
|
|
724
|
-
id: "vue-i18n-timeline",
|
|
725
|
-
label: VueDevToolsLabels["vue-i18n-timeline"],
|
|
726
|
-
color: VueDevToolsTimelineColors["vue-i18n-timeline"]
|
|
727
|
-
});
|
|
728
|
-
resolve(true);
|
|
729
|
-
});
|
|
730
|
-
} catch (e) {
|
|
731
|
-
console.error(e);
|
|
732
|
-
reject(false);
|
|
733
|
-
}
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
function getI18nScopeLable(instance) {
|
|
737
|
-
return instance.type.name || instance.type.displayName || instance.type.__file || "Anonymous";
|
|
738
|
-
}
|
|
739
|
-
function updateComponentTreeTags(instance, treeNode, i18n) {
|
|
740
|
-
const global = i18n.mode === "composition" ? i18n.global : i18n.global.__composer;
|
|
741
|
-
if (instance && instance.vnode.el && instance.vnode.el.__VUE_I18N__) {
|
|
742
|
-
if (instance.vnode.el.__VUE_I18N__ !== global) {
|
|
743
|
-
const tag = {
|
|
744
|
-
label: `i18n (${getI18nScopeLable(instance)} Scope)`,
|
|
745
|
-
textColor: 0,
|
|
746
|
-
backgroundColor: 16764185
|
|
747
|
-
};
|
|
748
|
-
treeNode.tags.push(tag);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
function inspectComposer(instanceData, composer) {
|
|
753
|
-
const type = VUE_I18N_COMPONENT_TYPES;
|
|
754
|
-
instanceData.state.push({
|
|
755
|
-
type,
|
|
756
|
-
key: "locale",
|
|
757
|
-
editable: true,
|
|
758
|
-
value: composer.locale.value
|
|
759
|
-
});
|
|
760
|
-
instanceData.state.push({
|
|
761
|
-
type,
|
|
762
|
-
key: "availableLocales",
|
|
763
|
-
editable: false,
|
|
764
|
-
value: composer.availableLocales
|
|
765
|
-
});
|
|
766
|
-
instanceData.state.push({
|
|
767
|
-
type,
|
|
768
|
-
key: "fallbackLocale",
|
|
769
|
-
editable: true,
|
|
770
|
-
value: composer.fallbackLocale.value
|
|
771
|
-
});
|
|
772
|
-
instanceData.state.push({
|
|
773
|
-
type,
|
|
774
|
-
key: "inheritLocale",
|
|
775
|
-
editable: true,
|
|
776
|
-
value: composer.inheritLocale
|
|
777
|
-
});
|
|
778
|
-
instanceData.state.push({
|
|
779
|
-
type,
|
|
780
|
-
key: "messages",
|
|
781
|
-
editable: false,
|
|
782
|
-
value: getLocaleMessageValue(composer.messages.value)
|
|
783
|
-
});
|
|
784
|
-
{
|
|
785
|
-
instanceData.state.push({
|
|
786
|
-
type,
|
|
787
|
-
key: "datetimeFormats",
|
|
788
|
-
editable: false,
|
|
789
|
-
value: composer.datetimeFormats.value
|
|
790
|
-
});
|
|
791
|
-
instanceData.state.push({
|
|
792
|
-
type,
|
|
793
|
-
key: "numberFormats",
|
|
794
|
-
editable: false,
|
|
795
|
-
value: composer.numberFormats.value
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
function getLocaleMessageValue(messages) {
|
|
800
|
-
const value = {};
|
|
801
|
-
Object.keys(messages).forEach((key) => {
|
|
802
|
-
const v = messages[key];
|
|
803
|
-
if (isFunction(v) && "source" in v) {
|
|
804
|
-
value[key] = getMessageFunctionDetails(v);
|
|
805
|
-
} else if (isMessageAST(v) && v.loc && v.loc.source) {
|
|
806
|
-
value[key] = v.loc.source;
|
|
807
|
-
} else if (isObject(v)) {
|
|
808
|
-
value[key] = getLocaleMessageValue(v);
|
|
809
|
-
} else {
|
|
810
|
-
value[key] = v;
|
|
811
|
-
}
|
|
812
|
-
});
|
|
813
|
-
return value;
|
|
814
|
-
}
|
|
815
|
-
const ESC = {
|
|
816
|
-
"<": "<",
|
|
817
|
-
">": ">",
|
|
818
|
-
'"': """,
|
|
819
|
-
"&": "&"
|
|
820
|
-
};
|
|
821
|
-
function escape(s) {
|
|
822
|
-
return s.replace(/[<>"&]/g, escapeChar);
|
|
823
|
-
}
|
|
824
|
-
function escapeChar(a) {
|
|
825
|
-
return ESC[a] || a;
|
|
826
|
-
}
|
|
827
|
-
function getMessageFunctionDetails(func) {
|
|
828
|
-
const argString = func.source ? `("${escape(func.source)}")` : `(?)`;
|
|
829
|
-
return {
|
|
830
|
-
_custom: {
|
|
831
|
-
type: "function",
|
|
832
|
-
display: `<span>ƒ</span> ${argString}`
|
|
833
|
-
}
|
|
834
|
-
};
|
|
835
|
-
}
|
|
836
|
-
function registerScope(payload, i18n) {
|
|
837
|
-
payload.rootNodes.push({
|
|
838
|
-
id: "global",
|
|
839
|
-
label: "Global Scope"
|
|
840
|
-
});
|
|
841
|
-
const global = i18n.mode === "composition" ? i18n.global : i18n.global.__composer;
|
|
842
|
-
for (const [keyInstance, instance] of i18n.__instances) {
|
|
843
|
-
const composer = i18n.mode === "composition" ? instance : instance.__composer;
|
|
844
|
-
if (global === composer) {
|
|
845
|
-
continue;
|
|
846
|
-
}
|
|
847
|
-
payload.rootNodes.push({
|
|
848
|
-
id: composer.id.toString(),
|
|
849
|
-
label: `${getI18nScopeLable(keyInstance)} Scope`
|
|
850
|
-
});
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
function getComponentInstance(nodeId, i18n) {
|
|
854
|
-
let instance = null;
|
|
855
|
-
if (nodeId !== "global") {
|
|
856
|
-
for (const [component, composer] of i18n.__instances.entries()) {
|
|
857
|
-
if (composer.id.toString() === nodeId) {
|
|
858
|
-
instance = component;
|
|
859
|
-
break;
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
return instance;
|
|
864
|
-
}
|
|
865
|
-
function getComposer$2(nodeId, i18n) {
|
|
866
|
-
if (nodeId === "global") {
|
|
867
|
-
return i18n.mode === "composition" ? i18n.global : i18n.global.__composer;
|
|
868
|
-
} else {
|
|
869
|
-
const instance = Array.from(i18n.__instances.values()).find((item) => item.id.toString() === nodeId);
|
|
870
|
-
if (instance) {
|
|
871
|
-
return i18n.mode === "composition" ? instance : instance.__composer;
|
|
872
|
-
} else {
|
|
873
|
-
return null;
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
function inspectScope(payload, i18n) {
|
|
878
|
-
const composer = getComposer$2(payload.nodeId, i18n);
|
|
879
|
-
if (composer) {
|
|
880
|
-
payload.state = makeScopeInspectState(composer);
|
|
881
|
-
}
|
|
882
|
-
return null;
|
|
883
|
-
}
|
|
884
|
-
function makeScopeInspectState(composer) {
|
|
885
|
-
const state = {};
|
|
886
|
-
const localeType = "Locale related info";
|
|
887
|
-
const localeStates = [
|
|
888
|
-
{
|
|
889
|
-
type: localeType,
|
|
890
|
-
key: "locale",
|
|
891
|
-
editable: true,
|
|
892
|
-
value: composer.locale.value
|
|
893
|
-
},
|
|
894
|
-
{
|
|
895
|
-
type: localeType,
|
|
896
|
-
key: "fallbackLocale",
|
|
897
|
-
editable: true,
|
|
898
|
-
value: composer.fallbackLocale.value
|
|
899
|
-
},
|
|
900
|
-
{
|
|
901
|
-
type: localeType,
|
|
902
|
-
key: "availableLocales",
|
|
903
|
-
editable: false,
|
|
904
|
-
value: composer.availableLocales
|
|
905
|
-
},
|
|
906
|
-
{
|
|
907
|
-
type: localeType,
|
|
908
|
-
key: "inheritLocale",
|
|
909
|
-
editable: true,
|
|
910
|
-
value: composer.inheritLocale
|
|
911
|
-
}
|
|
912
|
-
];
|
|
913
|
-
state[localeType] = localeStates;
|
|
914
|
-
const localeMessagesType = "Locale messages info";
|
|
915
|
-
const localeMessagesStates = [
|
|
916
|
-
{
|
|
917
|
-
type: localeMessagesType,
|
|
918
|
-
key: "messages",
|
|
919
|
-
editable: false,
|
|
920
|
-
value: getLocaleMessageValue(composer.messages.value)
|
|
921
|
-
}
|
|
922
|
-
];
|
|
923
|
-
state[localeMessagesType] = localeMessagesStates;
|
|
924
|
-
{
|
|
925
|
-
const datetimeFormatsType = "Datetime formats info";
|
|
926
|
-
const datetimeFormatsStates = [
|
|
927
|
-
{
|
|
928
|
-
type: datetimeFormatsType,
|
|
929
|
-
key: "datetimeFormats",
|
|
930
|
-
editable: false,
|
|
931
|
-
value: composer.datetimeFormats.value
|
|
932
|
-
}
|
|
933
|
-
];
|
|
934
|
-
state[datetimeFormatsType] = datetimeFormatsStates;
|
|
935
|
-
const numberFormatsType = "Datetime formats info";
|
|
936
|
-
const numberFormatsStates = [
|
|
937
|
-
{
|
|
938
|
-
type: numberFormatsType,
|
|
939
|
-
key: "numberFormats",
|
|
940
|
-
editable: false,
|
|
941
|
-
value: composer.numberFormats.value
|
|
942
|
-
}
|
|
943
|
-
];
|
|
944
|
-
state[numberFormatsType] = numberFormatsStates;
|
|
945
|
-
}
|
|
946
|
-
return state;
|
|
947
|
-
}
|
|
948
|
-
function addTimelineEvent(event, payload) {
|
|
949
|
-
if (devtoolsApi) {
|
|
950
|
-
let groupId;
|
|
951
|
-
if (payload && "groupId" in payload) {
|
|
952
|
-
groupId = payload.groupId;
|
|
953
|
-
delete payload.groupId;
|
|
954
|
-
}
|
|
955
|
-
devtoolsApi.addTimelineEvent({
|
|
956
|
-
layerId: "vue-i18n-timeline",
|
|
957
|
-
event: {
|
|
958
|
-
title: event,
|
|
959
|
-
groupId,
|
|
960
|
-
time: Date.now(),
|
|
961
|
-
meta: {},
|
|
962
|
-
data: payload || {},
|
|
963
|
-
logType: event === "compile-error" ? "error" : event === "fallback" || event === "missing" ? "warning" : "default"
|
|
964
|
-
}
|
|
965
|
-
});
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
function editScope(payload, i18n) {
|
|
969
|
-
const composer = getComposer$2(payload.nodeId, i18n);
|
|
970
|
-
if (composer) {
|
|
971
|
-
const [field] = payload.path;
|
|
972
|
-
if (field === "locale" && isString(payload.state.value)) {
|
|
973
|
-
composer.locale.value = payload.state.value;
|
|
974
|
-
} else if (field === "fallbackLocale" && (isString(payload.state.value) || isArray(payload.state.value) || isObject(payload.state.value))) {
|
|
975
|
-
composer.fallbackLocale.value = payload.state.value;
|
|
976
|
-
} else if (field === "inheritLocale" && isBoolean(payload.state.value)) {
|
|
977
|
-
composer.inheritLocale = payload.state.value;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
function convertComposerOptions(options) {
|
|
982
|
-
const locale = isString(options.locale) ? options.locale : DEFAULT_LOCALE;
|
|
983
|
-
const fallbackLocale = isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale;
|
|
984
|
-
const missing = isFunction(options.missing) ? options.missing : void 0;
|
|
985
|
-
const missingWarn = isBoolean(options.silentTranslationWarn) || isRegExp(options.silentTranslationWarn) ? !options.silentTranslationWarn : true;
|
|
986
|
-
const fallbackWarn = isBoolean(options.silentFallbackWarn) || isRegExp(options.silentFallbackWarn) ? !options.silentFallbackWarn : true;
|
|
987
|
-
const fallbackRoot = isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
|
|
988
|
-
const fallbackFormat = !!options.formatFallbackMessages;
|
|
989
|
-
const modifiers = isPlainObject(options.modifiers) ? options.modifiers : {};
|
|
990
|
-
const pluralizationRules = options.pluralizationRules;
|
|
991
|
-
const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : void 0;
|
|
992
|
-
const warnHtmlMessage = isString(options.warnHtmlInMessage) ? options.warnHtmlInMessage !== "off" : true;
|
|
993
|
-
const escapeParameter = !!options.escapeParameterHtml;
|
|
994
|
-
const inheritLocale = isBoolean(options.sync) ? options.sync : true;
|
|
995
|
-
let messages = options.messages;
|
|
996
|
-
if (isPlainObject(options.sharedMessages)) {
|
|
997
|
-
const sharedMessages = options.sharedMessages;
|
|
998
|
-
const locales = Object.keys(sharedMessages);
|
|
999
|
-
messages = locales.reduce((messages2, locale2) => {
|
|
1000
|
-
const message = messages2[locale2] || (messages2[locale2] = {});
|
|
1001
|
-
assign(message, sharedMessages[locale2]);
|
|
1002
|
-
return messages2;
|
|
1003
|
-
}, messages || {});
|
|
1004
|
-
}
|
|
1005
|
-
const { __i18n, __root, __injectWithOption } = options;
|
|
1006
|
-
const datetimeFormats = options.datetimeFormats;
|
|
1007
|
-
const numberFormats = options.numberFormats;
|
|
1008
|
-
const flatJson = options.flatJson;
|
|
1009
|
-
return {
|
|
1010
|
-
locale,
|
|
1011
|
-
fallbackLocale,
|
|
1012
|
-
messages,
|
|
1013
|
-
flatJson,
|
|
1014
|
-
datetimeFormats,
|
|
1015
|
-
numberFormats,
|
|
1016
|
-
missing,
|
|
1017
|
-
missingWarn,
|
|
1018
|
-
fallbackWarn,
|
|
1019
|
-
fallbackRoot,
|
|
1020
|
-
fallbackFormat,
|
|
1021
|
-
modifiers,
|
|
1022
|
-
pluralRules: pluralizationRules,
|
|
1023
|
-
postTranslation,
|
|
1024
|
-
warnHtmlMessage,
|
|
1025
|
-
escapeParameter,
|
|
1026
|
-
messageResolver: options.messageResolver,
|
|
1027
|
-
inheritLocale,
|
|
1028
|
-
__i18n,
|
|
1029
|
-
__root,
|
|
1030
|
-
__injectWithOption
|
|
1031
|
-
};
|
|
1032
|
-
}
|
|
1033
|
-
function createVueI18n(options = {}) {
|
|
1034
|
-
const composer = createComposer(convertComposerOptions(options));
|
|
1035
|
-
const { __extender } = options;
|
|
1036
|
-
const vueI18n = {
|
|
1037
|
-
// id
|
|
1038
|
-
id: composer.id,
|
|
1039
|
-
// locale
|
|
1040
|
-
get locale() {
|
|
1041
|
-
return composer.locale.value;
|
|
1042
|
-
},
|
|
1043
|
-
set locale(val) {
|
|
1044
|
-
composer.locale.value = val;
|
|
1045
|
-
},
|
|
1046
|
-
// fallbackLocale
|
|
1047
|
-
get fallbackLocale() {
|
|
1048
|
-
return composer.fallbackLocale.value;
|
|
1049
|
-
},
|
|
1050
|
-
set fallbackLocale(val) {
|
|
1051
|
-
composer.fallbackLocale.value = val;
|
|
1052
|
-
},
|
|
1053
|
-
// messages
|
|
1054
|
-
get messages() {
|
|
1055
|
-
return composer.messages.value;
|
|
1056
|
-
},
|
|
1057
|
-
// datetimeFormats
|
|
1058
|
-
get datetimeFormats() {
|
|
1059
|
-
return composer.datetimeFormats.value;
|
|
1060
|
-
},
|
|
1061
|
-
// numberFormats
|
|
1062
|
-
get numberFormats() {
|
|
1063
|
-
return composer.numberFormats.value;
|
|
1064
|
-
},
|
|
1065
|
-
// availableLocales
|
|
1066
|
-
get availableLocales() {
|
|
1067
|
-
return composer.availableLocales;
|
|
1068
|
-
},
|
|
1069
|
-
// missing
|
|
1070
|
-
get missing() {
|
|
1071
|
-
return composer.getMissingHandler();
|
|
1072
|
-
},
|
|
1073
|
-
set missing(handler) {
|
|
1074
|
-
composer.setMissingHandler(handler);
|
|
1075
|
-
},
|
|
1076
|
-
// silentTranslationWarn
|
|
1077
|
-
get silentTranslationWarn() {
|
|
1078
|
-
return isBoolean(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn;
|
|
1079
|
-
},
|
|
1080
|
-
set silentTranslationWarn(val) {
|
|
1081
|
-
composer.missingWarn = isBoolean(val) ? !val : val;
|
|
1082
|
-
},
|
|
1083
|
-
// silentFallbackWarn
|
|
1084
|
-
get silentFallbackWarn() {
|
|
1085
|
-
return isBoolean(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn;
|
|
1086
|
-
},
|
|
1087
|
-
set silentFallbackWarn(val) {
|
|
1088
|
-
composer.fallbackWarn = isBoolean(val) ? !val : val;
|
|
1089
|
-
},
|
|
1090
|
-
// modifiers
|
|
1091
|
-
get modifiers() {
|
|
1092
|
-
return composer.modifiers;
|
|
1093
|
-
},
|
|
1094
|
-
// formatFallbackMessages
|
|
1095
|
-
get formatFallbackMessages() {
|
|
1096
|
-
return composer.fallbackFormat;
|
|
1097
|
-
},
|
|
1098
|
-
set formatFallbackMessages(val) {
|
|
1099
|
-
composer.fallbackFormat = val;
|
|
1100
|
-
},
|
|
1101
|
-
// postTranslation
|
|
1102
|
-
get postTranslation() {
|
|
1103
|
-
return composer.getPostTranslationHandler();
|
|
1104
|
-
},
|
|
1105
|
-
set postTranslation(handler) {
|
|
1106
|
-
composer.setPostTranslationHandler(handler);
|
|
1107
|
-
},
|
|
1108
|
-
// sync
|
|
1109
|
-
get sync() {
|
|
1110
|
-
return composer.inheritLocale;
|
|
1111
|
-
},
|
|
1112
|
-
set sync(val) {
|
|
1113
|
-
composer.inheritLocale = val;
|
|
1114
|
-
},
|
|
1115
|
-
// warnInHtmlMessage
|
|
1116
|
-
get warnHtmlInMessage() {
|
|
1117
|
-
return composer.warnHtmlMessage ? "warn" : "off";
|
|
1118
|
-
},
|
|
1119
|
-
set warnHtmlInMessage(val) {
|
|
1120
|
-
composer.warnHtmlMessage = val !== "off";
|
|
1121
|
-
},
|
|
1122
|
-
// escapeParameterHtml
|
|
1123
|
-
get escapeParameterHtml() {
|
|
1124
|
-
return composer.escapeParameter;
|
|
1125
|
-
},
|
|
1126
|
-
set escapeParameterHtml(val) {
|
|
1127
|
-
composer.escapeParameter = val;
|
|
1128
|
-
},
|
|
1129
|
-
// pluralizationRules
|
|
1130
|
-
get pluralizationRules() {
|
|
1131
|
-
return composer.pluralRules || {};
|
|
1132
|
-
},
|
|
1133
|
-
// for internal
|
|
1134
|
-
__composer: composer,
|
|
1135
|
-
// t
|
|
1136
|
-
t(...args) {
|
|
1137
|
-
return Reflect.apply(composer.t, composer, [...args]);
|
|
1138
|
-
},
|
|
1139
|
-
// rt
|
|
1140
|
-
rt(...args) {
|
|
1141
|
-
return Reflect.apply(composer.rt, composer, [...args]);
|
|
1142
|
-
},
|
|
1143
|
-
// te
|
|
1144
|
-
te(key, locale) {
|
|
1145
|
-
return composer.te(key, locale);
|
|
1146
|
-
},
|
|
1147
|
-
// tm
|
|
1148
|
-
tm(key) {
|
|
1149
|
-
return composer.tm(key);
|
|
1150
|
-
},
|
|
1151
|
-
// getLocaleMessage
|
|
1152
|
-
getLocaleMessage(locale) {
|
|
1153
|
-
return composer.getLocaleMessage(locale);
|
|
1154
|
-
},
|
|
1155
|
-
// setLocaleMessage
|
|
1156
|
-
setLocaleMessage(locale, message) {
|
|
1157
|
-
composer.setLocaleMessage(locale, message);
|
|
1158
|
-
},
|
|
1159
|
-
// mergeLocaleMessage
|
|
1160
|
-
mergeLocaleMessage(locale, message) {
|
|
1161
|
-
composer.mergeLocaleMessage(locale, message);
|
|
1162
|
-
},
|
|
1163
|
-
// d
|
|
1164
|
-
d(...args) {
|
|
1165
|
-
return Reflect.apply(composer.d, composer, [...args]);
|
|
1166
|
-
},
|
|
1167
|
-
// getDateTimeFormat
|
|
1168
|
-
getDateTimeFormat(locale) {
|
|
1169
|
-
return composer.getDateTimeFormat(locale);
|
|
1170
|
-
},
|
|
1171
|
-
// setDateTimeFormat
|
|
1172
|
-
setDateTimeFormat(locale, format2) {
|
|
1173
|
-
composer.setDateTimeFormat(locale, format2);
|
|
1174
|
-
},
|
|
1175
|
-
// mergeDateTimeFormat
|
|
1176
|
-
mergeDateTimeFormat(locale, format2) {
|
|
1177
|
-
composer.mergeDateTimeFormat(locale, format2);
|
|
1178
|
-
},
|
|
1179
|
-
// n
|
|
1180
|
-
n(...args) {
|
|
1181
|
-
return Reflect.apply(composer.n, composer, [...args]);
|
|
1182
|
-
},
|
|
1183
|
-
// getNumberFormat
|
|
1184
|
-
getNumberFormat(locale) {
|
|
1185
|
-
return composer.getNumberFormat(locale);
|
|
1186
|
-
},
|
|
1187
|
-
// setNumberFormat
|
|
1188
|
-
setNumberFormat(locale, format2) {
|
|
1189
|
-
composer.setNumberFormat(locale, format2);
|
|
1190
|
-
},
|
|
1191
|
-
// mergeNumberFormat
|
|
1192
|
-
mergeNumberFormat(locale, format2) {
|
|
1193
|
-
composer.mergeNumberFormat(locale, format2);
|
|
1194
|
-
}
|
|
1195
|
-
};
|
|
1196
|
-
vueI18n.__extender = __extender;
|
|
1197
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1198
|
-
vueI18n.__enableEmitter = (emitter) => {
|
|
1199
|
-
const __composer = composer;
|
|
1200
|
-
__composer[EnableEmitter] && __composer[EnableEmitter](emitter);
|
|
1201
|
-
};
|
|
1202
|
-
vueI18n.__disableEmitter = () => {
|
|
1203
|
-
const __composer = composer;
|
|
1204
|
-
__composer[DisableEmitter] && __composer[DisableEmitter]();
|
|
1205
|
-
};
|
|
1206
|
-
}
|
|
1207
|
-
return vueI18n;
|
|
1208
|
-
}
|
|
1209
|
-
function defineMixin(vuei18n, composer, i18n) {
|
|
1210
|
-
return {
|
|
1211
|
-
beforeCreate() {
|
|
1212
|
-
const instance = getCurrentInstance();
|
|
1213
|
-
if (!instance) {
|
|
1214
|
-
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1215
|
-
}
|
|
1216
|
-
const options = this.$options;
|
|
1217
|
-
if (options.i18n) {
|
|
1218
|
-
const optionsI18n = options.i18n;
|
|
1219
|
-
if (options.__i18n) {
|
|
1220
|
-
optionsI18n.__i18n = options.__i18n;
|
|
1221
|
-
}
|
|
1222
|
-
optionsI18n.__root = composer;
|
|
1223
|
-
if (this === this.$root) {
|
|
1224
|
-
this.$i18n = mergeToGlobal(vuei18n, optionsI18n);
|
|
1225
|
-
} else {
|
|
1226
|
-
optionsI18n.__injectWithOption = true;
|
|
1227
|
-
optionsI18n.__extender = i18n.__vueI18nExtend;
|
|
1228
|
-
this.$i18n = createVueI18n(optionsI18n);
|
|
1229
|
-
const _vueI18n = this.$i18n;
|
|
1230
|
-
if (_vueI18n.__extender) {
|
|
1231
|
-
_vueI18n.__disposer = _vueI18n.__extender(this.$i18n);
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
} else if (options.__i18n) {
|
|
1235
|
-
if (this === this.$root) {
|
|
1236
|
-
this.$i18n = mergeToGlobal(vuei18n, options);
|
|
1237
|
-
} else {
|
|
1238
|
-
this.$i18n = createVueI18n({
|
|
1239
|
-
__i18n: options.__i18n,
|
|
1240
|
-
__injectWithOption: true,
|
|
1241
|
-
__extender: i18n.__vueI18nExtend,
|
|
1242
|
-
__root: composer
|
|
1243
|
-
});
|
|
1244
|
-
const _vueI18n = this.$i18n;
|
|
1245
|
-
if (_vueI18n.__extender) {
|
|
1246
|
-
_vueI18n.__disposer = _vueI18n.__extender(this.$i18n);
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
} else {
|
|
1250
|
-
this.$i18n = vuei18n;
|
|
1251
|
-
}
|
|
1252
|
-
if (options.__i18nGlobal) {
|
|
1253
|
-
adjustI18nResources(composer, options, options);
|
|
1254
|
-
}
|
|
1255
|
-
this.$t = (...args) => this.$i18n.t(...args);
|
|
1256
|
-
this.$rt = (...args) => this.$i18n.rt(...args);
|
|
1257
|
-
this.$te = (key, locale) => this.$i18n.te(key, locale);
|
|
1258
|
-
this.$d = (...args) => this.$i18n.d(...args);
|
|
1259
|
-
this.$n = (...args) => this.$i18n.n(...args);
|
|
1260
|
-
this.$tm = (key) => this.$i18n.tm(key);
|
|
1261
|
-
i18n.__setInstance(instance, this.$i18n);
|
|
1262
|
-
},
|
|
1263
|
-
mounted() {
|
|
1264
|
-
if ((process.env.NODE_ENV !== "production" || false) && true && this.$el && this.$i18n) {
|
|
1265
|
-
const _vueI18n = this.$i18n;
|
|
1266
|
-
this.$el.__VUE_I18N__ = _vueI18n.__composer;
|
|
1267
|
-
const emitter = this.__v_emitter = createEmitter();
|
|
1268
|
-
_vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
|
|
1269
|
-
emitter.on("*", addTimelineEvent);
|
|
1270
|
-
}
|
|
1271
|
-
},
|
|
1272
|
-
unmounted() {
|
|
1273
|
-
const instance = getCurrentInstance();
|
|
1274
|
-
if (!instance) {
|
|
1275
|
-
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1276
|
-
}
|
|
1277
|
-
const _vueI18n = this.$i18n;
|
|
1278
|
-
if ((process.env.NODE_ENV !== "production" || false) && true && this.$el && this.$el.__VUE_I18N__) {
|
|
1279
|
-
if (this.__v_emitter) {
|
|
1280
|
-
this.__v_emitter.off("*", addTimelineEvent);
|
|
1281
|
-
delete this.__v_emitter;
|
|
1282
|
-
}
|
|
1283
|
-
if (this.$i18n) {
|
|
1284
|
-
_vueI18n.__disableEmitter && _vueI18n.__disableEmitter();
|
|
1285
|
-
delete this.$el.__VUE_I18N__;
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
delete this.$t;
|
|
1289
|
-
delete this.$rt;
|
|
1290
|
-
delete this.$te;
|
|
1291
|
-
delete this.$d;
|
|
1292
|
-
delete this.$n;
|
|
1293
|
-
delete this.$tm;
|
|
1294
|
-
if (_vueI18n.__disposer) {
|
|
1295
|
-
_vueI18n.__disposer();
|
|
1296
|
-
delete _vueI18n.__disposer;
|
|
1297
|
-
delete _vueI18n.__extender;
|
|
1298
|
-
}
|
|
1299
|
-
i18n.__deleteInstance(instance);
|
|
1300
|
-
delete this.$i18n;
|
|
1301
|
-
}
|
|
1302
|
-
};
|
|
1303
|
-
}
|
|
1304
|
-
function mergeToGlobal(g, options) {
|
|
1305
|
-
g.locale = options.locale || g.locale;
|
|
1306
|
-
g.fallbackLocale = options.fallbackLocale || g.fallbackLocale;
|
|
1307
|
-
g.missing = options.missing || g.missing;
|
|
1308
|
-
g.silentTranslationWarn = options.silentTranslationWarn || g.silentFallbackWarn;
|
|
1309
|
-
g.silentFallbackWarn = options.silentFallbackWarn || g.silentFallbackWarn;
|
|
1310
|
-
g.formatFallbackMessages = options.formatFallbackMessages || g.formatFallbackMessages;
|
|
1311
|
-
g.postTranslation = options.postTranslation || g.postTranslation;
|
|
1312
|
-
g.warnHtmlInMessage = options.warnHtmlInMessage || g.warnHtmlInMessage;
|
|
1313
|
-
g.escapeParameterHtml = options.escapeParameterHtml || g.escapeParameterHtml;
|
|
1314
|
-
g.sync = options.sync || g.sync;
|
|
1315
|
-
g.__composer[SetPluralRulesSymbol](options.pluralizationRules || g.pluralizationRules);
|
|
1316
|
-
const messages = getLocaleMessages(g.locale, {
|
|
1317
|
-
messages: options.messages,
|
|
1318
|
-
__i18n: options.__i18n
|
|
1319
|
-
});
|
|
1320
|
-
Object.keys(messages).forEach((locale) => g.mergeLocaleMessage(locale, messages[locale]));
|
|
1321
|
-
if (options.datetimeFormats) {
|
|
1322
|
-
Object.keys(options.datetimeFormats).forEach((locale) => g.mergeDateTimeFormat(locale, options.datetimeFormats[locale]));
|
|
1323
|
-
}
|
|
1324
|
-
if (options.numberFormats) {
|
|
1325
|
-
Object.keys(options.numberFormats).forEach((locale) => g.mergeNumberFormat(locale, options.numberFormats[locale]));
|
|
1326
|
-
}
|
|
1327
|
-
return g;
|
|
1328
|
-
}
|
|
1329
|
-
const baseFormatProps = {
|
|
1330
|
-
tag: {
|
|
1331
|
-
type: [String, Object]
|
|
1332
|
-
},
|
|
1333
|
-
locale: {
|
|
1334
|
-
type: String
|
|
1335
|
-
},
|
|
1336
|
-
scope: {
|
|
1337
|
-
type: String,
|
|
1338
|
-
// NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
|
|
1339
|
-
validator: (val) => val === "parent" || val === "global",
|
|
1340
|
-
default: "parent"
|
|
1341
|
-
/* ComponentI18nScope */
|
|
1342
|
-
},
|
|
1343
|
-
i18n: {
|
|
1344
|
-
type: Object
|
|
1345
|
-
}
|
|
1346
|
-
};
|
|
1347
|
-
function getInterpolateArg({ slots }, keys) {
|
|
1348
|
-
if (keys.length === 1 && keys[0] === "default") {
|
|
1349
|
-
const ret = slots.default ? slots.default() : [];
|
|
1350
|
-
return ret.reduce((slot, current) => {
|
|
1351
|
-
return [
|
|
1352
|
-
...slot,
|
|
1353
|
-
// prettier-ignore
|
|
1354
|
-
...current.type === Fragment ? current.children : [current]
|
|
1355
|
-
];
|
|
1356
|
-
}, []);
|
|
1357
|
-
} else {
|
|
1358
|
-
return keys.reduce((arg, key) => {
|
|
1359
|
-
const slot = slots[key];
|
|
1360
|
-
if (slot) {
|
|
1361
|
-
arg[key] = slot();
|
|
1362
|
-
}
|
|
1363
|
-
return arg;
|
|
1364
|
-
}, create());
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
function getFragmentableTag() {
|
|
1368
|
-
return Fragment;
|
|
1369
|
-
}
|
|
1370
|
-
const TranslationImpl = /* @__PURE__ */ defineComponent({
|
|
1371
|
-
/* eslint-disable */
|
|
1372
|
-
name: "i18n-t",
|
|
1373
|
-
props: assign({
|
|
1374
|
-
keypath: {
|
|
1375
|
-
type: String,
|
|
1376
|
-
required: true
|
|
1377
|
-
},
|
|
1378
|
-
plural: {
|
|
1379
|
-
type: [Number, String],
|
|
1380
|
-
validator: (val) => isNumber(val) || !isNaN(val)
|
|
1381
|
-
}
|
|
1382
|
-
}, baseFormatProps),
|
|
1383
|
-
/* eslint-enable */
|
|
1384
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1385
|
-
setup(props, context) {
|
|
1386
|
-
const { slots, attrs } = context;
|
|
1387
|
-
const i18n = props.i18n || useI18n({
|
|
1388
|
-
useScope: props.scope,
|
|
1389
|
-
__useComponent: true
|
|
1390
|
-
});
|
|
1391
|
-
return () => {
|
|
1392
|
-
const keys = Object.keys(slots).filter((key) => key[0] !== "_");
|
|
1393
|
-
const options = create();
|
|
1394
|
-
if (props.locale) {
|
|
1395
|
-
options.locale = props.locale;
|
|
1396
|
-
}
|
|
1397
|
-
if (props.plural !== void 0) {
|
|
1398
|
-
options.plural = isString(props.plural) ? +props.plural : props.plural;
|
|
1399
|
-
}
|
|
1400
|
-
const arg = getInterpolateArg(context, keys);
|
|
1401
|
-
const children = i18n[TranslateVNodeSymbol](props.keypath, arg, options);
|
|
1402
|
-
const assignedAttrs = assign(create(), attrs);
|
|
1403
|
-
const tag = isString(props.tag) || isObject(props.tag) ? props.tag : getFragmentableTag();
|
|
1404
|
-
return h(tag, assignedAttrs, children);
|
|
1405
|
-
};
|
|
1406
|
-
}
|
|
1407
|
-
});
|
|
1408
|
-
const Translation = TranslationImpl;
|
|
1409
|
-
const I18nT = Translation;
|
|
1410
|
-
function isVNode(target) {
|
|
1411
|
-
return isArray(target) && !isString(target[0]);
|
|
1412
|
-
}
|
|
1413
|
-
function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
1414
|
-
const { slots, attrs } = context;
|
|
1415
|
-
return () => {
|
|
1416
|
-
const options = { part: true };
|
|
1417
|
-
let overrides = create();
|
|
1418
|
-
if (props.locale) {
|
|
1419
|
-
options.locale = props.locale;
|
|
1420
|
-
}
|
|
1421
|
-
if (isString(props.format)) {
|
|
1422
|
-
options.key = props.format;
|
|
1423
|
-
} else if (isObject(props.format)) {
|
|
1424
|
-
if (isString(props.format.key)) {
|
|
1425
|
-
options.key = props.format.key;
|
|
1426
|
-
}
|
|
1427
|
-
overrides = Object.keys(props.format).reduce((options2, prop) => {
|
|
1428
|
-
return slotKeys.includes(prop) ? assign(create(), options2, { [prop]: props.format[prop] }) : options2;
|
|
1429
|
-
}, create());
|
|
1430
|
-
}
|
|
1431
|
-
const parts = partFormatter(...[props.value, options, overrides]);
|
|
1432
|
-
let children = [options.key];
|
|
1433
|
-
if (isArray(parts)) {
|
|
1434
|
-
children = parts.map((part, index) => {
|
|
1435
|
-
const slot = slots[part.type];
|
|
1436
|
-
const node = slot ? slot({ [part.type]: part.value, index, parts }) : [part.value];
|
|
1437
|
-
if (isVNode(node)) {
|
|
1438
|
-
node[0].key = `${part.type}-${index}`;
|
|
1439
|
-
}
|
|
1440
|
-
return node;
|
|
1441
|
-
});
|
|
1442
|
-
} else if (isString(parts)) {
|
|
1443
|
-
children = [parts];
|
|
1444
|
-
}
|
|
1445
|
-
const assignedAttrs = assign(create(), attrs);
|
|
1446
|
-
const tag = isString(props.tag) || isObject(props.tag) ? props.tag : getFragmentableTag();
|
|
1447
|
-
return h(tag, assignedAttrs, children);
|
|
1448
|
-
};
|
|
1449
|
-
}
|
|
1450
|
-
const NumberFormatImpl = /* @__PURE__ */ defineComponent({
|
|
1451
|
-
/* eslint-disable */
|
|
1452
|
-
name: "i18n-n",
|
|
1453
|
-
props: assign({
|
|
1454
|
-
value: {
|
|
1455
|
-
type: Number,
|
|
1456
|
-
required: true
|
|
1457
|
-
},
|
|
1458
|
-
format: {
|
|
1459
|
-
type: [String, Object]
|
|
1460
|
-
}
|
|
1461
|
-
}, baseFormatProps),
|
|
1462
|
-
/* eslint-enable */
|
|
1463
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1464
|
-
setup(props, context) {
|
|
1465
|
-
const i18n = props.i18n || useI18n({
|
|
1466
|
-
useScope: props.scope,
|
|
1467
|
-
__useComponent: true
|
|
1468
|
-
});
|
|
1469
|
-
return renderFormatter(props, context, NUMBER_FORMAT_OPTIONS_KEYS, (...args) => (
|
|
1470
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1471
|
-
i18n[NumberPartsSymbol](...args)
|
|
1472
|
-
));
|
|
1473
|
-
}
|
|
1474
|
-
});
|
|
1475
|
-
const NumberFormat = NumberFormatImpl;
|
|
1476
|
-
const I18nN = NumberFormat;
|
|
1477
|
-
function getComposer$1(i18n, instance) {
|
|
1478
|
-
const i18nInternal = i18n;
|
|
1479
|
-
if (i18n.mode === "composition") {
|
|
1480
|
-
return i18nInternal.__getInstance(instance) || i18n.global;
|
|
1481
|
-
} else {
|
|
1482
|
-
const vueI18n = i18nInternal.__getInstance(instance);
|
|
1483
|
-
return vueI18n != null ? vueI18n.__composer : i18n.global.__composer;
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
function vTDirective(i18n) {
|
|
1487
|
-
const _process = (binding) => {
|
|
1488
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1489
|
-
warnOnce(getWarnMessage(I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));
|
|
1490
|
-
}
|
|
1491
|
-
const { instance, value } = binding;
|
|
1492
|
-
if (!instance || !instance.$) {
|
|
1493
|
-
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1494
|
-
}
|
|
1495
|
-
const composer = getComposer$1(i18n, instance.$);
|
|
1496
|
-
const parsedValue = parseValue(value);
|
|
1497
|
-
return [
|
|
1498
|
-
Reflect.apply(composer.t, composer, [...makeParams(parsedValue)]),
|
|
1499
|
-
composer
|
|
1500
|
-
];
|
|
1501
|
-
};
|
|
1502
|
-
const register = (el, binding) => {
|
|
1503
|
-
const [textContent, composer] = _process(binding);
|
|
1504
|
-
if (inBrowser && i18n.global === composer) {
|
|
1505
|
-
el.__i18nWatcher = watch(composer.locale, () => {
|
|
1506
|
-
binding.instance && binding.instance.$forceUpdate();
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
el.__composer = composer;
|
|
1510
|
-
el.textContent = textContent;
|
|
1511
|
-
};
|
|
1512
|
-
const unregister = (el) => {
|
|
1513
|
-
if (inBrowser && el.__i18nWatcher) {
|
|
1514
|
-
el.__i18nWatcher();
|
|
1515
|
-
el.__i18nWatcher = void 0;
|
|
1516
|
-
delete el.__i18nWatcher;
|
|
1517
|
-
}
|
|
1518
|
-
if (el.__composer) {
|
|
1519
|
-
el.__composer = void 0;
|
|
1520
|
-
delete el.__composer;
|
|
1521
|
-
}
|
|
1522
|
-
};
|
|
1523
|
-
const update = (el, { value }) => {
|
|
1524
|
-
if (el.__composer) {
|
|
1525
|
-
const composer = el.__composer;
|
|
1526
|
-
const parsedValue = parseValue(value);
|
|
1527
|
-
el.textContent = Reflect.apply(composer.t, composer, [
|
|
1528
|
-
...makeParams(parsedValue)
|
|
1529
|
-
]);
|
|
1530
|
-
}
|
|
1531
|
-
};
|
|
1532
|
-
const getSSRProps = (binding) => {
|
|
1533
|
-
const [textContent] = _process(binding);
|
|
1534
|
-
return { textContent };
|
|
1535
|
-
};
|
|
1536
|
-
return {
|
|
1537
|
-
created: register,
|
|
1538
|
-
unmounted: unregister,
|
|
1539
|
-
beforeUpdate: update,
|
|
1540
|
-
getSSRProps
|
|
1541
|
-
};
|
|
1542
|
-
}
|
|
1543
|
-
function parseValue(value) {
|
|
1544
|
-
if (isString(value)) {
|
|
1545
|
-
return { path: value };
|
|
1546
|
-
} else if (isPlainObject(value)) {
|
|
1547
|
-
if (!("path" in value)) {
|
|
1548
|
-
throw createI18nError(I18nErrorCodes.REQUIRED_VALUE, "path");
|
|
1549
|
-
}
|
|
1550
|
-
return value;
|
|
1551
|
-
} else {
|
|
1552
|
-
throw createI18nError(I18nErrorCodes.INVALID_VALUE);
|
|
1553
|
-
}
|
|
1554
|
-
}
|
|
1555
|
-
function makeParams(value) {
|
|
1556
|
-
const { path, locale, args, choice, plural } = value;
|
|
1557
|
-
const options = {};
|
|
1558
|
-
const named = args || {};
|
|
1559
|
-
if (isString(locale)) {
|
|
1560
|
-
options.locale = locale;
|
|
1561
|
-
}
|
|
1562
|
-
if (isNumber(choice)) {
|
|
1563
|
-
options.plural = choice;
|
|
1564
|
-
}
|
|
1565
|
-
if (isNumber(plural)) {
|
|
1566
|
-
options.plural = plural;
|
|
1567
|
-
}
|
|
1568
|
-
return [path, named, options];
|
|
1569
|
-
}
|
|
1570
|
-
function apply(app, i18n, ...options) {
|
|
1571
|
-
const pluginOptions = isPlainObject(options[0]) ? options[0] : {};
|
|
1572
|
-
const globalInstall = isBoolean(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
|
|
1573
|
-
if (globalInstall) {
|
|
1574
|
-
[Translation.name, "I18nT"].forEach((name) => app.component(name, Translation));
|
|
1575
|
-
[NumberFormat.name, "I18nN"].forEach((name) => app.component(name, NumberFormat));
|
|
1576
|
-
[DatetimeFormat.name, "I18nD"].forEach((name) => app.component(name, DatetimeFormat));
|
|
1577
|
-
}
|
|
1578
|
-
{
|
|
1579
|
-
app.directive("t", vTDirective(i18n));
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
const I18nInjectionKey = /* @__PURE__ */ makeSymbol("global-vue-i18n");
|
|
1583
|
-
function createI18n(options = {}) {
|
|
1584
|
-
const __legacyMode = __VUE_I18N_LEGACY_API__ && isBoolean(options.legacy) ? options.legacy : __VUE_I18N_LEGACY_API__;
|
|
1585
|
-
if (process.env.NODE_ENV !== "production" && __legacyMode) {
|
|
1586
|
-
warnOnce(getWarnMessage(I18nWarnCodes.DEPRECATE_LEGACY_MODE));
|
|
1587
|
-
}
|
|
1588
|
-
const __globalInjection = isBoolean(options.globalInjection) ? options.globalInjection : true;
|
|
1589
|
-
const __instances = /* @__PURE__ */ new Map();
|
|
1590
|
-
const [globalScope, __global] = createGlobal(options, __legacyMode);
|
|
1591
|
-
const symbol = /* @__PURE__ */ makeSymbol(process.env.NODE_ENV !== "production" ? "vue-i18n" : "");
|
|
1592
|
-
function __getInstance(component) {
|
|
1593
|
-
return __instances.get(component) || null;
|
|
1594
|
-
}
|
|
1595
|
-
function __setInstance(component, instance) {
|
|
1596
|
-
__instances.set(component, instance);
|
|
1597
|
-
}
|
|
1598
|
-
function __deleteInstance(component) {
|
|
1599
|
-
__instances.delete(component);
|
|
1600
|
-
}
|
|
1601
|
-
const i18n = {
|
|
1602
|
-
// mode
|
|
1603
|
-
get mode() {
|
|
1604
|
-
return __VUE_I18N_LEGACY_API__ && __legacyMode ? "legacy" : "composition";
|
|
1605
|
-
},
|
|
1606
|
-
// install plugin
|
|
1607
|
-
async install(app, ...options2) {
|
|
1608
|
-
if ((process.env.NODE_ENV !== "production" || false) && true) {
|
|
1609
|
-
app.__VUE_I18N__ = i18n;
|
|
1610
|
-
}
|
|
1611
|
-
app.__VUE_I18N_SYMBOL__ = symbol;
|
|
1612
|
-
app.provide(app.__VUE_I18N_SYMBOL__, i18n);
|
|
1613
|
-
if (isPlainObject(options2[0])) {
|
|
1614
|
-
const opts = options2[0];
|
|
1615
|
-
i18n.__composerExtend = opts.__composerExtend;
|
|
1616
|
-
i18n.__vueI18nExtend = opts.__vueI18nExtend;
|
|
1617
|
-
}
|
|
1618
|
-
let globalReleaseHandler = null;
|
|
1619
|
-
if (!__legacyMode && __globalInjection) {
|
|
1620
|
-
globalReleaseHandler = injectGlobalFields(app, i18n.global);
|
|
1621
|
-
}
|
|
1622
|
-
if (__VUE_I18N_FULL_INSTALL__) {
|
|
1623
|
-
apply(app, i18n, ...options2);
|
|
1624
|
-
}
|
|
1625
|
-
if (__VUE_I18N_LEGACY_API__ && __legacyMode) {
|
|
1626
|
-
app.mixin(defineMixin(__global, __global.__composer, i18n));
|
|
1627
|
-
}
|
|
1628
|
-
const unmountApp = app.unmount;
|
|
1629
|
-
app.unmount = () => {
|
|
1630
|
-
globalReleaseHandler && globalReleaseHandler();
|
|
1631
|
-
i18n.dispose();
|
|
1632
|
-
unmountApp();
|
|
1633
|
-
};
|
|
1634
|
-
if ((process.env.NODE_ENV !== "production" || false) && true) {
|
|
1635
|
-
const ret = await enableDevTools(app, i18n);
|
|
1636
|
-
if (!ret) {
|
|
1637
|
-
throw createI18nError(I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
|
|
1638
|
-
}
|
|
1639
|
-
const emitter = createEmitter();
|
|
1640
|
-
if (__legacyMode) {
|
|
1641
|
-
const _vueI18n = __global;
|
|
1642
|
-
_vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
|
|
1643
|
-
} else {
|
|
1644
|
-
const _composer = __global;
|
|
1645
|
-
_composer[EnableEmitter] && _composer[EnableEmitter](emitter);
|
|
1646
|
-
}
|
|
1647
|
-
emitter.on("*", addTimelineEvent);
|
|
1648
|
-
}
|
|
1649
|
-
},
|
|
1650
|
-
// global accessor
|
|
1651
|
-
get global() {
|
|
1652
|
-
return __global;
|
|
1653
|
-
},
|
|
1654
|
-
dispose() {
|
|
1655
|
-
globalScope.stop();
|
|
1656
|
-
},
|
|
1657
|
-
// @internal
|
|
1658
|
-
__instances,
|
|
1659
|
-
// @internal
|
|
1660
|
-
__getInstance,
|
|
1661
|
-
// @internal
|
|
1662
|
-
__setInstance,
|
|
1663
|
-
// @internal
|
|
1664
|
-
__deleteInstance
|
|
1665
|
-
};
|
|
1666
|
-
return i18n;
|
|
1667
|
-
}
|
|
1668
|
-
function useI18n(options = {}) {
|
|
1669
|
-
const instance = getCurrentInstance();
|
|
1670
|
-
if (instance == null) {
|
|
1671
|
-
throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP);
|
|
1672
|
-
}
|
|
1673
|
-
if (!instance.isCE && instance.appContext.app != null && !instance.appContext.app.__VUE_I18N_SYMBOL__) {
|
|
1674
|
-
throw createI18nError(I18nErrorCodes.NOT_INSTALLED);
|
|
1675
|
-
}
|
|
1676
|
-
const i18n = getI18nInstance(instance);
|
|
1677
|
-
const gl = getGlobalComposer(i18n);
|
|
1678
|
-
const componentOptions = getComponentOptions(instance);
|
|
1679
|
-
const scope = getScope(options, componentOptions);
|
|
1680
|
-
if (scope === "global") {
|
|
1681
|
-
adjustI18nResources(gl, options, componentOptions);
|
|
1682
|
-
return gl;
|
|
1683
|
-
}
|
|
1684
|
-
if (scope === "parent") {
|
|
1685
|
-
let composer2 = getComposer(i18n, instance, options.__useComponent);
|
|
1686
|
-
if (composer2 == null) {
|
|
1687
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1688
|
-
warn(getWarnMessage(I18nWarnCodes.NOT_FOUND_PARENT_SCOPE));
|
|
1689
|
-
}
|
|
1690
|
-
composer2 = gl;
|
|
1691
|
-
}
|
|
1692
|
-
return composer2;
|
|
1693
|
-
}
|
|
1694
|
-
const i18nInternal = i18n;
|
|
1695
|
-
let composer = i18nInternal.__getInstance(instance);
|
|
1696
|
-
if (composer == null) {
|
|
1697
|
-
const composerOptions = assign({}, options);
|
|
1698
|
-
if ("__i18n" in componentOptions) {
|
|
1699
|
-
composerOptions.__i18n = componentOptions.__i18n;
|
|
1700
|
-
}
|
|
1701
|
-
if (gl) {
|
|
1702
|
-
composerOptions.__root = gl;
|
|
1703
|
-
}
|
|
1704
|
-
composer = createComposer(composerOptions);
|
|
1705
|
-
if (i18nInternal.__composerExtend) {
|
|
1706
|
-
composer[DisposeSymbol] = i18nInternal.__composerExtend(composer);
|
|
1707
|
-
}
|
|
1708
|
-
setupLifeCycle(i18nInternal, instance, composer);
|
|
1709
|
-
i18nInternal.__setInstance(instance, composer);
|
|
1710
|
-
} else {
|
|
1711
|
-
if (process.env.NODE_ENV !== "production" && scope === "local") {
|
|
1712
|
-
throw createI18nError(I18nErrorCodes.DUPLICATE_USE_I18N_CALLING);
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
return composer;
|
|
1716
|
-
}
|
|
1717
|
-
function createGlobal(options, legacyMode) {
|
|
1718
|
-
const scope = effectScope();
|
|
1719
|
-
const obj = __VUE_I18N_LEGACY_API__ && legacyMode ? scope.run(() => createVueI18n(options)) : scope.run(() => createComposer(options));
|
|
1720
|
-
if (obj == null) {
|
|
1721
|
-
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1722
|
-
}
|
|
1723
|
-
return [scope, obj];
|
|
1724
|
-
}
|
|
1725
|
-
function getI18nInstance(instance) {
|
|
1726
|
-
const i18n = inject(!instance.isCE ? instance.appContext.app.__VUE_I18N_SYMBOL__ : I18nInjectionKey);
|
|
1727
|
-
if (!i18n) {
|
|
1728
|
-
throw createI18nError(!instance.isCE ? I18nErrorCodes.UNEXPECTED_ERROR : I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE);
|
|
1729
|
-
}
|
|
1730
|
-
return i18n;
|
|
1731
|
-
}
|
|
1732
|
-
function getScope(options, componentOptions) {
|
|
1733
|
-
return isEmptyObject(options) ? "__i18n" in componentOptions ? "local" : "global" : !options.useScope ? "local" : options.useScope;
|
|
1734
|
-
}
|
|
1735
|
-
function getGlobalComposer(i18n) {
|
|
1736
|
-
return i18n.mode === "composition" ? i18n.global : i18n.global.__composer;
|
|
1737
|
-
}
|
|
1738
|
-
function getComposer(i18n, target, useComponent = false) {
|
|
1739
|
-
let composer = null;
|
|
1740
|
-
const root = target.root;
|
|
1741
|
-
let current = getParentComponentInstance(target, useComponent);
|
|
1742
|
-
while (current != null) {
|
|
1743
|
-
const i18nInternal = i18n;
|
|
1744
|
-
if (i18n.mode === "composition") {
|
|
1745
|
-
composer = i18nInternal.__getInstance(current);
|
|
1746
|
-
} else {
|
|
1747
|
-
if (__VUE_I18N_LEGACY_API__) {
|
|
1748
|
-
const vueI18n = i18nInternal.__getInstance(current);
|
|
1749
|
-
if (vueI18n != null) {
|
|
1750
|
-
composer = vueI18n.__composer;
|
|
1751
|
-
if (useComponent && composer && !composer[InejctWithOptionSymbol]) {
|
|
1752
|
-
composer = null;
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
if (composer != null) {
|
|
1758
|
-
break;
|
|
1759
|
-
}
|
|
1760
|
-
if (root === current) {
|
|
1761
|
-
break;
|
|
1762
|
-
}
|
|
1763
|
-
current = current.parent;
|
|
1764
|
-
}
|
|
1765
|
-
return composer;
|
|
1766
|
-
}
|
|
1767
|
-
function getParentComponentInstance(target, useComponent = false) {
|
|
1768
|
-
if (target == null) {
|
|
1769
|
-
return null;
|
|
1770
|
-
}
|
|
1771
|
-
return !useComponent ? target.parent : target.vnode.ctx || target.parent;
|
|
1772
|
-
}
|
|
1773
|
-
function setupLifeCycle(i18n, target, composer) {
|
|
1774
|
-
let emitter = null;
|
|
1775
|
-
onMounted(() => {
|
|
1776
|
-
if ((process.env.NODE_ENV !== "production" || false) && true && target.vnode.el) {
|
|
1777
|
-
target.vnode.el.__VUE_I18N__ = composer;
|
|
1778
|
-
emitter = createEmitter();
|
|
1779
|
-
const _composer = composer;
|
|
1780
|
-
_composer[EnableEmitter] && _composer[EnableEmitter](emitter);
|
|
1781
|
-
emitter.on("*", addTimelineEvent);
|
|
1782
|
-
}
|
|
1783
|
-
}, target);
|
|
1784
|
-
onUnmounted(() => {
|
|
1785
|
-
const _composer = composer;
|
|
1786
|
-
if ((process.env.NODE_ENV !== "production" || false) && true && target.vnode.el && target.vnode.el.__VUE_I18N__) {
|
|
1787
|
-
emitter && emitter.off("*", addTimelineEvent);
|
|
1788
|
-
_composer[DisableEmitter] && _composer[DisableEmitter]();
|
|
1789
|
-
delete target.vnode.el.__VUE_I18N__;
|
|
1790
|
-
}
|
|
1791
|
-
i18n.__deleteInstance(target);
|
|
1792
|
-
const dispose = _composer[DisposeSymbol];
|
|
1793
|
-
if (dispose) {
|
|
1794
|
-
dispose();
|
|
1795
|
-
delete _composer[DisposeSymbol];
|
|
1796
|
-
}
|
|
1797
|
-
}, target);
|
|
1798
|
-
}
|
|
1799
|
-
const globalExportProps = [
|
|
1800
|
-
"locale",
|
|
1801
|
-
"fallbackLocale",
|
|
1802
|
-
"availableLocales"
|
|
1803
|
-
];
|
|
1804
|
-
const globalExportMethods = ["t", "rt", "d", "n", "tm", "te"];
|
|
1805
|
-
function injectGlobalFields(app, composer) {
|
|
1806
|
-
const i18n = /* @__PURE__ */ Object.create(null);
|
|
1807
|
-
globalExportProps.forEach((prop) => {
|
|
1808
|
-
const desc = Object.getOwnPropertyDescriptor(composer, prop);
|
|
1809
|
-
if (!desc) {
|
|
1810
|
-
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1811
|
-
}
|
|
1812
|
-
const wrap = isRef(desc.value) ? {
|
|
1813
|
-
get() {
|
|
1814
|
-
return desc.value.value;
|
|
1815
|
-
},
|
|
1816
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1817
|
-
set(val) {
|
|
1818
|
-
desc.value.value = val;
|
|
1819
|
-
}
|
|
1820
|
-
} : {
|
|
1821
|
-
get() {
|
|
1822
|
-
return desc.get && desc.get();
|
|
1823
|
-
}
|
|
1824
|
-
};
|
|
1825
|
-
Object.defineProperty(i18n, prop, wrap);
|
|
1826
|
-
});
|
|
1827
|
-
app.config.globalProperties.$i18n = i18n;
|
|
1828
|
-
globalExportMethods.forEach((method) => {
|
|
1829
|
-
const desc = Object.getOwnPropertyDescriptor(composer, method);
|
|
1830
|
-
if (!desc || !desc.value) {
|
|
1831
|
-
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1832
|
-
}
|
|
1833
|
-
Object.defineProperty(app.config.globalProperties, `$${method}`, desc);
|
|
1834
|
-
});
|
|
1835
|
-
const dispose = () => {
|
|
1836
|
-
delete app.config.globalProperties.$i18n;
|
|
1837
|
-
globalExportMethods.forEach((method) => {
|
|
1838
|
-
delete app.config.globalProperties[`$${method}`];
|
|
1839
|
-
});
|
|
1840
|
-
};
|
|
1841
|
-
return dispose;
|
|
1842
|
-
}
|
|
1843
|
-
const DatetimeFormatImpl = /* @__PURE__ */ defineComponent({
|
|
1844
|
-
/* eslint-disable */
|
|
1845
|
-
name: "i18n-d",
|
|
1846
|
-
props: assign({
|
|
1847
|
-
value: {
|
|
1848
|
-
type: [Number, Date],
|
|
1849
|
-
required: true
|
|
1850
|
-
},
|
|
1851
|
-
format: {
|
|
1852
|
-
type: [String, Object]
|
|
1853
|
-
}
|
|
1854
|
-
}, baseFormatProps),
|
|
1855
|
-
/* eslint-enable */
|
|
1856
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1857
|
-
setup(props, context) {
|
|
1858
|
-
const i18n = props.i18n || useI18n({
|
|
1859
|
-
useScope: props.scope,
|
|
1860
|
-
__useComponent: true
|
|
1861
|
-
});
|
|
1862
|
-
return renderFormatter(props, context, DATETIME_FORMAT_OPTIONS_KEYS, (...args) => (
|
|
1863
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1864
|
-
i18n[DatetimePartsSymbol](...args)
|
|
1865
|
-
));
|
|
1866
|
-
}
|
|
1867
|
-
});
|
|
1868
|
-
const DatetimeFormat = DatetimeFormatImpl;
|
|
1869
|
-
const I18nD = DatetimeFormat;
|
|
1870
|
-
{
|
|
1871
|
-
initFeatureFlags();
|
|
1872
|
-
}
|
|
1873
|
-
registerMessageCompiler(compile);
|
|
1874
|
-
registerMessageResolver(resolveValue);
|
|
1875
|
-
registerLocaleFallbacker(fallbackWithLocaleChain);
|
|
1876
|
-
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
|
|
1877
|
-
const target = getGlobalThis();
|
|
1878
|
-
target.__INTLIFY__ = true;
|
|
1879
|
-
setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
|
|
1880
|
-
}
|
|
1881
|
-
|
|
1882
|
-
const VueI18n = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
1883
|
-
__proto__: null,
|
|
1884
|
-
DatetimeFormat,
|
|
1885
|
-
I18nD,
|
|
1886
|
-
I18nInjectionKey,
|
|
1887
|
-
I18nN,
|
|
1888
|
-
I18nT,
|
|
1889
|
-
NumberFormat,
|
|
1890
|
-
Translation,
|
|
1891
|
-
VERSION,
|
|
1892
|
-
createI18n,
|
|
1893
|
-
useI18n,
|
|
1894
|
-
vTDirective
|
|
1895
|
-
}, Symbol.toStringTag, { value: 'Module' }));
|
|
1896
|
-
|
|
1897
|
-
export { VueI18n as V, createI18n as c, useI18n as u };
|