From 89cb577059ff4b7d850c316dd361a326ecb39f47 Mon Sep 17 00:00:00 2001 From: dizzy Date: Mon, 15 Nov 2021 05:00:13 -0800 Subject: [Vue] migrate notifications directive & service + UI.Notifications (#18225) * migrating RateFeature and ReviewLinks + adding AjaxHelper.fetch utility method (all untested) * get ratefeature component to work, modify matomodialog component to use v-model, add event parameters to createAngularAdapter, allow translate to use variadic args or one string array + rebuild * remove ratefeature angularjs files * rebuild + make vue mapping property optional in createANgularJsAdapter * migrate enrichedheadline and get to work * fix test * fix translate * fix another translate issue & migrate contentblock directive * fix anchor links, not including the "/" causes angularjs to fail (also on 4.x-dev) * update expected screenshots * fix ui test * fix some test failures * fix nested transclude issue * remove content block files * fix icon spacing that occurs due to angularjs inserting empty comments in between nodes while vue 3 does not * update some screenshots * update screenshot (actually fixes an alignment issue) * update screenshot * first pass at converting comparisons service/component * get new code to build and load without error in the UI * debugging * getting basic functionaltiy to work * Update _dataTable.twig * fix UI test failure + URL encoding/angularjs issue causing back button to not work * fix order of operations issue * built vue files * using ref in setup() is not needed to access this.$refs * Convert comparisons service angularjs tests to comparison store typescript tests. * migrate piwik-date-picker directive * migrate date range picker component (changed invalid date in input handling to just reset back to the previous date since it was easier in vue to do that) * migrate period-date-picker component (using composition api more when easier for migration) * convert piwik-expand-onclick directive to vue directive * migrate expand on hover directive to vue directive * fix variable reference * build * Add materialize-css @types and migrate piwik-dropdown-menu. * migrate focus-anywhere-but-here directive to vue directive * migrate focus-if directive * migrate menudropdown directive * forgot to remove old files * built vue files * first pass at migrating notification directive, notification service and parts of UI.Notification to Vue * rewrite URL handling to use computed properties in a URL store + do the same for other dependent data in the comparison store to allow vues to subscribe to the properties for changes to global state * fix some tests * some more fixes * more fixes + disallow modifications to MatomoUrl state * get angularjs unit tests to pass + fix a couple more issues * another fix * fix bad merge * self review + fixes * remove old fix as it may not be needed anymore * empty string is not a valid date + do not report invalid date exception just rethrow * update screenshots and try to fix random failure * use jquery $destroy event instead of scope one since the scope one is broadcasted * rangeChange event must be triggered once on mount * initialize startDateText/endDateText correctly * use jquery $destroy event instead of angularjs one * built vue files * fix menudropdown.directive.js reference * load vue in installation/updater & correctly make focusanywherebuthere stateful * correctly implement stateful directives for ExpandOnClick/ExpandOnHover * less tweak (angularjs comment removal) * fix submenu check * quick type fix * load vue in installation workflow * add broadcast.js to Installation workflow + do not fail in pk_translate if no translations are loaded * update expected screenshots (spacing of arrow changed because of angularjs comment no longer being there) * start moving Notification class code to notifications store * fix prop type * fix html escaping * built vue files * get toast and other transitions to work + fix broken toast * move all of notification.js to NotificationStore * wait for angular to be initialized to post events to avoid loading race condition * get scroll to notification to work + get initialization of notification groups to work * correct unmount + remove notifications service file * fix some test failures * re add accidentally removed (?) file * remove no longer needed file * Add CoreHome UMD in CoreUpdater/Installation. * self review * fix type + add default value * remove file from JS list * fix test * fix UI tests * set correct type in users manager notification and allow scope values to be transformed in createAngularAdapter * built vue files * get focus-if to work and remove debugging return; * rebuilt vue * built vue files Co-authored-by: sgiehl --- plugins/CoreHome/CoreHome.php | 6 +- .../notification/notification.controller.js | 34 -- .../notification/notification.directive.html | 8 - .../notification/notification.directive.js | 99 ---- .../notification/notification.directive.less | 69 --- .../angularjs/notification/notification.service.js | 53 -- .../reporting-menu/reportingmenu.controller.js | 2 +- plugins/CoreHome/javascripts/notification.js | 175 +----- plugins/CoreHome/stylesheets/vue-transitions.less | 16 + plugins/CoreHome/vue/dist/CoreHome.umd.js | 646 +++++++++++++++++++-- plugins/CoreHome/vue/dist/CoreHome.umd.min.js | 100 ++-- plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts | 13 +- .../CoreHome/vue/src/FocusIf/FocusIf.adapter.ts | 2 +- plugins/CoreHome/vue/src/FocusIf/FocusIf.ts | 26 +- .../CoreHome/vue/src/Menudropdown/Menudropdown.vue | 1 + .../vue/src/Notification/Notification.adapter.ts | 36 ++ .../vue/src/Notification/Notification.less | 83 +++ .../CoreHome/vue/src/Notification/Notification.vue | 145 +++++ .../vue/src/Notification/NotificationGroup.vue | 59 ++ .../Notification/Notifications.store.adapter.ts | 10 + .../vue/src/Notification/Notifications.store.ts | 275 +++++++++ plugins/CoreHome/vue/src/Notification/index.ts | 12 + plugins/CoreHome/vue/src/createAngularJsAdapter.ts | 13 +- plugins/CoreHome/vue/src/index.ts | 1 + 24 files changed, 1373 insertions(+), 511 deletions(-) delete mode 100644 plugins/CoreHome/angularjs/notification/notification.controller.js delete mode 100644 plugins/CoreHome/angularjs/notification/notification.directive.html delete mode 100644 plugins/CoreHome/angularjs/notification/notification.directive.js delete mode 100644 plugins/CoreHome/angularjs/notification/notification.directive.less delete mode 100644 plugins/CoreHome/angularjs/notification/notification.service.js create mode 100644 plugins/CoreHome/stylesheets/vue-transitions.less create mode 100644 plugins/CoreHome/vue/src/Notification/Notification.adapter.ts create mode 100644 plugins/CoreHome/vue/src/Notification/Notification.less create mode 100644 plugins/CoreHome/vue/src/Notification/Notification.vue create mode 100644 plugins/CoreHome/vue/src/Notification/NotificationGroup.vue create mode 100644 plugins/CoreHome/vue/src/Notification/Notifications.store.adapter.ts create mode 100644 plugins/CoreHome/vue/src/Notification/Notifications.store.ts create mode 100644 plugins/CoreHome/vue/src/Notification/index.ts (limited to 'plugins/CoreHome') diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index 731db3f565..4464aa1cd8 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -137,7 +137,7 @@ class CoreHome extends \Piwik\Plugin $stylesheets[] = "plugins/CoreHome/stylesheets/zen-mode.less"; $stylesheets[] = "plugins/CoreHome/stylesheets/layout.less"; $stylesheets[] = "plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.less"; - $stylesheets[] = "plugins/CoreHome/angularjs/notification/notification.directive.less"; + $stylesheets[] = "plugins/CoreHome/vue/src/Notification/Notification.less"; $stylesheets[] = "plugins/CoreHome/angularjs/quick-access/quick-access.directive.less"; $stylesheets[] = "plugins/CoreHome/stylesheets/selector.less"; $stylesheets[] = "plugins/CoreHome/angularjs/reporting-page/reportingpage.directive.less"; @@ -151,6 +151,7 @@ class CoreHome extends \Piwik\Plugin $stylesheets[] = "plugins/CoreHome/angularjs/sparkline/sparkline.component.less"; $stylesheets[] = "plugins/CoreHome/angularjs/field-array/field-array.directive.less"; $stylesheets[] = "plugins/CoreHome/vue/src/Comparisons/Comparisons.less"; + $stylesheets[] = "plugins/CoreHome/stylesheets/vue-transitions.less"; } public function getJsFiles(&$jsFiles) @@ -235,9 +236,6 @@ class CoreHome extends \Piwik\Plugin $jsFiles[] = "plugins/CoreHome/angularjs/content-intro/content-intro.directive.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/notification/notification.controller.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/notification/notification.directive.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/notification/notification.service.js"; $jsFiles[] = "plugins/CoreHome/angularjs/ajax-form/ajax-form.controller.js"; $jsFiles[] = "plugins/CoreHome/angularjs/ajax-form/ajax-form.directive.js"; diff --git a/plugins/CoreHome/angularjs/notification/notification.controller.js b/plugins/CoreHome/angularjs/notification/notification.controller.js deleted file mode 100644 index 80497e940f..0000000000 --- a/plugins/CoreHome/angularjs/notification/notification.controller.js +++ /dev/null @@ -1,34 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp').controller('NotificationController', NotificationController); - - NotificationController.$inject = ['piwikApi']; - - function NotificationController(piwikApi) { - /** - * Marks a persistent notification as read so it will not reappear on the next page - * load. - */ - this.markNotificationAsRead = function (notificationId) { - if (!notificationId) { - return; - } - - piwikApi.withTokenInUrl(); - piwikApi.post( - { // GET params - module: 'CoreHome', - action: 'markNotificationAsRead' - }, - { // POST params - notificationId: notificationId - } - ); - }; - } -})(); \ No newline at end of file diff --git a/plugins/CoreHome/angularjs/notification/notification.directive.html b/plugins/CoreHome/angularjs/notification/notification.directive.html deleted file mode 100644 index 82138156f1..0000000000 --- a/plugins/CoreHome/angularjs/notification/notification.directive.html +++ /dev/null @@ -1,8 +0,0 @@ -
- - {{ title }} - - -
- -
diff --git a/plugins/CoreHome/angularjs/notification/notification.directive.js b/plugins/CoreHome/angularjs/notification/notification.directive.js deleted file mode 100644 index 51ff0d4819..0000000000 --- a/plugins/CoreHome/angularjs/notification/notification.directive.js +++ /dev/null @@ -1,99 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Directive to show a notification. - * - * Note: using this directive is preferred over the Notification class (which uses jquery - * exclusively). - * - * Supports the following attributes: - * - * * **context**: Either 'success', 'error', 'info', 'warning' - * * **type**: Either 'toast', 'persistent', 'transient' - * * **noclear**: If truthy, no clear button is displayed. For persistent notifications, has no effect. - * - * Usage: - * - *
- * Info: My notification message. - *
- */ -(function () { - angular.module('piwikApp').directive('piwikNotification', piwikNotification); - - piwikNotification.$inject = ['piwik', '$timeout']; - - function piwikNotification(piwik, $timeout) { - return { - restrict: 'A', - scope: { - notificationId: '@?', - title: '@?notificationTitle', // TODO: shouldn't need this since the title can be specified within - // HTML of the node that uses the directive. - context: '@?', - type: '@?', - noclear: '@?', - toastLength: '@?' - }, - transclude: true, - templateUrl: 'plugins/CoreHome/angularjs/notification/notification.directive.html?cb=' + piwik.cacheBuster, - controller: 'NotificationController', - controllerAs: 'notification', - link: function (scope, element) { - scope.toastLength = scope.toastLength || 12 * 1000; - - if (scope.notificationId) { - closeExistingNotificationHavingSameIdIfNeeded(scope.notificationId, element); - } - - if (scope.context) { - element.children('.notification').addClass('notification-' + scope.context); - } - - if (scope.type == 'persistent') { - // otherwise it is never possible to dismiss the notification - scope.noclear = false; - } - - if ('toast' == scope.type) { - addToastEvent(); - } - - if (!scope.noclear) { - addCloseEvent(); - } - - function addToastEvent() { - $timeout(function () { - element.fadeOut('slow', function() { - element.remove(); - }); - }, scope.toastLength); - } - - function addCloseEvent() { - element.on('click', '.close', function (event) { - if (event && event.delegateTarget) { - angular.element(event.delegateTarget).remove(); - } - }); - } - - function closeExistingNotificationHavingSameIdIfNeeded(id, notificationElement) { - // TODO: instead of doing a global query for notification, there should be a notification-container - // directive that manages notifications. - var notificationStillExists = !!notificationElement.parents('body').length; - var existingNode = angular.element('[notification-id=' + id + ']').not(notificationElement); - if (notificationStillExists && existingNode && existingNode.length) { - existingNode.remove(); - } - } - } - }; - } -})(); \ No newline at end of file diff --git a/plugins/CoreHome/angularjs/notification/notification.directive.less b/plugins/CoreHome/angularjs/notification/notification.directive.less deleted file mode 100644 index ae372d74b6..0000000000 --- a/plugins/CoreHome/angularjs/notification/notification.directive.less +++ /dev/null @@ -1,69 +0,0 @@ -.system.notification { - .alert; - - box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12); - border: 0 !important; - - p:not(:first-child) { - margin-top: 1em; - } - - // We have to use !important because the default button style is crazy - .close { - position: relative; - top: -5px; - right: -10px; - padding: 0 !important; - background: transparent !important; - border: none !important; - float: right; - font-size: 20px !important; - font-weight: bold; - line-height: 20px !important; - color: inherit !important; - opacity: 0.3; - filter: alpha(opacity=30); - } - - &.notification-success { - .alert-success; - color: #eef6ef !important; - background-color: @color-green-piwik !important; - &:before, p, a { - color: #eef6ef; - } - } - &.notification-warning { - .alert-warning; - background-color: #f57c00; - color: #fbf7f1 !important; - &:before, p, a { - color: #fbf7f1; - } - } - &.notification-danger, - &.notification-error { - .alert-danger; - color: #fdf0f2 !important; - background-color: #e53935; - &:before, p, a { - color: #fdf0f2; - } - } - &.notification-info { - .alert-info; - color: #f3feff !important; - background-color: #00bcd4; - &:before, p, a { - color: #f3feff; - } - } - - .help-notification &.notification-info { - background-color: @theme-color-help-background-color; - - &:before { - content: "\e61f"; - } - } -} diff --git a/plugins/CoreHome/angularjs/notification/notification.service.js b/plugins/CoreHome/angularjs/notification/notification.service.js deleted file mode 100644 index 637af734fa..0000000000 --- a/plugins/CoreHome/angularjs/notification/notification.service.js +++ /dev/null @@ -1,53 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp').factory('notifications', NotificationFactory); - - NotificationFactory.$inject = []; - - function NotificationFactory() { - - return { - parseNotificationDivs: parseNotificationDivs, - clearTransientNotifications: clearTransientNotifications, - }; - - function parseNotificationDivs() { - var UI = require('piwik/UI'); - - var $notificationNodes = $('[data-role="notification"]'); - - $notificationNodes.each(function (index, notificationNode) { - $notificationNode = $(notificationNode); - var attributes = $notificationNode.data(); - var message = $notificationNode.html(); - - if (message) { - var notification = new UI.Notification(); - attributes.animate = false; - notification.show(message, attributes); - } - - $notificationNodes.remove(); - }); - } - - function clearTransientNotifications() { - $('[piwik-notification][type=transient]').each(function () { - var $element = angular.element(this); - $element.scope().$destroy(); - $element.remove(); - }); - } - } - - angular.module('piwikApp').run(['notifications', function (notifications) { - $(function () { - notifications.parseNotificationDivs(); - }); - }]); -})(); diff --git a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js index 0c34f1e666..949d85a9b0 100644 --- a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js +++ b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js @@ -93,7 +93,7 @@ var prefix = '' + _pk_translate('CoreHome_ReportingCategoryHelpPrefix', [category.name, subcategory.name]) + '
'; - var options = { context: 'info', id: 'reportingmenu-help', type: 'persistent', noclear: true }; + var options = { context: 'info', id: 'reportingmenu-help', type: 'transient', noclear: true }; options['class'] = 'help-notification'; notification.show(prefix + subcategory.help, options); diff --git a/plugins/CoreHome/javascripts/notification.js b/plugins/CoreHome/javascripts/notification.js index da3216048f..f55b6504eb 100644 --- a/plugins/CoreHome/javascripts/notification.js +++ b/plugins/CoreHome/javascripts/notification.js @@ -6,192 +6,51 @@ */ (function ($, require) { - var exports = require('piwik/UI'); /** - * Creates a new notifications. - * - * Example: - * var UI = require('piwik/UI'); - * var notification = new UI.Notification(); - * notification.show('My Notification Message', {title: 'Low space', context: 'warning'}); + * @deprecated */ var Notification = function () { - this.$node = null; + this.notificationId = null; }; /** - * Makes the notification visible. - * - * @param {string} message The actual message that will be displayed. Must be set. - * @param {Object} [options] - * @param {string} [options.id] Only needed for persistent notifications. The id will be sent to the - * frontend once the user closes the notifications. The notification has to - * be registered/notified under this name - * @param {string} [options.title] The title of the notification. For instance the plugin name. - * @param {bool} [options.animate=true] If enabled, the notification will be faded in. - * @param {string} [options.context=warning] Context of the notification: 'info', 'warning', 'success' or - * 'error' - * @param {string} [options.type=transient] The type of the notification: Either 'toast' or 'transitent' - * @param {bool} [options.noclear=false] If set, the close icon is not displayed. - * @param {object} [options.style] Optional style/css dictionary. For instance {'display': 'inline-block'} - * @param {string} [options.placeat] By default, the notification will be displayed in the "stats bar". - * You can specify any other CSS selector to place the notifications - * wherever you want. + * @deprecated use NotificationsStore.show() in CoreHome Vue module */ Notification.prototype.show = function (message, options) { - checkMessage(message); options = checkOptions(options); - - var template = generateNotificationHtmlMarkup(options, message); - this.$node = placeNotification(template, options); + options.noclear = !! options.noclear; + this.notificationId = window.CoreHome.NotificationsStore.show($.extend({ message: message }, options)); }; /** - * Removes a previously shown notification having the given notification id. - * - * - * @param {string} notificationId The id of a notification that was previously registered. + * @deprecated use NotificationsStore.remove() in CoreHome Vue module */ Notification.prototype.remove = function (notificationId) { - $('[piwik-notification][notification-id=' + notificationId + ']').remove(); + window.CoreHome.NotificationsStore.remove(notificationId); }; - Notification.prototype.scrollToNotification = function () { - if (this.$node) { - piwikHelper.lazyScrollTo(this.$node, 250); + /** + * @deprecated use NotificationsStore.scrollToNotification() in CoreHome Vue module + */ + Notification.prototype.scrollToNotification = function () { + if (this.notificationId) { + window.CoreHome.NotificationsStore.scrollToNotification(this.notificationId); } }; /** - * Shows a notification at a certain point with a quick upwards animation. - * - * TODO: if the materializecss version matomo uses is updated, should use their toasts. - * - * @type {Notification} - * @param {string} message The actual message that will be displayed. Must be set. - * @param {Object} options - * @param {string} options.placeat Where to place the notification. Required. - * @param {string} [options.id] Only needed for persistent notifications. The id will be sent to the - * frontend once the user closes the notifications. The notification has to - * be registered/notified under this name - * @param {string} [options.title] The title of the notification. For instance the plugin name. - * @param {string} [options.context=warning] Context of the notification: 'info', 'warning', 'success' or - * 'error' - * @param {string} [options.type=transient] The type of the notification: Either 'toast' or 'transitent' - * @param {bool} [options.noclear=false] If set, the close icon is not displayed. - * @param {object} [options.style] Optional style/css dictionary. For instance {'display': 'inline-block'} + * @deprecated use NotificationsStore.toast() in CoreHome Vue module */ Notification.prototype.toast = function (message, options) { - checkMessage(message); options = checkOptions(options); - - var $placeat = $(options.placeat); - if (!$placeat.length) { - throw new Error("A valid selector is required for the placeat option when using Notification.toast()."); - } - - var $template = $(generateNotificationHtmlMarkup(options, message)).hide(); - $('body').append($template); - - compileNotification($template); - - $template.css({ - position: 'absolute', - left: $placeat.offset().left, - top: $placeat.offset().top - }); - setTimeout(function () { - $template.animate( - { - top: $placeat.offset().top - $template.height() - }, - { - duration: 300, - start: function () { - $template.show(); - } - } - ); - }); + options.noclear = !! options.noclear; + window.CoreHome.NotificationsStore.toast($.extend({ message: message }, options)); }; exports.Notification = Notification; - function generateNotificationHtmlMarkup(options, message) { - var attributeMapping = { - id: 'notification-id', - title: 'notification-title', - context: 'context', - type: 'type', - noclear: 'noclear', - class: 'class', - toastLength: 'toast-length' - }, - html = '
'; - - return html; - } - - function compileNotification($node) { - angular.element(document).injector().invoke(function ($compile, $rootScope) { - $compile($node)($rootScope.$new(true)); - }); - } - - function placeNotification(template, options) { - var $notificationNode = $(template); - - // compile the template in angular - compileNotification($notificationNode); - - if (options.style) { - $notificationNode.css(options.style); - } - - var notificationPosition = '#notificationContainer'; - var method = 'append'; - if (options.placeat) { - notificationPosition = options.placeat; - } else { - // If a modal is open, we want to make sure the error message is visible and therefore show it within the opened modal - var modalSelector = '.modal.open .modal-content'; - var modalOpen = $(modalSelector); - if (modalOpen.length) { - notificationPosition = modalSelector; - method = 'prepend'; - } - } - - $notificationNode = $notificationNode.hide(); - $(notificationPosition)[method]($notificationNode); - - if (false === options.animate) { - $notificationNode.show(); - } else { - $notificationNode.fadeIn(1000); - } - - return $notificationNode; - } - - function checkMessage(message) { - if (!message) { - throw new Error('No message given, cannot display notification'); - } - } - function checkOptions(options) { if (options && !$.isPlainObject(options)) { throw new Error('Options has the wrong format, cannot display notification'); @@ -201,4 +60,4 @@ return options; } -})(jQuery, require); \ No newline at end of file +})(jQuery, require); diff --git a/plugins/CoreHome/stylesheets/vue-transitions.less b/plugins/CoreHome/stylesheets/vue-transitions.less new file mode 100644 index 0000000000..cdfef3e1ea --- /dev/null +++ b/plugins/CoreHome/stylesheets/vue-transitions.less @@ -0,0 +1,16 @@ +.fade-in-enter-active { + transition: opacity 1s ease; +} + +.fade-in-enter-from { + opacity: 0; +} + +// 'slow' as in jquery.animate's 'slow' value +.slow-fade-out-leave-active { + transition: opacity .6s ease; +} + +.slow-fade-out-leave-to { + opacity: 0; +} \ No newline at end of file diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index a572e3e558..36e4c542d9 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -162,6 +162,9 @@ __webpack_require__.d(__webpack_exports__, "Menudropdown", function() { return / __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return /* reexport */ DatePicker; }); __webpack_require__.d(__webpack_exports__, "DateRangePicker", function() { return /* reexport */ DateRangePicker; }); __webpack_require__.d(__webpack_exports__, "PeriodDatePicker", function() { return /* reexport */ PeriodDatePicker; }); +__webpack_require__.d(__webpack_exports__, "Notification", function() { return /* reexport */ Notification; }); +__webpack_require__.d(__webpack_exports__, "NotificationGroup", function() { return /* reexport */ Notification_NotificationGroup; }); +__webpack_require__.d(__webpack_exports__, "NotificationsStore", function() { return /* reexport */ Notifications_store; }); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js // This file is imported into lib/wc client bundles. @@ -1828,12 +1831,23 @@ var AjaxHelper_AjaxHelper = /*#__PURE__*/function () { */ // helper method entry point function fetch(params) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var helper = new AjaxHelper(); + + if (options.withTokenInUrl) { + helper.withTokenInUrl(); + } + helper.setFormat('json'); helper.addParams(AjaxHelper_objectSpread({ module: 'API', format: 'json' }, params), 'get'); + + if (options.postParams) { + helper.addParams(options.postParams, 'post'); + } + return helper.send(); } }]); @@ -2057,17 +2071,24 @@ angular.module('piwikApp.directive').directive('piwikFocusAnywhereButHere', piwi * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +function doFocusIf(el, binding) { + if (binding.arg) { + setTimeout(function () { + el.focus(); + + if (binding.value.afterFocus) { + binding.value.afterFocus(); + } + }, 5); + } +} + /* harmony default export */ var FocusIf = ({ + mounted: function mounted(el, binding) { + doFocusIf(el, binding); + }, updated: function updated(el, binding) { - if (binding.value.focusIf) { - setTimeout(function () { - el.focus(); - - if (binding.value.afterFocus) { - binding.value.afterFocus(); - } - }, 5); - } + doFocusIf(el, binding); } }); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/FocusIf/FocusIf.adapter.ts @@ -2092,8 +2113,8 @@ function piwikFocusIf() { scope.$watch(attrs.piwikFocusIf, function (newValue) { var binding = { instance: null, + arg: newValue ? '1' : undefined, value: { - focusIf: !!newValue, afterFocus: function afterFocus() { return scope.$apply(); } @@ -2320,7 +2341,7 @@ angular.module('piwikApp').directive('piwikExpandOnHover', piwikExpandOnHover); var _hoisted_1 = { ref: "root" }; -function render(_ctx, _cache, $props, $setup, $data, $options) { +function MatomoDialogvue_type_template_id_7aba656e_render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.modelValue]]); } // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=template&id=7aba656e @@ -2395,7 +2416,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { -MatomoDialogvue_type_script_lang_ts.render = render +MatomoDialogvue_type_script_lang_ts.render = MatomoDialogvue_type_template_id_7aba656e_render /* harmony default export */ var MatomoDialog = (MatomoDialogvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/createAngularJsAdapter.ts @@ -2527,6 +2548,10 @@ function createAngularJsAdapter(options) { value = info.default instanceof Function ? info.default.apply(info, [ngScope, ngElement, ngAttrs].concat(injectedServices)) : info.default; } + if (info.transform) { + value = info.transform(value); + } + initialData[info.vue] = value; }); return initialData; @@ -2572,11 +2597,17 @@ function createAngularJsAdapter(options) { } ngScope.$watch(scopeVarName, function (newValue) { + var newValueFinal = newValue; + if (typeof info.default !== 'undefined' && typeof newValue === 'undefined') { - vm[scopeVarName] = info.default instanceof Function ? info.default.apply(info, [ngScope, ngElement, ngAttrs].concat(injectedServices)) : info.default; - } else { - vm[scopeVarName] = newValue; + newValueFinal = info.default instanceof Function ? info.default.apply(info, [ngScope, ngElement, ngAttrs].concat(injectedServices)) : info.default; } + + if (info.transform) { + newValueFinal = info.transform(newValueFinal); + } + + vm[scopeVarName] = newValueFinal; }); }); @@ -3819,33 +3850,35 @@ angular.module('piwikApp.service').factory('piwikComparisonsService', Comparison directiveName: 'piwikComparisons', restrict: 'E' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Menudropdown/Menudropdown.vue?vue&type=template&id=6bbbef32 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Menudropdown/Menudropdown.vue?vue&type=template&id=0349d645 -var Menudropdownvue_type_template_id_6bbbef32_hoisted_1 = { +var Menudropdownvue_type_template_id_0349d645_hoisted_1 = { ref: "root", class: "menuDropdown" }; -var Menudropdownvue_type_template_id_6bbbef32_hoisted_2 = ["title"]; -var Menudropdownvue_type_template_id_6bbbef32_hoisted_3 = ["innerHTML"]; +var Menudropdownvue_type_template_id_0349d645_hoisted_2 = ["title"]; +var Menudropdownvue_type_template_id_0349d645_hoisted_3 = ["innerHTML"]; -var Menudropdownvue_type_template_id_6bbbef32_hoisted_4 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var Menudropdownvue_type_template_id_0349d645_hoisted_4 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon-arrow-bottom" }, null, -1); -var Menudropdownvue_type_template_id_6bbbef32_hoisted_5 = { +var Menudropdownvue_type_template_id_0349d645_hoisted_5 = { class: "items" }; -var Menudropdownvue_type_template_id_6bbbef32_hoisted_6 = { +var Menudropdownvue_type_template_id_0349d645_hoisted_6 = { key: 0, class: "search" }; -var Menudropdownvue_type_template_id_6bbbef32_hoisted_7 = ["placeholder"]; -var Menudropdownvue_type_template_id_6bbbef32_hoisted_8 = ["title"]; -var Menudropdownvue_type_template_id_6bbbef32_hoisted_9 = ["title"]; -function Menudropdownvue_type_template_id_6bbbef32_render(_ctx, _cache, $props, $setup, $data, $options) { +var Menudropdownvue_type_template_id_0349d645_hoisted_7 = ["placeholder"]; +var Menudropdownvue_type_template_id_0349d645_hoisted_8 = ["title"]; +var Menudropdownvue_type_template_id_0349d645_hoisted_9 = ["title"]; +function Menudropdownvue_type_template_id_0349d645_render(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_focus_if = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-if"); + var _directive_focus_anywhere_but_here = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-anywhere-but-here"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Menudropdownvue_type_template_id_6bbbef32_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Menudropdownvue_type_template_id_0349d645_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "title", onClick: _cache[0] || (_cache[0] = function ($event) { return _ctx.showItems = !_ctx.showItems; @@ -3853,7 +3886,7 @@ function Menudropdownvue_type_template_id_6bbbef32_render(_ctx, _cache, $props, title: _ctx.tooltip }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { innerHTML: _ctx.$sanitize(this.actualMenuTitle) - }, null, 8, Menudropdownvue_type_template_id_6bbbef32_hoisted_3), Menudropdownvue_type_template_id_6bbbef32_hoisted_4], 8, Menudropdownvue_type_template_id_6bbbef32_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Menudropdownvue_type_template_id_6bbbef32_hoisted_5, [_ctx.showSearch && _ctx.showItems ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Menudropdownvue_type_template_id_6bbbef32_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + }, null, 8, Menudropdownvue_type_template_id_0349d645_hoisted_3), Menudropdownvue_type_template_id_0349d645_hoisted_4], 8, Menudropdownvue_type_template_id_0349d645_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Menudropdownvue_type_template_id_0349d645_hoisted_5, [_ctx.showSearch && _ctx.showItems ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Menudropdownvue_type_template_id_0349d645_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { type: "text", "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) { return _ctx.searchTerm = $event; @@ -3862,11 +3895,11 @@ function Menudropdownvue_type_template_id_6bbbef32_render(_ctx, _cache, $props, return _ctx.onSearchTermKeydown($event); }), placeholder: _ctx.translate('General_Search') - }, null, 40, Menudropdownvue_type_template_id_6bbbef32_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + }, null, 40, Menudropdownvue_type_template_id_0349d645_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.showItems]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { class: "search_ico", src: "plugins/Morpheus/images/search_ico.png", title: _ctx.translate('General_Search') - }, null, 8, Menudropdownvue_type_template_id_6bbbef32_hoisted_8), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.searchTerm]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + }, null, 8, Menudropdownvue_type_template_id_0349d645_hoisted_8), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.searchTerm]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { onClick: _cache[3] || (_cache[3] = function ($event) { _ctx.searchTerm = ''; @@ -3875,7 +3908,7 @@ function Menudropdownvue_type_template_id_6bbbef32_render(_ctx, _cache, $props, class: "reset", src: "plugins/CoreHome/images/reset_search.png", title: _ctx.translate('General_Clear') - }, null, 8, Menudropdownvue_type_template_id_6bbbef32_hoisted_9), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + }, null, 8, Menudropdownvue_type_template_id_0349d645_hoisted_9), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { onClick: _cache[4] || (_cache[4] = function ($event) { return _ctx.selectItem($event); }) @@ -3883,7 +3916,7 @@ function Menudropdownvue_type_template_id_6bbbef32_render(_ctx, _cache, $props, blur: _ctx.lostFocus }]]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Menudropdown/Menudropdown.vue?vue&type=template&id=6bbbef32 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Menudropdown/Menudropdown.vue?vue&type=template&id=0349d645 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Menudropdown/Menudropdown.vue?vue&type=script&lang=ts @@ -3964,7 +3997,7 @@ var Menudropdownvue_type_script_lang_ts_window = window, -Menudropdownvue_type_script_lang_ts.render = Menudropdownvue_type_template_id_6bbbef32_render +Menudropdownvue_type_script_lang_ts.render = Menudropdownvue_type_template_id_0349d645_render /* harmony default export */ var Menudropdown = (Menudropdownvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Menudropdown/Menudropdown.adapter.ts @@ -4923,6 +4956,552 @@ function deleteCookie(name) { document.cookie = "".concat(name, "=; expires=").concat(date.toUTCString(), "; path=/"); } +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=template&id=e3d12348 + +var Notificationvue_type_template_id_e3d12348_hoisted_1 = { + key: 0 +}; +var Notificationvue_type_template_id_e3d12348_hoisted_2 = ["data-notification-instance-id"]; +var Notificationvue_type_template_id_e3d12348_hoisted_3 = { + key: 1 +}; +var Notificationvue_type_template_id_e3d12348_hoisted_4 = { + class: "notification-body" +}; +var Notificationvue_type_template_id_e3d12348_hoisted_5 = ["innerHTML"]; +var Notificationvue_type_template_id_e3d12348_hoisted_6 = { + key: 1 +}; +function Notificationvue_type_template_id_e3d12348_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Transition"], { + name: _ctx.type === 'toast' ? 'slow-fade-out' : undefined, + onAfterLeave: _cache[1] || (_cache[1] = function ($event) { + return _ctx.toastClosed(); + }) + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [!_ctx.deleted ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Notificationvue_type_template_id_e3d12348_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Transition"], { + name: _ctx.type === 'toast' ? 'toast-slide-up' : undefined, + appear: "" + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Transition"], { + name: _ctx.animate ? 'fade-in' : undefined, + appear: "" + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["notification system", _ctx.cssClasses]), + style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])(_ctx.style), + ref: "root", + "data-notification-instance-id": _ctx.notificationInstanceId + }, [_ctx.canClose ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("button", { + key: 0, + type: "button", + class: "close", + "data-dismiss": "alert", + onClick: _cache[0] || (_cache[0] = function ($event) { + return _ctx.closeNotification($event); + }) + }, " × ")) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.title ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("strong", Notificationvue_type_template_id_e3d12348_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.title), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Notificationvue_type_template_id_e3d12348_hoisted_4, [_ctx.message ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + key: 0, + innerHTML: _ctx.$sanitize(_ctx.message) + }, null, 8, Notificationvue_type_template_id_e3d12348_hoisted_5)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.message ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Notificationvue_type_template_id_e3d12348_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 14, Notificationvue_type_template_id_e3d12348_hoisted_2)]; + }), + _: 3 + }, 8, ["name"])])]; + }), + _: 3 + }, 8, ["name"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]; + }), + _: 3 + }, 8, ["name"]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=template&id=e3d12348 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=script&lang=ts + + +var Notificationvue_type_script_lang_ts_window = window, + Notificationvue_type_script_lang_ts_$ = Notificationvue_type_script_lang_ts_window.$; +/* harmony default export */ var Notificationvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + notificationId: String, + // NOTE: notificationId refers to server side ID for notifications stored in the session. + // this ID is just so it can be selected outside of this component (just for scrolling). + notificationInstanceId: String, + title: String, + context: String, + type: String, + noclear: Boolean, + toastLength: { + type: Number, + default: 12 * 1000 + }, + style: [String, Object], + animate: Boolean, + message: String, + cssClass: String + }, + computed: { + cssClasses: function cssClasses() { + var result = {}; + + if (this.context) { + result["notification-".concat(this.context)] = true; + } + + if (this.cssClass) { + result[this.cssClass] = true; + } + + return result; + }, + canClose: function canClose() { + if (this.type === 'persistent') { + // otherwise it is never possible to dismiss the notification + return true; + } + + return !this.noclear; + } + }, + emits: ['closed'], + data: function data() { + return { + deleted: false + }; + }, + mounted: function mounted() { + var _this = this; + + var addToastEvent = function addToastEvent() { + setTimeout(function () { + _this.deleted = true; + }, _this.toastLength); + }; + + if (this.type === 'toast') { + addToastEvent(); + } + + if (this.style) { + Notificationvue_type_script_lang_ts_$(this.$refs.root).css(this.style); + } + }, + methods: { + toastClosed: function toastClosed() { + var _this2 = this; + + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + _this2.$emit('closed'); + }); + }, + closeNotification: function closeNotification(event) { + var _this3 = this; + + if (this.canClose && event && event.target) { + this.deleted = true; + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + _this3.$emit('closed'); + }); + } + + this.markNotificationAsRead(); + }, + markNotificationAsRead: function markNotificationAsRead() { + if (!this.notificationId) { + return; + } + + AjaxHelper_AjaxHelper.fetch({ + module: 'CoreHome', + action: 'markNotificationAsRead' + }, { + postParams: { + notificationId: this.notificationId + } + }); + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.vue + + + +Notificationvue_type_script_lang_ts.render = Notificationvue_type_template_id_e3d12348_render + +/* harmony default export */ var Notification = (Notificationvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + +/* harmony default export */ var Notification_adapter = (createAngularJsAdapter({ + component: Notification, + scope: { + notificationId: { + angularJsBind: '@?' + }, + title: { + angularJsBind: '@?notificationTitle' + }, + context: { + angularJsBind: '@?' + }, + type: { + angularJsBind: '@?' + }, + noclear: { + angularJsBind: '@?', + transform: function transform(v) { + return !!v; + } + }, + toastLength: { + angularJsBind: '@?' + } + }, + directiveName: 'piwikNotification', + transclude: true +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notifications.store.ts +function Notifications_store_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function Notifications_store_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Notifications_store_ownKeys(Object(source), true).forEach(function (key) { Notifications_store_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Notifications_store_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function Notifications_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Notifications_store_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Notifications_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) Notifications_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) Notifications_store_defineProperties(Constructor, staticProps); return Constructor; } + +function Notifications_store_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + + + +var Notifications_store_NotificationsStore = /*#__PURE__*/function () { + function NotificationsStore() { + Notifications_store_classCallCheck(this, NotificationsStore); + + Notifications_store_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ + notifications: [] + })); + + Notifications_store_defineProperty(this, "nextNotificationId", 0); + } + + Notifications_store_createClass(NotificationsStore, [{ + key: "state", + get: function get() { + return this.privateState; + } + }, { + key: "appendNotification", + value: function appendNotification(notification) { + this.checkMessage(notification.message); // remove existing notification before adding + + if (notification.id) { + this.remove(notification.id); + } + + this.privateState.notifications.push(notification); + } + }, { + key: "prependNotification", + value: function prependNotification(notification) { + this.checkMessage(notification.message); // remove existing notification before adding + + if (notification.id) { + this.remove(notification.id); + } + + this.privateState.notifications.unshift(notification); + } + /** + * Removes a previously shown notification having the given notification id. + */ + + }, { + key: "remove", + value: function remove(id) { + this.privateState.notifications = this.privateState.notifications.filter(function (n) { + return n.id !== id; + }); + } + }, { + key: "parseNotificationDivs", + value: function parseNotificationDivs() { + var _this = this; + + var $notificationNodes = $('[data-role="notification"]'); + var notificationsToShow = []; + $notificationNodes.each(function (index, notificationNode) { + var $notificationNode = $(notificationNode); + var attributes = $notificationNode.data(); + var message = $notificationNode.html(); + + if (message) { + notificationsToShow.push(Notifications_store_objectSpread(Notifications_store_objectSpread({}, attributes), {}, { + message: message, + animate: false + })); + } + + $notificationNodes.remove(); + }); + notificationsToShow.forEach(function (n) { + return _this.show(n); + }); + } + }, { + key: "clearTransientNotifications", + value: function clearTransientNotifications() { + this.privateState.notifications = this.privateState.notifications.filter(function (n) { + return n.type !== 'transient'; + }); + } + /** + * Creates a notification and shows it to the user. + */ + + }, { + key: "show", + value: function show(notification) { + this.checkMessage(notification.message); + var addMethod = this.appendNotification; + var notificationPosition = '#notificationContainer'; + + if (notification.placeat) { + notificationPosition = notification.placeat; + } else { + // If a modal is open, we want to make sure the error message is visible and therefore + // show it within the opened modal + var modalSelector = '.modal.open .modal-content'; + + if (document.querySelector(modalSelector)) { + notificationPosition = modalSelector; + addMethod = this.prependNotification; + } + } + + var group = notification.group || (notification.placeat ? notification.placeat.toString() : ''); + this.initializeNotificationContainer(notificationPosition, group); + var notificationInstanceId = (this.nextNotificationId += 1).toString(); + addMethod.call(this, Notifications_store_objectSpread(Notifications_store_objectSpread({}, notification), {}, { + noclear: !!notification.noclear, + group: group, + notificationId: notification.id, + notificationInstanceId: notificationInstanceId, + type: notification.type || 'transient' + })); + return notificationInstanceId; + } + }, { + key: "scrollToNotification", + value: function scrollToNotification(notificationInstanceId) { + setTimeout(function () { + var element = document.querySelector("[data-notification-instance-id='".concat(notificationInstanceId, "']")); + + if (element) { + Matomo_Matomo.helper.lazyScrollTo(element, 250); + } + }); + } + /** + * Shows a notification at a certain point with a quick upwards animation. + */ + + }, { + key: "toast", + value: function toast(notification) { + this.checkMessage(notification.message); + var $placeat = $(notification.placeat); + + if (!$placeat.length) { + throw new Error('A valid selector is required for the placeat option when using Notification.toast().'); + } + + var toastElement = document.createElement('div'); + toastElement.style.position = 'absolute'; + toastElement.style.top = "".concat($placeat.offset().top, "px"); + toastElement.style.left = "".concat($placeat.offset().left, "px"); + toastElement.style.zIndex = '1000'; + document.body.appendChild(toastElement); + var app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])({ + render: function render() { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Notification, Notifications_store_objectSpread(Notifications_store_objectSpread({}, notification), {}, { + notificationId: notification.id, + type: 'toast', + onClosed: function onClosed() { + app.unmount(); + } + })); + } + }); + app.config.globalProperties.$sanitize = window.vueSanitize; + app.config.globalProperties.translate = translate; + app.mount(toastElement); + } + }, { + key: "initializeNotificationContainer", + value: function initializeNotificationContainer(notificationPosition, group) { + var $container = window.$(notificationPosition); + + if ($container.children('.notification-group').length) { + return; + } // avoiding a dependency cycle. won't need to do this when NotificationGroup's do not need + // to be dynamically initialized. + + + var NotificationGroup = window.CoreHome.NotificationGroup; // eslint-disable-line + + var app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])({ + template: '', + data: function data() { + return { + group: group + }; + } + }); + app.config.globalProperties.$sanitize = window.vueSanitize; + app.config.globalProperties.translate = translate; + app.component('NotificationGroup', NotificationGroup); + app.mount($container[0]); + } + }, { + key: "checkMessage", + value: function checkMessage(message) { + if (!message) { + throw new Error('No message given, cannot display notification'); + } + } + }]); + + return NotificationsStore; +}(); + +var Notifications_store_instance = new Notifications_store_NotificationsStore(); +/* harmony default export */ var Notifications_store = (Notifications_store_instance); // parse notifications on dom load + +$(function () { + return Notifications_store_instance.parseNotificationDivs(); +}); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notifications.store.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +angular.module('piwikApp').factory('notifications', function () { + return Notifications_store; +}); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=template&id=672051da + +var NotificationGroupvue_type_template_id_672051da_hoisted_1 = { + class: "notification-group" +}; +var NotificationGroupvue_type_template_id_672051da_hoisted_2 = ["innerHTML"]; +function NotificationGroupvue_type_template_id_672051da_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Notification = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Notification"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", NotificationGroupvue_type_template_id_672051da_hoisted_1, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.notifications, function (notification, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Notification, { + key: notification.id || "no-id-".concat(index), + "notification-id": notification.id, + title: notification.title, + context: notification.context, + type: notification.type, + noclear: notification.noclear, + "toast-length": notification.toastLength, + style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])(notification.style), + animate: notification.animate, + message: notification.message, + "notification-instance-id": notification.notificationInstanceId, + "css-class": notification.class, + onClosed: function onClosed($event) { + return _ctx.removeNotification(notification.id); + } + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + innerHTML: _ctx.$sanitize(notification.message) + }, null, 8, NotificationGroupvue_type_template_id_672051da_hoisted_2)]; + }), + _: 2 + }, 1032, ["notification-id", "title", "context", "type", "noclear", "toast-length", "style", "animate", "message", "notification-instance-id", "css-class", "onClosed"]); + }), 128))]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=template&id=672051da + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=script&lang=ts + + + +/* harmony default export */ var NotificationGroupvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + group: String + }, + components: { + Notification: Notification + }, + computed: { + notifications: function notifications() { + var _this = this; + + return Notifications_store.state.notifications.filter(function (n) { + if (_this.group) { + return _this.group === n.group; + } + + return !n.group; + }); + } + }, + methods: { + removeNotification: function removeNotification(id) { + Notifications_store.remove(id); + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue + + + +NotificationGroupvue_type_script_lang_ts.render = NotificationGroupvue_type_template_id_672051da_render + +/* harmony default export */ var Notification_NotificationGroup = (NotificationGroupvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/index.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + + + // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/index.ts /*! * Matomo - free/libre analytics platform @@ -4974,6 +5553,7 @@ function deleteCookie(name) { + // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index 0fe81a6b4c..4b0e64d200 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -4,19 +4,19 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */window.hasBlockedContent=!1},"8bbf":function(t,n){t.exports=e},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"createAngularJsAdapter",(function(){return yt})),n.d(t,"activityIndicatorAdapter",(function(){return br})),n.d(t,"ActivityIndicator",(function(){return gr})),n.d(t,"translate",(function(){return C})),n.d(t,"alertAdapter",(function(){return Or})),n.d(t,"AjaxHelper",(function(){return $e})),n.d(t,"setCookie",(function(){return jr})),n.d(t,"getCookie",(function(){return Cr})),n.d(t,"deleteCookie",(function(){return Pr})),n.d(t,"MatomoUrl",(function(){return ke})),n.d(t,"Matomo",(function(){return j})),n.d(t,"Periods",(function(){return p})),n.d(t,"Day",(function(){return Q})),n.d(t,"Week",(function(){return X})),n.d(t,"Month",(function(){return re})),n.d(t,"Year",(function(){return ce})),n.d(t,"Range",(function(){return R})),n.d(t,"format",(function(){return P})),n.d(t,"getToday",(function(){return S})),n.d(t,"parseDate",(function(){return E})),n.d(t,"todayIsInRange",(function(){return T})),n.d(t,"Dropdown",(function(){return Ae})),n.d(t,"FocusAnywhereButHere",(function(){return Re})),n.d(t,"FocusIf",(function(){return _e})),n.d(t,"MatomoDialog",(function(){return st})),n.d(t,"ExpandOnClick",(function(){return Ke})),n.d(t,"ExpandOnHover",(function(){return at})),n.d(t,"EnrichedHeadline",(function(){return Mt})),n.d(t,"ContentBlock",(function(){return qt})),n.d(t,"Comparisons",(function(){return In})),n.d(t,"Menudropdown",(function(){return Gn})),n.d(t,"DatePicker",(function(){return nr})),n.d(t,"DateRangePicker",(function(){return lr})),n.d(t,"PeriodDatePicker",(function(){return pr})),"undefined"!==typeof window){var r=window.document.currentScript,a=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}n("2342");var o=n("8bbf");function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r=e[0]&&S()<=e[1])}function x(e,t){return M(e)||B(e,t)||H(e,t)||I()}function I(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(e,t){if(e){if("string"===typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e[0]&&P()<=e[1])}function x(e,t){return A(e)||H(e,t)||N(e,t)||I()}function I(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function N(e,t){if(e){if("string"===typeof e)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(e,t):void 0}}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"day";if(/^previous/.test(t)){var r=e.getLastNRange(n,"2").startDate;return e.getLastNRange(n,t.substring(8),r)}if(/^last/.test(t))return e.getLastNRange(n,t.substring(4));var a=decodeURIComponent(t).split(",");return new e(E(a[0]),E(a[1]),n)}},{key:"getDisplayText",value:function(){return C("General_DateRangeInPeriodList")}}]),e}();function U(){return{getAllLabels:p.getAllLabels.bind(p),isRecognizedPeriod:p.isRecognizedPeriod.bind(p),get:p.get.bind(p),parse:p.parse.bind(p),parseDate:E,format:P,RangePeriod:R,todayIsInRange:T}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"day";if(/^previous/.test(t)){var r=e.getLastNRange(n,"2").startDate;return e.getLastNRange(n,t.substring(8),r)}if(/^last/.test(t))return e.getLastNRange(n,t.substring(4));var a=decodeURIComponent(t).split(",");return new e(E(a[0]),E(a[1]),n)}},{key:"getDisplayText",value:function(){return C("General_DateRangeInPeriodList")}}]),e}();function U(){return{getAllLabels:p.getAllLabels.bind(p),isRecognizedPeriod:p.isRecognizedPeriod.bind(p),get:p.get.bind(p),parse:p.parse.bind(p),parseDate:E,format:S,RangePeriod:R,todayIsInRange:T}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e,t){for(var n=0;n1?t-1:0),r=1;r1?t-1:0),r=1;r1?n-1:0),a=1;a1?t-1:0),r=1;r1?n-1:0),a=1;a=0;e-=1)this[e]&&4!==this[e].readyState||this.splice(e,1)},window.globalAjaxQueue.push=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r=0;e-=1)this[e]&&4!==this[e].readyState||this.splice(e,1)},window.globalAjaxQueue.push=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=new e;return n.withTokenInUrl&&r.withTokenInUrl(),r.setFormat("json"),r.addParams(Se({module:"API",format:"json"},t),"get"),n.postParams&&r.addParams(n.postParams,"post"),r.send()}}]),e}();function $e(){return globalAjaxQueue}window.ajaxHelper=Ne,angular.module("piwikApp.service").service("globalAjaxQueue",$e); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Ae={mounted:function(e,t){var n={};$(e).addClass("matomo-dropdown-menu");var r=!!$(e).parent().closest(".dropdown-content").length;r&&(n={hover:!0},$(e).addClass("submenu"),$(t.value.activates).addClass("submenu-dropdown-content"),$(e).parents(".dropdown-content").addClass("submenu-container")),$(e).dropdown(n)}}; + */var Be={mounted:function(e,t){var n={};$(e).addClass("matomo-dropdown-menu");var r=!!$(e).parent().closest(".dropdown-content").length;r&&(n={hover:!0},$(e).addClass("submenu"),$(t.value.activates).addClass("submenu-dropdown-content"),$(e).parents(".dropdown-content").addClass("submenu-container")),$(e).dropdown(n)}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Be(e){return{restrict:"A",link:function(t,n,r){var a={instance:null,value:{activates:$("#".concat(r.activates))[0]},oldValue:null,modifiers:{},dir:{}};e((function(){Ae.mounted(n[0],a)}))}}} + */function He(e){return{restrict:"A",link:function(t,n,r){var a={instance:null,value:{activates:$("#".concat(r.activates))[0]},oldValue:null,modifiers:{},dir:{}};e((function(){Be.mounted(n[0],a)}))}}} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Me(e,t,n){var r=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,r||e.contains(n.target)||t.value&&t.value.blur()}function Ne(e,t){t.value.hasScrolled=!0}function Fe(e,t){t.value.isMouseDown=!0,t.value.hasScrolled=!1}function Ve(e,t,n){27===n.which&&setTimeout((function(){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.blur&&t.value.blur()}),0)}Be.$inject=["$timeout"],angular.module("piwikApp").directive("piwikDropdownMenu",Be);var Le=document.documentElement,Re={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onEscapeHandler=Ve.bind(null,e,t),t.value.onMouseDown=Fe.bind(null,e,t),t.value.onClickOutsideElement=Me.bind(null,e,t),t.value.onScroll=Ne.bind(null,e,t),Le.addEventListener("keyup",t.value.onEscapeHandler),Le.addEventListener("mousedown",t.value.onMouseDown),Le.addEventListener("mouseup",t.value.onClickOutsideElement),Le.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){Le.removeEventListener("keyup",t.value.onEscapeHandler),Le.removeEventListener("mousedown",t.value.onMouseDown),Le.removeEventListener("mouseup",t.value.onClickOutsideElement),Le.removeEventListener("scroll",t.value.onScroll)}}; +function Ae(e,t,n){var r=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,r||e.contains(n.target)||t.value&&t.value.blur()}function Me(e,t){t.value.hasScrolled=!0}function Fe(e,t){t.value.isMouseDown=!0,t.value.hasScrolled=!1}function Ve(e,t,n){27===n.which&&setTimeout((function(){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.blur&&t.value.blur()}),0)}He.$inject=["$timeout"],angular.module("piwikApp").directive("piwikDropdownMenu",He);var Le=document.documentElement,Re={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onEscapeHandler=Ve.bind(null,e,t),t.value.onMouseDown=Fe.bind(null,e,t),t.value.onClickOutsideElement=Ae.bind(null,e,t),t.value.onScroll=Me.bind(null,e,t),Le.addEventListener("keyup",t.value.onEscapeHandler),Le.addEventListener("mousedown",t.value.onMouseDown),Le.addEventListener("mouseup",t.value.onClickOutsideElement),Le.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){Le.removeEventListener("keyup",t.value.onEscapeHandler),Le.removeEventListener("mousedown",t.value.onMouseDown),Le.removeEventListener("mouseup",t.value.onClickOutsideElement),Le.removeEventListener("scroll",t.value.onScroll)}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Ue(){return{restrict:"A",link:function(e,t,n){var r={instance:null,value:{blur:function(){setTimeout((function(){e.$apply(n.piwikFocusAnywhereButHere)}),0)}},oldValue:null,modifiers:{},dir:{}};Re.mounted(t[0],r),t.on("$destroy",(function(){return Re.unmounted(t[0],r)}))}}}Ue.$inject=[],angular.module("piwikApp.directive").directive("piwikFocusAnywhereButHere",Ue); +function Ue(){return{restrict:"A",link:function(e,t,n){var r={instance:null,value:{blur:function(){setTimeout((function(){e.$apply(n.piwikFocusAnywhereButHere)}),0)}},oldValue:null,modifiers:{},dir:{}};Re.mounted(t[0],r),t.on("$destroy",(function(){return Re.unmounted(t[0],r)}))}}} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var _e={updated:function(e,t){t.value.focusIf&&setTimeout((function(){e.focus(),t.value.afterFocus&&t.value.afterFocus()}),5)}}; + */ +function _e(e,t){t.arg&&setTimeout((function(){e.focus(),t.value.afterFocus&&t.value.afterFocus()}),5)}Ue.$inject=[],angular.module("piwikApp.directive").directive("piwikFocusAnywhereButHere",Ue);var Je={mounted:function(e,t){_e(e,t)},updated:function(e,t){_e(e,t)}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Je(){return{restrict:"A",link:function(e,t,n){e.$watch(n.piwikFocusIf,(function(n){var r={instance:null,value:{focusIf:!!n,afterFocus:function(){return e.$apply()}},oldValue:null,modifiers:{},dir:{}};_e.updated(t[0],r)}))}}} + */function Ge(){return{restrict:"A",link:function(e,t,n){e.$watch(n.piwikFocusIf,(function(n){var r={instance:null,arg:n?"1":void 0,value:{afterFocus:function(){return e.$apply()}},oldValue:null,modifiers:{},dir:{}};Je.updated(t[0],r)}))}}} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function qe(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&j.helper.setMarginLeftToBeInViewport(t)}function Ge(e,t,n){var r=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,r||e.contains(n.target)||e.classList.remove("expanded")}function Qe(e){e.value.hasScrolled=!0}function ze(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function Ye(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}angular.module("piwikApp.directive").directive("piwikFocusIf",Je);var We=document.documentElement,Ke={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=qe.bind(null,e),t.value.onEscapeHandler=Ye.bind(null,e,t),t.value.onMouseDown=ze.bind(null,t),t.value.onClickOutsideElement=Ge.bind(null,e,t),t.value.onScroll=Qe.bind(null,t),t.value.expander.addEventListener("click",t.value.onExpand),We.addEventListener("keyup",t.value.onEscapeHandler),We.addEventListener("mousedown",t.value.onMouseDown),We.addEventListener("mouseup",t.value.onClickOutsideElement),We.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){t.value.expander.removeEventListener("click",t.value.onExpand),We.removeEventListener("keyup",t.value.onEscapeHandler),We.removeEventListener("mousedown",t.value.onMouseDown),We.removeEventListener("mouseup",t.value.onClickOutsideElement),We.removeEventListener("scroll",t.value.onScroll)}}; +function qe(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&D.helper.setMarginLeftToBeInViewport(t)}function ze(e,t,n){var r=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,r||e.contains(n.target)||e.classList.remove("expanded")}function Qe(e){e.value.hasScrolled=!0}function Ye(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function We(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}angular.module("piwikApp.directive").directive("piwikFocusIf",Ge);var Ke=document.documentElement,Xe={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=qe.bind(null,e),t.value.onEscapeHandler=We.bind(null,e,t),t.value.onMouseDown=Ye.bind(null,t),t.value.onClickOutsideElement=ze.bind(null,e,t),t.value.onScroll=Qe.bind(null,t),t.value.expander.addEventListener("click",t.value.onExpand),Ke.addEventListener("keyup",t.value.onEscapeHandler),Ke.addEventListener("mousedown",t.value.onMouseDown),Ke.addEventListener("mouseup",t.value.onClickOutsideElement),Ke.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){t.value.expander.removeEventListener("click",t.value.onExpand),Ke.removeEventListener("keyup",t.value.onEscapeHandler),Ke.removeEventListener("mousedown",t.value.onMouseDown),Ke.removeEventListener("mouseup",t.value.onClickOutsideElement),Ke.removeEventListener("scroll",t.value.onScroll)}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Xe(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{expander:t.find(".title").first()[0]},oldValue:null,modifiers:{},dir:{}};Ke.mounted(t[0],n),t.on("$destroy",(function(){return Ke.unmounted(t[0],n)}))}}} +function Ze(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{expander:t.find(".title").first()[0]},oldValue:null,modifiers:{},dir:{}};Xe.mounted(t[0],n),t.on("$destroy",(function(){return Xe.unmounted(t[0],n)}))}}} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Ze(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&j.helper.setMarginLeftToBeInViewport(t)}function et(e){e.classList.remove("expanded")}function tt(e,t){e.contains(t.target)||e.classList.remove("expanded")}function nt(e,t){27===t.which&&e.classList.remove("expanded")}Xe.$inject=[],angular.module("piwikApp").directive("piwikExpandOnClick",Xe);var rt=document.documentElement,at={mounted:function(e,t){t.value.onMouseEnter=Ze.bind(null,e),t.value.onMouseLeave=et.bind(null,e),t.value.onClickOutsideElement=tt.bind(null,e),t.value.onEscapeHandler=nt.bind(null,e),t.value.expander.addEventListener("mouseenter",t.value.onMouseEnter),e.addEventListener("mouseleave",t.value.onMouseLeave),rt.addEventListener("keyup",t.value.onEscapeHandler),rt.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted:function(e,t){t.value.expander.removeEventListener("mouseenter",t.value.onMouseEnter),e.removeEventListener("mouseleave",t.value.onMouseLeave),document.removeEventListener("keyup",t.value.onEscapeHandler),document.removeEventListener("mouseup",t.value.onClickOutsideElement)}}; +function et(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&D.helper.setMarginLeftToBeInViewport(t)}function tt(e){e.classList.remove("expanded")}function nt(e,t){e.contains(t.target)||e.classList.remove("expanded")}function rt(e,t){27===t.which&&e.classList.remove("expanded")}Ze.$inject=[],angular.module("piwikApp").directive("piwikExpandOnClick",Ze);var at=document.documentElement,ot={mounted:function(e,t){t.value.onMouseEnter=et.bind(null,e),t.value.onMouseLeave=tt.bind(null,e),t.value.onClickOutsideElement=nt.bind(null,e),t.value.onEscapeHandler=rt.bind(null,e),t.value.expander.addEventListener("mouseenter",t.value.onMouseEnter),e.addEventListener("mouseleave",t.value.onMouseLeave),at.addEventListener("keyup",t.value.onEscapeHandler),at.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted:function(e,t){t.value.expander.removeEventListener("mouseenter",t.value.onMouseEnter),e.removeEventListener("mouseleave",t.value.onMouseLeave),document.removeEventListener("keyup",t.value.onEscapeHandler),document.removeEventListener("mouseup",t.value.onClickOutsideElement)}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function ot(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{expander:t.find(".title").first()[0]},oldValue:null,modifiers:{},dir:{}};at.mounted(t[0],n),t.on("$destroy",(function(){return at.unmounted(t[0],n)}))}}}ot.$inject=[],angular.module("piwikApp").directive("piwikExpandOnHover",ot);var it={ref:"root"};function lt(e,t,n,r,a,i){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",it,[Object(o["renderSlot"])(e.$slots,"default")],512)),[[o["vShow"],e.modelValue]])}var ct=Object(o["defineComponent"])({props:{modelValue:{type:Boolean,required:!0},element:{type:HTMLElement,required:!1}},emits:["yes","no","closeEnd","close","update:modelValue"],activated:function(){this.$emit("update:modelValue",!1)},watch:{modelValue:function(e,t){var n=this;if(e){var r=this.element||this.$refs.root.firstElementChild;j.helper.modalConfirm(r,{yes:function(){n.$emit("yes")},no:function(){n.$emit("no")},validation:function(){n.$emit("validation")}},{onCloseEnd:function(){n.element||n.$refs.root.appendChild(r),n.$emit("update:modelValue",!1),n.$emit("closeEnd")}})}else!1===e&&!0===t&&this.$emit("close")}}});ct.render=lt;var st=ct;function ut(e,t){return ht(e)||mt(e,t)||pt(e,t)||dt()}function dt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pt(e,t){if(e){if("string"===typeof e)return ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ft(e,t):void 0}}function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n')),c}return Object.entries(r).forEach((function(e){var t=dt(e,2),n=t[0],r=t[1];r.vue||(r.vue=n),r.angularJsBind&&(v[n]=r.angularJsBind)})),g.$inject=c||[],angular.module("piwikApp").directive(s,g),g} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var vt=0;function gt(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/[A-Z]/g,(function(e){return"-".concat(e.toLowerCase())}))}function bt(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))}function yt(e){var t=e.component,n=e.scope,r=void 0===n?{}:n,a=e.events,i=void 0===a?{}:a,l=e.$inject,c=e.directiveName,s=e.transclude,u=e.mountPointFactory,d=e.postCreate,p=e.noScope,f=e.restrict,m=void 0===f?"A":f,h=vt;s&&(vt+=1);var v={};function g(){for(var e=arguments.length,n=new Array(e),a=0;a')),l}return Object.entries(r).forEach((function(e){var t=ut(e,2),n=t[0],r=t[1];r.vue||(r.vue=n),r.angularJsBind&&(v[n]=r.angularJsBind)})),g.$inject=l||[],angular.module("piwikApp").directive(c,g),g} + */wt({component:ut,scope:{show:{vue:"modelValue",default:!1},element:{default:function(e,t){return t[0]}}},events:{yes:function(e,t,n,r){r.yes&&(t.$eval(r.yes),setTimeout((function(){t.$apply()}),0))},no:function(e,t,n,r){r.no&&(t.$eval(r.no),setTimeout((function(){t.$apply()}),0))},validation:function(e,t,n,r){r.no&&(t.$eval(r.no),setTimeout((function(){t.$apply()}),0))},close:function(e,t,n,r){r.close&&(t.$eval(r.close),setTimeout((function(){t.$apply()}),0))},"update:modelValue":function(e,t,n,r,a){setTimeout((function(){t.$apply(a(r.piwikDialog).assign(t,e))}),0)}},$inject:["$parse"],directiveName:"piwikDialog",transclude:!0,mountPointFactory:function(e,t){var n=$('
');return n.appendTo(t),n[0]},postCreate:function(e,t,n,r){t.$watch(r.piwikDialog,(function(t,n){n!==t&&(e.modelValue=t||!1)}))},noScope:!0});var kt={key:0,class:"title",tabindex:"6"},Ot=["href","title"],jt={class:"iconsBar"},Dt=["href","title"],Ct=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),St=[Ct],Pt=["title"],Et=Object(o["createElementVNode"])("span",{class:"icon-info"},null,-1),Tt=[Et],xt={class:"ratingIcons"},It={class:"inlineHelp"},Nt=["innerHTML"],$t=["href"];function Bt(e,t,n,r,a,i){var c=Object(o["resolveComponent"])("RateFeature");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"enrichedHeadline",onMouseenter:t[1]||(t[1]=function(t){return e.showIcons=!0}),onMouseleave:t[2]||(t[2]=function(t){return e.showIcons=!1}),ref:"root"},[e.editUrl?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",kt,[Object(o["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.$sanitize(e.actualFeatureName))},[Object(o["renderSlot"])(e.$slots,"default")],8,Ot)):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",jt,[e.helpUrl&&!e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},St,8,Dt)):Object(o["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(o["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},Tt,10,Pt)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",xt,[Object(o["createVNode"])(c,{title:e.actualFeatureName},null,8,["title"])])],512),[[o["vShow"],e.showIcons||e.showInlineHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",It,[Object(o["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,Nt),e.helpUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(o["toDisplayString"])(e.translate("General_MoreDetails")),9,$t)):Object(o["createCommentVNode"])("",!0)],512),[[o["vShow"],e.showInlineHelp]])],544)}var Ht=Object(o["defineAsyncComponent"])((function(){return new Promise((function(e){window.$(document).ready((function(){e(window.Feedback.RateFeature)}))}))})),At=Object(o["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:Ht},data:function(){return{showIcons:!1,showInlineHelp:!1,actualFeatureName:this.featureName,actualInlineHelp:this.inlineHelp}},watch:{inlineHelp:function(e){this.actualInlineHelp=e},featureName:function(e){this.actualFeatureName=e}},mounted:function(){var e=this,t=this.$refs.root;setTimeout((function(){if(!e.actualInlineHelp){var n=t.querySelector(".title .inlineHelp");if(!n&&t.parentElement.nextElementSibling&&(n=t.parentElement.nextElementSibling.querySelector(".reportDocumentation")),n){var r=n.getAttribute("data-content").trim();r.length&&(e.actualInlineHelp="

".concat(r,"

"),setTimeout((function(){return n.remove()}),0))}}e.actualFeatureName||(e.actualFeatureName=t.querySelector(".title").textContent),e.reportGenerated&&p.parse(D.period,D.currentDateString).containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:e.reportGenerated,items:"div",show:!1,hide:!1})}))}});At.render=Bt;var Mt=At,Ft=(wt({component:Mt,scope:{helpUrl:{angularJsBind:"@"},editUrl:{angularJsBind:"@"},reportGenerated:{angularJsBind:"@?"},featureName:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@?"}},directiveName:"piwikEnrichedHeadline",transclude:!0}),{class:"card",ref:"root"}),Vt={class:"card-content"},Lt={key:0,class:"card-title"},Rt={key:1,class:"card-title"},Ut={ref:"content"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */yt({component:st,scope:{show:{vue:"modelValue",default:!1},element:{default:function(e,t){return t[0]}}},events:{yes:function(e,t,n,r){r.yes&&(t.$eval(r.yes),setTimeout((function(){t.$apply()}),0))},no:function(e,t,n,r){r.no&&(t.$eval(r.no),setTimeout((function(){t.$apply()}),0))},validation:function(e,t,n,r){r.no&&(t.$eval(r.no),setTimeout((function(){t.$apply()}),0))},close:function(e,t,n,r){r.close&&(t.$eval(r.close),setTimeout((function(){t.$apply()}),0))},"update:modelValue":function(e,t,n,r,a){setTimeout((function(){t.$apply(a(r.piwikDialog).assign(t,e))}),0)}},$inject:["$parse"],directiveName:"piwikDialog",transclude:!0,mountPointFactory:function(e,t){var n=$('
');return n.appendTo(t),n[0]},postCreate:function(e,t,n,r){t.$watch(r.piwikDialog,(function(t,n){n!==t&&(e.modelValue=t||!1)}))},noScope:!0});var wt={key:0,class:"title",tabindex:"6"},kt=["href","title"],Dt={class:"iconsBar"},Ot=["href","title"],jt=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),Ct=[jt],Pt=["title"],St=Object(o["createElementVNode"])("span",{class:"icon-info"},null,-1),Et=[St],Tt={class:"ratingIcons"},xt={class:"inlineHelp"},It=["innerHTML"],$t=["href"];function Ht(e,t,n,r,a,i){var l=Object(o["resolveComponent"])("RateFeature");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"enrichedHeadline",onMouseenter:t[1]||(t[1]=function(t){return e.showIcons=!0}),onMouseleave:t[2]||(t[2]=function(t){return e.showIcons=!1}),ref:"root"},[e.editUrl?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",wt,[Object(o["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.$sanitize(e.actualFeatureName))},[Object(o["renderSlot"])(e.$slots,"default")],8,kt)):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",Dt,[e.helpUrl&&!e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},Ct,8,Ot)):Object(o["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(o["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},Et,10,Pt)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Tt,[Object(o["createVNode"])(l,{title:e.actualFeatureName},null,8,["title"])])],512),[[o["vShow"],e.showIcons||e.showInlineHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",xt,[Object(o["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,It),e.helpUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(o["toDisplayString"])(e.translate("General_MoreDetails")),9,$t)):Object(o["createCommentVNode"])("",!0)],512),[[o["vShow"],e.showInlineHelp]])],544)}var At=Object(o["defineAsyncComponent"])((function(){return new Promise((function(e){window.$(document).ready((function(){e(window.Feedback.RateFeature)}))}))})),Bt=Object(o["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:At},data:function(){return{showIcons:!1,showInlineHelp:!1,actualFeatureName:this.featureName,actualInlineHelp:this.inlineHelp}},watch:{inlineHelp:function(e){this.actualInlineHelp=e},featureName:function(e){this.actualFeatureName=e}},mounted:function(){var e=this,t=this.$refs.root;setTimeout((function(){if(!e.actualInlineHelp){var n=t.querySelector(".title .inlineHelp");if(!n&&t.parentElement.nextElementSibling&&(n=t.parentElement.nextElementSibling.querySelector(".reportDocumentation")),n){var r=n.getAttribute("data-content").trim();r.length&&(e.actualInlineHelp="

".concat(r,"

"),setTimeout((function(){return n.remove()}),0))}}e.actualFeatureName||(e.actualFeatureName=t.querySelector(".title").textContent),e.reportGenerated&&p.parse(j.period,j.currentDateString).containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:e.reportGenerated,items:"div",show:!1,hide:!1})}))}});Bt.render=Ht;var Mt=Bt,Nt=(yt({component:Mt,scope:{helpUrl:{angularJsBind:"@"},editUrl:{angularJsBind:"@"},reportGenerated:{angularJsBind:"@?"},featureName:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@?"}},directiveName:"piwikEnrichedHeadline",transclude:!0}),{class:"card",ref:"root"}),Ft={class:"card-content"},Vt={key:0,class:"card-title"},Lt={key:1,class:"card-title"},Rt={ref:"content"}; + */function _t(e,t,n,r,a,i){var c=Object(o["resolveComponent"])("EnrichedHeadline");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ft,[Object(o["createElementVNode"])("div",Vt,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",Lt,Object(o["toDisplayString"])(e.contentTitle),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",Rt,[Object(o["createVNode"])(c,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.contentTitle),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Ut,[Object(o["renderSlot"])(e.$slots,"default")],512)])],512)}var Jt=null,Gt=Object(o["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:Mt},data:function(){return{actualFeature:this.feature,actualHelpText:this.helpText}},watch:{feature:function(e){this.actualFeature=e},helpText:function(e){this.actualHelpText=e}},mounted:function(){var e,t=this,n=this.$refs,r=n.root,a=n.content;if(this.anchor){var o=document.createElement("a");o.id=this.anchor,r.parentElement.prepend(o)}if(setTimeout((function(){var e=a.querySelector(".contentHelp");e&&(t.actualHelpText=e.innerHTML,e.remove())}),0),!this.actualFeature||!0!==this.actualFeature&&"true"!==this.actualFeature||(this.actualFeature=this.contentTitle),null===Jt&&(Jt=document.querySelector("#content.admin")),Jt&&(e=Jt.offsetTop),e||0===e){var i=r.closest("[piwik-widget-loader]"),c=i?i.offsetTop:r.offsetTop;c-e<17&&(r.style.marginTop=0)}}});Gt.render=_t;var qt=Gt; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Ut(e,t,n,r,a,i){var l=Object(o["resolveComponent"])("EnrichedHeadline");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Nt,[Object(o["createElementVNode"])("div",Ft,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",Vt,Object(o["toDisplayString"])(e.contentTitle),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",Lt,[Object(o["createVNode"])(l,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.contentTitle),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Rt,[Object(o["renderSlot"])(e.$slots,"default")],512)])],512)}var _t=null,Jt=Object(o["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:Mt},data:function(){return{actualFeature:this.feature,actualHelpText:this.helpText}},watch:{feature:function(e){this.actualFeature=e},helpText:function(e){this.actualHelpText=e}},mounted:function(){var e,t=this,n=this.$refs,r=n.root,a=n.content;if(this.anchor){var o=document.createElement("a");o.id=this.anchor,r.parentElement.prepend(o)}if(setTimeout((function(){var e=a.querySelector(".contentHelp");e&&(t.actualHelpText=e.innerHTML,e.remove())}),0),!this.actualFeature||!0!==this.actualFeature&&"true"!==this.actualFeature||(this.actualFeature=this.contentTitle),null===_t&&(_t=document.querySelector("#content.admin")),_t&&(e=_t.offsetTop),e||0===e){var i=r.closest("[piwik-widget-loader]"),l=i?i.offsetTop:r.offsetTop;l-e<17&&(r.style.marginTop=0)}}});Jt.render=Ut;var qt=Jt; + */wt({component:qt,scope:{contentTitle:{angularJsBind:"@"},feature:{angularJsBind:"@"},helpUrl:{angularJsBind:"@"},helpText:{angularJsBind:"@"},anchor:{angularJsBind:"@?"}},directiveName:"piwikContentBlock",transclude:!0});function zt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qt(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1||this.periodComparisons.value.length>1)}},{key:"isComparingPeriods",value:function(){return this.getPeriodComparisons().length>1}},{key:"getSegmentComparisons",value:function(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}},{key:"getPeriodComparisons",value:function(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}},{key:"getSeriesColor",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getComparisonSeriesIndex(t.index,e.index)%pn;if(0===n)return this.colors["series".concat(r)];var a=n%fn;return this.colors["series".concat(r,"-shade").concat(a)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%pn);return t>0&&(n+="-shade".concat(t%fn)),n}},{key:"isComparisonEnabled",value:function(){return this.isEnabled.value}},{key:"getIndividualComparisonRowIndices",value:function(e){var t=this.getSegmentComparisons().length,n=e%t,r=Math.floor(e/t);return{segmentIndex:n,periodIndex:r}}},{key:"getComparisonSeriesIndex",value:function(e,t){var n=this.getSegmentComparisons().length;return e*n+t}},{key:"getAllComparisonSeries",value:function(){var e=this,t=[],n=0;return this.getPeriodComparisons().forEach((function(r){e.getSegmentComparisons().forEach((function(a){t.push({index:n,params:cn(cn({},a.params),r.params),color:e.colors["series".concat(n)]}),n+=1}))})),t}},{key:"removeSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=Zt(this.segmentComparisons.value);t.splice(e,1);var n={};0===e&&(n.segment=t[0].params.segment),this.updateQueryParamsFromComparisons(t,this.periodComparisons.value,n)}},{key:"addSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=this.segmentComparisons.value.concat([{params:e,index:-1,title:""}]);this.updateQueryParamsFromComparisons(t,this.periodComparisons.value)}},{key:"updateQueryParamsFromComparisons",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},a={},o=!1,i=!1;e.forEach((function(e){o?r[e.params.segment]=!0:o=!0})),t.forEach((function(e){i?a["".concat(e.params.period,"|").concat(e.params.date)]=!0:i=!0}));var c=[],s=[];Object.keys(a).forEach((function(e){var t=e.split("|");c.push(t[0]),s.push(t[1])}));var l={compareSegments:Object.keys(r),comparePeriods:c,compareDates:s};if(D.helper.isAngularRenderingThePage()){var u=ke.hashParsed.value,d=cn(cn(cn({},u),l),n);return delete d["compareSegments[]"],delete d["comparePeriods[]"],delete d["compareDates[]"],void(JSON.stringify(d)!==JSON.stringify(u)&&ke.updateHash(d))}var p=[];["compareSegments","comparePeriods","compareDates"].forEach((function(e){l[e].length||p.push(e)}));var f=ke.stringify(n),m=ke.stringify(l);window.broadcast.propagateNewPage(f,void 0,m,p)}},{key:"getAllSeriesColors",value:function(){var e=D.ColorManager;if(!e)return[];for(var t=[],n=0;n"+decodeURIComponent(t.params.segment)},[Object(o["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(o["toDisplayString"])(t.title),9,wn)],8,yn),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.periodComparisons,(function(n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(o["createElementVNode"])("span",{class:"comparison-dot",style:Object(o["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(o["createElementVNode"])("span",On,Object(o["toDisplayString"])(n.title)+" ("+Object(o["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,kn)})),128)),e.segmentComparisons.length>1?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(o["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,Dn)],8,jn)):Object(o["createCommentVNode"])("",!0)])})),128)),Object(o["createElementVNode"])("div",Cn,[Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Sn),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)):Object(o["createCommentVNode"])("",!0)}function En(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tn(e){for(var t=1;t"))},show:{delay:200,duration:200},hide:!1})},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,vn.isComparing()){var t=vn.getPeriodComparisons(),n=vn.getSegmentComparisons();Ne.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:ke.getSearchParam("compareSegments"),comparePeriods:ke.getSearchParam("comparePeriods"),compareDates:ke.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var a=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=a}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=vn.getComparisonSeriesIndex(t.index,0),a=e.reportData.comparisons[r],o=vn.getComparisonSeriesIndex(t.index,n.index),i=e.reportData.comparisons[o],c=e.reportData.comparisons[n.index],s='
',l=(i.nb_visits/a.nb_visits*100).toFixed(2);return l="".concat(l,"%"),s+=C("General_ComparisonCardTooltip1",["'".concat(i.compareSegmentPretty,"'"),i.comparePeriodPretty,l,i.nb_visits.toString(),a.nb_visits.toString()]),t.index>0&&(s+="

",s+=C("General_ComparisonCardTooltip2",[i.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),s+="
",s}},updated:function(){var e=this;setTimeout((function(){return e.setUpTooltips()}))},mounted:function(){var e=this;D.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged(),setTimeout((function(){return e.setUpTooltips()}))},beforeUnmount:function(){try{window.$(this.refs.root).tooltip("destroy")}catch(e){}}});In.render=Pn;var Nn=In; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var dn=8,pn=3;function fn(e){return e?e instanceof Array?e:[e]:[]}var mn=function(){function e(){var t=this;ln(this,e),un(this,"privateState",Object(o["reactive"])({comparisonsDisabledFor:[]})),un(this,"state",Object(o["readonly"])(this.privateState)),un(this,"colors",{}),un(this,"segmentComparisons",Object(o["computed"])((function(){return t.parseSegmentComparisons()}))),un(this,"periodComparisons",Object(o["computed"])((function(){return t.parsePeriodComparisons()}))),un(this,"isEnabled",Object(o["computed"])((function(){return t.checkEnabledForCurrentPage()}))),this.loadComparisonsDisabledFor(),$((function(){t.colors=t.getAllSeriesColors()})),Object(o["watch"])((function(){return t.getComparisons()}),(function(){return j.postEvent("piwikComparisonsChanged")}),{deep:!0})}return sn(e,[{key:"getComparisons",value:function(){return this.getSegmentComparisons().concat(this.getPeriodComparisons())}},{key:"isComparing",value:function(){return this.isComparisonEnabled()&&(this.segmentComparisons.value.length>1||this.periodComparisons.value.length>1)}},{key:"isComparingPeriods",value:function(){return this.getPeriodComparisons().length>1}},{key:"getSegmentComparisons",value:function(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}},{key:"getPeriodComparisons",value:function(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}},{key:"getSeriesColor",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getComparisonSeriesIndex(t.index,e.index)%dn;if(0===n)return this.colors["series".concat(r)];var a=n%pn;return this.colors["series".concat(r,"-shade").concat(a)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%dn);return t>0&&(n+="-shade".concat(t%pn)),n}},{key:"isComparisonEnabled",value:function(){return this.isEnabled.value}},{key:"getIndividualComparisonRowIndices",value:function(e){var t=this.getSegmentComparisons().length,n=e%t,r=Math.floor(e/t);return{segmentIndex:n,periodIndex:r}}},{key:"getComparisonSeriesIndex",value:function(e,t){var n=this.getSegmentComparisons().length;return e*n+t}},{key:"getAllComparisonSeries",value:function(){var e=this,t=[],n=0;return this.getPeriodComparisons().forEach((function(r){e.getSegmentComparisons().forEach((function(a){t.push({index:n,params:on(on({},a.params),r.params),color:e.colors["series".concat(n)]}),n+=1}))})),t}},{key:"removeSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=Xt(this.segmentComparisons.value);t.splice(e,1);var n={};0===e&&(n.segment=t[0].params.segment),this.updateQueryParamsFromComparisons(t,this.periodComparisons.value,n)}},{key:"addSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=this.segmentComparisons.value.concat([{params:e,index:-1,title:""}]);this.updateQueryParamsFromComparisons(t,this.periodComparisons.value)}},{key:"updateQueryParamsFromComparisons",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},a={},o=!1,i=!1;e.forEach((function(e){o?r[e.params.segment]=!0:o=!0})),t.forEach((function(e){i?a["".concat(e.params.period,"|").concat(e.params.date)]=!0:i=!0}));var l=[],c=[];Object.keys(a).forEach((function(e){var t=e.split("|");l.push(t[0]),c.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:l,compareDates:c};if(j.helper.isAngularRenderingThePage()){var u=ke.hashParsed.value,d=on(on(on({},u),s),n);return delete d["compareSegments[]"],delete d["comparePeriods[]"],delete d["compareDates[]"],void(JSON.stringify(d)!==JSON.stringify(u)&&ke.updateHash(d))}var p=[];["compareSegments","comparePeriods","compareDates"].forEach((function(e){s[e].length||p.push(e)}));var f=ke.stringify(n),m=ke.stringify(s);window.broadcast.propagateNewPage(f,void 0,m,p)}},{key:"getAllSeriesColors",value:function(){var e=j.ColorManager;if(!e)return[];for(var t=[],n=0;n"+decodeURIComponent(t.params.segment)},[Object(o["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(o["toDisplayString"])(t.title),9,yn)],8,bn),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.periodComparisons,(function(n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(o["createElementVNode"])("span",{class:"comparison-dot",style:Object(o["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(o["createElementVNode"])("span",kn,Object(o["toDisplayString"])(n.title)+" ("+Object(o["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,wn)})),128)),e.segmentComparisons.length>1?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(o["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,On)],8,Dn)):Object(o["createCommentVNode"])("",!0)])})),128)),Object(o["createElementVNode"])("div",jn,[Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Cn),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)):Object(o["createCommentVNode"])("",!0)}function Sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function En(e){for(var t=1;t"))},show:{delay:200,duration:200},hide:!1})},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,hn.isComparing()){var t=hn.getPeriodComparisons(),n=hn.getSegmentComparisons();$e.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:ke.getSearchParam("compareSegments"),comparePeriods:ke.getSearchParam("comparePeriods"),compareDates:ke.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var a=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=a}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=hn.getComparisonSeriesIndex(t.index,0),a=e.reportData.comparisons[r],o=hn.getComparisonSeriesIndex(t.index,n.index),i=e.reportData.comparisons[o],l=e.reportData.comparisons[n.index],c='
',s=(i.nb_visits/a.nb_visits*100).toFixed(2);return s="".concat(s,"%"),c+=C("General_ComparisonCardTooltip1",["'".concat(i.compareSegmentPretty,"'"),i.comparePeriodPretty,s,i.nb_visits.toString(),a.nb_visits.toString()]),t.index>0&&(c+="

",c+=C("General_ComparisonCardTooltip2",[i.nb_visits_change.toString(),l.compareSegmentPretty,l.comparePeriodPretty])),c+="
",c}},updated:function(){var e=this;setTimeout((function(){return e.setUpTooltips()}))},mounted:function(){var e=this;j.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged(),setTimeout((function(){return e.setUpTooltips()}))},beforeUnmount:function(){try{window.$(this.refs.root).tooltip("destroy")}catch(e){}}});xn.render=Pn;var In=xn; + */function $n(){return vn}$n.$inject=[],angular.module("piwikApp.service").factory("piwikComparisonsService",$n);wt({component:Nn,directiveName:"piwikComparisons",restrict:"E"});var Bn={ref:"root",class:"menuDropdown"},Hn=["title"],An=["innerHTML"],Mn=Object(o["createElementVNode"])("span",{class:"icon-arrow-bottom"},null,-1),Fn={class:"items"},Vn={key:0,class:"search"},Ln=["placeholder"],Rn=["title"],Un=["title"];function _n(e,t,n,r,a,i){var c=Object(o["resolveDirective"])("focus-if"),s=Object(o["resolveDirective"])("focus-anywhere-but-here");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Bn,[Object(o["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,An),Mn],8,Hn),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Fn,[e.showSearch&&e.showItems?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Vn,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),onKeydown:t[2]||(t[2]=function(t){return e.onSearchTermKeydown(t)}),placeholder:e.translate("General_Search")},null,40,Ln),[[o["vModelText"],e.searchTerm],[c,{},e.showItems]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("img",{class:"search_ico",src:"plugins/Morpheus/images/search_ico.png",title:e.translate("General_Search")},null,8,Rn),[[o["vShow"],!e.searchTerm]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("img",{onClick:t[3]||(t[3]=function(t){e.searchTerm="",e.searchItems("")}),class:"reset",src:"plugins/CoreHome/images/reset_search.png",title:e.translate("General_Clear")},null,8,Un),[[o["vShow"],e.searchTerm]])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(o["renderSlot"])(e.$slots,"default")])],512),[[o["vShow"],e.showItems]])],512)),[[s,{blur:e.lostFocus}]])}var Jn=window,Gn=Jn.$,qn=Object(o["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:String},directives:{FocusAnywhereButHere:Re,FocusIf:Je},emits:["afterSelect"],watch:{menuTitle:function(){this.actualMenuTitle=this.menuTitle}},data:function(){return{showItems:!1,searchTerm:"",actualMenuTitle:this.menuTitle}},methods:{lostFocus:function(){this.showItems=!1},selectItem:function(e){var t=e.target.classList;!t.contains("item")||t.contains("disabled")||t.contains("separator")||(!1!==this.menuTitleChangeOnClick&&(this.actualMenuTitle=e.target.textContent.replace(/[\u0000-\u2666]/g,(function(e){return"&#".concat(e.charCodeAt(0),";")}))),this.showItems=!1,Gn(this.$slots.default()).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect"))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();Gn(this.$refs.root).find(".item").each((function(e,n){var r=Gn(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});qn.render=_n;var zn=qn,Qn=(wt({component:zn,scope:{menuTitle:{angularJsBind:"@"},tooltip:{angularJsBind:"@"},showSearch:{angularJsBind:"="},menuTitleChangeOnClick:{angularJsBind:"="}},directiveName:"piwikMenudropdown",transclude:!0,events:{"after-select":function(e,t){setTimeout((function(){t.$apply()}),0)}}}),{ref:"root"}); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function $n(){return hn}$n.$inject=[],angular.module("piwikApp.service").factory("piwikComparisonsService",$n);yt({component:In,directiveName:"piwikComparisons",restrict:"E"});var Hn={ref:"root",class:"menuDropdown"},An=["title"],Bn=["innerHTML"],Mn=Object(o["createElementVNode"])("span",{class:"icon-arrow-bottom"},null,-1),Nn={class:"items"},Fn={key:0,class:"search"},Vn=["placeholder"],Ln=["title"],Rn=["title"];function Un(e,t,n,r,a,i){var l=Object(o["resolveDirective"])("focus-anywhere-but-here");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Hn,[Object(o["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,Bn),Mn],8,An),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Nn,[e.showSearch&&e.showItems?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Fn,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),onKeydown:t[2]||(t[2]=function(t){return e.onSearchTermKeydown(t)}),placeholder:e.translate("General_Search")},null,40,Vn),[[o["vModelText"],e.searchTerm]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("img",{class:"search_ico",src:"plugins/Morpheus/images/search_ico.png",title:e.translate("General_Search")},null,8,Ln),[[o["vShow"],!e.searchTerm]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("img",{onClick:t[3]||(t[3]=function(t){e.searchTerm="",e.searchItems("")}),class:"reset",src:"plugins/CoreHome/images/reset_search.png",title:e.translate("General_Clear")},null,8,Rn),[[o["vShow"],e.searchTerm]])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(o["renderSlot"])(e.$slots,"default")])],512),[[o["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var _n=window,Jn=_n.$,qn=Object(o["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:String},directives:{FocusAnywhereButHere:Re,FocusIf:_e},emits:["afterSelect"],watch:{menuTitle:function(){this.actualMenuTitle=this.menuTitle}},data:function(){return{showItems:!1,searchTerm:"",actualMenuTitle:this.menuTitle}},methods:{lostFocus:function(){this.showItems=!1},selectItem:function(e){var t=e.target.classList;!t.contains("item")||t.contains("disabled")||t.contains("separator")||(!1!==this.menuTitleChangeOnClick&&(this.actualMenuTitle=e.target.textContent.replace(/[\u0000-\u2666]/g,(function(e){return"&#".concat(e.charCodeAt(0),";")}))),this.showItems=!1,Jn(this.$slots.default()).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect"))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();Jn(this.$refs.root).find(".item").each((function(e,n){var r=Jn(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});qn.render=Un;var Gn=qn,Qn=(yt({component:Gn,scope:{menuTitle:{angularJsBind:"@"},tooltip:{angularJsBind:"@"},showSearch:{angularJsBind:"="},menuTitleChangeOnClick:{angularJsBind:"="}},directiveName:"piwikMenudropdown",transclude:!0,events:{"after-select":function(e,t){setTimeout((function(){t.$apply()}),0)}}}),{ref:"root"}); + */function Yn(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qn,null,512)}function Wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t=e.selectedDateStart&&n<=e.selectedDateEnd?t.addClass("ui-datepicker-current-period"):t.removeClass("ui-datepicker-current-period"),e.highlightedDateStart&&e.highlightedDateEnd&&n>=e.highlightedDateStart&&n<=e.highlightedDateEnd){var a=r.length?r:t;a.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function a(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return i(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function i(e,t,n){var r,o=e.parent(),i=o.children("td");if(o.is(":first-child")){var c=o.children("td:not(.ui-datepicker-other-month)").first();return r=a(c,t,n),r.setDate(i.index(e)-i.index(c)+1),r}var s=o.children("td:not(.ui-datepicker-other-month)").last();return r=a(s,t,n),r.setDate(r.getDate()+i.index(e)-i.index(s)),r}function c(){var e=tr(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),a=parseInt(t.attr("data-year"),10);return[r,a]}function s(){var e=tr(n.value),t=e.find(".ui-datepicker-calendar"),o=c(),i=t.find("td"),s=i.first(),l=a(s,o[0],o[1]);i.each((function(){r(tr(this),l),l.setDate(l.getDate()+1)}))}function l(){var t=e.viewDate;if(!t)return!1;if(!(t instanceof Date))try{t=E(t)}catch(o){return!1}var r=tr(n.value),a=c();return(a[0]!==t.getMonth()||a[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function u(){var e=tr(n.value);e.find("td[data-event]").off("click"),e.find(".ui-state-active").removeClass("ui-state-active"),e.find(".ui-datepicker-current-day").removeClass("ui-datepicker-current-day"),e.find(".ui-datepicker-prev,.ui-datepicker-next").attr("href","")}function d(){var t=tr(n.value),r=e.stepMonths||Zn;if(t.datepicker("option","stepMonths")===r)return!1;var a=tr(".ui-datepicker-month",t).val(),o=tr(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(o,a)),u(),!0}function p(){var t=tr(n.value);t.find(".ui-datepicker-month").attr("disabled",e.disableMonthDropdown)}function f(){if(tr(this).hasClass("ui-state-hover")){var e=tr(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function m(){p(),s()}return Object(o["watch"])((function(){return Kn({},e)}),(function(e,t){var n=!1;["selectedDateStart","selectedDateEnd","highlightedDateStart","highlightedDateEnd"].forEach((function(r){n||(!e[r]&&t[r]&&(n=!0),e[r]&&!t[r]&&(n=!0),e[r]&&t[r]&&e[r].getTime()!==t[r].getTime()&&(n=!0))})),e.viewDate!==t.viewDate&&l()&&(n=!0),e.stepMonths!==t.stepMonths&&d(),e.enableDisableMonthDropdown!==t.enableDisableMonthDropdown&&p(),n&&s()})),Object(o["onMounted"])((function(){var r=tr(n.value),o=e.options||{},i=Kn(Kn(Kn({},D.getBaseDatePickerOptions()),o),{},{onChangeMonthYear:function(){setTimeout((function(){u()}))}});r.datepicker(i),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&s()})),r.on("mouseenter","tbody td",(function(){var e=c(),n=tr(this),r=a(n,e[0],e[1]);t.emit("cellHover",{date:r,$cell:n})})),r.on("mouseout","tbody td a",(function(){s()})),r.on("mouseleave","table",(function(){return t.emit("cellHoverLeave")})).on("mouseenter","thead",(function(){return t.emit("cellHoverLeave")})),r.on("click","tbody td.ui-datepicker-other-month",(function(){return f()})),r.on("click",(function(e){e.preventDefault();var t=tr(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&m()})),r.on("click","td[data-month]",(function(e){var n=tr(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),a=parseInt(n.attr("data-year"),10),o=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(a,r,o)})}));var h=d();l(),p(),h||u(),s()})),{root:n}}});nr.render=Yn;var rr=nr,ar=(wt({component:rr,scope:{selectedDateStart:{angularJsBind:"<"},selectedDateEnd:{angularJsBind:"<"},highlightedDateStart:{angularJsBind:"<"},highlightedDateEnd:{angularJsBind:"<"},viewDate:{angularJsBind:"<"},stepMonths:{angularJsBind:"<"},disableMonthDropdown:{angularJsBind:"<"},options:{angularJsBind:"<"},cellHover:{angularJsBind:"&"},cellHoverLeave:{angularJsBind:"&"},dateSelect:{angularJsBind:"&"}},directiveName:"piwikDatePicker",events:{"cell-hover":function(e,t,n,r,a){a()},"cell-hover-leave":function(e,t,n,r,a){a()},"date-select":function(e,t,n,r,a){a()}},$inject:["$timeout"]}),{id:"calendarRangeFrom"}),or={id:"calendarRangeTo"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function zn(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qn,null,512)}function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wn(e){for(var t=1;t=e.selectedDateStart&&n<=e.selectedDateEnd?t.addClass("ui-datepicker-current-period"):t.removeClass("ui-datepicker-current-period"),e.highlightedDateStart&&e.highlightedDateEnd&&n>=e.highlightedDateStart&&n<=e.highlightedDateEnd){var a=r.length?r:t;a.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function a(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return i(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function i(e,t,n){var r,o=e.parent(),i=o.children("td");if(o.is(":first-child")){var l=o.children("td:not(.ui-datepicker-other-month)").first();return r=a(l,t,n),r.setDate(i.index(e)-i.index(l)+1),r}var c=o.children("td:not(.ui-datepicker-other-month)").last();return r=a(c,t,n),r.setDate(r.getDate()+i.index(e)-i.index(c)),r}function l(){var e=er(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),a=parseInt(t.attr("data-year"),10);return[r,a]}function c(){var e=er(n.value),t=e.find(".ui-datepicker-calendar"),o=l(),i=t.find("td"),c=i.first(),s=a(c,o[0],o[1]);i.each((function(){r(er(this),s),s.setDate(s.getDate()+1)}))}function s(){var t=e.viewDate;if(!t)return!1;if(!(t instanceof Date))try{t=E(t)}catch(o){return!1}var r=er(n.value),a=l();return(a[0]!==t.getMonth()||a[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function u(){var e=er(n.value);e.find("td[data-event]").off("click"),e.find(".ui-state-active").removeClass("ui-state-active"),e.find(".ui-datepicker-current-day").removeClass("ui-datepicker-current-day"),e.find(".ui-datepicker-prev,.ui-datepicker-next").attr("href","")}function d(){var t=er(n.value),r=e.stepMonths||Xn;if(t.datepicker("option","stepMonths")===r)return!1;var a=er(".ui-datepicker-month",t).val(),o=er(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(o,a)),u(),!0}function p(){var t=er(n.value);t.find(".ui-datepicker-month").attr("disabled",e.disableMonthDropdown)}function f(){if(er(this).hasClass("ui-state-hover")){var e=er(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function m(){p(),c()}return Object(o["watch"])((function(){return Wn({},e)}),(function(e,t){var n=!1;["selectedDateStart","selectedDateEnd","highlightedDateStart","highlightedDateEnd"].forEach((function(r){n||(!e[r]&&t[r]&&(n=!0),e[r]&&!t[r]&&(n=!0),e[r]&&t[r]&&e[r].getTime()!==t[r].getTime()&&(n=!0))})),e.viewDate!==t.viewDate&&s()&&(n=!0),e.stepMonths!==t.stepMonths&&d(),e.enableDisableMonthDropdown!==t.enableDisableMonthDropdown&&p(),n&&c()})),Object(o["onMounted"])((function(){var r=er(n.value),o=e.options||{},i=Wn(Wn(Wn({},j.getBaseDatePickerOptions()),o),{},{onChangeMonthYear:function(){setTimeout((function(){u()}))}});r.datepicker(i),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&c()})),r.on("mouseenter","tbody td",(function(){var e=l(),n=er(this),r=a(n,e[0],e[1]);t.emit("cellHover",{date:r,$cell:n})})),r.on("mouseout","tbody td a",(function(){c()})),r.on("mouseleave","table",(function(){return t.emit("cellHoverLeave")})).on("mouseenter","thead",(function(){return t.emit("cellHoverLeave")})),r.on("click","tbody td.ui-datepicker-other-month",(function(){return f()})),r.on("click",(function(e){e.preventDefault();var t=er(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&m()})),r.on("click","td[data-month]",(function(e){var n=er(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),a=parseInt(n.attr("data-year"),10),o=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(a,r,o)})}));var h=d();s(),p(),h||u(),c()})),{root:n}}});tr.render=zn;var nr=tr,rr=(yt({component:nr,scope:{selectedDateStart:{angularJsBind:"<"},selectedDateEnd:{angularJsBind:"<"},highlightedDateStart:{angularJsBind:"<"},highlightedDateEnd:{angularJsBind:"<"},viewDate:{angularJsBind:"<"},stepMonths:{angularJsBind:"<"},disableMonthDropdown:{angularJsBind:"<"},options:{angularJsBind:"<"},cellHover:{angularJsBind:"&"},cellHoverLeave:{angularJsBind:"&"},dateSelect:{angularJsBind:"&"}},directiveName:"piwikDatePicker",events:{"cell-hover":function(e,t,n,r,a){a()},"cell-hover-leave":function(e,t,n,r,a){a()},"date-select":function(e,t,n,r,a){a()}},$inject:["$timeout"]}),{id:"calendarRangeFrom"}),ar={id:"calendarRangeTo"}; + */function ir(e,t,n,r,a,i){var c=Object(o["resolveComponent"])("DatePicker");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",ar,[Object(o["createElementVNode"])("h6",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",id:"inputCalendarFrom",name:"inputCalendarFrom",class:"browser-default","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDateText=t}),onChange:t[1]||(t[1]=function(t){return e.onRangeInputChanged("from",t)}),onKeyup:t[2]||(t[2]=function(t){return e.handleEnterPress(t)})},null,544),[[o["vModelText"],e.startDateText]])]),Object(o["createVNode"])(c,{id:"calendarFrom","view-date":e.startDate,"selected-date-start":e.fromPickerSelectedDates[0],"selected-date-end":e.fromPickerSelectedDates[1],"highlighted-date-start":e.fromPickerHighlightedDates[0],"highlighted-date-end":e.fromPickerHighlightedDates[1],onDateSelect:t[3]||(t[3]=function(t){return e.setStartRangeDate(t.date)}),onCellHover:t[4]||(t[4]=function(t){return e.fromPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)}),onCellHoverLeave:t[5]||(t[5]=function(t){return e.fromPickerHighlightedDates=[null,null]})},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])]),Object(o["createElementVNode"])("div",or,[Object(o["createElementVNode"])("h6",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",id:"inputCalendarTo",name:"inputCalendarTo",class:"browser-default","onUpdate:modelValue":t[6]||(t[6]=function(t){return e.endDateText=t}),onChange:t[7]||(t[7]=function(t){return e.onRangeInputChanged("to",t)}),onKeyup:t[8]||(t[8]=function(t){return e.handleEnterPress(t)})},null,544),[[o["vModelText"],e.endDateText]])]),Object(o["createVNode"])(c,{id:"calendarTo","view-date":e.endDate,"selected-date-start":e.toPickerSelectedDates[0],"selected-date-end":e.toPickerSelectedDates[1],"highlighted-date-start":e.toPickerHighlightedDates[0],"highlighted-date-end":e.toPickerHighlightedDates[1],onDateSelect:t[9]||(t[9]=function(t){return e.setEndRangeDate(t.date)}),onCellHover:t[10]||(t[10]=function(t){return e.toPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)}),onCellHoverLeave:t[11]||(t[11]=function(t){return e.toPickerHighlightedDates=[null,null]})},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])])],64)}var cr=Object(o["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:rr},data:function(){var e=null;try{e=E(this.startDate)}catch(n){}var t=null;try{t=E(this.endDate)}catch(n){}return{fromPickerSelectedDates:[e,e],toPickerSelectedDates:[t,t],fromPickerHighlightedDates:[null,null],toPickerHighlightedDates:[null,null],startDateText:this.startDate,endDateText:this.endDate}},emits:["rangeChange","submit"],watch:{startDate:function(){this.startDateText=this.startDate,this.setStartRangeDateFromStr(this.startDate)},endDate:function(){this.endDateText=this.endDate,this.setEndRangeDateFromStr(this.endDate)}},mounted:function(){this.rangeChanged()},methods:{setStartRangeDate:function(e){this.fromPickerSelectedDates=[e,e],this.rangeChanged()},setEndRangeDate:function(e){this.toPickerSelectedDates=[e,e],this.rangeChanged()},onRangeInputChanged:function(e,t){"from"===e?this.setStartRangeDateFromStr(t.target.value):this.setEndRangeDateFromStr(t.target.value)},getNewHighlightedDates:function(e,t){return t.hasClass("ui-datepicker-unselectable")?null:[e,e]},handleEnterPress:function(e){13===e.keyCode&&this.$emit("submit",{start:this.startDate,end:this.endDate})},setStartRangeDateFromStr:function(e){var t;try{t=E(e)}catch(n){this.startDateText=this.startDate}t&&(this.fromPickerSelectedDates=[t,t]),this.rangeChanged()},setEndRangeDateFromStr:function(e){var t;try{t=E(e)}catch(n){this.endDateText=this.endDate}t&&(this.toPickerSelectedDates=[t,t]),this.rangeChanged()},rangeChanged:function(){this.$emit("rangeChange",{start:S(this.fromPickerSelectedDates[0]),end:S(this.toPickerSelectedDates[0])})}}});cr.render=ir;var sr=cr; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function or(e,t,n,r,a,i){var l=Object(o["resolveComponent"])("DatePicker");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",rr,[Object(o["createElementVNode"])("h6",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",id:"inputCalendarFrom",name:"inputCalendarFrom",class:"browser-default","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDateText=t}),onChange:t[1]||(t[1]=function(t){return e.onRangeInputChanged("from",t)}),onKeyup:t[2]||(t[2]=function(t){return e.handleEnterPress(t)})},null,544),[[o["vModelText"],e.startDateText]])]),Object(o["createVNode"])(l,{id:"calendarFrom","view-date":e.startDate,"selected-date-start":e.fromPickerSelectedDates[0],"selected-date-end":e.fromPickerSelectedDates[1],"highlighted-date-start":e.fromPickerHighlightedDates[0],"highlighted-date-end":e.fromPickerHighlightedDates[1],onDateSelect:t[3]||(t[3]=function(t){return e.setStartRangeDate(t.date)}),onCellHover:t[4]||(t[4]=function(t){return e.fromPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)}),onCellHoverLeave:t[5]||(t[5]=function(t){return e.fromPickerHighlightedDates=[null,null]})},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])]),Object(o["createElementVNode"])("div",ar,[Object(o["createElementVNode"])("h6",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",id:"inputCalendarTo",name:"inputCalendarTo",class:"browser-default","onUpdate:modelValue":t[6]||(t[6]=function(t){return e.endDateText=t}),onChange:t[7]||(t[7]=function(t){return e.onRangeInputChanged("to",t)}),onKeyup:t[8]||(t[8]=function(t){return e.handleEnterPress(t)})},null,544),[[o["vModelText"],e.endDateText]])]),Object(o["createVNode"])(l,{id:"calendarTo","view-date":e.endDate,"selected-date-start":e.toPickerSelectedDates[0],"selected-date-end":e.toPickerSelectedDates[1],"highlighted-date-start":e.toPickerHighlightedDates[0],"highlighted-date-end":e.toPickerHighlightedDates[1],onDateSelect:t[9]||(t[9]=function(t){return e.setEndRangeDate(t.date)}),onCellHover:t[10]||(t[10]=function(t){return e.toPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)}),onCellHoverLeave:t[11]||(t[11]=function(t){return e.toPickerHighlightedDates=[null,null]})},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])])],64)}var ir=Object(o["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:nr},data:function(){var e=null;try{e=E(this.startDate)}catch(n){}var t=null;try{t=E(this.endDate)}catch(n){}return{fromPickerSelectedDates:[e,e],toPickerSelectedDates:[t,t],fromPickerHighlightedDates:[null,null],toPickerHighlightedDates:[null,null],startDateText:this.startDate,endDateText:this.endDate}},emits:["rangeChange","submit"],watch:{startDate:function(){this.startDateText=this.startDate,this.setStartRangeDateFromStr(this.startDate)},endDate:function(){this.endDateText=this.endDate,this.setEndRangeDateFromStr(this.endDate)}},mounted:function(){this.rangeChanged()},methods:{setStartRangeDate:function(e){this.fromPickerSelectedDates=[e,e],this.rangeChanged()},setEndRangeDate:function(e){this.toPickerSelectedDates=[e,e],this.rangeChanged()},onRangeInputChanged:function(e,t){"from"===e?this.setStartRangeDateFromStr(t.target.value):this.setEndRangeDateFromStr(t.target.value)},getNewHighlightedDates:function(e,t){return t.hasClass("ui-datepicker-unselectable")?null:[e,e]},handleEnterPress:function(e){13===e.keyCode&&this.$emit("submit",{start:this.startDate,end:this.endDate})},setStartRangeDateFromStr:function(e){var t;try{t=E(e)}catch(n){this.startDateText=this.startDate}t&&(this.fromPickerSelectedDates=[t,t]),this.rangeChanged()},setEndRangeDateFromStr:function(e){var t;try{t=E(e)}catch(n){this.endDateText=this.endDate}t&&(this.toPickerSelectedDates=[t,t]),this.rangeChanged()},rangeChanged:function(){this.$emit("rangeChange",{start:P(this.fromPickerSelectedDates[0]),end:P(this.toPickerSelectedDates[0])})}}});ir.render=or;var lr=ir; + */wt({component:sr,scope:{startDate:{angularJsBind:"<"},endDate:{angularJsBind:"<"},rangeChange:{angularJsBind:"&"},submit:{angularJsBind:"&"}},directiveName:"piwikDateRangePicker",restrict:"E"});function lr(e,t,n,r,a,i){var c=Object(o["resolveComponent"])("DatePicker");return Object(o["openBlock"])(),Object(o["createBlock"])(c,{"selected-date-start":e.selectedDates[0],"selected-date-end":e.selectedDates[1],"highlighted-date-start":e.highlightedDates[0],"highlighted-date-end":e.highlightedDates[1],"view-date":e.viewDate,"step-months":"year"===e.period?12:1,"disable-month-dropdown":"year"===e.period,onCellHover:t[0]||(t[0]=function(t){return e.onHoverNormalCell(t.date,t.$cell)}),onCellHoverLeave:t[1]||(t[1]=function(t){return e.onHoverLeaveNormalCells()}),onDateSelect:t[2]||(t[2]=function(t){return e.onDateSelected(t.date)})},null,8,["selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end","view-date","step-months","disable-month-dropdown"])}var ur=new Date(D.minDateYear,D.minDateMonth-1,D.minDateDay),dr=new Date(D.maxDateYear,D.maxDateMonth-1,D.maxDateDay),pr=Object(o["defineComponent"])({props:{period:String,date:[String,Date]},components:{DatePicker:rr},emits:["select"],setup:function(e,t){var n=Object(o["ref"])(e.date),r=Object(o["ref"])([null,null]),a=Object(o["ref"])([null,null]);function i(t){var n=p.get(e.period).parse(t).getDateRange();return n[0]=urn[1]?n[1]:dr,n}function c(t,n){var r=tdr,o=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);a.value=r||o?[null,null]:i(t)}function s(){a.value=[null,null]}function l(e){t.emit("select",{date:e})}function u(){e.period&&e.date?r.value=i(e.date):r.value=[null,null]}return Object(o["watch"])(e,u),u(),{selectedDates:r,highlightedDates:a,viewDate:n,onHoverNormalCell:c,onHoverLeaveNormalCells:s,onDateSelected:l}}});pr.render=lr;var fr=pr,mr=(wt({component:fr,scope:{period:{angularJsBind:"<"},date:{angularJsBind:"<"},select:{angularJsBind:"&"}},directiveName:"piwikPeriodDatePicker",restrict:"E"}),{class:"loadingPiwik"}),hr=Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */yt({component:lr,scope:{startDate:{angularJsBind:"<"},endDate:{angularJsBind:"<"},rangeChange:{angularJsBind:"&"},submit:{angularJsBind:"&"}},directiveName:"piwikDateRangePicker",restrict:"E"});function cr(e,t,n,r,a,i){var l=Object(o["resolveComponent"])("DatePicker");return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"selected-date-start":e.selectedDates[0],"selected-date-end":e.selectedDates[1],"highlighted-date-start":e.highlightedDates[0],"highlighted-date-end":e.highlightedDates[1],"view-date":e.viewDate,"step-months":"year"===e.period?12:1,"disable-month-dropdown":"year"===e.period,onCellHover:t[0]||(t[0]=function(t){return e.onHoverNormalCell(t.date,t.$cell)}),onCellHoverLeave:t[1]||(t[1]=function(t){return e.onHoverLeaveNormalCells()}),onDateSelect:t[2]||(t[2]=function(t){return e.onDateSelected(t.date)})},null,8,["selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end","view-date","step-months","disable-month-dropdown"])}var sr=new Date(j.minDateYear,j.minDateMonth-1,j.minDateDay),ur=new Date(j.maxDateYear,j.maxDateMonth-1,j.maxDateDay),dr=Object(o["defineComponent"])({props:{period:String,date:[String,Date]},components:{DatePicker:nr},emits:["select"],setup:function(e,t){var n=Object(o["ref"])(e.date),r=Object(o["ref"])([null,null]),a=Object(o["ref"])([null,null]);function i(t){var n=p.get(e.period).parse(t).getDateRange();return n[0]=srn[1]?n[1]:ur,n}function l(t,n){var r=tur,o=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);a.value=r||o?[null,null]:i(t)}function c(){a.value=[null,null]}function s(e){t.emit("select",{date:e})}function u(){e.period&&e.date?r.value=i(e.date):r.value=[null,null]}return Object(o["watch"])(e,u),u(),{selectedDates:r,highlightedDates:a,viewDate:n,onHoverNormalCell:l,onHoverLeaveNormalCells:c,onDateSelected:s}}});dr.render=cr;var pr=dr,fr=(yt({component:pr,scope:{period:{angularJsBind:"<"},date:{angularJsBind:"<"},select:{angularJsBind:"&"}},directiveName:"piwikPeriodDatePicker",restrict:"E"}),{class:"loadingPiwik"}),mr=Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1); + */function vr(e,t,n,r,a,i){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",mr,[hr,Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.loadingMessage),1)],512)),[[o["vShow"],e.loading]])}var gr=Object(o["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:C("General_LoadingData")}}});gr.render=vr;var br=gr,yr=wt({component:br,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return C("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"}); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function hr(e,t,n,r,a,i){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",fr,[mr,Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.loadingMessage),1)],512)),[[o["vShow"],e.loading]])}var vr=Object(o["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:C("General_LoadingData")}}});vr.render=hr;var gr=vr,br=yt({component:gr,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return C("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"}); + */function wr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kr(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["alert",wr({},"alert-".concat(e.severity),!0)])},[Object(o["renderSlot"])(e.$slots,"default")],2)}var Or=Object(o["defineComponent"])({props:{severity:{type:String,required:!0}}});Or.render=kr;var jr=Or,Dr=wt({component:jr,scope:{severity:{vue:"severity",angularJsBind:"@piwikAlert"}},directiveName:"piwikAlert",transclude:!0}); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function yr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wr(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["alert",yr({},"alert-".concat(e.severity),!0)])},[Object(o["renderSlot"])(e.$slots,"default")],2)}var kr=Object(o["defineComponent"])({props:{severity:{type:String,required:!0}}});kr.render=wr;var Dr=kr,Or=yt({component:Dr,scope:{severity:{vue:"severity",angularJsBind:"@piwikAlert"}},directiveName:"piwikAlert",transclude:!0}); + */function Cr(e,t,n){var r=new Date;n||(n=432e4),r.setTime(r.getTime()+n),document.cookie="".concat(e,"=").concat(t,"; expires=").concat(r.toUTCString(),"; path=/")}function Sr(e){var t="; ".concat(document.cookie),n=t.split("; ".concat(e,"="));if(2==n.length){var r=n.pop().split(";").shift();if("undefined"!==typeof r)return r}return null}function Pr(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")}var Er={key:0},Tr=["data-notification-instance-id"],xr={key:1},Ir={class:"notification-body"},Nr=["innerHTML"],$r={key:1};function Br(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createBlock"])(o["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(o["withCtx"])((function(){return[e.deleted?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Er,[Object(o["createVNode"])(o["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(o["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",{class:Object(o["normalizeClass"])(["notification system",e.cssClasses]),style:Object(o["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(o["createCommentVNode"])("",!0),e.title?(Object(o["openBlock"])(),Object(o["createElementBlock"])("strong",xr,Object(o["toDisplayString"])(e.title),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Ir,[e.message?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,Nr)):Object(o["createCommentVNode"])("",!0),e.message?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",$r,[Object(o["renderSlot"])(e.$slots,"default")]))])],14,Tr)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var Hr=window,Ar=Hr.$,Mr=Object(o["defineComponent"])({props:{notificationId:String,notificationInstanceId:String,title:String,context:String,type:String,noclear:Boolean,toastLength:{type:Number,default:12e3},style:[String,Object],animate:Boolean,message:String,cssClass:String},computed:{cssClasses:function(){var e={};return this.context&&(e["notification-".concat(this.context)]=!0),this.cssClass&&(e[this.cssClass]=!0),e},canClose:function(){return"persistent"===this.type||!this.noclear}},emits:["closed"],data:function(){return{deleted:!1}},mounted:function(){var e=this,t=function(){setTimeout((function(){e.deleted=!0}),e.toastLength)};"toast"===this.type&&t(),this.style&&Ar(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(o["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(o["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Ne.fetch({module:"CoreHome",action:"markNotificationAsRead"},{postParams:{notificationId:this.notificationId}})}}});Mr.render=Br;var Fr=Mr; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function jr(e,t,n){var r=new Date;n||(n=432e4),r.setTime(r.getTime()+n),document.cookie="".concat(e,"=").concat(t,"; expires=").concat(r.toUTCString(),"; path=/")}function Cr(e){var t="; ".concat(document.cookie),n=t.split("; ".concat(e,"="));if(2==n.length){var r=n.pop().split(";").shift();if("undefined"!==typeof r)return r}return null}function Pr(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")} + */wt({component:Fr,scope:{notificationId:{angularJsBind:"@?"},title:{angularJsBind:"@?notificationTitle"},context:{angularJsBind:"@?"},type:{angularJsBind:"@?"},noclear:{angularJsBind:"@?",transform:function(e){return!!e}},toastLength:{angularJsBind:"@?"}},directiveName:"piwikNotification",transclude:!0});function Vr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lr(e){for(var t=1;t',data:function(){return{group:t}}});a.config.globalProperties.$sanitize=window.vueSanitize,a.config.globalProperties.translate=C,a.component("NotificationGroup",r),a.mount(n[0])}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),qr=new Gr,zr=qr;$((function(){return qr.parseNotificationDivs()})), +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +angular.module("piwikApp").factory("notifications",(function(){return zr}));var Qr={class:"notification-group"},Yr=["innerHTML"];function Wr(e,t,n,r,a,i){var c=Object(o["resolveComponent"])("Notification");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qr,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.notifications,(function(t,n){return Object(o["openBlock"])(),Object(o["createBlock"])(c,{key:t.id||"no-id-".concat(n),"notification-id":t.id,title:t.title,context:t.context,type:t.type,noclear:t.noclear,"toast-length":t.toastLength,style:Object(o["normalizeStyle"])(t.style),animate:t.animate,message:t.message,"notification-instance-id":t.notificationInstanceId,"css-class":t.class,onClosed:function(n){return e.removeNotification(t.id)}},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,Yr)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}var Kr=Object(o["defineComponent"])({props:{group:String},components:{Notification:Fr},computed:{notifications:function(){var e=this;return zr.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){zr.remove(e)}}});Kr.render=Wr;var Xr=Kr; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts index b1bf30ca7f..f128ae6c32 100644 --- a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts +++ b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts @@ -9,6 +9,11 @@ import jqXHR = JQuery.jqXHR; import MatomoUrl from '../MatomoUrl/MatomoUrl'; import Matomo from '../Matomo/Matomo'; +interface AjaxOptions { + withTokenInUrl?: boolean; + postParams?: QueryParameters; +} + window.globalAjaxQueue = [] as unknown as GlobalAjaxQueue; window.globalAjaxQueue.active = 0; @@ -148,10 +153,16 @@ export default class AjaxHelper { // eslint-disable-line defaultParams = ['idSite', 'period', 'date', 'segment']; // helper method entry point - static fetch(params: QueryParameters): Promise { // eslint-disable-line + static fetch(params: QueryParameters, options: AjaxOptions = {}): Promise { // eslint-disable-line const helper = new AjaxHelper(); + if (options.withTokenInUrl) { + helper.withTokenInUrl(); + } helper.setFormat('json'); helper.addParams({ module: 'API', format: 'json', ...params }, 'get'); + if (options.postParams) { + helper.addParams(options.postParams, 'post'); + } return helper.send(); } diff --git a/plugins/CoreHome/vue/src/FocusIf/FocusIf.adapter.ts b/plugins/CoreHome/vue/src/FocusIf/FocusIf.adapter.ts index a2226866ad..2d48e8f254 100644 --- a/plugins/CoreHome/vue/src/FocusIf/FocusIf.adapter.ts +++ b/plugins/CoreHome/vue/src/FocusIf/FocusIf.adapter.ts @@ -21,8 +21,8 @@ function piwikFocusIf(): IDirective { scope.$watch(attrs.piwikFocusIf, (newValue) => { const binding = { instance: null, + arg: newValue ? '1' : undefined, value: { - focusIf: !!newValue, afterFocus: () => scope.$apply(), }, oldValue: null, diff --git a/plugins/CoreHome/vue/src/FocusIf/FocusIf.ts b/plugins/CoreHome/vue/src/FocusIf/FocusIf.ts index 665f2774c3..6a13e46ff0 100644 --- a/plugins/CoreHome/vue/src/FocusIf/FocusIf.ts +++ b/plugins/CoreHome/vue/src/FocusIf/FocusIf.ts @@ -8,20 +8,26 @@ import { DirectiveBinding } from 'vue'; interface FocusIfArgs { - focusIf: boolean; afterFocus?: () => void; } +function doFocusIf(el: HTMLElement, binding: DirectiveBinding): void { + if (binding.arg) { + setTimeout(() => { + el.focus(); + + if (binding.value.afterFocus) { + binding.value.afterFocus(); + } + }, 5); + } +} + export default { + mounted(el: HTMLElement, binding: DirectiveBinding): void { + doFocusIf(el, binding); + }, updated(el: HTMLElement, binding: DirectiveBinding): void { - if (binding.value.focusIf) { - setTimeout(() => { - el.focus(); - - if (binding.value.afterFocus) { - binding.value.afterFocus(); - } - }, 5); - } + doFocusIf(el, binding); }, }; diff --git a/plugins/CoreHome/vue/src/Menudropdown/Menudropdown.vue b/plugins/CoreHome/vue/src/Menudropdown/Menudropdown.vue index de879274bd..fdd26bfdba 100644 --- a/plugins/CoreHome/vue/src/Menudropdown/Menudropdown.vue +++ b/plugins/CoreHome/vue/src/Menudropdown/Menudropdown.vue @@ -29,6 +29,7 @@ diff --git a/plugins/CoreHome/vue/src/Notification/Notification.adapter.ts b/plugins/CoreHome/vue/src/Notification/Notification.adapter.ts new file mode 100644 index 0000000000..5845718976 --- /dev/null +++ b/plugins/CoreHome/vue/src/Notification/Notification.adapter.ts @@ -0,0 +1,36 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import createAngularJsAdapter from '../createAngularJsAdapter'; +import Notification from './Notification.vue'; + +export default createAngularJsAdapter({ + component: Notification, + scope: { + notificationId: { + angularJsBind: '@?', + }, + title: { + angularJsBind: '@?notificationTitle', + }, + context: { + angularJsBind: '@?', + }, + type: { + angularJsBind: '@?', + }, + noclear: { + angularJsBind: '@?', + transform: (v) => !!v, + }, + toastLength: { + angularJsBind: '@?', + }, + }, + directiveName: 'piwikNotification', + transclude: true, +}); diff --git a/plugins/CoreHome/vue/src/Notification/Notification.less b/plugins/CoreHome/vue/src/Notification/Notification.less new file mode 100644 index 0000000000..9bafc751c9 --- /dev/null +++ b/plugins/CoreHome/vue/src/Notification/Notification.less @@ -0,0 +1,83 @@ +.system.notification { + .alert; + + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12); + border: 0 !important; + + p:not(:first-child) { + margin-top: 1em; + } + + .notification-body { + min-width: 50px; + } + + // We have to use !important because the default button style is crazy + .close { + position: relative; + top: -5px; + right: -10px; + padding: 0 !important; + background: transparent !important; + border: none !important; + float: right; + font-size: 20px !important; + font-weight: bold; + line-height: 20px !important; + color: inherit !important; + opacity: 0.3; + filter: alpha(opacity=30); + cursor: pointer; + } + + &.notification-success { + .alert-success; + color: #eef6ef !important; + background-color: @color-green-piwik !important; + &:before, p, a { + color: #eef6ef; + } + } + &.notification-warning { + .alert-warning; + background-color: #f57c00; + color: #fbf7f1 !important; + &:before, p, a { + color: #fbf7f1; + } + } + &.notification-danger, + &.notification-error { + .alert-danger; + color: #fdf0f2 !important; + background-color: #e53935; + &:before, p, a { + color: #fdf0f2; + } + } + &.notification-info { + .alert-info; + color: #f3feff !important; + background-color: #00bcd4; + &:before, p, a { + color: #f3feff; + } + } + + &.help-notification.notification-info { + background-color: @theme-color-help-background-color; + + &:before { + content: "\e61f"; + } + } +} + +// toast-slide-up transition +.toast-slide-up-enter-active { + transition: transform .3s ease; +} + +.toast-slide-up-enter-from { + transform: translateY(-100%); +} diff --git a/plugins/CoreHome/vue/src/Notification/Notification.vue b/plugins/CoreHome/vue/src/Notification/Notification.vue new file mode 100644 index 0000000000..e25dcb1711 --- /dev/null +++ b/plugins/CoreHome/vue/src/Notification/Notification.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/plugins/CoreHome/vue/src/Notification/NotificationGroup.vue b/plugins/CoreHome/vue/src/Notification/NotificationGroup.vue new file mode 100644 index 0000000000..f581822ba6 --- /dev/null +++ b/plugins/CoreHome/vue/src/Notification/NotificationGroup.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/plugins/CoreHome/vue/src/Notification/Notifications.store.adapter.ts b/plugins/CoreHome/vue/src/Notification/Notifications.store.adapter.ts new file mode 100644 index 0000000000..95cacccbcd --- /dev/null +++ b/plugins/CoreHome/vue/src/Notification/Notifications.store.adapter.ts @@ -0,0 +1,10 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import NotificationsStore from './Notifications.store'; + +angular.module('piwikApp').factory('notifications', () => NotificationsStore); diff --git a/plugins/CoreHome/vue/src/Notification/Notifications.store.ts b/plugins/CoreHome/vue/src/Notification/Notifications.store.ts new file mode 100644 index 0000000000..e014e9beda --- /dev/null +++ b/plugins/CoreHome/vue/src/Notification/Notifications.store.ts @@ -0,0 +1,275 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { + DeepReadonly, + reactive, + createVNode, + createApp, +} from 'vue'; +import NotificationComponent from './Notification.vue'; +import translate from '../translate'; +import Matomo from '../Matomo/Matomo'; + +interface Notification { + /** + * Only needed for persistent notifications. The id will be sent to the + * frontend once the user closes the notifications. The notification has to + * be registered/notified under this name. + */ + id?: string; + + /** + * Unique ID generated for the notification so it can be referenced specifically + * to scroll to. + */ + notificationInstanceId: string; + + /** + * Determines which notification group a notification is meant to be displayed + * in. + */ + group?: string; + + /** + * The title of the notification. For instance the plugin name. + */ + title?: string; + + /** + * The actual message that will be displayed. Must be set. + */ + message: string; + + /** + * Context of the notification: 'info', 'warning', 'success' or 'error' + */ + context: 'success'|'error'|'info'|'warning'; + + /** + * The type of the notification: Either 'toast' or 'transient'. 'persistent' is valid, but + * has no effect if only specified client side. + */ + type: 'toast'|'persistent'|'transient'; + + /** + * If set, the close icon is not displayed. + */ + noclear?: boolean; + + /** + * The number of milliseconds before a toast animation disappears. + */ + toastLength?: number; + + /** + * Optional style/css dictionary. For instance {'display': 'inline-block'} + */ + style?: string|Record; + + /** + * Optional CSS class to add. + */ + class?: string; + + /** + * If true, fades the animation in. + */ + animate?: boolean; + + /** + * Where to place the notification. Required if showing a toast. + */ + placeat?: string|HTMLElement|JQuery; +} + +interface NotificationsData { + notifications: Notification[]; +} + +class NotificationsStore { + private privateState: NotificationsData = reactive({ + notifications: [], + }); + + private nextNotificationId = 0; + + get state(): DeepReadonly { + return this.privateState; + } + + appendNotification(notification: Notification): void { + this.checkMessage(notification.message); + + // remove existing notification before adding + if (notification.id) { + this.remove(notification.id); + } + this.privateState.notifications.push(notification); + } + + prependNotification(notification: Notification): void { + this.checkMessage(notification.message); + + // remove existing notification before adding + if (notification.id) { + this.remove(notification.id); + } + this.privateState.notifications.unshift(notification); + } + + /** + * Removes a previously shown notification having the given notification id. + */ + remove(id: string): void { + this.privateState.notifications = this.privateState.notifications.filter( + (n) => n.id !== id, + ); + } + + parseNotificationDivs(): void { + const $notificationNodes = $('[data-role="notification"]'); + + const notificationsToShow = []; + $notificationNodes.each((index, notificationNode) => { + const $notificationNode = $(notificationNode); + const attributes = $notificationNode.data(); + const message = $notificationNode.html(); + + if (message) { + notificationsToShow.push({ ...attributes, message, animate: false }); + } + + $notificationNodes.remove(); + }); + + notificationsToShow.forEach((n) => this.show(n)); + } + + clearTransientNotifications(): void { + this.privateState.notifications = this.privateState.notifications.filter( + (n) => n.type !== 'transient', + ); + } + + /** + * Creates a notification and shows it to the user. + */ + show(notification: Notification): string { + this.checkMessage(notification.message); + + let addMethod = this.appendNotification; + + let notificationPosition: typeof Notification['placeat'] = '#notificationContainer'; + if (notification.placeat) { + notificationPosition = notification.placeat; + } else { + // If a modal is open, we want to make sure the error message is visible and therefore + // show it within the opened modal + const modalSelector = '.modal.open .modal-content'; + if (document.querySelector(modalSelector)) { + notificationPosition = modalSelector; + addMethod = this.prependNotification; + } + } + + const group = notification.group + || (notification.placeat ? notification.placeat.toString() : ''); + + this.initializeNotificationContainer(notificationPosition, group); + + const notificationInstanceId = (this.nextNotificationId += 1).toString(); + + addMethod.call(this, { + ...notification, + noclear: !!notification.noclear, + group, + notificationId: notification.id, + notificationInstanceId, + type: notification.type || 'transient', + }); + + return notificationInstanceId; + } + + scrollToNotification(notificationInstanceId: string) { + setTimeout(() => { + const element = document.querySelector(`[data-notification-instance-id='${notificationInstanceId}']`); + if (element) { + Matomo.helper.lazyScrollTo(element, 250); + } + }); + } + + /** + * Shows a notification at a certain point with a quick upwards animation. + */ + toast(notification: Notification): void { + this.checkMessage(notification.message); + + const $placeat = $(notification.placeat); + if (!$placeat.length) { + throw new Error('A valid selector is required for the placeat option when using Notification.toast().'); + } + + const toastElement = document.createElement('div'); + toastElement.style.position = 'absolute'; + toastElement.style.top = `${$placeat.offset().top}px`; + toastElement.style.left = `${$placeat.offset().left}px`; + toastElement.style.zIndex = '1000'; + document.body.appendChild(toastElement); + + const app = createApp({ + render: () => createVNode(NotificationComponent, { + ...notification, + notificationId: notification.id, + type: 'toast', + onClosed: () => { + app.unmount(); + }, + }), + }); + app.config.globalProperties.$sanitize = window.vueSanitize; + app.config.globalProperties.translate = translate; + app.mount(toastElement); + } + + private initializeNotificationContainer( + notificationPosition: typeof Notification['placeat'], + group: string, + ) { + const $container = window.$(notificationPosition); + if ($container.children('.notification-group').length) { + return; + } + + // avoiding a dependency cycle. won't need to do this when NotificationGroup's do not need + // to be dynamically initialized. + const NotificationGroup = (window as any).CoreHome.NotificationGroup; // eslint-disable-line + + const app = createApp({ + template: '', + data: () => ({ group }), + }); + app.config.globalProperties.$sanitize = window.vueSanitize; + app.config.globalProperties.translate = translate; + app.component('NotificationGroup', NotificationGroup); + app.mount($container[0]); + } + + private checkMessage(message: string) { + if (!message) { + throw new Error('No message given, cannot display notification'); + } + } +} + +const instance = new NotificationsStore(); +export default instance; + +// parse notifications on dom load +$(() => instance.parseNotificationDivs()); diff --git a/plugins/CoreHome/vue/src/Notification/index.ts b/plugins/CoreHome/vue/src/Notification/index.ts new file mode 100644 index 0000000000..abcc74b952 --- /dev/null +++ b/plugins/CoreHome/vue/src/Notification/index.ts @@ -0,0 +1,12 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +import './Notification.adapter'; +import './Notifications.store.adapter'; + +export { default as Notification } from './Notification.vue'; +export { default as NotificationGroup } from './NotificationGroup.vue'; +export { default as NotificationsStore } from './Notifications.store'; diff --git a/plugins/CoreHome/vue/src/createAngularJsAdapter.ts b/plugins/CoreHome/vue/src/createAngularJsAdapter.ts index 12ff8382bd..b28ee95d33 100644 --- a/plugins/CoreHome/vue/src/createAngularJsAdapter.ts +++ b/plugins/CoreHome/vue/src/createAngularJsAdapter.ts @@ -16,6 +16,7 @@ import translate from './translate'; interface SingleScopeVarInfo { vue?: string; default?: any; // eslint-disable-line + transform?: (v: unknown) => unknown; angularJsBind?: string; } @@ -147,6 +148,9 @@ export default function createAngularJsAdapter(options: { ? info.default(ngScope, ngElement, ngAttrs, ...injectedServices) : info.default; } + if (info.transform) { + value = info.transform(value); + } initialData[info.vue] = value; }); return initialData; @@ -191,13 +195,16 @@ export default function createAngularJsAdapter(options: { } ngScope.$watch(scopeVarName, (newValue: any) => { // eslint-disable-line + let newValueFinal = newValue; if (typeof info.default !== 'undefined' && typeof newValue === 'undefined') { - vm[scopeVarName] = info.default instanceof Function + newValueFinal = info.default instanceof Function ? info.default(ngScope, ngElement, ngAttrs, ...injectedServices) : info.default; - } else { - vm[scopeVarName] = newValue; } + if (info.transform) { + newValueFinal = info.transform(newValueFinal); + } + vm[scopeVarName] = newValueFinal; }); }); diff --git a/plugins/CoreHome/vue/src/index.ts b/plugins/CoreHome/vue/src/index.ts index 4755fabc73..baaada6b9a 100644 --- a/plugins/CoreHome/vue/src/index.ts +++ b/plugins/CoreHome/vue/src/index.ts @@ -52,3 +52,4 @@ export { default as Menudropdown } from './Menudropdown/Menudropdown.vue'; export { default as DatePicker } from './DatePicker/DatePicker.vue'; export { default as DateRangePicker } from './DateRangePicker/DateRangePicker.vue'; export { default as PeriodDatePicker } from './PeriodDatePicker/PeriodDatePicker.vue'; +export * from './Notification'; -- cgit v1.2.3