diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2021-12-09 11:14:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-09 11:14:17 +0300 |
commit | c77bd82060e0567819d20c745e2bd873ef5998f9 (patch) | |
tree | 4d1a681b472514d28d59da9b3d9502bdd442b85e | |
parent | 0c87f01093119ef9e6e41b16e84df068e8523276 (diff) |
[Vue] migrate piwik-reporting-menu directive to vue (#18423)
* fix a couple more bugs
* use jQuery click for expand on click
* undo submodule change
* rebuild vue
* get vue files to run
* missing element
* more fixes
* get more fields working properly
* rebuild
* fix even more issues
* [Vue] use jQuery click for expand on click (#18341)
* use jQuery click for expand on click
* undo submodule change
* migrate piwik-field directive and fix some issues
* forgot to add migrated directive files and get demo.twig to work
* use event target
* make sure angularjs and vue do not share data
* fix ng model mapping
* fix a couple more issues
* fix a couple more bugs
* more fixes
* mimic existing behavior where an empty value will result in an extra field appearing in a select option list, but only at first
* another fix
* built vue files
* more fixes
* do not use UMD if vue/src is not present
* use non-minified angularjs if in development mode
* deprecate custom template file property
* remove angularjs properties in scope properties (ie, $$hashKey) otherwise vue will fail when it tries to process them
* fixing some more issues from ui tests
* more fixes
* fix form field issue + patch jquery so .trigger() will also trigger events added via addEventHandler()
* true bc fix
* get the jquery patch to work
* ignore polyfill map
* fix ng-model issue in report limit in report export directive
* full width property was not handled properly before in angularjs
* do not try and parseInt null values
* fix several more issues for tests
* fix some tests
* fix data binding
* fix css class
* fixing more ui test issues
* do not decode model value of site name in site selector, so it is always the same as what is in the DB
* 4.6.0-rc2
* more ng-model fixes
* rebuild
* html tweaks
* add timeout to test
* rebuild
* fix another UI test
* rebuild vue files
* update some expected screenshots
* fix more issues
* Revert "[Vue] do not decode model value of site name in site selector, so it is always matches the DB value (#18356)"
This reverts commit 8c7539f073e7a49311cbe6dc2474eb1bbfb8718d.
* update screenshots
* more fixes
* another fix + screenshot update
* more screenshot updates
* more fixes
* even more fixes
* another ui test fix
* more type fixes
* rebuilt vue JS
* couple more fixes
* undo debugging
* do not convert undefined to bool
* update screenshot
* another bool checking fix
* rebuild vue files
* more fixes
* initial site value in field is assumed to be encoded
* file headers and custom field component support
* get custom component field code to work
* rebuild vue
* allow using angularjs templateFile for custom field (for BC)
* get angularjs template embedding to work for rollupreporting at least
* deal with some in source TODO items
* fix a couple more issues
* Use separate div in modals to display notifications otherwise Vue will erase modal content when initializing NotificationGroup component.
* build again
* refactor some code and fix an issue with checkbox array field handling in angularjs
* more fixes
* another fix
* even more fixes
* remove more todo
* hopefully the last changes
* update vue files
* update submodule
* revert debugging change + fix issue
* built vue files
* fix another select issue
* rebuild vue files
* fix broken refactor
* update two screenshots
* add some more timeouts and update screenshots
* initial conversion, loading w/o error
* tweaks
* get period selector work in UI
* fix site selector model binding
* rebuild vue
* fix viewDate not being kept in sync
* rebuild CoreHome
* [Vue] fix modal notification placement (#18377)
* Use separate div in modals to display notifications otherwise Vue will erase modal content when initializing NotificationGroup component.
* built vue files
* two fixes
* couple UI test fixes
* rebuild vue
* update files
* sidenav start
* make getRef a utility method
* tweak
* add return type
* finish converting side-nav directive
* starting on reporting menu conversion
* remove unused properties
* convert reporting pages service
* migrate report metadata store
* remove angularjs files
* migrating reporting pages store
* make store adapters more immutable
* get service adapters to work
* fix a UI test
* another html fix
* migrate most of reporting menu directive and model
* Use themed font family for input forms to override materialize.css styling
* rebuild vue
* add a missing div
* ui test fixes
* update styling
* get to build
* get to load in the UI w/o error
* clone result of functions
* fix compile issue
* Updating version to 4.6.0
* update expected screenshot
* add wait just in case travis is slow
* fix ordering bug
* add another wait
* rebuild vue
* css tweak
* fix some bugs and tests
* undo screenshot changes
* Menus test passing locally
* [Vue] date picker viewDate property is not kept up to date (#18385)
* viewDate ref is not kept up to date
* rebuild corehome
* reporting menu subcategory items are meant to be normal links
* update some screenshots
* use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add
* trigger angularjs digest after ajaxhelper request
* rebuild vue
* update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time
* undo box-shadow change for UI tests
* fix more issues & update more tests
* update some screenshots
* fix some tests
* built vue files
* fix field array title
* apply some pr feedback
* apply more pr feedback
* another fix
* tweak
* fix ng-change not executed before ng-model
* fix another set of issues
* fix another issue
* rebuild vue
* better ng-change/ng-model fix
* update some screenshots
* rebuild vue
* remove some TODOs
* initiate initial ng-change ONLY for site selectors where this behavior applies
* built vue files
* fix function signature
* fix vue warning
* fix ajax request race condition
* rebuild vue
* add new notification type "help" so the help notification is not cleared when clearing transient notifications
* fix some bugs and tests
* update screenshot
* update screenshot & fix a test
* allow using unminified jquery ui + fix bug in last fix
* add polyfill min.js
* update some screenshots and fix sanitization/escape issue
* update screenshots
* rebuild vue
* fix url location updating regression in MatomoUrl.updateLocation use
* submodule
* update screenshots and fix possible error in json parse
* built vue files
* Merge branch 'vue-period-selector-regression' into vue-reporting-menu
* rebuild vue
* use correct variable
* rebuild vue
* segment parameter can be undefined now for some reason
* fix ngmodel binding in siteselector adapter (for last time hopefully)
* the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance
* fix sitesmanager ui test failure
* fix usersettings test failure
* rebuild vue
* more siteselector tweaks.
* another siteselector issue
* update screenshots
* update screenshot and try to fix random failure
* apply review feedback
* fix ngmodel render issue w/ extra nextTick()
* fix css
* fix test
* rebuild vue
* update screenshots
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com>
Co-authored-by: sgiehl <stefan@matomo.org>
58 files changed, 2225 insertions, 1152 deletions
diff --git a/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php b/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php index b72e557331..989b8c4abf 100644 --- a/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php +++ b/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php @@ -74,8 +74,10 @@ class JScriptUIAssetFetcher extends UIAssetFetcher { return array( 'node_modules/jquery/dist/jquery.min.js', + 'node_modules/jquery/dist/jquery.js', 'node_modules/materialize-css/dist/js/materialize.min.js', // so jquery ui datepicker overrides materializecss 'node_modules/jquery-ui-dist/jquery-ui.min.js', + 'node_modules/jquery-ui-dist/jquery-ui.js', "plugins/CoreHome/javascripts/materialize-bc.js", "node_modules/jquery.browser/dist/jquery.browser.min.js", 'node_modules/', diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index c234997b6f..aaf0eab9ec 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -220,7 +220,6 @@ class CoreHome extends \Piwik\Plugin $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/translate.js"; $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/dropdown-button.js"; $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/select-on-focus.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/side-nav.js"; $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/string-to-number.js"; $jsFiles[] = "plugins/CoreHome/angularjs/piwikApp.js"; @@ -253,9 +252,6 @@ class CoreHome extends \Piwik\Plugin $jsFiles[] = "plugins/CoreHome/angularjs/reporting-page/reportingpage-model.js"; $jsFiles[] = "plugins/CoreHome/angularjs/reporting-page/reportingpage.directive.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/reporting-menu/reportingmenu-model.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/reporting-menu/reportingmenu.directive.js"; $jsFiles[] = "plugins/CoreHome/angularjs/content-table/content-table.directive.js"; diff --git a/plugins/CoreHome/angularjs/common/directives/side-nav.js b/plugins/CoreHome/angularjs/common/directives/side-nav.js deleted file mode 100644 index 1f62df58a3..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/side-nav.js +++ /dev/null @@ -1,48 +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 - */ - -/** - * Will activate the materialize side nav feature once rendered. We use this directive as it makes sure - * the actual left menu is rendered at the time we init the side nav. - * - * Has to be set on a collaapsible element - * - * Example: - * <div class="collapsible" piwik-side-nav="nav .activateLeftMenu">...</div> - */ -(function () { - angular.module('piwikApp.directive').directive('piwikSideNav', piwikSideNav); - - piwikSideNav.$inject = ['$timeout']; - var initialized = false; - - function piwikSideNav($timeout){ - return { - restrict: 'A', - priority: 10, - link: function(scope, element, attr, ctrl) { - if (attr.piwikSideNav) { - $timeout(function () { - if (!initialized) { - initialized = true; - - var sideNavActivator = $(attr.piwikSideNav).show(); - - $('#' + sideNavActivator.attr('data-target')).sidenav({ - closeOnClick: true - }); - } - - if (element.hasClass('collapsible')) { - element.collapsible(); - } - }); - } - } - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu-model.js b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu-model.js deleted file mode 100644 index 5b56090de8..0000000000 --- a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu-model.js +++ /dev/null @@ -1,165 +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('reportingMenuModel', reportingMenuModelService); - - reportingMenuModelService.$inject = ['$filter', '$q', 'reportingPagesModel', '$location']; - - function reportingMenuModelService ($filter, $q, reportingPagesModel, $location) { - - // those sites are going to be displayed - var model = { - menu: [], - selected: [], - fetchMenuItems: fetchMenuItems, - reloadMenuItems: reloadMenuItems, - findSubcategory: findSubcategory - }; - - return model; - - function isNumeric(text) { - return !isNaN(parseFloat(text)) && isFinite(text); - } - - function findSubcategory(categoryId, subcategoryId) - { - var foundCategory = null; - var foundSubcategory = null; - var foundSubSubcategory = null; - - angular.forEach(model.menu, function (category) { - if (category.id !== categoryId) { - return; - } - angular.forEach(category.subcategories, function (subcategory) { - if (subcategory.id === subcategoryId) { - foundCategory = category; - foundSubcategory = subcategory; - } - - if (subcategory.isGroup) { - angular.forEach(subcategory.subcategories, function (subcat) { - if (subcat.id === subcategoryId) { - foundCategory = category; - foundSubcategory = subcategory; - foundSubSubcategory = subcat; - } - }); - } - }); - }); - - return {category: foundCategory, subcategory: foundSubcategory, subsubcategory: foundSubSubcategory}; - } - - function buildMenuFromPages(pages) - { - var menu = []; - - var activeCategory = $location.search().category; - var activeSubcategory = $location.search().subcategory; - - var categoriesHandled = {}; - angular.forEach(pages, function (page, key) { - var category = page.category; - var categoryId = category.id; - - if (categoriesHandled[categoryId]) { - return; - } - - categoriesHandled[categoryId] = true; - - if (activeCategory && category.id === activeCategory) { - // this doesn't really belong here but placed it here for convenience - category.active = true; - } - - category.subcategories = []; - - var categoryGroups = false; - - angular.forEach(pages, function (page, key) { - if (page.category.id === categoryId) { - var subcategory = page.subcategory; - - if (subcategory.id === activeSubcategory && categoryId === activeCategory) { - subcategory.active = true; - } - - if (page.widgets && page.widgets[0] && isNumeric(page.subcategory.id)) { - // we handle a goal - if (!categoryGroups) { - categoryGroups = angular.copy(subcategory); - categoryGroups.name = $filter('translate')('CoreHome_ChooseX', [category.name]); - categoryGroups.isGroup = true; - categoryGroups.subcategories = []; - categoryGroups.order = 10; - } - - if (subcategory.active) { - categoryGroups.name = subcategory.name; - categoryGroups.active = true; - } - - var goalId = page.subcategory.id; - subcategory.tooltip = subcategory.name + ' (id = ' + goalId + ' )'; - - categoryGroups.subcategories.push(subcategory); - return; - } - - category.subcategories.push(subcategory); - } - }); - - if (categoryGroups && categoryGroups.subcategories && categoryGroups.subcategories.length <= 5) { - angular.forEach(categoryGroups.subcategories, function (subcategory) { - category.subcategories.push(subcategory); - }); - } else if(categoryGroups) { - category.subcategories.push(categoryGroups); - } - - category.subcategories = sortMenuItems(category.subcategories); - - menu.push(category); - - return menu; - }); - - menu = sortMenuItems(menu); - - return menu; - } - - function sortMenuItems(menu) { - return $filter('orderBy')(menu, 'order'); - }; - - function reloadMenuItems() - { - var pagesPromise = reportingPagesModel.reloadAllPages(); - return pagesPromise.then(function (pages) { - model.menu = buildMenuFromPages(pages); - return model.menu; - }); - } - - function fetchMenuItems() - { - var pagesPromise = reportingPagesModel.getAllPages(); - - return pagesPromise.then(function (pages) { - model.menu = buildMenuFromPages(pages); - - return model.menu; - }); - } - } -})(); diff --git a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js deleted file mode 100644 index 6da7b0898a..0000000000 --- a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.controller.js +++ /dev/null @@ -1,248 +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('ReportingMenuController', ReportingMenuController); - - ReportingMenuController.$inject = ['$scope', 'piwik', '$location', '$timeout', 'reportingMenuModel', '$rootScope', 'piwikUrl']; - - function ReportingMenuController($scope, piwik, $location, $timeout, menuModel, $rootScope, piwikUrl) { - - $scope.helpShownCategory = null; - - var idSite = piwikUrl.getSearchParam('idSite'); - var period = piwikUrl.getSearchParam('period'); - var date = piwikUrl.getSearchParam('date'); - var segment = piwikUrl.getSearchParam('segment'); - - var comparePeriods = piwikUrl.getSearchParam('comparePeriods'); - var compareDates = piwikUrl.getSearchParam('compareDates'); - var compareSegments = piwikUrl.getSearchParam('compareSegments'); - - var showSubcategoryHelpOnLoad = null; - - var initialLoad = true; - - $scope.currentCategory = piwikUrl.getSearchParam('category'); - $scope.currentSubcategory = piwikUrl.getSearchParam('subcategory'); - - function markAllCategoriesAsInactive() - { - angular.forEach(menuModel.menu, function (cat) { - cat.active = false; - }); - } - - function markAllCategoriesAndChildrenInactive() - { - angular.forEach(menuModel.menu, function (cat) { - cat.active = false; - angular.forEach(cat.subcategories, function (subcat) { - subcat.active = false; - - if (subcat.isGroup && subcat.subcategories) { - angular.forEach(subcat.subcategories, function (sub) { - sub.active = false; - }); - - } - }); - }); - } - - $scope.menuModel = menuModel; - - // highlight the currently hovered subcategory (and category) - function enterSubcategory(category, subcategory, subsubcategory) { - if (!category || !subcategory) { - return; - } - - markAllCategoriesAndChildrenInactive(); - - category.active = true; - subcategory.active = true; - - if (subsubcategory) { - subcategory.name = subsubcategory.name; - subsubcategory.active = true; - } - } - - $scope.showHelp = function (category, subcategory, $event) { - if (( $scope.currentCategory !== category.id - || $scope.currentSubcategory !== subcategory.id ) - && $event - ) { - showSubcategoryHelpOnLoad = { category: category, subcategory: subcategory }; - window.location.href = '#?' + $scope.makeUrl(category, subcategory); - return; - } - - var UI = require('piwik/UI'); - var notification = new UI.Notification(); - - if (subcategory === $scope.helpShownCategory) { - notification.remove('reportingmenu-help'); - $scope.helpShownCategory = null; - return; - } - - var prefix = '<strong>' + _pk_translate('CoreHome_ReportingCategoryHelpPrefix', [category.name, subcategory.name]) + '</strong><br/>'; - - var options = { context: 'info', id: 'reportingmenu-help', type: 'transient', noclear: true }; - options['class'] = 'help-notification'; - - notification.show(prefix + subcategory.help, options); - $scope.helpShownCategory = subcategory; - - // move help notification so it is always the first one shown - $('[notification-id=reportingmenu-help]').prependTo($('#notificationContainer')); - }; - - $scope.isNotificationShown = function () { - return !! $('#reportingmenu-help').length; - }; - - $scope.makeUrl = function (category, subcategory) { - var params = { - idSite: idSite, - period: period, - date: decodeURIComponent(date), - segment: decodeURIComponent(segment), - category: category.id, - subcategory: subcategory.id, - }; - - if (compareDates) { - params.compareDates = compareDates; - } - - if (comparePeriods) { - params.comparePeriods = comparePeriods; - } - - if (compareSegments) { - params.compareSegments = compareSegments; - } - - return $.param(params) - // some browsers treat URLs w/ date=a,b differently from date=a%2Cb, causing multiple - // entries to show up in the browser history. this has a compounding effect w/ angular.js, - // which when the back button is pressed to effectively abort the back navigation. - .replace(/%2C/g, ','); - }; - - $scope.loadCategory = function (category) { - var UI = require('piwik/UI'); - UI.Notification.prototype.remove('reportingmenu-help'); - - if (category.active) { - category.active = false; - } else { - markAllCategoriesAsInactive(); - category.active = true; - } - - if (category.active && category.subcategories && category.subcategories.length === 1) { - $scope.helpShownCategory = null; - - var subcategory = category.subcategories[0]; - - if (subcategory.active) { - // we need to manually trigger change as URL would not change and therefore page would not be - // reloaded - $scope.loadSubcategory(category, subcategory); - } else { - var url = $scope.makeUrl(category, subcategory); - $location.search(url); - } - } - }; - - $scope.loadSubcategory = function (category, subcategory) { - var UI = require('piwik/UI'); - UI.Notification.prototype.remove('reportingmenu-help'); - - if (subcategory && subcategory.active) { - $scope.helpShownCategory = null; - - // this menu item is already active, a location change success would not be triggered, - // instead trigger an event - $rootScope.$emit('loadPage', category.id, subcategory.id); - } - }; - - menuModel.fetchMenuItems().then(function (menu) { - if (!$location.search().subcategory) { - // load first, initial page if no subcategory is present - enterSubcategory(menu[0], menu[0].subcategories[0]); - $location.search($scope.makeUrl(menu[0], menu[0].subcategories[0])); - } - }); - - $rootScope.$on('updateReportingMenu', function () { - menuModel.reloadMenuItems().then(function (menu) { - var $search = $location.search(); - var category = $search.category; - var subcategory = $search.subcategory; - // we need to make sure to select same categories again - if (category && subcategory) { - var found = menuModel.findSubcategory(category, subcategory); - if (found) { - enterSubcategory(found.category, found.subcategory, found.subsubcategory); - } - } - }); - if ('object' === typeof widgetsHelper && widgetsHelper.availableWidgets) { - // lets also update widgetslist so will be easier to update list of available widgets in dashboard selector - // immediately - delete widgetsHelper.availableWidgets; - widgetsHelper.getAvailableWidgets(); - } - }); - - $rootScope.$on('$locationChangeSuccess', function () { - var $search = $location.search(); - var category = $search.category; - var subcategory = $search.subcategory; - - period = piwikUrl.getSearchParam('period'); - date = piwikUrl.getSearchParam('date'); - segment = piwikUrl.getSearchParam('segment'); - - comparePeriods = piwikUrl.getSearchParam('comparePeriods'); - compareDates = piwikUrl.getSearchParam('compareDates'); - compareSegments = piwikUrl.getSearchParam('compareSegments'); - - if (!category || !subcategory) { - return; - } - - var found = menuModel.findSubcategory(category, subcategory); - enterSubcategory(found.category, found.subcategory, found.subsubcategory); - }); - - $rootScope.$on('piwikPageChange', function (event) { - if (!initialLoad) { - globalAjaxQueue.abort(); - } - - $scope.helpShownCategory = null; - $scope.currentCategory = piwikUrl.getSearchParam('category'); - $scope.currentSubcategory = piwikUrl.getSearchParam('subcategory'); - - if (showSubcategoryHelpOnLoad) { - $scope.showHelp(showSubcategoryHelpOnLoad.category, showSubcategoryHelpOnLoad.subcategory); - showSubcategoryHelpOnLoad = null; - } - - $('#loadingError').hide(); - - initialLoad = false; - }); - } -})(); diff --git a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.directive.html b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.directive.html deleted file mode 100644 index ff3a549061..0000000000 --- a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.directive.html +++ /dev/null @@ -1,72 +0,0 @@ -<div class="reportingMenu"><ul class="navbar hide-on-med-and-down" role="menu" aria-label="{{ 'CoreHome_MainNavigation'|translate }}"> - <li ng-repeat="category in menuModel.menu" - class="menuTab" - role="menuitem" - ng-class="{'active': category.active}"> - <a class="item" tabindex="5" - href="" - ng-click="loadCategory(category)"> - <span class="menu-icon {{ category.icon ? category.icon : 'icon-arrow-right' }}"></span>{{ category.name }} - <span class="hidden"> - {{ 'CoreHome_Menu'|translate }} - </span> - </a> - - <ul role="menu"> - <li ng-repeat="subcategory in category.subcategories" - role="menuitem" - ng-class="{'active': subcategory.active}"> - <div ng-if="subcategory.isGroup" piwik-menudropdown show-search="true" menu-title="{{ subcategory.name|escape }}"> - <a class="item" tabindex="5" - ng-repeat="subcat in subcategory.subcategories" - title="{{ subcat.tooltip }}" - ng-class="{'active': subcat.active}" - ng-href="#?{{ makeUrl(category,subcat) }}" - ng-click='loadSubcategory(category, subcat)'> - {{ subcat.name }} - </a> - </div> - - <a ng-if="!subcategory.isGroup" - ng-href="#?{{ makeUrl(category,subcategory) }}" - class="item" - ng-click='loadSubcategory(category, subcategory)'> - {{ subcategory.name }} - </a> - - <a class="item-help-icon" - tabindex="5" href="javascript:" - ng-if="subcategory.help" - ng-click="showHelp(category, subcategory, $event)" - ng-class="{'active': helpShownCategory == subcategory && subcategory.help}" - > - <span class="icon-help"></span> - </a> - </li> - </ul> - </li> -</ul> -<ul id="mobile-left-menu" class="sidenav hide-on-large-only"> - <li class="no-padding" ng-repeat="category in menuModel.menu"> - <ul class="collapsible collapsible-accordion" piwik-side-nav="nav .activateLeftMenu"> - <li> - <a class="collapsible-header"><i class="{{ category.icon ? category.icon : 'icon-arrow-bottom' }}"></i>{{ category.name }}</a> - <div class="collapsible-body"> - <ul> - <li ng-repeat="subcategory in category.subcategories"> - <a ng-if="subcategory.isGroup" - ng-repeat="subcat in subcategory.subcategories" - ng-click='loadSubcategory(category, subcat)' - ng-href="#?{{ makeUrl(category,subcat) }}">{{ subcat.name }}</a> - <a ng-if="!subcategory.isGroup" - ng-click='loadSubcategory(category, subcategory)' - ng-href="#?{{ makeUrl(category,subcategory) }}">{{ subcategory.name }}</a> - </li> - </ul> - </div> - </li> - </ul> - </li> -</ul> - -</div> diff --git a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.directive.js b/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.directive.js deleted file mode 100644 index 1f037e8b8c..0000000000 --- a/plugins/CoreHome/angularjs/reporting-menu/reportingmenu.directive.js +++ /dev/null @@ -1,32 +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 - */ - -/** - * Shows the Piwik reporting menu. - * - * It automatically calls the API to fetch all data. - * - * Example: - * <div piwik-reporting-menu></div> - */ - -(function () { - angular.module('piwikApp').directive('piwikReportingMenu', piwikReportingMenu); - - piwikReportingMenu.$inject = ['piwik']; - - function piwikReportingMenu(piwik){ - - return { - restrict: 'A', - replace: true, - scope: {}, - templateUrl: 'plugins/CoreHome/angularjs/reporting-menu/reportingmenu.directive.html?cb=' + piwik.cacheBuster, - controller: 'ReportingMenuController' - }; - } -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/reporting-page/reportingpage.controller.js b/plugins/CoreHome/angularjs/reporting-page/reportingpage.controller.js index d23590babe..4fac133741 100644 --- a/plugins/CoreHome/angularjs/reporting-page/reportingpage.controller.js +++ b/plugins/CoreHome/angularjs/reporting-page/reportingpage.controller.js @@ -63,7 +63,7 @@ var $search = $location.search(); - if ($search.segment !== '') { + if ($search.segment) { hideOnlyRawDataNoticifation(); return; } diff --git a/plugins/CoreHome/stylesheets/layout.less b/plugins/CoreHome/stylesheets/layout.less index dd1a8b6fd0..35a7524aba 100644 --- a/plugins/CoreHome/stylesheets/layout.less +++ b/plugins/CoreHome/stylesheets/layout.less @@ -365,6 +365,9 @@ nav { .item .icon-arrow-right:before { content: "\e63b"; } + .menu-icon { + padding-right: 13px; + } } .collapsible { diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 8c280b3071..9cc87298a1 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -160,6 +160,7 @@ __webpack_require__.d(__webpack_exports__, "FocusIf", function() { return /* ree __webpack_require__.d(__webpack_exports__, "MatomoDialog", function() { return /* reexport */ MatomoDialog; }); __webpack_require__.d(__webpack_exports__, "ExpandOnClick", function() { return /* reexport */ ExpandOnClick; }); __webpack_require__.d(__webpack_exports__, "ExpandOnHover", function() { return /* reexport */ ExpandOnHover; }); +__webpack_require__.d(__webpack_exports__, "SideNav", function() { return /* reexport */ SideNav; }); __webpack_require__.d(__webpack_exports__, "EnrichedHeadline", function() { return /* reexport */ EnrichedHeadline; }); __webpack_require__.d(__webpack_exports__, "ContentBlock", function() { return /* reexport */ ContentBlock; }); __webpack_require__.d(__webpack_exports__, "Comparisons", function() { return /* reexport */ Comparisons; }); @@ -175,6 +176,7 @@ __webpack_require__.d(__webpack_exports__, "QuickAccess", function() { return /* __webpack_require__.d(__webpack_exports__, "FieldArray", function() { return /* reexport */ FieldArray; }); __webpack_require__.d(__webpack_exports__, "MultiPairField", function() { return /* reexport */ MultiPairField; }); __webpack_require__.d(__webpack_exports__, "PeriodSelector", function() { return /* reexport */ PeriodSelector; }); +__webpack_require__.d(__webpack_exports__, "ReportingMenu", function() { return /* reexport */ ReportingMenu; }); __webpack_require__.d(__webpack_exports__, "ReportingPagesStore", function() { return /* reexport */ ReportingPages_store; }); __webpack_require__.d(__webpack_exports__, "ReportMetadataStore", function() { return /* reexport */ ReportMetadata_store; }); @@ -1163,7 +1165,10 @@ var MatomoUrl_MatomoUrl = /*#__PURE__*/function () { key: "stringify", value: function stringify(search) { // TODO: using $ since URLSearchParams does not handle array params the way Matomo uses them - return $.param(search).replace(/%5B%5D/g, '[]'); + return $.param(search).replace(/%5B%5D/g, '[]') // some browsers treat URLs w/ date=a,b differently from date=a%2Cb, causing multiple + // entries to show up in the browser history. this has a compounding effect w/ angular.js, + // which when the back button is pressed to effectively abort the back navigation. + .replace(/%2C/g, ','); } }, { key: "updatePeriodParamsFromUrl", @@ -1623,12 +1628,25 @@ var AjaxHelper_AjaxHelper = /*#__PURE__*/function () { this.requestHandle = this.buildAjaxCall(); window.globalAjaxQueue.push(this.requestHandle); + var $timeout = null; + + try { + $timeout = Matomo_Matomo.helper.getAngularDependency('$timeout'); + } catch (e) {// ignore + } + var result = new Promise(function (resolve, reject) { - _this2.requestHandle.then(resolve).fail(function (xhr) { + _this2.requestHandle.then(function (data) { + resolve(data); // ignoring textStatus/jqXHR + }).fail(function (xhr) { if (xhr.statusText !== 'abort') { console.log("Warning: the ".concat($.param(_this2.getParams), " request failed!")); reject(xhr); } + }).done(function () { + if ($timeout) { + $timeout(); // trigger digest + } }); }); @@ -2410,6 +2428,82 @@ function piwikExpandOnHover() { piwikExpandOnHover.$inject = []; angular.module('piwikApp').directive('piwikExpandOnHover', piwikExpandOnHover); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SideNav/SideNav.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +var initialized = false; +/** + * Will activate the materialize side nav feature once rendered. We use this directive as + * it makes sure the actual left menu is rendered at the time we init the side nav. + * + * Has to be set on a collaapsible element + * + * Example: + * <div class="collapsible" v-side-nav="nav .activateLeftMenu">...</div> + */ + +/* harmony default export */ var SideNav = ({ + mounted: function mounted(el, binding) { + if (!binding.value.activator) { + return; + } + + setTimeout(function () { + if (!initialized) { + initialized = true; + var sideNavActivator = directiveUtilities.getRef(binding.value.activator, binding); + + if (sideNavActivator) { + window.$(sideNavActivator).show(); + } + + var targetSelector = sideNavActivator.getAttribute('data-target'); + window.$("#".concat(targetSelector)).sidenav({ + closeOnClick: true + }); + } + + if (el.classList.contains('collapsible')) { + window.$(el).collapsible(); + } + }); + } +}); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SideNav/SideNav.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 + */ + +function piwikSideNav($timeout) { + return { + restrict: 'A', + priority: 10, + link: function linkPiwikSideNav(scope, element, attr) { + var binding = { + instance: null, + value: { + activator: $(attr.piwikSideNav)[0] + }, + oldValue: null, + modifiers: {}, + dir: {} + }; + $timeout(function () { + SideNav.mounted(element[0], binding); + }); + } + }; +} +piwikSideNav.$inject = ['$timeout']; +angular.module('piwikApp.directive').directive('piwikSideNav', piwikSideNav); // 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/MatomoDialog/MatomoDialog.vue?vue&type=template&id=64e27324 var _hoisted_1 = { @@ -2755,6 +2849,10 @@ function transformAngularJsIntAttr(v) { } // utility function for service adapters function clone(p) { + if (typeof p === 'undefined') { + return p; + } + return JSON.parse(JSON.stringify(p)); } function cloneThenApply(p) { @@ -4916,34 +5014,34 @@ PeriodDatePickervue_type_script_lang_ts.render = PeriodDatePickervue_type_templa directiveName: 'piwikPeriodDatePicker', 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/SiteSelector/SiteSelector.vue?vue&type=template&id=f4155c00 +// 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/SiteSelector/SiteSelector.vue?vue&type=template&id=cc252118 -var SiteSelectorvue_type_template_id_f4155c00_hoisted_1 = ["value", "name"]; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_2 = ["title"]; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_3 = ["textContent"]; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_4 = { +var SiteSelectorvue_type_template_id_cc252118_hoisted_1 = ["value", "name"]; +var SiteSelectorvue_type_template_id_cc252118_hoisted_2 = ["title"]; +var SiteSelectorvue_type_template_id_cc252118_hoisted_3 = ["textContent"]; +var SiteSelectorvue_type_template_id_cc252118_hoisted_4 = { key: 1, class: "placeholder" }; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_5 = { +var SiteSelectorvue_type_template_id_cc252118_hoisted_5 = { class: "dropdown" }; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_6 = { +var SiteSelectorvue_type_template_id_cc252118_hoisted_6 = { class: "custom_select_search" }; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_7 = ["placeholder"]; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_8 = { +var SiteSelectorvue_type_template_id_cc252118_hoisted_7 = ["placeholder"]; +var SiteSelectorvue_type_template_id_cc252118_hoisted_8 = { key: 0 }; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_9 = { +var SiteSelectorvue_type_template_id_cc252118_hoisted_9 = { class: "custom_select_container" }; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_10 = ["onClick"]; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_11 = ["innerHTML", "href", "title"]; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_12 = { +var SiteSelectorvue_type_template_id_cc252118_hoisted_10 = ["onClick"]; +var SiteSelectorvue_type_template_id_cc252118_hoisted_11 = ["innerHTML", "href", "title"]; +var SiteSelectorvue_type_template_id_cc252118_hoisted_12 = { class: "ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect" }; -var SiteSelectorvue_type_template_id_f4155c00_hoisted_13 = { +var SiteSelectorvue_type_template_id_cc252118_hoisted_13 = { class: "ui-menu-item" }; var _hoisted_14 = { @@ -4953,7 +5051,7 @@ var _hoisted_14 = { var _hoisted_15 = { key: 1 }; -function SiteSelectorvue_type_template_id_f4155c00_render(_ctx, _cache, $props, $setup, $data, $options) { +function SiteSelectorvue_type_template_id_cc252118_render(_ctx, _cache, $props, $setup, $data, $options) { var _ctx$modelValue, _ctx$modelValue2, _ctx$modelValue3, _ctx$modelValue4; var _component_AllSitesLink = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("AllSitesLink"); @@ -4972,7 +5070,7 @@ function SiteSelectorvue_type_template_id_f4155c00_render(_ctx, _cache, $props, type: "hidden", value: (_ctx$modelValue = _ctx.modelValue) === null || _ctx$modelValue === void 0 ? void 0 : _ctx$modelValue.id, name: _ctx.name - }, null, 8, SiteSelectorvue_type_template_id_f4155c00_hoisted_1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, SiteSelectorvue_type_template_id_cc252118_hoisted_1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { ref: "selectorLink", onClick: _cache[0] || (_cache[0] = function () { return _ctx.onClickSelector && _ctx.onClickSelector.apply(_ctx, arguments); @@ -4994,7 +5092,7 @@ function SiteSelectorvue_type_template_id_f4155c00_render(_ctx, _cache, $props, }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [(_ctx$modelValue2 = _ctx.modelValue) !== null && _ctx$modelValue2 !== void 0 && _ctx$modelValue2.name || !_ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { key: 0, textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(((_ctx$modelValue3 = _ctx.modelValue) === null || _ctx$modelValue3 === void 0 ? void 0 : _ctx$modelValue3.name) || _ctx.firstSiteName) - }, null, 8, SiteSelectorvue_type_template_id_f4155c00_hoisted_3)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !((_ctx$modelValue4 = _ctx.modelValue) !== null && _ctx$modelValue4 !== void 0 && _ctx$modelValue4.name) && _ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SiteSelectorvue_type_template_id_f4155c00_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.placeholder), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 42, SiteSelectorvue_type_template_id_f4155c00_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_f4155c00_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_f4155c00_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + }, null, 8, SiteSelectorvue_type_template_id_cc252118_hoisted_3)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !((_ctx$modelValue4 = _ctx.modelValue) !== null && _ctx$modelValue4 !== void 0 && _ctx$modelValue4.name) && _ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SiteSelectorvue_type_template_id_cc252118_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.placeholder), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 42, SiteSelectorvue_type_template_id_cc252118_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_cc252118_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_cc252118_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { type: "text", onClick: _cache[2] || (_cache[2] = function ($event) { _ctx.searchTerm = ''; @@ -5007,7 +5105,7 @@ function SiteSelectorvue_type_template_id_f4155c00_render(_ctx, _cache, $props, tabindex: "4", class: "websiteSearch inp browser-default", placeholder: _ctx.translate('General_Search') - }, null, 8, SiteSelectorvue_type_template_id_f4155c00_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.shouldFocusOnSearch]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + }, null, 8, SiteSelectorvue_type_template_id_cc252118_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.shouldFocusOnSearch]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { title: "Clear", onClick: _cache[4] || (_cache[4] = function ($event) { _ctx.searchTerm = ''; @@ -5016,13 +5114,13 @@ function SiteSelectorvue_type_template_id_f4155c00_render(_ctx, _cache, $props, }), class: "reset", src: "plugins/CoreHome/images/reset_search.png" - }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.autocompleteMinSites <= _ctx.sites.length || _ctx.searchTerm]]), _ctx.allSitesLocation === 'top' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteSelectorvue_type_template_id_f4155c00_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { + }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.autocompleteMinSites <= _ctx.sites.length || _ctx.searchTerm]]), _ctx.allSitesLocation === 'top' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteSelectorvue_type_template_id_cc252118_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { href: _ctx.urlAllSites, "all-sites-text": _ctx.allSitesText, onClick: _cache[5] || (_cache[5] = function ($event) { return _ctx.onAllSitesClick($event); }) - }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_f4155c00_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { + }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_cc252118_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { class: "custom_select_ul_list", onClick: _cache[7] || (_cache[7] = function ($event) { return _ctx.showSitesList = false; @@ -5041,8 +5139,8 @@ function SiteSelectorvue_type_template_id_f4155c00_render(_ctx, _cache, $props, tabindex: "4", href: _ctx.getUrlForSiteId(site.idsite), title: site.name - }, null, 8, SiteSelectorvue_type_template_id_f4155c00_hoisted_11)], 8, SiteSelectorvue_type_template_id_f4155c00_hoisted_10)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(!_ctx.showSelectedSite && _ctx.activeSiteId === site.idsite)]]); - }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", SiteSelectorvue_type_template_id_f4155c00_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", SiteSelectorvue_type_template_id_f4155c00_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", _hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_NotFound') + ' ' + _ctx.searchTerm), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.sites.length && _ctx.searchTerm]])]), _ctx.allSitesLocation === 'bottom' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { + }, null, 8, SiteSelectorvue_type_template_id_cc252118_hoisted_11)], 8, SiteSelectorvue_type_template_id_cc252118_hoisted_10)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(!_ctx.showSelectedSite && _ctx.activeSiteId === site.idsite)]]); + }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", SiteSelectorvue_type_template_id_cc252118_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", SiteSelectorvue_type_template_id_cc252118_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", _hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_NotFound') + ' ' + _ctx.searchTerm), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.sites.length && _ctx.searchTerm]])]), _ctx.allSitesLocation === 'bottom' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { href: _ctx.urlAllSites, "all-sites-text": _ctx.allSitesText, onClick: _cache[8] || (_cache[8] = function ($event) { @@ -5052,7 +5150,7 @@ function SiteSelectorvue_type_template_id_f4155c00_render(_ctx, _cache, $props, blur: _ctx.onBlur }]]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=f4155c00 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=cc252118 // 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/SiteSelector/AllSitesLink.vue?vue&type=template&id=45607d28 @@ -5287,9 +5385,15 @@ function SiteSelectorvue_type_script_lang_ts_defineProperty(obj, key, value) { i props: { modelValue: { Object: Object, - default: { - id: Matomo_Matomo.idSite, - name: Matomo_Matomo.helper.htmlDecode(Matomo_Matomo.siteName) + default: function _default(props) { + if (props.modelValue) { + return props.modelValue; + } + + return Matomo_Matomo.idSite ? { + id: Matomo_Matomo.idSite, + name: Matomo_Matomo.helper.htmlDecode(Matomo_Matomo.siteName) + } : undefined; } }, showSelectedSite: { @@ -5342,10 +5446,6 @@ function SiteSelectorvue_type_script_lang_ts_defineProperty(obj, key, value) { i showSitesList: false, isLoading: false, sites: [], - selectedSite: this.modelValue || { - id: Matomo_Matomo.idSite, - name: Matomo_Matomo.helper.htmlDecode(Matomo_Matomo.siteName) - }, autocompleteMinSites: parseInt(Matomo_Matomo.config.autocomplete_min_sites, 10) }; }, @@ -5354,7 +5454,7 @@ function SiteSelectorvue_type_script_lang_ts_defineProperty(obj, key, value) { i window.initTopControls(); this.loadInitialSites().then(function () { - if ((!_this.modelValue || !_this.modelValue.id) && _this.sites[0]) { + if ((!_this.modelValue || !_this.modelValue.id) && !_this.hasMultipleSites && _this.sites[0]) { _this.$emit('update:modelValue', { id: _this.sites[0].idsite, name: _this.sites[0].name @@ -5391,7 +5491,8 @@ function SiteSelectorvue_type_script_lang_ts_defineProperty(obj, key, value) { i return SiteSelector_SitesStore.initialSites.value && SiteSelector_SitesStore.initialSites.value.length > 1; }, firstSiteName: function firstSiteName() { - return this.sites && this.sites.length > 0 ? this.sites[0].name : ''; + var initialSites = SiteSelector_SitesStore.initialSites.value; + return initialSites && initialSites.length > 0 ? initialSites[0].name : ''; }, urlAllSites: function urlAllSites() { var newQuery = src_MatomoUrl_MatomoUrl.stringify(SiteSelectorvue_type_script_lang_ts_objectSpread(SiteSelectorvue_type_script_lang_ts_objectSpread({}, src_MatomoUrl_MatomoUrl.urlParsed.value), {}, { @@ -5522,16 +5623,10 @@ function SiteSelectorvue_type_script_lang_ts_defineProperty(obj, key, value) { i -SiteSelectorvue_type_script_lang_ts.render = SiteSelectorvue_type_template_id_f4155c00_render +SiteSelectorvue_type_script_lang_ts.render = SiteSelectorvue_type_template_id_cc252118_render /* harmony default export */ var SiteSelector = (SiteSelectorvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts -function SiteSelector_adapter_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 SiteSelector_adapter_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { SiteSelector_adapter_ownKeys(Object(source), true).forEach(function (key) { SiteSelector_adapter_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { SiteSelector_adapter_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function SiteSelector_adapter_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 * @@ -5570,7 +5665,25 @@ function SiteSelector_adapter_defineProperty(obj, key, value) { if (key in obj) placeholder: { angularJsBind: '@' }, - modelValue: {} + modelValue: { + default: function _default(scope, element, attrs) { + if (attrs.siteid && attrs.sitename) { + return { + id: attrs.siteid, + name: Matomo_Matomo.helper.htmlDecode(attrs.sitename) + }; + } + + if (Matomo_Matomo.idSite) { + return { + id: Matomo_Matomo.idSite, + name: Matomo_Matomo.helper.htmlDecode(Matomo_Matomo.siteName) + }; + } + + return undefined; + } + } }, $inject: ['$timeout'], directiveName: 'piwikSiteselector', @@ -5582,14 +5695,10 @@ function SiteSelector_adapter_defineProperty(obj, key, value) { if (key in obj) element.attr('siteid', newValue.id); element.trigger('change', newValue); - if (ngModel // the original site selector did not initiate an ngModel change when initializing its - // internal selectedSite state. mimicking that behavior here for BC. - && (scope.isNotFirstModelChange || vm.modelValue)) { + if (ngModel) { ngModel.$setViewValue(newValue); ngModel.$render(); // not called automatically by the digest } - - scope.isNotFirstModelChange = true; }); } }, @@ -5599,71 +5708,63 @@ function SiteSelector_adapter_defineProperty(obj, key, value) { if (key in obj) }); } }, - postCreate: function postCreate(vm, scope, element, attrs, controller, $timeout) { + postCreate: function postCreate(vm, scope, element, attrs, controller) { var ngModel = controller; scope.$watch('value', function (newVal) { - if (newVal !== vm.modelValue) { - vm.modelValue = newVal; - } + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + if (newVal !== vm.modelValue) { + vm.modelValue = newVal; + } + }); }); // setup ng-model mapping if (ngModel) { - if (vm.modelValue) { - ngModel.$setViewValue(vm.modelValue); - } + ngModel.$setViewValue(vm.modelValue); ngModel.$render = function () { Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { - if (angular.isString(ngModel.$viewValue)) { - vm.modelValue = JSON.parse(ngModel.$viewValue); - } else { - vm.modelValue = ngModel.$viewValue; - } + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + if (angular.isString(ngModel.$viewValue)) { + vm.modelValue = JSON.parse(ngModel.$viewValue); + } else { + vm.modelValue = ngModel.$viewValue; + } + }); }); }; } - - $timeout(function () { - if (attrs.siteid && attrs.sitename) { - vm.modelValue = { - id: attrs.siteid, - name: Matomo_Matomo.helper.htmlDecode(attrs.sitename) - }; - ngModel.$setViewValue(SiteSelector_adapter_objectSpread({}, vm.modelValue)); - } - }); } })); -// 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/QuickAccess/QuickAccess.vue?vue&type=template&id=d1e03d32 +// 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/QuickAccess/QuickAccess.vue?vue&type=template&id=08fc9316 -var QuickAccessvue_type_template_id_d1e03d32_hoisted_1 = { +var QuickAccessvue_type_template_id_08fc9316_hoisted_1 = { ref: "root", class: "quickAccessInside" }; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_2 = ["title"]; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_3 = { +var QuickAccessvue_type_template_id_08fc9316_hoisted_2 = ["title"]; +var QuickAccessvue_type_template_id_08fc9316_hoisted_3 = { class: "dropdown" }; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_4 = { +var QuickAccessvue_type_template_id_08fc9316_hoisted_4 = { class: "no-result" }; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_5 = ["onClick"]; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_6 = ["onMouseenter", "onClick"]; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_7 = { +var QuickAccessvue_type_template_id_08fc9316_hoisted_5 = ["onClick"]; +var QuickAccessvue_type_template_id_08fc9316_hoisted_6 = ["onMouseenter", "onClick"]; +var QuickAccessvue_type_template_id_08fc9316_hoisted_7 = { class: "quickAccessMatomoSearch" }; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_8 = ["onMouseenter", "onClick"]; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_9 = ["textContent"]; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_10 = { +var QuickAccessvue_type_template_id_08fc9316_hoisted_8 = ["onMouseenter", "onClick"]; +var QuickAccessvue_type_template_id_08fc9316_hoisted_9 = ["textContent"]; +var QuickAccessvue_type_template_id_08fc9316_hoisted_10 = { class: "quick-access-category helpCategory" }; -var QuickAccessvue_type_template_id_d1e03d32_hoisted_11 = ["href"]; -function QuickAccessvue_type_template_id_d1e03d32_render(_ctx, _cache, $props, $setup, $data, $options) { +var QuickAccessvue_type_template_id_08fc9316_hoisted_11 = ["href"]; +function QuickAccessvue_type_template_id_08fc9316_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", QuickAccessvue_type_template_id_d1e03d32_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(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", QuickAccessvue_type_template_id_08fc9316_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon-search", onMouseenter: _cache[0] || (_cache[0] = function ($event) { return _ctx.searchActive = true; @@ -5682,7 +5783,7 @@ function QuickAccessvue_type_template_id_d1e03d32_render(_ctx, _cache, $props, $ type: "text", tabindex: "2", title: _ctx.quickAccessTitle - }, null, 40, QuickAccessvue_type_template_id_d1e03d32_hoisted_2), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.searchActive]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", QuickAccessvue_type_template_id_d1e03d32_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", QuickAccessvue_type_template_id_d1e03d32_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_SearchNoResults')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(_ctx.numMenuItems > 0 || _ctx.sites.length)]]), (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.menuItems, function (subcategory) { + }, null, 40, QuickAccessvue_type_template_id_08fc9316_hoisted_2), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.searchActive]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", QuickAccessvue_type_template_id_08fc9316_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", QuickAccessvue_type_template_id_08fc9316_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_SearchNoResults')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(_ctx.numMenuItems > 0 || _ctx.sites.length)]]), (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.menuItems, function (subcategory) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("ul", { key: subcategory.title }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { @@ -5692,7 +5793,7 @@ function QuickAccessvue_type_template_id_d1e03d32_render(_ctx, _cache, $props, $ _ctx.searchMenu(_ctx.searchTerm); } - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(subcategory.title), 9, QuickAccessvue_type_template_id_d1e03d32_hoisted_5), (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"])(subcategory.items, function (submenuEntry) { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(subcategory.title), 9, QuickAccessvue_type_template_id_08fc9316_hoisted_5), (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"])(subcategory.items, function (submenuEntry) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["result", { selected: submenuEntry.menuIndex === _ctx.searchIndex @@ -5704,9 +5805,9 @@ function QuickAccessvue_type_template_id_d1e03d32_render(_ctx, _cache, $props, $ return _ctx.selectMenuItem(submenuEntry.index); }, key: submenuEntry.index - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(submenuEntry.name.trim()), 1)], 42, QuickAccessvue_type_template_id_d1e03d32_hoisted_6); + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(submenuEntry.name.trim()), 1)], 42, QuickAccessvue_type_template_id_08fc9316_hoisted_6); }), 128))]); - }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", QuickAccessvue_type_template_id_d1e03d32_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { + }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", QuickAccessvue_type_template_id_08fc9316_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { class: "quick-access-category websiteCategory" }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Sites')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasSitesSelector && _ctx.sites.length || _ctx.isLoading]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { class: "no-result" @@ -5724,8 +5825,8 @@ function QuickAccessvue_type_template_id_d1e03d32_render(_ctx, _cache, $props, $ key: site.idsite }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(site.name) - }, null, 8, QuickAccessvue_type_template_id_d1e03d32_hoisted_9)], 42, QuickAccessvue_type_template_id_d1e03d32_hoisted_8)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasSitesSelector && !_ctx.isLoading]]); - }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", QuickAccessvue_type_template_id_d1e03d32_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_HelpResources')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { + }, null, 8, QuickAccessvue_type_template_id_08fc9316_hoisted_9)], 42, QuickAccessvue_type_template_id_08fc9316_hoisted_8)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasSitesSelector && !_ctx.isLoading]]); + }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", QuickAccessvue_type_template_id_08fc9316_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_HelpResources')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ selected: _ctx.searchIndex === 'help' }, "quick-access-help"]), @@ -5735,11 +5836,11 @@ function QuickAccessvue_type_template_id_d1e03d32_render(_ctx, _cache, $props, $ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "https://matomo.org?s=".concat(encodeURIComponent(_ctx.searchTerm)), target: "_blank" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreHome_SearchOnMatomo', _ctx.searchTerm)), 9, QuickAccessvue_type_template_id_d1e03d32_hoisted_11)], 34)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm && _ctx.searchActive]])], 512)), [[_directive_focus_anywhere_but_here, { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreHome_SearchOnMatomo', _ctx.searchTerm)), 9, QuickAccessvue_type_template_id_08fc9316_hoisted_11)], 34)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm && _ctx.searchActive]])], 512)), [[_directive_focus_anywhere_but_here, { blur: _ctx.onBlur }]]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue?vue&type=template&id=d1e03d32 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue?vue&type=template&id=08fc9316 // 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/QuickAccess/QuickAccess.vue?vue&type=script&lang=ts function QuickAccessvue_type_script_lang_ts_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; } @@ -6066,7 +6167,8 @@ function scrollFirstElementIntoView(element) { var leftMenuItems = []; document.querySelectorAll('#secondNavBar .menuTab').forEach(function (element) { - var category = window.$(element).find('> .item').text().trim(); + var category = window.$(element).find('> .item'); + category = category[0] ? category[0].innerText.trim() : ''; if (category && category.lastIndexOf('\n') !== -1) { // remove "\n\nMenu" @@ -6119,7 +6221,7 @@ function scrollFirstElementIntoView(element) { -QuickAccessvue_type_script_lang_ts.render = QuickAccessvue_type_template_id_d1e03d32_render +QuickAccessvue_type_script_lang_ts.render = QuickAccessvue_type_template_id_08fc9316_render /* harmony default export */ var QuickAccess = (QuickAccessvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/QuickAccess/QuickAccess.adapter.ts @@ -7206,347 +7308,152 @@ PeriodSelectorvue_type_script_lang_ts.render = PeriodSelectorvue_type_template_i }, directiveName: 'piwikPeriodSelector' })); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts -function ReportingPages_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function ReportingPages_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 ReportingPages_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) ReportingPages_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) ReportingPages_store_defineProperties(Constructor, staticProps); return Constructor; } - -function ReportingPages_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 ReportingPages_store_ReportingPagesStore = /*#__PURE__*/function () { - function ReportingPagesStore() { - var _this = this; - - ReportingPages_store_classCallCheck(this, ReportingPagesStore); - - ReportingPages_store_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ - pages: [] - })); - - ReportingPages_store_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.privateState)); - - ReportingPages_store_defineProperty(this, "fetchAllPagesPromise", void 0); - - ReportingPages_store_defineProperty(this, "pages", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { - return _this.state.pages; - })); - } - - ReportingPages_store_createClass(ReportingPagesStore, [{ - key: "findPageInCategory", - value: function findPageInCategory(categoryId) { - // happens when user switches between sites, in this case check if the same category exists and - // if so, select first entry from that category - return this.pages.value.find(function (p) { - return p && p.category && p.category.id === categoryId && p.subcategory && p.subcategory.id; - }); - } - }, { - key: "findPage", - value: function findPage(categoryId, subcategoryId) { - return this.pages.value.find(function (p) { - return p && p.category && p.subcategory && p.category.id === categoryId && "".concat(p.subcategory.id) === subcategoryId; - }); - } - }, { - key: "reloadAllPages", - value: function reloadAllPages() { - var _this2 = this; - - // use a setTimeout this method can happen when changing the page, and page changes - // will abort in progress AJAX requests, even this one if it is in progress. - return new Promise(function (resolve) { - return setTimeout(resolve); - }).then(function () { - _this2.fetchAllPagesPromise = null; - return _this2.getAllPages(); - }); - } - }, { - key: "getAllPages", - value: function getAllPages() { - var _this3 = this; - - if (!this.fetchAllPagesPromise) { - this.fetchAllPagesPromise = AjaxHelper_AjaxHelper.fetch({ - method: 'API.getReportPagesMetadata', - filter_limit: '-1' - }).then(function (response) { - _this3.privateState.pages = response; - }); - } +// 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/ReportingMenu/ReportingMenu.vue?vue&type=template&id=708190ea - return this.fetchAllPagesPromise.then(function () { - return _this3.pages.value; - }); - } - }]); - - return ReportingPagesStore; -}(); -/* harmony default export */ var ReportingPages_store = (new ReportingPages_store_ReportingPagesStore()); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPages/ReportingPages.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 - */ - - - -function reportingPagesModelAdapter() { - return { - get pages() { - return ReportingPages_store.pages.value; - }, - - findPageInCategory: function findPageInCategory() { - return clone(ReportingPages_store.findPageInCategory.apply(ReportingPages_store, arguments)); - }, - findPage: function findPage() { - return clone(ReportingPages_store.findPage.apply(ReportingPages_store, arguments)); - }, - reloadAllPages: function reloadAllPages() { - return ReportingPages_store.reloadAllPages().then(function (p) { - return cloneThenApply(p); - }); - }, - getAllPages: function getAllPages() { - return ReportingPages_store.getAllPages().then(function (p) { - return cloneThenApply(p); - }); - } - }; -} - -angular.module('piwikApp.service').factory('reportingPagesModel', reportingPagesModelAdapter); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportMetadata/ReportMetadata.store.ts -function ReportMetadata_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function ReportMetadata_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 ReportMetadata_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) ReportMetadata_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) ReportMetadata_store_defineProperties(Constructor, staticProps); return Constructor; } - -function ReportMetadata_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 ReportMetadata_store_ReportMetadataStore = /*#__PURE__*/function () { - function ReportMetadataStore() { - var _this = this; - - ReportMetadata_store_classCallCheck(this, ReportMetadataStore); - - ReportMetadata_store_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ - reports: [] - })); - - ReportMetadata_store_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.privateState)); - - ReportMetadata_store_defineProperty(this, "reports", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { - return _this.state.reports; - })); - - ReportMetadata_store_defineProperty(this, "reportsPromise", void 0); - } - - ReportMetadata_store_createClass(ReportMetadataStore, [{ - key: "findReport", - value: // TODO: it used to return an empty array when nothing was found, will that be an issue? - function findReport(reportModule, reportAction) { - return this.reports.value.find(function (r) { - return r.module === reportModule && r.action === reportAction; - }); - } - }, { - key: "fetchReportMetadata", - value: function fetchReportMetadata() { - var _this2 = this; - - if (!this.reportsPromise) { - this.reportsPromise = AjaxHelper_AjaxHelper.fetch({ - method: 'API.getReportMetadata', - filter_limit: '-1', - idSite: Matomo_Matomo.idSite || src_MatomoUrl_MatomoUrl.parsed.value.idSite - }).then(function (response) { - _this2.privateState.reports = response; - return response; - }); - } - - return this.reportsPromise.then(function () { - return _this2.reports.value; - }); - } - }]); - - return ReportMetadataStore; -}(); -/* harmony default export */ var ReportMetadata_store = (new ReportMetadata_store_ReportMetadataStore()); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportMetadata/ReportMetadata.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.service').factory('reportMetadataModel', function () { - return { - get reports() { - return ReportMetadata_store.reports.value; - }, - - findReport: ReportMetadata_store.findReport.bind(ReportMetadata_store), - fetchReportMetadata: function fetchReportMetadata() { - return ReportMetadata_store.fetchReportMetadata().then(function (m) { - return cloneThenApply(m); - }); - } - }; -}); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.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 ActivityIndicator_adapter = (createAngularJsAdapter({ - component: ActivityIndicator, - scope: { - loading: { - vue: 'loading', - angularJsBind: '<' - }, - loadingMessage: { - vue: 'loadingMessage', - angularJsBind: '<', - default: function _default() { - return translate('General_LoadingData'); - } - } - }, - $inject: [], - directiveName: 'piwikActivityIndicator' -})); -// 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/Alert/Alert.vue?vue&type=template&id=c3863ae2 -function Alertvue_type_template_id_c3863ae2_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; } +var ReportingMenuvue_type_template_id_708190ea_hoisted_1 = { + class: "reportingMenu" +}; +var ReportingMenuvue_type_template_id_708190ea_hoisted_2 = ["aria-label"]; +var ReportingMenuvue_type_template_id_708190ea_hoisted_3 = ["onClick"]; +var ReportingMenuvue_type_template_id_708190ea_hoisted_4 = { + class: "hidden" +}; +var ReportingMenuvue_type_template_id_708190ea_hoisted_5 = { + role: "menu" +}; +var ReportingMenuvue_type_template_id_708190ea_hoisted_6 = ["href", "onClick", "title"]; +var ReportingMenuvue_type_template_id_708190ea_hoisted_7 = ["href", "onClick"]; +var ReportingMenuvue_type_template_id_708190ea_hoisted_8 = ["onClick"]; +var ReportingMenuvue_type_template_id_708190ea_hoisted_9 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-help" +}, null, -1); -function Alertvue_type_template_id_c3863ae2_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_["createElementBlock"])("div", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["alert", Alertvue_type_template_id_c3863ae2_defineProperty({}, "alert-".concat(_ctx.severity), true)]) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 2); +var ReportingMenuvue_type_template_id_708190ea_hoisted_10 = [ReportingMenuvue_type_template_id_708190ea_hoisted_9]; +var ReportingMenuvue_type_template_id_708190ea_hoisted_11 = { + id: "mobile-left-menu", + class: "sidenav hide-on-large-only" +}; +var ReportingMenuvue_type_template_id_708190ea_hoisted_12 = { + class: "collapsible collapsible-accordion" +}; +var ReportingMenuvue_type_template_id_708190ea_hoisted_13 = { + class: "collapsible-header" +}; +var ReportingMenuvue_type_template_id_708190ea_hoisted_14 = { + class: "collapsible-body" +}; +var ReportingMenuvue_type_template_id_708190ea_hoisted_15 = { + key: 0 +}; +var ReportingMenuvue_type_template_id_708190ea_hoisted_16 = ["onClick", "href"]; +var ReportingMenuvue_type_template_id_708190ea_hoisted_17 = { + key: 1 +}; +var ReportingMenuvue_type_template_id_708190ea_hoisted_18 = ["onClick", "href"]; +function ReportingMenuvue_type_template_id_708190ea_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_MenuDropdown = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MenuDropdown"); + + var _directive_side_nav = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("side-nav"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ReportingMenuvue_type_template_id_708190ea_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { + class: "navbar hide-on-med-and-down", + role: "menu", + "aria-label": _ctx.translate('CoreHome_MainNavigation') + }, [(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.menu, function (category) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["menuTab", { + 'active': category.id === _ctx.activeCategory + }]), + role: "menuitem", + key: category.id + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + class: "item", + tabindex: "5", + href: "", + onClick: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.loadCategory(category); + }, ["prevent"]) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])("menu-icon ".concat(category.icon ? category.icon : 'icon-arrow-right')) + }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(category.name) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", ReportingMenuvue_type_template_id_708190ea_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreHome_Menu')), 1)], 8, ReportingMenuvue_type_template_id_708190ea_hoisted_3), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", ReportingMenuvue_type_template_id_708190ea_hoisted_5, [(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"])(category.subcategories, function (subcategory) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + role: "menuitem", + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({ + 'active': subcategory.id === _ctx.activeSubcategory + }), + key: subcategory.id + }, [subcategory.isGroup ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_MenuDropdown, { + key: 0, + "show-search": true, + "menu-title": _ctx.htmlEntities(subcategory.name) + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [(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"])(subcategory.subcategories, function (subcat) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["item", { + active: subcat.id === _ctx.activeSubsubcategory + }]), + tabindex: "5", + href: "#?".concat(_ctx.makeUrl(category, subcat)), + onClick: function onClick($event) { + return _ctx.loadSubcategory(category, subcat, $event); + }, + title: subcat.tooltip, + key: subcat.id + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(subcat.name), 11, ReportingMenuvue_type_template_id_708190ea_hoisted_6); + }), 128))]; + }), + _: 2 + }, 1032, ["menu-title"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !subcategory.isGroup ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 1, + href: "#?".concat(_ctx.makeUrl(category, subcategory)), + class: "item", + onClick: function onClick($event) { + return _ctx.loadSubcategory(category, subcategory, $event); + } + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(subcategory.name), 9, ReportingMenuvue_type_template_id_708190ea_hoisted_7)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), subcategory.help ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 2, + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["item-help-icon", { + active: _ctx.helpShownCategory && _ctx.helpShownCategory.subcategory === subcategory.id && _ctx.helpShownCategory.category === category.id && subcategory.help + }]), + tabindex: "5", + href: "javascript:", + onClick: function onClick($event) { + return _ctx.showHelp(category, subcategory, $event); + } + }, ReportingMenuvue_type_template_id_708190ea_hoisted_10, 10, ReportingMenuvue_type_template_id_708190ea_hoisted_8)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2); + }), 128))])], 2); + }), 128))], 8, ReportingMenuvue_type_template_id_708190ea_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", ReportingMenuvue_type_template_id_708190ea_hoisted_11, [(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.menu, function (category) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + class: "no-padding", + key: category.id + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", ReportingMenuvue_type_template_id_708190ea_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", ReportingMenuvue_type_template_id_708190ea_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("i", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(category.icon ? category.icon : 'icon-arrow-bottom') + }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(category.name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ReportingMenuvue_type_template_id_708190ea_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [(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"])(category.subcategories, function (subcategory) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + key: subcategory.id + }, [subcategory.isGroup ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ReportingMenuvue_type_template_id_708190ea_hoisted_15, [(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"])(subcategory.subcategories, function (subcat) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + onClick: function onClick($event) { + return _ctx.loadSubcategory(category, subcat); + }, + href: "#?".concat(_ctx.makeUrl(category, subcat)), + key: subcat.id + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(subcat.name), 9, ReportingMenuvue_type_template_id_708190ea_hoisted_16); + }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !subcategory.isGroup ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ReportingMenuvue_type_template_id_708190ea_hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + onClick: function onClick($event) { + return _ctx.loadSubcategory(category, subcategory); + }, + href: "#?".concat(_ctx.makeUrl(category, subcategory)) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(subcategory.name), 9, ReportingMenuvue_type_template_id_708190ea_hoisted_18)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]); + }), 128))])])])], 512), [[_directive_side_nav, { + activator: _ctx.sideNavActivator + }]])]); + }), 128))])]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 - -// 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/Alert/Alert.vue?vue&type=script&lang=ts - -/* harmony default export */ var Alertvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - severity: { - type: String, - required: true - } - } -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue - +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.vue?vue&type=template&id=708190ea - -Alertvue_type_script_lang_ts.render = Alertvue_type_template_id_c3863ae2_render - -/* harmony default export */ var Alert = (Alertvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.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 Alert_adapter = (createAngularJsAdapter({ - component: Alert, - scope: { - severity: { - vue: 'severity', - angularJsBind: '@piwikAlert' - } - }, - directiveName: 'piwikAlert', - transclude: true -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/CookieHelper/CookieHelper.ts -/* - * General utils for managing cookies in Typescript. - */ -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -function setCookie(name, val, seconds) { - var date = new Date(); // set default day to 3 days - - if (!seconds) { - // eslint-disable-next-line no-param-reassign - seconds = 3 * 24 * 60 * 1000; - } // Set it expire in n days - - - date.setTime(date.getTime() + seconds); // Set it - - document.cookie = "".concat(name, "=").concat(val, "; expires=").concat(date.toUTCString(), "; path=/"); -} // eslint-disable-next-line consistent-return,@typescript-eslint/explicit-module-boundary-types - -function getCookie(name) { - var value = "; ".concat(document.cookie); - var parts = value.split("; ".concat(name, "=")); // if cookie not exist return null - // eslint-disable-next-line eqeqeq - - if (parts.length == 2) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - var data = parts.pop().split(';').shift(); - - if (typeof data !== 'undefined') { - return data; - } - } - - return null; -} // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types - -function deleteCookie(name) { - var date = new Date(); // Set it expire in -1 days - - date.setTime(date.getTime() + -1 * 24 * 60 * 60 * 1000); // Set it - - 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 = { @@ -7798,7 +7705,7 @@ var Notifications_store_NotificationsStore = /*#__PURE__*/function () { Notifications_store_createClass(NotificationsStore, [{ key: "state", get: function get() { - return this.privateState; + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.privateState); } }, { key: "appendNotification", @@ -7873,7 +7780,7 @@ var Notifications_store_NotificationsStore = /*#__PURE__*/function () { key: "show", value: function show(notification) { this.checkMessage(notification.message); - var addMethod = this.appendNotification; + var addMethod = notification.prepend ? this.prependNotification : this.appendNotification; var notificationPosition = '#notificationContainer'; if (notification.placeat) { @@ -8096,6 +8003,877 @@ NotificationGroupvue_type_script_lang_ts.render = NotificationGroupvue_type_temp +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts +function ReportingPages_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function ReportingPages_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 ReportingPages_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) ReportingPages_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) ReportingPages_store_defineProperties(Constructor, staticProps); return Constructor; } + +function ReportingPages_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 ReportingPages_store_ReportingPagesStore = /*#__PURE__*/function () { + function ReportingPagesStore() { + var _this = this; + + ReportingPages_store_classCallCheck(this, ReportingPagesStore); + + ReportingPages_store_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ + pages: [] + })); + + ReportingPages_store_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.privateState)); + + ReportingPages_store_defineProperty(this, "fetchAllPagesPromise", void 0); + + ReportingPages_store_defineProperty(this, "pages", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.state.pages; + })); + } + + ReportingPages_store_createClass(ReportingPagesStore, [{ + key: "findPageInCategory", + value: function findPageInCategory(categoryId) { + // happens when user switches between sites, in this case check if the same category exists and + // if so, select first entry from that category + return this.pages.value.find(function (p) { + return p && p.category && p.category.id === categoryId && p.subcategory && p.subcategory.id; + }); + } + }, { + key: "findPage", + value: function findPage(categoryId, subcategoryId) { + return this.pages.value.find(function (p) { + return p && p.category && p.subcategory && p.category.id === categoryId && "".concat(p.subcategory.id) === subcategoryId; + }); + } + }, { + key: "reloadAllPages", + value: function reloadAllPages() { + var _this2 = this; + + // use a setTimeout this method can happen when changing the page, and page changes + // will abort in progress AJAX requests, even this one if it is in progress. + return new Promise(function (resolve) { + return setTimeout(resolve); + }).then(function () { + _this2.fetchAllPagesPromise = null; + return _this2.getAllPages(); + }); + } + }, { + key: "getAllPages", + value: function getAllPages() { + var _this3 = this; + + if (!this.fetchAllPagesPromise) { + this.fetchAllPagesPromise = AjaxHelper_AjaxHelper.fetch({ + method: 'API.getReportPagesMetadata', + filter_limit: '-1' + }).then(function (response) { + _this3.privateState.pages = response; + }); + } + + return this.fetchAllPagesPromise.then(function () { + return _this3.pages.value; + }); + } + }]); + + return ReportingPagesStore; +}(); +/* harmony default export */ var ReportingPages_store = (new ReportingPages_store_ReportingPagesStore()); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.ts +function ReportingMenu_store_toConsumableArray(arr) { return ReportingMenu_store_arrayWithoutHoles(arr) || ReportingMenu_store_iterableToArray(arr) || ReportingMenu_store_unsupportedIterableToArray(arr) || ReportingMenu_store_nonIterableSpread(); } + +function ReportingMenu_store_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function ReportingMenu_store_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ReportingMenu_store_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ReportingMenu_store_arrayLikeToArray(o, minLen); } + +function ReportingMenu_store_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function ReportingMenu_store_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return ReportingMenu_store_arrayLikeToArray(arr); } + +function ReportingMenu_store_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ReportingMenu_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 ReportingMenu_store_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ReportingMenu_store_ownKeys(Object(source), true).forEach(function (key) { ReportingMenu_store_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ReportingMenu_store_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function ReportingMenu_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function ReportingMenu_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 ReportingMenu_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) ReportingMenu_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) ReportingMenu_store_defineProperties(Constructor, staticProps); return Constructor; } + +function ReportingMenu_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 + */ + + + + + +function isNumeric(text) { + var n = parseFloat(text); + return !Number.isNaN(n) && Number.isFinite(n); +} + +var ReportingMenu_store_ReportingMenuStore = /*#__PURE__*/function () { + function ReportingMenuStore() { + var _this = this; + + ReportingMenu_store_classCallCheck(this, ReportingMenuStore); + + ReportingMenu_store_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ + activeCategoryId: null, + activeSubcategoryId: null, + activeSubsubcategoryId: null + })); + + ReportingMenu_store_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState); + })); + + ReportingMenu_store_defineProperty(this, "activeCategory", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.state.value.activeCategoryId || src_MatomoUrl_MatomoUrl.parsed.value.category; + })); + + ReportingMenu_store_defineProperty(this, "activeSubcategory", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.state.value.activeSubcategoryId || src_MatomoUrl_MatomoUrl.parsed.value.subcategory; + })); + + ReportingMenu_store_defineProperty(this, "activeSubsubcategory", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.state.value.activeSubsubcategoryId; + })); + + ReportingMenu_store_defineProperty(this, "menu", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.buildMenuFromPages(); + })); + } + + ReportingMenu_store_createClass(ReportingMenuStore, [{ + key: "fetchMenuItems", + value: function fetchMenuItems() { + var _this2 = this; + + return ReportingPages_store.getAllPages().then(function () { + return _this2.menu.value; + }); + } + }, { + key: "reloadMenuItems", + value: function reloadMenuItems() { + var _this3 = this; + + return ReportingPages_store.reloadAllPages().then(function () { + return _this3.menu.value; + }); + } + }, { + key: "findSubcategory", + value: function findSubcategory(categoryId, subcategoryId) { + var foundCategory = null; + var foundSubcategory = null; + var foundSubSubcategory = null; + this.menu.value.forEach(function (category) { + if (category.id !== categoryId) { + return; + } + + (category.subcategories || []).forEach(function (subcategory) { + if (subcategory.id === subcategoryId) { + foundCategory = category; + foundSubcategory = subcategory; + } + + if (subcategory.isGroup) { + (subcategory.subcategories || []).forEach(function (subcat) { + if (subcat.id === subcategoryId) { + foundCategory = category; + foundSubcategory = subcategory; + foundSubSubcategory = subcat; + } + }); + } + }); + }); + return { + category: foundCategory, + subcategory: foundSubcategory, + subsubcategory: foundSubSubcategory + }; + } + }, { + key: "buildMenuFromPages", + value: function buildMenuFromPages() { + var _this4 = this; + + var menu = []; + var activeCategory = this.activeCategory.value; + var activeSubcategory = this.activeSubcategory.value; + var pages = ReportingPages_store.pages.value; + var categoriesHandled = {}; + pages.forEach(function (page) { + var category = ReportingMenu_store_objectSpread({}, page.category); + + var categoryId = category.id; + var isCategoryActive = categoryId === activeCategory; + + if (categoriesHandled[categoryId]) { + return; + } + + categoriesHandled[categoryId] = true; + category.subcategories = []; + var categoryGroups; + var pagesWithCategory = pages.filter(function (p) { + return p.category.id === categoryId; + }); + pagesWithCategory.forEach(function (p) { + var subcategory = ReportingMenu_store_objectSpread({}, p.subcategory); + + var isSubcategoryActive = subcategory.id === activeSubcategory && isCategoryActive; + + if (p.widgets && p.widgets[0] && isNumeric(p.subcategory.id)) { + // we handle a goal or something like it + if (!categoryGroups) { + categoryGroups = ReportingMenu_store_objectSpread({}, subcategory); + categoryGroups.name = translate('CoreHome_ChooseX', [category.name]); + categoryGroups.isGroup = true; + categoryGroups.subcategories = []; + categoryGroups.order = 10; + } + + if (isSubcategoryActive) { + categoryGroups.name = subcategory.name; + } + + var entityId = page.subcategory.id; + subcategory.tooltip = "".concat(subcategory.name, " (id = ").concat(entityId, ")"); + categoryGroups.subcategories.push(subcategory); + return; + } + + category.subcategories.push(subcategory); + }); + + if (categoryGroups && categoryGroups.subcategories && categoryGroups.subcategories.length <= 5) { + categoryGroups.subcategories.forEach(function (sub) { + return category.subcategories.push(sub); + }); + } else if (categoryGroups) { + category.subcategories.push(categoryGroups); + } + + category.subcategories = _this4.sortMenuItems(category.subcategories); + menu.push(category); + }); + return this.sortMenuItems(menu); + } + }, { + key: "sortMenuItems", + value: function sortMenuItems(menu) { + var result = ReportingMenu_store_toConsumableArray(menu); + + result.sort(function (lhs, rhs) { + if (lhs.order < rhs.order) { + return -1; + } + + if (lhs.order > rhs.order) { + return 1; + } + + return 0; + }); + return result; + } + }, { + key: "toggleCategory", + value: function toggleCategory(category) { + this.privateState.activeSubcategoryId = null; + this.privateState.activeSubsubcategoryId = null; + + if (this.privateState.activeCategoryId === category.id) { + this.privateState.activeCategoryId = null; + return false; + } + + this.privateState.activeCategoryId = category.id; + return true; + } + }, { + key: "enterSubcategory", + value: function enterSubcategory(category, subcategory, subsubcategory) { + if (!category || !subcategory) { + return; + } + + this.privateState.activeCategoryId = category.id; + this.privateState.activeSubcategoryId = subcategory.id; + + if (subsubcategory) { + this.privateState.activeSubsubcategoryId = subsubcategory.id; + } + } + }]); + + return ReportingMenuStore; +}(); +/* harmony default export */ var ReportingMenu_store = (new ReportingMenu_store_ReportingMenuStore()); +// 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/ReportingMenu/ReportingMenu.vue?vue&type=script&lang=ts +function ReportingMenuvue_type_script_lang_ts_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 ReportingMenuvue_type_script_lang_ts_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ReportingMenuvue_type_script_lang_ts_ownKeys(Object(source), true).forEach(function (key) { ReportingMenuvue_type_script_lang_ts_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ReportingMenuvue_type_script_lang_ts_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function ReportingMenuvue_type_script_lang_ts_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; } + +function ReportingMenuvue_type_script_lang_ts_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ReportingMenuvue_type_script_lang_ts_typeof = function _typeof(obj) { return typeof obj; }; } else { ReportingMenuvue_type_script_lang_ts_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ReportingMenuvue_type_script_lang_ts_typeof(obj); } + + + + + + + + + +var REPORTING_HELP_NOTIFICATION_ID = 'reportingmenu-help'; +/* harmony default export */ var ReportingMenuvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + components: { + MenuDropdown: MenuDropdown + }, + directives: { + SideNav: SideNav + }, + props: {}, + data: function data() { + return { + showSubcategoryHelpOnLoad: null, + initialLoad: true, + helpShownCategory: null + }; + }, + computed: { + sideNavActivator: function sideNavActivator() { + return document.querySelector('nav .activateLeftMenu'); + }, + menu: function menu() { + return ReportingMenu_store.menu.value; + }, + activeCategory: function activeCategory() { + return ReportingMenu_store.activeCategory.value; + }, + activeSubcategory: function activeSubcategory() { + return ReportingMenu_store.activeSubcategory.value; + }, + activeSubsubcategory: function activeSubsubcategory() { + return ReportingMenu_store.activeSubsubcategory.value; + } + }, + created: function created() { + var _this = this; + + ReportingMenu_store.fetchMenuItems().then(function (menu) { + if (!src_MatomoUrl_MatomoUrl.parsed.value.subcategory) { + var categoryToLoad = menu[0]; + var subcategoryToLoad = categoryToLoad.subcategories[0]; // load first, initial page if no subcategory is present + + ReportingMenu_store.enterSubcategory(categoryToLoad, subcategoryToLoad); + + _this.propagateUrlChange(categoryToLoad, subcategoryToLoad); + } + }); + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () { + return src_MatomoUrl_MatomoUrl.parsed.value; + }, function (query) { + var found = ReportingMenu_store.findSubcategory(query.category, query.subcategory); + ReportingMenu_store.enterSubcategory(found.category, found.subcategory, found.subsubcategory); + }); + Matomo_Matomo.on('piwikPageChange', function () { + if (!_this.initialLoad) { + window.globalAjaxQueue.abort(); + } + + _this.helpShownCategory = null; + + if (_this.showSubcategoryHelpOnLoad) { + _this.showHelp(_this.showSubcategoryHelpOnLoad.category, _this.showSubcategoryHelpOnLoad.subcategory); + + _this.showSubcategoryHelpOnLoad = null; + } + + window.$('#loadingError').hide(); + _this.initialLoad = false; + }); + Matomo_Matomo.on('updateReportingMenu', function () { + ReportingMenu_store.reloadMenuItems().then(function () { + var _MatomoUrl$parsed$val = src_MatomoUrl_MatomoUrl.parsed.value, + category = _MatomoUrl$parsed$val.category, + subcategory = _MatomoUrl$parsed$val.subcategory; // we need to make sure to select same categories again + + if (category && subcategory) { + var found = ReportingMenu_store.findSubcategory(category, subcategory); + + if (found) { + ReportingMenu_store.enterSubcategory(found.category, found.subcategory, found.subsubcategory); + } + } + }); + + if (ReportingMenuvue_type_script_lang_ts_typeof(window.widgetsHelper) === 'object' && window.widgetsHelper.availableWidgets) { + // lets also update widgetslist so will be easier to update list of available widgets in + // dashboard selector immediately + delete window.widgetsHelper.availableWidgets; + window.widgetsHelper.getAvailableWidgets(); + } + }); + }, + methods: { + propagateUrlChange: function propagateUrlChange(category, subcategory) { + var queryParams = src_MatomoUrl_MatomoUrl.parsed.value; + + if (queryParams.category === category.id && queryParams.subcategory === subcategory.id) { + // we need to manually trigger change as URL would not change and therefore page would not + // be reloaded + this.loadSubcategory(category, subcategory); + } else { + src_MatomoUrl_MatomoUrl.updateHash(ReportingMenuvue_type_script_lang_ts_objectSpread(ReportingMenuvue_type_script_lang_ts_objectSpread({}, src_MatomoUrl_MatomoUrl.hashParsed.value), {}, { + category: category.id, + subcategory: subcategory.id + })); + } + }, + loadCategory: function loadCategory(category) { + Notifications_store.remove(REPORTING_HELP_NOTIFICATION_ID); + var isActive = ReportingMenu_store.toggleCategory(category); + + if (isActive && category.subcategories && category.subcategories.length === 1) { + this.helpShownCategory = null; + var subcategory = category.subcategories[0]; + this.propagateUrlChange(category, subcategory); + } + }, + loadSubcategory: function loadSubcategory(category, subcategory, event) { + if (event.shiftKey || event.ctrlKey || event.metaKey) { + return; + } + + Notifications_store.remove(REPORTING_HELP_NOTIFICATION_ID); + + if (subcategory && subcategory.id === this.activeSubcategory) { + this.helpShownCategory = null; // this menu item is already active, a location change success would not be triggered, + // instead trigger an event + + Matomo_Matomo.postEvent('loadPage', category.id, subcategory.id); + } + }, + makeUrl: function makeUrl(category, subcategory) { + var _MatomoUrl$parsed$val2 = src_MatomoUrl_MatomoUrl.parsed.value, + idSite = _MatomoUrl$parsed$val2.idSite, + period = _MatomoUrl$parsed$val2.period, + date = _MatomoUrl$parsed$val2.date, + segment = _MatomoUrl$parsed$val2.segment, + comparePeriods = _MatomoUrl$parsed$val2.comparePeriods, + compareDates = _MatomoUrl$parsed$val2.compareDates, + compareSegments = _MatomoUrl$parsed$val2.compareSegments; + return src_MatomoUrl_MatomoUrl.stringify({ + idSite: idSite, + period: period, + date: date, + segment: segment, + comparePeriods: comparePeriods, + compareDates: compareDates, + compareSegments: compareSegments, + category: category.id, + subcategory: subcategory.id + }); + }, + htmlEntities: function htmlEntities(v) { + return Matomo_Matomo.helper.htmlEntities(v); + }, + showHelp: function showHelp(category, subcategory, event) { + var parsedUrl = src_MatomoUrl_MatomoUrl.parsed.value; + var currentCategory = parsedUrl.category; + var currentSubcategory = parsedUrl.subcategory; + + if ((currentCategory !== category.id || currentSubcategory !== subcategory.id) && event) { + this.showSubcategoryHelpOnLoad = { + category: category, + subcategory: subcategory + }; + src_MatomoUrl_MatomoUrl.updateHash(ReportingMenuvue_type_script_lang_ts_objectSpread(ReportingMenuvue_type_script_lang_ts_objectSpread({}, src_MatomoUrl_MatomoUrl.hashParsed.value), {}, { + category: category.id, + subcategory: subcategory.id + })); + return; + } + + if (this.helpShownCategory && category.id === this.helpShownCategory.category && subcategory.id === this.helpShownCategory.subcategory) { + Notifications_store.remove(REPORTING_HELP_NOTIFICATION_ID); + this.helpShownCategory = null; + return; + } + + var prefixText = translate('CoreHome_ReportingCategoryHelpPrefix', category.name, subcategory.name); + var prefix = "<strong>".concat(prefixText, "</strong><br/>"); + Notifications_store.show({ + context: 'info', + id: REPORTING_HELP_NOTIFICATION_ID, + type: 'help', + noclear: true, + class: 'help-notification', + message: prefix + subcategory.help, + placeat: '#notificationContainer', + prepend: true + }); + this.helpShownCategory = { + category: category.id, + subcategory: subcategory.id + }; + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.vue + + + +ReportingMenuvue_type_script_lang_ts.render = ReportingMenuvue_type_template_id_708190ea_render + +/* harmony default export */ var ReportingMenu = (ReportingMenuvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.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 ReportingMenu_adapter = (createAngularJsAdapter({ + component: ReportingMenu, + directiveName: 'piwikReportingMenu' +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.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 + */ + + // removed boolean active property from objects in vue so we can keep the store immutable, but, +// angularjs version should still have them + +function addActiveMenuItems(menu) { + menu.forEach(function (category) { + if (category.id === ReportingMenu_store.activeCategory.value) { + category.active = true; + (category.subcategories || []).forEach(function (subcat) { + if (subcat.id === ReportingMenu_store.activeSubcategory.value) { + subcat.active = true; + (subcat.subcategories || []).forEach(function (subsubcat) { + if (subsubcat.id === ReportingMenu_store.activeSubsubcategory.value) { + subsubcat.active = true; + } + }); + } + }); + } + }); + return menu; +} + +function reportingMenuModelAdapter() { + return { + get menu() { + return ReportingMenu_store.menu.value; + }, + + findSubcategory: ReportingMenu_store.findSubcategory.bind(ReportingMenu_store), + reloadMenuItems: function reloadMenuItems() { + return ReportingMenu_store.reloadMenuItems().then(function (p) { + return addActiveMenuItems(cloneThenApply(p)); + }); + }, + fetchMenuItems: function fetchMenuItems() { + return ReportingMenu_store.fetchMenuItems().then(function (p) { + return addActiveMenuItems(cloneThenApply(p)); + }); + } + }; +} + +angular.module('piwikApp.service').factory('reportingMenuModel', reportingMenuModelAdapter); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPages/ReportingPages.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 + */ + + + +function reportingPagesModelAdapter() { + return { + get pages() { + return ReportingPages_store.pages.value; + }, + + findPageInCategory: function findPageInCategory() { + return clone(ReportingPages_store.findPageInCategory.apply(ReportingPages_store, arguments)); + }, + findPage: function findPage() { + return clone(ReportingPages_store.findPage.apply(ReportingPages_store, arguments)); + }, + reloadAllPages: function reloadAllPages() { + return ReportingPages_store.reloadAllPages().then(function (p) { + return cloneThenApply(p); + }); + }, + getAllPages: function getAllPages() { + return ReportingPages_store.getAllPages().then(function (p) { + return cloneThenApply(p); + }); + } + }; +} + +angular.module('piwikApp.service').factory('reportingPagesModel', reportingPagesModelAdapter); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportMetadata/ReportMetadata.store.ts +function ReportMetadata_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function ReportMetadata_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 ReportMetadata_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) ReportMetadata_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) ReportMetadata_store_defineProperties(Constructor, staticProps); return Constructor; } + +function ReportMetadata_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 ReportMetadata_store_ReportMetadataStore = /*#__PURE__*/function () { + function ReportMetadataStore() { + var _this = this; + + ReportMetadata_store_classCallCheck(this, ReportMetadataStore); + + ReportMetadata_store_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ + reports: [] + })); + + ReportMetadata_store_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.privateState)); + + ReportMetadata_store_defineProperty(this, "reports", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.state.reports; + })); + + ReportMetadata_store_defineProperty(this, "reportsPromise", void 0); + } + + ReportMetadata_store_createClass(ReportMetadataStore, [{ + key: "findReport", + value: // TODO: it used to return an empty array when nothing was found, will that be an issue? + function findReport(reportModule, reportAction) { + return this.reports.value.find(function (r) { + return r.module === reportModule && r.action === reportAction; + }); + } + }, { + key: "fetchReportMetadata", + value: function fetchReportMetadata() { + var _this2 = this; + + if (!this.reportsPromise) { + this.reportsPromise = AjaxHelper_AjaxHelper.fetch({ + method: 'API.getReportMetadata', + filter_limit: '-1', + idSite: Matomo_Matomo.idSite || src_MatomoUrl_MatomoUrl.parsed.value.idSite + }).then(function (response) { + _this2.privateState.reports = response; + return response; + }); + } + + return this.reportsPromise.then(function () { + return _this2.reports.value; + }); + } + }]); + + return ReportMetadataStore; +}(); +/* harmony default export */ var ReportMetadata_store = (new ReportMetadata_store_ReportMetadataStore()); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportMetadata/ReportMetadata.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.service').factory('reportMetadataModel', function () { + return { + get reports() { + return ReportMetadata_store.reports.value; + }, + + findReport: ReportMetadata_store.findReport.bind(ReportMetadata_store), + fetchReportMetadata: function fetchReportMetadata() { + return ReportMetadata_store.fetchReportMetadata().then(function (m) { + return cloneThenApply(m); + }); + } + }; +}); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.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 ActivityIndicator_adapter = (createAngularJsAdapter({ + component: ActivityIndicator, + scope: { + loading: { + vue: 'loading', + angularJsBind: '<' + }, + loadingMessage: { + vue: 'loadingMessage', + angularJsBind: '<', + default: function _default() { + return translate('General_LoadingData'); + } + } + }, + $inject: [], + directiveName: 'piwikActivityIndicator' +})); +// 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/Alert/Alert.vue?vue&type=template&id=c3863ae2 +function Alertvue_type_template_id_c3863ae2_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; } + + +function Alertvue_type_template_id_c3863ae2_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_["createElementBlock"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["alert", Alertvue_type_template_id_c3863ae2_defineProperty({}, "alert-".concat(_ctx.severity), true)]) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 2); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 + +// 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/Alert/Alert.vue?vue&type=script&lang=ts + +/* harmony default export */ var Alertvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + severity: { + type: String, + required: true + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue + + + +Alertvue_type_script_lang_ts.render = Alertvue_type_template_id_c3863ae2_render + +/* harmony default export */ var Alert = (Alertvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.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 Alert_adapter = (createAngularJsAdapter({ + component: Alert, + scope: { + severity: { + vue: 'severity', + angularJsBind: '@piwikAlert' + } + }, + directiveName: 'piwikAlert', + transclude: true +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/CookieHelper/CookieHelper.ts +/* + * General utils for managing cookies in Typescript. + */ +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function setCookie(name, val, seconds) { + var date = new Date(); // set default day to 3 days + + if (!seconds) { + // eslint-disable-next-line no-param-reassign + seconds = 3 * 24 * 60 * 1000; + } // Set it expire in n days + + + date.setTime(date.getTime() + seconds); // Set it + + document.cookie = "".concat(name, "=").concat(val, "; expires=").concat(date.toUTCString(), "; path=/"); +} // eslint-disable-next-line consistent-return,@typescript-eslint/explicit-module-boundary-types + +function getCookie(name) { + var value = "; ".concat(document.cookie); + var parts = value.split("; ".concat(name, "=")); // if cookie not exist return null + // eslint-disable-next-line eqeqeq + + if (parts.length == 2) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + var data = parts.pop().split(';').shift(); + + if (typeof data !== 'undefined') { + return data; + } + } + + return null; +} // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + +function deleteCookie(name) { + var date = new Date(); // Set it expire in -1 days + + date.setTime(date.getTime() + -1 * 24 * 60 * 60 * 1000); // Set it + + document.cookie = "".concat(name, "=; expires=").concat(date.toUTCString(), "; path=/"); +} // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/index.ts /*! * Matomo - free/libre analytics platform @@ -8166,6 +8944,11 @@ NotificationGroupvue_type_script_lang_ts.render = NotificationGroupvue_type_temp + + + + + // 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 c3a637e76b..d89882629b 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -4,7 +4,7 @@ * * @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,"DirectiveUtilities",(function(){return ze})),n.d(t,"debounce",(function(){return Xr})),n.d(t,"createAngularJsAdapter",(function(){return St})),n.d(t,"transformAngularJsBoolAttr",(function(){return Dt})),n.d(t,"transformAngularJsIntAttr",(function(){return Ct})),n.d(t,"removeAngularJsSpecificProperties",(function(){return kt})),n.d(t,"activityIndicatorAdapter",(function(){return lo})),n.d(t,"ActivityIndicator",(function(){return Ia})),n.d(t,"translate",(function(){return D})),n.d(t,"alertAdapter",(function(){return mo})),n.d(t,"AjaxHelper",(function(){return xe})),n.d(t,"setCookie",(function(){return ho})),n.d(t,"getCookie",(function(){return go})),n.d(t,"deleteCookie",(function(){return vo})),n.d(t,"MatomoUrl",(function(){return we})),n.d(t,"Matomo",(function(){return S})),n.d(t,"Periods",(function(){return p})),n.d(t,"Day",(function(){return z})),n.d(t,"Week",(function(){return Z})),n.d(t,"Month",(function(){return re})),n.d(t,"Year",(function(){return le})),n.d(t,"Range",(function(){return F})),n.d(t,"format",(function(){return C})),n.d(t,"getToday",(function(){return P})),n.d(t,"parseDate",(function(){return E})),n.d(t,"todayIsInRange",(function(){return V})),n.d(t,"Dropdown",(function(){return Ae})),n.d(t,"FocusAnywhereButHere",(function(){return Fe})),n.d(t,"FocusIf",(function(){return qe})),n.d(t,"MatomoDialog",(function(){return pt})),n.d(t,"ExpandOnClick",(function(){return et})),n.d(t,"ExpandOnHover",(function(){return ct})),n.d(t,"EnrichedHeadline",(function(){return Gt})),n.d(t,"ContentBlock",(function(){return tn})),n.d(t,"Comparisons",(function(){return Fn})),n.d(t,"MenuDropdown",(function(){return nr})),n.d(t,"DatePicker",(function(){return pr})),n.d(t,"DateRangePicker",(function(){return br})),n.d(t,"PeriodDatePicker",(function(){return kr})),n.d(t,"Notification",(function(){return Eo})),n.d(t,"NotificationGroup",(function(){return _o})),n.d(t,"NotificationsStore",(function(){return $o})),n.d(t,"SiteSelector",(function(){return ii})),n.d(t,"QuickAccess",(function(){return Ci})),n.d(t,"FieldArray",(function(){return Hi})),n.d(t,"MultiPairField",(function(){return aa})),n.d(t,"PeriodSelector",(function(){return Ya})),n.d(t,"ReportingPagesStore",(function(){return eo})),n.d(t,"ReportMetadataStore",(function(){return co})),"undefined"!==typeof window){var r=window.document.currentScript,i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}n("2342");var a=n("8bbf");function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */window.hasBlockedContent=!1},"8bbf":function(t,n){t.exports=e},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"DirectiveUtilities",(function(){return ze})),n.d(t,"debounce",(function(){return ni})),n.d(t,"createAngularJsAdapter",(function(){return Pt})),n.d(t,"transformAngularJsBoolAttr",(function(){return Et})),n.d(t,"transformAngularJsIntAttr",(function(){return Vt})),n.d(t,"removeAngularJsSpecificProperties",(function(){return Dt})),n.d(t,"activityIndicatorAdapter",(function(){return kc})),n.d(t,"ActivityIndicator",(function(){return Ia})),n.d(t,"translate",(function(){return C})),n.d(t,"alertAdapter",(function(){return Ec})),n.d(t,"AjaxHelper",(function(){return Ne})),n.d(t,"setCookie",(function(){return Vc})),n.d(t,"getCookie",(function(){return Tc})),n.d(t,"deleteCookie",(function(){return Ic})),n.d(t,"MatomoUrl",(function(){return we})),n.d(t,"Matomo",(function(){return S})),n.d(t,"Periods",(function(){return p})),n.d(t,"Day",(function(){return z})),n.d(t,"Week",(function(){return X})),n.d(t,"Month",(function(){return re})),n.d(t,"Year",(function(){return le})),n.d(t,"Range",(function(){return F})),n.d(t,"format",(function(){return D})),n.d(t,"getToday",(function(){return P})),n.d(t,"parseDate",(function(){return E})),n.d(t,"todayIsInRange",(function(){return V})),n.d(t,"Dropdown",(function(){return Ae})),n.d(t,"FocusAnywhereButHere",(function(){return Fe})),n.d(t,"FocusIf",(function(){return qe})),n.d(t,"MatomoDialog",(function(){return ht})),n.d(t,"ExpandOnClick",(function(){return et})),n.d(t,"ExpandOnHover",(function(){return ct})),n.d(t,"SideNav",(function(){return ut})),n.d(t,"EnrichedHeadline",(function(){return Qt})),n.d(t,"ContentBlock",(function(){return an})),n.d(t,"Comparisons",(function(){return qn})),n.d(t,"MenuDropdown",(function(){return ar})),n.d(t,"DatePicker",(function(){return hr})),n.d(t,"DateRangePicker",(function(){return wr})),n.d(t,"PeriodDatePicker",(function(){return Dr})),n.d(t,"Notification",(function(){return Co})),n.d(t,"NotificationGroup",(function(){return Ho})),n.d(t,"NotificationsStore",(function(){return Ao})),n.d(t,"SiteSelector",(function(){return ci})),n.d(t,"QuickAccess",(function(){return Di})),n.d(t,"FieldArray",(function(){return Ri})),n.d(t,"MultiPairField",(function(){return aa})),n.d(t,"PeriodSelector",(function(){return Ya})),n.d(t,"ReportingMenu",(function(){return fc})),n.d(t,"ReportingPagesStore",(function(){return Jo})),n.d(t,"ReportMetadataStore",(function(){return jc})),"undefined"!==typeof window){var r=window.document.currentScript,i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}n("2342");var a=n("8bbf");function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * @@ -23,19 +23,19 @@ * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function D(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n;return 1===n.length&&n[0]&&Array.isArray(n[0])&&(i=n[0]),window._pk_translate(e,i)} +function C(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n;return 1===n.length&&n[0]&&Array.isArray(n[0])&&(i=n[0]),window._pk_translate(e,i)} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function C(e){return $.datepicker.formatDate("yy-mm-dd",e)}function P(){var e=new Date(Date.now());return e.setTime(e.getTime()+60*e.getTimezoneOffset()*1e3),e.setHours(e.getHours()+(window.piwik.timezoneOffset||0)/3600),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function E(e){if(e instanceof Date)return e;var t=decodeURIComponent(e).trim();if(""===t)throw new Error("Invalid date, empty string.");if("today"===t||"now"===t)return P();if("yesterday"===t||"yesterdaySameTime"===t){var n=P();return n.setDate(n.getDate()-1),n}if(t.match(/last[ -]?week/i)){var r=P();return r.setDate(r.getDate()-7),r}if(t.match(/last[ -]?month/i)){var i=P();return i.setDate(1),i.setMonth(i.getMonth()-1),i}if(t.match(/last[ -]?year/i)){var a=P();return a.setFullYear(a.getFullYear()-1),a}return $.datepicker.parseDate("yy-mm-dd",t)}function V(e){return 2===e.length&&(P()>=e[0]&&P()<=e[1])}function T(e,t){return B(e)||A(e,t)||x(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 x(e,t){if(e){if("string"===typeof e)return N(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)?N(e,t):void 0}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,c=!1;try{for(n=n.call(e);!(o=(r=n.next()).done);o=!0)if(a.push(r.value),t&&a.length===t)break}catch(l){c=!0,i=l}finally{try{o||null==n["return"]||n["return"]()}finally{if(c)throw i}}return a}}function B(e){if(Array.isArray(e))return e}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t,n){return t&&L(e.prototype,t),n&&L(e,n),e}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */function D(e){return $.datepicker.formatDate("yy-mm-dd",e)}function P(){var e=new Date(Date.now());return e.setTime(e.getTime()+60*e.getTimezoneOffset()*1e3),e.setHours(e.getHours()+(window.piwik.timezoneOffset||0)/3600),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function E(e){if(e instanceof Date)return e;var t=decodeURIComponent(e).trim();if(""===t)throw new Error("Invalid date, empty string.");if("today"===t||"now"===t)return P();if("yesterday"===t||"yesterdaySameTime"===t){var n=P();return n.setDate(n.getDate()-1),n}if(t.match(/last[ -]?week/i)){var r=P();return r.setDate(r.getDate()-7),r}if(t.match(/last[ -]?month/i)){var i=P();return i.setDate(1),i.setMonth(i.getMonth()-1),i}if(t.match(/last[ -]?year/i)){var a=P();return a.setFullYear(a.getFullYear()-1),a}return $.datepicker.parseDate("yy-mm-dd",t)}function V(e){return 2===e.length&&(P()>=e[0]&&P()<=e[1])}function T(e,t){return B(e)||A(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 x(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)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,c=!1;try{for(n=n.call(e);!(o=(r=n.next()).done);o=!0)if(a.push(r.value),t&&a.length===t)break}catch(l){c=!0,i=l}finally{try{o||null==n["return"]||n["return"]()}finally{if(c)throw i}}return a}}function B(e){if(Array.isArray(e))return e}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function H(e,t,n){return t&&L(e.prototype,t),n&&L(e,n),e}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 F=function(){function e(t,n,r){M(this,e),H(this,"startDate",void 0),H(this,"endDate",void 0),H(this,"childPeriodType",void 0),this.startDate=t,this.endDate=n,this.childPeriodType=r}return R(e,[{key:"getPrettyString",value:function(){var e=C(this.startDate),t=C(this.endDate);return D("General_DateRangeFromTo",[e,t])}},{key:"getDateRange",value:function(){return[this.startDate,this.endDate]}},{key:"containsToday",value:function(){return V(this.getDateRange())}},{key:"getDayCount",value:function(){return Math.ceil((this.endDate.getTime()-this.startDate.getTime())/864e5)+1}}],[{key:"getLastNRange",value:function(t,n,r){var i=Math.max(parseInt(n.toString(),10)-1,0);if(Number.isNaN(i))throw new Error("Invalid range strAmount");var a=r?E(r):P(),o=new Date(a.getTime());if("day"===t)o.setDate(o.getDate()-i);else if("week"===t)o.setDate(o.getDate()-7*i);else if("month"===t)o.setDate(1),o.setMonth(o.getMonth()-i);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));o.setFullYear(o.getFullYear()-i)}if("day"!==t){var c=p.periods[t].parse(o),l=p.periods[t].parse(a),s=c.getDateRange(),u=T(s,1);o=u[0];var d=l.getDateRange(),f=T(d,2);a=f[1]}var m=new Date(1991,7,6);if(o.getTime()-m.getTime()<0)switch(t){case"year":o=new Date(1992,0,1);break;case"month":o=new Date(1991,8,1);break;case"week":o=new Date(1991,8,12);break;case"day":default:o=m;break}return new e(o,a,t)}},{key:"getLastNRangeChild",value:function(t,n,r){var i=n?E(n):P(),a=new Date(i.getTime()),o=new Date(i.getTime());if("day"===t)a.setDate(a.getDate()-r),o.setDate(o.getDate()-r);else if("week"===t)a.setDate(a.getDate()-7*r),o.setDate(o.getDate()-7*r);else if("month"===t)a.setDate(1),a.setMonth(a.getMonth()-r),o.setDate(1),o.setMonth(o.getMonth()-r);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));a.setFullYear(a.getFullYear()-r),o.setFullYear(o.getFullYear()-r)}if("day"!==t){var c=p.periods[t].parse(a),l=p.periods[t].parse(o),s=c.getDateRange(),u=T(s,1);a=u[0];var d=l.getDateRange(),f=T(d,2);o=f[1]}var m=new Date(1991,7,6);if(a.getTime()-m.getTime()<0)switch(t){case"year":a=new Date(1992,0,1);break;case"month":a=new Date(1991,8,1);break;case"week":a=new Date(1991,8,12);break;case"day":default:a=m;break}return new e(a,o,t)}},{key:"parse",value:function(t){var n=arguments.length>1&&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 i=decodeURIComponent(t).split(",");return new e(E(i[0]),E(i[1]),n)}},{key:"getDisplayText",value:function(){return D("General_DateRangeInPeriodList")}}]),e}();function _(){return{getAllLabels:p.getAllLabels.bind(p),isRecognizedPeriod:p.isRecognizedPeriod.bind(p),get:p.get.bind(p),parse:p.parse.bind(p),parseDate:E,format:C,RangePeriod:F,todayIsInRange:V}}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function J(e,t,n){return t&&q(e.prototype,t),n&&q(e,n),e}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */var F=function(){function e(t,n,r){M(this,e),R(this,"startDate",void 0),R(this,"endDate",void 0),R(this,"childPeriodType",void 0),this.startDate=t,this.endDate=n,this.childPeriodType=r}return H(e,[{key:"getPrettyString",value:function(){var e=D(this.startDate),t=D(this.endDate);return C("General_DateRangeFromTo",[e,t])}},{key:"getDateRange",value:function(){return[this.startDate,this.endDate]}},{key:"containsToday",value:function(){return V(this.getDateRange())}},{key:"getDayCount",value:function(){return Math.ceil((this.endDate.getTime()-this.startDate.getTime())/864e5)+1}}],[{key:"getLastNRange",value:function(t,n,r){var i=Math.max(parseInt(n.toString(),10)-1,0);if(Number.isNaN(i))throw new Error("Invalid range strAmount");var a=r?E(r):P(),o=new Date(a.getTime());if("day"===t)o.setDate(o.getDate()-i);else if("week"===t)o.setDate(o.getDate()-7*i);else if("month"===t)o.setDate(1),o.setMonth(o.getMonth()-i);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));o.setFullYear(o.getFullYear()-i)}if("day"!==t){var c=p.periods[t].parse(o),l=p.periods[t].parse(a),s=c.getDateRange(),u=T(s,1);o=u[0];var d=l.getDateRange(),f=T(d,2);a=f[1]}var m=new Date(1991,7,6);if(o.getTime()-m.getTime()<0)switch(t){case"year":o=new Date(1992,0,1);break;case"month":o=new Date(1991,8,1);break;case"week":o=new Date(1991,8,12);break;case"day":default:o=m;break}return new e(o,a,t)}},{key:"getLastNRangeChild",value:function(t,n,r){var i=n?E(n):P(),a=new Date(i.getTime()),o=new Date(i.getTime());if("day"===t)a.setDate(a.getDate()-r),o.setDate(o.getDate()-r);else if("week"===t)a.setDate(a.getDate()-7*r),o.setDate(o.getDate()-7*r);else if("month"===t)a.setDate(1),a.setMonth(a.getMonth()-r),o.setDate(1),o.setMonth(o.getMonth()-r);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));a.setFullYear(a.getFullYear()-r),o.setFullYear(o.getFullYear()-r)}if("day"!==t){var c=p.periods[t].parse(a),l=p.periods[t].parse(o),s=c.getDateRange(),u=T(s,1);a=u[0];var d=l.getDateRange(),f=T(d,2);o=f[1]}var m=new Date(1991,7,6);if(a.getTime()-m.getTime()<0)switch(t){case"year":a=new Date(1992,0,1);break;case"month":a=new Date(1991,8,1);break;case"week":a=new Date(1991,8,12);break;case"day":default:a=m;break}return new e(a,o,t)}},{key:"parse",value:function(t){var n=arguments.length>1&&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 i=decodeURIComponent(t).split(",");return new e(E(i[0]),E(i[1]),n)}},{key:"getDisplayText",value:function(){return C("General_DateRangeInPeriodList")}}]),e}();function _(){return{getAllLabels:p.getAllLabels.bind(p),isRecognizedPeriod:p.isRecognizedPeriod.bind(p),get:p.get.bind(p),parse:p.parse.bind(p),parseDate:E,format:D,RangePeriod:F,todayIsInRange:V}}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function J(e,t,n){return t&&q(e.prototype,t),n&&q(e,n),e}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * @@ -48,25 +48,25 @@ function D(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r- * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -window.piwik.addCustomPeriod=p.addCustomPeriod.bind(p),window.angular.module("piwikApp.service").factory("piwikPeriods",_);var z=function(){function e(t){U(this,e),G(this,"dateInPeriod",void 0),this.dateInPeriod=t}return J(e,[{key:"getPrettyString",value:function(){return C(this.dateInPeriod)}},{key:"getDateRange",value:function(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}},{key:"containsToday",value:function(){return V(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return D("Intl_PeriodDay")}}]),e}();function Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function W(e,t,n){return t&&Q(e.prototype,t),n&&Q(e,n),e}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} +window.piwik.addCustomPeriod=p.addCustomPeriod.bind(p),window.angular.module("piwikApp.service").factory("piwikPeriods",_);var z=function(){function e(t){U(this,e),G(this,"dateInPeriod",void 0),this.dateInPeriod=t}return J(e,[{key:"getPrettyString",value:function(){return D(this.dateInPeriod)}},{key:"getDateRange",value:function(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}},{key:"containsToday",value:function(){return V(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodDay")}}]),e}();function Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function W(e,t,n){return t&&Q(e.prototype,t),n&&Q(e,n),e}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */p.addCustomPeriod("day",z);var Z=function(){function e(t){Y(this,e),K(this,"dateInPeriod",void 0),this.dateInPeriod=t}return W(e,[{key:"getPrettyString",value:function(){var e=this.getDateRange(),t=C(e[0]),n=C(e[1]);return D("General_DateRangeFromTo",[t,n])}},{key:"getDateRange",value:function(){var e=(this.dateInPeriod.getDay()+6)%7,t=new Date(this.dateInPeriod.getTime());t.setDate(this.dateInPeriod.getDate()-e);var n=new Date(t.getTime());return n.setDate(t.getDate()+6),[t,n]}},{key:"containsToday",value:function(){return V(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return D("Intl_PeriodWeek")}}]),e}();function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t,n){return t&&ee(e.prototype,t),n&&ee(e,n),e}function ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */p.addCustomPeriod("day",z);var X=function(){function e(t){Y(this,e),K(this,"dateInPeriod",void 0),this.dateInPeriod=t}return W(e,[{key:"getPrettyString",value:function(){var e=this.getDateRange(),t=D(e[0]),n=D(e[1]);return C("General_DateRangeFromTo",[t,n])}},{key:"getDateRange",value:function(){var e=(this.dateInPeriod.getDay()+6)%7,t=new Date(this.dateInPeriod.getTime());t.setDate(this.dateInPeriod.getDate()-e);var n=new Date(t.getTime());return n.setDate(t.getDate()+6),[t,n]}},{key:"containsToday",value:function(){return V(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodWeek")}}]),e}();function Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t,n){return t&&ee(e.prototype,t),n&&ee(e,n),e}function ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */p.addCustomPeriod("week",Z);var re=function(){function e(t){X(this,e),ne(this,"dateInPeriod",void 0),this.dateInPeriod=t}return te(e,[{key:"getPrettyString",value:function(){var e=D("Intl_Month_Long_StandAlone_".concat(this.dateInPeriod.getMonth()+1));return"".concat(e," ").concat(this.dateInPeriod.getFullYear())}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return V(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return D("Intl_PeriodMonth")}}]),e}();function ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oe(e,t,n){return t&&ae(e.prototype,t),n&&ae(e,n),e}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */p.addCustomPeriod("week",X);var re=function(){function e(t){Z(this,e),ne(this,"dateInPeriod",void 0),this.dateInPeriod=t}return te(e,[{key:"getPrettyString",value:function(){var e=C("Intl_Month_Long_StandAlone_".concat(this.dateInPeriod.getMonth()+1));return"".concat(e," ").concat(this.dateInPeriod.getFullYear())}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return V(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodMonth")}}]),e}();function ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oe(e,t,n){return t&&ae(e.prototype,t),n&&ae(e,n),e}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */p.addCustomPeriod("month",re);var le=function(){function e(t){ie(this,e),ce(this,"dateInPeriod",void 0),this.dateInPeriod=t}return oe(e,[{key:"getPrettyString",value:function(){return this.dateInPeriod.getFullYear().toString()}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setMonth(0),e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setMonth(12),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return V(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return D("Intl_PeriodYear")}}]),e}(); + */p.addCustomPeriod("month",re);var le=function(){function e(t){ie(this,e),ce(this,"dateInPeriod",void 0),this.dateInPeriod=t}return oe(e,[{key:"getPrettyString",value:function(){return this.dateInPeriod.getFullYear().toString()}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setMonth(0),e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setMonth(12),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return V(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodYear")}}]),e}(); /*! * Matomo - free/libre analytics platform * @@ -79,7 +79,7 @@ function se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */p.addCustomPeriod("year",le);var he=window,ge=he.piwik,ve=he.broadcast;function be(e,t){try{return p.parse(e,t),!0}catch(n){return!1}}var ye=function(){function e(){var t=this;de(this,e),me(this,"urlQuery",Object(a["ref"])("")),me(this,"hashQuery",Object(a["ref"])("")),me(this,"urlParsed",Object(a["computed"])((function(){return Object(a["readonly"])(ve.getValuesFromUrl("?".concat(t.urlQuery.value),!0))}))),me(this,"hashParsed",Object(a["computed"])((function(){return Object(a["readonly"])(ve.getValuesFromUrl("?".concat(t.hashQuery.value),!0))}))),me(this,"parsed",Object(a["computed"])((function(){return Object(a["readonly"])(ue(ue({},t.urlParsed.value),t.hashParsed.value))}))),this.setUrlQuery(window.location.search),this.setHashQuery(window.location.hash),S.on("$locationChangeSuccess",(function(e){var n=new URL(e);t.setUrlQuery(n.search.replace(/^\?/,"")),t.setHashQuery(n.hash.replace(/^#/,""))})),this.updatePeriodParamsFromUrl()}return fe(e,[{key:"updateHash",value:function(e){var t="string"!==typeof e?this.stringify(e):e,n=S.helper.getAngularDependency("$location");n.search(t)}},{key:"updateUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?this.stringify(e):e,r="string"!==typeof t?this.stringify(t):t,i="?".concat(n);r.length&&(i="".concat(i,"#?").concat(r)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,i)}},{key:"updateLocation",value:function(e){S.helper.isAngularRenderingThePage()?this.updateHash(e):this.updateUrl(e)}},{key:"getSearchParam",value:function(e){var t=window.location.href.split("#"),n=new RegExp("".concat(e,"(\\[]|=)"));if(t&&t[1]&&n.test(decodeURIComponent(t[1]))){var r=window.broadcast.getValueFromHash(e,window.location.href);if(r||"date"!==e&&"period"!==e&&"idSite"!==e)return r}return window.broadcast.getValueFromUrl(e,window.location.search)}},{key:"stringify",value:function(e){return $.param(e).replace(/%5B%5D/g,"[]")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(be(t,e)&&(ge.period!==t||ge.currentDateString!==e)){ge.period=t;var n=p.parse(t,e).getDateRange();ge.startDateString=C(n[0]),ge.endDateString=C(n[1]),ge.updateDateInTitle(e,t),"range"===ge.period&&(e="".concat(ge.startDateString,",").concat(ge.endDateString)),ge.currentDateString=e}}},{key:"setUrlQuery",value:function(e){this.urlQuery.value=e.replace(/^\?/,"")}},{key:"setHashQuery",value:function(e){this.hashQuery.value=e.replace(/^[#/?]+/,"")}}]),e}(),Oe=new ye,we=Oe; + */p.addCustomPeriod("year",le);var he=window,ge=he.piwik,ve=he.broadcast;function be(e,t){try{return p.parse(e,t),!0}catch(n){return!1}}var ye=function(){function e(){var t=this;de(this,e),me(this,"urlQuery",Object(a["ref"])("")),me(this,"hashQuery",Object(a["ref"])("")),me(this,"urlParsed",Object(a["computed"])((function(){return Object(a["readonly"])(ve.getValuesFromUrl("?".concat(t.urlQuery.value),!0))}))),me(this,"hashParsed",Object(a["computed"])((function(){return Object(a["readonly"])(ve.getValuesFromUrl("?".concat(t.hashQuery.value),!0))}))),me(this,"parsed",Object(a["computed"])((function(){return Object(a["readonly"])(ue(ue({},t.urlParsed.value),t.hashParsed.value))}))),this.setUrlQuery(window.location.search),this.setHashQuery(window.location.hash),S.on("$locationChangeSuccess",(function(e){var n=new URL(e);t.setUrlQuery(n.search.replace(/^\?/,"")),t.setHashQuery(n.hash.replace(/^#/,""))})),this.updatePeriodParamsFromUrl()}return fe(e,[{key:"updateHash",value:function(e){var t="string"!==typeof e?this.stringify(e):e,n=S.helper.getAngularDependency("$location");n.search(t)}},{key:"updateUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?this.stringify(e):e,r="string"!==typeof t?this.stringify(t):t,i="?".concat(n);r.length&&(i="".concat(i,"#?").concat(r)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,i)}},{key:"updateLocation",value:function(e){S.helper.isAngularRenderingThePage()?this.updateHash(e):this.updateUrl(e)}},{key:"getSearchParam",value:function(e){var t=window.location.href.split("#"),n=new RegExp("".concat(e,"(\\[]|=)"));if(t&&t[1]&&n.test(decodeURIComponent(t[1]))){var r=window.broadcast.getValueFromHash(e,window.location.href);if(r||"date"!==e&&"period"!==e&&"idSite"!==e)return r}return window.broadcast.getValueFromUrl(e,window.location.search)}},{key:"stringify",value:function(e){return $.param(e).replace(/%5B%5D/g,"[]").replace(/%2C/g,",")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(be(t,e)&&(ge.period!==t||ge.currentDateString!==e)){ge.period=t;var n=p.parse(t,e).getDateRange();ge.startDateString=D(n[0]),ge.endDateString=D(n[1]),ge.updateDateInTitle(e,t),"range"===ge.period&&(e="".concat(ge.startDateString,",").concat(ge.endDateString)),ge.currentDateString=e}}},{key:"setUrlQuery",value:function(e){this.urlQuery.value=e.replace(/^\?/,"")}},{key:"setHashQuery",value:function(e){this.hashQuery.value=e.replace(/^[#/?]+/,"")}}]),e}(),Oe=new ye,we=Oe; /*! * Matomo - free/libre analytics platform * @@ -93,13 +93,13 @@ function je(){var e={getSearchParam:we.getSearchParam.bind(we)};return e} * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function ke(){return S}function Se(e,t){t.$oldEmit=t.$emit,t.$emit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return S.postEvent.apply(S,[e].concat(n)),null},t.$oldBroadcast=t.$broadcast,t.$broadcast=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return S.postEventNoEmit.apply(S,[e].concat(r)),t.$oldBroadcast.apply(t,[e].concat(r))},t.$on("$locationChangeSuccess",e.updatePeriodParamsFromUrl)}function De(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 Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?De(Object(n),!0).forEach((function(t){Te(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):De(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ve(e,t,n){return t&&Ee(e.prototype,t),n&&Ee(e,n),e}function Te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} +function ke(){return S}function Se(e,t){t.$oldEmit=t.$emit,t.$emit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return S.postEvent.apply(S,[e].concat(n)),null},t.$oldBroadcast=t.$broadcast,t.$broadcast=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return S.postEventNoEmit.apply(S,[e].concat(r)),t.$oldBroadcast.apply(t,[e].concat(r))},t.$on("$locationChangeSuccess",e.updatePeriodParamsFromUrl)}function Ce(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 De(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(n),!0).forEach((function(t){Te(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ve(e,t,n){return t&&Ee(e.prototype,t),n&&Ee(e,n),e}function Te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Ie(e,t){if("abort"!==t)if("undefined"!==typeof Piwik_Popover){var n=$("#loadingError");Piwik_Popover.isOpen()&&e&&500===e.status?e&&500===e.status&&$(document.body).html(piwikHelper.escape(e.responseText)):n.show()}else console.log("Request failed: ".concat(e.responseText))}ge.updatePeriodParamsFromUrl=Oe.updatePeriodParamsFromUrl.bind(Oe),je.$inject=[],angular.module("piwikApp.service").service("piwikUrl",je),window.angular.module("piwikApp.service").service("piwik",ke),Se.$inject=["piwik","$rootScope"],window.angular.module("piwikApp.service").run(Se),window.globalAjaxQueue=[],window.globalAjaxQueue.active=0,window.globalAjaxQueue.clean=function(){for(var e=this.length;e>=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<t;r++)n[r]=arguments[r];return this.active+=n.length,this.clean(),(e=Array.prototype.push).call.apply(e,[this].concat(n))},window.globalAjaxQueue.abort=function(){this.forEach((function(e){return e&&e.abort&&e.abort()})),this.splice(0,this.length),this.active=0};var xe=function(){function e(){Pe(this,e),Te(this,"format","json"),Te(this,"timeout",null),Te(this,"callback",null),Te(this,"useRegularCallbackInCaseOfError",!1),Te(this,"errorCallback",void 0),Te(this,"withToken",!1),Te(this,"completeCallback",void 0),Te(this,"getParams",{}),Te(this,"getUrl","?"),Te(this,"postParams",{}),Te(this,"loadingElement",null),Te(this,"errorElement","#ajaxError"),Te(this,"requestHandle",null),Te(this,"defaultParams",["idSite","period","date","segment"]),this.errorCallback=Ie}return Ve(e,[{key:"addParams",value:function(e,t){var n=this,r="string"===typeof e?window.broadcast.getValuesFromUrl(e):e,i=["compareSegments","comparePeriods","compareDates"];Object.keys(r).forEach((function(e){var a=r[e];(-1===i.indexOf(e)||a)&&("get"===t.toLowerCase()?n.getParams[e]=a:"post"===t.toLowerCase()&&(n.postParams[e]=a))}))}},{key:"withTokenInUrl",value:function(){this.withToken=!0}},{key:"setUrl",value:function(e){this.addParams(broadcast.getValuesFromUrl(e),"GET")}},{key:"setBulkRequests",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return"string"===typeof e?e:$.param(e)}));this.addParams({module:"API",method:"API.getBulkRequest",urls:r,format:"json"},"post")}},{key:"setTimeout",value:function(e){this.timeout=e}},{key:"setCallback",value:function(e){this.callback=e}},{key:"useCallbackInCaseOfError",value:function(){this.useRegularCallbackInCaseOfError=!0}},{key:"redirectOnSuccess",value:function(e){this.setCallback((function(){piwikHelper.redirect(e)}))}},{key:"setErrorCallback",value:function(e){this.errorCallback=e}},{key:"setCompleteCallback",value:function(e){this.completeCallback=e}},{key:"setFormat",value:function(e){this.format=e}},{key:"setLoadingElement",value:function(e){this.loadingElement=e||"#ajaxLoadingDiv"}},{key:"setErrorElement",value:function(e){e&&(this.errorElement=e)}},{key:"useGETDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)if(this.defaultParams[t]===e)return!0;return!1}},{key:"removeDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)this.defaultParams[t]===e&&this.defaultParams.splice(t,1)}},{key:"send",value:function(){var e=this;$(this.errorElement).length&&$(this.errorElement).hide(),this.loadingElement&&$(this.loadingElement).fadeIn(),this.requestHandle=this.buildAjaxCall(),window.globalAjaxQueue.push(this.requestHandle);var t=new Promise((function(t,n){e.requestHandle.then(t).fail((function(t){"abort"!==t.statusText&&(console.log("Warning: the ".concat($.param(e.getParams)," request failed!")),n(t))}))}));return t.abort=function(){e.requestHandle&&e.requestHandle.abort()},t}},{key:"abort",value:function(){this.requestHandle&&"function"===typeof this.requestHandle.abort&&(this.requestHandle.abort(),this.requestHandle=null)}},{key:"buildAjaxCall",value:function(){var e=this,t=this,n=this.mixinDefaultGetParams(this.getParams),r=this.getUrl;"?"!==r[r.length-1]&&(r+="&"),n.segment&&(r="".concat(r,"segment=").concat(n.segment,"&"),delete n.segment),n.date&&(r="".concat(r,"date=").concat(decodeURIComponent(n.date.toString()),"&"),delete n.date),r+=$.param(n);var i={type:"POST",async:!0,url:r,dataType:this.format||"json",complete:this.completeCallback,error:function(){if(window.globalAjaxQueue.active-=1,t.errorCallback){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.errorCallback.apply(this,n)}},success:function(t,n,r){if(e.loadingElement&&$(e.loadingElement).hide(),t&&"error"===t.result&&!e.useRegularCallbackInCaseOfError){var i=null,a="toast";if($(e.errorElement).length&&t.message&&($(e.errorElement).show(),i=e.errorElement,a=null),t.message){var o=window["require"]("piwik/UI"),c=new o.Notification;c.show(t.message,{placeat:i,context:"error",type:a,id:"ajaxHelper"}),c.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,S.ajaxRequestFinished&&S.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return $.ajax(i)}},{key:"isRequestToApiMethod",value:function(){return this.getParams&&"API"===this.getParams.module&&this.getParams.method||this.postParams&&"API"===this.postParams.module&&this.postParams.method}},{key:"isWidgetizedRequest",value:function(){return"Widgetize"===broadcast.getValueFromUrl("module")}},{key:"getDefaultPostParams",value:function(){return this.withToken||this.isRequestToApiMethod()||S.shouldPropagateTokenAuth?{token_auth:S.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Ce(Ce({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=we.getSearchParam("segment"),r={idSite:S.idSite?S.idSite.toString():broadcast.getValueFromUrl("idSite"),period:S.period||broadcast.getValueFromUrl("period"),segment:n},i=e;return i.token_auth&&(i.token_auth=null,delete i.token_auth),Object.keys(r).forEach((function(e){t.useGETDefaultParameter(e)&&!i[e]&&!t.postParams[e]&&r[e]&&(i[e]=r[e])})),!this.useGETDefaultParameter("date")||i.date||this.postParams.date||(i.date=S.currentDateString),i}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;return n.withTokenInUrl&&r.withTokenInUrl(),r.setFormat("json"),r.addParams(Ce({module:"API",format:"json"},t),"get"),n.postParams&&r.addParams(n.postParams,"post"),r.send()}}]),e}();function Ne(){return globalAjaxQueue}window.ajaxHelper=xe,angular.module("piwikApp.service").service("globalAjaxQueue",Ne); + */function Ie(e,t){if("abort"!==t)if("undefined"!==typeof Piwik_Popover){var n=$("#loadingError");Piwik_Popover.isOpen()&&e&&500===e.status?e&&500===e.status&&$(document.body).html(piwikHelper.escape(e.responseText)):n.show()}else console.log("Request failed: ".concat(e.responseText))}ge.updatePeriodParamsFromUrl=Oe.updatePeriodParamsFromUrl.bind(Oe),je.$inject=[],angular.module("piwikApp.service").service("piwikUrl",je),window.angular.module("piwikApp.service").service("piwik",ke),Se.$inject=["piwik","$rootScope"],window.angular.module("piwikApp.service").run(Se),window.globalAjaxQueue=[],window.globalAjaxQueue.active=0,window.globalAjaxQueue.clean=function(){for(var e=this.length;e>=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<t;r++)n[r]=arguments[r];return this.active+=n.length,this.clean(),(e=Array.prototype.push).call.apply(e,[this].concat(n))},window.globalAjaxQueue.abort=function(){this.forEach((function(e){return e&&e.abort&&e.abort()})),this.splice(0,this.length),this.active=0};var Ne=function(){function e(){Pe(this,e),Te(this,"format","json"),Te(this,"timeout",null),Te(this,"callback",null),Te(this,"useRegularCallbackInCaseOfError",!1),Te(this,"errorCallback",void 0),Te(this,"withToken",!1),Te(this,"completeCallback",void 0),Te(this,"getParams",{}),Te(this,"getUrl","?"),Te(this,"postParams",{}),Te(this,"loadingElement",null),Te(this,"errorElement","#ajaxError"),Te(this,"requestHandle",null),Te(this,"defaultParams",["idSite","period","date","segment"]),this.errorCallback=Ie}return Ve(e,[{key:"addParams",value:function(e,t){var n=this,r="string"===typeof e?window.broadcast.getValuesFromUrl(e):e,i=["compareSegments","comparePeriods","compareDates"];Object.keys(r).forEach((function(e){var a=r[e];(-1===i.indexOf(e)||a)&&("get"===t.toLowerCase()?n.getParams[e]=a:"post"===t.toLowerCase()&&(n.postParams[e]=a))}))}},{key:"withTokenInUrl",value:function(){this.withToken=!0}},{key:"setUrl",value:function(e){this.addParams(broadcast.getValuesFromUrl(e),"GET")}},{key:"setBulkRequests",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return"string"===typeof e?e:$.param(e)}));this.addParams({module:"API",method:"API.getBulkRequest",urls:r,format:"json"},"post")}},{key:"setTimeout",value:function(e){this.timeout=e}},{key:"setCallback",value:function(e){this.callback=e}},{key:"useCallbackInCaseOfError",value:function(){this.useRegularCallbackInCaseOfError=!0}},{key:"redirectOnSuccess",value:function(e){this.setCallback((function(){piwikHelper.redirect(e)}))}},{key:"setErrorCallback",value:function(e){this.errorCallback=e}},{key:"setCompleteCallback",value:function(e){this.completeCallback=e}},{key:"setFormat",value:function(e){this.format=e}},{key:"setLoadingElement",value:function(e){this.loadingElement=e||"#ajaxLoadingDiv"}},{key:"setErrorElement",value:function(e){e&&(this.errorElement=e)}},{key:"useGETDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)if(this.defaultParams[t]===e)return!0;return!1}},{key:"removeDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)this.defaultParams[t]===e&&this.defaultParams.splice(t,1)}},{key:"send",value:function(){var e=this;$(this.errorElement).length&&$(this.errorElement).hide(),this.loadingElement&&$(this.loadingElement).fadeIn(),this.requestHandle=this.buildAjaxCall(),window.globalAjaxQueue.push(this.requestHandle);var t=null;try{t=S.helper.getAngularDependency("$timeout")}catch(r){}var n=new Promise((function(n,r){e.requestHandle.then((function(e){n(e)})).fail((function(t){"abort"!==t.statusText&&(console.log("Warning: the ".concat($.param(e.getParams)," request failed!")),r(t))})).done((function(){t&&t()}))}));return n.abort=function(){e.requestHandle&&e.requestHandle.abort()},n}},{key:"abort",value:function(){this.requestHandle&&"function"===typeof this.requestHandle.abort&&(this.requestHandle.abort(),this.requestHandle=null)}},{key:"buildAjaxCall",value:function(){var e=this,t=this,n=this.mixinDefaultGetParams(this.getParams),r=this.getUrl;"?"!==r[r.length-1]&&(r+="&"),n.segment&&(r="".concat(r,"segment=").concat(n.segment,"&"),delete n.segment),n.date&&(r="".concat(r,"date=").concat(decodeURIComponent(n.date.toString()),"&"),delete n.date),r+=$.param(n);var i={type:"POST",async:!0,url:r,dataType:this.format||"json",complete:this.completeCallback,error:function(){if(window.globalAjaxQueue.active-=1,t.errorCallback){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.errorCallback.apply(this,n)}},success:function(t,n,r){if(e.loadingElement&&$(e.loadingElement).hide(),t&&"error"===t.result&&!e.useRegularCallbackInCaseOfError){var i=null,a="toast";if($(e.errorElement).length&&t.message&&($(e.errorElement).show(),i=e.errorElement,a=null),t.message){var o=window["require"]("piwik/UI"),c=new o.Notification;c.show(t.message,{placeat:i,context:"error",type:a,id:"ajaxHelper"}),c.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,S.ajaxRequestFinished&&S.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return $.ajax(i)}},{key:"isRequestToApiMethod",value:function(){return this.getParams&&"API"===this.getParams.module&&this.getParams.method||this.postParams&&"API"===this.postParams.module&&this.postParams.method}},{key:"isWidgetizedRequest",value:function(){return"Widgetize"===broadcast.getValueFromUrl("module")}},{key:"getDefaultPostParams",value:function(){return this.withToken||this.isRequestToApiMethod()||S.shouldPropagateTokenAuth?{token_auth:S.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=De(De({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=we.getSearchParam("segment"),r={idSite:S.idSite?S.idSite.toString():broadcast.getValueFromUrl("idSite"),period:S.period||broadcast.getValueFromUrl("period"),segment:n},i=e;return i.token_auth&&(i.token_auth=null,delete i.token_auth),Object.keys(r).forEach((function(e){t.useGETDefaultParameter(e)&&!i[e]&&!t.postParams[e]&&r[e]&&(i[e]=r[e])})),!this.useGETDefaultParameter("date")||i.date||this.postParams.date||(i.date=S.currentDateString),i}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;return n.withTokenInUrl&&r.withTokenInUrl(),r.setFormat("json"),r.addParams(De({module:"API",format:"json"},t),"get"),n.postParams&&r.addParams(n.postParams,"post"),r.send()}}]),e}();function xe(){return globalAjaxQueue}window.ajaxHelper=Ne,angular.module("piwikApp.service").service("globalAjaxQueue",xe); /*! * Matomo - free/libre analytics platform * @@ -118,7 +118,7 @@ function ke(){return S}function Se(e,t){t.$oldEmit=t.$emit,t.$emit=function(e){f * @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 $e(e,t){t.value.hasScrolled=!0}function Le(e,t){t.value.isMouseDown=!0,t.value.hasScrolled=!1}function Re(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 He=document.documentElement,Fe={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onEscapeHandler=Re.bind(null,e,t),t.value.onMouseDown=Le.bind(null,e,t),t.value.onClickOutsideElement=Me.bind(null,e,t),t.value.onScroll=$e.bind(null,e,t),He.addEventListener("keyup",t.value.onEscapeHandler),He.addEventListener("mousedown",t.value.onMouseDown),He.addEventListener("mouseup",t.value.onClickOutsideElement),He.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){He.removeEventListener("keyup",t.value.onEscapeHandler),He.removeEventListener("mousedown",t.value.onMouseDown),He.removeEventListener("mouseup",t.value.onClickOutsideElement),He.removeEventListener("scroll",t.value.onScroll)}}; +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 $e(e,t){t.value.hasScrolled=!0}function Le(e,t){t.value.isMouseDown=!0,t.value.hasScrolled=!1}function He(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 Re=document.documentElement,Fe={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onEscapeHandler=He.bind(null,e,t),t.value.onMouseDown=Le.bind(null,e,t),t.value.onClickOutsideElement=Me.bind(null,e,t),t.value.onScroll=$e.bind(null,e,t),Re.addEventListener("keyup",t.value.onEscapeHandler),Re.addEventListener("mousedown",t.value.onMouseDown),Re.addEventListener("mouseup",t.value.onClickOutsideElement),Re.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){Re.removeEventListener("keyup",t.value.onEscapeHandler),Re.removeEventListener("mousedown",t.value.onMouseDown),Re.removeEventListener("mouseup",t.value.onClickOutsideElement),Re.removeEventListener("scroll",t.value.onScroll)}}; /*! * Matomo - free/libre analytics platform * @@ -151,7 +151,7 @@ function Ge(e,t){return e instanceof HTMLElement?e:t.instance.$refs[e]}angular.m * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Ye(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&S.helper.setMarginLeftToBeInViewport(t)}function Qe(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 We(e){e.value.hasScrolled=!0}function Ke(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function Ze(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}var Xe=document.documentElement,et={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=Ye.bind(null,e),t.value.onEscapeHandler=Ze.bind(null,e,t),t.value.onMouseDown=Ke.bind(null,t),t.value.onClickOutsideElement=Qe.bind(null,e,t),t.value.onScroll=We.bind(null,t),setTimeout((function(){var e=ze.getRef(t.value.expander,t);e.addEventListener("click",t.value.onExpand)})),Xe.addEventListener("keyup",t.value.onEscapeHandler),Xe.addEventListener("mousedown",t.value.onMouseDown),Xe.addEventListener("mouseup",t.value.onClickOutsideElement),Xe.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){var n=ze.getRef(t.value.expander,t);n.removeEventListener("click",t.value.onExpand),Xe.removeEventListener("keyup",t.value.onEscapeHandler),Xe.removeEventListener("mousedown",t.value.onMouseDown),Xe.removeEventListener("mouseup",t.value.onClickOutsideElement),Xe.removeEventListener("scroll",t.value.onScroll)}}; + */function Ye(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&S.helper.setMarginLeftToBeInViewport(t)}function Qe(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 We(e){e.value.hasScrolled=!0}function Ke(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function Xe(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}var Ze=document.documentElement,et={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=Ye.bind(null,e),t.value.onEscapeHandler=Xe.bind(null,e,t),t.value.onMouseDown=Ke.bind(null,t),t.value.onClickOutsideElement=Qe.bind(null,e,t),t.value.onScroll=We.bind(null,t),setTimeout((function(){var e=ze.getRef(t.value.expander,t);e.addEventListener("click",t.value.onExpand)})),Ze.addEventListener("keyup",t.value.onEscapeHandler),Ze.addEventListener("mousedown",t.value.onMouseDown),Ze.addEventListener("mouseup",t.value.onClickOutsideElement),Ze.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){var n=ze.getRef(t.value.expander,t);n.removeEventListener("click",t.value.onExpand),Ze.removeEventListener("keyup",t.value.onEscapeHandler),Ze.removeEventListener("mousedown",t.value.onMouseDown),Ze.removeEventListener("mouseup",t.value.onClickOutsideElement),Ze.removeEventListener("scroll",t.value.onScroll)}}; /*! * Matomo - free/libre analytics platform * @@ -172,178 +172,211 @@ function nt(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.posi * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function lt(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{expander:t.find(".title").first()[0]},oldValue:null,modifiers:{},dir:{}};ct.mounted(t[0],n),t.on("$destroy",(function(){return ct.unmounted(t[0],n)}))}}}lt.$inject=[],angular.module("piwikApp").directive("piwikExpandOnHover",lt);var st={ref:"root"};function ut(e,t,n,r,i,o){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",st,[Object(a["renderSlot"])(e.$slots,"default")],512)),[[a["vShow"],e.modelValue]])}var dt=Object(a["defineComponent"])({props:{modelValue:{type:Boolean,required:!0},element:{type:HTMLElement,required:!1}},emits:["yes","no","closeEnd","close","validation","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;S.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")}}});dt.render=ut;var pt=dt;function ft(e,t){return bt(e)||vt(e,t)||ht(e,t)||mt()}function mt(){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 ht(e,t){if(e){if("string"===typeof e)return gt(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)?gt(e,t):void 0}}function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vt(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,c=!1;try{for(n=n.call(e);!(o=(r=n.next()).done);o=!0)if(a.push(r.value),t&&a.length===t)break}catch(l){c=!0,i=l}finally{try{o||null==n["return"]||n["return"]()}finally{if(c)throw i}}return a}}function bt(e){if(Array.isArray(e))return e}function yt(e){return yt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(e)} +function lt(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{expander:t.find(".title").first()[0]},oldValue:null,modifiers:{},dir:{}};ct.mounted(t[0],n),t.on("$destroy",(function(){return ct.unmounted(t[0],n)}))}}}lt.$inject=[],angular.module("piwikApp").directive("piwikExpandOnHover",lt); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Ot=0;function wt(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/[A-Z]/g,(function(e){return"-".concat(e.toLowerCase())}))}function jt(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))}function kt(e){return"object"===yt(e)&&null!==e&&Object.getPrototypeOf(e)===Object.prototype?Object.fromEntries(Object.entries(e).filter((function(e){return!/^\$/.test(e[0])}))):e}function St(e){var t=e.component,n=e.require,r=e.scope,i=void 0===r?{}:r,o=e.events,c=void 0===o?{}:o,l=e.$inject,s=e.directiveName,u=e.transclude,d=e.mountPointFactory,p=e.postCreate,f=e.noScope,m=e.restrict,h=void 0===m?"A":m,g=e.priority,v=Ot;u&&(Ot+=1);var b={};function y(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var l={restrict:h,require:n,priority:g,scope:f?void 0:b,compile:function(){return{post:function(e,n,o,l){var s=u?n.find("[ng-transclude][counter=".concat(v,"]")):null,f="<root-component";Object.entries(c).forEach((function(e){var t=ft(e,1),n=t[0];f+=" @".concat(wt(n),"=\"onEventHandler('").concat(n,"', $event)\"")})),Object.entries(i).forEach((function(e){var t=ft(e,2),n=t[0],r=t[1];if("&"===r.angularJsBind){var i=wt(n);c[i]||(f+=" @".concat(i,"=\"onEventHandler('").concat(i,"', $event)\""))}else f+=" :".concat(wt(r.vue),'="').concat(r.vue,'"')})),f+=">",u&&(f+='<div ref="transcludeTarget"/>'),f+="</root-component>";var m=Object(a["createApp"])({template:f,data:function(){var t=this,a={};return Object.entries(i).forEach((function(i){var c=ft(i,2),s=c[0],u=c[1],d=kt(e[s]);"undefined"===typeof d&&"undefined"!==typeof u.default&&(d=u.default instanceof Function?u.default.apply(u,[e,n,o].concat(r)):u.default),u.transform&&(d=u.transform.apply(u,[d,t,e,n,o,l].concat(r))),a[u.vue]=d})),a},setup:function(){if(u){var e=Object(a["ref"])(null);return{transcludeTarget:e}}},methods:{onEventHandler:function(t,i){var a=jt(t);e[a]&&e[a](i),c[t]&&c[t].apply(c,[i,this,e,n,o,l].concat(r))}}});m.config.globalProperties.$sanitize=window.vueSanitize,m.config.globalProperties.translate=D,m.component("root-component",t);var h=d?d.apply(void 0,[e,n,o].concat(r)):n[0],g=m.mount(h);Object.entries(i).forEach((function(t){var i=ft(t,2),a=i[0],c=i[1];c.angularJsBind&&"&"!==c.angularJsBind&&e.$watch(a,(function(t){var i=kt(t);"undefined"!==typeof c.default&&"undefined"===typeof t&&(i=c.default instanceof Function?c.default.apply(c,[e,n,o].concat(r)):c.default),c.transform&&(i=c.transform.apply(c,[i,g,e,n,o,l].concat(r))),g[c.vue]=i}))})),u&&$(g.transcludeTarget).append(s),p&&p.apply(void 0,[g,e,n,o,l].concat(r)),n.on("$destroy",(function(){m.unmount()}))}}}};return u&&(l.transclude=!0,l.template='<div ng-transclude counter="'.concat(v,'"/>')),l}return Object.entries(i).forEach((function(e){var t=ft(e,2),n=t[0],r=t[1];r.vue||(r.vue=n),r.angularJsBind&&(b[n]=r.angularJsBind)})),y.$inject=l||[],angular.module("piwikApp").directive(s,y),y}function Dt(e){if("undefined"!==typeof e)return"true"===e||!!e&&e>0&&"0"!==e}function Ct(e){if("undefined"!==typeof e)return null===e?null:parseInt(e,10)}function Pt(e){return JSON.parse(JSON.stringify(e))}function Et(e){var t=Pt(e);return S.helper.getAngularDependency("$rootScope").$applyAsync(),t} + */ +var st=!1,ut={mounted:function(e,t){t.value.activator&&setTimeout((function(){if(!st){st=!0;var n=ze.getRef(t.value.activator,t);n&&window.$(n).show();var r=n.getAttribute("data-target");window.$("#".concat(r)).sidenav({closeOnClick:!0})}e.classList.contains("collapsible")&&window.$(e).collapsible()}))}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */St({component:pt,scope:{show:{vue:"modelValue",default:!1},element:{default:function(e,t){return t[0]}}},events:{yes:function(e,t,n,r,i){i.yes&&(n.$eval(i.yes),setTimeout((function(){n.$apply()}),0))},no:function(e,t,n,r,i){i.no&&(n.$eval(i.no),setTimeout((function(){n.$apply()}),0))},validation:function(e,t,n,r,i){i.no&&(n.$eval(i.no),setTimeout((function(){n.$apply()}),0))},close:function(e,t,n,r,i){i.close&&(n.$eval(i.close),setTimeout((function(){n.$apply()}),0))},"update:modelValue":function(e,t,n,r,i,a,o){setTimeout((function(){n.$apply(o(i.piwikDialog).assign(n,e))}),0)}},$inject:["$parse"],directiveName:"piwikDialog",transclude:!0,mountPointFactory:function(e,t){var n=$('<div class="vue-placeholder"/>');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 Vt={key:0,class:"title",tabindex:"6"},Tt=["href","title"],It={class:"iconsBar"},xt=["href","title"],Nt=Object(a["createElementVNode"])("span",{class:"icon-help"},null,-1),At=[Nt],Bt=["title"],Mt=Object(a["createElementVNode"])("span",{class:"icon-info"},null,-1),$t=[Mt],Lt={class:"ratingIcons"},Rt={class:"inlineHelp"},Ht=["innerHTML"],Ft=["href"];function _t(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("RateFeature");return Object(a["openBlock"])(),Object(a["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(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Vt,[Object(a["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.$sanitize(e.actualFeatureName))},[Object(a["renderSlot"])(e.$slots,"default")],8,Tt)):Object(a["createCommentVNode"])("",!0),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",It,[e.helpUrl&&!e.actualInlineHelp?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},At,8,xt)):Object(a["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(a["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},$t,10,Bt)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",Lt,[Object(a["createVNode"])(c,{title:e.actualFeatureName},null,8,["title"])])],512),[[a["vShow"],e.showIcons||e.showInlineHelp]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Rt,[Object(a["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,Ht),e.helpUrl?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(a["toDisplayString"])(e.translate("General_MoreDetails")),9,Ft)):Object(a["createCommentVNode"])("",!0)],512),[[a["vShow"],e.showInlineHelp]])],544)} + */ +function dt(e){return{restrict:"A",priority:10,link:function(t,n,r){var i={instance:null,value:{activator:$(r.piwikSideNav)[0]},oldValue:null,modifiers:{},dir:{}};e((function(){ut.mounted(n[0],i)}))}}}dt.$inject=["$timeout"],angular.module("piwikApp.directive").directive("piwikSideNav",dt);var pt={ref:"root"};function ft(e,t,n,r,i,o){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",pt,[Object(a["renderSlot"])(e.$slots,"default")],512)),[[a["vShow"],e.modelValue]])}var mt=Object(a["defineComponent"])({props:{modelValue:{type:Boolean,required:!0},element:{type:HTMLElement,required:!1}},emits:["yes","no","closeEnd","close","validation","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;S.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")}}});mt.render=ft;var ht=mt;function gt(e,t){return wt(e)||Ot(e,t)||bt(e,t)||vt()}function vt(){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 bt(e,t){if(e){if("string"===typeof e)return yt(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)?yt(e,t):void 0}}function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ot(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,c=!1;try{for(n=n.call(e);!(o=(r=n.next()).done);o=!0)if(a.push(r.value),t&&a.length===t)break}catch(l){c=!0,i=l}finally{try{o||null==n["return"]||n["return"]()}finally{if(c)throw i}}return a}}function wt(e){if(Array.isArray(e))return e}function jt(e){return jt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jt(e)} /*! * 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){return Object(a["defineAsyncComponent"])((function(){return new Promise((function(n){window.$(document).ready((function(){window[e]?n(window[e][t]):n(null)}))}))}))}var qt=Ut("Feedback","RateFeature"),Jt=Object(a["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:qt},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="<p>".concat(r,"</p>"),setTimeout((function(){return n.remove()}),0))}}e.actualFeatureName||(e.actualFeatureName=t.querySelector(".title").textContent),e.reportGenerated&&p.parse(S.period,S.currentDateString).containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:e.reportGenerated,items:"div",show:!1,hide:!1})}))}});Jt.render=_t;var Gt=Jt,zt=(St({component:Gt,scope:{helpUrl:{angularJsBind:"@"},editUrl:{angularJsBind:"@"},reportGenerated:{angularJsBind:"@?"},featureName:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@?"}},directiveName:"piwikEnrichedHeadline",transclude:!0}),{class:"card",ref:"root"}),Yt={class:"card-content"},Qt={key:0,class:"card-title"},Wt={key:1,class:"card-title"},Kt={ref:"content"}; + */var kt=0;function St(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/[A-Z]/g,(function(e){return"-".concat(e.toLowerCase())}))}function Ct(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))}function Dt(e){return"object"===jt(e)&&null!==e&&Object.getPrototypeOf(e)===Object.prototype?Object.fromEntries(Object.entries(e).filter((function(e){return!/^\$/.test(e[0])}))):e}function Pt(e){var t=e.component,n=e.require,r=e.scope,i=void 0===r?{}:r,o=e.events,c=void 0===o?{}:o,l=e.$inject,s=e.directiveName,u=e.transclude,d=e.mountPointFactory,p=e.postCreate,f=e.noScope,m=e.restrict,h=void 0===m?"A":m,g=e.priority,v=kt;u&&(kt+=1);var b={};function y(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var l={restrict:h,require:n,priority:g,scope:f?void 0:b,compile:function(){return{post:function(e,n,o,l){var s=u?n.find("[ng-transclude][counter=".concat(v,"]")):null,f="<root-component";Object.entries(c).forEach((function(e){var t=gt(e,1),n=t[0];f+=" @".concat(St(n),"=\"onEventHandler('").concat(n,"', $event)\"")})),Object.entries(i).forEach((function(e){var t=gt(e,2),n=t[0],r=t[1];if("&"===r.angularJsBind){var i=St(n);c[i]||(f+=" @".concat(i,"=\"onEventHandler('").concat(i,"', $event)\""))}else f+=" :".concat(St(r.vue),'="').concat(r.vue,'"')})),f+=">",u&&(f+='<div ref="transcludeTarget"/>'),f+="</root-component>";var m=Object(a["createApp"])({template:f,data:function(){var t=this,a={};return Object.entries(i).forEach((function(i){var c=gt(i,2),s=c[0],u=c[1],d=Dt(e[s]);"undefined"===typeof d&&"undefined"!==typeof u.default&&(d=u.default instanceof Function?u.default.apply(u,[e,n,o].concat(r)):u.default),u.transform&&(d=u.transform.apply(u,[d,t,e,n,o,l].concat(r))),a[u.vue]=d})),a},setup:function(){if(u){var e=Object(a["ref"])(null);return{transcludeTarget:e}}},methods:{onEventHandler:function(t,i){var a=Ct(t);e[a]&&e[a](i),c[t]&&c[t].apply(c,[i,this,e,n,o,l].concat(r))}}});m.config.globalProperties.$sanitize=window.vueSanitize,m.config.globalProperties.translate=C,m.component("root-component",t);var h=d?d.apply(void 0,[e,n,o].concat(r)):n[0],g=m.mount(h);Object.entries(i).forEach((function(t){var i=gt(t,2),a=i[0],c=i[1];c.angularJsBind&&"&"!==c.angularJsBind&&e.$watch(a,(function(t){var i=Dt(t);"undefined"!==typeof c.default&&"undefined"===typeof t&&(i=c.default instanceof Function?c.default.apply(c,[e,n,o].concat(r)):c.default),c.transform&&(i=c.transform.apply(c,[i,g,e,n,o,l].concat(r))),g[c.vue]=i}))})),u&&$(g.transcludeTarget).append(s),p&&p.apply(void 0,[g,e,n,o,l].concat(r)),n.on("$destroy",(function(){m.unmount()}))}}}};return u&&(l.transclude=!0,l.template='<div ng-transclude counter="'.concat(v,'"/>')),l}return Object.entries(i).forEach((function(e){var t=gt(e,2),n=t[0],r=t[1];r.vue||(r.vue=n),r.angularJsBind&&(b[n]=r.angularJsBind)})),y.$inject=l||[],angular.module("piwikApp").directive(s,y),y}function Et(e){if("undefined"!==typeof e)return"true"===e||!!e&&e>0&&"0"!==e}function Vt(e){if("undefined"!==typeof e)return null===e?null:parseInt(e,10)}function Tt(e){return"undefined"===typeof e?e:JSON.parse(JSON.stringify(e))}function It(e){var t=Tt(e);return S.helper.getAngularDependency("$rootScope").$applyAsync(),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 Zt(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("EnrichedHeadline");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",zt,[Object(a["createElementVNode"])("div",Yt,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("h2",Qt,Object(a["toDisplayString"])(e.contentTitle),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(a["openBlock"])(),Object(a["createElementBlock"])("h2",Wt,[Object(a["createVNode"])(c,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(a["withCtx"])((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.contentTitle),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",Kt,[Object(a["renderSlot"])(e.$slots,"default")],512)])],512)}var Xt=null,en=Object(a["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:Gt},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,i=n.content;if(this.anchor){var a=document.createElement("a");a.id=this.anchor,r.parentElement.prepend(a)}if(setTimeout((function(){var e=i.querySelector(".contentHelp");e&&(t.actualHelpText=e.innerHTML,e.remove())}),0),!this.actualFeature||!0!==this.actualFeature&&"true"!==this.actualFeature||(this.actualFeature=this.contentTitle),null===Xt&&(Xt=document.querySelector("#content.admin")),Xt&&(e=Xt.offsetTop),e||0===e){var o=r.closest("[piwik-widget-loader]"),c=o?o.offsetTop:r.offsetTop;c-e<17&&(r.style.marginTop=0)}}});en.render=Zt;var tn=en; + */Pt({component:ht,scope:{show:{vue:"modelValue",default:!1},element:{default:function(e,t){return t[0]}}},events:{yes:function(e,t,n,r,i){i.yes&&(n.$eval(i.yes),setTimeout((function(){n.$apply()}),0))},no:function(e,t,n,r,i){i.no&&(n.$eval(i.no),setTimeout((function(){n.$apply()}),0))},validation:function(e,t,n,r,i){i.no&&(n.$eval(i.no),setTimeout((function(){n.$apply()}),0))},close:function(e,t,n,r,i){i.close&&(n.$eval(i.close),setTimeout((function(){n.$apply()}),0))},"update:modelValue":function(e,t,n,r,i,a,o){setTimeout((function(){n.$apply(o(i.piwikDialog).assign(n,e))}),0)}},$inject:["$parse"],directiveName:"piwikDialog",transclude:!0,mountPointFactory:function(e,t){var n=$('<div class="vue-placeholder"/>');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 Nt={key:0,class:"title",tabindex:"6"},xt=["href","title"],At={class:"iconsBar"},Bt=["href","title"],Mt=Object(a["createElementVNode"])("span",{class:"icon-help"},null,-1),$t=[Mt],Lt=["title"],Ht=Object(a["createElementVNode"])("span",{class:"icon-info"},null,-1),Rt=[Ht],Ft={class:"ratingIcons"},_t={class:"inlineHelp"},Ut=["innerHTML"],qt=["href"];function Jt(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("RateFeature");return Object(a["openBlock"])(),Object(a["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(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Nt,[Object(a["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.$sanitize(e.actualFeatureName))},[Object(a["renderSlot"])(e.$slots,"default")],8,xt)):Object(a["createCommentVNode"])("",!0),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",At,[e.helpUrl&&!e.actualInlineHelp?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},$t,8,Bt)):Object(a["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(a["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},Rt,10,Lt)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",Ft,[Object(a["createVNode"])(c,{title:e.actualFeatureName},null,8,["title"])])],512),[[a["vShow"],e.showIcons||e.showInlineHelp]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",_t,[Object(a["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,Ut),e.helpUrl?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(a["toDisplayString"])(e.translate("General_MoreDetails")),9,qt)):Object(a["createCommentVNode"])("",!0)],512),[[a["vShow"],e.showInlineHelp]])],544)} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */St({component:tn,scope:{contentTitle:{angularJsBind:"@"},feature:{angularJsBind:"@"},helpUrl:{angularJsBind:"@"},helpText:{angularJsBind:"@"},anchor:{angularJsBind:"@?"}},directiveName:"piwikContentBlock",transclude:!0});function nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function an(e,t,n){return t&&rn(e.prototype,t),n&&rn(e,n),e}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */function Gt(e,t){return Object(a["defineAsyncComponent"])((function(){return new Promise((function(n){window.$(document).ready((function(){window[e]?n(window[e][t]):n(null)}))}))}))}var zt=Gt("Feedback","RateFeature"),Yt=Object(a["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:zt},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="<p>".concat(r,"</p>"),setTimeout((function(){return n.remove()}),0))}}e.actualFeatureName||(e.actualFeatureName=t.querySelector(".title").textContent),e.reportGenerated&&p.parse(S.period,S.currentDateString).containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:e.reportGenerated,items:"div",show:!1,hide:!1})}))}});Yt.render=Jt;var Qt=Yt,Wt=(Pt({component:Qt,scope:{helpUrl:{angularJsBind:"@"},editUrl:{angularJsBind:"@"},reportGenerated:{angularJsBind:"@?"},featureName:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@?"}},directiveName:"piwikEnrichedHeadline",transclude:!0}),{class:"card",ref:"root"}),Kt={class:"card-content"},Xt={key:0,class:"card-title"},Zt={key:1,class:"card-title"},en={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 - */var cn=function(){function e(){var t=this;nn(this,e),on(this,"segmentState",Object(a["reactive"])({availableSegments:[]})),S.on("piwikSegmentationInited",(function(){return t.setSegmentState()}))}return an(e,[{key:"state",get:function(){return Object(a["readonly"])(this.segmentState)}},{key:"setSegmentState",value:function(){try{var e=$(".segmentEditorPanel").data("uiControlObject");this.segmentState.availableSegments=e.impl.availableSegments||[]}catch(t){}}}]),e}(),ln=new cn;function sn(e){return fn(e)||pn(e)||dn(e)||un()}function un(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function dn(e,t){if(e){if("string"===typeof e)return mn(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)?mn(e,t):void 0}}function pn(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function fn(e){if(Array.isArray(e))return mn(e)}function mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hn(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 gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(n),!0).forEach((function(t){On(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yn(e,t,n){return t&&bn(e.prototype,t),n&&bn(e,n),e}function On(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */function tn(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("EnrichedHeadline");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Wt,[Object(a["createElementVNode"])("div",Kt,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("h2",Xt,Object(a["toDisplayString"])(e.contentTitle),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(a["openBlock"])(),Object(a["createElementBlock"])("h2",Zt,[Object(a["createVNode"])(c,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(a["withCtx"])((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.contentTitle),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",en,[Object(a["renderSlot"])(e.$slots,"default")],512)])],512)}var nn=null,rn=Object(a["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:Qt},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,i=n.content;if(this.anchor){var a=document.createElement("a");a.id=this.anchor,r.parentElement.prepend(a)}if(setTimeout((function(){var e=i.querySelector(".contentHelp");e&&(t.actualHelpText=e.innerHTML,e.remove())}),0),!this.actualFeature||!0!==this.actualFeature&&"true"!==this.actualFeature||(this.actualFeature=this.contentTitle),null===nn&&(nn=document.querySelector("#content.admin")),nn&&(e=nn.offsetTop),e||0===e){var o=r.closest("[piwik-widget-loader]"),c=o?o.offsetTop:r.offsetTop;c-e<17&&(r.style.marginTop=0)}}});rn.render=tn;var an=rn; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var wn=8,jn=3;function kn(e){return e?Array.isArray(e)?e:[e]:[]}var Sn=function(){function e(){var t=this;vn(this,e),On(this,"privateState",Object(a["reactive"])({comparisonsDisabledFor:[]})),On(this,"state",Object(a["readonly"])(this.privateState)),On(this,"colors",{}),On(this,"segmentComparisons",Object(a["computed"])((function(){return t.parseSegmentComparisons()}))),On(this,"periodComparisons",Object(a["computed"])((function(){return t.parsePeriodComparisons()}))),On(this,"isEnabled",Object(a["computed"])((function(){return t.checkEnabledForCurrentPage()}))),this.loadComparisonsDisabledFor(),$((function(){t.colors=t.getAllSeriesColors()})),Object(a["watch"])((function(){return t.getComparisons()}),(function(){return S.postEvent("piwikComparisonsChanged")}),{deep:!0})}return yn(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)%wn;if(0===n)return this.colors["series".concat(r)];var i=n%jn;return this.colors["series".concat(r,"-shade").concat(i)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%wn);return t>0&&(n+="-shade".concat(t%jn)),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(i){t.push({index:n,params:gn(gn({},i.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=sn(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={},i={},a=!1,o=!1;e.forEach((function(e){a?r[e.params.segment]=!0:a=!0})),t.forEach((function(e){o?i["".concat(e.params.period,"|").concat(e.params.date)]=!0:o=!0}));var c=[],l=[];Object.keys(i).forEach((function(e){var t=e.split("|");c.push(t[0]),l.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:c,compareDates:l},u=S.helper.isAngularRenderingThePage()?we.hashParsed.value:we.urlParsed.value;we.updateLocation(gn(gn(gn({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=S.ColorManager;if(!e)return[];for(var t=[],n=0;n<wn;n+=1){t.push("series".concat(n));for(var r=0;r<jn;r+=1)t.push("series".concat(n,"-shade").concat(r))}return e.getColors("comparison-series-color",t)}},{key:"loadComparisonsDisabledFor",value:function(){var e=this,t=we.parsed.value.module;"CoreUpdater"!==t&&"Installation"!==t?xe.fetch({module:"API",method:"API.getPagesComparisonsDisabledFor"}).then((function(t){e.privateState.comparisonsDisabledFor=t})):this.privateState.comparisonsDisabledFor=[]}},{key:"parseSegmentComparisons",value:function(){var e=ln.state.availableSegments,t=sn(kn(we.parsed.value.compareSegments));t.unshift(we.parsed.value.segment||"");var n=[];return t.forEach((function(t,r){var i;e.forEach((function(e){e.definition!==t&&e.definition!==decodeURIComponent(t)&&decodeURIComponent(e.definition)!==t||(i=e)}));var a=i?i.name:D("General_Unknown");""===t.trim()&&(a=D("SegmentEditor_DefaultAllVisits")),n.push({params:{segment:t},title:S.helper.htmlDecode(a),index:r})})),n}},{key:"parsePeriodComparisons",value:function(){var e=sn(kn(we.parsed.value.comparePeriods)),t=sn(kn(we.parsed.value.compareDates));e.unshift(we.parsed.value.period),t.unshift(we.parsed.value.date);for(var n=[],r=0;r<Math.min(t.length,e.length);r+=1){var i=void 0;try{i=p.parse(e[r],t[r]).getPrettyString()}catch(a){i=D("General_Error")}n.push({params:{date:t[r],period:e[r]},title:i,index:r})}return n}},{key:"checkEnabledForCurrentPage",value:function(){var e=we.parsed.value.category||we.parsed.value.module,t=we.parsed.value.subcategory||we.parsed.value.action,n="".concat(e,".").concat(t),r=-1===this.privateState.comparisonsDisabledFor.indexOf(n)&&-1===this.privateState.comparisonsDisabledFor.indexOf("".concat(e,".*"));return document.documentElement.classList.toggle("comparisonsDisabled",!r),r}}]),e}(),Dn=new Sn,Cn={key:0,ref:"root",class:"matomo-comparisons"},Pn={class:"comparison-type"},En=["title"],Vn=["href"],Tn=["title"],In={class:"comparison-period-label"},xn=["onClick"],Nn=["title"],An={class:"loadingPiwik",style:{display:"none"}},Bn=["alt"];function Mn(e,t,n,r,i,o){return e.isComparing?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Cn,[Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.segmentComparisons,(function(t,n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(a["createElementVNode"])("div",Pn,Object(a["toDisplayString"])(e.translate("General_Segment")),1),Object(a["createElementVNode"])("div",{class:"title",title:t.title+"<br/>"+decodeURIComponent(t.params.segment)},[Object(a["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(a["toDisplayString"])(t.title),9,Vn)],8,En),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.periodComparisons,(function(n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(a["createElementVNode"])("span",{class:"comparison-dot",style:Object(a["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(a["createElementVNode"])("span",In,Object(a["toDisplayString"])(n.title)+" ("+Object(a["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,Tn)})),128)),e.segmentComparisons.length>1?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(a["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,Nn)],8,xn)):Object(a["createCommentVNode"])("",!0)])})),128)),Object(a["createElementVNode"])("div",An,[Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Bn),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)):Object(a["createCommentVNode"])("",!0)}function $n(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 Ln(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$n(Object(n),!0).forEach((function(t){Rn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$n(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hn=Object(a["defineComponent"])({props:{},data:function(){return{comparisonTooltips:null}},setup:function(){var e=Object(a["computed"])((function(){return Dn.isComparing()})),t=Object(a["computed"])((function(){return Dn.getSegmentComparisons()})),n=Object(a["computed"])((function(){return Dn.getPeriodComparisons()})),r=Dn.getSeriesColor.bind(Dn);return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),Dn.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return D("CoreHome_PeriodRange");var n=D("Intl_Period".concat(t.substring(0,1).toUpperCase()).concat(t.substring(1)));return n.substring(0,1).toUpperCase()+n.substring(1)},getComparisonTooltip:function(e,t){if(this.comparisonTooltips&&Object.keys(this.comparisonTooltips).length)return(this.comparisonTooltips[t.index]||{})[e.index]},getUrlToSegment:function(e){var t=Ln({},we.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(we.stringify(t))},setUpTooltips:function(){var e=window,t=e.$;t(this.$refs.root).tooltip({track:!0,content:function(){var e=t(this).attr("title");return window.vueSanitize(e.replace(/\n/g,"<br />"))},show:{delay:200,duration:200},hide:!1})},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,Dn.isComparing()){var t=Dn.getPeriodComparisons(),n=Dn.getSegmentComparisons();xe.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:we.getSearchParam("compareSegments"),comparePeriods:we.getSearchParam("comparePeriods"),compareDates:we.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var i=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=i}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=Dn.getComparisonSeriesIndex(t.index,0),i=e.reportData.comparisons[r],a=Dn.getComparisonSeriesIndex(t.index,n.index),o=e.reportData.comparisons[a],c=e.reportData.comparisons[n.index],l='<div class="comparison-card-tooltip">',s=(o.nb_visits/i.nb_visits*100).toFixed(2);return s="".concat(s,"%"),l+=D("General_ComparisonCardTooltip1",["'".concat(o.compareSegmentPretty,"'"),o.comparePeriodPretty,s,o.nb_visits.toString(),i.nb_visits.toString()]),t.index>0&&(l+="<br/><br/>",l+=D("General_ComparisonCardTooltip2",[o.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),l+="</div>",l}},updated:function(){var e=this;setTimeout((function(){return e.setUpTooltips()}))},mounted:function(){var e=this;S.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged(),setTimeout((function(){return e.setUpTooltips()}))},beforeUnmount:function(){try{window.$(this.refs.root).tooltip("destroy")}catch(e){}}});Hn.render=Mn;var Fn=Hn; + */Pt({component:an,scope:{contentTitle:{angularJsBind:"@"},feature:{angularJsBind:"@"},helpUrl:{angularJsBind:"@"},helpText:{angularJsBind:"@"},anchor:{angularJsBind:"@?"}},directiveName:"piwikContentBlock",transclude:!0});function on(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ln(e,t,n){return t&&cn(e.prototype,t),n&&cn(e,n),e}function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * 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 Dn}_n.$inject=[],angular.module("piwikApp.service").factory("piwikComparisonsService",_n);St({component:Fn,directiveName:"piwikComparisons",restrict:"E"});var Un={ref:"root",class:"menuDropdown"},qn=["title"],Jn=["innerHTML"],Gn=Object(a["createElementVNode"])("span",{class:"icon-arrow-bottom"},null,-1),zn={class:"items"},Yn={key:0,class:"search"},Qn=["placeholder"],Wn=["title"],Kn=["title"];function Zn(e,t,n,r,i,o){var c=Object(a["resolveDirective"])("focus-if"),l=Object(a["resolveDirective"])("focus-anywhere-but-here");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Un,[Object(a["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,Jn),Gn],8,qn),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",zn,[e.showSearch&&e.showItems?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Yn,[Object(a["withDirectives"])(Object(a["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,Qn),[[a["vModelText"],e.searchTerm],[c,{},e.showItems]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("img",{class:"search_ico",src:"plugins/Morpheus/images/search_ico.png",title:e.translate("General_Search")},null,8,Wn),[[a["vShow"],!e.searchTerm]]),Object(a["withDirectives"])(Object(a["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,Kn),[[a["vShow"],e.searchTerm]])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(a["renderSlot"])(e.$slots,"default")])],512),[[a["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var Xn=window,er=Xn.$,tr=Object(a["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:String},directives:{FocusAnywhereButHere:Fe,FocusIf:qe},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,er(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();er(this.$refs.root).find(".item").each((function(e,n){var r=er(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});tr.render=Zn;var nr=tr,rr=(St({component:nr,scope:{menuTitle:{angularJsBind:"@"},tooltip:{angularJsBind:"@"},showSearch:{angularJsBind:"="},menuTitleChangeOnClick:{angularJsBind:"="}},directiveName:"piwikMenudropdown",transclude:!0,events:{"after-select":function(e,t,n){setTimeout((function(){n.$apply()}),0)}}}),{ref:"root"}); + */var un=function(){function e(){var t=this;on(this,e),sn(this,"segmentState",Object(a["reactive"])({availableSegments:[]})),S.on("piwikSegmentationInited",(function(){return t.setSegmentState()}))}return ln(e,[{key:"state",get:function(){return Object(a["readonly"])(this.segmentState)}},{key:"setSegmentState",value:function(){try{var e=$(".segmentEditorPanel").data("uiControlObject");this.segmentState.availableSegments=e.impl.availableSegments||[]}catch(t){}}}]),e}(),dn=new un;function pn(e){return gn(e)||hn(e)||mn(e)||fn()}function fn(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function mn(e,t){if(e){if("string"===typeof e)return vn(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)?vn(e,t):void 0}}function hn(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function gn(e){if(Array.isArray(e))return vn(e)}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bn(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 yn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bn(Object(n),!0).forEach((function(t){kn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function On(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jn(e,t,n){return t&&wn(e.prototype,t),n&&wn(e,n),e}function kn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function ir(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",rr,null,512)}function ar(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 or(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ar(Object(n),!0).forEach((function(t){cr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ar(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lr=1,sr=window,ur=sr.$,dr=Object(a["defineComponent"])({props:{selectedDateStart:Date,selectedDateEnd:Date,highlightedDateStart:Date,highlightedDateEnd:Date,viewDate:[String,Date],stepMonths:Number,disableMonthDropdown:Boolean,options:Object},emits:["cellHover","cellHoverLeave","dateSelect"],setup:function(e,t){var n=Object(a["ref"])(null);function r(t,n){var r=t.children("a");if(e.selectedDateStart&&e.selectedDateEnd&&n>=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 i=r.length?r:t;i.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function i(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return o(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function o(e,t,n){var r,a=e.parent(),o=a.children("td");if(a.is(":first-child")){var c=a.children("td:not(.ui-datepicker-other-month)").first();return r=i(c,t,n),r.setDate(o.index(e)-o.index(c)+1),r}var l=a.children("td:not(.ui-datepicker-other-month)").last();return r=i(l,t,n),r.setDate(r.getDate()+o.index(e)-o.index(l)),r}function c(){var e=ur(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),i=parseInt(t.attr("data-year"),10);return[r,i]}function l(){var e=ur(n.value),t=e.find(".ui-datepicker-calendar"),a=c(),o=t.find("td"),l=o.first(),s=i(l,a[0],a[1]);o.each((function(){r(ur(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(a){return!1}var r=ur(n.value),i=c();return(i[0]!==t.getMonth()||i[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function u(){var e=ur(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=ur(n.value),r=e.stepMonths||lr;if(t.datepicker("option","stepMonths")===r)return!1;var i=ur(".ui-datepicker-month",t).val(),a=ur(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(a,i)),u(),!0}function p(){var t=ur(n.value);t.find(".ui-datepicker-month").attr("disabled",e.disableMonthDropdown)}function f(){if(ur(this).hasClass("ui-state-hover")){var e=ur(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function m(){p(),l()}return Object(a["watch"])((function(){return or({},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&&l()})),Object(a["onMounted"])((function(){var r=ur(n.value),a=e.options||{},o=or(or(or({},S.getBaseDatePickerOptions()),a),{},{onChangeMonthYear:function(){setTimeout((function(){u()}))}});r.datepicker(o),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&l()})),r.on("mouseenter","tbody td",(function(){var e=c(),n=ur(this),r=i(n,e[0],e[1]);t.emit("cellHover",{date:r,$cell:n})})),r.on("mouseout","tbody td a",(function(){l()})),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=ur(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=ur(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),i=parseInt(n.attr("data-year"),10),a=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(i,r,a)})}));var h=d();s(),p(),h||u(),l()})),{root:n}}});dr.render=ir;var pr=dr,fr=(St({component:pr,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,i){i()},"cell-hover-leave":function(e,t,n,r,i){i()},"date-select":function(e,t,n,r,i){i()}},$inject:["$timeout"]}),{id:"calendarRangeFrom"}),mr={id:"calendarRangeTo"}; + */var Sn=8,Cn=3;function Dn(e){return e?Array.isArray(e)?e:[e]:[]}var Pn=function(){function e(){var t=this;On(this,e),kn(this,"privateState",Object(a["reactive"])({comparisonsDisabledFor:[]})),kn(this,"state",Object(a["readonly"])(this.privateState)),kn(this,"colors",{}),kn(this,"segmentComparisons",Object(a["computed"])((function(){return t.parseSegmentComparisons()}))),kn(this,"periodComparisons",Object(a["computed"])((function(){return t.parsePeriodComparisons()}))),kn(this,"isEnabled",Object(a["computed"])((function(){return t.checkEnabledForCurrentPage()}))),this.loadComparisonsDisabledFor(),$((function(){t.colors=t.getAllSeriesColors()})),Object(a["watch"])((function(){return t.getComparisons()}),(function(){return S.postEvent("piwikComparisonsChanged")}),{deep:!0})}return jn(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)%Sn;if(0===n)return this.colors["series".concat(r)];var i=n%Cn;return this.colors["series".concat(r,"-shade").concat(i)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%Sn);return t>0&&(n+="-shade".concat(t%Cn)),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(i){t.push({index:n,params:yn(yn({},i.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=pn(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={},i={},a=!1,o=!1;e.forEach((function(e){a?r[e.params.segment]=!0:a=!0})),t.forEach((function(e){o?i["".concat(e.params.period,"|").concat(e.params.date)]=!0:o=!0}));var c=[],l=[];Object.keys(i).forEach((function(e){var t=e.split("|");c.push(t[0]),l.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:c,compareDates:l},u=S.helper.isAngularRenderingThePage()?we.hashParsed.value:we.urlParsed.value;we.updateLocation(yn(yn(yn({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=S.ColorManager;if(!e)return[];for(var t=[],n=0;n<Sn;n+=1){t.push("series".concat(n));for(var r=0;r<Cn;r+=1)t.push("series".concat(n,"-shade").concat(r))}return e.getColors("comparison-series-color",t)}},{key:"loadComparisonsDisabledFor",value:function(){var e=this,t=we.parsed.value.module;"CoreUpdater"!==t&&"Installation"!==t?Ne.fetch({module:"API",method:"API.getPagesComparisonsDisabledFor"}).then((function(t){e.privateState.comparisonsDisabledFor=t})):this.privateState.comparisonsDisabledFor=[]}},{key:"parseSegmentComparisons",value:function(){var e=dn.state.availableSegments,t=pn(Dn(we.parsed.value.compareSegments));t.unshift(we.parsed.value.segment||"");var n=[];return t.forEach((function(t,r){var i;e.forEach((function(e){e.definition!==t&&e.definition!==decodeURIComponent(t)&&decodeURIComponent(e.definition)!==t||(i=e)}));var a=i?i.name:C("General_Unknown");""===t.trim()&&(a=C("SegmentEditor_DefaultAllVisits")),n.push({params:{segment:t},title:S.helper.htmlDecode(a),index:r})})),n}},{key:"parsePeriodComparisons",value:function(){var e=pn(Dn(we.parsed.value.comparePeriods)),t=pn(Dn(we.parsed.value.compareDates));e.unshift(we.parsed.value.period),t.unshift(we.parsed.value.date);for(var n=[],r=0;r<Math.min(t.length,e.length);r+=1){var i=void 0;try{i=p.parse(e[r],t[r]).getPrettyString()}catch(a){i=C("General_Error")}n.push({params:{date:t[r],period:e[r]},title:i,index:r})}return n}},{key:"checkEnabledForCurrentPage",value:function(){var e=we.parsed.value.category||we.parsed.value.module,t=we.parsed.value.subcategory||we.parsed.value.action,n="".concat(e,".").concat(t),r=-1===this.privateState.comparisonsDisabledFor.indexOf(n)&&-1===this.privateState.comparisonsDisabledFor.indexOf("".concat(e,".*"));return document.documentElement.classList.toggle("comparisonsDisabled",!r),r}}]),e}(),En=new Pn,Vn={key:0,ref:"root",class:"matomo-comparisons"},Tn={class:"comparison-type"},In=["title"],Nn=["href"],xn=["title"],An={class:"comparison-period-label"},Bn=["onClick"],Mn=["title"],$n={class:"loadingPiwik",style:{display:"none"}},Ln=["alt"];function Hn(e,t,n,r,i,o){return e.isComparing?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Vn,[Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.segmentComparisons,(function(t,n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(a["createElementVNode"])("div",Tn,Object(a["toDisplayString"])(e.translate("General_Segment")),1),Object(a["createElementVNode"])("div",{class:"title",title:t.title+"<br/>"+decodeURIComponent(t.params.segment)},[Object(a["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(a["toDisplayString"])(t.title),9,Nn)],8,In),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.periodComparisons,(function(n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(a["createElementVNode"])("span",{class:"comparison-dot",style:Object(a["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(a["createElementVNode"])("span",An,Object(a["toDisplayString"])(n.title)+" ("+Object(a["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,xn)})),128)),e.segmentComparisons.length>1?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(a["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,Mn)],8,Bn)):Object(a["createCommentVNode"])("",!0)])})),128)),Object(a["createElementVNode"])("div",$n,[Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Ln),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)):Object(a["createCommentVNode"])("",!0)}function Rn(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 Fn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rn(Object(n),!0).forEach((function(t){_n(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Un=Object(a["defineComponent"])({props:{},data:function(){return{comparisonTooltips:null}},setup:function(){var e=Object(a["computed"])((function(){return En.isComparing()})),t=Object(a["computed"])((function(){return En.getSegmentComparisons()})),n=Object(a["computed"])((function(){return En.getPeriodComparisons()})),r=En.getSeriesColor.bind(En);return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),En.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return C("CoreHome_PeriodRange");var n=C("Intl_Period".concat(t.substring(0,1).toUpperCase()).concat(t.substring(1)));return n.substring(0,1).toUpperCase()+n.substring(1)},getComparisonTooltip:function(e,t){if(this.comparisonTooltips&&Object.keys(this.comparisonTooltips).length)return(this.comparisonTooltips[t.index]||{})[e.index]},getUrlToSegment:function(e){var t=Fn({},we.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(we.stringify(t))},setUpTooltips:function(){var e=window,t=e.$;t(this.$refs.root).tooltip({track:!0,content:function(){var e=t(this).attr("title");return window.vueSanitize(e.replace(/\n/g,"<br />"))},show:{delay:200,duration:200},hide:!1})},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,En.isComparing()){var t=En.getPeriodComparisons(),n=En.getSegmentComparisons();Ne.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:we.getSearchParam("compareSegments"),comparePeriods:we.getSearchParam("comparePeriods"),compareDates:we.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var i=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=i}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=En.getComparisonSeriesIndex(t.index,0),i=e.reportData.comparisons[r],a=En.getComparisonSeriesIndex(t.index,n.index),o=e.reportData.comparisons[a],c=e.reportData.comparisons[n.index],l='<div class="comparison-card-tooltip">',s=(o.nb_visits/i.nb_visits*100).toFixed(2);return s="".concat(s,"%"),l+=C("General_ComparisonCardTooltip1",["'".concat(o.compareSegmentPretty,"'"),o.comparePeriodPretty,s,o.nb_visits.toString(),i.nb_visits.toString()]),t.index>0&&(l+="<br/><br/>",l+=C("General_ComparisonCardTooltip2",[o.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),l+="</div>",l}},updated:function(){var e=this;setTimeout((function(){return e.setUpTooltips()}))},mounted:function(){var e=this;S.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged(),setTimeout((function(){return e.setUpTooltips()}))},beforeUnmount:function(){try{window.$(this.refs.root).tooltip("destroy")}catch(e){}}});Un.render=Hn;var qn=Un; /*! * 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,i,o){var c=Object(a["resolveComponent"])("DatePicker");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("div",fr,[Object(a["createElementVNode"])("h6",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text",id:"inputCalendarFrom",name:"inputCalendarFrom",class:"browser-default","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDateText=t}),onKeydown:t[1]||(t[1]=function(t){return e.onRangeInputChanged("from",t)}),onKeyup:t[2]||(t[2]=function(t){return e.handleEnterPress(t)})},null,544),[[a["vModelText"],e.startDateText]])]),Object(a["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(a["createElementVNode"])("div",mr,[Object(a["createElementVNode"])("h6",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text",id:"inputCalendarTo",name:"inputCalendarTo",class:"browser-default","onUpdate:modelValue":t[6]||(t[6]=function(t){return e.endDateText=t}),onKeydown:t[7]||(t[7]=function(t){return e.onRangeInputChanged("to",t)}),onKeyup:t[8]||(t[8]=function(t){return e.handleEnterPress(t)})},null,544),[[a["vModelText"],e.endDateText]])]),Object(a["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"])])])}var gr="YYYY-MM-DD",vr=Object(a["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:pr},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,startDateInvalid:!1,endDateInvalid:!1}},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){var n=this;setTimeout((function(){"from"===e?n.setStartRangeDateFromStr(t.target.value):n.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;this.startDateInvalid=!0;try{e.length===gr.length&&(t=E(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){var t;this.endDateInvalid=!0;try{e.length===gr.length&&(t=E(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:C(this.fromPickerSelectedDates[0]),end:C(this.toPickerSelectedDates[0])})}}});vr.render=hr;var br=vr; + */function Jn(){return En}Jn.$inject=[],angular.module("piwikApp.service").factory("piwikComparisonsService",Jn);Pt({component:qn,directiveName:"piwikComparisons",restrict:"E"});var Gn={ref:"root",class:"menuDropdown"},zn=["title"],Yn=["innerHTML"],Qn=Object(a["createElementVNode"])("span",{class:"icon-arrow-bottom"},null,-1),Wn={class:"items"},Kn={key:0,class:"search"},Xn=["placeholder"],Zn=["title"],er=["title"];function tr(e,t,n,r,i,o){var c=Object(a["resolveDirective"])("focus-if"),l=Object(a["resolveDirective"])("focus-anywhere-but-here");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Gn,[Object(a["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,Yn),Qn],8,zn),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Wn,[e.showSearch&&e.showItems?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Kn,[Object(a["withDirectives"])(Object(a["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,Xn),[[a["vModelText"],e.searchTerm],[c,{},e.showItems]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("img",{class:"search_ico",src:"plugins/Morpheus/images/search_ico.png",title:e.translate("General_Search")},null,8,Zn),[[a["vShow"],!e.searchTerm]]),Object(a["withDirectives"])(Object(a["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,er),[[a["vShow"],e.searchTerm]])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(a["renderSlot"])(e.$slots,"default")])],512),[[a["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var nr=window,rr=nr.$,ir=Object(a["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:String},directives:{FocusAnywhereButHere:Fe,FocusIf:qe},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,rr(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();rr(this.$refs.root).find(".item").each((function(e,n){var r=rr(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});ir.render=tr;var ar=ir,or=(Pt({component:ar,scope:{menuTitle:{angularJsBind:"@"},tooltip:{angularJsBind:"@"},showSearch:{angularJsBind:"="},menuTitleChangeOnClick:{angularJsBind:"="}},directiveName:"piwikMenudropdown",transclude:!0,events:{"after-select":function(e,t,n){setTimeout((function(){n.$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 - */St({component:br,scope:{startDate:{angularJsBind:"<"},endDate:{angularJsBind:"<"},rangeChange:{angularJsBind:"&"},submit:{angularJsBind:"&"}},directiveName:"piwikDateRangePicker",restrict:"E"});function yr(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("DatePicker");return Object(a["openBlock"])(),Object(a["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 Or=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay),wr=new Date(S.maxDateYear,S.maxDateMonth-1,S.maxDateDay),jr=Object(a["defineComponent"])({props:{period:String,date:[String,Date]},components:{DatePicker:pr},emits:["select"],setup:function(e,t){var n=Object(a["ref"])(e.date),r=Object(a["ref"])([null,null]),i=Object(a["ref"])([null,null]);function o(t){var n=p.get(e.period).parse(t).getDateRange();return n[0]=Or<n[0]?n[0]:Or,n[1]=wr>n[1]?n[1]:wr,n}function c(t,n){var r=t<Or||t>wr,a=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);i.value=r||a?[null,null]:o(t)}function l(){i.value=[null,null]}function s(e){t.emit("select",{date:e})}function u(){if(!e.period||!e.date)return r.value=[null,null],void(n.value=null);r.value=o(e.date),n.value=E(e.date)}return Object(a["watch"])(e,u),u(),{selectedDates:r,highlightedDates:i,viewDate:n,onHoverNormalCell:c,onHoverLeaveNormalCells:l,onDateSelected:s}}});jr.render=yr;var kr=jr,Sr=(St({component:kr,scope:{period:{angularJsBind:"<"},date:{angularJsBind:"<"},select:{angularJsBind:"&"}},directiveName:"piwikPeriodDatePicker",restrict:"E"}),["value","name"]),Dr=["title"],Cr=["textContent"],Pr={key:1,class:"placeholder"},Er={class:"dropdown"},Vr={class:"custom_select_search"},Tr=["placeholder"],Ir={key:0},xr={class:"custom_select_container"},Nr=["onClick"],Ar=["innerHTML","href","title"],Br={class:"ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect"},Mr={class:"ui-menu-item"},$r={class:"ui-corner-all",tabindex:"-1"},Lr={key:1}; + */function cr(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",or,null,512)}function lr(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 sr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lr(Object(n),!0).forEach((function(t){ur(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dr=1,pr=window,fr=pr.$,mr=Object(a["defineComponent"])({props:{selectedDateStart:Date,selectedDateEnd:Date,highlightedDateStart:Date,highlightedDateEnd:Date,viewDate:[String,Date],stepMonths:Number,disableMonthDropdown:Boolean,options:Object},emits:["cellHover","cellHoverLeave","dateSelect"],setup:function(e,t){var n=Object(a["ref"])(null);function r(t,n){var r=t.children("a");if(e.selectedDateStart&&e.selectedDateEnd&&n>=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 i=r.length?r:t;i.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function i(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return o(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function o(e,t,n){var r,a=e.parent(),o=a.children("td");if(a.is(":first-child")){var c=a.children("td:not(.ui-datepicker-other-month)").first();return r=i(c,t,n),r.setDate(o.index(e)-o.index(c)+1),r}var l=a.children("td:not(.ui-datepicker-other-month)").last();return r=i(l,t,n),r.setDate(r.getDate()+o.index(e)-o.index(l)),r}function c(){var e=fr(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),i=parseInt(t.attr("data-year"),10);return[r,i]}function l(){var e=fr(n.value),t=e.find(".ui-datepicker-calendar"),a=c(),o=t.find("td"),l=o.first(),s=i(l,a[0],a[1]);o.each((function(){r(fr(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(a){return!1}var r=fr(n.value),i=c();return(i[0]!==t.getMonth()||i[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function u(){var e=fr(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=fr(n.value),r=e.stepMonths||dr;if(t.datepicker("option","stepMonths")===r)return!1;var i=fr(".ui-datepicker-month",t).val(),a=fr(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(a,i)),u(),!0}function p(){var t=fr(n.value);t.find(".ui-datepicker-month").attr("disabled",e.disableMonthDropdown)}function f(){if(fr(this).hasClass("ui-state-hover")){var e=fr(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function m(){p(),l()}return Object(a["watch"])((function(){return sr({},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&&l()})),Object(a["onMounted"])((function(){var r=fr(n.value),a=e.options||{},o=sr(sr(sr({},S.getBaseDatePickerOptions()),a),{},{onChangeMonthYear:function(){setTimeout((function(){u()}))}});r.datepicker(o),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&l()})),r.on("mouseenter","tbody td",(function(){var e=c(),n=fr(this),r=i(n,e[0],e[1]);t.emit("cellHover",{date:r,$cell:n})})),r.on("mouseout","tbody td a",(function(){l()})),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=fr(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=fr(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),i=parseInt(n.attr("data-year"),10),a=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(i,r,a)})}));var h=d();s(),p(),h||u(),l()})),{root:n}}});mr.render=cr;var hr=mr,gr=(Pt({component:hr,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,i){i()},"cell-hover-leave":function(e,t,n,r,i){i()},"date-select":function(e,t,n,r,i){i()}},$inject:["$timeout"]}),{id:"calendarRangeFrom"}),vr={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 Rr(e,t,n,r,i,o){var c,l,s,u,d=Object(a["resolveComponent"])("AllSitesLink"),p=Object(a["resolveDirective"])("focus-if"),f=Object(a["resolveDirective"])("focus-anywhere-but-here");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(a["openBlock"])(),Object(a["createElementBlock"])("input",{key:0,type:"hidden",value:null===(c=e.modelValue)||void 0===c?void 0:c.id,name:e.name},null,8,Sr)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("a",{ref:"selectorLink",onClick:t[0]||(t[0]=function(){return e.onClickSelector&&e.onClickSelector.apply(e,arguments)}),onKeydown:t[1]||(t[1]=function(t){return e.onPressEnter(t)}),href:"javascript:void(0)",class:Object(a["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(a["createElementVNode"])("span",{class:Object(a["normalizeClass"])(["icon icon-arrow-bottom",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(a["createElementVNode"])("span",null,[null!==(l=e.modelValue)&&void 0!==l&&l.name||!e.placeholder?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",{key:0,textContent:Object(a["toDisplayString"])((null===(s=e.modelValue)||void 0===s?void 0:s.name)||e.firstSiteName)},null,8,Cr)):Object(a["createCommentVNode"])("",!0),null!==(u=e.modelValue)&&void 0!==u&&u.name||!e.placeholder?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Pr,Object(a["toDisplayString"])(e.placeholder),1))])],42,Dr),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Er,[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Vr,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text",onClick:t[2]||(t[2]=function(t){e.searchTerm="",e.loadInitialSites()}),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.searchTerm=t}),tabindex:"4",class:"websiteSearch inp browser-default",placeholder:e.translate("General_Search")},null,8,Tr),[[a["vModelText"],e.searchTerm],[p,{},e.shouldFocusOnSearch]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("img",{title:"Clear",onClick:t[4]||(t[4]=function(t){e.searchTerm="",e.loadInitialSites()}),class:"reset",src:"plugins/CoreHome/images/reset_search.png"},null,512),[[a["vShow"],e.searchTerm]])],512),[[a["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ir,[Object(a["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[5]||(t[5]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",xr,[Object(a["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.sites,(function(n,r){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{onClick:function(t){return e.switchSite(n,t)},key:r},[Object(a["createElementVNode"])("a",{onClick:t[6]||(t[6]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.getMatchedSiteName(n.name)),tabindex:"4",href:e.getUrlForSiteId(n.idsite),title:n.name},null,8,Ar)],8,Nr)),[[a["vShow"],!(!e.showSelectedSite&&e.activeSiteId===n.idsite)]])})),128))]),Object(a["withDirectives"])(Object(a["createElementVNode"])("ul",Br,[Object(a["createElementVNode"])("li",Mr,[Object(a["createElementVNode"])("a",$r,Object(a["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[a["vShow"],!e.sites.length&&e.searchTerm]])]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Lr,[Object(a["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[8]||(t[8]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(a["createCommentVNode"])("",!0)],512),[[a["vShow"],e.showSitesList]])],2)),[[f,{blur:e.onBlur}]])}var Hr=["innerHTML","href"];function Fr(e,t,n,r,i,o){var c=this;return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return c.onClick(e)}),class:"custom_select_all"},[Object(a["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Hr)])}var _r=Object(a["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});_r.render=Fr;var Ur=_r;function qr(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 Jr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qr(Object(n),!0).forEach((function(t){Qr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yr(e,t,n){return t&&zr(e.prototype,t),n&&zr(e,n),e}function Qr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */function br(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("DatePicker");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("div",gr,[Object(a["createElementVNode"])("h6",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text",id:"inputCalendarFrom",name:"inputCalendarFrom",class:"browser-default","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDateText=t}),onKeydown:t[1]||(t[1]=function(t){return e.onRangeInputChanged("from",t)}),onKeyup:t[2]||(t[2]=function(t){return e.handleEnterPress(t)})},null,544),[[a["vModelText"],e.startDateText]])]),Object(a["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(a["createElementVNode"])("div",vr,[Object(a["createElementVNode"])("h6",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text",id:"inputCalendarTo",name:"inputCalendarTo",class:"browser-default","onUpdate:modelValue":t[6]||(t[6]=function(t){return e.endDateText=t}),onKeydown:t[7]||(t[7]=function(t){return e.onRangeInputChanged("to",t)}),onKeyup:t[8]||(t[8]=function(t){return e.handleEnterPress(t)})},null,544),[[a["vModelText"],e.endDateText]])]),Object(a["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"])])])}var yr="YYYY-MM-DD",Or=Object(a["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:hr},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,startDateInvalid:!1,endDateInvalid:!1}},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){var n=this;setTimeout((function(){"from"===e?n.setStartRangeDateFromStr(t.target.value):n.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;this.startDateInvalid=!0;try{e.length===yr.length&&(t=E(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){var t;this.endDateInvalid=!0;try{e.length===yr.length&&(t=E(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:D(this.fromPickerSelectedDates[0]),end:D(this.toPickerSelectedDates[0])})}}});Or.render=br;var wr=Or; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Wr=function(){function e(){var t=this;Gr(this,e),Qr(this,"state",Object(a["reactive"])({initialSites:[],isInitialized:!1})),Qr(this,"currentRequest",void 0),Qr(this,"limitRequest",void 0),Qr(this,"initialSites",Object(a["computed"])((function(){return Object(a["readonly"])(t.state.initialSites)})))}return Yr(e,[{key:"loadInitialSites",value:function(){var e=this;return this.state.isInitialized?Promise.resolve(Object(a["readonly"])(this.state.initialSites)):this.searchSite("%").then((function(t){return e.state.isInitialized=!0,e.state.initialSites=t,Object(a["readonly"])(t)}))}},{key:"loadSite",value:function(e){"all"===e?we.updateUrl(Jr(Jr({},we.urlParsed.value),{},{module:"MultiSites",action:"index",date:we.parsed.value.date,period:we.parsed.value.period})):we.updateUrl(Jr(Jr({},we.parsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?(this.currentRequest&&this.currentRequest.abort(),this.limitRequest||(this.limitRequest=xe.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(r){var i=r.value,a="SitesManager.getPatternMatchSites";return n&&(a="SitesManager.getSitesWithAdminAccess"),t.currentRequest=xe.fetch({method:a,limit:i,pattern:e}),t.currentRequest})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequest=null}))):this.loadInitialSites()}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Jr(Jr({},e),{},{name:e.group?"[".concat(e.group,"] ").concat(e.name):e.name})})),t.sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()?-1:e.name.toLowerCase()>t.name.toLowerCase()?1:0})),t):[]}}]),e}(),Kr=new Wr,Zr=300;function Xr(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zr;return function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];t&&clearTimeout(t),t=setTimeout((function(){e.apply(void 0,i)}),n)}}function ei(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 ti(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(n),!0).forEach((function(t){ni(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ei(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ni(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ri=Object(a["defineComponent"])({props:{modelValue:{Object:Object,default:{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}},showSelectedSite:{type:Boolean,default:!1},showAllSitesItem:{type:Boolean,default:!0},switchSiteOnSelect:{type:Boolean,default:!0},onlySitesWithAdminAccess:{type:Boolean,default:!1},name:{type:String,default:""},allSitesText:{type:String,default:D("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String},emits:["update:modelValue","blur"],components:{AllSitesLink:Ur},directives:{FocusAnywhereButHere:Fe,FocusIf:qe},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:S.idSite,showSitesList:!1,isLoading:!1,sites:[],selectedSite:this.modelValue||{id:S.idSite,name:S.helper.htmlDecode(S.siteName)},autocompleteMinSites:parseInt(S.config.autocomplete_min_sites,10)}},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.modelValue&&e.modelValue.id||!e.sites[0]||e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=D("CoreHome_ShortcutWebsiteSelector");S.helper.registerShortcut("w",t,(function(t){t.altKey||(t.preventDefault?t.preventDefault():t.returnValue=!1,e.$refs.selectorLink.click(),e.$refs.selectorLink.focus())}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?D("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){return Kr.initialSites.value&&Kr.initialSites.value.length>1},firstSiteName:function(){return this.sites&&this.sites.length>0?this.sites[0].name:""},urlAllSites:function(){var e=we.stringify(ti(ti({},we.urlParsed.value),{},{module:"MultiSites",action:"index",date:we.parsed.value.date,period:we.parsed.value.period}));return"?".concat(e)}},created:function(){this.searchSite=Xr(this.searchSite.bind(this))},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({idsite:"all",name:this.allSitesText},e),this.showSitesList=!1},switchSite:function(e,t){var n=-1!==navigator.userAgent.indexOf("Mac OS X")?t.metaKey:t.ctrlKey;t&&n&&t.target&&t.target.href?window.open(t.target.href,"_blank"):(this.$emit("update:modelValue",{id:e.idsite,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.idsite&&Kr.loadSite(e.idsite))},onBlur:function(){this.showSitesList=!1,this.$emit("blur")},onClickSelector:function(){this.hasMultipleSites&&(this.showSitesList=!this.showSitesList,this.isLoading||this.searchTerm||this.loadInitialSites())},onPressEnter:function(e){"Enter"===e.key&&(e.preventDefault(),this.showSitesList=!this.showSitesList,this.showSitesList&&!this.isLoading&&this.loadInitialSites())},getMatchedSiteName:function(e){var t=e.toUpperCase().indexOf(this.searchTerm.toUpperCase());if(-1===t||this.isLoading)return S.helper.htmlEntities(e);var n=S.helper.htmlEntities(e.substring(0,t)),r=S.helper.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'<span class="autocompleteMatched">').concat(this.searchTerm,"</span>").concat(r)},loadInitialSites:function(){var e=this;return Kr.loadInitialSites().then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,Kr.searchSite(e,this.onlySitesWithAdminAccess).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=we.stringify(ti(ti({},we.urlParsed.value),{},{segment:"",idSite:e})),n=we.stringify(ti(ti({},we.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)}}});ri.render=Rr;var ii=ri;function ai(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 oi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ai(Object(n),!0).forEach((function(t){ci(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ai(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ci(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */Pt({component:wr,scope:{startDate:{angularJsBind:"<"},endDate:{angularJsBind:"<"},rangeChange:{angularJsBind:"&"},submit:{angularJsBind:"&"}},directiveName:"piwikDateRangePicker",restrict:"E"});function jr(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("DatePicker");return Object(a["openBlock"])(),Object(a["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 kr=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay),Sr=new Date(S.maxDateYear,S.maxDateMonth-1,S.maxDateDay),Cr=Object(a["defineComponent"])({props:{period:String,date:[String,Date]},components:{DatePicker:hr},emits:["select"],setup:function(e,t){var n=Object(a["ref"])(e.date),r=Object(a["ref"])([null,null]),i=Object(a["ref"])([null,null]);function o(t){var n=p.get(e.period).parse(t).getDateRange();return n[0]=kr<n[0]?n[0]:kr,n[1]=Sr>n[1]?n[1]:Sr,n}function c(t,n){var r=t<kr||t>Sr,a=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);i.value=r||a?[null,null]:o(t)}function l(){i.value=[null,null]}function s(e){t.emit("select",{date:e})}function u(){if(!e.period||!e.date)return r.value=[null,null],void(n.value=null);r.value=o(e.date),n.value=E(e.date)}return Object(a["watch"])(e,u),u(),{selectedDates:r,highlightedDates:i,viewDate:n,onHoverNormalCell:c,onHoverLeaveNormalCells:l,onDateSelected:s}}});Cr.render=jr;var Dr=Cr,Pr=(Pt({component:Dr,scope:{period:{angularJsBind:"<"},date:{angularJsBind:"<"},select:{angularJsBind:"&"}},directiveName:"piwikPeriodDatePicker",restrict:"E"}),["value","name"]),Er=["title"],Vr=["textContent"],Tr={key:1,class:"placeholder"},Ir={class:"dropdown"},Nr={class:"custom_select_search"},xr=["placeholder"],Ar={key:0},Br={class:"custom_select_container"},Mr=["onClick"],$r=["innerHTML","href","title"],Lr={class:"ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect"},Hr={class:"ui-menu-item"},Rr={class:"ui-corner-all",tabindex:"-1"},Fr={key:1}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */St({component:ii,require:"?ngModel",scope:{showSelectedSite:{angularJsBind:"="},showAllSitesItem:{angularJsBind:"="},switchSiteOnSelect:{angularJsBind:"="},onlySitesWithAdminAccess:{angularJsBind:"="},name:{angularJsBind:"@"},allSitesText:{angularJsBind:"@"},allSitesLocation:{angularJsBind:"@"},placeholder:{angularJsBind:"@"},modelValue:{}},$inject:["$timeout"],directiveName:"piwikSiteselector",events:{"update:modelValue":function(e,t,n,r,i,a,o){(e&&!t.modelValue||!e&&t.modelValue||e.id!==t.modelValue.id)&&o((function(){n.value=e,r.attr("siteid",e.id),r.trigger("change",e),a&&(n.isNotFirstModelChange||t.modelValue)&&(a.$setViewValue(e),a.$render()),n.isNotFirstModelChange=!0}))},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}},postCreate:function(e,t,n,r,i,o){var c=i;t.$watch("value",(function(t){t!==e.modelValue&&(e.modelValue=t)})),c&&(e.modelValue&&c.$setViewValue(e.modelValue),c.$render=function(){Object(a["nextTick"])((function(){angular.isString(c.$viewValue)?e.modelValue=JSON.parse(c.$viewValue):e.modelValue=c.$viewValue}))}),o((function(){r.siteid&&r.sitename&&(e.modelValue={id:r.siteid,name:S.helper.htmlDecode(r.sitename)},c.$setViewValue(oi({},e.modelValue)))}))}});var li={ref:"root",class:"quickAccessInside"},si=["title"],ui={class:"dropdown"},di={class:"no-result"},pi=["onClick"],fi=["onMouseenter","onClick"],mi={class:"quickAccessMatomoSearch"},hi=["onMouseenter","onClick"],gi=["textContent"],vi={class:"quick-access-category helpCategory"},bi=["href"];function yi(e,t,n,r,i,o){var c=Object(a["resolveDirective"])("focus-if"),l=Object(a["resolveDirective"])("focus-anywhere-but-here");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",li,[Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,544),[[a["vShow"],!(e.searchTerm||e.searchActive)]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{class:"s",onKeydown:t[1]||(t[1]=function(t){return e.onKeypress(t)}),onFocus:t[2]||(t[2]=function(t){return e.searchActive=!0}),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.searchTerm=t}),type:"text",tabindex:"2",title:e.quickAccessTitle},null,40,si),[[a["vModelText"],e.searchTerm],[c,{},e.searchActive]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",ui,[Object(a["withDirectives"])(Object(a["createElementVNode"])("ul",null,[Object(a["createElementVNode"])("li",di,Object(a["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[a["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.menuItems,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("ul",{key:t.title},[Object(a["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(a["toDisplayString"])(t.title),9,pi),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(t.items,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{class:Object(a["normalizeClass"])(["result",{selected:t.menuIndex===e.searchIndex}]),onMouseenter:function(n){return e.searchIndex=t.menuIndex},onClick:function(n){return e.selectMenuItem(t.index)},key:t.index},[Object(a["createElementVNode"])("a",null,Object(a["toDisplayString"])(t.name.trim()),1)],42,fi)})),128))])})),128)),Object(a["createElementVNode"])("ul",mi,[Object(a["withDirectives"])(Object(a["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(a["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[a["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("li",{class:"no-result"},Object(a["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[a["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.sites,(function(t,n){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{class:Object(a["normalizeClass"])(["result",{selected:e.numMenuItems+n===e.searchIndex}]),onMouseenter:function(t){return e.searchIndex=e.numMenuItems+n},onClick:function(n){return e.selectSite(t.idsite)},key:t.idsite},[Object(a["createElementVNode"])("a",{textContent:Object(a["toDisplayString"])(t.name)},null,8,gi)],42,hi)),[[a["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(a["createElementVNode"])("ul",null,[Object(a["createElementVNode"])("li",vi,Object(a["toDisplayString"])(e.translate("General_HelpResources")),1),Object(a["createElementVNode"])("li",{class:Object(a["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(a["createElementVNode"])("a",{href:"https://matomo.org?s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(a["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,bi)],34)])],512),[[a["vShow"],e.searchTerm&&e.searchActive]])],512)),[[l,{blur:e.onBlur}]])}function Oi(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 wi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oi(Object(n),!0).forEach((function(t){ji(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ji(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ki(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.$(window).height()&&t.right<=window.$(window).width()}function Si(e){e&&e.scrollIntoView&&e.scrollIntoView()}var Di=Object(a["defineComponent"])({props:{},directives:{FocusAnywhereButHere:Fe,FocusIf:qe},watch:{searchActive:function(e){var t=this.$refs.root.parentElement.classList;t.toggle("active",e),t.toggle("expanded",e)}},mounted:function(){var e=this;this.$refs.root.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),S.helper.registerShortcut("f",D("CoreHome_ShortcutSearch"),(function(t){t.altKey||(t.preventDefault(),Si(e.$refs.root),e.activateSearch())}))},data:function(){var e=!!document.querySelector(".segmentEditorPanel");return{menuItems:[],numMenuItems:0,searchActive:!1,searchTerm:"",searchIndex:0,menuIndexCounter:-1,topMenuItems:null,leftMenuItems:null,segmentItems:null,hasSegmentSelector:e,sites:[],isLoading:!1}},created:function(){this.searchMenu=Xr(this.searchMenu.bind(this))},computed:{hasSitesSelector:function(){return!!document.querySelector(".top_controls [piwik-siteselector]")},quickAccessTitle:function(){var e="",t=[D("CoreHome_MenuEntries")];this.hasSegmentSelector&&t.push(D("CoreHome_Segments")),this.hasSitesSelector&&t.push(D("SitesManager_Sites"));while(t.length)e+=t.shift(),t.length>=2?e+=", ":1===t.length&&(e+=" ".concat(D("General_And")," "));return D("CoreHome_QuickAccessTitle",e)}},emits:["itemSelected","blur"],methods:{onKeypress:function(e){var t=this,n=this.searchTerm&&this.searchActive,r=9===e.which,i=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():r&&n||i&&n?this.deactivateSearch():setTimeout((function(){t.searchActive=!0,t.searchMenu(t.searchTerm)}))},highlightPreviousItem:function(){this.searchIndex-1<0?this.searchIndex=0:this.searchIndex-=1,this.makeSureSelectedItemIsInViewport()},highlightNextItem:function(){var e=this.$refs.root.querySelectorAll("li.result").length;e<=this.searchIndex+1?this.searchIndex=e-1:this.searchIndex+=1,this.makeSureSelectedItemIsInViewport()},clickQuickAccessMenuItem:function(){var e=this,t=this.getCurrentlySelectedElement();t&&setTimeout((function(){t.click(),e.$emit("itemSelected",t)}),20)},deactivateSearch:function(){this.searchTerm="",this.searchActive=!1,this.$refs.root.querySelector("input").blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!ki(e)&&Si(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");return e&&e.length&&e.item(this.searchIndex)?e.item(this.searchIndex):null},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,i={},a=[],o=function(e){var t=wi({},e);r+=1,t.menuIndex=r;var n=t.category;n in i||(a.push({title:n,items:[]}),i[n]=a.length-1);var o=i[n];a[o].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,Kr.searchSite(n).then((function(e){t.sites=e})).finally((function(){t.isLoading=!1})));var c=function(e){return-1!==e.name.toLowerCase().indexOf(n)||-1!==e.category.toLowerCase().indexOf(n)};null===this.topMenuItems&&(this.topMenuItems=this.getTopMenuItems()),null===this.leftMenuItems&&(this.leftMenuItems=this.getLeftMenuItems()),null===this.segmentItems&&(this.segmentItems=this.getSegmentItems());var l=this.topMenuItems.filter(c),s=this.leftMenuItems.filter(c),u=this.segmentItems.filter(c);l.forEach(o),s.forEach(o),u.forEach(o),this.numMenuItems=l.length+s.length+u.length,this.menuItems=a},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){Kr.loadSite(e)},selectMenuItem:function(e){var t=document.querySelector("[quick_access='".concat(e,"']"));if(t){this.deactivateSearch();var n=t.getAttribute("href");if(n&&n.length>10&&t&&t.click)try{t.click()}catch(r){window.$(t).click()}else window.$(t).click()}},onBlur:function(){this.searchActive=!1,this.$emit("blur")},activateSearch:function(){this.searchActive=!0},getTopMenuItems:function(){var e=this,t=D("CoreHome_Menu"),n=[];return document.querySelectorAll("nav .sidenav li > a").forEach((function(r){var i=r.textContent.trim();i||(i=r.getAttribute("title").trim()),i&&(n.push({name:i,index:e.menuIndexCounter+=1,category:t}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n},getLeftMenuItems:function(){var e=this,t=[];return document.querySelectorAll("#secondNavBar .menuTab").forEach((function(n){var r=window.$(n).find("> .item").text().trim();r&&-1!==r.lastIndexOf("\n")&&(r=r.substr(0,r.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,i){var a=i.textContent.trim();a&&(t.push({name:a,category:r,index:e.menuIndexCounter+=1}),i.setAttribute("quick_access","".concat(e.menuIndexCounter)))}))})),t},getSegmentItems:function(){var e=this;if(!this.hasSegmentSelector)return[];var t=D("CoreHome_Segments"),n=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach((function(r){var i=r.querySelector(".segname").textContent.trim();i&&(n.push({name:i,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});Di.render=yi;var Ci=Di; + */function _r(e,t,n,r,i,o){var c,l,s,u,d=Object(a["resolveComponent"])("AllSitesLink"),p=Object(a["resolveDirective"])("focus-if"),f=Object(a["resolveDirective"])("focus-anywhere-but-here");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(a["openBlock"])(),Object(a["createElementBlock"])("input",{key:0,type:"hidden",value:null===(c=e.modelValue)||void 0===c?void 0:c.id,name:e.name},null,8,Pr)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("a",{ref:"selectorLink",onClick:t[0]||(t[0]=function(){return e.onClickSelector&&e.onClickSelector.apply(e,arguments)}),onKeydown:t[1]||(t[1]=function(t){return e.onPressEnter(t)}),href:"javascript:void(0)",class:Object(a["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(a["createElementVNode"])("span",{class:Object(a["normalizeClass"])(["icon icon-arrow-bottom",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(a["createElementVNode"])("span",null,[null!==(l=e.modelValue)&&void 0!==l&&l.name||!e.placeholder?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",{key:0,textContent:Object(a["toDisplayString"])((null===(s=e.modelValue)||void 0===s?void 0:s.name)||e.firstSiteName)},null,8,Vr)):Object(a["createCommentVNode"])("",!0),null!==(u=e.modelValue)&&void 0!==u&&u.name||!e.placeholder?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Tr,Object(a["toDisplayString"])(e.placeholder),1))])],42,Er),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Ir,[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Nr,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text",onClick:t[2]||(t[2]=function(t){e.searchTerm="",e.loadInitialSites()}),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.searchTerm=t}),tabindex:"4",class:"websiteSearch inp browser-default",placeholder:e.translate("General_Search")},null,8,xr),[[a["vModelText"],e.searchTerm],[p,{},e.shouldFocusOnSearch]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("img",{title:"Clear",onClick:t[4]||(t[4]=function(t){e.searchTerm="",e.loadInitialSites()}),class:"reset",src:"plugins/CoreHome/images/reset_search.png"},null,512),[[a["vShow"],e.searchTerm]])],512),[[a["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ar,[Object(a["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[5]||(t[5]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",Br,[Object(a["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.sites,(function(n,r){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{onClick:function(t){return e.switchSite(n,t)},key:r},[Object(a["createElementVNode"])("a",{onClick:t[6]||(t[6]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.getMatchedSiteName(n.name)),tabindex:"4",href:e.getUrlForSiteId(n.idsite),title:n.name},null,8,$r)],8,Mr)),[[a["vShow"],!(!e.showSelectedSite&&e.activeSiteId===n.idsite)]])})),128))]),Object(a["withDirectives"])(Object(a["createElementVNode"])("ul",Lr,[Object(a["createElementVNode"])("li",Hr,[Object(a["createElementVNode"])("a",Rr,Object(a["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[a["vShow"],!e.sites.length&&e.searchTerm]])]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Fr,[Object(a["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[8]||(t[8]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(a["createCommentVNode"])("",!0)],512),[[a["vShow"],e.showSitesList]])],2)),[[f,{blur:e.onBlur}]])}var Ur=["innerHTML","href"];function qr(e,t,n,r,i,o){var c=this;return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return c.onClick(e)}),class:"custom_select_all"},[Object(a["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Ur)])}var Jr=Object(a["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});Jr.render=qr;var Gr=Jr;function zr(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 Yr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zr(Object(n),!0).forEach((function(t){Xr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kr(e,t,n){return t&&Wr(e.prototype,t),n&&Wr(e,n),e}function Xr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */St({component:Ci,directiveName:"piwikQuickAccess",events:{itemSelected:function(e,t,n,r,i,a,o){o()},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}}});function Pi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ei={class:"fieldArray form-group"},Vi={key:0,class:"fieldUiControl"},Ti=["onClick","title"];function Ii(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("Field");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ei,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.modelValue,(function(t,n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",Pi({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Vi,[Object(a["createVNode"])(c,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n)},null,8,["model-value","options","onUpdate:modelValue","uicontrol","title","name"])])):Object(a["createCommentVNode"])("",!0),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Ti),[[a["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function xi(e){return Mi(e)||Bi(e)||Ai(e)||Ni()}function Ni(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ai(e,t){if(e){if("string"===typeof e)return $i(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)?$i(e,t):void 0}}function Bi(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Mi(e){if(Array.isArray(e))return $i(e)}function $i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Li=Ut("CorePluginsAdmin","Field"),Ri=Object(a["defineComponent"])({props:{modelValue:Array,name:String,field:Object},components:{Field:Li},emits:["update:modelValue"],watch:{modelValue:function(e){this.checkEmptyModelValue(e)}},mounted:function(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue:function(e){e&&e.length&&""===e.slice(-1)[0]||this.$emit("update:modelValue",[].concat(xi(e||[]),[""]))},onEntryChange:function(e,t){var n=xi(this.modelValue);n[t]=e,this.$emit("update:modelValue",n)},removeEntry:function(e){if(e>-1){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});Ri.render=Ii;var Hi=Ri; + */var Zr=function(){function e(){var t=this;Qr(this,e),Xr(this,"state",Object(a["reactive"])({initialSites:[],isInitialized:!1})),Xr(this,"currentRequest",void 0),Xr(this,"limitRequest",void 0),Xr(this,"initialSites",Object(a["computed"])((function(){return Object(a["readonly"])(t.state.initialSites)})))}return Kr(e,[{key:"loadInitialSites",value:function(){var e=this;return this.state.isInitialized?Promise.resolve(Object(a["readonly"])(this.state.initialSites)):this.searchSite("%").then((function(t){return e.state.isInitialized=!0,e.state.initialSites=t,Object(a["readonly"])(t)}))}},{key:"loadSite",value:function(e){"all"===e?we.updateUrl(Yr(Yr({},we.urlParsed.value),{},{module:"MultiSites",action:"index",date:we.parsed.value.date,period:we.parsed.value.period})):we.updateUrl(Yr(Yr({},we.parsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?(this.currentRequest&&this.currentRequest.abort(),this.limitRequest||(this.limitRequest=Ne.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(r){var i=r.value,a="SitesManager.getPatternMatchSites";return n&&(a="SitesManager.getSitesWithAdminAccess"),t.currentRequest=Ne.fetch({method:a,limit:i,pattern:e}),t.currentRequest})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequest=null}))):this.loadInitialSites()}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Yr(Yr({},e),{},{name:e.group?"[".concat(e.group,"] ").concat(e.name):e.name})})),t.sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()?-1:e.name.toLowerCase()>t.name.toLowerCase()?1:0})),t):[]}}]),e}(),ei=new Zr,ti=300;function ni(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ti;return function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];t&&clearTimeout(t),t=setTimeout((function(){e.apply(void 0,i)}),n)}}function ri(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 ii(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ri(Object(n),!0).forEach((function(t){ai(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ri(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ai(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oi=Object(a["defineComponent"])({props:{modelValue:{Object:Object,default:function(e){return e.modelValue?e.modelValue:S.idSite?{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}:void 0}},showSelectedSite:{type:Boolean,default:!1},showAllSitesItem:{type:Boolean,default:!0},switchSiteOnSelect:{type:Boolean,default:!0},onlySitesWithAdminAccess:{type:Boolean,default:!1},name:{type:String,default:""},allSitesText:{type:String,default:C("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String},emits:["update:modelValue","blur"],components:{AllSitesLink:Gr},directives:{FocusAnywhereButHere:Fe,FocusIf:qe},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:S.idSite,showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(S.config.autocomplete_min_sites,10)}},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.modelValue&&e.modelValue.id||e.hasMultipleSites||!e.sites[0]||e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=C("CoreHome_ShortcutWebsiteSelector");S.helper.registerShortcut("w",t,(function(t){t.altKey||(t.preventDefault?t.preventDefault():t.returnValue=!1,e.$refs.selectorLink.click(),e.$refs.selectorLink.focus())}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?C("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){return ei.initialSites.value&&ei.initialSites.value.length>1},firstSiteName:function(){var e=ei.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=we.stringify(ii(ii({},we.urlParsed.value),{},{module:"MultiSites",action:"index",date:we.parsed.value.date,period:we.parsed.value.period}));return"?".concat(e)}},created:function(){this.searchSite=ni(this.searchSite.bind(this))},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({idsite:"all",name:this.allSitesText},e),this.showSitesList=!1},switchSite:function(e,t){var n=-1!==navigator.userAgent.indexOf("Mac OS X")?t.metaKey:t.ctrlKey;t&&n&&t.target&&t.target.href?window.open(t.target.href,"_blank"):(this.$emit("update:modelValue",{id:e.idsite,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.idsite&&ei.loadSite(e.idsite))},onBlur:function(){this.showSitesList=!1,this.$emit("blur")},onClickSelector:function(){this.hasMultipleSites&&(this.showSitesList=!this.showSitesList,this.isLoading||this.searchTerm||this.loadInitialSites())},onPressEnter:function(e){"Enter"===e.key&&(e.preventDefault(),this.showSitesList=!this.showSitesList,this.showSitesList&&!this.isLoading&&this.loadInitialSites())},getMatchedSiteName:function(e){var t=e.toUpperCase().indexOf(this.searchTerm.toUpperCase());if(-1===t||this.isLoading)return S.helper.htmlEntities(e);var n=S.helper.htmlEntities(e.substring(0,t)),r=S.helper.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'<span class="autocompleteMatched">').concat(this.searchTerm,"</span>").concat(r)},loadInitialSites:function(){var e=this;return ei.loadInitialSites().then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,ei.searchSite(e,this.onlySitesWithAdminAccess).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=we.stringify(ii(ii({},we.urlParsed.value),{},{segment:"",idSite:e})),n=we.stringify(ii(ii({},we.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)}}});oi.render=_r;var ci=oi,li=(Pt({component:ci,require:"?ngModel",scope:{showSelectedSite:{angularJsBind:"="},showAllSitesItem:{angularJsBind:"="},switchSiteOnSelect:{angularJsBind:"="},onlySitesWithAdminAccess:{angularJsBind:"="},name:{angularJsBind:"@"},allSitesText:{angularJsBind:"@"},allSitesLocation:{angularJsBind:"@"},placeholder:{angularJsBind:"@"},modelValue:{default:function(e,t,n){return n.siteid&&n.sitename?{id:n.siteid,name:S.helper.htmlDecode(n.sitename)}:S.idSite?{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}:void 0}}},$inject:["$timeout"],directiveName:"piwikSiteselector",events:{"update:modelValue":function(e,t,n,r,i,a,o){(e&&!t.modelValue||!e&&t.modelValue||e.id!==t.modelValue.id)&&o((function(){n.value=e,r.attr("siteid",e.id),r.trigger("change",e),a&&(a.$setViewValue(e),a.$render())}))},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}},postCreate:function(e,t,n,r,i){var o=i;t.$watch("value",(function(t){Object(a["nextTick"])((function(){t!==e.modelValue&&(e.modelValue=t)}))})),o&&(o.$setViewValue(e.modelValue),o.$render=function(){Object(a["nextTick"])((function(){Object(a["nextTick"])((function(){angular.isString(o.$viewValue)?e.modelValue=JSON.parse(o.$viewValue):e.modelValue=o.$viewValue}))}))})}}),{ref:"root",class:"quickAccessInside"}),si=["title"],ui={class:"dropdown"},di={class:"no-result"},pi=["onClick"],fi=["onMouseenter","onClick"],mi={class:"quickAccessMatomoSearch"},hi=["onMouseenter","onClick"],gi=["textContent"],vi={class:"quick-access-category helpCategory"},bi=["href"]; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */St({component:Hi,require:"?ngModel",scope:{name:{angularJsBind:"="},field:{angularJsBind:"="}},directiveName:"matomoFieldArray",events:{"update:modelValue":function(e,t,n,r,i,a){e!==t.modelValue&&(r.trigger("change",e),a&&a.$setViewValue(e))}},postCreate:function(e,t,n,r,i){var a=i;a&&(a.$setViewValue(e.modelValue),a.$render=function(){angular.isString(a.$viewValue)?e.modelValue=JSON.parse(a.$viewValue):e.modelValue=a.$viewValue})}});function Fi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _i={class:"multiPairField form-group"},Ui={key:1,class:"fieldUiControl fieldUiControl2"},qi={key:2,class:"fieldUiControl fieldUiControl3"},Ji={key:3,class:"fieldUiControl fieldUiControl4"},Gi=["onClick","title"];function zi(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("Field");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",_i,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.modelValue,(function(t,n){var r;return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},Fi(r,"multiPairFieldTable".concat(n),!0),Fi(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{key:0,class:Object(a["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(a["createVNode"])(c,{"full-width":!0,modelValue:t[e.field1.key],"onUpdate:modelValue":[function(n){return t[e.field1.key]=n},function(t){return e.onEntryChange(n,e.field1.key,t)}],options:e.field1.availableValues,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title},null,8,["modelValue","onUpdate:modelValue","options","uicontrol","name","title"])],2)):Object(a["createCommentVNode"])("",!0),e.field2?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ui,[Object(a["createVNode"])(c,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field2.key,t)},function(n){return t[e.field2.key]=n}],modelValue:t[e.field2.key],placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","name","title"])])):Object(a["createCommentVNode"])("",!0),e.field3?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",qi,[Object(a["createVNode"])(c,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field3.key,t)},function(n){return t[e.field3.key]=n}],modelValue:t[e.field3.key],placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","title"])])):Object(a["createCommentVNode"])("",!0),e.field4?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ji,[Object(a["createVNode"])(c,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field4.key,t)},function(n){return t[e.field4.key]=n}],modelValue:t[e.field4.key],placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","title"])])):Object(a["createCommentVNode"])("",!0),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Gi),[[a["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function Yi(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 Qi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yi(Object(n),!0).forEach((function(t){Wi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ki(e){return ta(e)||ea(e)||Xi(e)||Zi()}function Zi(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Xi(e,t){if(e){if("string"===typeof e)return na(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)?na(e,t):void 0}}function ea(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ta(e){if(Array.isArray(e))return na(e)}function na(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ra=Ut("CorePluginsAdmin","Field"),ia=Object(a["defineComponent"])({props:{modelValue:Array,name:String,field1:Object,field2:Object,field3:Object,field4:Object},components:{Field:ra},computed:{fieldCount:function(){return this.field1&&this.field2&&this.field3&&this.field4?4:this.field1&&this.field2&&this.field3?3:this.field1&&this.field2?2:this.field1?1:0}},emits:["update:modelValue"],watch:{modelValue:function(e){this.checkEmptyModelValue(e)}},mounted:function(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue:function(e){e&&e.length&&!this.isEmptyValue(e.slice(-1)[0])||this.$emit("update:modelValue",[].concat(Ki(e||[]),[this.makeEmptyValue()]))},onEntryChange:function(e,t,n){var r=Ki(this.modelValue);r[e]=Qi(Qi({},r[e]),{},Wi({},t,n)),this.$emit("update:modelValue",r)},removeEntry:function(e){if(e>-1){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}},isEmptyValue:function(e){var t=this.fieldCount;if(4===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key]&&!e[this.field4.key])return!1}else if(3===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key])return!1}else if(2===t){if(!e[this.field1.key]&&!e[this.field2.key])return!1}else if(1===t&&!e[this.field1.key])return!1;return!0},makeEmptyValue:function(){var e={};return this.field1&&this.field1.key&&(e[this.field1.key]=""),this.field2&&this.field2.key&&(e[this.field2.key]=""),this.field3&&this.field3.key&&(e[this.field3.key]=""),this.field4&&this.field4.key&&(e[this.field4.key]=""),e}}});ia.render=zi;var aa=ia,oa=(St({component:aa,require:"?ngModel",scope:{name:{angularJsBind:"="},field1:{angularJsBind:"="},field2:{angularJsBind:"="},field3:{angularJsBind:"="},field4:{angularJsBind:"="}},directiveName:"matomoMultiPairField",events:{"update:modelValue":function(e,t,n,r,i,a){e!==t.modelValue&&(r.trigger("change",e),a&&a.$setViewValue(e))}},postCreate:function(e,t,n,r,i){var a=i;a&&(a.$setViewValue(e.modelValue),a.$render=function(){angular.isString(a.$viewValue)?e.modelValue=JSON.parse(a.$viewValue):e.modelValue=a.$viewValue})}}),{ref:"root",class:"periodSelector piwikSelector"}),ca=["title"],la=Object(a["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),sa={id:"periodMore",class:"dropdown"},ua={class:"flex"},da={key:0,class:"period-date"},pa={class:"period-type"},fa={id:"otherPeriods"},ma=["onDblclick","title"],ha=["id","checked","onChange","onDblclick"],ga={key:0,class:"compare-checkbox"},va={id:"comparePeriodToDropdown"},ba={key:1,class:"compare-date-range"},ya={id:"comparePeriodStartDate"},Oa=Object(a["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),wa={id:"comparePeriodEndDate"},ja={class:"apply-button-container"},ka=["disabled","value"],Sa={key:2,id:"ajaxLoadingCalendar"},Da={class:"loadingSegment"}; + */function yi(e,t,n,r,i,o){var c=Object(a["resolveDirective"])("focus-if"),l=Object(a["resolveDirective"])("focus-anywhere-but-here");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",li,[Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,544),[[a["vShow"],!(e.searchTerm||e.searchActive)]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{class:"s",onKeydown:t[1]||(t[1]=function(t){return e.onKeypress(t)}),onFocus:t[2]||(t[2]=function(t){return e.searchActive=!0}),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.searchTerm=t}),type:"text",tabindex:"2",title:e.quickAccessTitle},null,40,si),[[a["vModelText"],e.searchTerm],[c,{},e.searchActive]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",ui,[Object(a["withDirectives"])(Object(a["createElementVNode"])("ul",null,[Object(a["createElementVNode"])("li",di,Object(a["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[a["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.menuItems,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("ul",{key:t.title},[Object(a["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(a["toDisplayString"])(t.title),9,pi),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(t.items,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{class:Object(a["normalizeClass"])(["result",{selected:t.menuIndex===e.searchIndex}]),onMouseenter:function(n){return e.searchIndex=t.menuIndex},onClick:function(n){return e.selectMenuItem(t.index)},key:t.index},[Object(a["createElementVNode"])("a",null,Object(a["toDisplayString"])(t.name.trim()),1)],42,fi)})),128))])})),128)),Object(a["createElementVNode"])("ul",mi,[Object(a["withDirectives"])(Object(a["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(a["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[a["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("li",{class:"no-result"},Object(a["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[a["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.sites,(function(t,n){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{class:Object(a["normalizeClass"])(["result",{selected:e.numMenuItems+n===e.searchIndex}]),onMouseenter:function(t){return e.searchIndex=e.numMenuItems+n},onClick:function(n){return e.selectSite(t.idsite)},key:t.idsite},[Object(a["createElementVNode"])("a",{textContent:Object(a["toDisplayString"])(t.name)},null,8,gi)],42,hi)),[[a["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(a["createElementVNode"])("ul",null,[Object(a["createElementVNode"])("li",vi,Object(a["toDisplayString"])(e.translate("General_HelpResources")),1),Object(a["createElementVNode"])("li",{class:Object(a["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(a["createElementVNode"])("a",{href:"https://matomo.org?s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(a["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,bi)],34)])],512),[[a["vShow"],e.searchTerm&&e.searchActive]])],512)),[[l,{blur:e.onBlur}]])}function Oi(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 wi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oi(Object(n),!0).forEach((function(t){ji(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ji(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ki(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.$(window).height()&&t.right<=window.$(window).width()}function Si(e){e&&e.scrollIntoView&&e.scrollIntoView()}var Ci=Object(a["defineComponent"])({props:{},directives:{FocusAnywhereButHere:Fe,FocusIf:qe},watch:{searchActive:function(e){var t=this.$refs.root.parentElement.classList;t.toggle("active",e),t.toggle("expanded",e)}},mounted:function(){var e=this;this.$refs.root.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),S.helper.registerShortcut("f",C("CoreHome_ShortcutSearch"),(function(t){t.altKey||(t.preventDefault(),Si(e.$refs.root),e.activateSearch())}))},data:function(){var e=!!document.querySelector(".segmentEditorPanel");return{menuItems:[],numMenuItems:0,searchActive:!1,searchTerm:"",searchIndex:0,menuIndexCounter:-1,topMenuItems:null,leftMenuItems:null,segmentItems:null,hasSegmentSelector:e,sites:[],isLoading:!1}},created:function(){this.searchMenu=ni(this.searchMenu.bind(this))},computed:{hasSitesSelector:function(){return!!document.querySelector(".top_controls [piwik-siteselector]")},quickAccessTitle:function(){var e="",t=[C("CoreHome_MenuEntries")];this.hasSegmentSelector&&t.push(C("CoreHome_Segments")),this.hasSitesSelector&&t.push(C("SitesManager_Sites"));while(t.length)e+=t.shift(),t.length>=2?e+=", ":1===t.length&&(e+=" ".concat(C("General_And")," "));return C("CoreHome_QuickAccessTitle",e)}},emits:["itemSelected","blur"],methods:{onKeypress:function(e){var t=this,n=this.searchTerm&&this.searchActive,r=9===e.which,i=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():r&&n||i&&n?this.deactivateSearch():setTimeout((function(){t.searchActive=!0,t.searchMenu(t.searchTerm)}))},highlightPreviousItem:function(){this.searchIndex-1<0?this.searchIndex=0:this.searchIndex-=1,this.makeSureSelectedItemIsInViewport()},highlightNextItem:function(){var e=this.$refs.root.querySelectorAll("li.result").length;e<=this.searchIndex+1?this.searchIndex=e-1:this.searchIndex+=1,this.makeSureSelectedItemIsInViewport()},clickQuickAccessMenuItem:function(){var e=this,t=this.getCurrentlySelectedElement();t&&setTimeout((function(){t.click(),e.$emit("itemSelected",t)}),20)},deactivateSearch:function(){this.searchTerm="",this.searchActive=!1,this.$refs.root.querySelector("input").blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!ki(e)&&Si(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");return e&&e.length&&e.item(this.searchIndex)?e.item(this.searchIndex):null},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,i={},a=[],o=function(e){var t=wi({},e);r+=1,t.menuIndex=r;var n=t.category;n in i||(a.push({title:n,items:[]}),i[n]=a.length-1);var o=i[n];a[o].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,ei.searchSite(n).then((function(e){t.sites=e})).finally((function(){t.isLoading=!1})));var c=function(e){return-1!==e.name.toLowerCase().indexOf(n)||-1!==e.category.toLowerCase().indexOf(n)};null===this.topMenuItems&&(this.topMenuItems=this.getTopMenuItems()),null===this.leftMenuItems&&(this.leftMenuItems=this.getLeftMenuItems()),null===this.segmentItems&&(this.segmentItems=this.getSegmentItems());var l=this.topMenuItems.filter(c),s=this.leftMenuItems.filter(c),u=this.segmentItems.filter(c);l.forEach(o),s.forEach(o),u.forEach(o),this.numMenuItems=l.length+s.length+u.length,this.menuItems=a},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){ei.loadSite(e)},selectMenuItem:function(e){var t=document.querySelector("[quick_access='".concat(e,"']"));if(t){this.deactivateSearch();var n=t.getAttribute("href");if(n&&n.length>10&&t&&t.click)try{t.click()}catch(r){window.$(t).click()}else window.$(t).click()}},onBlur:function(){this.searchActive=!1,this.$emit("blur")},activateSearch:function(){this.searchActive=!0},getTopMenuItems:function(){var e=this,t=C("CoreHome_Menu"),n=[];return document.querySelectorAll("nav .sidenav li > a").forEach((function(r){var i=r.textContent.trim();i||(i=r.getAttribute("title").trim()),i&&(n.push({name:i,index:e.menuIndexCounter+=1,category:t}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n},getLeftMenuItems:function(){var e=this,t=[];return document.querySelectorAll("#secondNavBar .menuTab").forEach((function(n){var r=window.$(n).find("> .item");r=r[0]?r[0].innerText.trim():"",r&&-1!==r.lastIndexOf("\n")&&(r=r.substr(0,r.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,i){var a=i.textContent.trim();a&&(t.push({name:a,category:r,index:e.menuIndexCounter+=1}),i.setAttribute("quick_access","".concat(e.menuIndexCounter)))}))})),t},getSegmentItems:function(){var e=this;if(!this.hasSegmentSelector)return[];var t=C("CoreHome_Segments"),n=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach((function(r){var i=r.querySelector(".segname").textContent.trim();i&&(n.push({name:i,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});Ci.render=yi;var Di=Ci; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Ca(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("DateRangePicker"),l=Object(a["resolveComponent"])("PeriodDatePicker"),s=Object(a["resolveComponent"])("Field"),u=Object(a["resolveComponent"])("ActivityIndicator"),d=Object(a["resolveDirective"])("expand-on-click");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",oa,[Object(a["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[la,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.currentlyViewingText),1)],8,ca),Object(a["createElementVNode"])("div",sa,[Object(a["createElementVNode"])("div",ua,[Object(a["createElementVNode"])("div",null,[Object(a["withDirectives"])(Object(a["createVNode"])(c,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[0]||(t[0]=function(t){return e.onRangeChange(t.start,t.end)}),onSubmit:t[1]||(t[1]=function(t){return e.onApplyClicked()})},null,8,["start-date","end-date"]),[[a["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",da,[Object(a["createVNode"])(l,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[2]||(t[2]=function(t){return e.setPiwikPeriodAndDate(e.selectedPeriod,t.date)})},null,8,["period","date"])])):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("div",pa,[Object(a["createElementVNode"])("h6",null,Object(a["toDisplayString"])(e.translate("General_Period")),1),Object(a["createElementVNode"])("div",fa,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.periodsFiltered,(function(n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("p",{key:n},[Object(a["createElementVNode"])("label",{class:Object(a["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_".concat(n),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.selectedPeriod=t}),checked:e.selectedPeriod===n,onChange:function(t){return e.selectedPeriod=n},onDblclick:function(t){return e.changeViewedPeriod(n)}},null,40,ha),[[a["vModelRadio"],e.selectedPeriod]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,ma)])})),128))])])]),e.isComparisonEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",ga,[Object(a["createElementVNode"])("label",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.isComparing=t})},null,512),[[a["vModelCheckbox"],e.isComparing]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(a["createElementVNode"])("div",va,[Object(a["createVNode"])(s,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.comparePeriodType=t}),style:Object(a["normalizeStyle"])({visibility:e.isComparing?"visible":"hidden"}),name:"comparePeriodToDropdown",uicontrol:"select",options:e.comparePeriodDropdownOptions,"full-width":!0,disabled:!e.isComparing},null,8,["modelValue","style","options","disabled"])])])):Object(a["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",ba,[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",ya,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(s,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.compareStartDate=t}),name:"comparePeriodStartDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_StartDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])]),Oa,Object(a["createElementVNode"])("div",wa,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(s,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.compareEndDate=t}),name:"comparePeriodEndDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_EndDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])])])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",ja,[Object(a["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[8]||(t[8]=function(t){return e.onApplyClicked()}),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,ka)]),e.isLoadingNewPage?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Sa,[Object(a["createVNode"])(u,{loading:!0}),Object(a["createElementVNode"])("div",Da,Object(a["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(a["createCommentVNode"])("",!0)])],512)),[[d,{expander:"title"}]])}var Pa={class:"loadingPiwik"},Ea=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function Va(e,t,n,r,i,o){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Pa,[Ea,Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.loadingMessage),1)],512)),[[a["vShow"],e.loading]])}var Ta=Object(a["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:D("General_LoadingData")}}});Ta.render=Va;var Ia=Ta;function xa(e,t){return $a(e)||Ma(e,t)||Aa(e,t)||Na()}function Na(){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 Aa(e,t){if(e){if("string"===typeof e)return Ba(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)?Ba(e,t):void 0}}function Ba(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ma(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,c=!1;try{for(n=n.call(e);!(o=(r=n.next()).done);o=!0)if(a.push(r.value),t&&a.length===t)break}catch(l){c=!0,i=l}finally{try{o||null==n["return"]||n["return"]()}finally{if(c)throw i}}return a}}function $a(e){if(Array.isArray(e))return e}function La(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 Ra(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?La(Object(n),!0).forEach((function(t){Ha(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):La(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ha(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Fa=Ut("CorePluginsAdmin","Field"),_a=S.helper.htmlDecode(" "),Ua=[{key:"custom",value:D("General_Custom")},{key:"previousPeriod",value:D("General_PreviousPeriod").replace(/\s+/,_a)},{key:"previousYear",value:D("General_PreviousYear").replace(/\s+/,_a)}],qa=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay),Ja=new Date(S.maxDateYear,S.maxDateMonth-1,S.maxDateDay);function Ga(e){return"[object Date]"===Object.prototype.toString.call(e)&&!Number.isNaN(e.getTime())}var za=Object(a["defineComponent"])({props:{periods:Array},components:{DateRangePicker:br,PeriodDatePicker:kr,Field:Fa,ActivityIndicator:Ia},directives:{ExpandOnClick:et},data:function(){return{comparePeriodDropdownOptions:Ua,periodValue:null,dateValue:null,selectedPeriod:null,startRangeDate:null,endRangeDate:null,isRangeValid:null,isLoadingNewPage:!1,isComparing:null,comparePeriodType:"previousPeriod",compareStartDate:"",compareEndDate:""}},mounted:function(){var e=this;S.on("hidePeriodSelector",(function(){window.$(e.$refs.root).hide()})),S.on("piwikPageChange",(function(){window.$(e.$refs.root).show()})),this.updateSelectedValuesFromHash(),Object(a["watch"])((function(){return we.parsed.value}),this.updateSelectedValuesFromHash),this.isComparing=Dn.isComparing(),Object(a["watch"])((function(){return Dn.isComparing()}),(function(t){e.isComparing=t})),window.initTopControls(),this.handleZIndexPositionRelativeCompareDropdownIssue()},computed:{currentlyViewingText:function(){var e;if("range"===this.periodValue){if(!this.startRangeDate||!this.endRangeDate)return D("General_Error");e="".concat(this.startRangeDate,",").concat(this.endRangeDate)}else{if(!this.dateValue)return D("General_Error");e=C(this.dateValue)}try{return p.parse(this.periodValue,e).getPrettyString()}catch(t){return D("General_Error")}},isComparisonEnabled:function(){return Dn.isComparisonEnabled()},periodsFiltered:function(){return(this.periods||[]).filter((function(e){return p.isRecognizedPeriod(e)}))},selectedComparisonParams:function(){if(!this.isComparing)return{};if("custom"===this.comparePeriodType)return{comparePeriods:["range"],compareDates:["".concat(this.compareStartDate,",").concat(this.compareEndDate)]};if("previousPeriod"===this.comparePeriodType)return{comparePeriods:[this.selectedPeriod],compareDates:[this.previousPeriodDateToSelectedPeriod]};if("previousYear"===this.comparePeriodType){var e="range"===this.selectedPeriod?"".concat(this.startRangeDate,",").concat(this.endRangeDate):this.dateValue,t=p.parse(this.selectedPeriod,e).getDateRange();return t[0].setFullYear(t[0].getFullYear()-1),t[1].setFullYear(t[1].getFullYear()-1),"range"===this.selectedPeriod?{comparePeriods:["range"],compareDates:["".concat(C(t[0]),",").concat(C(t[1]))]}:{comparePeriods:[this.selectedPeriod],compareDates:[C(t[0])]}}return console.warn("Unknown compare period type: ".concat(this.comparePeriodType)),{}},previousPeriodDateToSelectedPeriod:function(){if("range"===this.selectedPeriod){var e=E(this.startRangeDate),t=E(this.endRangeDate),n=F.getLastNRange("day",2,e).startDate,r=Math.floor((t-e)/864e5),i=F.getLastNRange("day",1+r,n);return"".concat(C(i.startDate),",").concat(C(i.endDate))}var a=F.getLastNRange(this.selectedPeriod,2,this.dateValue).startDate;return C(a)},selectedDateString:function(){if("range"===this.selectedPeriod){var e=this.startRangeDate,t=this.endRangeDate,n=E(e),r=E(t);return!Ga(n)||!Ga(r)||n>r?(window.$("#alert").find("h2").text(D("General_InvalidDateRange")),S.helper.modalConfirm("#alert",{}),null):"".concat(e,",").concat(t)}return C(this.dateValue)}},methods:{handleZIndexPositionRelativeCompareDropdownIssue:function(){var e=window.$(this.$refs.root);e.on("focus","#comparePeriodToDropdown .select-dropdown",(function(){e.addClass("compare-dropdown-open")})).on("blur","#comparePeriodToDropdown .select-dropdown",(function(){e.removeClass("compare-dropdown-open")}))},changeViewedPeriod:function(){this.period!==this.periodValue&&"range"!==this.period&&this.setPiwikPeriodAndDate(this.period,this.dateValue)},setPiwikPeriodAndDate:function(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;var n=C(t);this.setRangeStartEndFromPeriod(e,n),this.propagateNewUrlParams(n,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams:function(e,t){var n,r=this.selectedComparisonParams;S.helper.isAngularRenderingThePage()?(this.closePeriodSelector(),n=we.hashParsed.value):(this.isLoadingNewPage=!0,n=we.parsed.value);var i=Ra({},n);delete i.comparePeriods,delete i.compareSegments,delete i.compareDates,we.updateLocation(Ra(Ra({},i),{},{date:e,period:t},r))},onApplyClicked:function(){if("range"===this.selectedPeriod){var e=this.selectedDateString;if(!e)return;return this.periodValue="range",void this.propagateNewUrlParams(e,"range")}this.setPiwikPeriodAndDate(this.selectedPeriod,this.dateValue)},updateSelectedValuesFromHash:function(){var e=we.parsed.value,t=e.date,n=e.period;this.periodValue=n,this.selectedPeriod=n,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{p.parse(n,t)}catch(l){return}if("range"===n){var r=p.get(n).parse(t),i=r.getDateRange(),a=xa(i,2),o=a[0],c=a[1];this.dateValue=o,this.startRangeDate=C(o),this.endRangeDate=C(c)}else this.dateValue=E(t),this.setRangeStartEndFromPeriod(n,t)},setRangeStartEndFromPeriod:function(e,t){var n=p.parse(e,t).getDateRange();this.startRangeDate=C(n[0]<qa?qa:n[0]),this.endRangeDate=C(n[1]>Ja?Ja:n[1])},getPeriodDisplayText:function(e){return p.get(e).getDisplayText()},onRangeChange:function(e,t){e&&t?(this.isRangeValid=!0,this.startRangeDate=e,this.endRangeDate=t):this.isRangeValid=!1},isApplyEnabled:function(){return!("range"===this.selectedPeriod&&!this.isRangeValid)&&!(this.isComparing&&"custom"===this.comparePeriodType&&!this.isCompareRangeValid())},closePeriodSelector:function(){this.$refs.root.classList.remove("expanded")},isCompareRangeValid:function(){try{E(this.compareStartDate)}catch(e){return!1}try{E(this.compareEndDate)}catch(e){return!1}return!0}}});za.render=Ca;var Ya=za; + */Pt({component:Di,directiveName:"piwikQuickAccess",events:{itemSelected:function(e,t,n,r,i,a,o){o()},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}}});function Pi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ei={class:"fieldArray form-group"},Vi={key:0,class:"fieldUiControl"},Ti=["onClick","title"];function Ii(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("Field");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ei,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.modelValue,(function(t,n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",Pi({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Vi,[Object(a["createVNode"])(c,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n)},null,8,["model-value","options","onUpdate:modelValue","uicontrol","title","name"])])):Object(a["createCommentVNode"])("",!0),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Ti),[[a["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function Ni(e){return Mi(e)||Bi(e)||Ai(e)||xi()}function xi(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ai(e,t){if(e){if("string"===typeof e)return $i(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)?$i(e,t):void 0}}function Bi(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Mi(e){if(Array.isArray(e))return $i(e)}function $i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Li=Gt("CorePluginsAdmin","Field"),Hi=Object(a["defineComponent"])({props:{modelValue:Array,name:String,field:Object},components:{Field:Li},emits:["update:modelValue"],watch:{modelValue:function(e){this.checkEmptyModelValue(e)}},mounted:function(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue:function(e){e&&e.length&&""===e.slice(-1)[0]||this.$emit("update:modelValue",[].concat(Ni(e||[]),[""]))},onEntryChange:function(e,t){var n=Ni(this.modelValue);n[t]=e,this.$emit("update:modelValue",n)},removeEntry:function(e){if(e>-1){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});Hi.render=Ii;var Ri=Hi; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */St({component:Ya,scope:{periods:{angularJsBind:"<"}},directiveName:"piwikPeriodSelector"});function Qa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ka(e,t,n){return t&&Wa(e.prototype,t),n&&Wa(e,n),e}function Za(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */Pt({component:Ri,require:"?ngModel",scope:{name:{angularJsBind:"="},field:{angularJsBind:"="}},directiveName:"matomoFieldArray",events:{"update:modelValue":function(e,t,n,r,i,a){e!==t.modelValue&&(r.trigger("change",e),a&&a.$setViewValue(e))}},postCreate:function(e,t,n,r,i){var a=i;a&&(a.$setViewValue(e.modelValue),a.$render=function(){angular.isString(a.$viewValue)?e.modelValue=JSON.parse(a.$viewValue):e.modelValue=a.$viewValue})}});function Fi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _i={class:"multiPairField form-group"},Ui={key:1,class:"fieldUiControl fieldUiControl2"},qi={key:2,class:"fieldUiControl fieldUiControl3"},Ji={key:3,class:"fieldUiControl fieldUiControl4"},Gi=["onClick","title"];function zi(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("Field");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",_i,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.modelValue,(function(t,n){var r;return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},Fi(r,"multiPairFieldTable".concat(n),!0),Fi(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{key:0,class:Object(a["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(a["createVNode"])(c,{"full-width":!0,modelValue:t[e.field1.key],"onUpdate:modelValue":[function(n){return t[e.field1.key]=n},function(t){return e.onEntryChange(n,e.field1.key,t)}],options:e.field1.availableValues,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title},null,8,["modelValue","onUpdate:modelValue","options","uicontrol","name","title"])],2)):Object(a["createCommentVNode"])("",!0),e.field2?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ui,[Object(a["createVNode"])(c,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field2.key,t)},function(n){return t[e.field2.key]=n}],modelValue:t[e.field2.key],placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","name","title"])])):Object(a["createCommentVNode"])("",!0),e.field3?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",qi,[Object(a["createVNode"])(c,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field3.key,t)},function(n){return t[e.field3.key]=n}],modelValue:t[e.field3.key],placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","title"])])):Object(a["createCommentVNode"])("",!0),e.field4?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ji,[Object(a["createVNode"])(c,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field4.key,t)},function(n){return t[e.field4.key]=n}],modelValue:t[e.field4.key],placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","title"])])):Object(a["createCommentVNode"])("",!0),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Gi),[[a["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function Yi(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 Qi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yi(Object(n),!0).forEach((function(t){Wi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ki(e){return ta(e)||ea(e)||Zi(e)||Xi()}function Xi(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Zi(e,t){if(e){if("string"===typeof e)return na(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)?na(e,t):void 0}}function ea(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ta(e){if(Array.isArray(e))return na(e)}function na(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ra=Gt("CorePluginsAdmin","Field"),ia=Object(a["defineComponent"])({props:{modelValue:Array,name:String,field1:Object,field2:Object,field3:Object,field4:Object},components:{Field:ra},computed:{fieldCount:function(){return this.field1&&this.field2&&this.field3&&this.field4?4:this.field1&&this.field2&&this.field3?3:this.field1&&this.field2?2:this.field1?1:0}},emits:["update:modelValue"],watch:{modelValue:function(e){this.checkEmptyModelValue(e)}},mounted:function(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue:function(e){e&&e.length&&!this.isEmptyValue(e.slice(-1)[0])||this.$emit("update:modelValue",[].concat(Ki(e||[]),[this.makeEmptyValue()]))},onEntryChange:function(e,t,n){var r=Ki(this.modelValue);r[e]=Qi(Qi({},r[e]),{},Wi({},t,n)),this.$emit("update:modelValue",r)},removeEntry:function(e){if(e>-1){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}},isEmptyValue:function(e){var t=this.fieldCount;if(4===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key]&&!e[this.field4.key])return!1}else if(3===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key])return!1}else if(2===t){if(!e[this.field1.key]&&!e[this.field2.key])return!1}else if(1===t&&!e[this.field1.key])return!1;return!0},makeEmptyValue:function(){var e={};return this.field1&&this.field1.key&&(e[this.field1.key]=""),this.field2&&this.field2.key&&(e[this.field2.key]=""),this.field3&&this.field3.key&&(e[this.field3.key]=""),this.field4&&this.field4.key&&(e[this.field4.key]=""),e}}});ia.render=zi;var aa=ia,oa=(Pt({component:aa,require:"?ngModel",scope:{name:{angularJsBind:"="},field1:{angularJsBind:"="},field2:{angularJsBind:"="},field3:{angularJsBind:"="},field4:{angularJsBind:"="}},directiveName:"matomoMultiPairField",events:{"update:modelValue":function(e,t,n,r,i,a){e!==t.modelValue&&(r.trigger("change",e),a&&a.$setViewValue(e))}},postCreate:function(e,t,n,r,i){var a=i;a&&(a.$setViewValue(e.modelValue),a.$render=function(){angular.isString(a.$viewValue)?e.modelValue=JSON.parse(a.$viewValue):e.modelValue=a.$viewValue})}}),{ref:"root",class:"periodSelector piwikSelector"}),ca=["title"],la=Object(a["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),sa={id:"periodMore",class:"dropdown"},ua={class:"flex"},da={key:0,class:"period-date"},pa={class:"period-type"},fa={id:"otherPeriods"},ma=["onDblclick","title"],ha=["id","checked","onChange","onDblclick"],ga={key:0,class:"compare-checkbox"},va={id:"comparePeriodToDropdown"},ba={key:1,class:"compare-date-range"},ya={id:"comparePeriodStartDate"},Oa=Object(a["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),wa={id:"comparePeriodEndDate"},ja={class:"apply-button-container"},ka=["disabled","value"],Sa={key:2,id:"ajaxLoadingCalendar"},Ca={class:"loadingSegment"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Xa=function(){function e(){var t=this;Qa(this,e),Za(this,"privateState",Object(a["reactive"])({pages:[]})),Za(this,"state",Object(a["readonly"])(this.privateState)),Za(this,"fetchAllPagesPromise",void 0),Za(this,"pages",Object(a["computed"])((function(){return t.state.pages})))}return Ka(e,[{key:"findPageInCategory",value:function(e){return this.pages.value.find((function(t){return t&&t.category&&t.category.id===e&&t.subcategory&&t.subcategory.id}))}},{key:"findPage",value:function(e,t){return this.pages.value.find((function(n){return n&&n.category&&n.subcategory&&n.category.id===e&&"".concat(n.subcategory.id)===t}))}},{key:"reloadAllPages",value:function(){var e=this;return new Promise((function(e){return setTimeout(e)})).then((function(){return e.fetchAllPagesPromise=null,e.getAllPages()}))}},{key:"getAllPages",value:function(){var e=this;return this.fetchAllPagesPromise||(this.fetchAllPagesPromise=xe.fetch({method:"API.getReportPagesMetadata",filter_limit:"-1"}).then((function(t){e.privateState.pages=t}))),this.fetchAllPagesPromise.then((function(){return e.pages.value}))}}]),e}(),eo=new Xa; + */function Da(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("DateRangePicker"),l=Object(a["resolveComponent"])("PeriodDatePicker"),s=Object(a["resolveComponent"])("Field"),u=Object(a["resolveComponent"])("ActivityIndicator"),d=Object(a["resolveDirective"])("expand-on-click");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",oa,[Object(a["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[la,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.currentlyViewingText),1)],8,ca),Object(a["createElementVNode"])("div",sa,[Object(a["createElementVNode"])("div",ua,[Object(a["createElementVNode"])("div",null,[Object(a["withDirectives"])(Object(a["createVNode"])(c,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[0]||(t[0]=function(t){return e.onRangeChange(t.start,t.end)}),onSubmit:t[1]||(t[1]=function(t){return e.onApplyClicked()})},null,8,["start-date","end-date"]),[[a["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",da,[Object(a["createVNode"])(l,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[2]||(t[2]=function(t){return e.setPiwikPeriodAndDate(e.selectedPeriod,t.date)})},null,8,["period","date"])])):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("div",pa,[Object(a["createElementVNode"])("h6",null,Object(a["toDisplayString"])(e.translate("General_Period")),1),Object(a["createElementVNode"])("div",fa,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.periodsFiltered,(function(n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("p",{key:n},[Object(a["createElementVNode"])("label",{class:Object(a["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_".concat(n),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.selectedPeriod=t}),checked:e.selectedPeriod===n,onChange:function(t){return e.selectedPeriod=n},onDblclick:function(t){return e.changeViewedPeriod(n)}},null,40,ha),[[a["vModelRadio"],e.selectedPeriod]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,ma)])})),128))])])]),e.isComparisonEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",ga,[Object(a["createElementVNode"])("label",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.isComparing=t})},null,512),[[a["vModelCheckbox"],e.isComparing]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(a["createElementVNode"])("div",va,[Object(a["createVNode"])(s,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.comparePeriodType=t}),style:Object(a["normalizeStyle"])({visibility:e.isComparing?"visible":"hidden"}),name:"comparePeriodToDropdown",uicontrol:"select",options:e.comparePeriodDropdownOptions,"full-width":!0,disabled:!e.isComparing},null,8,["modelValue","style","options","disabled"])])])):Object(a["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",ba,[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",ya,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(s,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.compareStartDate=t}),name:"comparePeriodStartDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_StartDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])]),Oa,Object(a["createElementVNode"])("div",wa,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(s,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.compareEndDate=t}),name:"comparePeriodEndDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_EndDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])])])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",ja,[Object(a["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[8]||(t[8]=function(t){return e.onApplyClicked()}),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,ka)]),e.isLoadingNewPage?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Sa,[Object(a["createVNode"])(u,{loading:!0}),Object(a["createElementVNode"])("div",Ca,Object(a["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(a["createCommentVNode"])("",!0)])],512)),[[d,{expander:"title"}]])}var Pa={class:"loadingPiwik"},Ea=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function Va(e,t,n,r,i,o){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Pa,[Ea,Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.loadingMessage),1)],512)),[[a["vShow"],e.loading]])}var Ta=Object(a["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:C("General_LoadingData")}}});Ta.render=Va;var Ia=Ta;function Na(e,t){return $a(e)||Ma(e,t)||Aa(e,t)||xa()}function xa(){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 Aa(e,t){if(e){if("string"===typeof e)return Ba(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)?Ba(e,t):void 0}}function Ba(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ma(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,c=!1;try{for(n=n.call(e);!(o=(r=n.next()).done);o=!0)if(a.push(r.value),t&&a.length===t)break}catch(l){c=!0,i=l}finally{try{o||null==n["return"]||n["return"]()}finally{if(c)throw i}}return a}}function $a(e){if(Array.isArray(e))return e}function La(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 Ha(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?La(Object(n),!0).forEach((function(t){Ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):La(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Fa=Gt("CorePluginsAdmin","Field"),_a=S.helper.htmlDecode(" "),Ua=[{key:"custom",value:C("General_Custom")},{key:"previousPeriod",value:C("General_PreviousPeriod").replace(/\s+/,_a)},{key:"previousYear",value:C("General_PreviousYear").replace(/\s+/,_a)}],qa=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay),Ja=new Date(S.maxDateYear,S.maxDateMonth-1,S.maxDateDay);function Ga(e){return"[object Date]"===Object.prototype.toString.call(e)&&!Number.isNaN(e.getTime())}var za=Object(a["defineComponent"])({props:{periods:Array},components:{DateRangePicker:wr,PeriodDatePicker:Dr,Field:Fa,ActivityIndicator:Ia},directives:{ExpandOnClick:et},data:function(){return{comparePeriodDropdownOptions:Ua,periodValue:null,dateValue:null,selectedPeriod:null,startRangeDate:null,endRangeDate:null,isRangeValid:null,isLoadingNewPage:!1,isComparing:null,comparePeriodType:"previousPeriod",compareStartDate:"",compareEndDate:""}},mounted:function(){var e=this;S.on("hidePeriodSelector",(function(){window.$(e.$refs.root).hide()})),S.on("piwikPageChange",(function(){window.$(e.$refs.root).show()})),this.updateSelectedValuesFromHash(),Object(a["watch"])((function(){return we.parsed.value}),this.updateSelectedValuesFromHash),this.isComparing=En.isComparing(),Object(a["watch"])((function(){return En.isComparing()}),(function(t){e.isComparing=t})),window.initTopControls(),this.handleZIndexPositionRelativeCompareDropdownIssue()},computed:{currentlyViewingText:function(){var e;if("range"===this.periodValue){if(!this.startRangeDate||!this.endRangeDate)return C("General_Error");e="".concat(this.startRangeDate,",").concat(this.endRangeDate)}else{if(!this.dateValue)return C("General_Error");e=D(this.dateValue)}try{return p.parse(this.periodValue,e).getPrettyString()}catch(t){return C("General_Error")}},isComparisonEnabled:function(){return En.isComparisonEnabled()},periodsFiltered:function(){return(this.periods||[]).filter((function(e){return p.isRecognizedPeriod(e)}))},selectedComparisonParams:function(){if(!this.isComparing)return{};if("custom"===this.comparePeriodType)return{comparePeriods:["range"],compareDates:["".concat(this.compareStartDate,",").concat(this.compareEndDate)]};if("previousPeriod"===this.comparePeriodType)return{comparePeriods:[this.selectedPeriod],compareDates:[this.previousPeriodDateToSelectedPeriod]};if("previousYear"===this.comparePeriodType){var e="range"===this.selectedPeriod?"".concat(this.startRangeDate,",").concat(this.endRangeDate):this.dateValue,t=p.parse(this.selectedPeriod,e).getDateRange();return t[0].setFullYear(t[0].getFullYear()-1),t[1].setFullYear(t[1].getFullYear()-1),"range"===this.selectedPeriod?{comparePeriods:["range"],compareDates:["".concat(D(t[0]),",").concat(D(t[1]))]}:{comparePeriods:[this.selectedPeriod],compareDates:[D(t[0])]}}return console.warn("Unknown compare period type: ".concat(this.comparePeriodType)),{}},previousPeriodDateToSelectedPeriod:function(){if("range"===this.selectedPeriod){var e=E(this.startRangeDate),t=E(this.endRangeDate),n=F.getLastNRange("day",2,e).startDate,r=Math.floor((t-e)/864e5),i=F.getLastNRange("day",1+r,n);return"".concat(D(i.startDate),",").concat(D(i.endDate))}var a=F.getLastNRange(this.selectedPeriod,2,this.dateValue).startDate;return D(a)},selectedDateString:function(){if("range"===this.selectedPeriod){var e=this.startRangeDate,t=this.endRangeDate,n=E(e),r=E(t);return!Ga(n)||!Ga(r)||n>r?(window.$("#alert").find("h2").text(C("General_InvalidDateRange")),S.helper.modalConfirm("#alert",{}),null):"".concat(e,",").concat(t)}return D(this.dateValue)}},methods:{handleZIndexPositionRelativeCompareDropdownIssue:function(){var e=window.$(this.$refs.root);e.on("focus","#comparePeriodToDropdown .select-dropdown",(function(){e.addClass("compare-dropdown-open")})).on("blur","#comparePeriodToDropdown .select-dropdown",(function(){e.removeClass("compare-dropdown-open")}))},changeViewedPeriod:function(){this.period!==this.periodValue&&"range"!==this.period&&this.setPiwikPeriodAndDate(this.period,this.dateValue)},setPiwikPeriodAndDate:function(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;var n=D(t);this.setRangeStartEndFromPeriod(e,n),this.propagateNewUrlParams(n,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams:function(e,t){var n,r=this.selectedComparisonParams;S.helper.isAngularRenderingThePage()?(this.closePeriodSelector(),n=we.hashParsed.value):(this.isLoadingNewPage=!0,n=we.parsed.value);var i=Ha({},n);delete i.comparePeriods,delete i.compareSegments,delete i.compareDates,we.updateLocation(Ha(Ha({},i),{},{date:e,period:t},r))},onApplyClicked:function(){if("range"===this.selectedPeriod){var e=this.selectedDateString;if(!e)return;return this.periodValue="range",void this.propagateNewUrlParams(e,"range")}this.setPiwikPeriodAndDate(this.selectedPeriod,this.dateValue)},updateSelectedValuesFromHash:function(){var e=we.parsed.value,t=e.date,n=e.period;this.periodValue=n,this.selectedPeriod=n,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{p.parse(n,t)}catch(l){return}if("range"===n){var r=p.get(n).parse(t),i=r.getDateRange(),a=Na(i,2),o=a[0],c=a[1];this.dateValue=o,this.startRangeDate=D(o),this.endRangeDate=D(c)}else this.dateValue=E(t),this.setRangeStartEndFromPeriod(n,t)},setRangeStartEndFromPeriod:function(e,t){var n=p.parse(e,t).getDateRange();this.startRangeDate=D(n[0]<qa?qa:n[0]),this.endRangeDate=D(n[1]>Ja?Ja:n[1])},getPeriodDisplayText:function(e){return p.get(e).getDisplayText()},onRangeChange:function(e,t){e&&t?(this.isRangeValid=!0,this.startRangeDate=e,this.endRangeDate=t):this.isRangeValid=!1},isApplyEnabled:function(){return!("range"===this.selectedPeriod&&!this.isRangeValid)&&!(this.isComparing&&"custom"===this.comparePeriodType&&!this.isCompareRangeValid())},closePeriodSelector:function(){this.$refs.root.classList.remove("expanded")},isCompareRangeValid:function(){try{E(this.compareStartDate)}catch(e){return!1}try{E(this.compareEndDate)}catch(e){return!1}return!0}}});za.render=Da;var Ya=za,Qa=(Pt({component:Ya,scope:{periods:{angularJsBind:"<"}},directiveName:"piwikPeriodSelector"}),{class:"reportingMenu"}),Wa=["aria-label"],Ka=["onClick"],Xa={class:"hidden"},Za={role:"menu"},eo=["href","onClick","title"],to=["href","onClick"],no=["onClick"],ro=Object(a["createElementVNode"])("span",{class:"icon-help"},null,-1),io=[ro],ao={id:"mobile-left-menu",class:"sidenav hide-on-large-only"},oo={class:"collapsible collapsible-accordion"},co={class:"collapsible-header"},lo={class:"collapsible-body"},so={key:0},uo=["onClick","href"],po={key:1},fo=["onClick","href"]; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function to(){return{get pages(){return eo.pages.value},findPageInCategory:function(){return Pt(eo.findPageInCategory.apply(eo,arguments))},findPage:function(){return Pt(eo.findPage.apply(eo,arguments))},reloadAllPages:function(){return eo.reloadAllPages().then((function(e){return Et(e)}))},getAllPages:function(){return eo.getAllPages().then((function(e){return Et(e)}))}}}function no(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ro(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function io(e,t,n){return t&&ro(e.prototype,t),n&&ro(e,n),e}function ao(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */function mo(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("MenuDropdown"),l=Object(a["resolveDirective"])("side-nav");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Qa,[Object(a["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.menu,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{class:Object(a["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id},[Object(a["createElementVNode"])("a",{class:"item",tabindex:"5",href:"",onClick:Object(a["withModifiers"])((function(n){return e.loadCategory(t)}),["prevent"])},[Object(a["createElementVNode"])("span",{class:Object(a["normalizeClass"])("menu-icon ".concat(t.icon?t.icon:"icon-arrow-right"))},null,2),Object(a["createTextVNode"])(Object(a["toDisplayString"])(t.name)+" ",1),Object(a["createElementVNode"])("span",Xa,Object(a["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,Ka),Object(a["createElementVNode"])("ul",Za,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(t.subcategories,(function(n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{role:"menuitem",class:Object(a["normalizeClass"])({active:n.id===e.activeSubcategory}),key:n.id},[n.isGroup?(Object(a["openBlock"])(),Object(a["createBlock"])(c,{key:0,"show-search":!0,"menu-title":e.htmlEntities(n.name)},{default:Object(a["withCtx"])((function(){return[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(n.subcategories,(function(n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{class:Object(a["normalizeClass"])(["item",{active:n.id===e.activeSubsubcategory}]),tabindex:"5",href:"#?".concat(e.makeUrl(t,n)),onClick:function(r){return e.loadSubcategory(t,n,r)},title:n.tooltip,key:n.id},Object(a["toDisplayString"])(n.name),11,eo)})),128))]})),_:2},1032,["menu-title"])):Object(a["createCommentVNode"])("",!0),n.isGroup?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:1,href:"#?".concat(e.makeUrl(t,n)),class:"item",onClick:function(r){return e.loadSubcategory(t,n,r)}},Object(a["toDisplayString"])(n.name),9,to)),n.help?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:2,class:Object(a["normalizeClass"])(["item-help-icon",{active:e.helpShownCategory&&e.helpShownCategory.subcategory===n.id&&e.helpShownCategory.category===t.id&&n.help}]),tabindex:"5",href:"javascript:",onClick:function(r){return e.showHelp(t,n,r)}},io,10,no)):Object(a["createCommentVNode"])("",!0)],2)})),128))])],2)})),128))],8,Wa),Object(a["createElementVNode"])("ul",ao,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.menu,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{class:"no-padding",key:t.id},[Object(a["withDirectives"])(Object(a["createElementVNode"])("ul",oo,[Object(a["createElementVNode"])("li",null,[Object(a["createElementVNode"])("a",co,[Object(a["createElementVNode"])("i",{class:Object(a["normalizeClass"])(t.icon?t.icon:"icon-arrow-bottom")},null,2),Object(a["createTextVNode"])(Object(a["toDisplayString"])(t.name),1)]),Object(a["createElementVNode"])("div",lo,[Object(a["createElementVNode"])("ul",null,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(t.subcategories,(function(n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{key:n.id},[n.isGroup?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",so,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(n.subcategories,(function(n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n)),key:n.id},Object(a["toDisplayString"])(n.name),9,uo)})),128))])):Object(a["createCommentVNode"])("",!0),n.isGroup?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",po,[Object(a["createElementVNode"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n))},Object(a["toDisplayString"])(n.name),9,fo)]))])})),128))])])])],512),[[l,{activator:e.sideNavActivator}]])])})),128))])])}var ho={key:0},go=["data-notification-instance-id"],vo={key:1},bo={class:"notification-body"},yo=["innerHTML"],Oo={key:1};function wo(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createBlock"])(a["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(a["withCtx"])((function(){return[e.deleted?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",ho,[Object(a["createVNode"])(a["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(a["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",{class:Object(a["normalizeClass"])(["notification system",e.cssClasses]),style:Object(a["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(a["openBlock"])(),Object(a["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(a["createCommentVNode"])("",!0),e.title?(Object(a["openBlock"])(),Object(a["createElementBlock"])("strong",vo,Object(a["toDisplayString"])(e.title),1)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",bo,[e.message?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,yo)):Object(a["createCommentVNode"])("",!0),e.message?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Oo,[Object(a["renderSlot"])(e.$slots,"default")]))])],14,go)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var jo=window,ko=jo.$,So=Object(a["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&&ko(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(a["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(a["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Ne.fetch({module:"CoreHome",action:"markNotificationAsRead"},{postParams:{notificationId:this.notificationId}})}}});So.render=wo;var Co=So; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */Pt({component:Co,scope:{notificationId:{angularJsBind:"@?"},title:{angularJsBind:"@?notificationTitle"},context:{angularJsBind:"@?"},type:{angularJsBind:"@?"},noclear:{angularJsBind:"@?",transform:Et},toastLength:{angularJsBind:"@?"}},directiveName:"piwikNotification",transclude:!0});function Do(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 Po(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Do(Object(n),!0).forEach((function(t){Io(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Eo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function To(e,t,n){return t&&Vo(e.prototype,t),n&&Vo(e,n),e}function Io(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * 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.service").factory("reportingPagesModel",to);var oo=function(){function e(){var t=this;no(this,e),ao(this,"privateState",Object(a["reactive"])({reports:[]})),ao(this,"state",Object(a["readonly"])(this.privateState)),ao(this,"reports",Object(a["computed"])((function(){return t.state.reports}))),ao(this,"reportsPromise",void 0)}return io(e,[{key:"findReport",value:function(e,t){return this.reports.value.find((function(n){return n.module===e&&n.action===t}))}},{key:"fetchReportMetadata",value:function(){var e=this;return this.reportsPromise||(this.reportsPromise=xe.fetch({method:"API.getReportMetadata",filter_limit:"-1",idSite:S.idSite||we.parsed.value.idSite}).then((function(t){return e.privateState.reports=t,t}))),this.reportsPromise.then((function(){return e.reports.value}))}}]),e}(),co=new oo; + */var No=function(){function e(){Eo(this,e),Io(this,"privateState",Object(a["reactive"])({notifications:[]})),Io(this,"nextNotificationId",0)}return To(e,[{key:"state",get:function(){return Object(a["readonly"])(this.privateState)}},{key:"appendNotification",value:function(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.push(e)}},{key:"prependNotification",value:function(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.unshift(e)}},{key:"remove",value:function(e){this.privateState.notifications=this.privateState.notifications.filter((function(t){return t.id!==e}))}},{key:"parseNotificationDivs",value:function(){var e=this,t=$('[data-role="notification"]'),n=[];t.each((function(e,r){var i=$(r),a=i.data(),o=i.html();o&&n.push(Po(Po({},a),{},{message:o,animate:!1})),t.remove()})),n.forEach((function(t){return e.show(t)}))}},{key:"clearTransientNotifications",value:function(){this.privateState.notifications=this.privateState.notifications.filter((function(e){return"transient"!==e.type}))}},{key:"show",value:function(e){this.checkMessage(e.message);var t=e.prepend?this.prependNotification:this.appendNotification,n="#notificationContainer";if(e.placeat)n=e.placeat;else{var r=".modal.open .modal-content",i=document.querySelector(r);i&&(i.querySelector("#modalNotificationContainer")||window.$(i).prepend('<div id="modalNotificationContainer"/>'),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var a=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,a);var o=(this.nextNotificationId+=1).toString();return t.call(this,Po(Po({},e),{},{noclear:!!e.noclear,group:a,notificationId:e.id,notificationInstanceId:o,type:e.type||"transient"})),o}},{key:"scrollToNotification",value:function(e){setTimeout((function(){var t=document.querySelector("[data-notification-instance-id='".concat(e,"']"));t&&S.helper.lazyScrollTo(t,250)}))}},{key:"toast",value:function(e){this.checkMessage(e.message);var t=$(e.placeat);if(!t.length)throw new Error("A valid selector is required for the placeat option when using Notification.toast().");var n=document.createElement("div");n.style.position="absolute",n.style.top="".concat(t.offset().top,"px"),n.style.left="".concat(t.offset().left,"px"),n.style.zIndex="1000",document.body.appendChild(n);var r=Object(a["createApp"])({render:function(){return Object(a["createVNode"])(Co,Po(Po({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.config.globalProperties.$sanitize=window.vueSanitize,r.config.globalProperties.translate=C,r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){var n=window.$(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,i=Object(a["createApp"])({template:'<NotificationGroup :group="group"></NotificationGroup>',data:function(){return{group:t}}});i.config.globalProperties.$sanitize=window.vueSanitize,i.config.globalProperties.translate=C,i.component("NotificationGroup",r),i.mount(n[0])}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),xo=new No,Ao=xo;$((function(){return xo.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.service").factory("reportMetadataModel",(function(){return{get reports(){return co.reports.value},findReport:co.findReport.bind(co),fetchReportMetadata:function(){return co.fetchReportMetadata().then((function(e){return Et(e)}))}}})); +angular.module("piwikApp").factory("notifications",(function(){return Ao}));var Bo={class:"notification-group"},Mo=["innerHTML"];function $o(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("Notification");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Bo,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.notifications,(function(t,n){return Object(a["openBlock"])(),Object(a["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(a["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(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,Mo)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}var Lo=Object(a["defineComponent"])({props:{group:String},components:{Notification:Co},computed:{notifications:function(){var e=this;return Ao.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){Ao.remove(e)}}});Lo.render=$o;var Ho=Lo; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var lo=St({component:Ia,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return D("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"});function so(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uo(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["alert",so({},"alert-".concat(e.severity),!0)])},[Object(a["renderSlot"])(e.$slots,"default")],2)}var po=Object(a["defineComponent"])({props:{severity:{type:String,required:!0}}});po.render=uo;var fo=po,mo=St({component:fo,scope:{severity:{vue:"severity",angularJsBind:"@piwikAlert"}},directiveName:"piwikAlert",transclude:!0}); + */function Ro(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _o(e,t,n){return t&&Fo(e.prototype,t),n&&Fo(e,n),e}function Uo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function ho(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 go(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 vo(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")}var bo={key:0},yo=["data-notification-instance-id"],Oo={key:1},wo={class:"notification-body"},jo=["innerHTML"],ko={key:1};function So(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createBlock"])(a["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(a["withCtx"])((function(){return[e.deleted?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",bo,[Object(a["createVNode"])(a["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(a["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",{class:Object(a["normalizeClass"])(["notification system",e.cssClasses]),style:Object(a["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(a["openBlock"])(),Object(a["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(a["createCommentVNode"])("",!0),e.title?(Object(a["openBlock"])(),Object(a["createElementBlock"])("strong",Oo,Object(a["toDisplayString"])(e.title),1)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",wo,[e.message?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,jo)):Object(a["createCommentVNode"])("",!0),e.message?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",ko,[Object(a["renderSlot"])(e.$slots,"default")]))])],14,yo)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var Do=window,Co=Do.$,Po=Object(a["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&&Co(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(a["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(a["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&xe.fetch({module:"CoreHome",action:"markNotificationAsRead"},{postParams:{notificationId:this.notificationId}})}}});Po.render=So;var Eo=Po; + */var qo=function(){function e(){var t=this;Ro(this,e),Uo(this,"privateState",Object(a["reactive"])({pages:[]})),Uo(this,"state",Object(a["readonly"])(this.privateState)),Uo(this,"fetchAllPagesPromise",void 0),Uo(this,"pages",Object(a["computed"])((function(){return t.state.pages})))}return _o(e,[{key:"findPageInCategory",value:function(e){return this.pages.value.find((function(t){return t&&t.category&&t.category.id===e&&t.subcategory&&t.subcategory.id}))}},{key:"findPage",value:function(e,t){return this.pages.value.find((function(n){return n&&n.category&&n.subcategory&&n.category.id===e&&"".concat(n.subcategory.id)===t}))}},{key:"reloadAllPages",value:function(){var e=this;return new Promise((function(e){return setTimeout(e)})).then((function(){return e.fetchAllPagesPromise=null,e.getAllPages()}))}},{key:"getAllPages",value:function(){var e=this;return this.fetchAllPagesPromise||(this.fetchAllPagesPromise=Ne.fetch({method:"API.getReportPagesMetadata",filter_limit:"-1"}).then((function(t){e.privateState.pages=t}))),this.fetchAllPagesPromise.then((function(){return e.pages.value}))}}]),e}(),Jo=new qo;function Go(e){return Wo(e)||Qo(e)||Yo(e)||zo()}function zo(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Yo(e,t){if(e){if("string"===typeof e)return Ko(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)?Ko(e,t):void 0}}function Qo(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Wo(e){if(Array.isArray(e))return Ko(e)}function Ko(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xo(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 Zo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xo(Object(n),!0).forEach((function(t){rc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ec(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nc(e,t,n){return t&&tc(e.prototype,t),n&&tc(e,n),e}function rc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */St({component:Eo,scope:{notificationId:{angularJsBind:"@?"},title:{angularJsBind:"@?notificationTitle"},context:{angularJsBind:"@?"},type:{angularJsBind:"@?"},noclear:{angularJsBind:"@?",transform:Dt},toastLength:{angularJsBind:"@?"}},directiveName:"piwikNotification",transclude:!0});function Vo(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 To(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vo(Object(n),!0).forEach((function(t){Ao(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Io(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function No(e,t,n){return t&&xo(e.prototype,t),n&&xo(e,n),e}function Ao(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */function ic(e){var t=parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)}var ac=function(){function e(){var t=this;ec(this,e),rc(this,"privateState",Object(a["reactive"])({activeCategoryId:null,activeSubcategoryId:null,activeSubsubcategoryId:null})),rc(this,"state",Object(a["computed"])((function(){return Object(a["readonly"])(t.privateState)}))),rc(this,"activeCategory",Object(a["computed"])((function(){return t.state.value.activeCategoryId||we.parsed.value.category}))),rc(this,"activeSubcategory",Object(a["computed"])((function(){return t.state.value.activeSubcategoryId||we.parsed.value.subcategory}))),rc(this,"activeSubsubcategory",Object(a["computed"])((function(){return t.state.value.activeSubsubcategoryId}))),rc(this,"menu",Object(a["computed"])((function(){return t.buildMenuFromPages()})))}return nc(e,[{key:"fetchMenuItems",value:function(){var e=this;return Jo.getAllPages().then((function(){return e.menu.value}))}},{key:"reloadMenuItems",value:function(){var e=this;return Jo.reloadAllPages().then((function(){return e.menu.value}))}},{key:"findSubcategory",value:function(e,t){var n=null,r=null,i=null;return this.menu.value.forEach((function(a){a.id===e&&(a.subcategories||[]).forEach((function(e){e.id===t&&(n=a,r=e),e.isGroup&&(e.subcategories||[]).forEach((function(o){o.id===t&&(n=a,r=e,i=o)}))}))})),{category:n,subcategory:r,subsubcategory:i}}},{key:"buildMenuFromPages",value:function(){var e=this,t=[],n=this.activeCategory.value,r=this.activeSubcategory.value,i=Jo.pages.value,a={};return i.forEach((function(o){var c=Zo({},o.category),l=c.id,s=l===n;if(!a[l]){var u;a[l]=!0,c.subcategories=[];var d=i.filter((function(e){return e.category.id===l}));d.forEach((function(e){var t=Zo({},e.subcategory),n=t.id===r&&s;if(e.widgets&&e.widgets[0]&&ic(e.subcategory.id)){u||(u=Zo({},t),u.name=C("CoreHome_ChooseX",[c.name]),u.isGroup=!0,u.subcategories=[],u.order=10),n&&(u.name=t.name);var i=o.subcategory.id;return t.tooltip="".concat(t.name," (id = ").concat(i,")"),void u.subcategories.push(t)}c.subcategories.push(t)})),u&&u.subcategories&&u.subcategories.length<=5?u.subcategories.forEach((function(e){return c.subcategories.push(e)})):u&&c.subcategories.push(u),c.subcategories=e.sortMenuItems(c.subcategories),t.push(c)}})),this.sortMenuItems(t)}},{key:"sortMenuItems",value:function(e){var t=Go(e);return t.sort((function(e,t){return e.order<t.order?-1:e.order>t.order?1:0})),t}},{key:"toggleCategory",value:function(e){return this.privateState.activeSubcategoryId=null,this.privateState.activeSubsubcategoryId=null,this.privateState.activeCategoryId===e.id?(this.privateState.activeCategoryId=null,!1):(this.privateState.activeCategoryId=e.id,!0)}},{key:"enterSubcategory",value:function(e,t,n){e&&t&&(this.privateState.activeCategoryId=e.id,this.privateState.activeSubcategoryId=t.id,n&&(this.privateState.activeSubsubcategoryId=n.id))}}]),e}(),oc=new ac;function cc(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 lc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cc(Object(n),!0).forEach((function(t){sc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uc(e){return uc="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uc(e)}var dc="reportingmenu-help",pc=Object(a["defineComponent"])({components:{MenuDropdown:ar},directives:{SideNav:ut},props:{},data:function(){return{showSubcategoryHelpOnLoad:null,initialLoad:!0,helpShownCategory:null}},computed:{sideNavActivator:function(){return document.querySelector("nav .activateLeftMenu")},menu:function(){return oc.menu.value},activeCategory:function(){return oc.activeCategory.value},activeSubcategory:function(){return oc.activeSubcategory.value},activeSubsubcategory:function(){return oc.activeSubsubcategory.value}},created:function(){var e=this;oc.fetchMenuItems().then((function(t){if(!we.parsed.value.subcategory){var n=t[0],r=n.subcategories[0];oc.enterSubcategory(n,r),e.propagateUrlChange(n,r)}})),Object(a["watch"])((function(){return we.parsed.value}),(function(e){var t=oc.findSubcategory(e.category,e.subcategory);oc.enterSubcategory(t.category,t.subcategory,t.subsubcategory)})),S.on("piwikPageChange",(function(){e.initialLoad||window.globalAjaxQueue.abort(),e.helpShownCategory=null,e.showSubcategoryHelpOnLoad&&(e.showHelp(e.showSubcategoryHelpOnLoad.category,e.showSubcategoryHelpOnLoad.subcategory),e.showSubcategoryHelpOnLoad=null),window.$("#loadingError").hide(),e.initialLoad=!1})),S.on("updateReportingMenu",(function(){oc.reloadMenuItems().then((function(){var e=we.parsed.value,t=e.category,n=e.subcategory;if(t&&n){var r=oc.findSubcategory(t,n);r&&oc.enterSubcategory(r.category,r.subcategory,r.subsubcategory)}})),"object"===uc(window.widgetsHelper)&&window.widgetsHelper.availableWidgets&&(delete window.widgetsHelper.availableWidgets,window.widgetsHelper.getAvailableWidgets())}))},methods:{propagateUrlChange:function(e,t){var n=we.parsed.value;n.category===e.id&&n.subcategory===t.id?this.loadSubcategory(e,t):we.updateHash(lc(lc({},we.hashParsed.value),{},{category:e.id,subcategory:t.id}))},loadCategory:function(e){Ao.remove(dc);var t=oc.toggleCategory(e);if(t&&e.subcategories&&1===e.subcategories.length){this.helpShownCategory=null;var n=e.subcategories[0];this.propagateUrlChange(e,n)}},loadSubcategory:function(e,t,n){n.shiftKey||n.ctrlKey||n.metaKey||(Ao.remove(dc),t&&t.id===this.activeSubcategory&&(this.helpShownCategory=null,S.postEvent("loadPage",e.id,t.id)))},makeUrl:function(e,t){var n=we.parsed.value,r=n.idSite,i=n.period,a=n.date,o=n.segment,c=n.comparePeriods,l=n.compareDates,s=n.compareSegments;return we.stringify({idSite:r,period:i,date:a,segment:o,comparePeriods:c,compareDates:l,compareSegments:s,category:e.id,subcategory:t.id})},htmlEntities:function(e){return S.helper.htmlEntities(e)},showHelp:function(e,t,n){var r=we.parsed.value,i=r.category,a=r.subcategory;if((i!==e.id||a!==t.id)&&n)return this.showSubcategoryHelpOnLoad={category:e,subcategory:t},void we.updateHash(lc(lc({},we.hashParsed.value),{},{category:e.id,subcategory:t.id}));if(this.helpShownCategory&&e.id===this.helpShownCategory.category&&t.id===this.helpShownCategory.subcategory)return Ao.remove(dc),void(this.helpShownCategory=null);var o=C("CoreHome_ReportingCategoryHelpPrefix",e.name,t.name),c="<strong>".concat(o,"</strong><br/>");Ao.show({context:"info",id:dc,type:"help",noclear:!0,class:"help-notification",message:c+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});pc.render=mo;var fc=pc; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Bo=function(){function e(){Io(this,e),Ao(this,"privateState",Object(a["reactive"])({notifications:[]})),Ao(this,"nextNotificationId",0)}return No(e,[{key:"state",get:function(){return this.privateState}},{key:"appendNotification",value:function(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.push(e)}},{key:"prependNotification",value:function(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.unshift(e)}},{key:"remove",value:function(e){this.privateState.notifications=this.privateState.notifications.filter((function(t){return t.id!==e}))}},{key:"parseNotificationDivs",value:function(){var e=this,t=$('[data-role="notification"]'),n=[];t.each((function(e,r){var i=$(r),a=i.data(),o=i.html();o&&n.push(To(To({},a),{},{message:o,animate:!1})),t.remove()})),n.forEach((function(t){return e.show(t)}))}},{key:"clearTransientNotifications",value:function(){this.privateState.notifications=this.privateState.notifications.filter((function(e){return"transient"!==e.type}))}},{key:"show",value:function(e){this.checkMessage(e.message);var t=this.appendNotification,n="#notificationContainer";if(e.placeat)n=e.placeat;else{var r=".modal.open .modal-content",i=document.querySelector(r);i&&(i.querySelector("#modalNotificationContainer")||window.$(i).prepend('<div id="modalNotificationContainer"/>'),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var a=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,a);var o=(this.nextNotificationId+=1).toString();return t.call(this,To(To({},e),{},{noclear:!!e.noclear,group:a,notificationId:e.id,notificationInstanceId:o,type:e.type||"transient"})),o}},{key:"scrollToNotification",value:function(e){setTimeout((function(){var t=document.querySelector("[data-notification-instance-id='".concat(e,"']"));t&&S.helper.lazyScrollTo(t,250)}))}},{key:"toast",value:function(e){this.checkMessage(e.message);var t=$(e.placeat);if(!t.length)throw new Error("A valid selector is required for the placeat option when using Notification.toast().");var n=document.createElement("div");n.style.position="absolute",n.style.top="".concat(t.offset().top,"px"),n.style.left="".concat(t.offset().left,"px"),n.style.zIndex="1000",document.body.appendChild(n);var r=Object(a["createApp"])({render:function(){return Object(a["createVNode"])(Eo,To(To({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.config.globalProperties.$sanitize=window.vueSanitize,r.config.globalProperties.translate=D,r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){var n=window.$(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,i=Object(a["createApp"])({template:'<NotificationGroup :group="group"></NotificationGroup>',data:function(){return{group:t}}});i.config.globalProperties.$sanitize=window.vueSanitize,i.config.globalProperties.translate=D,i.component("NotificationGroup",r),i.mount(n[0])}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),Mo=new Bo,$o=Mo;$((function(){return Mo.parseNotificationDivs()})), + */Pt({component:fc,directiveName:"piwikReportingMenu"}); /*! * 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 $o}));var Lo={class:"notification-group"},Ro=["innerHTML"];function Ho(e,t,n,r,i,o){var c=Object(a["resolveComponent"])("Notification");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Lo,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.notifications,(function(t,n){return Object(a["openBlock"])(),Object(a["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(a["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(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,Ro)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}var Fo=Object(a["defineComponent"])({props:{group:String},components:{Notification:Eo},computed:{notifications:function(){var e=this;return $o.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){$o.remove(e)}}});Fo.render=Ho;var _o=Fo; +function mc(e){return e.forEach((function(e){e.id===oc.activeCategory.value&&(e.active=!0,(e.subcategories||[]).forEach((function(e){e.id===oc.activeSubcategory.value&&(e.active=!0,(e.subcategories||[]).forEach((function(e){e.id===oc.activeSubsubcategory.value&&(e.active=!0)})))})))})),e}function hc(){return{get menu(){return oc.menu.value},findSubcategory:oc.findSubcategory.bind(oc),reloadMenuItems:function(){return oc.reloadMenuItems().then((function(e){return mc(It(e))}))},fetchMenuItems:function(){return oc.fetchMenuItems().then((function(e){return mc(It(e))}))}}} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +function gc(){return{get pages(){return Jo.pages.value},findPageInCategory:function(){return Tt(Jo.findPageInCategory.apply(Jo,arguments))},findPage:function(){return Tt(Jo.findPage.apply(Jo,arguments))},reloadAllPages:function(){return Jo.reloadAllPages().then((function(e){return It(e)}))},getAllPages:function(){return Jo.getAllPages().then((function(e){return It(e)}))}}}function vc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yc(e,t,n){return t&&bc(e.prototype,t),n&&bc(e,n),e}function Oc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} +/*! + * 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.service").factory("reportingMenuModel",hc),angular.module("piwikApp.service").factory("reportingPagesModel",gc);var wc=function(){function e(){var t=this;vc(this,e),Oc(this,"privateState",Object(a["reactive"])({reports:[]})),Oc(this,"state",Object(a["readonly"])(this.privateState)),Oc(this,"reports",Object(a["computed"])((function(){return t.state.reports}))),Oc(this,"reportsPromise",void 0)}return yc(e,[{key:"findReport",value:function(e,t){return this.reports.value.find((function(n){return n.module===e&&n.action===t}))}},{key:"fetchReportMetadata",value:function(){var e=this;return this.reportsPromise||(this.reportsPromise=Ne.fetch({method:"API.getReportMetadata",filter_limit:"-1",idSite:S.idSite||we.parsed.value.idSite}).then((function(t){return e.privateState.reports=t,t}))),this.reportsPromise.then((function(){return e.reports.value}))}}]),e}(),jc=new wc; +/*! + * 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.service").factory("reportMetadataModel",(function(){return{get reports(){return jc.reports.value},findReport:jc.findReport.bind(jc),fetchReportMetadata:function(){return jc.fetchReportMetadata().then((function(e){return It(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 kc=Pt({component:Ia,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return C("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"});function Sc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cc(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["alert",Sc({},"alert-".concat(e.severity),!0)])},[Object(a["renderSlot"])(e.$slots,"default")],2)}var Dc=Object(a["defineComponent"])({props:{severity:{type:String,required:!0}}});Dc.render=Cc;var Pc=Dc,Ec=Pt({component:Pc,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 Vc(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 Tc(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 Ic(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")} /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts index a3965760b8..827effda5a 100644 --- a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts +++ b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts @@ -5,6 +5,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +import { ITimeoutService } from 'angular'; import jqXHR = JQuery.jqXHR; import MatomoUrl from '../MatomoUrl/MatomoUrl'; import Matomo from '../Matomo/Matomo'; @@ -358,13 +359,26 @@ export default class AjaxHelper<T = any> { // eslint-disable-line this.requestHandle = this.buildAjaxCall(); window.globalAjaxQueue.push(this.requestHandle); + let $timeout: ITimeoutService|null = null; + try { + $timeout = Matomo.helper.getAngularDependency('$timeout'); + } catch (e) { + // ignore + } + const result: AbortablePromise<T> = new Promise<T>((resolve, reject) => { - this.requestHandle!.then(resolve).fail((xhr: jqXHR) => { + this.requestHandle!.then((data: unknown) => { + resolve(data as T); // ignoring textStatus/jqXHR + }).fail((xhr: jqXHR) => { if (xhr.statusText !== 'abort') { console.log(`Warning: the ${$.param(this.getParams)} request failed!`); reject(xhr); } + }).done(() => { + if ($timeout) { + $timeout(); // trigger digest + } }); }) as AbortablePromise<T>; diff --git a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts index 971acfa299..90d5dd9560 100644 --- a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts +++ b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts @@ -110,7 +110,11 @@ class MatomoUrl { stringify(search: QueryParameters): string { // TODO: using $ since URLSearchParams does not handle array params the way Matomo uses them - return $.param(search).replace(/%5B%5D/g, '[]'); + return $.param(search).replace(/%5B%5D/g, '[]') + // some browsers treat URLs w/ date=a,b differently from date=a%2Cb, causing multiple + // entries to show up in the browser history. this has a compounding effect w/ angular.js, + // which when the back button is pressed to effectively abort the back navigation. + .replace(/%2C/g, ','); } updatePeriodParamsFromUrl(): void { diff --git a/plugins/CoreHome/vue/src/Notification/Notifications.store.ts b/plugins/CoreHome/vue/src/Notification/Notifications.store.ts index 651cdd127a..6aada1b0e3 100644 --- a/plugins/CoreHome/vue/src/Notification/Notifications.store.ts +++ b/plugins/CoreHome/vue/src/Notification/Notifications.store.ts @@ -10,6 +10,7 @@ import { reactive, createVNode, createApp, + readonly, } from 'vue'; import NotificationComponent from './Notification.vue'; import translate from '../translate'; @@ -27,7 +28,7 @@ interface Notification { * Unique ID generated for the notification so it can be referenced specifically * to scroll to. */ - notificationInstanceId: string; + notificationInstanceId?: string; /** * Determines which notification group a notification is meant to be displayed @@ -53,8 +54,10 @@ interface Notification { /** * The type of the notification: Either 'toast' or 'transient'. 'persistent' is valid, but * has no effect if only specified client side. + * + * 'help' is only used by ReportingMenu.vue. */ - type: 'toast'|'persistent'|'transient'; + type: 'toast'|'persistent'|'transient'|'help'; /** * If set, the close icon is not displayed. @@ -85,6 +88,11 @@ interface Notification { * Where to place the notification. Required if showing a toast. */ placeat?: string|HTMLElement|JQuery; + + /** + * If true, the notification will be displayed before others currently displayed. + */ + prepend?: boolean; } interface NotificationsData { @@ -99,7 +107,7 @@ class NotificationsStore { private nextNotificationId = 0; get state(): DeepReadonly<NotificationsData> { - return this.privateState; + return readonly(this.privateState); } appendNotification(notification: Notification): void { @@ -162,7 +170,7 @@ class NotificationsStore { show(notification: Notification): string { this.checkMessage(notification.message); - let addMethod = this.appendNotification; + let addMethod = notification.prepend ? this.prependNotification : this.appendNotification; let notificationPosition: typeof Notification['placeat'] = '#notificationContainer'; if (notification.placeat) { diff --git a/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue b/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue index 20c8588fc3..6ca1e9c9d2 100644 --- a/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue +++ b/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue @@ -423,7 +423,8 @@ export default defineComponent({ const leftMenuItems: SubMenuItem[] = []; document.querySelectorAll('#secondNavBar .menuTab').forEach((element) => { - let category = window.$(element).find('> .item').text().trim(); + let category = window.$(element).find('> .item'); + category = category[0] ? category[0].innerText.trim() : ''; if (category && category.lastIndexOf('\n') !== -1) { // remove "\n\nMenu" diff --git a/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.adapter.ts b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.adapter.ts new file mode 100644 index 0000000000..8de6fd465c --- /dev/null +++ b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.adapter.ts @@ -0,0 +1,14 @@ +/*! + * 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 ReportingMenu from './ReportingMenu.vue'; + +export default createAngularJsAdapter({ + component: ReportingMenu, + directiveName: 'piwikReportingMenu', +}); diff --git a/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.adapter.ts b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.adapter.ts new file mode 100644 index 0000000000..cb176e8443 --- /dev/null +++ b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.adapter.ts @@ -0,0 +1,48 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import ReportingMenuStoreInstance from './ReportingMenu.store'; +import { cloneThenApply } from '../createAngularJsAdapter'; + +// removed boolean active property from objects in vue so we can keep the store immutable, but, +// angularjs version should still have them +function addActiveMenuItems(menu: typeof ReportingMenuStoreInstance.menu.value) { + menu.forEach((category) => { + if (category.id === ReportingMenuStoreInstance.activeCategory.value) { + category.active = true; + + (category.subcategories || []).forEach((subcat) => { + if (subcat.id === ReportingMenuStoreInstance.activeSubcategory.value) { + subcat.active = true; + + (subcat.subcategories || []).forEach((subsubcat) => { + if (subsubcat.id === ReportingMenuStoreInstance.activeSubsubcategory.value) { + subsubcat.active = true; + } + }); + } + }); + } + }); + return menu; +} + +function reportingMenuModelAdapter() { + return { + get menu() { + return ReportingMenuStoreInstance.menu.value; + }, + findSubcategory: + ReportingMenuStoreInstance.findSubcategory.bind(ReportingMenuStoreInstance), + reloadMenuItems: () => ReportingMenuStoreInstance.reloadMenuItems() + .then((p) => addActiveMenuItems(cloneThenApply(p))), + fetchMenuItems: () => ReportingMenuStoreInstance.fetchMenuItems() + .then((p) => addActiveMenuItems(cloneThenApply(p))), + }; +} + +angular.module('piwikApp.service').factory('reportingMenuModel', reportingMenuModelAdapter); diff --git a/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.ts b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.ts new file mode 100644 index 0000000000..05b4096b1d --- /dev/null +++ b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.ts @@ -0,0 +1,231 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { computed, reactive, readonly } from 'vue'; +import ReportingPagesStoreInstance from '../ReportingPages/ReportingPages.store'; +import MatomoUrl from '../MatomoUrl/MatomoUrl'; +import translate from '../translate'; + +interface Orderable { + order: number; +} + +export interface Subcategory extends Orderable { + id: string; + name: string; + isGroup: boolean; + icon?: string; + tooltip?: string; + help?: string; + subcategories: Subcategory[]; +} + +export interface Category extends Orderable { + id: string; + name: string; + icon?: string; + tooltip?: string; + subcategories: Subcategory[]; +} + +interface ReportingMenuStoreState { + activeCategoryId: string; + activeSubcategoryId: string; + activeSubsubcategoryId: string; +} + +interface SubcategoryFindResult { + category: Category; + subcategory: Subcategory; + subsubcategory: Subcategory; +} + +function isNumeric(text) { + const n = parseFloat(text); + return !Number.isNaN(n) && Number.isFinite(n); +} + +export class ReportingMenuStore { + private privateState = reactive<ReportingMenuStoreState>({ + activeCategoryId: null, + activeSubcategoryId: null, + activeSubsubcategoryId: null, + }); + + private state = computed(() => readonly(this.privateState)); + + readonly activeCategory = computed(() => this.state.value.activeCategoryId + || MatomoUrl.parsed.value.category); + + readonly activeSubcategory = computed(() => this.state.value.activeSubcategoryId + || MatomoUrl.parsed.value.subcategory); + + readonly activeSubsubcategory = computed(() => this.state.value.activeSubsubcategoryId); + + readonly menu = computed(() => this.buildMenuFromPages()); + + fetchMenuItems(): Promise<typeof ReportingPagesStoreInstance['menu']['value']> { + return ReportingPagesStoreInstance.getAllPages().then(() => this.menu.value); + } + + reloadMenuItems(): Promise<typeof ReportingMenuStore['menu']['value']> { + return ReportingPagesStoreInstance.reloadAllPages().then(() => this.menu.value); + } + + findSubcategory(categoryId: string, subcategoryId: string): SubcategoryFindResult { + let foundCategory = null; + let foundSubcategory = null; + let foundSubSubcategory = null; + + this.menu.value.forEach((category) => { + if (category.id !== categoryId) { + return; + } + + (category.subcategories || []).forEach((subcategory) => { + if (subcategory.id === subcategoryId) { + foundCategory = category; + foundSubcategory = subcategory; + } + + if (subcategory.isGroup) { + (subcategory.subcategories || []).forEach((subcat) => { + if (subcat.id === subcategoryId) { + foundCategory = category; + foundSubcategory = subcategory; + foundSubSubcategory = subcat; + } + }); + } + }); + }); + + return { + category: foundCategory, + subcategory: foundSubcategory, + subsubcategory: foundSubSubcategory, + }; + } + + private buildMenuFromPages() { + const menu = []; + + const activeCategory = this.activeCategory.value; + const activeSubcategory = this.activeSubcategory.value; + + const pages = ReportingPagesStoreInstance.pages.value; + + const categoriesHandled = {}; + pages.forEach((page) => { + const category = { ...page.category } as Category; + const categoryId = category.id; + const isCategoryActive = categoryId === activeCategory; + + if (categoriesHandled[categoryId]) { + return; + } + + categoriesHandled[categoryId] = true; + + category.subcategories = []; + + let categoryGroups: Subcategory; + + const pagesWithCategory = pages.filter((p) => p.category.id === categoryId); + pagesWithCategory.forEach((p) => { + const subcategory = { ...p.subcategory } as Subcategory; + const isSubcategoryActive = subcategory.id === activeSubcategory && isCategoryActive; + + if (p.widgets && p.widgets[0] && isNumeric(p.subcategory.id)) { + // we handle a goal or something like it + if (!categoryGroups) { + categoryGroups = { ...subcategory } as Subcategory; + categoryGroups.name = translate('CoreHome_ChooseX', [category.name]); + categoryGroups.isGroup = true; + categoryGroups.subcategories = []; + categoryGroups.order = 10; + } + + if (isSubcategoryActive) { + categoryGroups.name = subcategory.name; + } + + const entityId = page.subcategory.id; + subcategory.tooltip = `${subcategory.name} (id = ${entityId})`; + + categoryGroups.subcategories.push(subcategory); + return; + } + + category.subcategories.push(subcategory); + }); + + if (categoryGroups + && categoryGroups.subcategories + && categoryGroups.subcategories.length <= 5 + ) { + categoryGroups.subcategories.forEach((sub) => category.subcategories.push(sub)); + } else if (categoryGroups) { + category.subcategories.push(categoryGroups); + } + + category.subcategories = this.sortMenuItems(category.subcategories); + + menu.push(category); + }); + + return this.sortMenuItems(menu); + } + + private sortMenuItems<T extends Orderable>(menu: T[]): T[] { + const result = [...menu]; + result.sort((lhs, rhs) => { + if (lhs.order < rhs.order) { + return -1; + } + + if (lhs.order > rhs.order) { + return 1; + } + + return 0; + }); + return result; + } + + toggleCategory(category: Category): boolean { + this.privateState.activeSubcategoryId = null; + this.privateState.activeSubsubcategoryId = null; + + if (this.privateState.activeCategoryId === category.id) { + this.privateState.activeCategoryId = null; + return false; + } + + this.privateState.activeCategoryId = category.id; + return true; + } + + enterSubcategory( + category?: Category, + subcategory?: Subcategory, + subsubcategory?: Subcategory, + ): void { + if (!category || !subcategory) { + return; + } + + this.privateState.activeCategoryId = category.id; + this.privateState.activeSubcategoryId = subcategory.id; + + if (subsubcategory) { + this.privateState.activeSubsubcategoryId = subsubcategory.id; + } + } +} + +export default new ReportingMenuStore(); diff --git a/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.vue b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.vue new file mode 100644 index 0000000000..379f387b4e --- /dev/null +++ b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.vue @@ -0,0 +1,358 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <div class="reportingMenu"> + <ul + class="navbar hide-on-med-and-down" + role="menu" + :aria-label="translate('CoreHome_MainNavigation')" + > + <li + class="menuTab" + role="menuitem" + v-for="category in menu" + :class="{ 'active': category.id === activeCategory }" + :key="category.id" + > + <a + class="item" + tabindex="5" + href="" + @click.prevent="loadCategory(category)" + > + <span + :class="`menu-icon ${category.icon ? category.icon : 'icon-arrow-right'}`" + />{{ category.name }} + <span class="hidden"> + {{ translate('CoreHome_Menu') }} + </span> + </a> + <ul role="menu"> + <li + role="menuitem" + :class="{'active': subcategory.id === activeSubcategory}" + v-for="subcategory in category.subcategories" + :key="subcategory.id" + > + <MenuDropdown + v-if="subcategory.isGroup" + :show-search="true" + :menu-title="htmlEntities(subcategory.name)" + > + <a + class="item" + tabindex="5" + :class="{active: subcat.id === activeSubsubcategory}" + :href="`#?${makeUrl(category, subcat)}`" + @click="loadSubcategory(category, subcat, $event)" + v-for="subcat in subcategory.subcategories" + :title="subcat.tooltip" + :key="subcat.id" + > + {{ subcat.name }} + </a> + </MenuDropdown> + <a + v-if="!subcategory.isGroup" + :href="`#?${makeUrl(category, subcategory)}`" + class="item" + @click="loadSubcategory(category, subcategory, $event)" + > + {{ subcategory.name }} + </a> + <a + class="item-help-icon" + tabindex="5" + href="javascript:" + v-if="subcategory.help" + @click="showHelp(category, subcategory, $event)" + :class="{active: helpShownCategory + && helpShownCategory.subcategory === subcategory.id + && helpShownCategory.category === category.id + && subcategory.help}" + > + <span class="icon-help" /> + </a> + </li> + </ul> + </li> + </ul> + <ul + id="mobile-left-menu" + class="sidenav hide-on-large-only" + > + <li + class="no-padding" + v-for="category in menu" + :key="category.id" + > + <ul + class="collapsible collapsible-accordion" + v-side-nav="{ activator: sideNavActivator }" + > + <li> + <a class="collapsible-header"> + <i :class="category.icon ? category.icon : 'icon-arrow-bottom'" />{{ category.name }} + </a> + <div class="collapsible-body"> + <ul> + <li v-for="subcategory in category.subcategories" :key="subcategory.id"> + <span v-if="subcategory.isGroup"> + <a + @click="loadSubcategory(category, subcat)" + :href="`#?${makeUrl(category, subcat)}`" + v-for="subcat in subcategory.subcategories" + :key="subcat.id" + > + {{ subcat.name }} + </a> + </span> + <span v-if="!subcategory.isGroup"> + <a + @click="loadSubcategory(category, subcategory)" + :href="`#?${makeUrl(category, subcategory)}`" + > + {{ subcategory.name }} + </a> + </span> + </li> + </ul> + </div> + </li> + </ul> + </li> + </ul> + </div> +</template> + +<script lang="ts"> +import { defineComponent, watch } from 'vue'; +import MenuDropdown from '../MenuDropdown/MenuDropdown.vue'; +import SideNav from '../SideNav/SideNav'; +import { NotificationsStore } from '../Notification'; +import MatomoUrl from '../MatomoUrl/MatomoUrl'; +import ReportingMenuStoreInstance, { Category, Subcategory } from './ReportingMenu.store'; +import Matomo from '../Matomo/Matomo'; +import translate from '../translate'; + +const REPORTING_HELP_NOTIFICATION_ID = 'reportingmenu-help'; + +export default defineComponent({ + components: { + MenuDropdown, + }, + directives: { + SideNav, + }, + props: {}, + data() { + return { + showSubcategoryHelpOnLoad: null, + initialLoad: true, + helpShownCategory: null, + }; + }, + computed: { + sideNavActivator() { + return document.querySelector('nav .activateLeftMenu'); + }, + menu() { + return ReportingMenuStoreInstance.menu.value; + }, + activeCategory() { + return ReportingMenuStoreInstance.activeCategory.value; + }, + activeSubcategory() { + return ReportingMenuStoreInstance.activeSubcategory.value; + }, + activeSubsubcategory() { + return ReportingMenuStoreInstance.activeSubsubcategory.value; + }, + }, + created() { + ReportingMenuStoreInstance.fetchMenuItems().then((menu) => { + if (!MatomoUrl.parsed.value.subcategory) { + const categoryToLoad = menu[0]; + const subcategoryToLoad = categoryToLoad.subcategories[0]; + + // load first, initial page if no subcategory is present + ReportingMenuStoreInstance.enterSubcategory(categoryToLoad, subcategoryToLoad); + this.propagateUrlChange(categoryToLoad, subcategoryToLoad); + } + }); + + watch(() => MatomoUrl.parsed.value, (query) => { + const found = ReportingMenuStoreInstance.findSubcategory(query.category, query.subcategory); + ReportingMenuStoreInstance.enterSubcategory( + found.category, + found.subcategory, + found.subsubcategory, + ); + }); + + Matomo.on('piwikPageChange', () => { + if (!this.initialLoad) { + window.globalAjaxQueue.abort(); + } + + this.helpShownCategory = null; + + if (this.showSubcategoryHelpOnLoad) { + this.showHelp( + this.showSubcategoryHelpOnLoad.category, + this.showSubcategoryHelpOnLoad.subcategory, + ); + this.showSubcategoryHelpOnLoad = null; + } + + window.$('#loadingError').hide(); + + this.initialLoad = false; + }); + + Matomo.on('updateReportingMenu', () => { + ReportingMenuStoreInstance.reloadMenuItems().then(() => { + const { category, subcategory } = MatomoUrl.parsed.value; + + // we need to make sure to select same categories again + if (category && subcategory) { + const found = ReportingMenuStoreInstance.findSubcategory(category, subcategory); + if (found) { + ReportingMenuStoreInstance.enterSubcategory( + found.category, + found.subcategory, + found.subsubcategory, + ); + } + } + }); + + if (typeof window.widgetsHelper === 'object' && window.widgetsHelper.availableWidgets) { + // lets also update widgetslist so will be easier to update list of available widgets in + // dashboard selector immediately + delete window.widgetsHelper.availableWidgets; + window.widgetsHelper.getAvailableWidgets(); + } + }); + }, + methods: { + propagateUrlChange(category: Category, subcategory: Subcategory) { + const queryParams = MatomoUrl.parsed.value; + if (queryParams.category === category.id && queryParams.subcategory === subcategory.id) { + // we need to manually trigger change as URL would not change and therefore page would not + // be reloaded + this.loadSubcategory(category, subcategory); + } else { + MatomoUrl.updateHash({ + ...MatomoUrl.hashParsed.value, + category: category.id, + subcategory: subcategory.id, + }); + } + }, + loadCategory(category: Category) { + NotificationsStore.remove(REPORTING_HELP_NOTIFICATION_ID); + + const isActive = ReportingMenuStoreInstance.toggleCategory(category); + if (isActive && category.subcategories && category.subcategories.length === 1) { + this.helpShownCategory = null; + + const subcategory = category.subcategories[0]; + this.propagateUrlChange(category, subcategory); + } + }, + loadSubcategory(category: Category, subcategory: Subcategory, event: MouseEvent) { + if (event.shiftKey || event.ctrlKey || event.metaKey) { + return; + } + + NotificationsStore.remove(REPORTING_HELP_NOTIFICATION_ID); + + if (subcategory && subcategory.id === this.activeSubcategory) { + this.helpShownCategory = null; + + // this menu item is already active, a location change success would not be triggered, + // instead trigger an event + Matomo.postEvent('loadPage', category.id, subcategory.id); + } + }, + makeUrl(category: Category, subcategory: Subcategory) { + const { + idSite, + period, + date, + segment, + comparePeriods, + compareDates, + compareSegments, + } = MatomoUrl.parsed.value; + + return MatomoUrl.stringify({ + idSite, + period, + date, + segment, + comparePeriods, + compareDates, + compareSegments, + category: category.id, + subcategory: subcategory.id, + }); + }, + htmlEntities(v: string) { + return Matomo.helper.htmlEntities(v); + }, + showHelp(category: Category, subcategory: Subcategory, event?: Event) { + const parsedUrl = MatomoUrl.parsed.value; + const currentCategory = parsedUrl.category; + const currentSubcategory = parsedUrl.subcategory; + + if ((currentCategory !== category.id + || currentSubcategory !== subcategory.id) + && event + ) { + this.showSubcategoryHelpOnLoad = { category, subcategory }; + MatomoUrl.updateHash({ + ...MatomoUrl.hashParsed.value, + category: category.id, + subcategory: subcategory.id, + }); + return; + } + + if (this.helpShownCategory + && category.id === this.helpShownCategory.category + && subcategory.id === this.helpShownCategory.subcategory + ) { + NotificationsStore.remove(REPORTING_HELP_NOTIFICATION_ID); + this.helpShownCategory = null; + return; + } + + const prefixText = translate('CoreHome_ReportingCategoryHelpPrefix', + category.name, subcategory.name); + const prefix = `<strong>${prefixText}</strong><br/>`; + + NotificationsStore.show({ + context: 'info', + id: REPORTING_HELP_NOTIFICATION_ID, + type: 'help', + noclear: true, + class: 'help-notification', + message: prefix + subcategory.help, + placeat: '#notificationContainer', + prepend: true, + }); + + this.helpShownCategory = { + category: category.id, + subcategory: subcategory.id, + }; + }, + }, +}); +</script> diff --git a/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts b/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts index 7f2af14c4e..5d2b92f502 100644 --- a/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts +++ b/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts @@ -18,9 +18,15 @@ interface SubcategoryRef { name: string; } +interface WidgetRef { + module: string; + action: string; +} + interface Page { category: CategoryRef; subcategory: SubcategoryRef; + widgets: WidgetRef; } interface ReportingPagesStoreState { diff --git a/plugins/CoreHome/vue/src/SideNav/SideNav.adapter.ts b/plugins/CoreHome/vue/src/SideNav/SideNav.adapter.ts new file mode 100644 index 0000000000..7a7f6c6316 --- /dev/null +++ b/plugins/CoreHome/vue/src/SideNav/SideNav.adapter.ts @@ -0,0 +1,35 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { IDirective, ITimeoutService } from 'angular'; +import SideNav from './SideNav'; + +export default function piwikSideNav($timeout: ITimeoutService): IDirective { + return { + restrict: 'A', + priority: 10, + link: function linkPiwikSideNav(scope, element, attr) { + const binding = { + instance: null, + value: { + activator: $(attr.piwikSideNav)[0], + }, + oldValue: null, + modifiers: {}, + dir: {}, + }; + + $timeout(() => { + SideNav.mounted(element[0], binding); + }); + }, + }; +} + +piwikSideNav.$inject = ['$timeout']; + +angular.module('piwikApp.directive').directive('piwikSideNav', piwikSideNav); diff --git a/plugins/CoreHome/vue/src/SideNav/SideNav.ts b/plugins/CoreHome/vue/src/SideNav/SideNav.ts new file mode 100644 index 0000000000..fa39d9e45d --- /dev/null +++ b/plugins/CoreHome/vue/src/SideNav/SideNav.ts @@ -0,0 +1,52 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { DirectiveBinding } from 'vue'; +import DirectiveUtilities from '../directiveUtilities'; + +interface SideNavArgs { + activator: HTMLElement | string; +} + +let initialized = false; + +/** + * Will activate the materialize side nav feature once rendered. We use this directive as + * it makes sure the actual left menu is rendered at the time we init the side nav. + * + * Has to be set on a collaapsible element + * + * Example: + * <div class="collapsible" v-side-nav="nav .activateLeftMenu">...</div> + */ +export default { + mounted(el: HTMLElement, binding: DirectiveBinding<SideNavArgs>): void { + if (!binding.value.activator) { + return; + } + + setTimeout(() => { + if (!initialized) { + initialized = true; + + const sideNavActivator = DirectiveUtilities.getRef(binding.value.activator, binding); + if (sideNavActivator) { + window.$(sideNavActivator).show(); + } + + const targetSelector = sideNavActivator.getAttribute('data-target'); + window.$(`#${targetSelector}`).sidenav({ + closeOnClick: true, + }); + } + + if (el.classList.contains('collapsible')) { + window.$(el).collapsible(); + } + }); + }, +}; diff --git a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts index 2e5fcffd80..3b62d9bdbd 100644 --- a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts +++ b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts @@ -39,7 +39,22 @@ export default createAngularJsAdapter<[ITimeoutService]>({ placeholder: { angularJsBind: '@', }, - modelValue: {}, + modelValue: { + default(scope, element, attrs) { + if (attrs.siteid && attrs.sitename) { + return { id: attrs.siteid, name: Matomo.helper.htmlDecode(attrs.sitename) }; + } + + if (Matomo.idSite) { + return { + id: Matomo.idSite, + name: Matomo.helper.htmlDecode(Matomo.siteName), + }; + } + + return undefined; + }, + }, }, $inject: ['$timeout'], directiveName: 'piwikSiteselector', @@ -55,17 +70,10 @@ export default createAngularJsAdapter<[ITimeoutService]>({ element.attr('siteid', newValue.id); element.trigger('change', newValue); - if (ngModel - // the original site selector did not initiate an ngModel change when initializing its - // internal selectedSite state. mimicking that behavior here for BC. - && (scope.isNotFirstModelChange - || vm.modelValue) - ) { + if (ngModel) { ngModel.$setViewValue(newValue); ngModel.$render(); // not called automatically by the digest } - - scope.isNotFirstModelChange = true; }); } }, @@ -73,37 +81,32 @@ export default createAngularJsAdapter<[ITimeoutService]>({ setTimeout(() => scope.$apply()); }, }, - postCreate(vm, scope, element, attrs, controller, $timeout: ITimeoutService) { + postCreate(vm, scope, element, attrs, controller) { const ngModel = controller as INgModelController; scope.$watch('value', (newVal) => { - if (newVal !== vm.modelValue) { - vm.modelValue = newVal; - } + nextTick(() => { + if (newVal !== vm.modelValue) { + vm.modelValue = newVal; + } + }); }); // setup ng-model mapping if (ngModel) { - if (vm.modelValue) { - ngModel.$setViewValue(vm.modelValue); - } + ngModel.$setViewValue(vm.modelValue); ngModel.$render = () => { nextTick(() => { - if (angular.isString(ngModel.$viewValue)) { - vm.modelValue = JSON.parse(ngModel.$viewValue); - } else { - vm.modelValue = ngModel.$viewValue; - } + nextTick(() => { + if (angular.isString(ngModel.$viewValue)) { + vm.modelValue = JSON.parse(ngModel.$viewValue); + } else { + vm.modelValue = ngModel.$viewValue; + } + }); }); }; } - - $timeout(() => { - if (attrs.siteid && attrs.sitename) { - vm.modelValue = { id: attrs.siteid, name: Matomo.helper.htmlDecode(attrs.sitename) }; - ngModel.$setViewValue({ ...vm.modelValue }); - } - }); }, }); diff --git a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue index abb4237423..6a5087e96d 100644 --- a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue +++ b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue @@ -147,9 +147,15 @@ export default defineComponent({ props: { modelValue: { Object, - default: { - id: Matomo.idSite, - name: Matomo.helper.htmlDecode(Matomo.siteName), + default: (props) => { + if (props.modelValue) { + return props.modelValue; + } + + return (Matomo.idSite ? { + id: Matomo.idSite, + name: Matomo.helper.htmlDecode(Matomo.siteName), + } : undefined); }, }, showSelectedSite: { @@ -202,10 +208,6 @@ export default defineComponent({ showSitesList: false, isLoading: false, sites: [], - selectedSite: this.modelValue || { - id: Matomo.idSite, - name: Matomo.helper.htmlDecode(Matomo.siteName), - }, autocompleteMinSites: parseInt(Matomo.config.autocomplete_min_sites as string, 10), }; }, @@ -213,7 +215,7 @@ export default defineComponent({ window.initTopControls(); this.loadInitialSites().then(() => { - if ((!this.modelValue || !this.modelValue.id) && this.sites[0]) { + if ((!this.modelValue || !this.modelValue.id) && !this.hasMultipleSites && this.sites[0]) { this.$emit('update:modelValue', { id: this.sites[0].idsite, name: this.sites[0].name }); } }); @@ -246,7 +248,8 @@ export default defineComponent({ return SitesStore.initialSites.value && SitesStore.initialSites.value.length > 1; }, firstSiteName() { - return this.sites && this.sites.length > 0 ? this.sites[0].name : ''; + const initialSites = SitesStore.initialSites.value; + return initialSites && initialSites.length > 0 ? initialSites[0].name : ''; }, urlAllSites() { const newQuery = MatomoUrl.stringify({ diff --git a/plugins/CoreHome/vue/src/createAngularJsAdapter.ts b/plugins/CoreHome/vue/src/createAngularJsAdapter.ts index 8e975c1f21..0fdedb37cf 100644 --- a/plugins/CoreHome/vue/src/createAngularJsAdapter.ts +++ b/plugins/CoreHome/vue/src/createAngularJsAdapter.ts @@ -321,6 +321,10 @@ export function transformAngularJsIntAttr(v: string): number { // utility function for service adapters export function clone<T>(p: T): T { + if (typeof p === 'undefined') { + return p; + } + return JSON.parse(JSON.stringify(p)) as T; } diff --git a/plugins/CoreHome/vue/src/index.ts b/plugins/CoreHome/vue/src/index.ts index 2cfa12de93..14b11e22bb 100644 --- a/plugins/CoreHome/vue/src/index.ts +++ b/plugins/CoreHome/vue/src/index.ts @@ -20,6 +20,7 @@ import './FocusAnywhereButHere/FocusAnywhereButHere.adapter'; import './FocusIf/FocusIf.adapter'; import './ExpandOnClick/ExpandOnClick.adapter'; import './ExpandOnHover/ExpandOnHover.adapter'; +import './SideNav/SideNav.adapter'; import './MatomoDialog/MatomoDialog.adapter'; import './EnrichedHeadline/EnrichedHeadline.adapter'; import './ContentBlock/ContentBlock.adapter'; @@ -33,6 +34,8 @@ import './QuickAccess/QuickAccess.adapter'; import './FieldArray/FieldArray.adapter'; import './MultiPairField/MultiPairField.adapter'; import './PeriodSelector/PeriodSelector.adapter'; +import './ReportingMenu/ReportingMenu.adapter'; +import './ReportingMenu/ReportingMenu.store.adapter'; import './ReportingPages/ReportingPages.store.adapter'; import './ReportMetadata/ReportMetadata.store.adapter'; @@ -59,6 +62,7 @@ export { default as FocusIf } from './FocusIf/FocusIf'; export { default as MatomoDialog } from './MatomoDialog/MatomoDialog.vue'; export { default as ExpandOnClick } from './ExpandOnClick/ExpandOnClick'; export { default as ExpandOnHover } from './ExpandOnHover/ExpandOnHover'; +export { default as SideNav } from './SideNav/SideNav'; export { default as EnrichedHeadline } from './EnrichedHeadline/EnrichedHeadline.vue'; export { default as ContentBlock } from './ContentBlock/ContentBlock.vue'; export { default as Comparisons } from './Comparisons/Comparisons.vue'; @@ -72,5 +76,6 @@ export { default as QuickAccess } from './QuickAccess/QuickAccess.vue'; export { default as FieldArray } from './FieldArray/FieldArray.vue'; export { default as MultiPairField } from './MultiPairField/MultiPairField.vue'; export { default as PeriodSelector } from './PeriodSelector/PeriodSelector.vue'; +export { default as ReportingMenu } from './ReportingMenu/ReportingMenu.vue'; export { default as ReportingPagesStore } from './ReportingPages/ReportingPages.store'; export { default as ReportMetadataStore } from './ReportMetadata/ReportMetadata.store'; diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js index 5d7f65aa94..e952be0d1d 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js @@ -2412,7 +2412,7 @@ function handleJsonValue(value, varType, uiControl) { // value, but only for 'site' uicontrols. this only happened for site selectors, no others. - if (scope.uicontrol === 'site') { + if (scope.uicontrol === 'site' && ngModel.$viewValue) { setTimeout(function () { ngModel.$setViewValue(Field_adapter_objectSpread({}, ngModel.$viewValue)); }); diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js index a35fd654f6..4e12d0d5de 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js @@ -22,7 +22,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function bn(e,t,n){if("string"===typeof e&&e&&("array"===t||"multituple"===n||"field-array"===n||"multiselect"===n||"site"===n)){var r=JSON.parse(e);return"site"===n&&(r.name=l["Matomo"].helper.htmlDecode(r.name)),r}return"checkbox"===n&&"array"!==t?Object(l["transformAngularJsBoolAttr"])(e):e}Object(l["createAngularJsAdapter"])({component:dn,require:"?ngModel",scope:{uicontrol:{angularJsBind:"@"},name:{angularJsBind:"@"},value:{vue:"modelValue",angularJsBind:"@",transform:function(e,t,n){return bn(e,n.varType,n.uicontrol)}},default:{vue:"defaultValue",angularJsBind:"@"},options:{angularJsBind:"="},description:{angularJsBind:"@"},introduction:{angularJsBind:"@"},title:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@"},disabled:{angularJsBind:"=",transform:l["transformAngularJsBoolAttr"]},uiControlAttributes:{angularJsBind:"="},uiControlOptions:{angularJsBind:"="},autocomplete:{angularJsBind:"@",transform:l["transformAngularJsBoolAttr"]},condition:{angularJsBind:"@",transform:function(e,t,n){var r=e;return e&&(r=function(t){return n.$eval(e,t)}),r}},varType:{angularJsBind:"@"},autofocus:{angularJsBind:"@",transform:l["transformAngularJsBoolAttr"]},tabindex:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},fullWidth:{angularJsBind:"@",transform:l["transformAngularJsBoolAttr"]},maxlength:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},required:{angularJsBind:"@",transform:l["transformAngularJsBoolAttr"]},placeholder:{angularJsBind:"@"},rows:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},min:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},max:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},component:{angularJsBind:"<",transform:function(e,t,n){if(!e)return e;if(n.templateFile)return Object(i["shallowRef"])(Yt);var r=e.plugin,o=e.name;if(!r||!o)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(i["shallowRef"])(Object(l["useExternalPluginComponent"])(r,o))}}},directiveName:"piwikField",$inject:["$timeout"],events:{"update:modelValue":function(e,t,n,r,o,l,i){var a=l?l.$viewValue:n.value;e!==a&&i((function(){l?(l.$setViewValue(e),l.$render()):n.value=e}))}},postCreate:function(e,t,n,r,o){var a=o;if(a){if(a.$render=function(){Object(i["nextTick"])((function(){e.modelValue=Object(l["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value){var u=bn(t.value,t.varType,t.uicontrol);a.$setViewValue(u)}else a.$setViewValue(e.modelValue);"site"===t.uicontrol&&setTimeout((function(){a.$setViewValue(fn({},a.$viewValue))}))}else t.$watch("value",(function(n){if(n!==e.modelValue){var r=bn(n,t.varType,t.uicontrol);Object(i["nextTick"])((function(){e.modelValue=r}))}}))}}); + */function bn(e,t,n){if("string"===typeof e&&e&&("array"===t||"multituple"===n||"field-array"===n||"multiselect"===n||"site"===n)){var r=JSON.parse(e);return"site"===n&&(r.name=l["Matomo"].helper.htmlDecode(r.name)),r}return"checkbox"===n&&"array"!==t?Object(l["transformAngularJsBoolAttr"])(e):e}Object(l["createAngularJsAdapter"])({component:dn,require:"?ngModel",scope:{uicontrol:{angularJsBind:"@"},name:{angularJsBind:"@"},value:{vue:"modelValue",angularJsBind:"@",transform:function(e,t,n){return bn(e,n.varType,n.uicontrol)}},default:{vue:"defaultValue",angularJsBind:"@"},options:{angularJsBind:"="},description:{angularJsBind:"@"},introduction:{angularJsBind:"@"},title:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@"},disabled:{angularJsBind:"=",transform:l["transformAngularJsBoolAttr"]},uiControlAttributes:{angularJsBind:"="},uiControlOptions:{angularJsBind:"="},autocomplete:{angularJsBind:"@",transform:l["transformAngularJsBoolAttr"]},condition:{angularJsBind:"@",transform:function(e,t,n){var r=e;return e&&(r=function(t){return n.$eval(e,t)}),r}},varType:{angularJsBind:"@"},autofocus:{angularJsBind:"@",transform:l["transformAngularJsBoolAttr"]},tabindex:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},fullWidth:{angularJsBind:"@",transform:l["transformAngularJsBoolAttr"]},maxlength:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},required:{angularJsBind:"@",transform:l["transformAngularJsBoolAttr"]},placeholder:{angularJsBind:"@"},rows:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},min:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},max:{angularJsBind:"@",transform:l["transformAngularJsIntAttr"]},component:{angularJsBind:"<",transform:function(e,t,n){if(!e)return e;if(n.templateFile)return Object(i["shallowRef"])(Yt);var r=e.plugin,o=e.name;if(!r||!o)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(i["shallowRef"])(Object(l["useExternalPluginComponent"])(r,o))}}},directiveName:"piwikField",$inject:["$timeout"],events:{"update:modelValue":function(e,t,n,r,o,l,i){var a=l?l.$viewValue:n.value;e!==a&&i((function(){l?(l.$setViewValue(e),l.$render()):n.value=e}))}},postCreate:function(e,t,n,r,o){var a=o;if(a){if(a.$render=function(){Object(i["nextTick"])((function(){e.modelValue=Object(l["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value){var u=bn(t.value,t.varType,t.uicontrol);a.$setViewValue(u)}else a.$setViewValue(e.modelValue);"site"===t.uicontrol&&a.$viewValue&&setTimeout((function(){a.$setViewValue(fn({},a.$viewValue))}))}else t.$watch("value",(function(n){if(n!==e.modelValue){var r=bn(n,t.varType,t.uicontrol);Object(i["nextTick"])((function(){e.modelValue=r}))}}))}}); /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CorePluginsAdmin/vue/src/Field/Field.adapter.ts b/plugins/CorePluginsAdmin/vue/src/Field/Field.adapter.ts index 51dc7dff9e..10f8a6847b 100644 --- a/plugins/CorePluginsAdmin/vue/src/Field/Field.adapter.ts +++ b/plugins/CorePluginsAdmin/vue/src/Field/Field.adapter.ts @@ -217,7 +217,7 @@ export default createAngularJsAdapter<[ITimeoutService]>({ // to provide same behavior in angularjs/<4.6.0, we trigger a model update to the same // value, but only for 'site' uicontrols. this only happened for site selectors, no others. - if (scope.uicontrol === 'site') { + if (scope.uicontrol === 'site' && ngModel.$viewValue) { setTimeout(() => { ngModel.$setViewValue({ ...ngModel.$viewValue }); }); diff --git a/plugins/CoreVue/polyfills/dist/MatomoPolyfills.js b/plugins/CoreVue/polyfills/dist/MatomoPolyfills.js index 3c2fb99476..232b3159b6 100644 --- a/plugins/CoreVue/polyfills/dist/MatomoPolyfills.js +++ b/plugins/CoreVue/polyfills/dist/MatomoPolyfills.js @@ -1273,7 +1273,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _hom /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nvar oldTrigger = window.$.fn.trigger;\n\nfunction triggerWithNativeEventDispatch(jqEventOrType, data) {\n function nativeDispatch(element) {\n var type = jqEventOrType.type || jqEventOrType;\n var onEventAttributeName = \"on\".concat(type);\n\n if (element[onEventAttributeName] || element[type] instanceof Function) {\n // if a on... (eg, onchange) handler is specified, it will be triggered by jquery.\n // it will also be triggered by addEventListener, and we don't want that so just\n // assume there is no addEventListener event.\n return;\n } // eslint-disable-next-line\n\n\n if ((window.$._data(element, 'events') || {})[type] && window.$._data(element, 'handle')) {\n // there is an event handler in jquery private data, assume this was handled.\n return;\n }\n\n if (element.dispatchEvent) {\n var event = new Event(type, {\n // do not rely on browser bubbling so we can keep checking for the on... attribute\n bubbles: false,\n cancelable: true\n });\n element.dispatchEvent(event);\n }\n\n var parent = element.parentElement;\n\n if (parent) {\n nativeDispatch(parent);\n }\n }\n\n var result = oldTrigger.call(this, jqEventOrType, data);\n this.each(function onEach() {\n nativeDispatch(this);\n });\n return result;\n}\n\nwindow.$.fn.trigger = triggerWithNativeEventDispatch;\n\n//# sourceURL=webpack:///plugins/CoreVue/polyfills/src/jqueryNativeEventTrigger.ts"); +eval("\n/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nvar oldTrigger = window.$.fn.trigger;\n\nfunction triggerWithNativeEventDispatch(jqEventOrType, data) {\n var isFirstElementOnPath = true;\n var type = jqEventOrType.type || jqEventOrType;\n var onEventAttributeName = \"on\".concat(type);\n\n function nativeDispatchSingleElement(element) {\n if (isFirstElementOnPath) {\n isFirstElementOnPath = false;\n\n if (element[onEventAttributeName] || element[type] instanceof Function // jquery disables calling the native click() method for links\n && !(type === 'click' && element.tagName.toUpperCase() === 'A')) {\n // if a on... (eg, onchange) handler is specified, it will be triggered by jquery.\n // it will also be triggered by addEventListener, and we don't want that so just\n // assume there is no addEventListener event.\n // NOTE: this only happens for the FIRST element on the event path. jquery's trigger\n // function will not call .click() on any other element in the event path.\n return;\n }\n } // eslint-disable-next-line\n\n\n if ((window.$._data(element, 'events') || {})[type] && window.$._data(element, 'handle')) {\n // there is an event handler in jquery private data, assume this was handled.\n return;\n }\n\n if (element.dispatchEvent) {\n var event = new Event(type, {\n // do not rely on browser bubbling so we can keep checking for the on... attribute\n bubbles: false,\n cancelable: true\n });\n element.dispatchEvent(event);\n }\n }\n\n function nativeDispatch(element) {\n nativeDispatchSingleElement(element);\n var parent = element.parentElement;\n\n if (parent) {\n nativeDispatch(parent);\n }\n }\n\n var result = oldTrigger.call(this, jqEventOrType, data);\n\n if (type === 'focus' || type === 'blur') {\n // jquery handles focus/blur fine\n return result;\n }\n\n this.each(function onEach() {\n nativeDispatch(this);\n });\n return result;\n}\n\nwindow.$.fn.trigger = triggerWithNativeEventDispatch;\n\n//# sourceURL=webpack:///plugins/CoreVue/polyfills/src/jqueryNativeEventTrigger.ts"); /***/ }) diff --git a/plugins/CoreVue/polyfills/dist/MatomoPolyfills.min.js b/plugins/CoreVue/polyfills/dist/MatomoPolyfills.min.js index 77d72e379c..a604a9bd02 100644 --- a/plugins/CoreVue/polyfills/dist/MatomoPolyfills.min.js +++ b/plugins/CoreVue/polyfills/dist/MatomoPolyfills.min.js @@ -10,7 +10,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var r=window.$.fn.trigger;function o(t,e){function n(e){var r=t.type||t,o="on".concat(r);if(!(e[o]||e[r]instanceof Function)&&(!(window.$._data(e,"events")||{})[r]||!window.$._data(e,"handle"))){if(e.dispatchEvent){var i=new Event(r,{bubbles:!1,cancelable:!0});e.dispatchEvent(i)}var a=e.parentElement;a&&n(a)}}var o=r.call(this,t,e);return this.each((function(){n(this)})),o}window.$.fn.trigger=o},a691:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},a79d:function(t,e,n){"use strict";var r=n("23e7"),o=n("c430"),i=n("fea9"),a=n("d039"),c=n("d066"),u=n("4840"),f=n("cdf9"),s=n("6eeb"),l=!!i&&a((function(){i.prototype["finally"].call({then:function(){}},(function(){}))}));if(r({target:"Promise",proto:!0,real:!0,forced:l},{finally:function(t){var e=u(this,c("Promise")),n="function"==typeof t;return this.then(n?function(n){return f(e,t()).then((function(){return n}))}:t,n?function(n){return f(e,t()).then((function(){throw n}))}:t)}}),!o&&"function"==typeof i){var p=c("Promise").prototype["finally"];i.prototype["finally"]!==p&&s(i.prototype,"finally",p,{unsafe:!0})}},ae93:function(t,e,n){"use strict";var r,o,i,a=n("d039"),c=n("e163"),u=n("9112"),f=n("5135"),s=n("b622"),l=n("c430"),p=s("iterator"),d=!1,m=function(){return this};[].keys&&(i=[].keys(),"next"in i?(o=c(c(i)),o!==Object.prototype&&(r=o)):d=!0);var v=void 0==r||a((function(){var t={};return r[p].call(t)!==t}));v&&(r={}),l&&!v||f(r,p)||u(r,p,m),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},b575:function(t,e,n){var r,o,i,a,c,u,f,s,l=n("da84"),p=n("06cf").f,d=n("2cf4").set,m=n("1cdc"),v=n("d4c3"),h=n("a4b4"),y=n("605d"),b=l.MutationObserver||l.WebKitMutationObserver,g=l.document,w=l.process,x=l.Promise,O=p(l,"queueMicrotask"),_=O&&O.value;_||(r=function(){var t,e;y&&(t=w.domain)&&t.exit();while(o){e=o.fn,o=o.next;try{e()}catch(n){throw o?a():i=void 0,n}}i=void 0,t&&t.enter()},m||y||h||!b||!g?!v&&x&&x.resolve?(f=x.resolve(void 0),f.constructor=x,s=f.then,a=function(){s.call(f,r)}):a=y?function(){w.nextTick(r)}:function(){d.call(l,r)}:(c=!0,u=g.createTextNode(""),new b(r).observe(u,{characterData:!0}),a=function(){u.data=c=!c})),t.exports=_||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,a()),i=e}},b622:function(t,e,n){var r=n("da84"),o=n("5692"),i=n("5135"),a=n("90e3"),c=n("4930"),u=n("fdbf"),f=o("wks"),s=r.Symbol,l=u?s:s&&s.withoutSetter||a;t.exports=function(t){return i(f,t)&&(c||"string"==typeof f[t])||(c&&i(s,t)?f[t]=s[t]:f[t]=l("Symbol."+t)),f[t]}},c04e:function(t,e,n){var r=n("861d"),o=n("d9b5"),i=n("485a"),a=n("b622"),c=a("toPrimitive");t.exports=function(t,e){if(!r(t)||o(t))return t;var n,a=t[c];if(void 0!==a){if(void 0===e&&(e="default"),n=a.call(t,e),!r(n)||o(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),i(t,e)}},c0c4:function(t,e,n){ + */var r=window.$.fn.trigger;function o(t,e){var n=!0,o=t.type||t,i="on".concat(o);function a(t){if(!(n&&(n=!1,t[i]||t[o]instanceof Function&&("click"!==o||"A"!==t.tagName.toUpperCase())))&&(!(window.$._data(t,"events")||{})[o]||!window.$._data(t,"handle"))&&t.dispatchEvent){var e=new Event(o,{bubbles:!1,cancelable:!0});t.dispatchEvent(e)}}function c(t){a(t);var e=t.parentElement;e&&c(e)}var u=r.call(this,t,e);return"focus"===o||"blur"===o||this.each((function(){c(this)})),u}window.$.fn.trigger=o},a691:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},a79d:function(t,e,n){"use strict";var r=n("23e7"),o=n("c430"),i=n("fea9"),a=n("d039"),c=n("d066"),u=n("4840"),f=n("cdf9"),s=n("6eeb"),l=!!i&&a((function(){i.prototype["finally"].call({then:function(){}},(function(){}))}));if(r({target:"Promise",proto:!0,real:!0,forced:l},{finally:function(t){var e=u(this,c("Promise")),n="function"==typeof t;return this.then(n?function(n){return f(e,t()).then((function(){return n}))}:t,n?function(n){return f(e,t()).then((function(){throw n}))}:t)}}),!o&&"function"==typeof i){var p=c("Promise").prototype["finally"];i.prototype["finally"]!==p&&s(i.prototype,"finally",p,{unsafe:!0})}},ae93:function(t,e,n){"use strict";var r,o,i,a=n("d039"),c=n("e163"),u=n("9112"),f=n("5135"),s=n("b622"),l=n("c430"),p=s("iterator"),d=!1,m=function(){return this};[].keys&&(i=[].keys(),"next"in i?(o=c(c(i)),o!==Object.prototype&&(r=o)):d=!0);var v=void 0==r||a((function(){var t={};return r[p].call(t)!==t}));v&&(r={}),l&&!v||f(r,p)||u(r,p,m),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},b575:function(t,e,n){var r,o,i,a,c,u,f,s,l=n("da84"),p=n("06cf").f,d=n("2cf4").set,m=n("1cdc"),v=n("d4c3"),h=n("a4b4"),y=n("605d"),b=l.MutationObserver||l.WebKitMutationObserver,g=l.document,w=l.process,x=l.Promise,O=p(l,"queueMicrotask"),_=O&&O.value;_||(r=function(){var t,e;y&&(t=w.domain)&&t.exit();while(o){e=o.fn,o=o.next;try{e()}catch(n){throw o?a():i=void 0,n}}i=void 0,t&&t.enter()},m||y||h||!b||!g?!v&&x&&x.resolve?(f=x.resolve(void 0),f.constructor=x,s=f.then,a=function(){s.call(f,r)}):a=y?function(){w.nextTick(r)}:function(){d.call(l,r)}:(c=!0,u=g.createTextNode(""),new b(r).observe(u,{characterData:!0}),a=function(){u.data=c=!c})),t.exports=_||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,a()),i=e}},b622:function(t,e,n){var r=n("da84"),o=n("5692"),i=n("5135"),a=n("90e3"),c=n("4930"),u=n("fdbf"),f=o("wks"),s=r.Symbol,l=u?s:s&&s.withoutSetter||a;t.exports=function(t){return i(f,t)&&(c||"string"==typeof f[t])||(c&&i(s,t)?f[t]=s[t]:f[t]=l("Symbol."+t)),f[t]}},c04e:function(t,e,n){var r=n("861d"),o=n("d9b5"),i=n("485a"),a=n("b622"),c=a("toPrimitive");t.exports=function(t,e){if(!r(t)||o(t))return t;var n,a=t[c];if(void 0!==a){if(void 0===e&&(e="default"),n=a.call(t,e),!r(n)||o(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),i(t,e)}},c0c4:function(t,e,n){ /*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */ -(function(e,n){t.exports=n()})(0,(function(){"use strict";function t(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}var e=Object.hasOwnProperty,n=Object.setPrototypeOf,r=Object.isFrozen,o=Object.getPrototypeOf,i=Object.getOwnPropertyDescriptor,a=Object.freeze,c=Object.seal,u=Object.create,f="undefined"!==typeof Reflect&&Reflect,s=f.apply,l=f.construct;s||(s=function(t,e,n){return t.apply(e,n)}),a||(a=function(t){return t}),c||(c=function(t){return t}),l||(l=function(e,n){return new(Function.prototype.bind.apply(e,[null].concat(t(n))))});var p=O(Array.prototype.forEach),d=O(Array.prototype.pop),m=O(Array.prototype.push),v=O(String.prototype.toLowerCase),h=O(String.prototype.match),y=O(String.prototype.replace),b=O(String.prototype.indexOf),g=O(String.prototype.trim),w=O(RegExp.prototype.test),x=_(TypeError);function O(t){return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(t,e,r)}}function _(t){return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return l(t,n)}}function S(t,e){n&&n(t,null);var o=e.length;while(o--){var i=e[o];if("string"===typeof i){var a=v(i);a!==i&&(r(e)||(e[o]=a),i=a)}t[i]=!0}return t}function T(t){var n=u(null),r=void 0;for(r in t)s(e,t,[r])&&(n[r]=t[r]);return n}function A(t,e){while(null!==t){var n=i(t,e);if(n){if(n.get)return O(n.get);if("function"===typeof n.value)return O(n.value)}t=o(t)}function r(t){return console.warn("fallback value for",t),null}return r}var E=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),j=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),k=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R=a(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),P=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),M=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),D=a(["#text"]),N=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),I=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),C=c(/\{\{[\s\S]*|[\s\S]*\}\}/gm),z=c(/<%[\s\S]*|[\s\S]*%>/gm),U=c(/^data-[\-\w.\u00B7-\uFFFF]/),H=c(/^aria-[\-\w]+$/),B=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=c(/^(?:\w+script|data):/i),W=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function Y(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}var $=function(){return"undefined"===typeof window?null:window},K=function(t,e){if("object"!==("undefined"===typeof t?"undefined":q(t))||"function"!==typeof t.createPolicy)return null;var n=null,r="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(r)&&(n=e.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:function(t){return t}})}catch(i){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function V(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$(),e=function(t){return V(t)};if(e.version="2.3.3",e.removed=[],!t||!t.document||9!==t.document.nodeType)return e.isSupported=!1,e;var n=t.document,r=t.document,o=t.DocumentFragment,i=t.HTMLTemplateElement,c=t.Node,u=t.Element,f=t.NodeFilter,s=t.NamedNodeMap,l=void 0===s?t.NamedNodeMap||t.MozNamedAttrMap:s,O=t.Text,_=t.Comment,X=t.DOMParser,Z=t.trustedTypes,J=u.prototype,Q=A(J,"cloneNode"),tt=A(J,"nextSibling"),et=A(J,"childNodes"),nt=A(J,"parentNode");if("function"===typeof i){var rt=r.createElement("template");rt.content&&rt.content.ownerDocument&&(r=rt.content.ownerDocument)}var ot=K(Z,n),it=ot&&Ft?ot.createHTML(""):"",at=r,ct=at.implementation,ut=at.createNodeIterator,ft=at.createDocumentFragment,st=at.getElementsByTagName,lt=n.importNode,pt={};try{pt=T(r).documentMode?r.documentMode:{}}catch(Oe){}var dt={};e.isSupported="function"===typeof nt&&ct&&"undefined"!==typeof ct.createHTMLDocument&&9!==pt;var mt=C,vt=z,ht=U,yt=H,bt=G,gt=W,wt=B,xt=null,Ot=S({},[].concat(Y(E),Y(j),Y(k),Y(P),Y(D))),_t=null,St=S({},[].concat(Y(N),Y(I),Y(L),Y(F))),Tt=null,At=null,Et=!0,jt=!0,kt=!1,Rt=!1,Pt=!1,Mt=!1,Dt=!1,Nt=!1,It=!1,Lt=!0,Ft=!1,Ct=!0,zt=!0,Ut=!1,Ht={},Bt=null,Gt=S({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Wt=null,qt=S({},["audio","video","img","source","image","track"]),Yt=null,$t=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",Vt="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml",Zt=Xt,Jt=!1,Qt=void 0,te=["application/xhtml+xml","text/html"],ee="text/html",ne=void 0,re=null,oe=r.createElement("form"),ie=function(t){re&&re===t||(t&&"object"===("undefined"===typeof t?"undefined":q(t))||(t={}),t=T(t),xt="ALLOWED_TAGS"in t?S({},t.ALLOWED_TAGS):Ot,_t="ALLOWED_ATTR"in t?S({},t.ALLOWED_ATTR):St,Yt="ADD_URI_SAFE_ATTR"in t?S(T($t),t.ADD_URI_SAFE_ATTR):$t,Wt="ADD_DATA_URI_TAGS"in t?S(T(qt),t.ADD_DATA_URI_TAGS):qt,Bt="FORBID_CONTENTS"in t?S({},t.FORBID_CONTENTS):Gt,Tt="FORBID_TAGS"in t?S({},t.FORBID_TAGS):{},At="FORBID_ATTR"in t?S({},t.FORBID_ATTR):{},Ht="USE_PROFILES"in t&&t.USE_PROFILES,Et=!1!==t.ALLOW_ARIA_ATTR,jt=!1!==t.ALLOW_DATA_ATTR,kt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=t.SAFE_FOR_TEMPLATES||!1,Pt=t.WHOLE_DOCUMENT||!1,Nt=t.RETURN_DOM||!1,It=t.RETURN_DOM_FRAGMENT||!1,Lt=!1!==t.RETURN_DOM_IMPORT,Ft=t.RETURN_TRUSTED_TYPE||!1,Dt=t.FORCE_BODY||!1,Ct=!1!==t.SANITIZE_DOM,zt=!1!==t.KEEP_CONTENT,Ut=t.IN_PLACE||!1,wt=t.ALLOWED_URI_REGEXP||wt,Zt=t.NAMESPACE||Xt,Qt=Qt=-1===te.indexOf(t.PARSER_MEDIA_TYPE)?ee:t.PARSER_MEDIA_TYPE,ne="application/xhtml+xml"===Qt?function(t){return t}:v,Rt&&(jt=!1),It&&(Nt=!0),Ht&&(xt=S({},[].concat(Y(D))),_t=[],!0===Ht.html&&(S(xt,E),S(_t,N)),!0===Ht.svg&&(S(xt,j),S(_t,I),S(_t,F)),!0===Ht.svgFilters&&(S(xt,k),S(_t,I),S(_t,F)),!0===Ht.mathMl&&(S(xt,P),S(_t,L),S(_t,F))),t.ADD_TAGS&&(xt===Ot&&(xt=T(xt)),S(xt,t.ADD_TAGS)),t.ADD_ATTR&&(_t===St&&(_t=T(_t)),S(_t,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&S(Yt,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(Bt===Gt&&(Bt=T(Bt)),S(Bt,t.FORBID_CONTENTS)),zt&&(xt["#text"]=!0),Pt&&S(xt,["html","head","body"]),xt.table&&(S(xt,["tbody"]),delete Tt.tbody),a&&a(t),re=t)},ae=S({},["mi","mo","mn","ms","mtext"]),ce=S({},["foreignobject","desc","title","annotation-xml"]),ue=S({},j);S(ue,k),S(ue,R);var fe=S({},P);S(fe,M);var se=function(t){var e=nt(t);e&&e.tagName||(e={namespaceURI:Xt,tagName:"template"});var n=v(t.tagName),r=v(e.tagName);if(t.namespaceURI===Vt)return e.namespaceURI===Xt?"svg"===n:e.namespaceURI===Kt?"svg"===n&&("annotation-xml"===r||ae[r]):Boolean(ue[n]);if(t.namespaceURI===Kt)return e.namespaceURI===Xt?"math"===n:e.namespaceURI===Vt?"math"===n&&ce[r]:Boolean(fe[n]);if(t.namespaceURI===Xt){if(e.namespaceURI===Vt&&!ce[r])return!1;if(e.namespaceURI===Kt&&!ae[r])return!1;var o=S({},["title","style","font","a","script"]);return!fe[n]&&(o[n]||!ue[n])}return!1},le=function(t){m(e.removed,{element:t});try{t.parentNode.removeChild(t)}catch(Oe){try{t.outerHTML=it}catch(Oe){t.remove()}}},pe=function(t,n){try{m(e.removed,{attribute:n.getAttributeNode(t),from:n})}catch(Oe){m(e.removed,{attribute:null,from:n})}if(n.removeAttribute(t),"is"===t&&!_t[t])if(Nt||It)try{le(n)}catch(Oe){}else try{n.setAttribute(t,"")}catch(Oe){}},de=function(t){var e=void 0,n=void 0;if(Dt)t="<remove></remove>"+t;else{var o=h(t,/^[\r\n\t ]+/);n=o&&o[0]}"application/xhtml+xml"===Qt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var i=ot?ot.createHTML(t):t;if(Zt===Xt)try{e=(new X).parseFromString(i,Qt)}catch(Oe){}if(!e||!e.documentElement){e=ct.createDocument(Zt,"template",null);try{e.documentElement.innerHTML=Jt?"":i}catch(Oe){}}var a=e.body||e.documentElement;return t&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),Zt===Xt?st.call(e,Pt?"html":"body")[0]:Pt?e.documentElement:a},me=function(t){return ut.call(t.ownerDocument||t,t,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT,null,!1)},ve=function(t){return!(t instanceof O||t instanceof _)&&!("string"===typeof t.nodeName&&"string"===typeof t.textContent&&"function"===typeof t.removeChild&&t.attributes instanceof l&&"function"===typeof t.removeAttribute&&"function"===typeof t.setAttribute&&"string"===typeof t.namespaceURI&&"function"===typeof t.insertBefore)},he=function(t){return"object"===("undefined"===typeof c?"undefined":q(c))?t instanceof c:t&&"object"===("undefined"===typeof t?"undefined":q(t))&&"number"===typeof t.nodeType&&"string"===typeof t.nodeName},ye=function(t,n,r){dt[t]&&p(dt[t],(function(t){t.call(e,n,r,re)}))},be=function(t){var n=void 0;if(ye("beforeSanitizeElements",t,null),ve(t))return le(t),!0;if(h(t.nodeName,/[\u0080-\uFFFF]/))return le(t),!0;var r=ne(t.nodeName);if(ye("uponSanitizeElement",t,{tagName:r,allowedTags:xt}),!he(t.firstElementChild)&&(!he(t.content)||!he(t.content.firstElementChild))&&w(/<[/\w]/g,t.innerHTML)&&w(/<[/\w]/g,t.textContent))return le(t),!0;if("select"===r&&w(/<template/i,t.innerHTML))return le(t),!0;if(!xt[r]||Tt[r]){if(zt&&!Bt[r]){var o=nt(t)||t.parentNode,i=et(t)||t.childNodes;if(i&&o)for(var a=i.length,c=a-1;c>=0;--c)o.insertBefore(Q(i[c],!0),tt(t))}return le(t),!0}return t instanceof u&&!se(t)?(le(t),!0):"noscript"!==r&&"noembed"!==r||!w(/<\/no(script|embed)/i,t.innerHTML)?(Rt&&3===t.nodeType&&(n=t.textContent,n=y(n,mt," "),n=y(n,vt," "),t.textContent!==n&&(m(e.removed,{element:t.cloneNode()}),t.textContent=n)),ye("afterSanitizeElements",t,null),!1):(le(t),!0)},ge=function(t,e,n){if(Ct&&("id"===e||"name"===e)&&(n in r||n in oe))return!1;if(jt&&!At[e]&&w(ht,e));else if(Et&&w(yt,e));else{if(!_t[e]||At[e])return!1;if(Yt[e]);else if(w(wt,y(n,gt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==b(n,"data:")||!Wt[t]){if(kt&&!w(bt,y(n,gt,"")));else if(n)return!1}else;}return!0},we=function(t){var n=void 0,r=void 0,o=void 0,i=void 0;ye("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_t};i=a.length;while(i--){n=a[i];var u=n,f=u.name,s=u.namespaceURI;if(r=g(n.value),o=ne(f),c.attrName=o,c.attrValue=r,c.keepAttr=!0,c.forceKeepAttr=void 0,ye("uponSanitizeAttribute",t,c),r=c.attrValue,!c.forceKeepAttr&&(pe(f,t),c.keepAttr))if(w(/\/>/i,r))pe(f,t);else{Rt&&(r=y(r,mt," "),r=y(r,vt," "));var l=ne(t.nodeName);if(ge(l,o,r))try{s?t.setAttributeNS(s,f,r):t.setAttribute(f,r),d(e.removed)}catch(Oe){}}}ye("afterSanitizeAttributes",t,null)}},xe=function t(e){var n=void 0,r=me(e);ye("beforeSanitizeShadowDOM",e,null);while(n=r.nextNode())ye("uponSanitizeShadowNode",n,null),be(n)||(n.content instanceof o&&t(n.content),we(n));ye("afterSanitizeShadowDOM",e,null)};return e.sanitize=function(r,i){var a=void 0,u=void 0,f=void 0,s=void 0,l=void 0;if(Jt=!r,Jt&&(r="\x3c!--\x3e"),"string"!==typeof r&&!he(r)){if("function"!==typeof r.toString)throw x("toString is not a function");if(r=r.toString(),"string"!==typeof r)throw x("dirty is not a string, aborting")}if(!e.isSupported){if("object"===q(t.toStaticHTML)||"function"===typeof t.toStaticHTML){if("string"===typeof r)return t.toStaticHTML(r);if(he(r))return t.toStaticHTML(r.outerHTML)}return r}if(Mt||ie(i),e.removed=[],"string"===typeof r&&(Ut=!1),Ut);else if(r instanceof c)a=de("\x3c!----\x3e"),u=a.ownerDocument.importNode(r,!0),1===u.nodeType&&"BODY"===u.nodeName||"HTML"===u.nodeName?a=u:a.appendChild(u);else{if(!Nt&&!Rt&&!Pt&&-1===r.indexOf("<"))return ot&&Ft?ot.createHTML(r):r;if(a=de(r),!a)return Nt?null:it}a&&Dt&&le(a.firstChild);var p=me(Ut?r:a);while(f=p.nextNode())3===f.nodeType&&f===s||be(f)||(f.content instanceof o&&xe(f.content),we(f),s=f);if(s=null,Ut)return r;if(Nt){if(It){l=ft.call(a.ownerDocument);while(a.firstChild)l.appendChild(a.firstChild)}else l=a;return Lt&&(l=lt.call(n,l,!0)),l}var d=Pt?a.outerHTML:a.innerHTML;return Rt&&(d=y(d,mt," "),d=y(d,vt," ")),ot&&Ft?ot.createHTML(d):d},e.setConfig=function(t){ie(t),Mt=!0},e.clearConfig=function(){re=null,Mt=!1},e.isValidAttribute=function(t,e,n){re||ie({});var r=ne(t),o=ne(e);return ge(r,o,n)},e.addHook=function(t,e){"function"===typeof e&&(dt[t]=dt[t]||[],m(dt[t],e))},e.removeHook=function(t){dt[t]&&d(dt[t])},e.removeHooks=function(t){dt[t]&&(dt[t]=[])},e.removeAllHooks=function(){dt={}},e}var X=V();return X}))},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},c6cd:function(t,e,n){var r=n("da84"),o=n("ce4e"),i="__core-js_shared__",a=r[i]||o(i,{});t.exports=a},c8d2:function(t,e,n){var r=n("d039"),o=n("5899"),i="
";t.exports=function(t){return r((function(){return!!o[t]()||i[t]()!=i||o[t].name!==t}))}},ca84:function(t,e,n){var r=n("5135"),o=n("fc6a"),i=n("4d64").indexOf,a=n("d012");t.exports=function(t,e){var n,c=o(t),u=0,f=[];for(n in c)!r(a,n)&&r(c,n)&&f.push(n);while(e.length>u)r(c,n=e[u++])&&(~i(f,n)||f.push(n));return f}},cc12:function(t,e,n){var r=n("da84"),o=n("861d"),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},cca6:function(t,e,n){var r=n("23e7"),o=n("60da");r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},cdf9:function(t,e,n){var r=n("825a"),o=n("861d"),i=n("f069");t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t),a=n.resolve;return a(e),n.promise}},ce4e:function(t,e,n){var r=n("da84");t.exports=function(t,e){try{Object.defineProperty(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var r=n("da84"),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},d1e7:function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},d2bb:function(t,e,n){var r=n("825a"),o=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(i){}return function(n,i){return r(n),o(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},d44e:function(t,e,n){var r=n("9bf2").f,o=n("5135"),i=n("b622"),a=i("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,a)&&r(t,a,{configurable:!0,value:e})}},d4c3:function(t,e,n){var r=n("342f"),o=n("da84");t.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},d9b5:function(t,e,n){var r=n("d066"),o=n("fdbf");t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return"function"==typeof e&&Object(t)instanceof e}},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n("24aa"))},df75:function(t,e,n){var r=n("ca84"),o=n("7839");t.exports=Object.keys||function(t){return r(t,o)}},e163:function(t,e,n){var r=n("5135"),o=n("7b0b"),i=n("f772"),a=n("e177"),c=i("IE_PROTO"),u=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=o(t),r(t,c)?t[c]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},e177:function(t,e,n){var r=n("d039");t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,e,n){"use strict";var r=n("fc6a"),o=n("44d2"),i=n("3f8c"),a=n("69f3"),c=n("7dd0"),u="Array Iterator",f=a.set,s=a.getterFor(u);t.exports=c(Array,"Array",(function(t,e){f(this,{type:u,target:r(t),index:0,kind:e})}),(function(){var t=s(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},e2cc:function(t,e,n){var r=n("6eeb");t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},e667:function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},e6cf:function(t,e,n){"use strict";var r,o,i,a,c=n("23e7"),u=n("c430"),f=n("da84"),s=n("d066"),l=n("fea9"),p=n("6eeb"),d=n("e2cc"),m=n("d2bb"),v=n("d44e"),h=n("2626"),y=n("861d"),b=n("1c0b"),g=n("19aa"),w=n("8925"),x=n("2266"),O=n("1c7e"),_=n("4840"),S=n("2cf4").set,T=n("b575"),A=n("cdf9"),E=n("44de"),j=n("f069"),k=n("e667"),R=n("69f3"),P=n("94ca"),M=n("b622"),D=n("6069"),N=n("605d"),I=n("2d00"),L=M("species"),F="Promise",C=R.get,z=R.set,U=R.getterFor(F),H=l&&l.prototype,B=l,G=H,W=f.TypeError,q=f.document,Y=f.process,$=j.f,K=$,V=!!(q&&q.createEvent&&f.dispatchEvent),X="function"==typeof PromiseRejectionEvent,Z="unhandledrejection",J="rejectionhandled",Q=0,tt=1,et=2,nt=1,rt=2,ot=!1,it=P(F,(function(){var t=w(B),e=t!==String(B);if(!e&&66===I)return!0;if(u&&!G["finally"])return!0;if(I>=51&&/native code/.test(t))return!1;var n=new B((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))},o=n.constructor={};return o[L]=r,ot=n.then((function(){}))instanceof r,!ot||!e&&D&&!X})),at=it||!O((function(t){B.all(t)["catch"]((function(){}))})),ct=function(t){var e;return!(!y(t)||"function"!=typeof(e=t.then))&&e},ut=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;T((function(){var r=t.value,o=t.state==tt,i=0;while(n.length>i){var a,c,u,f=n[i++],s=o?f.ok:f.fail,l=f.resolve,p=f.reject,d=f.domain;try{s?(o||(t.rejection===rt&&pt(t),t.rejection=nt),!0===s?a=r:(d&&d.enter(),a=s(r),d&&(d.exit(),u=!0)),a===f.promise?p(W("Promise-chain cycle")):(c=ct(a))?c.call(a,l,p):l(a)):p(r)}catch(m){d&&!u&&d.exit(),p(m)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&st(t)}))}},ft=function(t,e,n){var r,o;V?(r=q.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),f.dispatchEvent(r)):r={promise:e,reason:n},!X&&(o=f["on"+t])?o(r):t===Z&&E("Unhandled promise rejection",n)},st=function(t){S.call(f,(function(){var e,n=t.facade,r=t.value,o=lt(t);if(o&&(e=k((function(){N?Y.emit("unhandledRejection",r,n):ft(Z,n,r)})),t.rejection=N||lt(t)?rt:nt,e.error))throw e.value}))},lt=function(t){return t.rejection!==nt&&!t.parent},pt=function(t){S.call(f,(function(){var e=t.facade;N?Y.emit("rejectionHandled",e):ft(J,e,t.value)}))},dt=function(t,e,n){return function(r){t(e,r,n)}},mt=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=et,ut(t,!0))},vt=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw W("Promise can't be resolved itself");var r=ct(e);r?T((function(){var n={done:!1};try{r.call(e,dt(vt,n,t),dt(mt,n,t))}catch(o){mt(n,o,t)}})):(t.value=e,t.state=tt,ut(t,!1))}catch(o){mt({done:!1},o,t)}}};if(it&&(B=function(t){g(this,B,F),b(t),r.call(this);var e=C(this);try{t(dt(vt,e),dt(mt,e))}catch(n){mt(e,n)}},G=B.prototype,r=function(t){z(this,{type:F,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:Q,value:void 0})},r.prototype=d(G,{then:function(t,e){var n=U(this),r=$(_(this,B));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=N?Y.domain:void 0,n.parent=!0,n.reactions.push(r),n.state!=Q&&ut(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=C(t);this.promise=t,this.resolve=dt(vt,e),this.reject=dt(mt,e)},j.f=$=function(t){return t===B||t===i?new o(t):K(t)},!u&&"function"==typeof l&&H!==Object.prototype)){a=H.then,ot||(p(H,"then",(function(t,e){var n=this;return new B((function(t,e){a.call(n,t,e)})).then(t,e)}),{unsafe:!0}),p(H,"catch",G["catch"],{unsafe:!0}));try{delete H.constructor}catch(ht){}m&&m(H,G)}c({global:!0,wrap:!0,forced:it},{Promise:B}),v(B,F,!1,!0),h(F),i=s(F),c({target:F,stat:!0,forced:it},{reject:function(t){var e=$(this);return e.reject.call(void 0,t),e.promise}}),c({target:F,stat:!0,forced:u||it},{resolve:function(t){return A(u&&this===i?B:this,t)}}),c({target:F,stat:!0,forced:at},{all:function(t){var e=this,n=$(e),r=n.resolve,o=n.reject,i=k((function(){var n=b(e.resolve),i=[],a=0,c=1;x(t,(function(t){var u=a++,f=!1;i.push(void 0),c++,n.call(e,t).then((function(t){f||(f=!0,i[u]=t,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=$(e),r=n.reject,o=k((function(){var o=b(e.resolve);x(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},e893:function(t,e,n){var r=n("5135"),o=n("56ef"),i=n("06cf"),a=n("9bf2");t.exports=function(t,e){for(var n=o(e),c=a.f,u=i.f,f=0;f<n.length;f++){var s=n[f];r(t,s)||c(t,s,u(e,s))}}},e95a:function(t,e,n){var r=n("b622"),o=n("3f8c"),i=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},f069:function(t,e,n){"use strict";var r=n("1c0b"),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},f5df:function(t,e,n){var r=n("00ee"),o=n("c6b6"),i=n("b622"),a=i("toStringTag"),c="Arguments"==o(function(){return arguments}()),u=function(t,e){try{return t[e]}catch(n){}};t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=u(e=Object(t),a))?n:c?o(e):"Object"==(r=o(e))&&"function"==typeof e.callee?"Arguments":r}},f772:function(t,e,n){var r=n("5692"),o=n("90e3"),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},fc6a:function(t,e,n){var r=n("44ad"),o=n("1d80");t.exports=function(t){return r(o(t))}},fdbf:function(t,e,n){var r=n("4930");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fea9:function(t,e,n){var r=n("da84");t.exports=r.Promise}}); +(function(e,n){t.exports=n()})(0,(function(){"use strict";function t(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}var e=Object.hasOwnProperty,n=Object.setPrototypeOf,r=Object.isFrozen,o=Object.getPrototypeOf,i=Object.getOwnPropertyDescriptor,a=Object.freeze,c=Object.seal,u=Object.create,f="undefined"!==typeof Reflect&&Reflect,s=f.apply,l=f.construct;s||(s=function(t,e,n){return t.apply(e,n)}),a||(a=function(t){return t}),c||(c=function(t){return t}),l||(l=function(e,n){return new(Function.prototype.bind.apply(e,[null].concat(t(n))))});var p=O(Array.prototype.forEach),d=O(Array.prototype.pop),m=O(Array.prototype.push),v=O(String.prototype.toLowerCase),h=O(String.prototype.match),y=O(String.prototype.replace),b=O(String.prototype.indexOf),g=O(String.prototype.trim),w=O(RegExp.prototype.test),x=_(TypeError);function O(t){return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(t,e,r)}}function _(t){return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return l(t,n)}}function S(t,e){n&&n(t,null);var o=e.length;while(o--){var i=e[o];if("string"===typeof i){var a=v(i);a!==i&&(r(e)||(e[o]=a),i=a)}t[i]=!0}return t}function T(t){var n=u(null),r=void 0;for(r in t)s(e,t,[r])&&(n[r]=t[r]);return n}function A(t,e){while(null!==t){var n=i(t,e);if(n){if(n.get)return O(n.get);if("function"===typeof n.value)return O(n.value)}t=o(t)}function r(t){return console.warn("fallback value for",t),null}return r}var E=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),j=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),k=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R=a(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),P=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),M=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),N=a(["#text"]),D=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),I=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),C=c(/\{\{[\s\S]*|[\s\S]*\}\}/gm),z=c(/<%[\s\S]*|[\s\S]*%>/gm),U=c(/^data-[\-\w.\u00B7-\uFFFF]/),H=c(/^aria-[\-\w]+$/),B=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=c(/^(?:\w+script|data):/i),W=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function Y(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}var $=function(){return"undefined"===typeof window?null:window},K=function(t,e){if("object"!==("undefined"===typeof t?"undefined":q(t))||"function"!==typeof t.createPolicy)return null;var n=null,r="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(r)&&(n=e.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:function(t){return t}})}catch(i){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function V(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$(),e=function(t){return V(t)};if(e.version="2.3.3",e.removed=[],!t||!t.document||9!==t.document.nodeType)return e.isSupported=!1,e;var n=t.document,r=t.document,o=t.DocumentFragment,i=t.HTMLTemplateElement,c=t.Node,u=t.Element,f=t.NodeFilter,s=t.NamedNodeMap,l=void 0===s?t.NamedNodeMap||t.MozNamedAttrMap:s,O=t.Text,_=t.Comment,X=t.DOMParser,Z=t.trustedTypes,J=u.prototype,Q=A(J,"cloneNode"),tt=A(J,"nextSibling"),et=A(J,"childNodes"),nt=A(J,"parentNode");if("function"===typeof i){var rt=r.createElement("template");rt.content&&rt.content.ownerDocument&&(r=rt.content.ownerDocument)}var ot=K(Z,n),it=ot&&Ft?ot.createHTML(""):"",at=r,ct=at.implementation,ut=at.createNodeIterator,ft=at.createDocumentFragment,st=at.getElementsByTagName,lt=n.importNode,pt={};try{pt=T(r).documentMode?r.documentMode:{}}catch(Oe){}var dt={};e.isSupported="function"===typeof nt&&ct&&"undefined"!==typeof ct.createHTMLDocument&&9!==pt;var mt=C,vt=z,ht=U,yt=H,bt=G,gt=W,wt=B,xt=null,Ot=S({},[].concat(Y(E),Y(j),Y(k),Y(P),Y(N))),_t=null,St=S({},[].concat(Y(D),Y(I),Y(L),Y(F))),Tt=null,At=null,Et=!0,jt=!0,kt=!1,Rt=!1,Pt=!1,Mt=!1,Nt=!1,Dt=!1,It=!1,Lt=!0,Ft=!1,Ct=!0,zt=!0,Ut=!1,Ht={},Bt=null,Gt=S({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Wt=null,qt=S({},["audio","video","img","source","image","track"]),Yt=null,$t=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",Vt="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml",Zt=Xt,Jt=!1,Qt=void 0,te=["application/xhtml+xml","text/html"],ee="text/html",ne=void 0,re=null,oe=r.createElement("form"),ie=function(t){re&&re===t||(t&&"object"===("undefined"===typeof t?"undefined":q(t))||(t={}),t=T(t),xt="ALLOWED_TAGS"in t?S({},t.ALLOWED_TAGS):Ot,_t="ALLOWED_ATTR"in t?S({},t.ALLOWED_ATTR):St,Yt="ADD_URI_SAFE_ATTR"in t?S(T($t),t.ADD_URI_SAFE_ATTR):$t,Wt="ADD_DATA_URI_TAGS"in t?S(T(qt),t.ADD_DATA_URI_TAGS):qt,Bt="FORBID_CONTENTS"in t?S({},t.FORBID_CONTENTS):Gt,Tt="FORBID_TAGS"in t?S({},t.FORBID_TAGS):{},At="FORBID_ATTR"in t?S({},t.FORBID_ATTR):{},Ht="USE_PROFILES"in t&&t.USE_PROFILES,Et=!1!==t.ALLOW_ARIA_ATTR,jt=!1!==t.ALLOW_DATA_ATTR,kt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=t.SAFE_FOR_TEMPLATES||!1,Pt=t.WHOLE_DOCUMENT||!1,Dt=t.RETURN_DOM||!1,It=t.RETURN_DOM_FRAGMENT||!1,Lt=!1!==t.RETURN_DOM_IMPORT,Ft=t.RETURN_TRUSTED_TYPE||!1,Nt=t.FORCE_BODY||!1,Ct=!1!==t.SANITIZE_DOM,zt=!1!==t.KEEP_CONTENT,Ut=t.IN_PLACE||!1,wt=t.ALLOWED_URI_REGEXP||wt,Zt=t.NAMESPACE||Xt,Qt=Qt=-1===te.indexOf(t.PARSER_MEDIA_TYPE)?ee:t.PARSER_MEDIA_TYPE,ne="application/xhtml+xml"===Qt?function(t){return t}:v,Rt&&(jt=!1),It&&(Dt=!0),Ht&&(xt=S({},[].concat(Y(N))),_t=[],!0===Ht.html&&(S(xt,E),S(_t,D)),!0===Ht.svg&&(S(xt,j),S(_t,I),S(_t,F)),!0===Ht.svgFilters&&(S(xt,k),S(_t,I),S(_t,F)),!0===Ht.mathMl&&(S(xt,P),S(_t,L),S(_t,F))),t.ADD_TAGS&&(xt===Ot&&(xt=T(xt)),S(xt,t.ADD_TAGS)),t.ADD_ATTR&&(_t===St&&(_t=T(_t)),S(_t,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&S(Yt,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(Bt===Gt&&(Bt=T(Bt)),S(Bt,t.FORBID_CONTENTS)),zt&&(xt["#text"]=!0),Pt&&S(xt,["html","head","body"]),xt.table&&(S(xt,["tbody"]),delete Tt.tbody),a&&a(t),re=t)},ae=S({},["mi","mo","mn","ms","mtext"]),ce=S({},["foreignobject","desc","title","annotation-xml"]),ue=S({},j);S(ue,k),S(ue,R);var fe=S({},P);S(fe,M);var se=function(t){var e=nt(t);e&&e.tagName||(e={namespaceURI:Xt,tagName:"template"});var n=v(t.tagName),r=v(e.tagName);if(t.namespaceURI===Vt)return e.namespaceURI===Xt?"svg"===n:e.namespaceURI===Kt?"svg"===n&&("annotation-xml"===r||ae[r]):Boolean(ue[n]);if(t.namespaceURI===Kt)return e.namespaceURI===Xt?"math"===n:e.namespaceURI===Vt?"math"===n&&ce[r]:Boolean(fe[n]);if(t.namespaceURI===Xt){if(e.namespaceURI===Vt&&!ce[r])return!1;if(e.namespaceURI===Kt&&!ae[r])return!1;var o=S({},["title","style","font","a","script"]);return!fe[n]&&(o[n]||!ue[n])}return!1},le=function(t){m(e.removed,{element:t});try{t.parentNode.removeChild(t)}catch(Oe){try{t.outerHTML=it}catch(Oe){t.remove()}}},pe=function(t,n){try{m(e.removed,{attribute:n.getAttributeNode(t),from:n})}catch(Oe){m(e.removed,{attribute:null,from:n})}if(n.removeAttribute(t),"is"===t&&!_t[t])if(Dt||It)try{le(n)}catch(Oe){}else try{n.setAttribute(t,"")}catch(Oe){}},de=function(t){var e=void 0,n=void 0;if(Nt)t="<remove></remove>"+t;else{var o=h(t,/^[\r\n\t ]+/);n=o&&o[0]}"application/xhtml+xml"===Qt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var i=ot?ot.createHTML(t):t;if(Zt===Xt)try{e=(new X).parseFromString(i,Qt)}catch(Oe){}if(!e||!e.documentElement){e=ct.createDocument(Zt,"template",null);try{e.documentElement.innerHTML=Jt?"":i}catch(Oe){}}var a=e.body||e.documentElement;return t&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),Zt===Xt?st.call(e,Pt?"html":"body")[0]:Pt?e.documentElement:a},me=function(t){return ut.call(t.ownerDocument||t,t,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT,null,!1)},ve=function(t){return!(t instanceof O||t instanceof _)&&!("string"===typeof t.nodeName&&"string"===typeof t.textContent&&"function"===typeof t.removeChild&&t.attributes instanceof l&&"function"===typeof t.removeAttribute&&"function"===typeof t.setAttribute&&"string"===typeof t.namespaceURI&&"function"===typeof t.insertBefore)},he=function(t){return"object"===("undefined"===typeof c?"undefined":q(c))?t instanceof c:t&&"object"===("undefined"===typeof t?"undefined":q(t))&&"number"===typeof t.nodeType&&"string"===typeof t.nodeName},ye=function(t,n,r){dt[t]&&p(dt[t],(function(t){t.call(e,n,r,re)}))},be=function(t){var n=void 0;if(ye("beforeSanitizeElements",t,null),ve(t))return le(t),!0;if(h(t.nodeName,/[\u0080-\uFFFF]/))return le(t),!0;var r=ne(t.nodeName);if(ye("uponSanitizeElement",t,{tagName:r,allowedTags:xt}),!he(t.firstElementChild)&&(!he(t.content)||!he(t.content.firstElementChild))&&w(/<[/\w]/g,t.innerHTML)&&w(/<[/\w]/g,t.textContent))return le(t),!0;if("select"===r&&w(/<template/i,t.innerHTML))return le(t),!0;if(!xt[r]||Tt[r]){if(zt&&!Bt[r]){var o=nt(t)||t.parentNode,i=et(t)||t.childNodes;if(i&&o)for(var a=i.length,c=a-1;c>=0;--c)o.insertBefore(Q(i[c],!0),tt(t))}return le(t),!0}return t instanceof u&&!se(t)?(le(t),!0):"noscript"!==r&&"noembed"!==r||!w(/<\/no(script|embed)/i,t.innerHTML)?(Rt&&3===t.nodeType&&(n=t.textContent,n=y(n,mt," "),n=y(n,vt," "),t.textContent!==n&&(m(e.removed,{element:t.cloneNode()}),t.textContent=n)),ye("afterSanitizeElements",t,null),!1):(le(t),!0)},ge=function(t,e,n){if(Ct&&("id"===e||"name"===e)&&(n in r||n in oe))return!1;if(jt&&!At[e]&&w(ht,e));else if(Et&&w(yt,e));else{if(!_t[e]||At[e])return!1;if(Yt[e]);else if(w(wt,y(n,gt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==b(n,"data:")||!Wt[t]){if(kt&&!w(bt,y(n,gt,"")));else if(n)return!1}else;}return!0},we=function(t){var n=void 0,r=void 0,o=void 0,i=void 0;ye("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_t};i=a.length;while(i--){n=a[i];var u=n,f=u.name,s=u.namespaceURI;if(r=g(n.value),o=ne(f),c.attrName=o,c.attrValue=r,c.keepAttr=!0,c.forceKeepAttr=void 0,ye("uponSanitizeAttribute",t,c),r=c.attrValue,!c.forceKeepAttr&&(pe(f,t),c.keepAttr))if(w(/\/>/i,r))pe(f,t);else{Rt&&(r=y(r,mt," "),r=y(r,vt," "));var l=ne(t.nodeName);if(ge(l,o,r))try{s?t.setAttributeNS(s,f,r):t.setAttribute(f,r),d(e.removed)}catch(Oe){}}}ye("afterSanitizeAttributes",t,null)}},xe=function t(e){var n=void 0,r=me(e);ye("beforeSanitizeShadowDOM",e,null);while(n=r.nextNode())ye("uponSanitizeShadowNode",n,null),be(n)||(n.content instanceof o&&t(n.content),we(n));ye("afterSanitizeShadowDOM",e,null)};return e.sanitize=function(r,i){var a=void 0,u=void 0,f=void 0,s=void 0,l=void 0;if(Jt=!r,Jt&&(r="\x3c!--\x3e"),"string"!==typeof r&&!he(r)){if("function"!==typeof r.toString)throw x("toString is not a function");if(r=r.toString(),"string"!==typeof r)throw x("dirty is not a string, aborting")}if(!e.isSupported){if("object"===q(t.toStaticHTML)||"function"===typeof t.toStaticHTML){if("string"===typeof r)return t.toStaticHTML(r);if(he(r))return t.toStaticHTML(r.outerHTML)}return r}if(Mt||ie(i),e.removed=[],"string"===typeof r&&(Ut=!1),Ut);else if(r instanceof c)a=de("\x3c!----\x3e"),u=a.ownerDocument.importNode(r,!0),1===u.nodeType&&"BODY"===u.nodeName||"HTML"===u.nodeName?a=u:a.appendChild(u);else{if(!Dt&&!Rt&&!Pt&&-1===r.indexOf("<"))return ot&&Ft?ot.createHTML(r):r;if(a=de(r),!a)return Dt?null:it}a&&Nt&&le(a.firstChild);var p=me(Ut?r:a);while(f=p.nextNode())3===f.nodeType&&f===s||be(f)||(f.content instanceof o&&xe(f.content),we(f),s=f);if(s=null,Ut)return r;if(Dt){if(It){l=ft.call(a.ownerDocument);while(a.firstChild)l.appendChild(a.firstChild)}else l=a;return Lt&&(l=lt.call(n,l,!0)),l}var d=Pt?a.outerHTML:a.innerHTML;return Rt&&(d=y(d,mt," "),d=y(d,vt," ")),ot&&Ft?ot.createHTML(d):d},e.setConfig=function(t){ie(t),Mt=!0},e.clearConfig=function(){re=null,Mt=!1},e.isValidAttribute=function(t,e,n){re||ie({});var r=ne(t),o=ne(e);return ge(r,o,n)},e.addHook=function(t,e){"function"===typeof e&&(dt[t]=dt[t]||[],m(dt[t],e))},e.removeHook=function(t){dt[t]&&d(dt[t])},e.removeHooks=function(t){dt[t]&&(dt[t]=[])},e.removeAllHooks=function(){dt={}},e}var X=V();return X}))},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},c6cd:function(t,e,n){var r=n("da84"),o=n("ce4e"),i="__core-js_shared__",a=r[i]||o(i,{});t.exports=a},c8d2:function(t,e,n){var r=n("d039"),o=n("5899"),i="
";t.exports=function(t){return r((function(){return!!o[t]()||i[t]()!=i||o[t].name!==t}))}},ca84:function(t,e,n){var r=n("5135"),o=n("fc6a"),i=n("4d64").indexOf,a=n("d012");t.exports=function(t,e){var n,c=o(t),u=0,f=[];for(n in c)!r(a,n)&&r(c,n)&&f.push(n);while(e.length>u)r(c,n=e[u++])&&(~i(f,n)||f.push(n));return f}},cc12:function(t,e,n){var r=n("da84"),o=n("861d"),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},cca6:function(t,e,n){var r=n("23e7"),o=n("60da");r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},cdf9:function(t,e,n){var r=n("825a"),o=n("861d"),i=n("f069");t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t),a=n.resolve;return a(e),n.promise}},ce4e:function(t,e,n){var r=n("da84");t.exports=function(t,e){try{Object.defineProperty(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var r=n("da84"),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},d1e7:function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},d2bb:function(t,e,n){var r=n("825a"),o=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(i){}return function(n,i){return r(n),o(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},d44e:function(t,e,n){var r=n("9bf2").f,o=n("5135"),i=n("b622"),a=i("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,a)&&r(t,a,{configurable:!0,value:e})}},d4c3:function(t,e,n){var r=n("342f"),o=n("da84");t.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},d9b5:function(t,e,n){var r=n("d066"),o=n("fdbf");t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return"function"==typeof e&&Object(t)instanceof e}},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n("24aa"))},df75:function(t,e,n){var r=n("ca84"),o=n("7839");t.exports=Object.keys||function(t){return r(t,o)}},e163:function(t,e,n){var r=n("5135"),o=n("7b0b"),i=n("f772"),a=n("e177"),c=i("IE_PROTO"),u=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=o(t),r(t,c)?t[c]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},e177:function(t,e,n){var r=n("d039");t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,e,n){"use strict";var r=n("fc6a"),o=n("44d2"),i=n("3f8c"),a=n("69f3"),c=n("7dd0"),u="Array Iterator",f=a.set,s=a.getterFor(u);t.exports=c(Array,"Array",(function(t,e){f(this,{type:u,target:r(t),index:0,kind:e})}),(function(){var t=s(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},e2cc:function(t,e,n){var r=n("6eeb");t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},e667:function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},e6cf:function(t,e,n){"use strict";var r,o,i,a,c=n("23e7"),u=n("c430"),f=n("da84"),s=n("d066"),l=n("fea9"),p=n("6eeb"),d=n("e2cc"),m=n("d2bb"),v=n("d44e"),h=n("2626"),y=n("861d"),b=n("1c0b"),g=n("19aa"),w=n("8925"),x=n("2266"),O=n("1c7e"),_=n("4840"),S=n("2cf4").set,T=n("b575"),A=n("cdf9"),E=n("44de"),j=n("f069"),k=n("e667"),R=n("69f3"),P=n("94ca"),M=n("b622"),N=n("6069"),D=n("605d"),I=n("2d00"),L=M("species"),F="Promise",C=R.get,z=R.set,U=R.getterFor(F),H=l&&l.prototype,B=l,G=H,W=f.TypeError,q=f.document,Y=f.process,$=j.f,K=$,V=!!(q&&q.createEvent&&f.dispatchEvent),X="function"==typeof PromiseRejectionEvent,Z="unhandledrejection",J="rejectionhandled",Q=0,tt=1,et=2,nt=1,rt=2,ot=!1,it=P(F,(function(){var t=w(B),e=t!==String(B);if(!e&&66===I)return!0;if(u&&!G["finally"])return!0;if(I>=51&&/native code/.test(t))return!1;var n=new B((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))},o=n.constructor={};return o[L]=r,ot=n.then((function(){}))instanceof r,!ot||!e&&N&&!X})),at=it||!O((function(t){B.all(t)["catch"]((function(){}))})),ct=function(t){var e;return!(!y(t)||"function"!=typeof(e=t.then))&&e},ut=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;T((function(){var r=t.value,o=t.state==tt,i=0;while(n.length>i){var a,c,u,f=n[i++],s=o?f.ok:f.fail,l=f.resolve,p=f.reject,d=f.domain;try{s?(o||(t.rejection===rt&&pt(t),t.rejection=nt),!0===s?a=r:(d&&d.enter(),a=s(r),d&&(d.exit(),u=!0)),a===f.promise?p(W("Promise-chain cycle")):(c=ct(a))?c.call(a,l,p):l(a)):p(r)}catch(m){d&&!u&&d.exit(),p(m)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&st(t)}))}},ft=function(t,e,n){var r,o;V?(r=q.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),f.dispatchEvent(r)):r={promise:e,reason:n},!X&&(o=f["on"+t])?o(r):t===Z&&E("Unhandled promise rejection",n)},st=function(t){S.call(f,(function(){var e,n=t.facade,r=t.value,o=lt(t);if(o&&(e=k((function(){D?Y.emit("unhandledRejection",r,n):ft(Z,n,r)})),t.rejection=D||lt(t)?rt:nt,e.error))throw e.value}))},lt=function(t){return t.rejection!==nt&&!t.parent},pt=function(t){S.call(f,(function(){var e=t.facade;D?Y.emit("rejectionHandled",e):ft(J,e,t.value)}))},dt=function(t,e,n){return function(r){t(e,r,n)}},mt=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=et,ut(t,!0))},vt=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw W("Promise can't be resolved itself");var r=ct(e);r?T((function(){var n={done:!1};try{r.call(e,dt(vt,n,t),dt(mt,n,t))}catch(o){mt(n,o,t)}})):(t.value=e,t.state=tt,ut(t,!1))}catch(o){mt({done:!1},o,t)}}};if(it&&(B=function(t){g(this,B,F),b(t),r.call(this);var e=C(this);try{t(dt(vt,e),dt(mt,e))}catch(n){mt(e,n)}},G=B.prototype,r=function(t){z(this,{type:F,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:Q,value:void 0})},r.prototype=d(G,{then:function(t,e){var n=U(this),r=$(_(this,B));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=D?Y.domain:void 0,n.parent=!0,n.reactions.push(r),n.state!=Q&&ut(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=C(t);this.promise=t,this.resolve=dt(vt,e),this.reject=dt(mt,e)},j.f=$=function(t){return t===B||t===i?new o(t):K(t)},!u&&"function"==typeof l&&H!==Object.prototype)){a=H.then,ot||(p(H,"then",(function(t,e){var n=this;return new B((function(t,e){a.call(n,t,e)})).then(t,e)}),{unsafe:!0}),p(H,"catch",G["catch"],{unsafe:!0}));try{delete H.constructor}catch(ht){}m&&m(H,G)}c({global:!0,wrap:!0,forced:it},{Promise:B}),v(B,F,!1,!0),h(F),i=s(F),c({target:F,stat:!0,forced:it},{reject:function(t){var e=$(this);return e.reject.call(void 0,t),e.promise}}),c({target:F,stat:!0,forced:u||it},{resolve:function(t){return A(u&&this===i?B:this,t)}}),c({target:F,stat:!0,forced:at},{all:function(t){var e=this,n=$(e),r=n.resolve,o=n.reject,i=k((function(){var n=b(e.resolve),i=[],a=0,c=1;x(t,(function(t){var u=a++,f=!1;i.push(void 0),c++,n.call(e,t).then((function(t){f||(f=!0,i[u]=t,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=$(e),r=n.reject,o=k((function(){var o=b(e.resolve);x(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},e893:function(t,e,n){var r=n("5135"),o=n("56ef"),i=n("06cf"),a=n("9bf2");t.exports=function(t,e){for(var n=o(e),c=a.f,u=i.f,f=0;f<n.length;f++){var s=n[f];r(t,s)||c(t,s,u(e,s))}}},e95a:function(t,e,n){var r=n("b622"),o=n("3f8c"),i=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},f069:function(t,e,n){"use strict";var r=n("1c0b"),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},f5df:function(t,e,n){var r=n("00ee"),o=n("c6b6"),i=n("b622"),a=i("toStringTag"),c="Arguments"==o(function(){return arguments}()),u=function(t,e){try{return t[e]}catch(n){}};t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=u(e=Object(t),a))?n:c?o(e):"Object"==(r=o(e))&&"function"==typeof e.callee?"Arguments":r}},f772:function(t,e,n){var r=n("5692"),o=n("90e3"),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},fc6a:function(t,e,n){var r=n("44ad"),o=n("1d80");t.exports=function(t){return r(o(t))}},fdbf:function(t,e,n){var r=n("4930");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fea9:function(t,e,n){var r=n("da84");t.exports=r.Promise}}); //# sourceMappingURL=MatomoPolyfills.min.js.map
\ No newline at end of file diff --git a/plugins/CoreVue/polyfills/src/jqueryNativeEventTrigger.ts b/plugins/CoreVue/polyfills/src/jqueryNativeEventTrigger.ts index 09057159d7..d165e7d75f 100644 --- a/plugins/CoreVue/polyfills/src/jqueryNativeEventTrigger.ts +++ b/plugins/CoreVue/polyfills/src/jqueryNativeEventTrigger.ts @@ -8,17 +8,27 @@ const oldTrigger = window.$.fn.trigger; function triggerWithNativeEventDispatch(jqEventOrType, data) { - function nativeDispatch(element: HTMLElement) { - const type = jqEventOrType.type || jqEventOrType; - const onEventAttributeName = `on${type}`; - - if (element[onEventAttributeName] - || element[type] instanceof Function - ) { - // if a on... (eg, onchange) handler is specified, it will be triggered by jquery. - // it will also be triggered by addEventListener, and we don't want that so just - // assume there is no addEventListener event. - return; + let isFirstElementOnPath = true; + + const type = jqEventOrType.type || jqEventOrType; + const onEventAttributeName = `on${type}`; + + function nativeDispatchSingleElement(element: HTMLElement) { + if (isFirstElementOnPath) { + isFirstElementOnPath = false; + + if (element[onEventAttributeName] + || (element[type] instanceof Function + // jquery disables calling the native click() method for links + && !(type === 'click' && element.tagName.toUpperCase() === 'A')) + ) { + // if a on... (eg, onchange) handler is specified, it will be triggered by jquery. + // it will also be triggered by addEventListener, and we don't want that so just + // assume there is no addEventListener event. + // NOTE: this only happens for the FIRST element on the event path. jquery's trigger + // function will not call .click() on any other element in the event path. + return; + } } // eslint-disable-next-line @@ -35,6 +45,10 @@ function triggerWithNativeEventDispatch(jqEventOrType, data) { }); element.dispatchEvent(event); } + } + + function nativeDispatch(element: HTMLElement) { + nativeDispatchSingleElement(element); const parent = element.parentElement; if (parent) { @@ -43,6 +57,10 @@ function triggerWithNativeEventDispatch(jqEventOrType, data) { } const result = oldTrigger.call(this, jqEventOrType, data); + if (type === 'focus' || type === 'blur') { // jquery handles focus/blur fine + return result; + } + this.each(function onEach() { nativeDispatch(this); }); diff --git a/plugins/CoreVue/types/index.d.ts b/plugins/CoreVue/types/index.d.ts index a8a3dda00c..3b822f9b39 100644 --- a/plugins/CoreVue/types/index.d.ts +++ b/plugins/CoreVue/types/index.d.ts @@ -134,6 +134,13 @@ declare global { let piwik: PiwikGlobal; + interface WidgetsHelper { + availableWidgets: unknown[]; + getAvailableWidgets(): unknown[]; + } + + let widgetsHelper: WidgetsHelper; + interface Window { angular: IAngularStatic; globalAjaxQueue: GlobalAjaxQueue; @@ -143,6 +150,7 @@ declare global { hasBlockedContent: boolean; piwik_translations: {[key: string]: string}; Materialize: M; + widgetsHelper: WidgetsHelper; _pk_translate(translationStringId: string, values: string[]): string; require(p: string): any; diff --git a/plugins/Dashboard/tests/UI/DashboardManager_spec.js b/plugins/Dashboard/tests/UI/DashboardManager_spec.js index d4be12b265..4fc6b9d64a 100644 --- a/plugins/Dashboard/tests/UI/DashboardManager_spec.js +++ b/plugins/Dashboard/tests/UI/DashboardManager_spec.js @@ -111,4 +111,4 @@ describe("DashboardManager", function () { expect(await page.screenshot({ fullPage: true })).to.matchImage('removed'); }); -});
\ No newline at end of file +}); diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png index 50abd73c78..8375170b64 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b0b4fddfece501d072fd0fccea9dfafa0994f77f4025c85a57932352217fa5be -size 481675 +oid sha256:1597684be6b7ae1dbad4a5cc381f2a742a4e19ad45626a439344fc7b60f1871e +size 475301 diff --git a/plugins/PagePerformance/tests/UI/PagePerformance_spec.js b/plugins/PagePerformance/tests/UI/PagePerformance_spec.js index ad41d70e7b..259866e889 100644 --- a/plugins/PagePerformance/tests/UI/PagePerformance_spec.js +++ b/plugins/PagePerformance/tests/UI/PagePerformance_spec.js @@ -24,7 +24,7 @@ describe("PagePerformance", function () { it("should load page performance overview", async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=PagePerformance_Performance"); - await page.waitForSelector('.theWidgetContent'); + await page.waitForSelector('.piwik-graph'); pageWrap = await page.$('.pageWrap'); expect(await pageWrap.screenshot()).to.matchImage('load'); }); diff --git a/plugins/SitesManager/tests/UI/SitesManager_spec.js b/plugins/SitesManager/tests/UI/SitesManager_spec.js index da2c0c211c..6ae5979163 100644 --- a/plugins/SitesManager/tests/UI/SitesManager_spec.js +++ b/plugins/SitesManager/tests/UI/SitesManager_spec.js @@ -13,12 +13,14 @@ describe("SitesManager", function () { var url = "?module=SitesManager&action=index&idSite=1&period=day&date=yesterday&showaddsite=false"; - async function assertScreenshotEquals(screenshotName, test) + async function assertScreenshotEquals(screenshotName, test, selectorToWaitFor = ".enrichedHeadline:contains(Manage Measurables)") { await test(); await page.waitForNetworkIdle(); const pageWrap = await page.$('#content'); - await page.waitFor(() => !!$('.enrichedHeadline:contains("Manage Measurables")').length); + await page.waitForFunction((s) => { + return !!$(s).length; + }, {}, selectorToWaitFor); expect(await pageWrap.screenshot()).to.matchImage(screenshotName); } @@ -86,7 +88,7 @@ describe("SitesManager", function () { await page.evaluate(function () { $('.form-help:contains(UTC time is)').hide(); }); - }); + }, "h2:contains(Global websites settings)"); }); it("should be able to open and edit a site directly based on url parameter", async function() { diff --git a/plugins/TestRunner/Commands/SyncScreenshots.php b/plugins/TestRunner/Commands/SyncScreenshots.php index ac749d73fd..237decdd82 100644 --- a/plugins/TestRunner/Commands/SyncScreenshots.php +++ b/plugins/TestRunner/Commands/SyncScreenshots.php @@ -50,8 +50,8 @@ class SyncScreenshots extends ConsoleCommand $this->setDescription('For Piwik core devs. Copies screenshots ' . 'from travis artifacts to the tests/UI/expected-screenshots/ folder'); $this->addArgument('buildnumber', InputArgument::REQUIRED, 'Travis build number you want to sync.'); - $this->addArgument('screenshotsRegex', InputArgument::OPTIONAL, - 'A regex to use when selecting screenshots to copy. If not supplied all screenshots are copied.', '.*'); + $this->addArgument('screenshotsRegex', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, + 'A regex to use when selecting screenshots to copy. If not supplied all screenshots are copied.', ['.*']); $this->addOption('repository', 'r', InputOption::VALUE_OPTIONAL, 'Repository name you want to sync screenshots for.', 'matomo-org/matomo'); $this->addOption('http-user', '', InputOption::VALUE_OPTIONAL, 'the HTTP AUTH username (for premium plugins where artifacts are protected)'); $this->addOption('http-password', '', InputOption::VALUE_OPTIONAL, 'the HTTP AUTH password (for premium plugins where artifacts are protected)'); @@ -69,9 +69,12 @@ class SyncScreenshots extends ConsoleCommand $this->logger->notice('Downloading {number} screenshots', array('number' => count($screenshots))); foreach ($screenshots as $name => $url) { - if (preg_match('/' . $screenshotsRegex . '/', $name)) { - $this->logger->info('Downloading {name}', array('name' => $name)); - $this->downloadScreenshot($url, $repository, $name, $httpUser, $httpPassword); + foreach ($screenshotsRegex as $regex) { + if (preg_match('/' . $regex . '/', $name)) { + $this->logger->info('Downloading {name}', array('name' => $name)); + $this->downloadScreenshot($url, $repository, $name, $httpUser, $httpPassword); + break; + } } } diff --git a/plugins/UsersManager/tests/UI/UserSettings_spec.js b/plugins/UsersManager/tests/UI/UserSettings_spec.js index 20480988ec..ffc0eb2e2b 100644 --- a/plugins/UsersManager/tests/UI/UserSettings_spec.js +++ b/plugins/UsersManager/tests/UI/UserSettings_spec.js @@ -75,6 +75,7 @@ describe("UserSettings", function () { await page.evaluate(function () { $('#userSettingsTable input#email').val('testlogin123@example.com').change(); }); + await page.waitForTimeout(100); await page.click('#userSettingsTable [piwik-save-button] .btn'); await page.waitForTimeout(500); // wait for animation @@ -91,4 +92,4 @@ describe("UserSettings", function () { let pageWrap = await page.$('#notificationContainer'); expect(await pageWrap.screenshot()).to.matchImage('wrong_password_confirmed'); }); -});
\ No newline at end of file +}); diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_load.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_load.png index e2994a392a..dd85882018 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_load.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_load.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c7ce1577c5c0d8d5f933ba703ae7d9d4276aac71d26f000014655ba5da20128e -size 107855 +oid sha256:ef307406aedeeea5fdcc18c3ce79b07f6e1f630f8ac27c06a98906d3f3dc6160 +size 106425 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_deselected.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_deselected.png index 1892857dda..9fcdbf9250 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_deselected.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_deselected.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0dba6de897f4f539af9534383c2a871a43510931153e4a914e809ee5d74fa37c -size 174066 +oid sha256:763ad9348883e7ce3835c886ffcf3123662e2556d225b9fc1b8db4cd5a458aa2 +size 171438 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_in_search.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_in_search.png index 87e98e8e60..f8cde47b2f 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_in_search.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_in_search.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b33f4769a4aab3a4e0e7c756b463ae0e93a33db49370bf8f846eff33c19d3018 -size 174663 +oid sha256:d13c5092a3e62d278c2acec21d694e15276fd9236a95f0bad03cc9878810d9ad +size 172052 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_selected.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_selected.png index 1892857dda..9fcdbf9250 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_selected.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_selected.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0dba6de897f4f539af9534383c2a871a43510931153e4a914e809ee5d74fa37c -size 174066 +oid sha256:763ad9348883e7ce3835c886ffcf3123662e2556d225b9fc1b8db4cd5a458aa2 +size 171438 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_remove_access.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_remove_access.png index 2e69d4561f..95d6f354ab 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_remove_access.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_remove_access.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b41325f4ffdbe249d79c3fec31a7515e493f0bd13b4298020ab2528cff677fb2 -size 162260 +oid sha256:69a5c5b50b2a7b51e03a5bcf8259a3f079136d14ce0a12925125511a75fc818f +size 162842 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access.png index 5cca5d9f8f..d17af75b3a 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a8551fbe7ab890b6ff5eec612a366bc0119a71a2577ca93eed95bd7362525aa7 -size 152718 +oid sha256:1f875e690ebfbbec8fe1c971412721dd1b16bd3a02b2adc6b3936506776338cc +size 153294 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access_confirm.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access_confirm.png index 9b3b90470b..12d610f69d 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access_confirm.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access_confirm.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7f2bc38c19d5424d61e034a7072e52318cf1f8691faa1d2788ecd9b0478863cc -size 9023 +oid sha256:a304bb1bf2f8986559bf838d0c62fd360e714d1cb7cbb74cc3734423ae768d39 +size 9498 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_bulk_access.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_bulk_access.png index 08f816e818..4a9814a99a 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_bulk_access.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_bulk_access.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9adb23a017f985eda23aea3d56995425323ea471289d9feaa0076c9c3ca01fea -size 147030 +oid sha256:a1aa996985875ac9f719aee357dc439a1e5beeb72f7be779fd327a197af02de8 +size 147591 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_single.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_single.png index 2b104efe29..057b1813ac 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_single.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_single.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:48d6513ad172924794a2953ff8cc09fe085caa59e7ec41479e4827c1c72d74c6 -size 147712 +oid sha256:c66e2f4b376fbcbe96241179dce176e10273c70302306c1ae44030b96fe25e1d +size 148204 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_manage_users_back.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_manage_users_back.png index bea2eb3273..37abff71fd 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_manage_users_back.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_manage_users_back.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae404313c6fac2ec50d8029564204b86471516ced99f29a865794f463ba4e7be -size 158794 +oid sha256:056b637034bd252fbe286885ed9eeeb9b7b1875f0950de1a4f734ce4d0462575 +size 158181 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_previous.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_previous.png index 8937189e2b..18f5f4462c 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_previous.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_previous.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c0a0768353e642106a7a56c374e964a4c3cd7a5057968fa427ecbc762adb442b -size 147988 +oid sha256:b97540f25c04a133cb10dcc058b7fc1e4a038ee1b319b082615f23545019bbed +size 148552 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_role_for.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_role_for.png index 88f9582ac5..03c60e0fbb 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_role_for.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_role_for.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f96f77641023594f08cbda089256472c4b32de13580d6b4a837bd6375a53a3eb -size 159653 +oid sha256:5110165e05355bc989dad0e06739b37b5c630582403031855ed5300ca90ff3db +size 157072 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_rows_selected.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_rows_selected.png index 2c6a18293d..1ae87ef19f 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_rows_selected.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_rows_selected.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c49f99ceb41ccd165905c62c61561e65683bdaa83900844b53dc29ed07eefe17 -size 161419 +oid sha256:ffc8054f46701ef58b6b3a8cf4195076dbb956d5ddd3a49d70db53553c69eca5 +size 158800 diff --git a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png index 212214bf1e..8ed9efad02 100644 --- a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png +++ b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:92d30918a85e6ecfb5c099792d4eb247ae93bdf2d5a17eb093cf5c51c9d81da3 -size 377439 +oid sha256:d05b7fda313296b799b9b91e76b2bd618dc0bd1ab765723c638185a39a579a72 +size 377467 diff --git a/tests/UI/expected-screenshots/Menus_admin_loaded.png b/tests/UI/expected-screenshots/Menus_admin_loaded.png index 13b0c6635d..ae78ec6194 100644 --- a/tests/UI/expected-screenshots/Menus_admin_loaded.png +++ b/tests/UI/expected-screenshots/Menus_admin_loaded.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:99d83435f81a0d63949e62f88426b529ed4f54ef71eef5accb69ea1b93ac7232 -size 17009 +oid sha256:d1bc3867d70c7c9bbbaa86185c311837c7b3a216bfd01300e8e4d6911ce0cb32 +size 17289 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png index 590660f40b..be9a4550f7 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b62060436c927dd0ce56a5773cbe172b77fa603953c5f98af28133ad33799e09 -size 1099886 +oid sha256:0cfafd53863ecc53dd3d67c51ff75fafd599bddd9e2e4f9b1766133120fea8b1 +size 1099782 diff --git a/tests/UI/specs/Comparison_spec.js b/tests/UI/specs/Comparison_spec.js index 06bbcc168b..ef2989f3f7 100644 --- a/tests/UI/specs/Comparison_spec.js +++ b/tests/UI/specs/Comparison_spec.js @@ -65,7 +65,7 @@ describe("Comparison", function () { }); it('should not show comparisons for pages that do not support it', async () => { - await (await page.jQuery('li.menuTab:contains(Behaviour)')).click(); + await (await page.jQuery('li.menuTab:contains(Behaviour) > a')).click(); await page.waitForTimeout(100); await (await page.jQuery('a.item:contains(Transitions)')).click(); await page.waitForNetworkIdle(); @@ -75,7 +75,7 @@ describe("Comparison", function () { }); it('should show extra serieses when comparing in evolution graphs and sparklines', async () => { - await (await page.jQuery('li.menuTab:contains(Visitors)')).click(); + await (await page.jQuery('li.menuTab:contains(Visitors) > a')).click(); await page.waitForTimeout(100); await (await page.jQuery('li.menuTab:contains(Visitors) a.item:contains(Overview)')).click(); await page.waitForNetworkIdle(); diff --git a/tests/UI/specs/Menus_spec.js b/tests/UI/specs/Menus_spec.js index a065e5d9b1..152c994c56 100644 --- a/tests/UI/specs/Menus_spec.js +++ b/tests/UI/specs/Menus_spec.js @@ -16,6 +16,7 @@ describe("Menus", function () { async function openMenuItem(page, menuItem) { const element = await page.jQuery('#secondNavBar .navbar a:contains(' + menuItem + '):first'); await element.click(); + await page.waitForTimeout(250); } // main menu tests diff --git a/vue.config.js b/vue.config.js index 325655fe5a..cfeb38db68 100644 --- a/vue.config.js +++ b/vue.config.js @@ -71,7 +71,9 @@ module.exports = { } if (pluginExternals[request]) { - if (detectedDependentPlugins.indexOf(request) === -1) { + if (detectedDependentPlugins.indexOf(request) === -1 + && request !== process.env.MATOMO_CURRENT_PLUGIN + ) { detectedDependentPlugins.push(request); } callback(null, pluginExternals[request]); |