{"version":3,"sources":["jsdelivr-header.js","/npm/vue-lang@0.2.5/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,CCNG,WACC,IAAI,EAAU,CAAC,EAwDf,SAAS,EAAO,GAEZ,IADA,IAAI,EAAI,EAAG,UAAU,OACd,KACH,EAAG,UAAU,GAAG,QAAO,GAE3B,IAAI,EAAW,EAAG,UAElB,IADA,EAAI,EAAS,OACN,KAAK,CAER,EADY,EAAS,GAEzB,CACJ,CAlEA,EAAQ,QAAU,SAAU,EAAK,GAG7B,IAAI,EAAU,QAAQ,gBACtB,EAAI,OAAO,UAAW,GAElB,EAAQ,MAAM,QAAQ,KAAK,qEAG/B,EAAI,QAAU,EAAQ,SAAW,CAAC,EAClC,EAAI,UAAU,aAAe,EAAQ,MAAQ,GAG1C,EAAI,UAAU,aACb,EAAI,UAAU,MAAQ,EAAI,QAAQ,EAAI,UAAU,cAEhD,EAAI,UAAU,MAAQ,CAAC,EAI3B,EAAI,UAAU,OAAS,OAAO,KAAK,EAAI,SAGvC,EAAI,UAAU,SAAW,SAAS,GAC9B,EAAI,UAAU,aAAe,EAC1B,GAAY,EAAI,UAAU,OAAO,QAAQ,IAAa,GACrD,EAAI,UAAU,MAAQ,EAAI,QAAQ,GAClC,EAAO,KAAK,QAEZ,QAAQ,KAAK,kDAErB,CACJ,EAEsB,iBAAX,QACP,OAAO,QAAU,EACO,mBAAV,QAAwB,OAAO,IAC7C,OAAO,IAAI,WAAc,OAAO,CAAQ,IACjC,OAAO,MACd,OAAO,QAAU,EACjB,IAAI,IAAI,GA4Bf,CAtEE","file":"/npm/vue-lang@0.2.5/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/vue-lang@0.2.5/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","﻿; (function () {\r\n    var vueLang = {};\r\n    vueLang.install = function (Vue, options) {\r\n\r\n        // register the replace filter (Credits: @Haixing-Hu, https://github.com/Haixing-Hu/vue-format/)\r\n        var replace = require(\"./replace.js\");\r\n        Vue.filter(\"replace\", replace);\r\n\r\n        if(!options.lang){console.warn(\"vue-lang: No default language given. Please specify as {lang: ..}\")}\r\n\r\n        // Set parameters\r\n        Vue.locales = options.locales || {}\r\n        Vue.prototype.$currentLang = options.lang || \"\"\r\n\r\n        // Set current language file\r\n        if(Vue.prototype.$currentLang){\r\n            Vue.prototype.$lang = Vue.locales[Vue.prototype.$currentLang]\r\n        }else{\r\n            Vue.prototype.$lang = {}\r\n        }\r\n\r\n        // Set list of available languages\r\n        Vue.prototype.$langs = Object.keys(Vue.locales)\r\n\r\n        // Create function to set the language\r\n        Vue.prototype.$setLang = function(language) {\r\n            Vue.prototype.$currentLang = language\r\n            if(language && Vue.prototype.$langs.indexOf(language) > -1){\r\n                Vue.prototype.$lang = Vue.locales[language]\r\n                update(this.$root);\r\n            }else{\r\n                console.warn(\"vue-lang: Language not given or not initialized\")\r\n            }\r\n        }\r\n    }\r\n\r\n    if (typeof exports == \"object\") {\r\n        module.exports = vueLang;\r\n    } else if (typeof define == \"function\" && define.amd) {\r\n        define([], function () { return vueLang });\r\n    } else if (window.Vue) {\r\n        window.vueLang = vueLang;\r\n        Vue.use(vueLang);\r\n    }\r\n\r\n    /**\r\n     * Credits: @Haixing-Hu\r\n     *\r\n     * Updates all the watchers in the Vue instance of a component tree.\r\n     *\r\n     * This function is inspired by the \"_digest()\" function in the\r\n     * \"src/instance/scope.js\" of the source of Vue.js, excepts that this function\r\n     * updates the children components no matter whether it is inheritable.\r\n     *\r\n     * @param vm\r\n     *    the root of the component tree.\r\n     */\r\n    function update(vm) {\r\n        var i = vm._watchers.length\r\n        while (i--) {\r\n            vm._watchers[i].update(true); // shallow updates\r\n        }\r\n        var children = vm.$children;\r\n        i = children.length;\r\n        while (i--) {\r\n            var child = children[i]\r\n            update(child)\r\n        }\r\n    }\r\n\r\n})();\r\n"]}