From d0baf34180bddafc4db68aaef1efcc199fd80fc4 Mon Sep 17 00:00:00 2001 From: pimlie Date: Fri, 30 Aug 2019 16:19:52 +0000 Subject: [PATCH] chore(release): 2.2.2 --- CHANGELOG.md | 8 + dist/vue-meta.common.js | 248 ++++++++++++++++--------------- dist/vue-meta.esm.browser.js | 248 ++++++++++++++++--------------- dist/vue-meta.esm.browser.min.js | 2 +- dist/vue-meta.esm.js | 248 ++++++++++++++++--------------- dist/vue-meta.js | 248 ++++++++++++++++--------------- dist/vue-meta.min.js | 2 +- package.json | 2 +- 8 files changed, 523 insertions(+), 483 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bea0552..9f732ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [2.2.2](https://github.com/nuxt/vue-meta/compare/v2.2.1...v2.2.2) (2019-08-30) + + +### Bug Fixes + +* workaround for memoryleak in destroyed hook ([ec7b1fb](https://github.com/nuxt/vue-meta/commit/ec7b1fb)) +* **types:** add "content" property to MetaPropertyEquiv and remove "name" ([#436](https://github.com/nuxt/vue-meta/issues/436)) ([4384f44](https://github.com/nuxt/vue-meta/commit/4384f44)) + ### [2.2.1](https://github.com/nuxt/vue-meta/compare/v2.2.0...v2.2.1) (2019-08-04) diff --git a/dist/vue-meta.common.js b/dist/vue-meta.common.js index 1507e36..c886a72 100644 --- a/dist/vue-meta.common.js +++ b/dist/vue-meta.common.js @@ -1,5 +1,5 @@ /** - * vue-meta v2.2.1 + * vue-meta v2.2.2 * (c) 2019 * - Declan de Wet * - Sébastien Chopin (@Atinux) @@ -13,7 +13,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau var deepmerge = _interopDefault(require('deepmerge')); -var version = "2.2.1"; +var version = "2.2.2"; // store an id to keep track of DOM updates var batchId = null; @@ -240,137 +240,145 @@ function createMixin(Vue, options) { // _vnode is used to know that it's attached to a real component // useful if we use some mixin to add some meta tags (like nuxt-i18n) - if (!isUndefined(this.$options[options.keyName]) && this.$options[options.keyName] !== null) { - if (!this.$root._vueMeta) { - this.$root._vueMeta = { - appId: appId - }; - appId++; - } // to speed up updates we keep track of branches which have a component with vue-meta info defined - // if _vueMeta = true it has info, if _vueMeta = false a child has info + if (isUndefined(this.$options[options.keyName]) || this.$options[options.keyName] === null) { + return; + } + + if (!this.$root._vueMeta) { + this.$root._vueMeta = { + appId: appId + }; + appId++; + } // to speed up updates we keep track of branches which have a component with vue-meta info defined + // if _vueMeta = true it has info, if _vueMeta = false a child has info - if (!this._vueMeta) { - this._vueMeta = true; - var p = this.$parent; + if (!this._vueMeta) { + this._vueMeta = true; + var p = this.$parent; - while (p && p !== this.$root) { - if (isUndefined(p._vueMeta)) { - p._vueMeta = false; - } - - p = p.$parent; - } - } // coerce function-style metaInfo to a computed prop so we can observe - // it on creation - - - if (isFunction(this.$options[options.keyName])) { - if (!this.$options.computed) { - this.$options.computed = {}; + while (p && p !== this.$root) { + if (isUndefined(p._vueMeta)) { + p._vueMeta = false; } - this.$options.computed.$metaInfo = this.$options[options.keyName]; - - if (!this.$isServer) { - // if computed $metaInfo exists, watch it for updates & trigger a refresh - // when it changes (i.e. automatically handle async actions that affect metaInfo) - // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux) - ensuredPush(this.$options, 'created', function () { - _this.$watch('$metaInfo', function () { - triggerUpdate(this, 'watcher'); - }); - }); - } - } // force an initial refresh on page load and prevent other lifecycleHooks - // to triggerUpdate until this initial refresh is finished - // this is to make sure that when a page is opened in an inactive tab which - // has throttled rAF/timers we still immediately set the page title + p = p.$parent; + } + } // coerce function-style metaInfo to a computed prop so we can observe + // it on creation - if (isUndefined(this.$root._vueMeta.initialized)) { - this.$root._vueMeta.initialized = this.$isServer; - - if (!this.$root._vueMeta.initialized) { - ensuredPush(this.$options, 'beforeMount', function () { - // if this Vue-app was server rendered, set the appId to 'ssr' - // only one SSR app per page is supported - if (_this.$root.$el && _this.$root.$el.hasAttribute && _this.$root.$el.hasAttribute('data-server-rendered')) { - _this.$root._vueMeta.appId = options.ssrAppId; - } - }); // we use the mounted hook here as on page load - - ensuredPush(this.$options, 'mounted', function () { - if (!_this.$root._vueMeta.initialized) { - // used in triggerUpdate to check if a change was triggered - // during initialization - _this.$root._vueMeta.initializing = true; // refresh meta in nextTick so all child components have loaded - - _this.$nextTick(function () { - var _this2 = this; - - var _this$$root$$meta$ref = this.$root.$meta().refresh(), - tags = _this$$root$$meta$ref.tags, - metaInfo = _this$$root$$meta$ref.metaInfo; // After ssr hydration (identifier by tags === false) check - // if initialized was set to null in triggerUpdate. That'd mean - // that during initilazation changes where triggered which need - // to be applied OR a metaInfo watcher was triggered before the - // current hook was called - // (during initialization all changes are blocked) - - - if (tags === false && this.$root._vueMeta.initialized === null) { - this.$nextTick(function () { - return triggerUpdate(_this2, 'initializing'); - }); - } - - this.$root._vueMeta.initialized = true; - delete this.$root._vueMeta.initializing; // add the navigation guards if they havent been added yet - // they are needed for the afterNavigation callback - - if (!options.refreshOnceOnNavigation && metaInfo.afterNavigation) { - addNavGuards(this); - } - }); - } - }); // add the navigation guards if requested - - if (options.refreshOnceOnNavigation) { - addNavGuards(this); - } - } - } // do not trigger refresh on the server side + if (isFunction(this.$options[options.keyName])) { + if (!this.$options.computed) { + this.$options.computed = {}; + } + this.$options.computed.$metaInfo = this.$options[options.keyName]; if (!this.$isServer) { - // no need to add this hooks on server side - updateOnLifecycleHook.forEach(function (lifecycleHook) { - ensuredPush(_this.$options, lifecycleHook, function () { - return triggerUpdate(_this, lifecycleHook); + // if computed $metaInfo exists, watch it for updates & trigger a refresh + // when it changes (i.e. automatically handle async actions that affect metaInfo) + // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux) + ensuredPush(this.$options, 'created', function () { + _this.$watch('$metaInfo', function () { + _this.__metaInfo = undefined; + triggerUpdate(_this, 'watcher'); }); - }); // re-render meta data when returning from a child component to parent - - ensuredPush(this.$options, 'destroyed', function () { - // Wait that element is hidden before refreshing meta tags (to support animations) - var interval = setInterval(function () { - if (_this.$el && _this.$el.offsetParent !== null) { - /* istanbul ignore next line */ - return; - } - - clearInterval(interval); - - if (!_this.$parent) { - /* istanbul ignore next line */ - return; - } - - triggerUpdate(_this, 'destroyed'); - }, 50); }); } - } + } // force an initial refresh on page load and prevent other lifecycleHooks + // to triggerUpdate until this initial refresh is finished + // this is to make sure that when a page is opened in an inactive tab which + // has throttled rAF/timers we still immediately set the page title + + + if (isUndefined(this.$root._vueMeta.initialized)) { + this.$root._vueMeta.initialized = this.$isServer; + + if (!this.$root._vueMeta.initialized) { + ensuredPush(this.$options, 'beforeMount', function () { + // if this Vue-app was server rendered, set the appId to 'ssr' + // only one SSR app per page is supported + if (_this.$root.$el && _this.$root.$el.hasAttribute && _this.$root.$el.hasAttribute('data-server-rendered')) { + _this.$root._vueMeta.appId = options.ssrAppId; + } + }); // we use the mounted hook here as on page load + + ensuredPush(this.$options, 'mounted', function () { + if (!_this.$root._vueMeta.initialized) { + // used in triggerUpdate to check if a change was triggered + // during initialization + _this.$root._vueMeta.initializing = true; // refresh meta in nextTick so all child components have loaded + + _this.$nextTick(function () { + var _this2 = this; + + var _this$$root$$meta$ref = this.$root.$meta().refresh(), + tags = _this$$root$$meta$ref.tags, + metaInfo = _this$$root$$meta$ref.metaInfo; // After ssr hydration (identifier by tags === false) check + // if initialized was set to null in triggerUpdate. That'd mean + // that during initilazation changes where triggered which need + // to be applied OR a metaInfo watcher was triggered before the + // current hook was called + // (during initialization all changes are blocked) + + + if (tags === false && this.$root._vueMeta.initialized === null) { + this.$nextTick(function () { + return triggerUpdate(_this2, 'initializing'); + }); + } + + this.$root._vueMeta.initialized = true; + delete this.$root._vueMeta.initializing; // add the navigation guards if they havent been added yet + // they are needed for the afterNavigation callback + + if (!options.refreshOnceOnNavigation && metaInfo.afterNavigation) { + addNavGuards(this); + } + }); + } + }); // add the navigation guards if requested + + if (options.refreshOnceOnNavigation) { + addNavGuards(this); + } + } + } // do not trigger refresh on the server side + + + if (this.$isServer) { + return; + } // no need to add this hooks on server side + + + updateOnLifecycleHook.forEach(function (lifecycleHook) { + ensuredPush(_this.$options, lifecycleHook, function () { + return triggerUpdate(_this, lifecycleHook); + }); + }); + }, + // TODO: move back into beforeCreate when Vue issue is resolved + destroyed: function destroyed() { + var _this3 = this; + + // do not trigger refresh: + // - on the server side + // - when the component doesnt have a parent + // - doesnt have metaInfo defined + if (this.$isServer || !this.$parent || !hasMetaInfo(this)) { + return; + } // Wait that element is hidden before refreshing meta tags (to support animations) + + + var interval = setInterval(function () { + if (_this3.$el && _this3.$el.offsetParent !== null) { + return; + } + + clearInterval(interval); + triggerUpdate(_this3, 'destroyed'); + }, 50); } }; } diff --git a/dist/vue-meta.esm.browser.js b/dist/vue-meta.esm.browser.js index f2b404a..0603c7b 100644 --- a/dist/vue-meta.esm.browser.js +++ b/dist/vue-meta.esm.browser.js @@ -1,5 +1,5 @@ /** - * vue-meta v2.2.1 + * vue-meta v2.2.2 * (c) 2019 * - Declan de Wet * - Sébastien Chopin (@Atinux) @@ -9,7 +9,7 @@ import deepmerge from 'deepmerge'; -var version = "2.2.1"; +var version = "2.2.2"; // store an id to keep track of DOM updates var batchId = null; @@ -219,137 +219,145 @@ function createMixin(Vue, options) { // _vnode is used to know that it's attached to a real component // useful if we use some mixin to add some meta tags (like nuxt-i18n) - if (!isUndefined(this.$options[options.keyName]) && this.$options[options.keyName] !== null) { - if (!this.$root._vueMeta) { - this.$root._vueMeta = { - appId: appId - }; - appId++; - } // to speed up updates we keep track of branches which have a component with vue-meta info defined - // if _vueMeta = true it has info, if _vueMeta = false a child has info + if (isUndefined(this.$options[options.keyName]) || this.$options[options.keyName] === null) { + return; + } + + if (!this.$root._vueMeta) { + this.$root._vueMeta = { + appId: appId + }; + appId++; + } // to speed up updates we keep track of branches which have a component with vue-meta info defined + // if _vueMeta = true it has info, if _vueMeta = false a child has info - if (!this._vueMeta) { - this._vueMeta = true; - var p = this.$parent; + if (!this._vueMeta) { + this._vueMeta = true; + var p = this.$parent; - while (p && p !== this.$root) { - if (isUndefined(p._vueMeta)) { - p._vueMeta = false; - } - - p = p.$parent; - } - } // coerce function-style metaInfo to a computed prop so we can observe - // it on creation - - - if (isFunction(this.$options[options.keyName])) { - if (!this.$options.computed) { - this.$options.computed = {}; + while (p && p !== this.$root) { + if (isUndefined(p._vueMeta)) { + p._vueMeta = false; } - this.$options.computed.$metaInfo = this.$options[options.keyName]; - - if (!this.$isServer) { - // if computed $metaInfo exists, watch it for updates & trigger a refresh - // when it changes (i.e. automatically handle async actions that affect metaInfo) - // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux) - ensuredPush(this.$options, 'created', function () { - _this.$watch('$metaInfo', function () { - triggerUpdate(this, 'watcher'); - }); - }); - } - } // force an initial refresh on page load and prevent other lifecycleHooks - // to triggerUpdate until this initial refresh is finished - // this is to make sure that when a page is opened in an inactive tab which - // has throttled rAF/timers we still immediately set the page title + p = p.$parent; + } + } // coerce function-style metaInfo to a computed prop so we can observe + // it on creation - if (isUndefined(this.$root._vueMeta.initialized)) { - this.$root._vueMeta.initialized = this.$isServer; - - if (!this.$root._vueMeta.initialized) { - ensuredPush(this.$options, 'beforeMount', function () { - // if this Vue-app was server rendered, set the appId to 'ssr' - // only one SSR app per page is supported - if (_this.$root.$el && _this.$root.$el.hasAttribute && _this.$root.$el.hasAttribute('data-server-rendered')) { - _this.$root._vueMeta.appId = options.ssrAppId; - } - }); // we use the mounted hook here as on page load - - ensuredPush(this.$options, 'mounted', function () { - if (!_this.$root._vueMeta.initialized) { - // used in triggerUpdate to check if a change was triggered - // during initialization - _this.$root._vueMeta.initializing = true; // refresh meta in nextTick so all child components have loaded - - _this.$nextTick(function () { - var _this2 = this; - - var _this$$root$$meta$ref = this.$root.$meta().refresh(), - tags = _this$$root$$meta$ref.tags, - metaInfo = _this$$root$$meta$ref.metaInfo; // After ssr hydration (identifier by tags === false) check - // if initialized was set to null in triggerUpdate. That'd mean - // that during initilazation changes where triggered which need - // to be applied OR a metaInfo watcher was triggered before the - // current hook was called - // (during initialization all changes are blocked) - - - if (tags === false && this.$root._vueMeta.initialized === null) { - this.$nextTick(function () { - return triggerUpdate(_this2, 'initializing'); - }); - } - - this.$root._vueMeta.initialized = true; - delete this.$root._vueMeta.initializing; // add the navigation guards if they havent been added yet - // they are needed for the afterNavigation callback - - if (!options.refreshOnceOnNavigation && metaInfo.afterNavigation) { - addNavGuards(this); - } - }); - } - }); // add the navigation guards if requested - - if (options.refreshOnceOnNavigation) { - addNavGuards(this); - } - } - } // do not trigger refresh on the server side + if (isFunction(this.$options[options.keyName])) { + if (!this.$options.computed) { + this.$options.computed = {}; + } + this.$options.computed.$metaInfo = this.$options[options.keyName]; if (!this.$isServer) { - // no need to add this hooks on server side - updateOnLifecycleHook.forEach(function (lifecycleHook) { - ensuredPush(_this.$options, lifecycleHook, function () { - return triggerUpdate(_this, lifecycleHook); + // if computed $metaInfo exists, watch it for updates & trigger a refresh + // when it changes (i.e. automatically handle async actions that affect metaInfo) + // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux) + ensuredPush(this.$options, 'created', function () { + _this.$watch('$metaInfo', function () { + _this.__metaInfo = undefined; + triggerUpdate(_this, 'watcher'); }); - }); // re-render meta data when returning from a child component to parent - - ensuredPush(this.$options, 'destroyed', function () { - // Wait that element is hidden before refreshing meta tags (to support animations) - var interval = setInterval(function () { - if (_this.$el && _this.$el.offsetParent !== null) { - /* istanbul ignore next line */ - return; - } - - clearInterval(interval); - - if (!_this.$parent) { - /* istanbul ignore next line */ - return; - } - - triggerUpdate(_this, 'destroyed'); - }, 50); }); } - } + } // force an initial refresh on page load and prevent other lifecycleHooks + // to triggerUpdate until this initial refresh is finished + // this is to make sure that when a page is opened in an inactive tab which + // has throttled rAF/timers we still immediately set the page title + + + if (isUndefined(this.$root._vueMeta.initialized)) { + this.$root._vueMeta.initialized = this.$isServer; + + if (!this.$root._vueMeta.initialized) { + ensuredPush(this.$options, 'beforeMount', function () { + // if this Vue-app was server rendered, set the appId to 'ssr' + // only one SSR app per page is supported + if (_this.$root.$el && _this.$root.$el.hasAttribute && _this.$root.$el.hasAttribute('data-server-rendered')) { + _this.$root._vueMeta.appId = options.ssrAppId; + } + }); // we use the mounted hook here as on page load + + ensuredPush(this.$options, 'mounted', function () { + if (!_this.$root._vueMeta.initialized) { + // used in triggerUpdate to check if a change was triggered + // during initialization + _this.$root._vueMeta.initializing = true; // refresh meta in nextTick so all child components have loaded + + _this.$nextTick(function () { + var _this2 = this; + + var _this$$root$$meta$ref = this.$root.$meta().refresh(), + tags = _this$$root$$meta$ref.tags, + metaInfo = _this$$root$$meta$ref.metaInfo; // After ssr hydration (identifier by tags === false) check + // if initialized was set to null in triggerUpdate. That'd mean + // that during initilazation changes where triggered which need + // to be applied OR a metaInfo watcher was triggered before the + // current hook was called + // (during initialization all changes are blocked) + + + if (tags === false && this.$root._vueMeta.initialized === null) { + this.$nextTick(function () { + return triggerUpdate(_this2, 'initializing'); + }); + } + + this.$root._vueMeta.initialized = true; + delete this.$root._vueMeta.initializing; // add the navigation guards if they havent been added yet + // they are needed for the afterNavigation callback + + if (!options.refreshOnceOnNavigation && metaInfo.afterNavigation) { + addNavGuards(this); + } + }); + } + }); // add the navigation guards if requested + + if (options.refreshOnceOnNavigation) { + addNavGuards(this); + } + } + } // do not trigger refresh on the server side + + + if (this.$isServer) { + return; + } // no need to add this hooks on server side + + + updateOnLifecycleHook.forEach(function (lifecycleHook) { + ensuredPush(_this.$options, lifecycleHook, function () { + return triggerUpdate(_this, lifecycleHook); + }); + }); + }, + // TODO: move back into beforeCreate when Vue issue is resolved + destroyed: function destroyed() { + var _this3 = this; + + // do not trigger refresh: + // - on the server side + // - when the component doesnt have a parent + // - doesnt have metaInfo defined + if (this.$isServer || !this.$parent || !hasMetaInfo(this)) { + return; + } // Wait that element is hidden before refreshing meta tags (to support animations) + + + var interval = setInterval(function () { + if (_this3.$el && _this3.$el.offsetParent !== null) { + return; + } + + clearInterval(interval); + triggerUpdate(_this3, 'destroyed'); + }, 50); } }; } diff --git a/dist/vue-meta.esm.browser.min.js b/dist/vue-meta.esm.browser.min.js index 3a26b54..3f06bab 100644 --- a/dist/vue-meta.esm.browser.min.js +++ b/dist/vue-meta.esm.browser.min.js @@ -1 +1 @@ -import t from"deepmerge";var e=null;function n(t,n){t.$root._vueMeta.initialized||!t.$root._vueMeta.initializing&&"watcher"!==n||(t.$root._vueMeta.initialized=null),t.$root._vueMeta.initialized&&!t.$root._vueMeta.paused&&function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;clearTimeout(e),e=setTimeout(function(){t()},n)}(function(){return t.$meta().refresh()})}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return Array.isArray(t)}function a(t){return void 0===t}function u(t){return"object"===r(t)}function s(t){return"object"===r(t)&&null!==t}function c(t){return"function"==typeof t}function l(t,e){return e&&u(t)?(o(t[e])||(t[e]=[]),t):o(t)?t:[]}function f(t,e,n){l(t,e),t[e].push(n)}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return t&&(!0===t._vueMeta||u(t._vueMeta))}function v(t){if(!t.$root._vueMeta.navGuards&&t.$root.$router){t.$root._vueMeta.navGuards=!0;var e=t.$root.$router,n=t.$root.$meta();e.beforeEach(function(t,e,r){n.pause(),r()}),e.afterEach(function(){var t=n.resume().metaInfo;t&&t.afterNavigation&&c(t.afterNavigation)&&t.afterNavigation(t)})}}var h=(function(){try{return!a(window)}catch(t){return!1}}()?window:global).console||{};function p(t){h&&h.warn&&h.warn(t)}var m=function(){return p("This vue app/component has no vue-meta configuration")},y=1;var g={title:void 0,titleChunk:"",titleTemplate:"%s",htmlAttrs:{},bodyAttrs:{},headAttrs:{},base:[],link:[],meta:[],style:[],script:[],noscript:[],__dangerouslyDisableSanitizers:[],__dangerouslyDisableSanitizersByTagID:{}},b={keyName:"metaInfo",attribute:"data-vue-meta",ssrAttribute:"data-vue-meta-server-rendered",tagIDKeyName:"vmid",contentKeyName:"content",metaTemplateKeyName:"template",ssrAppId:"ssr"},$=["titleChunk","titleTemplate","changed","__dangerouslyDisableSanitizers","__dangerouslyDisableSanitizersByTagID"],_=["__dangerouslyDisableSanitizers","__dangerouslyDisableSanitizersByTagID"],M=["htmlAttrs","headAttrs","bodyAttrs"],T=["link","style","script"],A=["once","template"],N=["body","pbody"],I=["allowfullscreen","amp","async","autofocus","autoplay","checked","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","defer","disabled","enabled","formnovalidate","hidden","indeterminate","inert","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","pauseonexit","readonly","required","reversed","scoped","seamless","selected","sortable","truespeed","typemustmatch","visible"];function w(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$root._vueMeta.paused=!0,function(){return S(t)}}function S(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.$root._vueMeta.paused=!1,t)return this.$root.$meta().refresh()}function E(t,e){if(!Array.prototype.findIndex){for(var n=0;n/g,">"],[/"/g,'"'],[/'/g,"'"]];function K(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r={doEscape:function(t){return n.reduce(function(t,e){var n=i(e,2),r=n[0],o=n[1];return t.replace(r,o)},t)}};return _.forEach(function(t,n){if(0===n)l(e,t);else if(1===n)for(var i in e[t])l(e[t],i);r[t]=e[t]}),function t(e,n,r,a){var u=n.tagIDKeyName,c=r.doEscape,l=void 0===c?function(t){return t}:c,f={};for(var d in e){var v=e[d];if(z($,d))f[d]=v;else{var h=i(_,1)[0];if(r[h]&&z(r[h],d))f[d]=v;else{var p=e[u];if(p&&(h=_[1],r[h]&&r[h][p]&&z(r[h][p],d)))f[d]=v;else if("string"==typeof v?f[d]=l(v):o(v)?f[d]=v.map(function(e){return s(e)?t(e,n,r,!0):l(e)}):s(v)?f[d]=t(v,n,r,!0):f[d]=v,a){var m=l(d);d!==m&&(f[m]=f[d],delete f[d])}}}}return f}(e,t,r)}function O(t,e,n,r){var i=t.component,o=t.metaTemplateKeyName,u=t.contentKeyName;return!0!==n&&!0!==e[o]&&(a(n)&&e[o]&&(n=e[o],e[o]=!0),n?(a(r)&&(r=e[u]),e[u]=c(n)?n.call(i,r):n.replace(/%s/g,r),!0):(e.hasOwnProperty(o)&&delete e[o],!1))}function x(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.hasOwnProperty("title")&&void 0===n.title&&delete n.title,M.forEach(function(t){if(n[t])for(var e in n[t])n[t].hasOwnProperty(e)&&void 0===n[t][e]&&(z(I,e)&&p("VueMeta: Please note that since v2 the value undefined is not used to indicate boolean attributes anymore, see migration guide for details"),delete n[t][e])}),t(e,n,{arrayMerge:function(t,e){return function(t,e,n){var r=t.component,i=t.tagIDKeyName,o=t.metaTemplateKeyName,a=t.contentKeyName,u=[];return e.length||n.length?(e.forEach(function(t,e){if(t[i]){var s=E(n,function(e){return e[i]===t[i]}),c=n[s];if(-1!==s){if(c.hasOwnProperty(a)&&void 0===c[a]||c.hasOwnProperty("innerHTML")&&void 0===c.innerHTML)return u.push(t),void n.splice(s,1);if(null!==c[a]&&null!==c.innerHTML){var l=t[o];if(l){if(!c[o])return O({component:r,metaTemplateKeyName:o,contentKeyName:a},c,l),void(c.template=!0);c[a]||O({component:r,metaTemplateKeyName:o,contentKeyName:a},c,void 0,t[a])}}else n.splice(s,1)}else u.push(t)}else u.push(t)}),u.concat(n)):u}(r,t,e)}})}function P(){return function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n=arguments.length>1?arguments[1]:void 0;var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var i=e.keyName;var o=n.$options,s=n.$children;if(n._inactive)return r;if(o[i]){var l=o[i];if(c(l)&&(l=l.call(n)),!u(l))return r;r=x(r,l,e)}s.length&&s.forEach(function(n){(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return t&&!a(t._vueMeta)})(n)&&(r=t(e,n,r))});return r}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0,g)}function j(t,e){return t[e]||(t[e]=document.getElementsByTagName(e)[0]),t[e]}function C(t,e){var n=e.appId,r=e.attribute,i=e.type,o=e.tagIDKeyName,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=["".concat(i,"[").concat(r,'="').concat(n,'"]'),"".concat(i,"[data-").concat(o,"]")].map(function(t){for(var e in a){var n=a[e],r=n&&!0!==n?'="'.concat(n,'"'):"";t+="[data-".concat(e).concat(r,"]")}return t});return k(t.querySelectorAll(u.join(", ")))}var L=[];function H(t,e,n,r){var i=t.tagIDKeyName,o=!1;return n.forEach(function(t){t[i]&&t.callback&&(o=!0,function(t,e){1===arguments.length&&(e=t,t=""),L.push([t,e])}("".concat(e,"[data-").concat(i,'="').concat(t[i],'"]'),t.callback))}),r&&o?B():o}function B(){!function(){return"complete"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).readyState}()?document.onreadystatechange=function(){q()}:q()}function q(t){L.forEach(function(e){var n=i(e,2),r=n[0],o=n[1],a="".concat(r,'[onload="this.__vm_l=1"]'),u=[];t||(u=k(document.querySelectorAll(a))),t&&t.matches(a)&&(u=[t]),u.forEach(function(t){if(!t.__vm_cb){var e=function(){t.__vm_cb=!0,t.removeAttribute("onload"),o(t)};t.__vm_l?e():t.__vm_ev||(t.__vm_ev=!0,t.addEventListener("load",e))}})})}function V(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).attribute,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=n.getAttribute(t),i=r?r.split(","):[],a=k(i),u=[];for(var s in e)if(e.hasOwnProperty(s)){var c=z(I,s)?"":o(e[s])?e[s].join(" "):e[s];n.setAttribute(s,c||""),z(i,s)||i.push(s),u.push(a.indexOf(s))}var l=a.filter(function(t,e){return!z(u,e)}).reduce(function(t,e){return n.removeAttribute(e),t+1},0);i.length===l?n.removeAttribute(t):n.setAttribute(t,i.sort().join(","))}function W(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=e.attribute,u=e.tagIDKeyName,s=N.slice();s.push(u);var c=[],l={appId:t,attribute:a,type:n,tagIDKeyName:u},f={head:C(i,l),pbody:C(o,l,{pbody:!0}),body:C(o,l,{body:!0})};if(r.length>1){var d=[];r=r.filter(function(t){var e=JSON.stringify(t),n=!z(d,e);return d.push(e),n})}r.forEach(function(e){if(!e.skip){var r=document.createElement(n);r.setAttribute(a,t);var i=function(t){if(!e.hasOwnProperty(t)||z(A,t))return"continue";if("innerHTML"===t)return r.innerHTML=e.innerHTML,"continue";if("json"===t)return r.innerHTML=JSON.stringify(e.json),"continue";if("cssText"===t)return r.styleSheet?r.styleSheet.cssText=e.cssText:r.appendChild(document.createTextNode(e.cssText)),"continue";if("callback"===t)return r.onload=function(){return e[t](r)},"continue";var n=z(s,t)?"data-".concat(t):t,i=z(I,t);if(i&&!e[t])return"continue";var o=i?"":e[t];r.setAttribute(n,o)};for(var o in e)i(o);var u,l=f[function(t){var e=t.body,n=t.pbody;return e?"body":n?"pbody":"head"}(e)];l.some(function(t,e){return u=e,r.isEqualNode(t)})&&(u||0===u)?l.splice(u,1):c.push(r)}});var v=[];for(var h in f)Array.prototype.push.apply(v,f[h]);return v.forEach(function(t){t.parentNode.removeChild(t)}),c.forEach(function(t){t.hasAttribute("data-body")?o.appendChild(t):t.hasAttribute("data-pbody")?o.insertBefore(t,o.firstChild):i.appendChild(t)}),{oldTags:v,newTags:c}}function G(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(){var e=P(t,this.$root),n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,i=t.tagIDKeyName;return e.title&&(e.titleChunk=e.title),e.titleTemplate&&"%s"!==e.titleTemplate&&O({component:r,contentKeyName:"title"},e,e.titleTemplate,e.titleChunk||""),e.base&&(e.base=Object.keys(e.base).length?[e.base]:[]),e.meta&&(e.meta=e.meta.filter(function(t,e,n){return!t.hasOwnProperty(i)||e===E(n,function(e){return e[i]===t[i]})}),e.meta.forEach(function(e){return O(t,e)})),K(t,e,n)}(t,e,D,this.$root),r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.ssrAttribute,i=e.ssrAppId,a={},u=j(a,"html");if(t===i&&u.hasAttribute(r)){u.removeAttribute(r);var s=!1;return T.forEach(function(t){n[t]&&H(e,t,n[t])&&(s=!0)}),s&&B(),!1}var c,l={},f={};for(var d in n)if(!z($,d))if("title"!==d){if(z(M,d)){var v=d.substr(0,4);V(e,n[d],j(a,v))}else if(o(n[d])){var h=W(t,e,d,n[d],j(a,"head"),j(a,"body")),p=h.oldTags,m=h.newTags;m.length&&(l[d]=m,f[d]=p)}}else((c=n.title)||""===c)&&(document.title=c);return{addedTags:l,removedTags:f}}(this.$root._vueMeta.appId,t,n);return r&&c(n.changed)&&n.changed(n,r.addedTags,r.removedTags),{vm:this,metaInfo:n,tags:r}}}function J(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.__vuemeta_installed||(t.__vuemeta_installed=!0,e=function(t){for(var e in t=u(t)?t:{},b)t[e]||(t[e]=b[e]);return t}(e),t.prototype.$meta=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=G(t),n=function(){};return function(){return this.$root._vueMeta?{getOptions:function(){return function(t){var e={};for(var n in t)e[n]=t[n];return e}(t)},refresh:e.bind(this),inject:n,pause:w.bind(this),resume:S.bind(this)}:{getOptions:m,refresh:m,inject:m,pause:m,resume:m}}}(e),t.mixin(function(t,e){var r=["activated","deactivated","beforeMount"];return{beforeCreate:function(){var i=this;if(Object.defineProperty(this,"_hasMetaInfo",{configurable:!0,get:function(){return t.config.devtools&&!this.$root._vueMeta.hasMetaInfoDeprecationWarningShown&&(p("VueMeta DeprecationWarning: _hasMetaInfo has been deprecated and will be removed in a future version. Please use hasMetaInfo(vm) instead"),this.$root._vueMeta.hasMetaInfoDeprecationWarningShown=!0),d(this)}}),!a(this.$options[e.keyName])&&null!==this.$options[e.keyName]){if(this.$root._vueMeta||(this.$root._vueMeta={appId:y},y++),!this._vueMeta){this._vueMeta=!0;for(var o=this.$parent;o&&o!==this.$root;)a(o._vueMeta)&&(o._vueMeta=!1),o=o.$parent}c(this.$options[e.keyName])&&(this.$options.computed||(this.$options.computed={}),this.$options.computed.$metaInfo=this.$options[e.keyName],this.$isServer||f(this.$options,"created",function(){i.$watch("$metaInfo",function(){n(this,"watcher")})})),a(this.$root._vueMeta.initialized)&&(this.$root._vueMeta.initialized=this.$isServer,this.$root._vueMeta.initialized||(f(this.$options,"beforeMount",function(){i.$root.$el&&i.$root.$el.hasAttribute&&i.$root.$el.hasAttribute("data-server-rendered")&&(i.$root._vueMeta.appId=e.ssrAppId)}),f(this.$options,"mounted",function(){i.$root._vueMeta.initialized||(i.$root._vueMeta.initializing=!0,i.$nextTick(function(){var t=this,r=this.$root.$meta().refresh(),i=r.tags,o=r.metaInfo;!1===i&&null===this.$root._vueMeta.initialized&&this.$nextTick(function(){return n(t,"initializing")}),this.$root._vueMeta.initialized=!0,delete this.$root._vueMeta.initializing,!e.refreshOnceOnNavigation&&o.afterNavigation&&v(this)}))}),e.refreshOnceOnNavigation&&v(this))),this.$isServer||(r.forEach(function(t){f(i.$options,t,function(){return n(i,t)})}),f(this.$options,"destroyed",function(){var t=setInterval(function(){i.$el&&null!==i.$el.offsetParent||(clearInterval(t),i.$parent&&n(i,"destroyed"))},50)}))}}}}(t,e)))}a(window)||a(window.Vue)||J(window.Vue);var F={version:"2.2.1",install:J,hasMetaInfo:d};export default F; +import t from"deepmerge";var e=null;function n(t,n){t.$root._vueMeta.initialized||!t.$root._vueMeta.initializing&&"watcher"!==n||(t.$root._vueMeta.initialized=null),t.$root._vueMeta.initialized&&!t.$root._vueMeta.paused&&function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;clearTimeout(e),e=setTimeout(function(){t()},n)}(function(){return t.$meta().refresh()})}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return Array.isArray(t)}function a(t){return void 0===t}function u(t){return"object"===r(t)}function s(t){return"object"===r(t)&&null!==t}function c(t){return"function"==typeof t}function l(t,e){return e&&u(t)?(o(t[e])||(t[e]=[]),t):o(t)?t:[]}function f(t,e,n){l(t,e),t[e].push(n)}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return t&&(!0===t._vueMeta||u(t._vueMeta))}function v(t){if(!t.$root._vueMeta.navGuards&&t.$root.$router){t.$root._vueMeta.navGuards=!0;var e=t.$root.$router,n=t.$root.$meta();e.beforeEach(function(t,e,r){n.pause(),r()}),e.afterEach(function(){var t=n.resume().metaInfo;t&&t.afterNavigation&&c(t.afterNavigation)&&t.afterNavigation(t)})}}var h=(function(){try{return!a(window)}catch(t){return!1}}()?window:global).console||{};function p(t){h&&h.warn&&h.warn(t)}var m=function(){return p("This vue app/component has no vue-meta configuration")},y=1;var g={title:void 0,titleChunk:"",titleTemplate:"%s",htmlAttrs:{},bodyAttrs:{},headAttrs:{},base:[],link:[],meta:[],style:[],script:[],noscript:[],__dangerouslyDisableSanitizers:[],__dangerouslyDisableSanitizersByTagID:{}},b={keyName:"metaInfo",attribute:"data-vue-meta",ssrAttribute:"data-vue-meta-server-rendered",tagIDKeyName:"vmid",contentKeyName:"content",metaTemplateKeyName:"template",ssrAppId:"ssr"},$=["titleChunk","titleTemplate","changed","__dangerouslyDisableSanitizers","__dangerouslyDisableSanitizersByTagID"],_=["__dangerouslyDisableSanitizers","__dangerouslyDisableSanitizersByTagID"],M=["htmlAttrs","headAttrs","bodyAttrs"],T=["link","style","script"],A=["once","template"],I=["body","pbody"],N=["allowfullscreen","amp","async","autofocus","autoplay","checked","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","defer","disabled","enabled","formnovalidate","hidden","indeterminate","inert","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","pauseonexit","readonly","required","reversed","scoped","seamless","selected","sortable","truespeed","typemustmatch","visible"];function w(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$root._vueMeta.paused=!0,function(){return S(t)}}function S(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.$root._vueMeta.paused=!1,t)return this.$root.$meta().refresh()}function E(t,e){if(!Array.prototype.findIndex){for(var n=0;n/g,">"],[/"/g,'"'],[/'/g,"'"]];function K(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r={doEscape:function(t){return n.reduce(function(t,e){var n=i(e,2),r=n[0],o=n[1];return t.replace(r,o)},t)}};return _.forEach(function(t,n){if(0===n)l(e,t);else if(1===n)for(var i in e[t])l(e[t],i);r[t]=e[t]}),function t(e,n,r,a){var u=n.tagIDKeyName,c=r.doEscape,l=void 0===c?function(t){return t}:c,f={};for(var d in e){var v=e[d];if(z($,d))f[d]=v;else{var h=i(_,1)[0];if(r[h]&&z(r[h],d))f[d]=v;else{var p=e[u];if(p&&(h=_[1],r[h]&&r[h][p]&&z(r[h][p],d)))f[d]=v;else if("string"==typeof v?f[d]=l(v):o(v)?f[d]=v.map(function(e){return s(e)?t(e,n,r,!0):l(e)}):s(v)?f[d]=t(v,n,r,!0):f[d]=v,a){var m=l(d);d!==m&&(f[m]=f[d],delete f[d])}}}}return f}(e,t,r)}function O(t,e,n,r){var i=t.component,o=t.metaTemplateKeyName,u=t.contentKeyName;return!0!==n&&!0!==e[o]&&(a(n)&&e[o]&&(n=e[o],e[o]=!0),n?(a(r)&&(r=e[u]),e[u]=c(n)?n.call(i,r):n.replace(/%s/g,r),!0):(e.hasOwnProperty(o)&&delete e[o],!1))}function x(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.hasOwnProperty("title")&&void 0===n.title&&delete n.title,M.forEach(function(t){if(n[t])for(var e in n[t])n[t].hasOwnProperty(e)&&void 0===n[t][e]&&(z(N,e)&&p("VueMeta: Please note that since v2 the value undefined is not used to indicate boolean attributes anymore, see migration guide for details"),delete n[t][e])}),t(e,n,{arrayMerge:function(t,e){return function(t,e,n){var r=t.component,i=t.tagIDKeyName,o=t.metaTemplateKeyName,a=t.contentKeyName,u=[];return e.length||n.length?(e.forEach(function(t,e){if(t[i]){var s=E(n,function(e){return e[i]===t[i]}),c=n[s];if(-1!==s){if(c.hasOwnProperty(a)&&void 0===c[a]||c.hasOwnProperty("innerHTML")&&void 0===c.innerHTML)return u.push(t),void n.splice(s,1);if(null!==c[a]&&null!==c.innerHTML){var l=t[o];if(l){if(!c[o])return O({component:r,metaTemplateKeyName:o,contentKeyName:a},c,l),void(c.template=!0);c[a]||O({component:r,metaTemplateKeyName:o,contentKeyName:a},c,void 0,t[a])}}else n.splice(s,1)}else u.push(t)}else u.push(t)}),u.concat(n)):u}(r,t,e)}})}function P(){return function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n=arguments.length>1?arguments[1]:void 0;var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var i=e.keyName;var o=n.$options,s=n.$children;if(n._inactive)return r;if(o[i]){var l=o[i];if(c(l)&&(l=l.call(n)),!u(l))return r;r=x(r,l,e)}s.length&&s.forEach(function(n){(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return t&&!a(t._vueMeta)})(n)&&(r=t(e,n,r))});return r}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0,g)}function j(t,e){return t[e]||(t[e]=document.getElementsByTagName(e)[0]),t[e]}function C(t,e){var n=e.appId,r=e.attribute,i=e.type,o=e.tagIDKeyName,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=["".concat(i,"[").concat(r,'="').concat(n,'"]'),"".concat(i,"[data-").concat(o,"]")].map(function(t){for(var e in a){var n=a[e],r=n&&!0!==n?'="'.concat(n,'"'):"";t+="[data-".concat(e).concat(r,"]")}return t});return k(t.querySelectorAll(u.join(", ")))}var L=[];function H(t,e,n,r){var i=t.tagIDKeyName,o=!1;return n.forEach(function(t){t[i]&&t.callback&&(o=!0,function(t,e){1===arguments.length&&(e=t,t=""),L.push([t,e])}("".concat(e,"[data-").concat(i,'="').concat(t[i],'"]'),t.callback))}),r&&o?B():o}function B(){!function(){return"complete"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).readyState}()?document.onreadystatechange=function(){q()}:q()}function q(t){L.forEach(function(e){var n=i(e,2),r=n[0],o=n[1],a="".concat(r,'[onload="this.__vm_l=1"]'),u=[];t||(u=k(document.querySelectorAll(a))),t&&t.matches(a)&&(u=[t]),u.forEach(function(t){if(!t.__vm_cb){var e=function(){t.__vm_cb=!0,t.removeAttribute("onload"),o(t)};t.__vm_l?e():t.__vm_ev||(t.__vm_ev=!0,t.addEventListener("load",e))}})})}function V(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).attribute,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=n.getAttribute(t),i=r?r.split(","):[],a=k(i),u=[];for(var s in e)if(e.hasOwnProperty(s)){var c=z(N,s)?"":o(e[s])?e[s].join(" "):e[s];n.setAttribute(s,c||""),z(i,s)||i.push(s),u.push(a.indexOf(s))}var l=a.filter(function(t,e){return!z(u,e)}).reduce(function(t,e){return n.removeAttribute(e),t+1},0);i.length===l?n.removeAttribute(t):n.setAttribute(t,i.sort().join(","))}function W(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=e.attribute,u=e.tagIDKeyName,s=I.slice();s.push(u);var c=[],l={appId:t,attribute:a,type:n,tagIDKeyName:u},f={head:C(i,l),pbody:C(o,l,{pbody:!0}),body:C(o,l,{body:!0})};if(r.length>1){var d=[];r=r.filter(function(t){var e=JSON.stringify(t),n=!z(d,e);return d.push(e),n})}r.forEach(function(e){if(!e.skip){var r=document.createElement(n);r.setAttribute(a,t);var i=function(t){if(!e.hasOwnProperty(t)||z(A,t))return"continue";if("innerHTML"===t)return r.innerHTML=e.innerHTML,"continue";if("json"===t)return r.innerHTML=JSON.stringify(e.json),"continue";if("cssText"===t)return r.styleSheet?r.styleSheet.cssText=e.cssText:r.appendChild(document.createTextNode(e.cssText)),"continue";if("callback"===t)return r.onload=function(){return e[t](r)},"continue";var n=z(s,t)?"data-".concat(t):t,i=z(N,t);if(i&&!e[t])return"continue";var o=i?"":e[t];r.setAttribute(n,o)};for(var o in e)i(o);var u,l=f[function(t){var e=t.body,n=t.pbody;return e?"body":n?"pbody":"head"}(e)];l.some(function(t,e){return u=e,r.isEqualNode(t)})&&(u||0===u)?l.splice(u,1):c.push(r)}});var v=[];for(var h in f)Array.prototype.push.apply(v,f[h]);return v.forEach(function(t){t.parentNode.removeChild(t)}),c.forEach(function(t){t.hasAttribute("data-body")?o.appendChild(t):t.hasAttribute("data-pbody")?o.insertBefore(t,o.firstChild):i.appendChild(t)}),{oldTags:v,newTags:c}}function G(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(){var e=P(t,this.$root),n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,i=t.tagIDKeyName;return e.title&&(e.titleChunk=e.title),e.titleTemplate&&"%s"!==e.titleTemplate&&O({component:r,contentKeyName:"title"},e,e.titleTemplate,e.titleChunk||""),e.base&&(e.base=Object.keys(e.base).length?[e.base]:[]),e.meta&&(e.meta=e.meta.filter(function(t,e,n){return!t.hasOwnProperty(i)||e===E(n,function(e){return e[i]===t[i]})}),e.meta.forEach(function(e){return O(t,e)})),K(t,e,n)}(t,e,D,this.$root),r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.ssrAttribute,i=e.ssrAppId,a={},u=j(a,"html");if(t===i&&u.hasAttribute(r)){u.removeAttribute(r);var s=!1;return T.forEach(function(t){n[t]&&H(e,t,n[t])&&(s=!0)}),s&&B(),!1}var c,l={},f={};for(var d in n)if(!z($,d))if("title"!==d){if(z(M,d)){var v=d.substr(0,4);V(e,n[d],j(a,v))}else if(o(n[d])){var h=W(t,e,d,n[d],j(a,"head"),j(a,"body")),p=h.oldTags,m=h.newTags;m.length&&(l[d]=m,f[d]=p)}}else((c=n.title)||""===c)&&(document.title=c);return{addedTags:l,removedTags:f}}(this.$root._vueMeta.appId,t,n);return r&&c(n.changed)&&n.changed(n,r.addedTags,r.removedTags),{vm:this,metaInfo:n,tags:r}}}function J(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.__vuemeta_installed||(t.__vuemeta_installed=!0,e=function(t){for(var e in t=u(t)?t:{},b)t[e]||(t[e]=b[e]);return t}(e),t.prototype.$meta=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=G(t),n=function(){};return function(){return this.$root._vueMeta?{getOptions:function(){return function(t){var e={};for(var n in t)e[n]=t[n];return e}(t)},refresh:e.bind(this),inject:n,pause:w.bind(this),resume:S.bind(this)}:{getOptions:m,refresh:m,inject:m,pause:m,resume:m}}}(e),t.mixin(function(t,e){var r=["activated","deactivated","beforeMount"];return{beforeCreate:function(){var i=this;if(Object.defineProperty(this,"_hasMetaInfo",{configurable:!0,get:function(){return t.config.devtools&&!this.$root._vueMeta.hasMetaInfoDeprecationWarningShown&&(p("VueMeta DeprecationWarning: _hasMetaInfo has been deprecated and will be removed in a future version. Please use hasMetaInfo(vm) instead"),this.$root._vueMeta.hasMetaInfoDeprecationWarningShown=!0),d(this)}}),!a(this.$options[e.keyName])&&null!==this.$options[e.keyName]){if(this.$root._vueMeta||(this.$root._vueMeta={appId:y},y++),!this._vueMeta){this._vueMeta=!0;for(var o=this.$parent;o&&o!==this.$root;)a(o._vueMeta)&&(o._vueMeta=!1),o=o.$parent}c(this.$options[e.keyName])&&(this.$options.computed||(this.$options.computed={}),this.$options.computed.$metaInfo=this.$options[e.keyName],this.$isServer||f(this.$options,"created",function(){i.$watch("$metaInfo",function(){i.__metaInfo=void 0,n(i,"watcher")})})),a(this.$root._vueMeta.initialized)&&(this.$root._vueMeta.initialized=this.$isServer,this.$root._vueMeta.initialized||(f(this.$options,"beforeMount",function(){i.$root.$el&&i.$root.$el.hasAttribute&&i.$root.$el.hasAttribute("data-server-rendered")&&(i.$root._vueMeta.appId=e.ssrAppId)}),f(this.$options,"mounted",function(){i.$root._vueMeta.initialized||(i.$root._vueMeta.initializing=!0,i.$nextTick(function(){var t=this,r=this.$root.$meta().refresh(),i=r.tags,o=r.metaInfo;!1===i&&null===this.$root._vueMeta.initialized&&this.$nextTick(function(){return n(t,"initializing")}),this.$root._vueMeta.initialized=!0,delete this.$root._vueMeta.initializing,!e.refreshOnceOnNavigation&&o.afterNavigation&&v(this)}))}),e.refreshOnceOnNavigation&&v(this))),this.$isServer||r.forEach(function(t){f(i.$options,t,function(){return n(i,t)})})}},destroyed:function(){var t=this;if(!this.$isServer&&this.$parent&&d(this))var e=setInterval(function(){t.$el&&null!==t.$el.offsetParent||(clearInterval(e),n(t,"destroyed"))},50)}}}(t,e)))}a(window)||a(window.Vue)||J(window.Vue);var F={version:"2.2.2",install:J,hasMetaInfo:d};export default F; diff --git a/dist/vue-meta.esm.js b/dist/vue-meta.esm.js index 9b2f46f..f059dfc 100644 --- a/dist/vue-meta.esm.js +++ b/dist/vue-meta.esm.js @@ -1,5 +1,5 @@ /** - * vue-meta v2.2.1 + * vue-meta v2.2.2 * (c) 2019 * - Declan de Wet * - Sébastien Chopin (@Atinux) @@ -9,7 +9,7 @@ import deepmerge from 'deepmerge'; -var version = "2.2.1"; +var version = "2.2.2"; // store an id to keep track of DOM updates var batchId = null; @@ -236,137 +236,145 @@ function createMixin(Vue, options) { // _vnode is used to know that it's attached to a real component // useful if we use some mixin to add some meta tags (like nuxt-i18n) - if (!isUndefined(this.$options[options.keyName]) && this.$options[options.keyName] !== null) { - if (!this.$root._vueMeta) { - this.$root._vueMeta = { - appId: appId - }; - appId++; - } // to speed up updates we keep track of branches which have a component with vue-meta info defined - // if _vueMeta = true it has info, if _vueMeta = false a child has info + if (isUndefined(this.$options[options.keyName]) || this.$options[options.keyName] === null) { + return; + } + + if (!this.$root._vueMeta) { + this.$root._vueMeta = { + appId: appId + }; + appId++; + } // to speed up updates we keep track of branches which have a component with vue-meta info defined + // if _vueMeta = true it has info, if _vueMeta = false a child has info - if (!this._vueMeta) { - this._vueMeta = true; - var p = this.$parent; + if (!this._vueMeta) { + this._vueMeta = true; + var p = this.$parent; - while (p && p !== this.$root) { - if (isUndefined(p._vueMeta)) { - p._vueMeta = false; - } - - p = p.$parent; - } - } // coerce function-style metaInfo to a computed prop so we can observe - // it on creation - - - if (isFunction(this.$options[options.keyName])) { - if (!this.$options.computed) { - this.$options.computed = {}; + while (p && p !== this.$root) { + if (isUndefined(p._vueMeta)) { + p._vueMeta = false; } - this.$options.computed.$metaInfo = this.$options[options.keyName]; - - if (!this.$isServer) { - // if computed $metaInfo exists, watch it for updates & trigger a refresh - // when it changes (i.e. automatically handle async actions that affect metaInfo) - // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux) - ensuredPush(this.$options, 'created', function () { - _this.$watch('$metaInfo', function () { - triggerUpdate(this, 'watcher'); - }); - }); - } - } // force an initial refresh on page load and prevent other lifecycleHooks - // to triggerUpdate until this initial refresh is finished - // this is to make sure that when a page is opened in an inactive tab which - // has throttled rAF/timers we still immediately set the page title + p = p.$parent; + } + } // coerce function-style metaInfo to a computed prop so we can observe + // it on creation - if (isUndefined(this.$root._vueMeta.initialized)) { - this.$root._vueMeta.initialized = this.$isServer; - - if (!this.$root._vueMeta.initialized) { - ensuredPush(this.$options, 'beforeMount', function () { - // if this Vue-app was server rendered, set the appId to 'ssr' - // only one SSR app per page is supported - if (_this.$root.$el && _this.$root.$el.hasAttribute && _this.$root.$el.hasAttribute('data-server-rendered')) { - _this.$root._vueMeta.appId = options.ssrAppId; - } - }); // we use the mounted hook here as on page load - - ensuredPush(this.$options, 'mounted', function () { - if (!_this.$root._vueMeta.initialized) { - // used in triggerUpdate to check if a change was triggered - // during initialization - _this.$root._vueMeta.initializing = true; // refresh meta in nextTick so all child components have loaded - - _this.$nextTick(function () { - var _this2 = this; - - var _this$$root$$meta$ref = this.$root.$meta().refresh(), - tags = _this$$root$$meta$ref.tags, - metaInfo = _this$$root$$meta$ref.metaInfo; // After ssr hydration (identifier by tags === false) check - // if initialized was set to null in triggerUpdate. That'd mean - // that during initilazation changes where triggered which need - // to be applied OR a metaInfo watcher was triggered before the - // current hook was called - // (during initialization all changes are blocked) - - - if (tags === false && this.$root._vueMeta.initialized === null) { - this.$nextTick(function () { - return triggerUpdate(_this2, 'initializing'); - }); - } - - this.$root._vueMeta.initialized = true; - delete this.$root._vueMeta.initializing; // add the navigation guards if they havent been added yet - // they are needed for the afterNavigation callback - - if (!options.refreshOnceOnNavigation && metaInfo.afterNavigation) { - addNavGuards(this); - } - }); - } - }); // add the navigation guards if requested - - if (options.refreshOnceOnNavigation) { - addNavGuards(this); - } - } - } // do not trigger refresh on the server side + if (isFunction(this.$options[options.keyName])) { + if (!this.$options.computed) { + this.$options.computed = {}; + } + this.$options.computed.$metaInfo = this.$options[options.keyName]; if (!this.$isServer) { - // no need to add this hooks on server side - updateOnLifecycleHook.forEach(function (lifecycleHook) { - ensuredPush(_this.$options, lifecycleHook, function () { - return triggerUpdate(_this, lifecycleHook); + // if computed $metaInfo exists, watch it for updates & trigger a refresh + // when it changes (i.e. automatically handle async actions that affect metaInfo) + // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux) + ensuredPush(this.$options, 'created', function () { + _this.$watch('$metaInfo', function () { + _this.__metaInfo = undefined; + triggerUpdate(_this, 'watcher'); }); - }); // re-render meta data when returning from a child component to parent - - ensuredPush(this.$options, 'destroyed', function () { - // Wait that element is hidden before refreshing meta tags (to support animations) - var interval = setInterval(function () { - if (_this.$el && _this.$el.offsetParent !== null) { - /* istanbul ignore next line */ - return; - } - - clearInterval(interval); - - if (!_this.$parent) { - /* istanbul ignore next line */ - return; - } - - triggerUpdate(_this, 'destroyed'); - }, 50); }); } - } + } // force an initial refresh on page load and prevent other lifecycleHooks + // to triggerUpdate until this initial refresh is finished + // this is to make sure that when a page is opened in an inactive tab which + // has throttled rAF/timers we still immediately set the page title + + + if (isUndefined(this.$root._vueMeta.initialized)) { + this.$root._vueMeta.initialized = this.$isServer; + + if (!this.$root._vueMeta.initialized) { + ensuredPush(this.$options, 'beforeMount', function () { + // if this Vue-app was server rendered, set the appId to 'ssr' + // only one SSR app per page is supported + if (_this.$root.$el && _this.$root.$el.hasAttribute && _this.$root.$el.hasAttribute('data-server-rendered')) { + _this.$root._vueMeta.appId = options.ssrAppId; + } + }); // we use the mounted hook here as on page load + + ensuredPush(this.$options, 'mounted', function () { + if (!_this.$root._vueMeta.initialized) { + // used in triggerUpdate to check if a change was triggered + // during initialization + _this.$root._vueMeta.initializing = true; // refresh meta in nextTick so all child components have loaded + + _this.$nextTick(function () { + var _this2 = this; + + var _this$$root$$meta$ref = this.$root.$meta().refresh(), + tags = _this$$root$$meta$ref.tags, + metaInfo = _this$$root$$meta$ref.metaInfo; // After ssr hydration (identifier by tags === false) check + // if initialized was set to null in triggerUpdate. That'd mean + // that during initilazation changes where triggered which need + // to be applied OR a metaInfo watcher was triggered before the + // current hook was called + // (during initialization all changes are blocked) + + + if (tags === false && this.$root._vueMeta.initialized === null) { + this.$nextTick(function () { + return triggerUpdate(_this2, 'initializing'); + }); + } + + this.$root._vueMeta.initialized = true; + delete this.$root._vueMeta.initializing; // add the navigation guards if they havent been added yet + // they are needed for the afterNavigation callback + + if (!options.refreshOnceOnNavigation && metaInfo.afterNavigation) { + addNavGuards(this); + } + }); + } + }); // add the navigation guards if requested + + if (options.refreshOnceOnNavigation) { + addNavGuards(this); + } + } + } // do not trigger refresh on the server side + + + if (this.$isServer) { + return; + } // no need to add this hooks on server side + + + updateOnLifecycleHook.forEach(function (lifecycleHook) { + ensuredPush(_this.$options, lifecycleHook, function () { + return triggerUpdate(_this, lifecycleHook); + }); + }); + }, + // TODO: move back into beforeCreate when Vue issue is resolved + destroyed: function destroyed() { + var _this3 = this; + + // do not trigger refresh: + // - on the server side + // - when the component doesnt have a parent + // - doesnt have metaInfo defined + if (this.$isServer || !this.$parent || !hasMetaInfo(this)) { + return; + } // Wait that element is hidden before refreshing meta tags (to support animations) + + + var interval = setInterval(function () { + if (_this3.$el && _this3.$el.offsetParent !== null) { + return; + } + + clearInterval(interval); + triggerUpdate(_this3, 'destroyed'); + }, 50); } }; } diff --git a/dist/vue-meta.js b/dist/vue-meta.js index ac530c2..321f8c7 100644 --- a/dist/vue-meta.js +++ b/dist/vue-meta.js @@ -1,5 +1,5 @@ /** - * vue-meta v2.2.1 + * vue-meta v2.2.2 * (c) 2019 * - Declan de Wet * - Sébastien Chopin (@Atinux) @@ -13,7 +13,7 @@ (global = global || self, global.VueMeta = factory()); }(this, function () { 'use strict'; - var version = "2.2.1"; + var version = "2.2.2"; // store an id to keep track of DOM updates var batchId = null; @@ -223,137 +223,145 @@ // _vnode is used to know that it's attached to a real component // useful if we use some mixin to add some meta tags (like nuxt-i18n) - if (!isUndefined(this.$options[options.keyName]) && this.$options[options.keyName] !== null) { - if (!this.$root._vueMeta) { - this.$root._vueMeta = { - appId: appId - }; - appId++; - } // to speed up updates we keep track of branches which have a component with vue-meta info defined - // if _vueMeta = true it has info, if _vueMeta = false a child has info + if (isUndefined(this.$options[options.keyName]) || this.$options[options.keyName] === null) { + return; + } + + if (!this.$root._vueMeta) { + this.$root._vueMeta = { + appId: appId + }; + appId++; + } // to speed up updates we keep track of branches which have a component with vue-meta info defined + // if _vueMeta = true it has info, if _vueMeta = false a child has info - if (!this._vueMeta) { - this._vueMeta = true; - var p = this.$parent; + if (!this._vueMeta) { + this._vueMeta = true; + var p = this.$parent; - while (p && p !== this.$root) { - if (isUndefined(p._vueMeta)) { - p._vueMeta = false; - } - - p = p.$parent; - } - } // coerce function-style metaInfo to a computed prop so we can observe - // it on creation - - - if (isFunction(this.$options[options.keyName])) { - if (!this.$options.computed) { - this.$options.computed = {}; + while (p && p !== this.$root) { + if (isUndefined(p._vueMeta)) { + p._vueMeta = false; } - this.$options.computed.$metaInfo = this.$options[options.keyName]; - - if (!this.$isServer) { - // if computed $metaInfo exists, watch it for updates & trigger a refresh - // when it changes (i.e. automatically handle async actions that affect metaInfo) - // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux) - ensuredPush(this.$options, 'created', function () { - _this.$watch('$metaInfo', function () { - triggerUpdate(this, 'watcher'); - }); - }); - } - } // force an initial refresh on page load and prevent other lifecycleHooks - // to triggerUpdate until this initial refresh is finished - // this is to make sure that when a page is opened in an inactive tab which - // has throttled rAF/timers we still immediately set the page title + p = p.$parent; + } + } // coerce function-style metaInfo to a computed prop so we can observe + // it on creation - if (isUndefined(this.$root._vueMeta.initialized)) { - this.$root._vueMeta.initialized = this.$isServer; - - if (!this.$root._vueMeta.initialized) { - ensuredPush(this.$options, 'beforeMount', function () { - // if this Vue-app was server rendered, set the appId to 'ssr' - // only one SSR app per page is supported - if (_this.$root.$el && _this.$root.$el.hasAttribute && _this.$root.$el.hasAttribute('data-server-rendered')) { - _this.$root._vueMeta.appId = options.ssrAppId; - } - }); // we use the mounted hook here as on page load - - ensuredPush(this.$options, 'mounted', function () { - if (!_this.$root._vueMeta.initialized) { - // used in triggerUpdate to check if a change was triggered - // during initialization - _this.$root._vueMeta.initializing = true; // refresh meta in nextTick so all child components have loaded - - _this.$nextTick(function () { - var _this2 = this; - - var _this$$root$$meta$ref = this.$root.$meta().refresh(), - tags = _this$$root$$meta$ref.tags, - metaInfo = _this$$root$$meta$ref.metaInfo; // After ssr hydration (identifier by tags === false) check - // if initialized was set to null in triggerUpdate. That'd mean - // that during initilazation changes where triggered which need - // to be applied OR a metaInfo watcher was triggered before the - // current hook was called - // (during initialization all changes are blocked) - - - if (tags === false && this.$root._vueMeta.initialized === null) { - this.$nextTick(function () { - return triggerUpdate(_this2, 'initializing'); - }); - } - - this.$root._vueMeta.initialized = true; - delete this.$root._vueMeta.initializing; // add the navigation guards if they havent been added yet - // they are needed for the afterNavigation callback - - if (!options.refreshOnceOnNavigation && metaInfo.afterNavigation) { - addNavGuards(this); - } - }); - } - }); // add the navigation guards if requested - - if (options.refreshOnceOnNavigation) { - addNavGuards(this); - } - } - } // do not trigger refresh on the server side + if (isFunction(this.$options[options.keyName])) { + if (!this.$options.computed) { + this.$options.computed = {}; + } + this.$options.computed.$metaInfo = this.$options[options.keyName]; if (!this.$isServer) { - // no need to add this hooks on server side - updateOnLifecycleHook.forEach(function (lifecycleHook) { - ensuredPush(_this.$options, lifecycleHook, function () { - return triggerUpdate(_this, lifecycleHook); + // if computed $metaInfo exists, watch it for updates & trigger a refresh + // when it changes (i.e. automatically handle async actions that affect metaInfo) + // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux) + ensuredPush(this.$options, 'created', function () { + _this.$watch('$metaInfo', function () { + _this.__metaInfo = undefined; + triggerUpdate(_this, 'watcher'); }); - }); // re-render meta data when returning from a child component to parent - - ensuredPush(this.$options, 'destroyed', function () { - // Wait that element is hidden before refreshing meta tags (to support animations) - var interval = setInterval(function () { - if (_this.$el && _this.$el.offsetParent !== null) { - /* istanbul ignore next line */ - return; - } - - clearInterval(interval); - - if (!_this.$parent) { - /* istanbul ignore next line */ - return; - } - - triggerUpdate(_this, 'destroyed'); - }, 50); }); } - } + } // force an initial refresh on page load and prevent other lifecycleHooks + // to triggerUpdate until this initial refresh is finished + // this is to make sure that when a page is opened in an inactive tab which + // has throttled rAF/timers we still immediately set the page title + + + if (isUndefined(this.$root._vueMeta.initialized)) { + this.$root._vueMeta.initialized = this.$isServer; + + if (!this.$root._vueMeta.initialized) { + ensuredPush(this.$options, 'beforeMount', function () { + // if this Vue-app was server rendered, set the appId to 'ssr' + // only one SSR app per page is supported + if (_this.$root.$el && _this.$root.$el.hasAttribute && _this.$root.$el.hasAttribute('data-server-rendered')) { + _this.$root._vueMeta.appId = options.ssrAppId; + } + }); // we use the mounted hook here as on page load + + ensuredPush(this.$options, 'mounted', function () { + if (!_this.$root._vueMeta.initialized) { + // used in triggerUpdate to check if a change was triggered + // during initialization + _this.$root._vueMeta.initializing = true; // refresh meta in nextTick so all child components have loaded + + _this.$nextTick(function () { + var _this2 = this; + + var _this$$root$$meta$ref = this.$root.$meta().refresh(), + tags = _this$$root$$meta$ref.tags, + metaInfo = _this$$root$$meta$ref.metaInfo; // After ssr hydration (identifier by tags === false) check + // if initialized was set to null in triggerUpdate. That'd mean + // that during initilazation changes where triggered which need + // to be applied OR a metaInfo watcher was triggered before the + // current hook was called + // (during initialization all changes are blocked) + + + if (tags === false && this.$root._vueMeta.initialized === null) { + this.$nextTick(function () { + return triggerUpdate(_this2, 'initializing'); + }); + } + + this.$root._vueMeta.initialized = true; + delete this.$root._vueMeta.initializing; // add the navigation guards if they havent been added yet + // they are needed for the afterNavigation callback + + if (!options.refreshOnceOnNavigation && metaInfo.afterNavigation) { + addNavGuards(this); + } + }); + } + }); // add the navigation guards if requested + + if (options.refreshOnceOnNavigation) { + addNavGuards(this); + } + } + } // do not trigger refresh on the server side + + + if (this.$isServer) { + return; + } // no need to add this hooks on server side + + + updateOnLifecycleHook.forEach(function (lifecycleHook) { + ensuredPush(_this.$options, lifecycleHook, function () { + return triggerUpdate(_this, lifecycleHook); + }); + }); + }, + // TODO: move back into beforeCreate when Vue issue is resolved + destroyed: function destroyed() { + var _this3 = this; + + // do not trigger refresh: + // - on the server side + // - when the component doesnt have a parent + // - doesnt have metaInfo defined + if (this.$isServer || !this.$parent || !hasMetaInfo(this)) { + return; + } // Wait that element is hidden before refreshing meta tags (to support animations) + + + var interval = setInterval(function () { + if (_this3.$el && _this3.$el.offsetParent !== null) { + return; + } + + clearInterval(interval); + triggerUpdate(_this3, 'destroyed'); + }, 50); } }; } diff --git a/dist/vue-meta.min.js b/dist/vue-meta.min.js index 7eed458..ed4a86e 100644 --- a/dist/vue-meta.min.js +++ b/dist/vue-meta.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).VueMeta=t()}(this,function(){"use strict";var e=null;function t(t,n){t.$root._vueMeta.initialized||!t.$root._vueMeta.initializing&&"watcher"!==n||(t.$root._vueMeta.initialized=null),t.$root._vueMeta.initialized&&!t.$root._vueMeta.paused&&function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;clearTimeout(e),e=setTimeout(function(){t()},n)}(function(){return t.$meta().refresh()})}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e){return Array.isArray(e)}function i(e){return void 0===e}function a(e){return"object"===n(e)}function u(e){return"object"===n(e)&&null!==e}function c(e){return"function"==typeof e}function s(e,t){return t&&a(e)?(o(e[t])||(e[t]=[]),e):o(e)?e:[]}function f(e,t,n){s(e,t),e[t].push(n)}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return e&&(!0===e._vueMeta||a(e._vueMeta))}function d(e){if(!e.$root._vueMeta.navGuards&&e.$root.$router){e.$root._vueMeta.navGuards=!0;var t=e.$root.$router,n=e.$root.$meta();t.beforeEach(function(e,t,r){n.pause(),r()}),t.afterEach(function(){var e=n.resume().metaInfo;e&&e.afterNavigation&&c(e.afterNavigation)&&e.afterNavigation(e)})}}var v=(function(){try{return!i(window)}catch(e){return!1}}()?window:global).console||{};function h(e){v&&v.warn&&v.warn(e)}var p=function(){return h("This vue app/component has no vue-meta configuration")},m=1;var y={title:void 0,titleChunk:"",titleTemplate:"%s",htmlAttrs:{},bodyAttrs:{},headAttrs:{},base:[],link:[],meta:[],style:[],script:[],noscript:[],__dangerouslyDisableSanitizers:[],__dangerouslyDisableSanitizersByTagID:{}},g={keyName:"metaInfo",attribute:"data-vue-meta",ssrAttribute:"data-vue-meta-server-rendered",tagIDKeyName:"vmid",contentKeyName:"content",metaTemplateKeyName:"template",ssrAppId:"ssr"},b=["titleChunk","titleTemplate","changed","__dangerouslyDisableSanitizers","__dangerouslyDisableSanitizersByTagID"],$=["__dangerouslyDisableSanitizers","__dangerouslyDisableSanitizersByTagID"],_=["htmlAttrs","headAttrs","bodyAttrs"],M=["link","style","script"],A=["once","template"],T=["body","pbody"],w=["allowfullscreen","amp","async","autofocus","autoplay","checked","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","defer","disabled","enabled","formnovalidate","hidden","indeterminate","inert","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","pauseonexit","readonly","required","reversed","scoped","seamless","selected","sortable","truespeed","typemustmatch","visible"];function I(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$root._vueMeta.paused=!0,function(){return N(e)}}function N(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.$root._vueMeta.paused=!1,e)return this.$root.$meta().refresh()}function O(e,t){if(!Array.prototype.findIndex){for(var n=0;n/g,">"],[/"/g,'"'],[/'/g,"'"]];function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i={doEscape:function(e){return n.reduce(function(e,t){var n=r(t,2),o=n[0],i=n[1];return e.replace(o,i)},e)}};return $.forEach(function(e,n){if(0===n)s(t,e);else if(1===n)for(var r in t[e])s(t[e],r);i[e]=t[e]}),function e(t,n,i,a){var c=n.tagIDKeyName,s=i.doEscape,f=void 0===s?function(e){return e}:s,l={};for(var d in t){var v=t[d];if(E(b,d))l[d]=v;else{var h=r($,1)[0];if(i[h]&&E(i[h],d))l[d]=v;else{var p=t[c];if(p&&(h=$[1],i[h]&&i[h][p]&&E(i[h][p],d)))l[d]=v;else if("string"==typeof v?l[d]=f(v):o(v)?l[d]=v.map(function(t){return u(t)?e(t,n,i,!0):f(t)}):u(v)?l[d]=e(v,n,i,!0):l[d]=v,a){var m=f(d);d!==m&&(l[m]=l[d],delete l[d])}}}}return l}(t,e,i)}var D=function(e){return function(e){return!!e&&"object"===n(e)}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===z}(e)}(e)};var z="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function K(e,t){return!1!==t.clone&&t.isMergeableObject(e)?L((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function x(e,t,n){return e.concat(t).map(function(e){return K(e,n)})}function P(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function C(e,t,n){var r={};return n.isMergeableObject(e)&&P(e).forEach(function(t){r[t]=K(e[t],n)}),P(t).forEach(function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=function(e,t){if(!t.customMerge)return L;var n=t.customMerge(e);return"function"==typeof n?n:L}(o,n)(e[o],t[o],n):r[o]=K(t[o],n)}),r}function L(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||x,n.isMergeableObject=n.isMergeableObject||D;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):C(e,t,n):K(t,n)}L.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return L(e,n,t)},{})};var H=L;function B(e,t,n,r){var o=e.component,a=e.metaTemplateKeyName,u=e.contentKeyName;return!0!==n&&!0!==t[a]&&(i(n)&&t[a]&&(n=t[a],t[a]=!0),n?(i(r)&&(r=t[u]),t[u]=c(n)?n.call(o,r):n.replace(/%s/g,r),!0):(t.hasOwnProperty(a)&&delete t[a],!1))}function V(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.hasOwnProperty("title")&&void 0===t.title&&delete t.title,_.forEach(function(e){if(t[e])for(var n in t[e])t[e].hasOwnProperty(n)&&void 0===t[e][n]&&(E(w,n)&&h("VueMeta: Please note that since v2 the value undefined is not used to indicate boolean attributes anymore, see migration guide for details"),delete t[e][n])}),H(e,t,{arrayMerge:function(e,t){return function(e,t,n){var r=e.component,o=e.tagIDKeyName,i=e.metaTemplateKeyName,a=e.contentKeyName,u=[];return t.length||n.length?(t.forEach(function(e,t){if(e[o]){var c=O(n,function(t){return t[o]===e[o]}),s=n[c];if(-1!==c){if(s.hasOwnProperty(a)&&void 0===s[a]||s.hasOwnProperty("innerHTML")&&void 0===s.innerHTML)return u.push(e),void n.splice(c,1);if(null!==s[a]&&null!==s.innerHTML){var f=e[i];if(f){if(!s[i])return B({component:r,metaTemplateKeyName:i,contentKeyName:a},s,f),void(s.template=!0);s[a]||B({component:r,metaTemplateKeyName:i,contentKeyName:a},s,void 0,e[a])}}else n.splice(c,1)}else u.push(e)}else u.push(e)}),u.concat(n)):u}(n,e,t)}})}function q(){return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n=arguments.length>1?arguments[1]:void 0;var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o=t.keyName;var u=n.$options,s=n.$children;if(n._inactive)return r;if(u[o]){var f=u[o];if(c(f)&&(f=f.call(n)),!a(f))return r;r=V(r,f,t)}s.length&&s.forEach(function(n){(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return e&&!i(e._vueMeta)})(n)&&(r=e(t,n,r))});return r}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0,y)}function W(e,t){return e[t]||(e[t]=document.getElementsByTagName(t)[0]),e[t]}function G(e,t){var n=t.appId,r=t.attribute,o=t.type,i=t.tagIDKeyName,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=["".concat(o,"[").concat(r,'="').concat(n,'"]'),"".concat(o,"[data-").concat(i,"]")].map(function(e){for(var t in a){var n=a[t],r=n&&!0!==n?'="'.concat(n,'"'):"";e+="[data-".concat(t).concat(r,"]")}return e});return S(e.querySelectorAll(u.join(", ")))}var J=[];function R(e,t,n,r){var o=e.tagIDKeyName,i=!1;return n.forEach(function(e){e[o]&&e.callback&&(i=!0,function(e,t){1===arguments.length&&(t=e,e=""),J.push([e,t])}("".concat(t,"[data-").concat(o,'="').concat(e[o],'"]'),e.callback))}),r&&i?F():i}function F(){!function(){return"complete"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).readyState}()?document.onreadystatechange=function(){Q()}:Q()}function Q(e){J.forEach(function(t){var n=r(t,2),o=n[0],i=n[1],a="".concat(o,'[onload="this.__vm_l=1"]'),u=[];e||(u=S(document.querySelectorAll(a))),e&&e.matches(a)&&(u=[e]),u.forEach(function(e){if(!e.__vm_cb){var t=function(){e.__vm_cb=!0,e.removeAttribute("onload"),i(e)};e.__vm_l?t():e.__vm_ev||(e.__vm_ev=!0,e.addEventListener("load",t))}})})}function U(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).attribute,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=n.getAttribute(e),i=r?r.split(","):[],a=S(i),u=[];for(var c in t)if(t.hasOwnProperty(c)){var s=E(w,c)?"":o(t[c])?t[c].join(" "):t[c];n.setAttribute(c,s||""),E(i,c)||i.push(c),u.push(a.indexOf(c))}var f=a.filter(function(e,t){return!E(u,t)}).reduce(function(e,t){return n.removeAttribute(t),e+1},0);i.length===f?n.removeAttribute(e):n.setAttribute(e,i.sort().join(","))}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,a=t.attribute,u=t.tagIDKeyName,c=T.slice();c.push(u);var s=[],f={appId:e,attribute:a,type:n,tagIDKeyName:u},l={head:G(o,f),pbody:G(i,f,{pbody:!0}),body:G(i,f,{body:!0})};if(r.length>1){var d=[];r=r.filter(function(e){var t=JSON.stringify(e),n=!E(d,t);return d.push(t),n})}r.forEach(function(t){if(!t.skip){var r=document.createElement(n);r.setAttribute(a,e);var o=function(e){if(!t.hasOwnProperty(e)||E(A,e))return"continue";if("innerHTML"===e)return r.innerHTML=t.innerHTML,"continue";if("json"===e)return r.innerHTML=JSON.stringify(t.json),"continue";if("cssText"===e)return r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText)),"continue";if("callback"===e)return r.onload=function(){return t[e](r)},"continue";var n=E(c,e)?"data-".concat(e):e,o=E(w,e);if(o&&!t[e])return"continue";var i=o?"":t[e];r.setAttribute(n,i)};for(var i in t)o(i);var u,f=l[function(e){var t=e.body,n=e.pbody;return t?"body":n?"pbody":"head"}(t)];f.some(function(e,t){return u=t,r.isEqualNode(e)})&&(u||0===u)?f.splice(u,1):s.push(r)}});var v=[];for(var h in l)Array.prototype.push.apply(v,l[h]);return v.forEach(function(e){e.parentNode.removeChild(e)}),s.forEach(function(e){e.hasAttribute("data-body")?i.appendChild(e):e.hasAttribute("data-pbody")?i.insertBefore(e,i.firstChild):o.appendChild(e)}),{oldTags:v,newTags:s}}function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(){var t=q(e,this.$root),n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,o=e.tagIDKeyName;return t.title&&(t.titleChunk=t.title),t.titleTemplate&&"%s"!==t.titleTemplate&&B({component:r,contentKeyName:"title"},t,t.titleTemplate,t.titleChunk||""),t.base&&(t.base=Object.keys(t.base).length?[t.base]:[]),t.meta&&(t.meta=t.meta.filter(function(e,t,n){return!e.hasOwnProperty(o)||t===O(n,function(t){return t[o]===e[o]})}),t.meta.forEach(function(t){return B(e,t)})),k(e,t,n)}(e,t,j,this.$root),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.ssrAttribute,i=t.ssrAppId,a={},u=W(a,"html");if(e===i&&u.hasAttribute(r)){u.removeAttribute(r);var c=!1;return M.forEach(function(e){n[e]&&R(t,e,n[e])&&(c=!0)}),c&&F(),!1}var s,f={},l={};for(var d in n)if(!E(b,d))if("title"!==d){if(E(_,d)){var v=d.substr(0,4);U(t,n[d],W(a,v))}else if(o(n[d])){var h=X(e,t,d,n[d],W(a,"head"),W(a,"body")),p=h.oldTags,m=h.newTags;m.length&&(f[d]=m,l[d]=p)}}else((s=n.title)||""===s)&&(document.title=s);return{addedTags:f,removedTags:l}}(this.$root._vueMeta.appId,e,n);return r&&c(n.changed)&&n.changed(n,r.addedTags,r.removedTags),{vm:this,metaInfo:n,tags:r}}}function Z(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.__vuemeta_installed||(e.__vuemeta_installed=!0,n=function(e){for(var t in e=a(e)?e:{},g)e[t]||(e[t]=g[t]);return e}(n),e.prototype.$meta=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Y(e),n=function(){};return function(){return this.$root._vueMeta?{getOptions:function(){return function(e){var t={};for(var n in e)t[n]=e[n];return t}(e)},refresh:t.bind(this),inject:n,pause:I.bind(this),resume:N.bind(this)}:{getOptions:p,refresh:p,inject:p,pause:p,resume:p}}}(n),e.mixin(function(e,n){var r=["activated","deactivated","beforeMount"];return{beforeCreate:function(){var o=this;if(Object.defineProperty(this,"_hasMetaInfo",{configurable:!0,get:function(){return e.config.devtools&&!this.$root._vueMeta.hasMetaInfoDeprecationWarningShown&&(h("VueMeta DeprecationWarning: _hasMetaInfo has been deprecated and will be removed in a future version. Please use hasMetaInfo(vm) instead"),this.$root._vueMeta.hasMetaInfoDeprecationWarningShown=!0),l(this)}}),!i(this.$options[n.keyName])&&null!==this.$options[n.keyName]){if(this.$root._vueMeta||(this.$root._vueMeta={appId:m},m++),!this._vueMeta){this._vueMeta=!0;for(var a=this.$parent;a&&a!==this.$root;)i(a._vueMeta)&&(a._vueMeta=!1),a=a.$parent}c(this.$options[n.keyName])&&(this.$options.computed||(this.$options.computed={}),this.$options.computed.$metaInfo=this.$options[n.keyName],this.$isServer||f(this.$options,"created",function(){o.$watch("$metaInfo",function(){t(this,"watcher")})})),i(this.$root._vueMeta.initialized)&&(this.$root._vueMeta.initialized=this.$isServer,this.$root._vueMeta.initialized||(f(this.$options,"beforeMount",function(){o.$root.$el&&o.$root.$el.hasAttribute&&o.$root.$el.hasAttribute("data-server-rendered")&&(o.$root._vueMeta.appId=n.ssrAppId)}),f(this.$options,"mounted",function(){o.$root._vueMeta.initialized||(o.$root._vueMeta.initializing=!0,o.$nextTick(function(){var e=this,r=this.$root.$meta().refresh(),o=r.tags,i=r.metaInfo;!1===o&&null===this.$root._vueMeta.initialized&&this.$nextTick(function(){return t(e,"initializing")}),this.$root._vueMeta.initialized=!0,delete this.$root._vueMeta.initializing,!n.refreshOnceOnNavigation&&i.afterNavigation&&d(this)}))}),n.refreshOnceOnNavigation&&d(this))),this.$isServer||(r.forEach(function(e){f(o.$options,e,function(){return t(o,e)})}),f(this.$options,"destroyed",function(){var e=setInterval(function(){o.$el&&null!==o.$el.offsetParent||(clearInterval(e),o.$parent&&t(o,"destroyed"))},50)}))}}}}(e,n)))}return i(window)||i(window.Vue)||Z(window.Vue),{version:"2.2.1",install:Z,hasMetaInfo:l}}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).VueMeta=t()}(this,function(){"use strict";var e=null;function t(t,n){t.$root._vueMeta.initialized||!t.$root._vueMeta.initializing&&"watcher"!==n||(t.$root._vueMeta.initialized=null),t.$root._vueMeta.initialized&&!t.$root._vueMeta.paused&&function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;clearTimeout(e),e=setTimeout(function(){t()},n)}(function(){return t.$meta().refresh()})}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e){return Array.isArray(e)}function i(e){return void 0===e}function a(e){return"object"===n(e)}function u(e){return"object"===n(e)&&null!==e}function c(e){return"function"==typeof e}function s(e,t){return t&&a(e)?(o(e[t])||(e[t]=[]),e):o(e)?e:[]}function f(e,t,n){s(e,t),e[t].push(n)}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return e&&(!0===e._vueMeta||a(e._vueMeta))}function d(e){if(!e.$root._vueMeta.navGuards&&e.$root.$router){e.$root._vueMeta.navGuards=!0;var t=e.$root.$router,n=e.$root.$meta();t.beforeEach(function(e,t,r){n.pause(),r()}),t.afterEach(function(){var e=n.resume().metaInfo;e&&e.afterNavigation&&c(e.afterNavigation)&&e.afterNavigation(e)})}}var v=(function(){try{return!i(window)}catch(e){return!1}}()?window:global).console||{};function h(e){v&&v.warn&&v.warn(e)}var p=function(){return h("This vue app/component has no vue-meta configuration")},m=1;var y={title:void 0,titleChunk:"",titleTemplate:"%s",htmlAttrs:{},bodyAttrs:{},headAttrs:{},base:[],link:[],meta:[],style:[],script:[],noscript:[],__dangerouslyDisableSanitizers:[],__dangerouslyDisableSanitizersByTagID:{}},g={keyName:"metaInfo",attribute:"data-vue-meta",ssrAttribute:"data-vue-meta-server-rendered",tagIDKeyName:"vmid",contentKeyName:"content",metaTemplateKeyName:"template",ssrAppId:"ssr"},b=["titleChunk","titleTemplate","changed","__dangerouslyDisableSanitizers","__dangerouslyDisableSanitizersByTagID"],$=["__dangerouslyDisableSanitizers","__dangerouslyDisableSanitizersByTagID"],_=["htmlAttrs","headAttrs","bodyAttrs"],M=["link","style","script"],A=["once","template"],T=["body","pbody"],I=["allowfullscreen","amp","async","autofocus","autoplay","checked","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","defer","disabled","enabled","formnovalidate","hidden","indeterminate","inert","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","pauseonexit","readonly","required","reversed","scoped","seamless","selected","sortable","truespeed","typemustmatch","visible"];function w(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$root._vueMeta.paused=!0,function(){return N(e)}}function N(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.$root._vueMeta.paused=!1,e)return this.$root.$meta().refresh()}function S(e,t){if(!Array.prototype.findIndex){for(var n=0;n/g,">"],[/"/g,'"'],[/'/g,"'"]];function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i={doEscape:function(e){return n.reduce(function(e,t){var n=r(t,2),o=n[0],i=n[1];return e.replace(o,i)},e)}};return $.forEach(function(e,n){if(0===n)s(t,e);else if(1===n)for(var r in t[e])s(t[e],r);i[e]=t[e]}),function e(t,n,i,a){var c=n.tagIDKeyName,s=i.doEscape,f=void 0===s?function(e){return e}:s,l={};for(var d in t){var v=t[d];if(E(b,d))l[d]=v;else{var h=r($,1)[0];if(i[h]&&E(i[h],d))l[d]=v;else{var p=t[c];if(p&&(h=$[1],i[h]&&i[h][p]&&E(i[h][p],d)))l[d]=v;else if("string"==typeof v?l[d]=f(v):o(v)?l[d]=v.map(function(t){return u(t)?e(t,n,i,!0):f(t)}):u(v)?l[d]=e(v,n,i,!0):l[d]=v,a){var m=f(d);d!==m&&(l[m]=l[d],delete l[d])}}}}return l}(t,e,i)}var D=function(e){return function(e){return!!e&&"object"===n(e)}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===z}(e)}(e)};var z="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function K(e,t){return!1!==t.clone&&t.isMergeableObject(e)?L((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function x(e,t,n){return e.concat(t).map(function(e){return K(e,n)})}function P(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function C(e,t,n){var r={};return n.isMergeableObject(e)&&P(e).forEach(function(t){r[t]=K(e[t],n)}),P(t).forEach(function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=function(e,t){if(!t.customMerge)return L;var n=t.customMerge(e);return"function"==typeof n?n:L}(o,n)(e[o],t[o],n):r[o]=K(t[o],n)}),r}function L(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||x,n.isMergeableObject=n.isMergeableObject||D;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):C(e,t,n):K(t,n)}L.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return L(e,n,t)},{})};var H=L;function B(e,t,n,r){var o=e.component,a=e.metaTemplateKeyName,u=e.contentKeyName;return!0!==n&&!0!==t[a]&&(i(n)&&t[a]&&(n=t[a],t[a]=!0),n?(i(r)&&(r=t[u]),t[u]=c(n)?n.call(o,r):n.replace(/%s/g,r),!0):(t.hasOwnProperty(a)&&delete t[a],!1))}function V(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.hasOwnProperty("title")&&void 0===t.title&&delete t.title,_.forEach(function(e){if(t[e])for(var n in t[e])t[e].hasOwnProperty(n)&&void 0===t[e][n]&&(E(I,n)&&h("VueMeta: Please note that since v2 the value undefined is not used to indicate boolean attributes anymore, see migration guide for details"),delete t[e][n])}),H(e,t,{arrayMerge:function(e,t){return function(e,t,n){var r=e.component,o=e.tagIDKeyName,i=e.metaTemplateKeyName,a=e.contentKeyName,u=[];return t.length||n.length?(t.forEach(function(e,t){if(e[o]){var c=S(n,function(t){return t[o]===e[o]}),s=n[c];if(-1!==c){if(s.hasOwnProperty(a)&&void 0===s[a]||s.hasOwnProperty("innerHTML")&&void 0===s.innerHTML)return u.push(e),void n.splice(c,1);if(null!==s[a]&&null!==s.innerHTML){var f=e[i];if(f){if(!s[i])return B({component:r,metaTemplateKeyName:i,contentKeyName:a},s,f),void(s.template=!0);s[a]||B({component:r,metaTemplateKeyName:i,contentKeyName:a},s,void 0,e[a])}}else n.splice(c,1)}else u.push(e)}else u.push(e)}),u.concat(n)):u}(n,e,t)}})}function q(){return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n=arguments.length>1?arguments[1]:void 0;var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o=t.keyName;var u=n.$options,s=n.$children;if(n._inactive)return r;if(u[o]){var f=u[o];if(c(f)&&(f=f.call(n)),!a(f))return r;r=V(r,f,t)}s.length&&s.forEach(function(n){(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return e&&!i(e._vueMeta)})(n)&&(r=e(t,n,r))});return r}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0,y)}function W(e,t){return e[t]||(e[t]=document.getElementsByTagName(t)[0]),e[t]}function G(e,t){var n=t.appId,r=t.attribute,o=t.type,i=t.tagIDKeyName,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=["".concat(o,"[").concat(r,'="').concat(n,'"]'),"".concat(o,"[data-").concat(i,"]")].map(function(e){for(var t in a){var n=a[t],r=n&&!0!==n?'="'.concat(n,'"'):"";e+="[data-".concat(t).concat(r,"]")}return e});return O(e.querySelectorAll(u.join(", ")))}var J=[];function R(e,t,n,r){var o=e.tagIDKeyName,i=!1;return n.forEach(function(e){e[o]&&e.callback&&(i=!0,function(e,t){1===arguments.length&&(t=e,e=""),J.push([e,t])}("".concat(t,"[data-").concat(o,'="').concat(e[o],'"]'),e.callback))}),r&&i?F():i}function F(){!function(){return"complete"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).readyState}()?document.onreadystatechange=function(){Q()}:Q()}function Q(e){J.forEach(function(t){var n=r(t,2),o=n[0],i=n[1],a="".concat(o,'[onload="this.__vm_l=1"]'),u=[];e||(u=O(document.querySelectorAll(a))),e&&e.matches(a)&&(u=[e]),u.forEach(function(e){if(!e.__vm_cb){var t=function(){e.__vm_cb=!0,e.removeAttribute("onload"),i(e)};e.__vm_l?t():e.__vm_ev||(e.__vm_ev=!0,e.addEventListener("load",t))}})})}function U(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).attribute,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=n.getAttribute(e),i=r?r.split(","):[],a=O(i),u=[];for(var c in t)if(t.hasOwnProperty(c)){var s=E(I,c)?"":o(t[c])?t[c].join(" "):t[c];n.setAttribute(c,s||""),E(i,c)||i.push(c),u.push(a.indexOf(c))}var f=a.filter(function(e,t){return!E(u,t)}).reduce(function(e,t){return n.removeAttribute(t),e+1},0);i.length===f?n.removeAttribute(e):n.setAttribute(e,i.sort().join(","))}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,a=t.attribute,u=t.tagIDKeyName,c=T.slice();c.push(u);var s=[],f={appId:e,attribute:a,type:n,tagIDKeyName:u},l={head:G(o,f),pbody:G(i,f,{pbody:!0}),body:G(i,f,{body:!0})};if(r.length>1){var d=[];r=r.filter(function(e){var t=JSON.stringify(e),n=!E(d,t);return d.push(t),n})}r.forEach(function(t){if(!t.skip){var r=document.createElement(n);r.setAttribute(a,e);var o=function(e){if(!t.hasOwnProperty(e)||E(A,e))return"continue";if("innerHTML"===e)return r.innerHTML=t.innerHTML,"continue";if("json"===e)return r.innerHTML=JSON.stringify(t.json),"continue";if("cssText"===e)return r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText)),"continue";if("callback"===e)return r.onload=function(){return t[e](r)},"continue";var n=E(c,e)?"data-".concat(e):e,o=E(I,e);if(o&&!t[e])return"continue";var i=o?"":t[e];r.setAttribute(n,i)};for(var i in t)o(i);var u,f=l[function(e){var t=e.body,n=e.pbody;return t?"body":n?"pbody":"head"}(t)];f.some(function(e,t){return u=t,r.isEqualNode(e)})&&(u||0===u)?f.splice(u,1):s.push(r)}});var v=[];for(var h in l)Array.prototype.push.apply(v,l[h]);return v.forEach(function(e){e.parentNode.removeChild(e)}),s.forEach(function(e){e.hasAttribute("data-body")?i.appendChild(e):e.hasAttribute("data-pbody")?i.insertBefore(e,i.firstChild):o.appendChild(e)}),{oldTags:v,newTags:s}}function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(){var t=q(e,this.$root),n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,o=e.tagIDKeyName;return t.title&&(t.titleChunk=t.title),t.titleTemplate&&"%s"!==t.titleTemplate&&B({component:r,contentKeyName:"title"},t,t.titleTemplate,t.titleChunk||""),t.base&&(t.base=Object.keys(t.base).length?[t.base]:[]),t.meta&&(t.meta=t.meta.filter(function(e,t,n){return!e.hasOwnProperty(o)||t===S(n,function(t){return t[o]===e[o]})}),t.meta.forEach(function(t){return B(e,t)})),k(e,t,n)}(e,t,j,this.$root),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.ssrAttribute,i=t.ssrAppId,a={},u=W(a,"html");if(e===i&&u.hasAttribute(r)){u.removeAttribute(r);var c=!1;return M.forEach(function(e){n[e]&&R(t,e,n[e])&&(c=!0)}),c&&F(),!1}var s,f={},l={};for(var d in n)if(!E(b,d))if("title"!==d){if(E(_,d)){var v=d.substr(0,4);U(t,n[d],W(a,v))}else if(o(n[d])){var h=X(e,t,d,n[d],W(a,"head"),W(a,"body")),p=h.oldTags,m=h.newTags;m.length&&(f[d]=m,l[d]=p)}}else((s=n.title)||""===s)&&(document.title=s);return{addedTags:f,removedTags:l}}(this.$root._vueMeta.appId,e,n);return r&&c(n.changed)&&n.changed(n,r.addedTags,r.removedTags),{vm:this,metaInfo:n,tags:r}}}function Z(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.__vuemeta_installed||(e.__vuemeta_installed=!0,n=function(e){for(var t in e=a(e)?e:{},g)e[t]||(e[t]=g[t]);return e}(n),e.prototype.$meta=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Y(e),n=function(){};return function(){return this.$root._vueMeta?{getOptions:function(){return function(e){var t={};for(var n in e)t[n]=e[n];return t}(e)},refresh:t.bind(this),inject:n,pause:w.bind(this),resume:N.bind(this)}:{getOptions:p,refresh:p,inject:p,pause:p,resume:p}}}(n),e.mixin(function(e,n){var r=["activated","deactivated","beforeMount"];return{beforeCreate:function(){var o=this;if(Object.defineProperty(this,"_hasMetaInfo",{configurable:!0,get:function(){return e.config.devtools&&!this.$root._vueMeta.hasMetaInfoDeprecationWarningShown&&(h("VueMeta DeprecationWarning: _hasMetaInfo has been deprecated and will be removed in a future version. Please use hasMetaInfo(vm) instead"),this.$root._vueMeta.hasMetaInfoDeprecationWarningShown=!0),l(this)}}),!i(this.$options[n.keyName])&&null!==this.$options[n.keyName]){if(this.$root._vueMeta||(this.$root._vueMeta={appId:m},m++),!this._vueMeta){this._vueMeta=!0;for(var a=this.$parent;a&&a!==this.$root;)i(a._vueMeta)&&(a._vueMeta=!1),a=a.$parent}c(this.$options[n.keyName])&&(this.$options.computed||(this.$options.computed={}),this.$options.computed.$metaInfo=this.$options[n.keyName],this.$isServer||f(this.$options,"created",function(){o.$watch("$metaInfo",function(){o.__metaInfo=void 0,t(o,"watcher")})})),i(this.$root._vueMeta.initialized)&&(this.$root._vueMeta.initialized=this.$isServer,this.$root._vueMeta.initialized||(f(this.$options,"beforeMount",function(){o.$root.$el&&o.$root.$el.hasAttribute&&o.$root.$el.hasAttribute("data-server-rendered")&&(o.$root._vueMeta.appId=n.ssrAppId)}),f(this.$options,"mounted",function(){o.$root._vueMeta.initialized||(o.$root._vueMeta.initializing=!0,o.$nextTick(function(){var e=this,r=this.$root.$meta().refresh(),o=r.tags,i=r.metaInfo;!1===o&&null===this.$root._vueMeta.initialized&&this.$nextTick(function(){return t(e,"initializing")}),this.$root._vueMeta.initialized=!0,delete this.$root._vueMeta.initializing,!n.refreshOnceOnNavigation&&i.afterNavigation&&d(this)}))}),n.refreshOnceOnNavigation&&d(this))),this.$isServer||r.forEach(function(e){f(o.$options,e,function(){return t(o,e)})})}},destroyed:function(){var e=this;if(!this.$isServer&&this.$parent&&l(this))var n=setInterval(function(){e.$el&&null!==e.$el.offsetParent||(clearInterval(n),t(e,"destroyed"))},50)}}}(e,n)))}return i(window)||i(window.Vue)||Z(window.Vue),{version:"2.2.2",install:Z,hasMetaInfo:l}}); diff --git a/package.json b/package.json index 4c10869..d91463d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-meta", - "version": "2.2.1", + "version": "2.2.2", "description": "Manage HTML metadata in Vue.js components with ssr support", "keywords": [ "attribute",